esoftplay-event 0.0.0-a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/config.json +11 -0
  2. package/event/additional.tsx +188 -0
  3. package/event/additional_input.tsx +316 -0
  4. package/event/block_invitation.tsx +48 -0
  5. package/event/countdown.tsx +72 -0
  6. package/event/counter_cashier.tsx +180 -0
  7. package/event/counter_cashier_report.tsx +114 -0
  8. package/event/counter_cashier_sell.tsx +135 -0
  9. package/event/counter_eo.tsx +451 -0
  10. package/event/counter_history.tsx +74 -0
  11. package/event/counter_history_item.tsx +48 -0
  12. package/event/counter_info.tsx +96 -0
  13. package/event/counter_lm.tsx +273 -0
  14. package/event/counter_menu.tsx +85 -0
  15. package/event/counter_report.tsx +105 -0
  16. package/event/counter_report_breakdown.tsx +93 -0
  17. package/event/counter_report_detail.tsx +238 -0
  18. package/event/counter_report_detail_list.tsx +56 -0
  19. package/event/counter_request.tsx +136 -0
  20. package/event/counter_request_detail.tsx +211 -0
  21. package/event/counter_section.tsx +32 -0
  22. package/event/counter_send.tsx +277 -0
  23. package/event/counter_status.tsx +32 -0
  24. package/event/counter_type.tsx +23 -0
  25. package/event/counter_user_list.tsx +197 -0
  26. package/event/counter_user_list_item.tsx +143 -0
  27. package/event/coupon.tsx +124 -0
  28. package/event/coupon_claim.tsx +198 -0
  29. package/event/coupon_claim_detail.tsx +175 -0
  30. package/event/coupon_claim_history.tsx +279 -0
  31. package/event/coupon_claim_reimburse.tsx +111 -0
  32. package/event/coupon_claim_reimburse_history.tsx +72 -0
  33. package/event/coupon_claim_reimburse_history_detail.tsx +117 -0
  34. package/event/coupon_claim_staff.tsx +256 -0
  35. package/event/coupon_detail.tsx +98 -0
  36. package/event/coupon_event_list.tsx +77 -0
  37. package/event/coupon_generate.tsx +258 -0
  38. package/event/coupon_generate_event.tsx +79 -0
  39. package/event/coupon_generate_list.tsx +56 -0
  40. package/event/date_picker.tsx +152 -0
  41. package/event/detail.tsx +352 -0
  42. package/event/entrance.tsx +215 -0
  43. package/event/entrance_again.tsx +200 -0
  44. package/event/entrance_failed.tsx +190 -0
  45. package/event/entrance_idcard.tsx +203 -0
  46. package/event/entrance_list.tsx +264 -0
  47. package/event/entrance_list_item.tsx +88 -0
  48. package/event/entrance_log.tsx +130 -0
  49. package/event/entrance_success.tsx +155 -0
  50. package/event/entrance_warning.tsx +91 -0
  51. package/event/exchange_reward.tsx +31 -0
  52. package/event/exchange_reward_result.tsx +137 -0
  53. package/event/exchange_ticket.tsx +234 -0
  54. package/event/exchange_ticket_list.tsx +191 -0
  55. package/event/exchange_ticket_result.tsx +211 -0
  56. package/event/exit.tsx +91 -0
  57. package/event/exit_failed.tsx +135 -0
  58. package/event/exit_list.tsx +118 -0
  59. package/event/exit_log.tsx +131 -0
  60. package/event/exit_success.tsx +143 -0
  61. package/event/exit_temporary.tsx +226 -0
  62. package/event/hall_in.tsx +148 -0
  63. package/event/hall_in_failed.tsx +270 -0
  64. package/event/hall_in_list.tsx +222 -0
  65. package/event/hall_in_log.tsx +134 -0
  66. package/event/hall_in_success.tsx +132 -0
  67. package/event/hall_out.tsx +143 -0
  68. package/event/hall_out_failed.tsx +133 -0
  69. package/event/hall_out_list.tsx +215 -0
  70. package/event/hall_out_log.tsx +133 -0
  71. package/event/hall_out_success.tsx +130 -0
  72. package/event/list.tsx +219 -0
  73. package/event/list_filter.tsx +124 -0
  74. package/event/log.tsx +435 -0
  75. package/event/qc_idcard.tsx +209 -0
  76. package/event/qc_idcard_failed.tsx +78 -0
  77. package/event/qc_idcard_success.tsx +68 -0
  78. package/event/queue_out.tsx +186 -0
  79. package/event/queue_pricing.tsx +152 -0
  80. package/event/randomseat.tsx +33 -0
  81. package/event/review.tsx +117 -0
  82. package/event/review_add.tsx +342 -0
  83. package/event/review_detail.tsx +67 -0
  84. package/event/review_item.tsx +76 -0
  85. package/event/scan_item.tsx +66 -0
  86. package/event/schedule.tsx +135 -0
  87. package/event/seat.tsx +628 -0
  88. package/event/seat_autopick.tsx +120 -0
  89. package/event/seat_map.tsx +408 -0
  90. package/event/seat_map_matrix.tsx +94 -0
  91. package/event/seat_map_test.tsx +401 -0
  92. package/event/ticket_list.tsx +722 -0
  93. package/event/ticket_list2.tsx +680 -0
  94. package/event/timer.tsx +58 -0
  95. package/event/tms.tsx +103 -0
  96. package/event/tms_add.tsx +94 -0
  97. package/event/tms_add_result.tsx +175 -0
  98. package/event/tms_dashboard.tsx +89 -0
  99. package/event/tms_event_list.tsx +66 -0
  100. package/event/turnstile_event_gate.tsx +74 -0
  101. package/event/turnstile_event_item.tsx +41 -0
  102. package/event/turnstile_event_list.tsx +69 -0
  103. package/event/turnstile_event_ticket.tsx +95 -0
  104. package/event/turnstile_settings.tsx +327 -0
  105. package/event/turnstile_settings_otp.tsx +58 -0
  106. package/event/turnstile_settings_status.tsx +50 -0
  107. package/event/voucher.tsx +149 -0
  108. package/event/voucher_multi.tsx +181 -0
  109. package/fonts/Arial.ttf +0 -0
  110. package/fonts/ArialBold.ttf +0 -0
  111. package/fonts/DecoNumbers.ttf +0 -0
  112. package/fonts/MonoSpace.ttf +0 -0
  113. package/fonts/SFProText.ttf +0 -0
  114. package/fonts/digital.ttf +0 -0
  115. package/fonts/mono.ttf +0 -0
  116. package/id.json +1113 -0
  117. package/index.js +2 -0
  118. package/libs.json +1 -0
  119. package/mover.js +0 -0
  120. package/package.json +16 -0
  121. package/publisher.js +84 -0
