esoftplay-event 0.0.1 → 0.0.2

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 (83) hide show
  1. package/event/artist.tsx +11 -7
  2. package/event/artist_detail.tsx +3 -5
  3. package/event/artist_detailv2.tsx +386 -0
  4. package/event/artistv2.tsx +162 -0
  5. package/event/button_order_detail.tsx +43 -0
  6. package/event/countdown_base.tsx +16 -3
  7. package/event/countdown_event.tsx +47 -0
  8. package/event/detail.tsx +30 -37
  9. package/event/detail2.tsx +354 -0
  10. package/event/exchange_ticket.tsx +1 -1
  11. package/event/exchange_ticket_list.tsx +2 -3
  12. package/event/exchange_ticket_result.tsx +1 -1
  13. package/event/firebase_socket.ts +8 -0
  14. package/event/loading_page.tsx +4 -2
  15. package/event/order.tsx +23 -36
  16. package/event/order_detail.tsx +119 -41
  17. package/event/order_detail_upgrade.tsx +8 -5
  18. package/event/order_detail_upgrade_payment.tsx +17 -11
  19. package/event/order_detail_visitor.tsx +33 -33
  20. package/event/order_detail_waiting.tsx +45 -20
  21. package/event/order_item.tsx +1 -1
  22. package/event/order_lottery.tsx +48 -36
  23. package/event/order_reschedule.tsx +50 -52
  24. package/event/order_share_to.tsx +11 -24
  25. package/event/order_share_to_detail.tsx +8 -3
  26. package/event/order_waiting.tsx +1 -1
  27. package/event/queue_pricing.tsx +16 -3
  28. package/event/refresh_button.tsx +3 -5
  29. package/event/scan_item.tsx +2 -2
  30. package/event/seat.tsx +19 -11
  31. package/event/seat_map_new.tsx +313 -0
  32. package/event/secure_page.debug.tsx +34 -0
  33. package/event/secure_page.live.tsx +35 -0
  34. package/event/secure_page.tsx +6 -5
  35. package/event/test.tsx +240 -155
  36. package/event/ticket_list.tsx +49 -21
  37. package/event/ticket_list2.tsx +83 -34
  38. package/event/tms_check_code.tsx +6 -0
  39. package/event/tms_check_ticket_result.tsx +36 -7
  40. package/event/tms_dashboard.tsx +85 -3
  41. package/event/tms_gate.tsx +6 -0
  42. package/event/tms_home.tsx +1 -4
  43. package/event/tms_in_failed.tsx +1 -1
  44. package/event/tms_in_log.tsx +2 -0
  45. package/event/tms_in_success.tsx +1 -1
  46. package/event/tms_log.tsx +10 -25
  47. package/event/tms_out.tsx +1 -1
  48. package/event/tms_out_failed.tsx +1 -1
  49. package/event/visitor_input.tsx +23 -5
  50. package/event/visitor_inputv2.tsx +397 -0
  51. package/event/voucher.tsx +2 -0
  52. package/event/voucher2.tsx +14 -6
  53. package/id.json +25 -9
  54. package/package.json +1 -1
  55. package/event/entrance.tsx +0 -215
  56. package/event/entrance_again.tsx +0 -199
  57. package/event/entrance_failed.tsx +0 -190
  58. package/event/entrance_idcard.tsx +0 -199
  59. package/event/entrance_list.tsx +0 -264
  60. package/event/entrance_list_item.tsx +0 -88
  61. package/event/entrance_log.tsx +0 -130
  62. package/event/entrance_success.tsx +0 -153
  63. package/event/entrance_warning.tsx +0 -91
  64. package/event/exit.tsx +0 -91
  65. package/event/exit_failed.tsx +0 -135
  66. package/event/exit_list.tsx +0 -118
  67. package/event/exit_log.tsx +0 -130
  68. package/event/exit_success.tsx +0 -143
  69. package/event/exit_temporary.tsx +0 -226
  70. package/event/firebase_socket.debug.ts +0 -260
  71. package/event/firebase_socket.live.ts +0 -335
  72. package/event/hall_in.tsx +0 -148
  73. package/event/hall_in_failed.tsx +0 -270
  74. package/event/hall_in_list.tsx +0 -222
  75. package/event/hall_in_log.tsx +0 -134
  76. package/event/hall_in_success.tsx +0 -132
  77. package/event/hall_out.tsx +0 -143
  78. package/event/hall_out_failed.tsx +0 -133
  79. package/event/hall_out_list.tsx +0 -215
  80. package/event/hall_out_log.tsx +0 -133
  81. package/event/hall_out_success.tsx +0 -130
  82. package/event/log.tsx +0 -433
  83. package/event/seat_map_test.tsx +0 -401
