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,722 @@
1
+ // withHooks
2
+ import { ComponentButton } from 'esoftplay/cache/component/button/import';
3
+ import { ComponentHeader } from 'esoftplay/cache/component/header/import';
4
+ import { ComponentPending_trx } from 'esoftplay/cache/component/pending_trx/import';
5
+ import { ComponentTouchable } from 'esoftplay/cache/component/touchable/import';
6
+ import { EventQueue_pricingProperty } from 'esoftplay/cache/event/queue_pricing/import';
7
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
8
+ import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
9
+ import { LibFocus } from 'esoftplay/cache/lib/focus/import';
10
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
11
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
12
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
13
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
14
+ import { LibSkeleton } from 'esoftplay/cache/lib/skeleton/import';
15
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
16
+ import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
17
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
18
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
19
+ import { MarketCountdown } from 'esoftplay/cache/market/countdown/import';
20
+ import moment from 'esoftplay/moment';
21
+
22
+ import { applyStyle } from 'esoftplay';
23
+ import { BboConfigProperty } from 'esoftplay/cache/bbo/config/import';
24
+ import { BigbangLoading_pageProperty } from 'esoftplay/cache/bigbang/loading_page/import';
25
+ import { EventCountdownProperty } from 'esoftplay/cache/event/countdown/import';
26
+ import { LibEffect } from 'esoftplay/cache/lib/effect/import';
27
+ import { LibFirebase_socket, LibFirebase_socketProperty } from 'esoftplay/cache/lib/firebase_socket/import';
28
+ import { LibHtmltext } from 'esoftplay/cache/lib/htmltext/import';
29
+ import { LibProgress } from 'esoftplay/cache/lib/progress/import';
30
+ import { UseDeeplinkProperty } from 'esoftplay/cache/use/deeplink/import';
31
+ import esp from 'esoftplay/esp';
32
+ import useLazyState from 'esoftplay/lazy';
33
+ import useSafeState from 'esoftplay/state';
34
+ import React, { useEffect, useRef } from 'react';
35
+ import { Pressable, RefreshControl, ScrollView, Text, TouchableOpacity, View } from 'react-native';
36
+
37
+
38
+ export interface EventTicket_listArgs {
39
+
40
+ }
41
+ export interface EventTicket_listProps {
42
+
43
+ }
44
+
45
+ export 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
+ export default function m(props: EventTicket_listProps): any {
132
+ const checkCounter = useRef<number>(0)
133
+ let refTimeout = useRef<any>()
134
+ const [bboConfig] = BboConfigProperty.state().useState()
135
+ const { doneQueue, isInPricingQueueConfig, updateQueueExp } = LibFirebase_socket();
136
+
137
+ const [pendingData] = BigbangLoading_pageProperty.state().useState()
138
+
139
+ const { url, fee_platform, has_addition, subscribed }: any = useRef(LibNavigation.getArgsAll(props)).current
140
+
141
+ const [deeplinkParams] = UseDeeplinkProperty.params.useState()
142
+ const [timer] = EventCountdownProperty.countdownTime.useState()
143
+
144
+ const [unAvailableResult, setUnavailableResult] = useLazyState<any>()
145
+ const [availableResult, setAvailableResult, getAvailableResult] = useSafeState<Result>()
146
+ const [urlPayment, setUrlPayment] = useLazyState<any>()
147
+
148
+ const [qty, setQty, getQty] = useSafeState<number>(1)
149
+ const [selectedTicket, setSelectedTicket, getSelectedTicket] = useSafeState<any>()
150
+
151
+ const [isPass, setIsPass] = useSafeState(true)
152
+ const [showAll, setShowAll] = useSafeState<any>({});
153
+
154
+ useEffect(() => {
155
+ BboConfigProperty.curlConfig('v2/config_order_type')
156
+ const { event_id } = EventQueue_pricingProperty.state().get()
157
+ if (isInPricingQueueConfig(event_id))
158
+ EventCountdownProperty.countdownTime.set(moment().add(LibFirebase_socketProperty.eventQueueConfig.get(event_id).time, 'seconds').localeFormat('YYYY-MM-DD HH:mm:ss'))
159
+ // loadData()
160
+ getCheckCounter()
161
+ return () => {
162
+ clearTimeout(refTimeout.current)
163
+ EventCountdownProperty.releaseQueue.trigger()
164
+ }
165
+ }, [])
166
+
167
+ function onRefresh() {
168
+ loadData()
169
+ }
170
+
171
+ function getCheckCounter() {
172
+ clearTimeout(refTimeout.current)
173
+ const { pathQueue, event_id } = EventQueue_pricingProperty.state().get()
174
+ if (event_id && isInPricingQueueConfig(event_id)) {
175
+ updateQueueExp(pathQueue, event_id)
176
+ checkCounter.current++
177
+ refTimeout.current = setTimeout(() => {
178
+ getCheckCounter()
179
+ }, 6000);
180
+ }
181
+ }
182
+
183
+ function loadData() {
184
+ new LibCurl(url, null, (res, msg) => {
185
+
186
+ const availablePriceType = LibObject.update(res, (arr: any[]) => arr.filter((x) => x.status != 0))('price_type')
187
+ const unAvailablePriceType = LibObject.update(res, (arr: any[]) => arr.filter((x) => x.status == 0))('price_type')
188
+
189
+ setUnavailableResult(unAvailablePriceType)
190
+ setAvailableResult(availablePriceType)
191
+ setUrlPayment(res?.url_payment)
192
+
193
+ if (selectedTicket) {
194
+ res?.price_type?.map((item: any) => {
195
+ if (item.price_id == selectedTicket?.price_id && item.status != 1) {
196
+ setSelectedTicket(undefined)
197
+ }
198
+ })
199
+ }
200
+
201
+ if (res.form_allotment == 1) {
202
+ releaseQueue()
203
+ LibNavigation.push('event/queue_out', { event_id: res.id, notes: res.form_allotment_text })
204
+ }
205
+ }, (error) => {
206
+ LibDialog.warningConfirm(esp.lang("event/ticket_list", "warn"), error?.message, "Ok", () => {
207
+ LibNavigation.back()
208
+ }, "", () => { })
209
+ }, 1)
210
+ }
211
+
212
+ function add(quota?: any, quota_used?: any): void {
213
+ if (getQty() != parseInt(getSelectedTicket()?.qty_max)) {
214
+ if (getQty() != (parseInt(quota) - parseInt(quota_used))) {
215
+ setQty(getQty() + 1)
216
+ }
217
+ }
218
+ }
219
+
220
+ function min(): void {
221
+ if (getQty() <= getSelectedTicket()?.qty_min) {
222
+ setQty(Number(getSelectedTicket()?.qty_min))
223
+ } else {
224
+ setQty(getQty() == 1 ? 1 : getQty() - 1)
225
+ }
226
+ }
227
+
228
+ function setQtyGlobal(value: any) {
229
+ let qty = 1
230
+ if (getSelectedTicket()?.qty_min) {
231
+ qty = Number(getSelectedTicket()?.qty_min)
232
+ }
233
+ if (qty > getSelectedTicket()?.qty_max) {
234
+ qty = Number(getSelectedTicket().qty_max)
235
+ }
236
+ if (value.quota != 0 && qty > value.quota) {
237
+ qty = value.quota
238
+ }
239
+ setQty(qty)
240
+ }
241
+
242
+ function releaseQueue() {
243
+ const { pathQueue, event_id, key } = EventQueue_pricingProperty.state().get()
244
+ if (event_id && isInPricingQueueConfig(event_id)) {
245
+ doneQueue(pathQueue, event_id, key, () => { })
246
+ EventQueue_pricingProperty.state().reset()
247
+ setIsPass(false)
248
+ EventCountdownProperty.releaseQueue.trigger()
249
+ }
250
+ }
251
+
252
+ let dataPost: any = {
253
+ event_id: availableResult?.id,
254
+ event_title: availableResult?.title,
255
+ charge_payment: availableResult?.charge_payment,
256
+ charge_payment_type: availableResult?.charge_payment_type,
257
+ images: availableResult?.images,
258
+ selected_ticket: selectedTicket,
259
+ qty: getQty(),
260
+ }
261
+
262
+ function checkAddition(newDataPost: any) {
263
+ if ((has_addition == 1 || selectedTicket?.hasOwnProperty("has_addition") && selectedTicket?.has_addition == 1)) {
264
+ LibNavigation.navigateForResult('event/additional', { type_ticket: selectedTicket?.type, ondate: selectedTicket?.list?.ondate, event_id: availableResult?.id, qty: getQty(), price_id: selectedTicket?.price_id }, 321).then((additions) => {
265
+ if (additions != "") {
266
+ newDataPost.addition = additions
267
+ }
268
+ LibNavigation.navigate('payment/ticket', {
269
+ order_type: bboConfig?.order_type?.ticket,
270
+ tax: selectedTicket?.tax == null ? 0 : selectedTicket?.tax,
271
+ fee_platform: fee_platform,
272
+ dataBookingEvent: { ...newDataPost, qty: getQty() },
273
+ subscribed: subscribed,
274
+ url_payment: urlPayment,
275
+ })
276
+ })
277
+ } else {
278
+ LibNavigation.navigate('payment/ticket', {
279
+ order_type: bboConfig?.order_type?.ticket,
280
+ tax: selectedTicket?.tax == null ? 0 : selectedTicket?.tax,
281
+ fee_platform: fee_platform,
282
+ dataBookingEvent: { ...newDataPost, qty: getQty() },
283
+ subscribed: subscribed,
284
+ url_payment: urlPayment,
285
+ })
286
+ }
287
+ }
288
+
289
+ function nextStep(onALine?: number) {
290
+ // releaseQueue()
291
+ if (selectedTicket?.config?.seat_autopick == 1 && getQty() > 1) {
292
+ dataPost.adjacent_seats = 1
293
+ }
294
+
295
+ if (selectedTicket?.use_code == 1 && selectedTicket?.use_seat == 1) {
296
+ // tak arahke halaman seng anyar
297
+ LibNavigation.navigate('payment/event_invitation', {
298
+ dataBookingEvent: dataPost,
299
+ subscribed: subscribed
300
+ })
301
+ } else if (selectedTicket?.use_seat == 1) {
302
+ if (selectedTicket?.config && selectedTicket?.config?.seat_autopick == 1) {
303
+ checkAddition(dataPost)
304
+ } else {
305
+ LibNavigation.navigateForResult('event/seat_map', {
306
+ url: 'event_seat',
307
+ dataTicket: dataPost,
308
+ }).then((value) => {
309
+ dataPost.row_id = value.row_id
310
+ dataPost.column_id = value.column_id
311
+ dataPost.seat_name = value.seat_name
312
+
313
+ checkAddition(dataPost)
314
+ })
315
+ }
316
+ } else {
317
+ checkAddition(dataPost)
318
+ }
319
+ }
320
+
321
+ function checkInvBlock() {
322
+ LibProgress.show(esp.lang("event/ticket_list", "wait"))
323
+ new LibCurl('voucher_check_validate', null, (res, msg) => {
324
+ LibProgress.hide()
325
+ if (res?.status == 1) {
326
+ LibNavigation.navigate('event/block_invitation', {
327
+ dataCheck: res,
328
+ })
329
+ } else {
330
+ nextStep()
331
+ }
332
+ }, (err) => {
333
+ LibProgress.hide()
334
+ })
335
+ }
336
+
337
+ function renderItem(item: any, itemT: any, iT: number) {
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 = item.price_id == selectedTicket?.price_id && itemT.date_id == selectedTicket?.list?.date_id
343
+
344
+ let colorDefault = _selectedTicket ? "#FFE9AD" : '#fff'
345
+ let colorBackground = item.status != 1 ? LibStyle.colorLightGrey : itemT.status != 1 ? LibStyle.colorLightGrey : colorDefault
346
+ let textOpacity = /* item.status == 1 ? 1 : */itemT?.status == 1 ? 1 : 0.3
347
+
348
+ return (
349
+ <TouchableOpacity key={iT} onPress={() => {
350
+ let itemTicket = {
351
+ ...item
352
+ }
353
+ let replaceList = LibObject.set(itemTicket, itemT)('list')
354
+ // kondisi untuk tipe tiket yang ada tanggalnya
355
+ let msg = itemT.status == 0 ? esp.lang("event/ticket_list", "sold_out") : esp.lang("event/ticket_list", "coming_soon")
356
+ if (ticketWithDate) {
357
+ if (item.status == 1 && itemT.status == 1) {
358
+ setSelectedTicket(replaceList)
359
+ setQtyGlobal(itemT)
360
+ } else if (item.status == 0) {
361
+ LibToastProperty.show(msg)
362
+ } else if (item.status == 2) {
363
+ LibToastProperty.show(msg)
364
+ }
365
+ } else {
366
+ // kondisi untuk tipe tiket yang tidak ada tanggalnya (undangan/khusus)
367
+ if (item.status == 1 && itemT.status == 1) {
368
+ setSelectedTicket(replaceList)
369
+ if (ticketInvitation) {
370
+ setQty(1)
371
+ } else {
372
+ setQtyGlobal(itemT)
373
+ }
374
+ } else if (item.status == 0) {
375
+ LibToastProperty.show(msg)
376
+ } else if (item.status == 2) {
377
+ LibToastProperty.show(msg)
378
+ }
379
+ }
380
+ }} testID="ticket_item" activeOpacity={itemT.status == 1 ? 0 : 1} style={{ backgroundColor: colorBackground, borderBottomWidth: item.list.length == 1 ? 0 : 5, borderBottomColor: "#fff" }}>
381
+ <View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between', padding: 10, alignItems: 'center' }}>
382
+ {
383
+ ticketWithDate ?
384
+ // view untuk yang ada tanggalnya
385
+ <View style={{ flex: 1, flexDirection: 'row', alignContent: 'center', alignItems: 'center', }}>
386
+ <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' })}>
387
+ <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(itemT.ondate).localeFormat('DD')}</Text>
388
+ </View>
389
+ <View style={applyStyle({ flexDirection: 'column', flex: 1 })}>
390
+ {
391
+ item?.status == 1 && itemT.status != 1 &&
392
+ <View style={applyStyle({ flexDirection: 'row', marginBottom: 5 })}>
393
+ <View style={applyStyle({ alignContent: 'center', alignItems: 'center', justifyContent: 'center', marginTop: 5, borderWidth: 1, backgroundColor: itemT.status == 0 ? LibStyle.colorRed : "#4cd964", borderColor: itemT.status == 0 ? LibStyle.colorRed : "#4cd964", borderRadius: 5, padding: 3, opacity: 0.8 })}>
394
+ <Text allowFontScaling={false} style={applyStyle({ fontSize: 10, fontStyle: "normal", letterSpacing: 0, color: /* itemT.status == 2 ? "#000" : */ "#fff", fontWeight: 'bold' })}>{itemT.status == 0 ? esp.lang("event/ticket_list", "sold_out") : esp.lang("event/ticket_list", "coming_soon")}</Text>
395
+ </View>
396
+ </View>
397
+ }
398
+ <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('dddd')}</Text>
399
+ <View style={applyStyle({ flexDirection: 'row' })}>
400
+ <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('MMMM')}</Text>
401
+ <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(itemT.ondate).localeFormat('YYYY')}</Text>
402
+ </View>
403
+ </View>
404
+ </View>
405
+ :
406
+ // view untuk yang undangan dan khusus
407
+ <View style={{ flex: 1, flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
408
+ <LibPicture source={esp.assets(ticketInvitation ? 'icons/invitation2.png' : 'icons/ic_special2.png')} style={{ height: 42, width: 42 }} />
409
+ <View style={{ marginLeft: 14, flex: 1 }} >
410
+ {
411
+ item?.status == 1 && itemT.status != 1 &&
412
+ <View style={applyStyle({ flexDirection: 'row', marginBottom: 5 })}>
413
+ <View style={applyStyle({ alignContent: 'center', alignItems: 'center', justifyContent: 'center', marginTop: 5, borderWidth: 1, backgroundColor: itemT.status == 0 ? LibStyle.colorRed : LibStyle.colorPrimary, borderColor: itemT.status == 0 ? LibStyle.colorRed : LibStyle.colorPrimary, borderRadius: 5, padding: 3, opacity: 0.8 })}>
414
+ <Text allowFontScaling={false} style={applyStyle({ fontSize: 10, fontStyle: "normal", letterSpacing: 0, color: "#fff", fontWeight: 'bold' })}>{itemT.status == 0 ? esp.lang("event/ticket_list", "sold_out") : esp.lang("event/ticket_list", "coming_soon")}</Text>
415
+ </View>
416
+ </View>
417
+ }
418
+ {/* <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' }}>{item.type}</Text> */}
419
+ {
420
+ item.info != "" &&
421
+ <Text allowFontScaling={false} numberOfLines={3} style={{ flexWrap: 'wrap', fontFamily: "Arial", fontSize: 11, fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' }} >{item.info}</Text>
422
+ }
423
+ </View>
424
+ </View>
425
+ }
426
+
427
+ <View style={applyStyle({ marginRight: 5, marginLeft: 5, flexDirection: 'column' })} >
428
+ {
429
+ (itemT.status == 1 || itemT.status == 0 || itemT.show_price == 1) &&
430
+ <Text allowFontScaling={false} style={applyStyle({ opacity: ticketWithDate ? textOpacity : 1, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "right", color: _selectedTicket ? "#3ea4dc" : (itemT.price == 0 ? LibStyle.colorGreen : '#999') })} >{itemT.price == 0 ? esp.lang("event/ticket_list", "free") : LibUtils.money(itemT.price, itemT.currency)}</Text>
431
+ }
432
+ {/* {
433
+ item.status == 1 && itemT.show_limit == 1 &&
434
+ <Text allowFontScaling={false} style={{ textAlign: "right", marginBottom: 5, fontFamily: "Arial", fontSize: 10, fontWeight: "bold", fontStyle: "normal", letterSpacing: 1, color: LibStyle.colorRed }}> {quotaDifference <= 0 ? "Habis" : quotaDifference > 0 ? "Tersisa " + LibUtils.number(quotaDifference) : "Habis"}</Text>
435
+ } */}
436
+
437
+ {
438
+ (ticketWithDate || ticketSpecial) && item.price_id == selectedTicket?.price_id && itemT.date_id == selectedTicket?.list?.date_id &&
439
+ <View style={applyStyle({ marginTop: 4, flexDirection: 'row', marginLeft: 8, alignContent: 'center', alignItems: 'center' })}>
440
+ <Pressable hitSlop={{ top: 15, left: 15, right: 15, bottom: 15 }} testID='minus_btn' onPress={() => { min() }}>
441
+ <View style={applyStyle({ padding: 1, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
442
+ <LibIcon name="minus" color="#e74c3c" />
443
+ </View>
444
+ </Pressable>
445
+ <Text style={applyStyle({ fontFamily: "Arial", fontSize: 20, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#9b9b9b", marginLeft: 13, marginRight: 13 })}>{qty}</Text>
446
+ {/* </TouchableOpacity> */}
447
+ <Pressable hitSlop={{ top: 15, left: 15, right: 15, bottom: 15 }} testID='plus_btn' onPress={() => {
448
+ add(itemT.quota, itemT.quota_used)
449
+ }}>
450
+ <View style={applyStyle({ padding: 1, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
451
+ <LibIcon name="plus" color="#16a085" />
452
+ </View>
453
+ </Pressable>
454
+ </View>
455
+ }
456
+ </View>
457
+ {
458
+ ticketWithDate && itemT.schedule?.artist?.length > 0 &&
459
+ <TouchableOpacity onPress={() => {
460
+ if (item.status == 1 && itemT.status == 1) {
461
+ let itemTicket = {
462
+ ...item
463
+ }
464
+ let replaceList = LibObject.set(itemTicket, itemT)('list')
465
+ // ini jika dia gajadi beli dari halaman schedule.
466
+ setSelectedTicket(replaceList)
467
+ setQtyGlobal(itemT)
468
+ // releaseQueue()
469
+ // ini untuk dikirim ke halaman schedule
470
+ let dataPost: any = {
471
+ event_id: availableResult?.id,
472
+ event_title: availableResult?.title,
473
+ charge_payment: availableResult?.charge_payment,
474
+ charge_payment_type: availableResult?.charge_payment_type,
475
+ images: availableResult?.images,
476
+ selected_ticket: replaceList,
477
+ qty: getQty(),
478
+ }
479
+
480
+ LibNavigation.navigate('event/schedule', {
481
+ schedule: itemT.schedule,
482
+ order_type: bboConfig?.order_type?.ticket,
483
+ tax: selectedTicket?.tax == null ? 0 : selectedTicket?.tax,
484
+ dataBookingEvent: dataPost
485
+ })
486
+ }
487
+
488
+
489
+ }} activeOpacity={itemT.status == 1 ? 0 : 1} style={applyStyle({ padding: 5, opacity: 1 })} hitSlop={{ top: 15, left: 15, right: 15, bottom: 15 }} >
490
+ <LibIcon name="information-outline" size={18} color={"#434343"} style={{ opacity: textOpacity }} />
491
+ </TouchableOpacity>
492
+ }
493
+
494
+ </View>
495
+ </TouchableOpacity>
496
+ )
497
+ }
498
+
499
+
500
+ let listLength = new Array(10).fill('')
501
+
502
+
503
+ const maxDisplay = 3;
504
+
505
+ const handleShowAll = (price_id: any) => {
506
+ setShowAll((prevShowAll: any) => ({
507
+ ...prevShowAll,
508
+ [price_id]: !prevShowAll[price_id],
509
+ }));
510
+ };
511
+
512
+ return (
513
+ <View style={{ flex: 1, backgroundColor: "#fff" }}>
514
+ <LibFocus onFocus={() => {
515
+ onRefresh();
516
+ }} />
517
+ <ComponentHeader title={esp.lang("event/ticket_list", "buy_ticket")} subtitle={esp.lang("event/ticket_list", "choose_date")} />
518
+ {
519
+ !availableResult ?
520
+ <LibSkeleton>
521
+ {
522
+ listLength.map((item: any, i: number) => {
523
+ return (
524
+ <View key={i}>
525
+ <View style={{ height: 30, width: '100%', backgroundColor: '#fff' }} />
526
+ <View style={{ padding: 10, width: '100%', flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' }}>
527
+ <View style={{ flexDirection: 'row' }}>
528
+ <View style={{ backgroundColor: '#fff', height: 42, width: 42, borderRadius: 3, marginRight: 10 }} />
529
+ <View style={{ width: '60%' }}>
530
+ <View style={{ backgroundColor: '#fff', height: 20, width: '40%' }} />
531
+ <View style={{ backgroundColor: '#fff', marginTop: 7, height: 14, width: '70%' }} />
532
+ </View>
533
+ </View>
534
+ <View style={{ backgroundColor: '#fff', height: 20, width: '10%' }} />
535
+ </View>
536
+ </View>
537
+ )
538
+ })
539
+ }
540
+ </LibSkeleton>
541
+ :
542
+ <>
543
+ {
544
+ Object.values(pendingData).filter((item: any) => item?.order_type == "ticket").length > 0 &&
545
+ <ComponentPending_trx
546
+ onPress={() => {
547
+ LibNavigation.navigate('bigbang/loading_page_list', {
548
+ order_type: 'ticket'
549
+ })
550
+ }}
551
+ order_type="ticket"
552
+ title={esp.lang("event/ticket_list", "pending", String(Object.values(pendingData).filter((item: any) => item?.order_type == "ticket").length))}
553
+ />
554
+ }
555
+ {
556
+ isInPricingQueueConfig(availableResult?.id) && isPass ?
557
+ <LibEffect deps={[]}>
558
+ <View style={{ backgroundColor: LibStyle.colorGreen, margin: 16, borderRadius: 5, padding: 10, ...LibStyle.elevation(2) }} >
559
+ <LibTextstyle text={esp.lang("event/ticket_list", "select_ticket")} textStyle='caption1' style={{ color: 'white' }} />
560
+ <MarketCountdown
561
+ onExpired={() => {
562
+ LibNavigation.navigate("event/detail")
563
+ }}
564
+ expired={timer}
565
+ style={{ color: "#fff", fontWeight: 'bold' }} />
566
+ </View>
567
+ </LibEffect>
568
+ : null
569
+ }
570
+ <ScrollView refreshControl={<RefreshControl refreshing={false} onRefresh={onRefresh} />}>
571
+ {
572
+ availableResult?.image_map != "" &&
573
+ <ComponentTouchable onPress={() => {
574
+ LibNavigation.navigate('lib/gallery', { image: availableResult?.image_map })
575
+ }} style={{ marginBottom: 10, marginTop: 20 }}>
576
+ <LibPicture source={{ uri: availableResult?.image_map }} style={applyStyle({ alignSelf: 'center', height: LibStyle.width * 0.5, width: LibStyle.width })} resizeMode="contain" />
577
+ </ComponentTouchable>
578
+ }
579
+ <View style={{ flex: 1 }}>
580
+ {
581
+ availableResult?.price_type?.map?.((item: any, i: number) => {
582
+ let textOpacity = item?.status == 1 ? 1 : 0.3
583
+ let filterFullData = availableResult?.price_type?.filter((it: any) => it.status != 0)
584
+ const displayedData = showAll[item.price_id] ? item?.list : item?.list.slice(0, maxDisplay);
585
+
586
+ let selTic = item.price_id == selectedTicket?.price_id
587
+ let ticketWithDate = item.price_date == 1 && item.use_code == 0
588
+
589
+ return (
590
+ <Pressable onPress={() => {
591
+
592
+ }} key={i} style={{ overflow: 'hidden', margin: 15, marginBottom: 5, backgroundColor: '#fff', borderRadius: 10, ...LibStyle.elevation(2), borderWidth: 1, borderColor: selTic ? LibStyle.colorBlue : LibStyle.colorBgGrey }}>
593
+ <View style={{ padding: 10, backgroundColor: '#f1f2f3', borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
594
+ <View style={{ alignContent: 'center', alignItems: 'center', flexDirection: 'row', justifyContent: 'space-between', }}>
595
+ <View>
596
+ <LibHtmltext allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.type}
597
+ {
598
+ item.qty_min > 1 &&
599
+ <Text style={{ color: LibStyle.colorRed, fontSize: 10, fontWeight: 'normal' }}> {"(" + esp.lang("event/ticket_list", "min_order") + LibUtils.number(item.qty_min) + ")"}</Text>
600
+ }
601
+ </LibHtmltext>
602
+ {
603
+ deeplinkParams?.type == 'event-voucher' && deeplinkParams?.price_id == item.price_id ?
604
+ <Text allowFontScaling={false} style={{ color: "coral", fontSize: 12, fontWeight: 'bold' }}>{esp.lang("event/ticket_list", "applied_code", deeplinkParams?.code)}</Text>
605
+ : null
606
+ }
607
+ </View>
608
+ {/* {
609
+ item.use_quota == true &&
610
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', color: LibStyle.colorRed, fontSize: 12 }}>{parseInt(item.quota) == item.quota_used ? esp.lang("event/ticket_list", "empty") : (esp.lang("event/ticket_list", "qty_left",LibUtils.number(parseInt(item.quota) - item.quota_used)))}</Text>
611
+ } */}
612
+ {
613
+ item?.status != 1 &&
614
+ <View style={applyStyle({ flexDirection: 'row' })}>
615
+ <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 })}>
616
+ <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>
617
+ </View>
618
+ </View>
619
+ }
620
+ </View>
621
+ {
622
+ item.info != "" && ticketWithDate &&
623
+ <View style={{ marginTop: 3, alignContent: 'center', alignItems: 'center', flexDirection: 'row', marginRight: 5 }}>
624
+ <Text allowFontScaling={false} style={{ fontSize: 12, color: LibStyle.colorBlue }}>{item.info}</Text>
625
+ </View>
626
+ }
627
+ </View>
628
+ {
629
+ displayedData?.map((itemT: any, iT: number) => renderItem(item, itemT, iT))
630
+ }
631
+
632
+ {
633
+ filterFullData[i].list?.length > 3 &&
634
+ <TouchableOpacity onPress={() => {
635
+ handleShowAll(item.price_id)
636
+ }} style={{ borderTopColor: LibStyle.colorGrey, borderTopWidth: 0.8, flex: 1, padding: 8, flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
637
+ <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>
638
+ <LibIcon name={showAll[item.price_id] ? 'chevron-up-circle-outline' : 'chevron-down-circle-outline'} color={LibStyle.colorBlue} size={18} />
639
+ </TouchableOpacity>
640
+ }
641
+
642
+ </Pressable>
643
+ )
644
+ })
645
+ }
646
+
647
+ {/* ini view yang dibawah */}
648
+ <View style={{ marginTop: 30 }}>
649
+ {
650
+ unAvailableResult?.price_type?.length > 0 &&
651
+ <View style={{ margin: 15, marginTop: 0, marginBottom: 0, paddingBottom: 10, borderBottomWidth: 1, borderBottomColor: LibStyle.colorGrey }}>
652
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 16 }}>{esp.lang("event/ticket_list", "ticket_not_available")}</Text>
653
+ </View>
654
+ }
655
+ {
656
+ unAvailableResult?.price_type?.map?.((item: any, i: number) => {
657
+ let selTic = item.price_id == selectedTicket?.price_id
658
+ let textOpacity = item?.status == 1 ? 1 : 0.3
659
+ let ticketWithDate = item.price_date == 1 && item.use_code == 0
660
+ return (
661
+ <View key={i} style={{ overflow: 'hidden', margin: 15, marginBottom: 5, backgroundColor: '#fff', borderRadius: 10, ...LibStyle.elevation(2), borderWidth: 1, borderColor: selTic ? LibStyle.colorBlue : LibStyle.colorBgGrey }}>
662
+ <View style={{ padding: 10, backgroundColor: '#f1f2f3', borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
663
+ <View style={{ alignContent: 'center', alignItems: 'center', flexDirection: 'row', justifyContent: 'space-between', }}>
664
+ <View style={{ flex: 3 }}>
665
+ <LibHtmltext allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.type}</LibHtmltext>
666
+ </View>
667
+ {
668
+ item?.status != 1 &&
669
+ <View style={applyStyle({ flex: 1, justifyContent: 'flex-end', flexDirection: 'row' })}>
670
+ <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 })}>
671
+ <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>
672
+ </View>
673
+ </View>
674
+ }
675
+ </View>
676
+ {
677
+ item.info != "" && ticketWithDate &&
678
+ <View style={{ marginTop: 3, alignContent: 'center', alignItems: 'center', flexDirection: 'row', marginRight: 5 }}>
679
+ <Text allowFontScaling={false} style={{ fontSize: 12, color: LibStyle.colorBlue }}>{item.info}</Text>
680
+ </View>
681
+ }
682
+ </View>
683
+ {
684
+ item?.list?.map((itemT: any, iT: number) => renderItem(item, itemT, iT))
685
+ }
686
+ </View>
687
+ )
688
+ })
689
+ }
690
+ </View>
691
+ </View>
692
+ </ScrollView>
693
+
694
+
695
+ <View style={applyStyle({ margin: 10, marginVertical: 5 })}>
696
+ {
697
+ availableResult?.price_type_info != "" &&
698
+ <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>
699
+ }
700
+ <ComponentButton testID={"next_btn"} label={esp.lang("event/ticket_list", "next")} onPress={() => {
701
+ if (!selectedTicket) {
702
+ LibToastProperty.show(esp.lang("event/ticket_list", "ticket_not_select"), 3000)
703
+ return
704
+ }
705
+ if (selectedTicket?.use_code == 1) {
706
+ checkInvBlock()
707
+ }
708
+ // else if (selectedTicket?.config?.seat_autopick == 1 && getQty() > 1) {
709
+ // chooseBestSeat()
710
+ // }
711
+ else {
712
+ nextStep();
713
+ }
714
+
715
+ }} style={applyStyle({ backgroundColor: selectedTicket ? LibStyle.colorPrimary : "#f1f2f3" })} />
716
+ </View>
717
+ </>
718
+ }
719
+
720
+ </View>
721
+ )
722
+ }