@@ -0,0 +1,680 @@
1
+ // withHooks
2
+ import { applyStyle } from 'esoftplay';
3
+ import { ComponentButton } from 'esoftplay/cache/component/button/import';
4
+ import { ComponentHeader } from 'esoftplay/cache/component/header/import';
5
+ import { ComponentTouchable } from 'esoftplay/cache/component/touchable/import';
6
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
7
+ import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
8
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
9
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
10
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
11
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
12
+ import { LibSkeleton } from 'esoftplay/cache/lib/skeleton/import';
13
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
14
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
15
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
16
+ import { UseDeeplinkProperty } from 'esoftplay/cache/use/deeplink/import';
17
+ import esp from 'esoftplay/esp';
18
+ import useLazyState from 'esoftplay/lazy';
19
+ import useSafeState from 'esoftplay/state';
20
+ import { useEffect, useRef } from 'react';
21
+
22
+ import { BboConfigProperty } from 'esoftplay/cache/bbo/config/import';
23
+ import { BigbangLoading_pageProperty } from 'esoftplay/cache/bigbang/loading_page/import';
24
+ import { ComponentAlert } from 'esoftplay/cache/component/alert/import';
25
+ import { ComponentPending_trx } from 'esoftplay/cache/component/pending_trx/import';
26
+ import { EventCountdownProperty } from 'esoftplay/cache/event/countdown/import';
27
+ import { EventQueue_pricingProperty } from 'esoftplay/cache/event/queue_pricing/import';
28
+ import { LibFirebase_socketProperty } from 'esoftplay/cache/lib/firebase_socket/import';
29
+ import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
30
+ import { MarketCountdown } from 'esoftplay/cache/market/countdown/import';
31
+ import { UseTasks } from 'esoftplay/cache/use/tasks/import';
32
+ import moment from 'esoftplay/moment';
33
+ import React from 'react';
34
+ import { Pressable, RefreshControl, ScrollView, Text, TouchableOpacity, View } from 'react-native';
35
+ import useFirebaseSocket from '../lib/firebase_socket';
36
+
37
+
38
+ export interface EventTicket_list2Args {
39
+
40
+ }
41
+ export interface EventTicket_list2Props {
42
+
43
+ }
44
+
45
+ type Result = {
46
+ "id": string,
47
+ "title": string,
48
+ "image": string,
49
+ "images": Array<{
50
+ "image": string,
51
+ "title": string,
52
+ "description": string,
53
+ }>,
54
+ "image_map": string,
55
+ "charge_payment": number,
56
+ "status": string,
57
+ "quota_checkout": string,
58
+ "show_price": string,
59
+ "config_queue": {
60
+ "limit": number,
61
+ "time": number,
62
+ },
63
+ "form_allotment": string,
64
+ "form_allotment_text": string,
65
+ "use_queue": string,
66
+ "is_pod_limit": string,
67
+ "event_tag": [],
68
+ "charge_payment_type": string,
69
+ "price_type": Array<{
70
+ "price_id": string,
71
+ "type": string,
72
+ "kind": string,
73
+ "currency": string,
74
+ "price_min": string,
75
+ "price_max": string,
76
+ "use_code": string,
77
+ "use_seat": string,
78
+ "use_quota": boolean,
79
+ "config": {
80
+ "seat_autopick": string,
81
+ "seat_autopick_start": string,
82
+ },
83
+ "price_date": string,
84
+ "info": string,
85
+ "qty_min": string,
86
+ "qty_max": string,
87
+ "tax": string,
88
+ "quota": string,
89
+ "quota_used": string,
90
+ "status": number,
91
+ "quota_checkout": string,
92
+ "date_start": string,
93
+ "date_end": string,
94
+ "paper_size": string,
95
+ "is_refundable": boolean,
96
+ "refund": string,
97
+ "is_printed": string,
98
+ "image_map": string,
99
+ "term": Array<string>,
100
+ "list": Array<{
101
+ "list_id": string,
102
+ "date_id": number,
103
+ "ondate": string,
104
+ "price_id": string,
105
+ "price": string,
106
+ "quota": string,
107
+ "quota_used": string,
108
+ "show_limit": number,
109
+ "status": number,
110
+ "show_price": number,
111
+ "currency": string,
112
+ "schedule": {
113
+ "info": string,
114
+ "artist": [],
115
+ },
116
+ "is_available"?: string,
117
+ }>,
118
+ }>,
119
+ "price_type_info": string,
120
+ "exhibitor": {
121
+ "list": Array<{
122
+ "id": string,
123
+ "title": string,
124
+ "image": string,
125
+ }>,
126
+ "more_url": string,
127
+ },
128
+ "url_share": string,
129
+ }
130
+
131
+ const taskSeat = UseTasks()
132
+ const taskAdditional = UseTasks()
133
+
134
+ export default function m(props: EventTicket_list2Props): any {
135
+ const checkCounter = useRef<number>(0)
136
+ let refTimeout = useRef<any>()
137
+ const { doneQueue, isInPricingQueueConfig, updateQueueExp } = useFirebaseSocket();
138
+
139
+ const [pendingData] = BigbangLoading_pageProperty.state().useState()
140
+
141
+ const { has_addition, url, fee_platform, subscribed }: any = useRef(LibNavigation.getArgsAll(props)).current
142
+
143
+ const [deeplinkParams] = UseDeeplinkProperty.params.useState()
144
+ const [timer] = EventCountdownProperty.countdownTime.useState()
145
+ const [unAvailableResult, setUnavailableResult] = useLazyState<any>()
146
+ const [availableResult, setAvailableResult, getAvailableResult] = useSafeState<Result>()
147
+ const [, setDataPostBooking, getDataPostBooking] = useLazyState<any>([])
148
+ const [dataAddition, setDataAddition] = useSafeState<any>([])
149
+ const [isPass, setIsPass] = useSafeState(true)
150
+ const [showAll, setShowAll] = useSafeState<any>({});
151
+ const [urlPayment, setUrlPayment] = useLazyState<any>()
152
+
153
+ let dataEvent: any = {
154
+ event_id: availableResult?.id,
155
+ event_title: availableResult?.title,
156
+ charge_payment: availableResult?.charge_payment,
157
+ charge_payment_type: availableResult?.charge_payment_type,
158
+ images: availableResult?.images,
159
+ }
160
+
161
+ const [ticketSeat, resetTicketSeat] = taskSeat((item: any) => new Promise((next) => {
162
+ if (item.use_seat == 1) {
163
+ if (item.adjacent_seats == 0) {
164
+ LibNavigation.navigateForResult('event/seat_map', {
165
+ url: 'event_seat',
166
+ dataTicket: {
167
+ ...dataEvent,
168
+ qty: item.qty,
169
+ selected_ticket: {
170
+ price_id: item.price_id,
171
+ type: item.type,
172
+ list: {
173
+ ondate: item.ondate
174
+ }
175
+ }
176
+ },
177
+ }, item.list_id)
178
+ .then((value: any) => {
179
+ const merged = { ...item, ...value }
180
+ let a = LibObject.replaceItem(getDataPostBooking(), (it) => it.list_id == item.list_id, merged)()
181
+ setDataPostBooking(a)
182
+ next()
183
+ })
184
+ } else {
185
+ let a = LibObject.replaceItem(getDataPostBooking(), (it) => it.list_id == item.list_id, item)()
186
+ setDataPostBooking(a)
187
+ next()
188
+ }
189
+ } else {
190
+ let a = LibObject.replaceItem(getDataPostBooking(), (it) => it.list_id == item.list_id, item)()
191
+ setDataPostBooking(a)
192
+ next()
193
+ }
194
+ }), () => {
195
+
196
+ // bagian iki di remake
197
+
198
+ const transformedData: any[] = [];
199
+ availableResult?.price_type?.filter((y: any) => y.selected == 1)?.map((item: any) => {
200
+ item?.list?.filter((x: any) => x.selected == 1)?.map((listItem: any) => {
201
+ transformedData.push({
202
+ ...item,
203
+ list_id: listItem.list_id,
204
+ qty: listItem.qty,
205
+ ondate: listItem.ondate,
206
+ list: [listItem],
207
+ });
208
+ });
209
+ })
210
+
211
+ resetTicketAdditional()
212
+ ticketAdditional(transformedData)
213
+ setDataAddition([])
214
+ })
215
+
216
+
217
+ const [ticketAdditional, resetTicketAdditional] = taskAdditional((item: any) => new Promise((next) => {
218
+ if (has_addition == 1 || item.has_addition && item.has_addition == 1) {
219
+ LibNavigation.navigateForResult('event/additional', {
220
+ event_id: dataEvent?.event_id,
221
+ qty: item.qty,
222
+ ondate: item.ondate,
223
+ data: dataEvent,
224
+ price_id: item.price_id,
225
+ type_ticket: item.type
226
+ }, item.list_id).then((value) => {
227
+ if (value != "") {
228
+ setDataAddition(dataAddition.push(JSON.parse(value)))
229
+ }
230
+ next()
231
+ })
232
+ } else {
233
+ next()
234
+ }
235
+ }), () => {
236
+ if (dataAddition?.length > 0) {
237
+ dataEvent.addition = dataAddition
238
+ }
239
+ LibNavigation.navigate('payment/ticket_multi', {
240
+ order_type: BboConfigProperty?.state()?.get()?.order_type?.ticket,
241
+ fee_platform: fee_platform,
242
+ dataEvent: dataEvent,
243
+ dataTicket: getDataPostBooking(),
244
+ subscribed: subscribed,
245
+ url_payment: urlPayment,
246
+ })
247
+ })
248
+
249
+ useEffect(() => {
250
+ BboConfigProperty.curlConfig('v2/config_order_type')
251
+ const { event_id } = EventQueue_pricingProperty.state().get()
252
+ loadData()
253
+ if (isInPricingQueueConfig(event_id))
254
+ EventCountdownProperty.countdownTime.set(moment().add(LibFirebase_socketProperty.eventQueueConfig.get(event_id).time, 'seconds').localeFormat('YYYY-MM-DD HH:mm:ss'))
255
+ getCheckCounter()
256
+ return () => {
257
+ clearTimeout(refTimeout.current)
258
+ EventCountdownProperty.releaseQueue.trigger()
259
+ }
260
+ }, [])
261
+
262
+ function getCheckCounter() {
263
+ clearTimeout(refTimeout.current)
264
+ const { pathQueue, event_id, key } = EventQueue_pricingProperty.state().get()
265
+ if (event_id && isInPricingQueueConfig(event_id)) {
266
+ updateQueueExp(pathQueue, event_id)
267
+ checkCounter.current++
268
+ refTimeout.current = setTimeout(() => {
269
+ getCheckCounter()
270
+ }, 6000);
271
+ }
272
+ }
273
+
274
+ function loadData() {
275
+ new LibCurl(url, null, (res, msg) => {
276
+ const availablePriceType = LibObject.update(res, (arr: any[]) => arr.filter((x) => x.status != 0))('price_type')
277
+ const unAvailablePriceType = LibObject.update(res, (arr: any[]) => arr.filter((x) => x.status == 0))('price_type')
278
+
279
+ setUnavailableResult(unAvailablePriceType)
280
+ setAvailableResult(availablePriceType)
281
+ setUrlPayment(res?.url_payment)
282
+
283
+ if (res.form_allotment == 1) {
284
+ releaseQueue()
285
+ LibNavigation.push('event/queue_out', { event_id: res.id, notes: res.form_allotment_text })
286
+ }
287
+
288
+ }, (error) => {
289
+ LibDialog.warningConfirm(esp.lang("event/ticket_list", "warn"), error?.message, "Ok", () => {
290
+ LibNavigation.back()
291
+ }, "", () => { })
292
+ }, 1)
293
+ }
294
+
295
+ function releaseQueue() {
296
+ const { pathQueue, event_id, key } = EventQueue_pricingProperty.state().get()
297
+ if (event_id && isInPricingQueueConfig(event_id)) {
298
+ doneQueue(pathQueue, event_id, key, () => { })
299
+ EventQueue_pricingProperty.state().reset()
300
+ setIsPass(false)
301
+ EventCountdownProperty.releaseQueue.trigger()
302
+ }
303
+ }
304
+
305
+ function onRefresh() {
306
+ loadData()
307
+ }
308
+
309
+
310
+ function checkSeatMap() {
311
+ let newResult: any[] = [];
312
+
313
+ availableResult.price_type.map((priceType: any) => {
314
+ let filteredList = priceType.list/* .filter((item: any) => item.selected == 1); */
315
+ filteredList = filteredList?.map((item: any) => ({
316
+ ...item,
317
+ type: priceType?.type,
318
+ tax: priceType?.tax,
319
+ term: priceType?.term,
320
+ has_addition: priceType?.has_addition,
321
+ image_map: priceType?.image_map
322
+ }))
323
+
324
+ newResult = newResult.concat(filteredList);
325
+ });
326
+ // if (getDataPostBooking().length == 0) {
327
+ // }
328
+ setDataPostBooking(newResult)
329
+ resetTicketSeat()
330
+ ticketSeat(newResult.filter((x: any) => x.selected == 1))
331
+ // esp.log(newResult.filter((x: any) => x.selected == 1));
332
+ }
333
+
334
+
335
+ function renderItem(itemC: any, iC: number, item: any, i: number) {
336
+ // itemC adalah item yang ada diindex list, kalo item itu adalah item yang ada diindex price_type
337
+
338
+ let ticketWithDate = item.price_date == 1 && item.use_code == 0
339
+ let ticketInvitation = item.price_date == 0 && item.use_code == 1
340
+ let ticketSpecial = item.price_date == 0 && item.use_code == 0
341
+
342
+ let _selectedTicket = itemC.selected == 1
343
+
344
+ let colorDefault = _selectedTicket ? "#FFE9AD" : '#fff'
345
+ let colorBackground = item.status != 1 ? LibStyle.colorLightGrey : itemC.status != 1 ? LibStyle.colorLightGrey : colorDefault
346
+ let textOpacity = /* item.status == 1 ? 1 : */itemC?.status == 1 ? 1 : 0.3
347
+
348
+ return (
349
+ <TouchableOpacity key={iC} onPress={() => {
350
+ let msg = item.status == 0 ? esp.lang("event/ticket_list", "sold_out") : esp.lang("event/ticket_list", "coming_soon")
351
+ if (itemC.status == 1 && item.status == 1) {
352
+ const data = new LibObject(getAvailableResult())
353
+ .update((itemList) => {
354
+ itemList.selected = itemList.selected == 1 ? 0 : 1
355
+ itemList.qty = itemList.selected == 1 ? item.qty_min : 0
356
+ itemList.adjacent_seats = item.config?.seat_autopick
357
+ itemList.use_seat = item.use_seat
358
+ return itemList
359
+ })('price_type', i, 'list', iC)
360
+ .update((priceTypeItem) => {
361
+ return ({
362
+ ...priceTypeItem,
363
+ selected: priceTypeItem.list.some((item: any) => item.selected == 1) ? 1 : 0
364
+ })
365
+ })('price_type', i)
366
+ .value()
367
+
368
+ setAvailableResult(data)
369
+ } else if (itemC.status == 0) {
370
+ LibToastProperty.show(msg)
371
+ } else if (itemC.status == 2) {
372
+ LibToastProperty.show(msg)
373
+ }
374
+
375
+ }} testID="ticket_item" activeOpacity={itemC.status == 1 ? 0 : 1} style={{ backgroundColor: colorBackground, borderBottomWidth: item.list.length == 1 ? 0 : 5, borderBottomColor: "#fff" }}>
376
+ <View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between', padding: 10, alignItems: 'center' }}>
377
+ {
378
+ ticketWithDate ?
379
+ // view untuk yang ada tanggalnya
380
+ <View style={{ flex: 1, flexDirection: 'row', alignContent: 'center', alignItems: 'center', }}>
381
+ <View style={applyStyle({ marginLeft: 10, marginHorizontal: 20, width: 42, height: 42, borderRadius: 5, backgroundColor: colorBackground, borderStyle: "solid", borderWidth: textOpacity, borderColor: _selectedTicket ? "#3ea4dc" : '#999', alignContent: 'center', alignItems: 'center', justifyContent: 'center' })}>
382
+ <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 20, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0.23, textAlign: "center", color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemC.ondate).localeFormat('DD')}</Text>
383
+ </View>
384
+ <View style={applyStyle({ flexDirection: 'column', flex: 1 })}>
385
+ {
386
+ item?.status == 1 && itemC.status != 1 &&
387
+ <View style={applyStyle({ flexDirection: 'row', marginBottom: 5 })}>
388
+ <View style={applyStyle({ alignContent: 'center', alignItems: 'center', justifyContent: 'center', marginTop: 5, borderWidth: 1, backgroundColor: itemC.status == 0 ? LibStyle.colorRed : "#4cd964", borderColor: itemC.status == 0 ? LibStyle.colorRed : "#4cd964", borderRadius: 5, padding: 3, opacity: 0.8 })}>
389
+ <Text allowFontScaling={false} style={applyStyle({ fontSize: 10, fontStyle: "normal", letterSpacing: 0, color: /* itemC.status == 2 ? "#000" : */ "#fff", fontWeight: 'bold' })}>{itemC.status == 0 ? esp.lang("event/ticket_list", "sold_out") : esp.lang("event/ticket_list", "coming_soon")}</Text>
390
+ </View>
391
+ </View>
392
+ }
393
+ <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemC.ondate).localeFormat('dddd')}</Text>
394
+ <View style={applyStyle({ flexDirection: 'row' })}>
395
+ <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemC.ondate).localeFormat('MMMM')}</Text>
396
+ <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, marginLeft: 7, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemC.ondate).localeFormat('YYYY')}</Text>
397
+ </View>
398
+ </View>
399
+ </View>
400
+ :
401
+ // view untuk yang undangan dan khusus
402
+ <View style={{ flex: 1, flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
403
+ <LibPicture source={esp.assets(ticketInvitation ? 'icons/invitation2.png' : 'icons/ic_special2.png')} style={{ height: 42, width: 42 }} />
404
+ <View style={{ marginLeft: 14, flex: 1 }} >
405
+ {
406
+ item?.status == 1 && itemC.status != 1 &&
407
+ <View style={applyStyle({ flexDirection: 'row', marginBottom: 5 })}>
408
+ <View style={applyStyle({ alignContent: 'center', alignItems: 'center', justifyContent: 'center', marginTop: 5, borderWidth: 1, backgroundColor: itemC.status == 0 ? LibStyle.colorRed : LibStyle.colorPrimary, borderColor: itemC.status == 0 ? LibStyle.colorRed : LibStyle.colorPrimary, borderRadius: 5, padding: 3, opacity: 0.8 })}>
409
+ <Text allowFontScaling={false} style={applyStyle({ fontSize: 10, fontStyle: "normal", letterSpacing: 0, color: "#fff", fontWeight: 'bold' })}>{itemC.status == 0 ? esp.lang("event/ticket_list", "sold_out") : esp.lang("event/ticket_list", "coming_soon")}</Text>
410
+ </View>
411
+ </View>
412
+ }
413
+ {<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' }}>{item.type}</Text>}
414
+ {
415
+ item.info != "" &&
416
+ <Text allowFontScaling={false} numberOfLines={3} style={{ flexWrap: 'wrap', fontFamily: "Arial", fontSize: 11, fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' }} >{item.info}</Text>
417
+ }
418
+ </View>
419
+ </View>
420
+ }
421
+
422
+ <View style={applyStyle({ marginRight: 5, marginLeft: 5, flexDirection: 'column' })} >
423
+ {
424
+ (itemC.status == 1 || itemC.status == 0 || itemC.show_price == 1) &&
425
+ <Text allowFontScaling={false} style={applyStyle({ opacity: ticketWithDate ? textOpacity : 1, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "right", color: _selectedTicket ? "#3ea4dc" : (itemC.price == 0 ? LibStyle.colorGreen : '#999') })} >{itemC.price == 0 ? esp.lang("event/ticket_list", "free") : LibUtils.money(itemC.price, itemC.currency)}</Text>
426
+ }
427
+ {
428
+ (ticketWithDate || ticketSpecial) && itemC.selected == 1 &&
429
+ <View style={applyStyle({ marginTop: 4, flexDirection: 'row', marginLeft: 8, alignContent: 'center', alignItems: 'center' })}>
430
+ <Pressable hitSlop={{ top: 15, left: 15, right: 15, bottom: 15 }} testID='minus_btn' onPress={() => {
431
+ // min()
432
+ let qty = 1
433
+ if (itemC.qty <= item.qty_min) {
434
+ qty = Number(item.qty_min)
435
+ } else {
436
+ qty = Number(itemC.qty) == 1 ? 1 : Number(itemC.qty) - 1
437
+ }
438
+
439
+ setAvailableResult(LibObject.set(getAvailableResult(), qty)('price_type', i, 'list', iC, 'qty'))
440
+
441
+ }}>
442
+ <View style={applyStyle({ padding: 1, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
443
+ <LibIcon name="minus" color="#e74c3c" />
444
+ </View>
445
+ </Pressable>
446
+ <Text style={applyStyle({ fontFamily: "Arial", fontSize: 20, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#9b9b9b", marginLeft: 13, marginRight: 13 })}>{itemC?.qty}</Text>
447
+ <Pressable hitSlop={{ top: 15, left: 15, right: 15, bottom: 15 }} testID='plus_btn' onPress={() => {
448
+ // add(itemP.quota, itemP.quota_used)
449
+ let qty = 1
450
+ if (itemC.qty != item.qty_max) {
451
+ if (qty != (Number(itemC.quota) - Number(itemC.quota_used))) {
452
+ qty = Number(itemC?.qty) + 1
453
+ }
454
+ } else {
455
+ qty = Number(item.qty_max)
456
+ }
457
+ setAvailableResult(LibObject.set(getAvailableResult(), qty)('price_type', i, 'list', iC, 'qty'))
458
+ }}>
459
+ <View style={applyStyle({ padding: 1, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
460
+ <LibIcon name="plus" color="#16a085" />
461
+ </View>
462
+ </Pressable>
463
+ </View>
464
+ }
465
+ </View>
466
+
467
+ </View>
468
+ </TouchableOpacity>
469
+ )
470
+ }
471
+
472
+ let listLength = new Array(10).fill('')
473
+
474
+ const maxDisplay = 3;
475
+
476
+ const handleShowAll = (price_id: any) => {
477
+ setShowAll((prevShowAll: any) => ({
478
+ ...prevShowAll,
479
+ [price_id]: !prevShowAll[price_id],
480
+ }));
481
+ };
482
+
483
+ return (
484
+ <View style={{ flex: 1, backgroundColor: '#fff' }}>
485
+ {/* <LibFocus onFocus={onRefresh} /> */}
486
+ <ComponentHeader title={esp.lang("event/ticket_list", "buy_ticket")} subtitle={esp.lang("event/ticket_list", "choose_date")} />
487
+ {
488
+ !availableResult ?
489
+ <LibSkeleton>
490
+ {
491
+ listLength.map((item: any, i: number) => {
492
+ return (
493
+ <View key={i}>
494
+ <View style={{ height: 30, width: '100%', backgroundColor: '#fff' }} />
495
+ <View style={{ padding: 10, width: '100%', flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' }}>
496
+ <View style={{ flexDirection: 'row' }}>
497
+ <View style={{ backgroundColor: '#fff', height: 42, width: 42, borderRadius: 3, marginRight: 10 }} />
498
+ <View style={{ width: '60%' }}>
499
+ <View style={{ backgroundColor: '#fff', height: 20, width: '40%' }} />
500
+ <View style={{ backgroundColor: '#fff', marginTop: 7, height: 14, width: '70%' }} />
501
+ </View>
502
+ </View>
503
+ <View style={{ backgroundColor: '#fff', height: 20, width: '10%' }} />
504
+ </View>
505
+ </View>
506
+ )
507
+ })
508
+ }
509
+ </LibSkeleton>
510
+ :
511
+ <>
512
+ {
513
+ Object.values(pendingData).filter((item: any) => item?.order_type == "ticket").length > 0 &&
514
+ <ComponentPending_trx
515
+ onPress={() => {
516
+ LibNavigation.navigate('bigbang/loading_page_list', {
517
+ order_type: 'ticket'
518
+ })
519
+ }}
520
+ order_type="ticket"
521
+ title={esp.lang("event/ticket_list", "pending", String(Object.values(pendingData).filter((item: any) => item?.order_type == "ticket").length))}
522
+ />
523
+ }
524
+ {
525
+ isInPricingQueueConfig(availableResult?.id) && isPass ?
526
+ <View style={{ backgroundColor: LibStyle.colorGreen, margin: 16, borderRadius: 5, padding: 10, ...LibStyle.elevation(2) }} >
527
+ <LibTextstyle text={esp.lang("event/ticket_list", "select_ticket")} textStyle='caption1' style={{ color: 'white' }} />
528
+ <MarketCountdown
529
+ onExpired={() => {
530
+ LibNavigation.back(1)
531
+ }}
532
+ expired={timer}
533
+ style={{ color: "#fff", fontWeight: 'bold' }} />
534
+ </View>
535
+ : null
536
+ }
537
+
538
+ <ScrollView refreshControl={<RefreshControl refreshing={false} onRefresh={onRefresh} />}>
539
+ <ComponentAlert
540
+ color={LibStyle.colorPrimary}
541
+ msg={esp.lang("event/ticket_list2", "u_can_choose_multiple")}
542
+ style={{ marginHorizontal: 15 }}
543
+ useIcon
544
+ />
545
+ {
546
+ availableResult?.image_map != "" &&
547
+ <ComponentTouchable onPress={() => {
548
+ LibNavigation.navigate('lib/gallery', { image: availableResult?.image_map })
549
+ }} style={{ marginBottom: 10, marginTop: 20 }}>
550
+ <LibPicture source={{ uri: availableResult?.image_map }} style={applyStyle({ alignSelf: 'center', height: LibStyle.width * 0.5, width: LibStyle.width })} resizeMode="contain" />
551
+ </ComponentTouchable>
552
+ }
553
+ <View style={{ flex: 1 }}>
554
+ {
555
+ availableResult?.price_type?.map?.((item: any, i: number) => {
556
+ let textOpacity = item?.status == 1 ? 1 : 0.3
557
+ let filterFullData = availableResult?.price_type?.filter((it: any) => it.status != 0)
558
+ const displayedData = showAll[item.price_id] ? item?.list : item?.list.slice(0, maxDisplay);
559
+
560
+ let ticketWithDate = item.price_date == 1 && item.use_code == 0
561
+
562
+ return (
563
+ <Pressable onPress={() => {
564
+
565
+ }} key={i} style={{ overflow: 'hidden', margin: 15, marginBottom: 5, marginTop: 10, backgroundColor: '#fff', borderRadius: 10, ...LibStyle.elevation(2), borderWidth: 1, borderColor: item.selected == 1 ? LibStyle.colorBlue : LibStyle.colorBgGrey }}>
566
+ <View style={{ padding: 10, backgroundColor: '#f1f2f3', borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
567
+ <View style={{ alignContent: 'center', alignItems: 'center', flexDirection: 'row', justifyContent: 'space-between', }}>
568
+ <View>
569
+ <Text allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.type}
570
+ {
571
+ item.qty_min > 1 &&
572
+ <Text style={{ color: LibStyle.colorRed, fontSize: 10, fontWeight: 'normal' }}> {"(" + esp.lang("event/ticket_list", "min_order") + LibUtils.number(item.qty_min) + ")"}</Text>
573
+ }
574
+ </Text>
575
+ {
576
+ deeplinkParams?.type == 'event-voucher' && deeplinkParams?.price_id == item.price_id ?
577
+ <Text allowFontScaling={false} style={{ color: "coral", fontSize: 12, fontWeight: 'bold' }}>{esp.lang("event/ticket_list", "applied_code", deeplinkParams?.code)}</Text>
578
+ : null
579
+ }
580
+ </View>
581
+
582
+ {
583
+ item?.status != 1 &&
584
+ <View style={applyStyle({ flexDirection: 'row' })}>
585
+ <View style={applyStyle({ alignContent: 'center', alignItems: 'center', justifyContent: 'center', borderWidth: 1, backgroundColor: item.status == 0 ? LibStyle.colorRed : "#4cd964", borderColor: item.status == 0 ? LibStyle.colorRed : "#4cd964", borderRadius: 5, padding: 3, opacity: 0.8 })}>
586
+ <Text allowFontScaling={false} style={applyStyle({ fontSize: 10, fontStyle: "normal", letterSpacing: 0, color: item.status == 2 ? "#000" : "#fff", fontWeight: 'bold' })}>{item.status == 0 ? esp.lang("event/ticket_list", "sold_out") : esp.lang("event/ticket_list", "coming_soon")}</Text>
587
+ </View>
588
+ </View>
589
+ }
590
+ </View>
591
+ {
592
+ item.info != "" && ticketWithDate &&
593
+ <View style={{ marginTop: 3, alignContent: 'center', alignItems: 'center', flexDirection: 'row', marginRight: 5 }}>
594
+ <Text allowFontScaling={false} style={{ fontSize: 12, color: LibStyle.colorBlue }}>{item.info}</Text>
595
+ </View>
596
+ }
597
+ </View>
598
+ {
599
+ displayedData?.map((itemC: any, iC: number) => renderItem(itemC, iC, item, i))
600
+ }
601
+
602
+ {
603
+ filterFullData[i].list?.length > 3 &&
604
+ <TouchableOpacity onPress={() => {
605
+ handleShowAll(item.price_id)
606
+ }} style={{ borderTopColor: LibStyle.colorGrey, borderTopWidth: 0.8, flex: 1, padding: 8, flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
607
+ <Text allowFontScaling={false} style={{ marginRight: 5, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: LibStyle.colorBlue }}>{showAll[item.price_id] ? esp.lang("event/ticket_list", "see_less") : esp.lang("event/ticket_list", "see_more")}</Text>
608
+ <LibIcon name={showAll[item.price_id] ? 'chevron-double-up' : 'chevron-double-down'} color={LibStyle.colorBlue} size={18} />
609
+ </TouchableOpacity>
610
+ }
611
+
612
+ </Pressable>
613
+ )
614
+ })
615
+ }
616
+
617
+ {/* ini view yang dibawah */}
618
+ <View style={{ marginTop: 30 }}>
619
+ {
620
+ unAvailableResult?.price_type?.length > 0 &&
621
+ <View style={{ margin: 15, marginTop: 0, marginBottom: 0, paddingBottom: 10, borderBottomWidth: 1, borderBottomColor: LibStyle.colorGrey }}>
622
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 16 }}>{esp.lang("event/ticket_list", "ticket_not_available")}</Text>
623
+ </View>
624
+ }
625
+ {
626
+ unAvailableResult?.price_type?.map?.((item: any, i: number) => {
627
+ let textOpacity = item?.status == 1 ? 1 : 0.3
628
+ let ticketWithDate = item.price_date == 1 && item.use_code == 0
629
+ return (
630
+ <View key={i} style={{ overflow: 'hidden', margin: 15, marginBottom: 5, backgroundColor: '#fff', borderRadius: 10, ...LibStyle.elevation(2), borderWidth: 1, borderColor: item.selected == 1 ? LibStyle.colorBlue : LibStyle.colorBgGrey }}>
631
+ <View style={{ padding: 10, backgroundColor: '#f1f2f3', borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
632
+ <View style={{ alignContent: 'center', alignItems: 'center', flexDirection: 'row', justifyContent: 'space-between', }}>
633
+ <Text allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.type}</Text>
634
+ {
635
+ item?.status != 1 &&
636
+ <View style={applyStyle({ flexDirection: 'row' })}>
637
+ <View style={applyStyle({ alignContent: 'center', alignItems: 'center', justifyContent: 'center', borderWidth: 1, backgroundColor: item.status == 0 ? LibStyle.colorRed : "#4cd964", borderColor: item.status == 0 ? LibStyle.colorRed : "#4cd964", borderRadius: 5, padding: 3, opacity: 0.8 })}>
638
+ <Text allowFontScaling={false} style={applyStyle({ fontSize: 10, fontStyle: "normal", letterSpacing: 0, color: item.status == 2 ? "#000" : "#fff", fontWeight: 'bold' })}>{item.status == 0 ? esp.lang("event/ticket_list", "sold_out") : esp.lang("event/ticket_list", "coming_soon")}</Text>
639
+ </View>
640
+ </View>
641
+ }
642
+ </View>
643
+ {
644
+ item.info != "" && ticketWithDate &&
645
+ <View style={{ marginTop: 3, alignContent: 'center', alignItems: 'center', flexDirection: 'row', marginRight: 5 }}>
646
+ <Text allowFontScaling={false} style={{ fontSize: 12, color: LibStyle.colorBlue }}>{item.info}</Text>
647
+ </View>
648
+ }
649
+ </View>
650
+ {
651
+ item.list.slice(0, 3).map((itemC: any, iC: number) => renderItem(itemC, iC, item, i))
652
+ }
653
+ </View>
654
+ )
655
+ })
656
+ }
657
+ </View>
658
+ </View>
659
+ </ScrollView>
660
+ <View style={applyStyle({ margin: 10, marginVertical: 5 })}>
661
+ {
662
+ availableResult?.price_type_info != "" &&
663
+ <Text allowFontScaling={false} style={applyStyle({ marginBottom: 10, fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: LibStyle.colorBlue })} >{availableResult && availableResult?.hasOwnProperty("price_type_info") && availableResult?.price_type_info}</Text>
664
+ }
665
+ <ComponentButton testID={"next_btn"} label={esp.lang("event/ticket_list", "next")} onPress={() => {
666
+ if (availableResult?.price_type.some((item: any) => item.selected == 1)) {
667
+ checkSeatMap();
668
+ } else {
669
+ LibToastProperty.show(esp.lang("event/ticket_list", "ticket_not_select"), 3000)
670
+ return
671
+ }
672
+
673
+ }} style={applyStyle({ backgroundColor: LibStyle.colorPrimary })} />
674
+ </View>
675
+ </>
676
+ }
677
+
678
+ </View>
679
+ )
680
+ }