@@ -23,9 +23,11 @@ import { EventConfigProperty } from 'esoftplay/cache/event/config/import';
23
23
  import { EventCountdownProperty } from 'esoftplay/cache/event/countdown/import';
24
24
  import { EventCountdown_base } from 'esoftplay/cache/event/countdown_base/import';
25
25
  import { EventFirebase_socket, EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
26
+ import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
26
27
  import { EventLoading_pageProperty } from 'esoftplay/cache/event/loading_page/import';
27
28
  import { EventQueue_pricingProperty } from 'esoftplay/cache/event/queue_pricing/import';
28
29
  import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
30
+ import { UseCondition } from 'esoftplay/cache/use/condition/import';
29
31
  import { UseTasks } from 'esoftplay/cache/use/tasks/import';
30
32
  import moment from 'esoftplay/moment';
31
33
  import React from 'react';
@@ -135,11 +137,12 @@ export default function m(props: EventTicket_list2Props): any {
135
137
 
136
138
  const [pendingData] = EventLoading_pageProperty.state().useState()
137
139
 
138
- const { has_addition, has_addition_global, url, fee_platform, subscribed, show_fee_percentage }: any = useRef(LibNavigation.getArgsAll(props)).current
140
+ const { url, is_multiprice, fee_platform, subscribed, show_fee_percentage }: any = useRef(LibNavigation.getArgsAll(props)).current
139
141
 
140
142
  const [deeplinkParams] = UseDeeplinkProperty.params.useState()
141
143
  const [timer] = EventCountdownProperty.countdownTime.useState()
142
144
  const [unAvailableResult, setUnavailableResult] = useLazyState<any>()
145
+ const [, setHasAdditionGlobal, getHasAdditionGlobal] = useLazyState<any>()
143
146
  const [availableResult, setAvailableResult, getAvailableResult] = useSafeState<Result>()
144
147
  const [, setDataPostBooking, getDataPostBooking] = useLazyState<any>([])
145
148
  const [dataAddition, setDataAddition] = useSafeState<any>([])
@@ -147,8 +150,6 @@ export default function m(props: EventTicket_list2Props): any {
147
150
  const [showAll, setShowAll] = useSafeState<any>({});
148
151
  const [urlPayment, setUrlPayment] = useLazyState<any>()
149
152
 
150
- // esp.log(availableResult);
151
-
152
153
  let dataEvent: any = {
153
154
  event_id: availableResult?.id,
154
155
  event_title: availableResult?.title,
@@ -159,8 +160,8 @@ export default function m(props: EventTicket_list2Props): any {
159
160
 
160
161
  const [ticketSeat, resetTicketSeat] = taskSeat((item: any) => new Promise((next) => {
161
162
  if (item.use_seat == 1) {
162
- if (item.adjacent_seats == 0) {
163
- LibNavigation.navigateForResult('event/seat_map', {
163
+ if (item.adjacent_seats == undefined || item.adjacent_seats == 0) {
164
+ LibNavigation.navigateForResult('event/seat_map_new', {
164
165
  url: 'event_seat',
165
166
  dataTicket: {
166
167
  ...dataEvent,
@@ -209,7 +210,7 @@ export default function m(props: EventTicket_list2Props): any {
209
210
  })
210
211
 
211
212
 
212
- if (has_addition_global == 1) {
213
+ if (getHasAdditionGlobal() == 1) {
213
214
  LibNavigation.navigateForResult('event/additional', {
214
215
  event_id: dataEvent?.event_id,
215
216
  qty: 1,
@@ -231,7 +232,7 @@ export default function m(props: EventTicket_list2Props): any {
231
232
 
232
233
 
233
234
  const [ticketAdditional, resetTicketAdditional] = taskAdditional((item: any) => new Promise((next) => {
234
- if (has_addition == 1 || item.has_addition && item.has_addition == 1) {
235
+ if (item.has_addition && item.has_addition == 1) {
235
236
  LibNavigation.navigateForResult('event/additional', {
236
237
  event_id: dataEvent?.event_id,
237
238
  qty: item.qty,
@@ -291,12 +292,14 @@ export default function m(props: EventTicket_list2Props): any {
291
292
 
292
293
  function loadData() {
293
294
  new LibCurl(url, null, (res, msg) => {
295
+ esp.log(res, url);
294
296
  const availablePriceType = LibObject.update(res, (arr: any[]) => arr.filter((x) => x.status != 0))('price_type')
295
297
  const unAvailablePriceType = LibObject.update(res, (arr: any[]) => arr.filter((x) => x.status == 0))('price_type')
296
298
 
297
299
  setUnavailableResult(unAvailablePriceType)
298
300
  setAvailableResult(availablePriceType)
299
301
  setUrlPayment(res?.url_payment)
302
+ setHasAdditionGlobal(res?.has_addition_global)
300
303
 
301
304
  if (res.form_allotment == 1) {
302
305
  releaseQueue()
@@ -325,6 +328,7 @@ export default function m(props: EventTicket_list2Props): any {
325
328
  }
326
329
 
327
330
 
331
+
328
332
  function checkSeatMap() {
329
333
  let newResult: any[] = [];
330
334
 
@@ -336,7 +340,9 @@ export default function m(props: EventTicket_list2Props): any {
336
340
  tax: priceType?.tax,
337
341
  term: priceType?.term,
338
342
  has_addition: priceType?.has_addition,
339
- image_map: priceType?.image_map
343
+ image_map: priceType?.image_map,
344
+ use_seat: priceType?.use_seat,
345
+ adjacent_seats: priceType?.config?.seat_autopick,
340
346
  }))
341
347
 
342
348
  newResult = newResult.concat(filteredList);
@@ -346,9 +352,39 @@ export default function m(props: EventTicket_list2Props): any {
346
352
  setDataPostBooking(newResult)
347
353
  resetTicketSeat()
348
354
  ticketSeat(newResult.filter((x: any) => x.selected == 1))
349
- // esp.log(newResult.filter((x: any) => x.selected == 1));
350
355
  }
351
356
 
357
+ function selectSinglePrice(priceTypes: any, selectedItem: any) {
358
+ return priceTypes.map((priceType: any) => {
359
+ // reset parent
360
+ let updated = {
361
+ ...priceType,
362
+ selected: 0,
363
+ qty: 0,
364
+ list: priceType.list.map((child: any) => ({
365
+ ...child,
366
+ selected: 0,
367
+ qty: 0
368
+ }))
369
+ };
370
+
371
+ // kalau cocok, aktifkan parent & child
372
+ if (priceType.price_id === selectedItem.price_id) {
373
+ updated.selected = 1;
374
+ updated.qty = selectedItem.qty_min;
375
+
376
+ updated.list = updated.list.map((child: any) => ({
377
+ ...child,
378
+ selected: 1,
379
+ qty: selectedItem.qty_min
380
+ }));
381
+ }
382
+
383
+ return updated;
384
+ });
385
+ }
386
+
387
+ // contoh penggunaan:
352
388
 
353
389
  function renderItem(itemC: any, iC: number, item: any, i: number) {
354
390
  // itemC adalah item yang ada diindex list, kalo item itu adalah item yang ada diindex price_type
@@ -375,23 +411,34 @@ export default function m(props: EventTicket_list2Props): any {
375
411
  }
376
412
  // let msg = item.status == 0 ? esp.lang("event/ticket_list", "sold_out") : esp.lang("event/ticket_list", "coming_soon")
377
413
  if (itemC.status == 1 && item.status == 1) {
378
- const data = new LibObject(getAvailableResult())
379
- .update((itemList) => {
380
- itemList.selected = itemList.selected == 1 ? 0 : 1
381
- itemList.qty = itemList.selected == 1 ? item.qty_min : 0
382
- itemList.adjacent_seats = item.config?.seat_autopick
383
- itemList.use_seat = item.use_seat
384
- return itemList
385
- })('price_type', i, 'list', iC)
386
- .update((priceTypeItem) => {
387
- return ({
388
- ...priceTypeItem,
389
- selected: priceTypeItem.list.some((item: any) => item.selected == 1) ? 1 : 0
390
- })
391
- })('price_type', i)
392
- .value()
414
+ if (is_multiprice) {
415
+ const data = new LibObject(getAvailableResult())
416
+ .update((itemList) => {
417
+ itemList.selected = itemList.selected == 1 ? 0 : 1
418
+ itemList.qty = itemList.selected == 1 ? item.qty_min : 0
419
+ itemList.adjacent_seats = item.config?.seat_autopick
420
+ itemList.use_seat = item.use_seat
421
+ return itemList
422
+ })('price_type', i, 'list', iC)
423
+ .update((priceTypeItem) => {
424
+ return ({
425
+ ...priceTypeItem,
426
+ selected: priceTypeItem.list.some((item: any) => item.selected == 1) ? 1 : 0
427
+ })
428
+ })('price_type', i)
429
+ .value()
430
+
431
+ setAvailableResult(data)
432
+ } else {
433
+ const updatedData = selectSinglePrice(availableResult?.price_type, { price_id: item?.price_id, qty_min: item?.qty_min });
434
+ const data = {
435
+ ...getAvailableResult(),
436
+ price_type: updatedData
437
+ }
438
+
439
+ setAvailableResult(data)
440
+ }
393
441
 
394
- setAvailableResult(data)
395
442
  } else if (itemC.status == 0) {
396
443
  LibToastProperty.show(msg)
397
444
  } else if (itemC.status == 2) {
@@ -439,7 +486,7 @@ export default function m(props: EventTicket_list2Props): any {
439
486
  {<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' }}>{item.type}</Text>}
440
487
  {
441
488
  item.info != "" &&
442
- <Text allowFontScaling={false} numberOfLines={3} style={{ flexWrap: 'wrap', fontFamily: "Arial", fontSize: 11, fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' }} >{item.info}</Text>
489
+ <EventHtmltext allowFontScaling={false} style={{ flexWrap: 'wrap', fontFamily: "Arial", fontSize: 11, fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' }}>{item.info}</EventHtmltext>
443
490
  }
444
491
  </View>
445
492
  </View>
@@ -562,12 +609,14 @@ export default function m(props: EventTicket_list2Props): any {
562
609
  }
563
610
 
564
611
  <ScrollView refreshControl={<RefreshControl refreshing={false} onRefresh={onRefresh} />}>
565
- <EventAlert
566
- color={LibStyle.colorPrimary}
567
- msg={esp.lang("event/ticket_list2", "u_can_choose_multiple")}
568
- style={{ marginHorizontal: 15 }}
569
- useIcon
570
- />
612
+ <UseCondition if={is_multiprice == 1} >
613
+ <EventAlert
614
+ color={LibStyle.colorPrimary}
615
+ msg={esp.lang("event/ticket_list2", "u_can_choose_multiple")}
616
+ style={{ marginHorizontal: 15 }}
617
+ useIcon
618
+ />
619
+ </UseCondition>
571
620
  {
572
621
  availableResult?.image_map != "" &&
573
622
  <TouchableOpacity onPress={() => {
@@ -592,12 +641,12 @@ export default function m(props: EventTicket_list2Props): any {
592
641
  <View style={{ padding: 10, backgroundColor: '#f1f2f3', borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
593
642
  <View style={{ alignContent: 'center', alignItems: 'center', flexDirection: 'row', justifyContent: 'space-between', }}>
594
643
  <View>
595
- <Text allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.type}
644
+ <EventHtmltext allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.type}
596
645
  {
597
646
  item.qty_min > 1 &&
598
647
  <Text style={{ color: LibStyle.colorRed, fontSize: 10, fontWeight: 'normal' }}> {"(" + esp.lang("event/ticket_list", "min_order") + LibUtils.number(item.qty_min) + ")"}</Text>
599
648
  }
600
- </Text>
649
+ </EventHtmltext>
601
650
  {
602
651
  deeplinkParams?.type == 'event-voucher' && deeplinkParams?.price_id == item.price_id ?
603
652
  <Text allowFontScaling={false} style={{ color: "coral", fontSize: 12, fontWeight: 'bold' }}>{esp.lang("event/ticket_list", "applied_code", deeplinkParams?.code)}</Text>
@@ -98,6 +98,8 @@ export default function m(props: EventTms_check_codeProps): any {
98
98
  )
99
99
  }
100
100
 
101
+ esp.log(result);
102
+
101
103
  return (
102
104
  <View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
103
105
  <EventHeader title={tab?.title} />
@@ -151,6 +153,10 @@ export default function m(props: EventTms_check_codeProps): any {
151
153
  <LibTextstyle text={result?.data?.exhibitor_name} textStyle="headline" style={{ fontWeight: 'bold' }} />
152
154
  }
153
155
  <LibTextstyle text={result?.info} textStyle="m_body1" style={{ lineHeight: 20, marginTop: 10 }} />
156
+ {
157
+ result?.is_claimed == true &&
158
+ <LibTextstyle text={result?.data?.status_label} textStyle="m_overline" style={{ marginTop: 10, fontWeight: 'bold', fontSize: 12, color: result?.data?.status_color }} />
159
+ }
154
160
  </View>
155
161
  }
156
162
  </ScrollView>
@@ -72,34 +72,51 @@ export default function m(props: EventTms_check_ticket_resultProps): any {
72
72
  }
73
73
 
74
74
  function renderTmsIn(item: any, i: number) {
75
+ let timeScannedIn = LibUtils.moment(item.scanned_in).serverFormat("DD MMM HH:mm:ss ", item.timezone)
76
+ let timezone = item.hasOwnProperty("timezone_locale") ? item?.timezone_locale : ""
75
77
  return (
76
78
  <View key={i} style={{ borderRadius: 5, margin: 2, padding: 5, backgroundColor: i % 2 ? '#fff' : LibStyle.colorGrey, borderBottomWidth: 1, borderBottomColor: LibStyle.colorBgGrey }}>
77
79
  {
78
80
  item.tms_name != "" &&
79
81
  <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item.tms_name}</Text>
80
82
  }
81
- <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item?.scanned_in != "0000-00-00 00:00:00" ? LibUtils.moment(item.scanned_in).serverFormat("DD MMM HH:mm:ss ") : esp.lang("event/tms_check_ticket_result", "not_scan_in")}</Text>
83
+ <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item?.scanned_in != "0000-00-00 00:00:00" ?
84
+ timeScannedIn + timezone
85
+ :
86
+ esp.lang("event/tms_check_ticket_result", "not_scan_in")}</Text>
82
87
 
83
88
  </View>
84
89
  )
85
90
  }
86
91
 
87
92
  function renderTmsOut(item: any, i: number) {
93
+ let timeScannedOut = LibUtils.moment(item.scanned_out).serverFormat("DD MMM HH:mm:ss ", item.timezone)
94
+ let timezone = item.hasOwnProperty("timezone_locale") ? item?.timezone_locale : ""
95
+
88
96
  return (
89
97
  <View key={i} style={{ borderRadius: 5, margin: 2, padding: 5, backgroundColor: i % 2 ? '#fff' : LibStyle.colorGrey, borderBottomWidth: 1, borderBottomColor: LibStyle.colorBgGrey }}>
90
98
  {
91
99
  item.tms_name_out != null && item.tms_name_out != "" &&
92
100
  <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item.tms_name_out}</Text>
93
101
  }
94
- <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item?.scanned_out != "0000-00-00 00:00:00" ? LibUtils.moment(item.scanned_out).serverFormat("DD MMM HH:mm:ss ") : esp.lang("event/tms_check_ticket_result", "not_scan_out")}</Text>
102
+ <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item?.scanned_out != "0000-00-00 00:00:00" ?
103
+ timeScannedOut + timezone
104
+ :
105
+ esp.lang("event/tms_check_ticket_result", "not_scan_out")}</Text>
95
106
  </View>
96
107
  )
97
108
  }
98
109
 
99
110
  function renderTempOut(item: any, i: number) {
111
+ let timeScannedTempOut = LibUtils.moment(item.scanned_out_temporary).serverFormat("DD MMM HH:mm:ss ", item.timezone)
112
+ let timezone = item.hasOwnProperty("timezone_locale") ? item?.timezone_locale : ""
113
+
100
114
  return (
101
115
  <View key={i} style={{ borderRadius: 5, margin: 2, padding: 5, backgroundColor: i % 2 ? '#fff' : LibStyle.colorGrey, borderBottomWidth: 1, borderBottomColor: LibStyle.colorBgGrey }}>
102
- <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item.hasOwnProperty("scanned_out_temporary") && item?.scanned_out_temporary != "0000-00-00 00:00:00" ? LibUtils.moment(item.scanned_out_temporary).serverFormat("DD MMM HH:mm:ss ") : "Belum pernah scan keluar sementara"}</Text>
116
+ <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item.hasOwnProperty("scanned_out_temporary") && item?.scanned_out_temporary != "0000-00-00 00:00:00" ?
117
+ timeScannedTempOut + timezone
118
+ :
119
+ esp.lang("event/tms_check_ticket_result", "notyet_scan_temp_out")}</Text>
103
120
  </View>
104
121
  )
105
122
  }
@@ -113,26 +130,38 @@ export default function m(props: EventTms_check_ticket_resultProps): any {
113
130
  }
114
131
 
115
132
  function renderHallIn(item: any, i: number) {
133
+ let timeScannedIn = LibUtils.moment(item.scanned_in).serverFormat("DD MMM HH:mm:ss ", item.timezone)
134
+ let timezone = item.hasOwnProperty("timezone_locale") ? item?.timezone_locale : ""
135
+
116
136
  return (
117
137
  <View key={i} style={{ borderRadius: 5, margin: 2, padding: 5, backgroundColor: i % 2 ? '#fff' : LibStyle.colorGrey, borderBottomWidth: 1, borderBottomColor: LibStyle.colorBgGrey }}>
118
138
  {
119
139
  item.tms_name != "" &&
120
140
  <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item.tms_name}</Text>
121
141
  }
122
- <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item?.scanned_in != "0000-00-00 00:00:00" ? LibUtils.moment(item.scanned_in).serverFormat("DD MMM HH:mm:ss ") : esp.lang("event/tms_check_ticket_result", "not_scan_in")}</Text>
142
+ <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item?.scanned_in != "0000-00-00 00:00:00" ?
143
+ timeScannedIn + timezone
144
+ :
145
+ esp.lang("event/tms_check_ticket_result", "not_scan_in")}</Text>
123
146
 
124
147
  </View>
125
148
  )
126
149
  }
127
150
 
128
151
  function renderHallOut(item: any, i: number) {
152
+ let timeScannedOut = LibUtils.moment(item.scanned_out).serverFormat("DD MMM HH:mm:ss ", item.timezone)
153
+ let timezone = item.hasOwnProperty("timezone_locale") ? item?.timezone_locale : ""
154
+
129
155
  return (
130
156
  <View key={i} style={{ borderRadius: 5, margin: 2, padding: 5, backgroundColor: i % 2 ? '#fff' : LibStyle.colorGrey, borderBottomWidth: 1, borderBottomColor: LibStyle.colorBgGrey }}>
131
157
  {
132
158
  item.tms_name_out != "" &&
133
159
  <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item.tms_name_out}</Text>
134
160
  }
135
- <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item?.scanned_out != "0000-00-00 00:00:00" ? LibUtils.moment(item.scanned_out).serverFormat("DD MMM HH:mm:ss ") : esp.lang("event/tms_check_ticket_result", "not_scan_out")}</Text>
161
+ <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item?.scanned_out != "0000-00-00 00:00:00" ?
162
+ timeScannedOut + timezone
163
+ :
164
+ esp.lang("event/tms_check_ticket_result", "not_scan_out")}</Text>
136
165
 
137
166
  </View>
138
167
  )
@@ -222,10 +251,10 @@ export default function m(props: EventTms_check_ticket_resultProps): any {
222
251
  <View style={{ marginBottom: 10, flexDirection: 'row', flexWrap: 'wrap', marginLeft: -10 }}>
223
252
  {
224
253
  item?.tickets?.map((x: any, i: number) => {
225
- if (x.seat_name != "") {
254
+ if (x.seat_label != "") {
226
255
  return (
227
256
  <View key={i} style={{ marginLeft: 10, paddingVertical: 5, marginBottom: 7, paddingHorizontal: 7, borderWidth: 1, borderColor: '#000', backgroundColor: '#fff', borderRadius: 5 }}>
228
- <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 20, color: '#000' }}>{x.seat_name}</Text>
257
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 20, color: '#000' }}>{x.seat_label}</Text>
229
258
  </View>
230
259
 
231
260
  )
@@ -1,10 +1,15 @@
1
1
  // withHooks
2
2
  import { EventHeader } from 'esoftplay/cache/event/header/import';
3
3
  import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
4
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
4
5
  import { LibPicture } from 'esoftplay/cache/lib/picture/import';
6
+ import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
5
7
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
8
+ import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
6
9
  import { UserClass } from 'esoftplay/cache/user/class/import';
7
10
  import esp from 'esoftplay/esp';
11
+ import useGlobalState, { useGlobalReturn } from 'esoftplay/global';
12
+ import { useRef } from 'react';
8
13
 
9
14
  import React from 'react';
10
15
  import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
@@ -16,8 +21,25 @@ export interface EventTms_dashboardArgs {
16
21
  export interface EventTms_dashboardProps {
17
22
 
18
23
  }
24
+
25
+
26
+ const stateClosingData = useGlobalState({
27
+ event_id: 0,
28
+ event_name: '',
29
+ gate_id: 0,
30
+ }, {
31
+ persistKey: 'event/tms_dashboard',
32
+ loadOnInit: true
33
+ })
34
+
35
+ export function closingDataState(): useGlobalReturn<any> {
36
+ return stateClosingData
37
+ }
38
+
19
39
  export default function m(props: EventTms_dashboardProps): any {
20
40
  const [user] = UserClass.state().useState()
41
+ const dialogClosing = useRef<LibSlidingup>(null)
42
+
21
43
  let menus = [
22
44
  {
23
45
  id: 1,
@@ -27,6 +49,9 @@ export default function m(props: EventTms_dashboardProps): any {
27
49
  color_accent: '#FFC523',
28
50
  onPress: () => {
29
51
  LibNavigation.navigateForResult('event/tms_event_list', { data: user?.is_tms }).then((value) => {
52
+ let a = LibObject.set(stateClosingData?.get(), value?.id)('event_id')
53
+ let b = LibObject.set(a, value?.name)('event_name')
54
+ stateClosingData?.set(b)
30
55
  LibNavigation.navigate('event/tms_gate', { is_scanner: value, typeScanner: 'tms' })
31
56
  })
32
57
  }
@@ -48,13 +73,41 @@ export default function m(props: EventTms_dashboardProps): any {
48
73
  title: esp.lang("user/profile", "exchange"),
49
74
  icon: 'menu/ic_redempt.png',
50
75
  active: 1,
51
- color_accent: '#D0004F',
76
+ color_accent: '#800020',
52
77
  onPress: () => {
53
78
  LibNavigation.navigateForResult('event/tms_event_list', { data: user?.is_tms }).then((value) => {
54
79
  LibNavigation.navigate('event/exchange_ticket', { dataEvent: value })
55
80
  })
56
81
  }
57
82
  },
83
+ {
84
+ id: 4,
85
+ title: esp.lang("event/tms_dashboard", "closing_tms"),
86
+ icon: 'failed_icon.png',
87
+ active: 1,
88
+ color_accent: '#D0004F',
89
+ onPress: () => {
90
+ dialogClosing.current?.show()
91
+ }
92
+ },
93
+ ]
94
+
95
+ const options = [
96
+ {
97
+ id: 1,
98
+ title: esp.lang("event/tms_dashboard", "log_tms"),
99
+ onPress: () => {
100
+ LibNavigation.navigate('event/tms_log')
101
+ dialogClosing.current?.show()
102
+ }
103
+ },
104
+ {
105
+ id: 2,
106
+ title: esp.lang("event/tms_dashboard", "log_exchange"),
107
+ onPress: () => {
108
+ dialogClosing.current?.show()
109
+ }
110
+ },
58
111
  ]
59
112
 
60
113
  function renderMenu(item: any, i: number) {
@@ -80,10 +133,39 @@ export default function m(props: EventTms_dashboardProps): any {
80
133
 
81
134
  <ScrollView>
82
135
  {
83
- menus?.map(renderMenu)
136
+ menus?.filter((x: any) => x.active == 1).map(renderMenu)
84
137
  }
85
138
  </ScrollView>
86
-
139
+ <LibSlidingup ref={dialogClosing}>
140
+ <View style={{ alignItems: 'center', marginBottom: 17 }} >
141
+ <View style={{ width: LibStyle.width - 30, borderRadius: 13, overflow: 'hidden', }} >
142
+ <ScrollView showsVerticalScrollIndicator={false} style={{ borderRadius: 13, overflow: 'hidden', backgroundColor: "white", maxHeight: LibStyle.height * 0.5 }} >
143
+ <View style={{ marginVertical: 17 }} >
144
+ <LibTextstyle textStyle="caption1" text={esp.lang("event/tms_dashboard", "closing_tms")} style={{ textAlign: 'center', fontWeight: "bold", color: "#888" }} />
145
+ </View>
146
+ {
147
+ options.map((opt, i) => (
148
+ <TouchableOpacity
149
+ key={i}
150
+ style={{ paddingHorizontal: 17, paddingVertical: 15, alignItems: 'center', borderTopWidth: 1, borderTopColor: "#f4f4f4" }}
151
+ onPress={opt.onPress} >
152
+ <LibTextstyle text={opt.title} textStyle="body" />
153
+ </TouchableOpacity>
154
+ ))
155
+ }
156
+ </ScrollView>
157
+ <View style={{ borderRadius: 13, marginTop: 10, backgroundColor: "white" }} >
158
+ <TouchableOpacity
159
+ style={{ paddingHorizontal: 17, paddingVertical: 15, alignItems: 'center' }}
160
+ onPress={() => {
161
+ dialogClosing.current?.hide()
162
+ }} >
163
+ <LibTextstyle text={esp.lang("event/tms_dashboard", "cancel")} textStyle="body" style={{ fontWeight: "bold", color: LibStyle.colorBlue }} />
164
+ </TouchableOpacity>
165
+ </View>
166
+ </View>
167
+ </View>
168
+ </LibSlidingup>
87
169
  </View>
88
170
  )
89
171
  }
@@ -9,6 +9,8 @@ import { LibStyle } from 'esoftplay/cache/lib/style/import';
9
9
  import esp from 'esoftplay/esp';
10
10
  import useSafeState from 'esoftplay/state';
11
11
 
12
+ import { EventTms_dashboardProperty } from 'esoftplay/cache/event/tms_dashboard/import';
13
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
12
14
  import React, { useEffect } from 'react';
13
15
  import { Pressable, ScrollView, Text, View } from 'react-native';
14
16
 
@@ -40,6 +42,8 @@ export default function m(props: EventTms_gateProps): any {
40
42
  new LibCurl('event_gate', post, (res, msg) => {
41
43
  setGates(res)
42
44
  if (res.length == 1) {
45
+ let a = LibObject.set(EventTms_dashboardProperty.closingDataState().get(), res[0].id)('gate_id')
46
+ EventTms_dashboardProperty.closingDataState().set(a)
43
47
  LibNavigation.back()
44
48
  LibNavigation.navigate('event/tms_home', { is_scanner: is_scanner, selectedGate: res[0], typeScanner: typeScanner })
45
49
  }
@@ -70,6 +74,8 @@ export default function m(props: EventTms_gateProps): any {
70
74
  return (
71
75
  <Pressable key={i} onPress={() => {
72
76
  setSelectGate(item)
77
+ let a = LibObject.set(EventTms_dashboardProperty.closingDataState().get(), item?.id)('gate_id')
78
+ EventTms_dashboardProperty.closingDataState().set(a)
73
79
  LibNavigation.navigate('event/tms_home', { is_scanner: is_scanner, selectedGate: item, typeScanner: typeScanner })
74
80
  }} style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center', backgroundColor: _selectGate ? LibStyle.colorGrey : '#fff', ...LibStyle.elevation(2), padding: 16, marginBottom: 10, marginHorizontal: 15, borderRadius: 5, flex: 1 }}>
75
81
  <LibIcon name={_selectGate ? "radiobox-marked" : "radiobox-blank"} size={18} color={_selectGate ? "#3ea4dc" : "#434343"} />
@@ -491,10 +491,7 @@ export default function m(props: EventTms_homeProps): any {
491
491
  <View style={{ margin: 15, flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
492
492
  {
493
493
  <TouchableOpacity onPress={() => {
494
- LibNavigation.navigate('event/tms_log', {
495
- event_id: is_scanner?.id,
496
- gate: selectedGate
497
- })
494
+ LibNavigation.navigate('event/tms_log')
498
495
  }} style={{ padding: 10, backgroundColor: "#000", borderRadius: 10, ...LibStyle.elevation(2) }}>
499
496
  <Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: '#fff' })} >{esp.lang("event/tms_home", "tms_close")}</Text>
500
497
  </TouchableOpacity>
@@ -145,7 +145,7 @@ export default function m(props: EventTms_in_failedProps): any {
145
145
  <View style={{ flex: 1.2, justifyContent: 'center', paddingVertical: 5 }}>
146
146
  {
147
147
  item.scanned != "0000-00-00 00:00:00" &&
148
- <Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 12 }}>{LibUtils.moment(item.scanned).localeFormat("DD MMM H:mm:ss ")}</Text>
148
+ <Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 12 }}>{LibUtils.moment(item.scanned).localeFormat("DD MMM H:mm:ss ") + (item.timezone_locale != "" ? item.timezone_locale : "")}</Text>
149
149
  }
150
150
  </View>
151
151
  <View style={{ flex: 2, justifyContent: 'center', borderLeftWidth: 1, borderColor: LibStyle.colorBgGrey, paddingVertical: 5 }}>
@@ -49,6 +49,8 @@ export default function m(props: EventTms_in_logProps): any {
49
49
  const [loading, setLoading] = useSafeState<boolean>(true)
50
50
  const timeout = useTimeout()
51
51
 
52
+ esp.log({ log });
53
+
52
54
  function syncData() {
53
55
  EventTms_homeProperty.subscribeSync().trigger(EventTms_in_successProperty.syncUsedTiket().get())
54
56
  timeout(() => {
@@ -105,7 +105,7 @@ export default function m(props: EventTms_in_successProps): any {
105
105
  is_tms: 1,
106
106
  qty: _qty,
107
107
  tms_id: UserClass.state().get()?.id,
108
- scanned: LibUtils.moment().format('YYYY-MM-DD HH:mm:ss'),
108
+ scanned: LibUtils.moment().localeFormat('YYYY-MM-DD HH:mm:ss'),
109
109
  }
110
110
  EventTms_homeProperty.addCounterEntranceOpenGate(1, selectedTicket?.price_id)
111
111
  syncUsedTiketState.set(LibObject.push(syncUsedTiketState.get(), [url, post])())