esoftplay-event 0.0.2 → 0.0.3

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 (100) hide show
  1. package/event/additional.tsx +1 -1
  2. package/event/additional_input.tsx +15 -0
  3. package/event/additional_new.tsx +565 -0
  4. package/event/artist.tsx +14 -34
  5. package/event/artist_detail.tsx +336 -239
  6. package/event/artist_detail_multi.tsx +266 -157
  7. package/event/artist_detailv2.tsx +129 -69
  8. package/event/artistv2.tsx +5 -13
  9. package/event/button.tsx +2 -2
  10. package/event/button_order_detail.tsx +20 -8
  11. package/event/capture.tsx +2 -0
  12. package/event/checkout.ts +135 -0
  13. package/event/countdown.tsx +13 -9
  14. package/event/countdown_base.tsx +88 -48
  15. package/event/countdown_event.tsx +3 -0
  16. package/event/countdown_timestamp.tsx +106 -0
  17. package/event/coupon.tsx +1 -1
  18. package/event/coupon_generate.tsx +35 -22
  19. package/event/detail.tsx +9 -15
  20. package/event/detail2.tsx +63 -61
  21. package/event/dialog_custom.tsx +67 -0
  22. package/event/exchange_ticket_list.tsx +23 -14
  23. package/event/exchange_ticket_result.tsx +1 -1
  24. package/event/firebase_socket.ts +14 -12
  25. package/event/htmltext.tsx +40 -28
  26. package/event/index.tsx +8 -2
  27. package/event/label_input.tsx +2 -2
  28. package/event/layout.tsx +312 -0
  29. package/event/loading_page.tsx +62 -82
  30. package/event/message.tsx +2 -2
  31. package/event/order_detail.tsx +408 -477
  32. package/event/order_detail_addons.tsx +60 -0
  33. package/event/order_detail_addons_booked.tsx +61 -0
  34. package/event/order_detail_coupon.tsx +66 -0
  35. package/event/order_detail_instruction.tsx +96 -0
  36. package/event/order_detail_payment.tsx +1 -1
  37. package/event/order_detail_reschedule.tsx +109 -0
  38. package/event/order_detail_return.tsx +231 -0
  39. package/event/order_detail_review.tsx +174 -0
  40. package/event/order_detail_share.tsx +304 -0
  41. package/event/order_detail_tnc.tsx +76 -0
  42. package/event/order_detail_upgrade.tsx +140 -90
  43. package/event/order_detail_upgrade_payment.tsx +120 -38
  44. package/event/order_detail_visitor.tsx +21 -10
  45. package/event/order_detail_waiting.tsx +3 -3
  46. package/event/order_history.tsx +1 -1
  47. package/event/order_item.tsx +1 -1
  48. package/event/order_lottery.tsx +1 -1
  49. package/event/order_reschedule.tsx +29 -16
  50. package/event/order_share_to.tsx +14 -0
  51. package/event/order_waiting.tsx +1 -1
  52. package/event/payment_subscribe.tsx +18 -0
  53. package/event/point_events.tsx +35 -0
  54. package/event/point_redemption.tsx +101 -0
  55. package/event/point_redemption_exchange.tsx +60 -0
  56. package/event/point_redemption_input.tsx +56 -0
  57. package/event/point_redemption_success.tsx +50 -0
  58. package/event/point_summary.tsx +48 -0
  59. package/event/popup.tsx +4 -4
  60. package/event/queue.tsx +111 -0
  61. package/event/queue_pricing.tsx +17 -6
  62. package/event/review_add.tsx +2 -2
  63. package/event/scan_item.tsx +1 -1
  64. package/event/schedule.tsx +33 -30
  65. package/event/schedule2.tsx +86 -0
  66. package/event/seat.tsx +135 -374
  67. package/event/seat_map.tsx +8 -8
  68. package/event/seat_map_new.tsx +211 -38
  69. package/event/step.tsx +1 -1
  70. package/event/test.tsx +8 -8
  71. package/event/ticket.tsx +326 -0
  72. package/event/ticket_list.tsx +316 -258
  73. package/event/ticket_list2.tsx +349 -224
  74. package/event/ticket_list_item.tsx +61 -0
  75. package/event/ticket_list_new.tsx +710 -0
  76. package/event/tms_add_result.tsx +10 -5
  77. package/event/tms_check_ticket_result.tsx +16 -7
  78. package/event/tms_dashboard.tsx +87 -12
  79. package/event/tms_gate.tsx +32 -15
  80. package/event/tms_home.tsx +178 -92
  81. package/event/tms_idcard.tsx +43 -26
  82. package/event/tms_in.tsx +2 -3
  83. package/event/tms_in_failed.tsx +1 -1
  84. package/event/tms_in_hall.tsx +4 -1
  85. package/event/tms_in_hall_failed.tsx +36 -16
  86. package/event/tms_in_log.tsx +9 -11
  87. package/event/tms_in_success.tsx +13 -8
  88. package/event/tms_log.tsx +16 -17
  89. package/event/tms_out_hall_failed.tsx +1 -1
  90. package/event/tms_out_temporary.tsx +3 -4
  91. package/event/token_order.tsx +103 -0
  92. package/event/token_payment.tsx +79 -0
  93. package/event/visitor_index.tsx +60 -49
  94. package/event/visitor_input.tsx +336 -54
  95. package/event/visitor_inputv2.tsx +173 -88
  96. package/event/voucher.tsx +1 -1
  97. package/id.json +76 -4
  98. package/package.json +1 -1
  99. package/event/secure_page.debug.tsx +0 -34
  100. package/event/secure_page.live.tsx +0 -35
@@ -1,6 +1,6 @@
1
1
  // withHooks
2
2
  import { EventHeader } from 'esoftplay/cache/event/header/import';
3
- import { EventTms_in_successProperty } from 'esoftplay/cache/event/tms_in_success/import';
3
+ // import { EventTms_in_successProperty } from 'esoftplay/cache/event/tms_in_success/import';
4
4
  import { LibCurl } from 'esoftplay/cache/lib/curl/import';
5
5
  import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
6
6
  import { LibFocus } from 'esoftplay/cache/lib/focus/import';
@@ -18,6 +18,7 @@ import useGlobalSubscriber, { useGlobalSubscriberReturn } from 'esoftplay/subscr
18
18
 
19
19
 
20
20
  import { applyStyle } from 'esoftplay';
21
+ import { EventTms_dashboardProperty } from 'esoftplay/cache/event/tms_dashboard/import';
21
22
  import { EventTms_in_hall_successProperty } from 'esoftplay/cache/event/tms_in_hall_success/import';
22
23
  import { EventTms_out_hall_successProperty } from 'esoftplay/cache/event/tms_out_hall_success/import';
23
24
  import { EventTms_out_successProperty } from 'esoftplay/cache/event/tms_out_success/import';
@@ -36,6 +37,24 @@ export interface EventTms_homeProps {
36
37
 
37
38
  }
38
39
 
40
+ const stateBackgroundIdCard = useGlobalState("")
41
+
42
+ export function stateImageBackgroundIdCard(): useGlobalReturn<any> {
43
+ return stateBackgroundIdCard
44
+ }
45
+
46
+ const urlGateCheckin = useGlobalState("")
47
+
48
+ export function stateUrlGateChekin(): useGlobalReturn<any> {
49
+ return urlGateCheckin
50
+ }
51
+
52
+ const stateTypeTMS = useGlobalState("")
53
+
54
+ export function stateTypeScanTMS(): useGlobalReturn<any> {
55
+ return stateTypeTMS
56
+ }
57
+
39
58
  const stateIsDirect = useGlobalState<boolean>(true)
40
59
 
41
60
  export function state(): useGlobalReturn<any> {
@@ -178,6 +197,52 @@ export function addCounterHallOutNO(counter: number, price_id: string) {
178
197
  addCounter(counter, 'hall_out_api_no', price_id)
179
198
  }
180
199
 
200
+ export function actionGateIn() {
201
+ LibNavigation.navigateForResult('component/scanner').then((value) => {
202
+ LibNavigation.navigate('tms/tms_in', {
203
+ qr_code: value
204
+ })
205
+ })
206
+ }
207
+
208
+ export function actionHallIn() {
209
+ LibNavigation.navigateForResult('component/scanner').then((value) => {
210
+ LibNavigation.navigate('tms/tms_hall_in', {
211
+ qr_code: value
212
+ })
213
+ })
214
+ }
215
+ export function actionHallOut() {
216
+ LibNavigation.navigateForResult('component/scanner').then((value) => {
217
+ LibNavigation.navigate('tms/tms_hall_out', {
218
+ qr_code: value
219
+ })
220
+ })
221
+ }
222
+
223
+ export function actionGateOut() {
224
+ LibNavigation.navigateForResult('component/scanner').then((value) => {
225
+ LibNavigation.navigate('tms/tms_out', {
226
+ qr_code: value
227
+ })
228
+ })
229
+ }
230
+
231
+ export function actionGateOutTemp() {
232
+ LibNavigation.navigateForResult('component/scanner').then((value) => {
233
+ LibNavigation.navigate('tms/tms_out_temp', {
234
+ qr_code: value
235
+ })
236
+ })
237
+ }
238
+
239
+ export function actionGateInBack() {
240
+ LibNavigation.navigateForResult('component/scanner').then((value) => {
241
+ LibNavigation.navigate('tms/tms_in_back', {
242
+ qr_code: value
243
+ })
244
+ })
245
+ }
181
246
 
182
247
  const subscriber = useGlobalSubscriber()
183
248
  export function subscribeSync(): useGlobalSubscriberReturn {
@@ -224,46 +289,46 @@ const useTasksExit = UseTasks()
224
289
  const useTasksHallIn = UseTasks()
225
290
  const useTasksHallOut = UseTasks()
226
291
  export default function m(props: EventTms_homeProps): any {
227
- const { is_scanner, selectedGate, typeScanner }: any = LibNavigation.getArgsAll(props)
292
+ const { selectedGate, typeScanner }: any = LibNavigation.getArgsAll(props)
228
293
 
229
294
  // esp.log(counterState().get());
230
295
 
231
- const timeoutSync = useRef<any>()
296
+ const timeoutSync = useRef<any>(null)
232
297
  const timeout = useTimeout()
233
- const [syncUseTicket, resetSyncUseTicket] = useTasks((item: any) => new Promise((next) => {
234
- const [url, post] = item;
235
- let _post = LibObject.assign({}, post)()
236
- clearTimeout?.(timeoutSync.current)
237
- timeoutSync.current = timeout(() => {
238
- addCounterEntranceTimeout(1, _post?.price_id)
239
- next()
240
- }, 30000);
241
- addCounterEntranceSend(1, _post?.price_id)
242
- _post["trx_id"] = new Date().getTime() + "" + UserClass.state().get()?.id;
243
-
244
- new LibCurl(url, _post, (res, msg) => {
245
- EventTms_in_successProperty.syncUsedTiket().set((old) => old.filter((x) => !isEqual([url, post], x)))
246
- addCounterEntranceOk(1, _post?.price_id)
247
- addCounterEntranceTicket(post?.qty, _post?.price_id)
248
- next()
249
- }, (err: any) => {
250
- addCounterEntranceNo(1, _post?.price_id)
251
- reportApiError(url, JSON.stringify({ post, response: err }))
252
- next()
253
- }, 1)
254
-
255
- }), () => {
256
-
257
- })
258
-
259
- subscriber.useSubscribe(() => {
260
- syncUseTicket(subscriber.getValue())
261
- })
262
-
263
- subscriberReset.useSubscribe(() => {
264
- resetSyncUseTicket()
265
- syncUseTicket(subscriberReset.getValue())
266
- })
298
+ // const [syncUseTicket, resetSyncUseTicket] = useTasks((item: any) => new Promise((next) => {
299
+ // const [url, post] = item;
300
+ // let _post = LibObject.assign({}, post)()
301
+ // clearTimeout?.(timeoutSync.current)
302
+ // timeoutSync.current = timeout(() => {
303
+ // addCounterEntranceTimeout(1, _post?.price_id)
304
+ // next()
305
+ // }, 30000);
306
+ // addCounterEntranceSend(1, _post?.price_id)
307
+ // _post["trx_id"] = new Date().getTime() + "" + UserClass.state().get()?.id;
308
+
309
+ // // new LibCurl(url, _post, (res, msg) => {
310
+ // // // EventTms_in_successProperty.syncUsedTiket().set((old) => old.filter((x) => !isEqual([url, post], x)))
311
+ // // addCounterEntranceOk(1, _post?.price_id)
312
+ // // addCounterEntranceTicket(post?.qty, _post?.price_id)
313
+ // // next()
314
+ // // }, (err: any) => {
315
+ // // addCounterEntranceNo(1, _post?.price_id)
316
+ // // reportApiError(url, JSON.stringify({ post, response: err }))
317
+ // // next()
318
+ // // }, 1)
319
+
320
+ // }), () => {
321
+
322
+ // })
323
+
324
+ // subscriber.useSubscribe(() => {
325
+ // syncUseTicket(subscriber.getValue())
326
+ // })
327
+
328
+ // subscriberReset.useSubscribe(() => {
329
+ // resetSyncUseTicket()
330
+ // syncUseTicket(subscriberReset.getValue())
331
+ // })
267
332
 
268
333
 
269
334
  const [syncTicketExit, resetSyncTicketExit] = useTasksExit((item: any) => new Promise((next) => {
@@ -365,7 +430,7 @@ export default function m(props: EventTms_homeProps): any {
365
430
  const date = LibUtils.moment().localeFormat('YYYY-MM-DD HH:mm:ss')
366
431
 
367
432
  useEffect(() => {
368
- resetSyncUseTicket()
433
+ // resetSyncUseTicket()
369
434
  resetSyncTicketExit()
370
435
  resetSyncTicketHallIn()
371
436
  resetSyncTicketHallOut()
@@ -373,10 +438,11 @@ export default function m(props: EventTms_homeProps): any {
373
438
  loadData()
374
439
  loadDataTypeTicket()
375
440
  loadDataConfigPriority()
441
+
376
442
  }, [])
377
443
 
378
444
  function loadDataTypeTicket() {
379
- new LibCurl('event_tms_ticket_type?event_id=' + is_scanner?.id, null, (res, msg) => {
445
+ new LibCurl('event_tms_ticket_type?event_id=' + EventTms_dashboardProperty.stateSelectedEvent()?.get()?.id, null, (res, msg) => {
380
446
  setRefreshing(false)
381
447
  setResultTypeTicket(res)
382
448
  }, (error) => {
@@ -387,10 +453,13 @@ export default function m(props: EventTms_homeProps): any {
387
453
  }
388
454
 
389
455
  function loadData() {
390
- subscriber.trigger(EventTms_in_successProperty.syncUsedTiket().get())
391
- new LibCurl('event_tms_visitor?event_id=' + is_scanner?.id, null, (res, msg) => {
456
+ // subscriber.trigger(EventTms_in_successProperty.syncUsedTiket().get())
457
+ new LibCurl('event_tms_visitor?event_id=' + EventTms_dashboardProperty.stateSelectedEvent()?.get()?.id, null, (res, msg) => {
458
+ // esp.log(res,"event tms visitor");
392
459
  setResult(res)
393
460
  setRefreshing(false)
461
+ stateImageBackgroundIdCard()?.set(res?.event?.image_idcard)
462
+ stateUrlGateChekin()?.set(res?.url_ticket_update)
394
463
  }, (error) => {
395
464
  LibDialog.warning(esp.lang("event/tms_home", "warning_load"), error?.message)
396
465
  LibNavigation.back()
@@ -399,7 +468,7 @@ export default function m(props: EventTms_homeProps): any {
399
468
  }
400
469
 
401
470
  function loadDataConfigPriority() {
402
- new LibCurl('event_tms_access_price?event_id=' + is_scanner?.id, null, (res, msg) => {
471
+ new LibCurl('event_tms_access_price?event_id=' + EventTms_dashboardProperty.stateSelectedEvent()?.get()?.id, null, (res, msg) => {
403
472
  setResultConfigPriority(res)
404
473
  setRefreshing(false)
405
474
  }, (error) => {
@@ -426,8 +495,8 @@ export default function m(props: EventTms_homeProps): any {
426
495
  let seventyFive = 100 * 0.75
427
496
 
428
497
  let args = {
429
- event_title: is_scanner?.name,
430
- event_id: is_scanner?.id,
498
+ event_title: EventTms_dashboardProperty.stateSelectedEvent()?.get()?.name,
499
+ event_id: EventTms_dashboardProperty.stateSelectedEvent()?.get()?.id,
431
500
  selectGate: selectedGate,
432
501
  typeScanner: typeScanner,
433
502
  configPriority: resultConfigPriority
@@ -448,7 +517,7 @@ export default function m(props: EventTms_homeProps): any {
448
517
  function renderViewTms(item: any, i: number) {
449
518
  let percentages = item?.quota_visitor == 0 && item?.visitor == 0 ? 0 : item?.visitor > 0 && item?.quota_visitor == 0 ? 5 : (item?.visitor / item?.quota_visitor) * 100
450
519
  return (
451
- <View key={i} style={applyStyle({ marginLeft: 7, marginRight: 7, marginBottom: 10, borderRadius: 10, borderWidth: 2, padding: 10, borderColor: "#f1f1f1" })}>
520
+ <View key={i} style={applyStyle({ marginRight: 7, marginBottom: 10, borderRadius: 10, borderWidth: 2, padding: 10, borderColor: "#f1f1f1" })}>
452
521
  {progressBar(percentages, 'small')}
453
522
  <View style={{ flexDirection: 'row', alignItems: 'center', marginTop: 8 }} >
454
523
  <Text allowFontScaling={false} style={applyStyle({ textAlign: 'left', fontSize: 14, color: '#000', fontWeight: 'bold', marginRight: 10, flex: 1 })}>{item.type}</Text>
@@ -461,7 +530,7 @@ export default function m(props: EventTms_homeProps): any {
461
530
  function renderViewHall(item: any, i: number) {
462
531
  let percentages = item?.quota_visitor == 0 && item?.visitor == 0 ? 0 : item?.visitor > 0 && item?.quota_visitor == 0 ? 5 : (item?.visitor / item?.quota_visitor) * 100
463
532
  return (
464
- <View key={i} style={applyStyle({ marginLeft: 7, marginRight: 7, marginBottom: 10, borderRadius: 10, borderWidth: 2, padding: 10, borderColor: "#f1f1f1" })}>
533
+ <View key={i} style={applyStyle({ marginRight: 7, marginBottom: 10, borderRadius: 10, borderWidth: 2, padding: 10, borderColor: "#f1f1f1" })}>
465
534
  {/* <ComponentCircural_progress size={60} strokeWidth={7} percentage={percentages} color={setColorProg(percentages)} /> */}
466
535
  {progressBar(percentages, 'small')}
467
536
  <View style={{ flexDirection: 'row', alignItems: 'center', marginTop: 8 }} >
@@ -487,7 +556,7 @@ export default function m(props: EventTms_homeProps): any {
487
556
  return (
488
557
  <View style={applyStyle({ flex: 1, backgroundColor: '#fff' })}>
489
558
  <LibFocus onFocus={loadData} />
490
- <EventHeader title={esp.lang("event/tms_home", "visitor_info")} subtitle={typeScanner == "tms" ? esp.lang("event/tms_home", "header_title1", is_scanner?.name) : esp.lang("event/tms_home", "header_title2", is_scanner?.name)} />
559
+ <EventHeader title={esp.lang("event/tms_home", "visitor_info")} subtitle={typeScanner == "tms" ? esp.lang("event/tms_home", "header_title1", EventTms_dashboardProperty.stateSelectedEvent()?.get()?.name) : esp.lang("event/tms_home", "header_title2", EventTms_dashboardProperty.stateSelectedEvent()?.get()?.name)} />
491
560
  <View style={{ margin: 15, flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
492
561
  {
493
562
  <TouchableOpacity onPress={() => {
@@ -503,7 +572,7 @@ export default function m(props: EventTms_homeProps): any {
503
572
  </TouchableOpacity>
504
573
  <TouchableOpacity onPress={() => {
505
574
  LibNavigation.navigate('event/tms_check_code', {
506
- event_id: is_scanner?.id,
575
+ event_id: EventTms_dashboardProperty.stateSelectedEvent()?.get()?.id,
507
576
  gate: selectedGate
508
577
  })
509
578
  }} style={{ padding: 10, marginRight: 0, backgroundColor: LibStyle.colorRed, borderRadius: 10, ...LibStyle.elevation(2) }}>
@@ -511,14 +580,6 @@ export default function m(props: EventTms_homeProps): any {
511
580
  </TouchableOpacity>
512
581
  </View>
513
582
  </View>
514
- {/* <UseCondition if={dataScan.length > 0}>
515
- <Pressable
516
- style={{ flexDirection: 'row', paddingHorizontal: 17, alignItems: 'center' }}
517
- onPress={() => syncUseTicket(EventTms_in_successProperty.syncUsedTiket().get())} >
518
- <LibIcon name='sync' />
519
- <Text>{"Menyinkronkan data, " + dataScan.length + " data tersisa.."}</Text>
520
- </Pressable>
521
- </UseCondition> */}
522
583
  {
523
584
  result?.event?.config?.jumbotron_app != 0 ?
524
585
  <ScrollView refreshControl={<RefreshControl refreshing={refreshing} onRefresh={onRefresh} />}>
@@ -560,33 +621,48 @@ export default function m(props: EventTms_homeProps): any {
560
621
  <>
561
622
  <View style={applyStyle({ flexDirection: 'row', justifyContent: 'space-between', })}>
562
623
  <TouchableOpacity onPress={() => {
563
- LibNavigation.navigate('component/scanner', {
564
- fromPage: 'event/tms_home',
565
- scan_type: typeScanner == "tms" ? 'exit' : 'hall_out',
566
- gate_type: 0, // ini kalo 0 itu out
567
- price_type: resultTypeTicket, // ini digunakan di event/tms_in
568
- ...args
569
- })
570
-
624
+ if (esp.isDebug("") && UserClass?.state().get().email == "bagus@fisip.net") {
625
+ if (typeScanner == "tms") {
626
+ stateTypeScanTMS()?.set("gate_out")
627
+ actionGateOut()
628
+ } else {
629
+ stateTypeScanTMS()?.set("hall_out")
630
+ actionHallOut()
631
+ }
632
+ } else {
633
+ LibNavigation.navigate('component/scanner', {
634
+ fromPage: 'event/tms_home',
635
+ scan_type: typeScanner == "tms" ? 'exit' : 'hall_out',
636
+ gate_type: 0, // ini kalo 0 itu out
637
+ price_type: resultTypeTicket, // ini digunakan di event/tms_in
638
+ ...args
639
+ })
640
+ }
571
641
  }} style={applyStyle({ width: (LibStyle.width - 40) * 0.5, borderWidth: 1, borderColor: 'rgba(0, 0, 0, 0)', height: 40, borderRadius: 16, backgroundColor: LibStyle.colorRed, flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center', paddingHorizontal: 9 })} >
572
642
  <LibIcon size={18} color="#fff" name="logout" style={applyStyle({ transform: [{ rotate: '180deg' }] })} />
573
643
  <Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: '#fff', marginLeft: 15 })} >{esp.lang("event/tms_home", "exit")}</Text>
574
644
  </TouchableOpacity>
575
645
 
576
646
  <TouchableOpacity onPress={() => {
577
- // if (esp.isDebug("") && UserClass?.state().get().email == "bagus@fisip.net") {
578
- // LibNavigation.navigate('tms/gate_in')
579
- // } else {
580
- LibNavigation.navigate('component/scanner', {
581
- fromPage: 'event/tms_home',
582
- scan_type: typeScanner == "tms" ? 'entrance' : 'hall_in',
583
- gate_type: 1, // ini kalo 1 itu in
584
- price_type: resultTypeTicket,
585
- url_ticket_detail: result?.url_ticket_detail,
586
- url_ticket_update: result?.url_ticket_update,
587
- ...args
588
- })
589
- // }
647
+ if (esp.isDebug("") && UserClass?.state().get().email == "bagus@fisip.net") {
648
+ if (typeScanner == "tms") {
649
+ stateTypeScanTMS()?.set("gate_in")
650
+ actionGateIn()
651
+ } else {
652
+ stateTypeScanTMS()?.set("hall_in")
653
+ actionHallIn()
654
+ }
655
+ } else {
656
+ LibNavigation.navigate('component/scanner', {
657
+ fromPage: 'event/tms_home',
658
+ scan_type: typeScanner == "tms" ? 'entrance' : 'hall_in',
659
+ gate_type: 1, // ini kalo 1 itu in
660
+ price_type: resultTypeTicket,
661
+ url_ticket_detail: result?.url_ticket_detail,
662
+ url_ticket_update: result?.url_ticket_update,
663
+ ...args
664
+ })
665
+ }
590
666
  }} style={applyStyle({ width: (LibStyle.width - 40) * 0.5, borderWidth: 1, borderColor: 'rgba(0, 0, 0, 0)', height: 40, borderRadius: 16, backgroundColor: LibStyle.colorGreen, flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center', paddingHorizontal: 9 })} >
591
667
  <Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: '#fff', marginRight: 15 })} >{esp.lang("event/tms_home", "entrance")}</Text>
592
668
  <LibIcon size={18} color="#fff" name="login" />
@@ -596,26 +672,36 @@ export default function m(props: EventTms_homeProps): any {
596
672
  typeScanner == "tms" && result?.event?.config?.temporary_out == 1 &&
597
673
  <View style={{ marginTop: 10, flexDirection: 'row', justifyContent: 'space-between' }}>
598
674
  <TouchableOpacity onPress={() => {
599
- LibNavigation.navigate('component/scanner', {
600
- fromPage: 'event/tms_home',
601
- scan_type: 'exit_temporary',
602
- ...args
603
- })
675
+ if (esp.isDebug("") && UserClass?.state().get().email == "bagus@fisip.net") {
676
+ stateTypeScanTMS()?.set("gate_out_temp")
677
+ actionGateOutTemp()
678
+ } else {
679
+ LibNavigation.navigate('component/scanner', {
680
+ fromPage: 'event/tms_home',
681
+ scan_type: 'exit_temporary',
682
+ ...args
683
+ })
684
+ }
604
685
  }} style={applyStyle({ width: (LibStyle.width - 40) * 0.5, borderWidth: 2, borderColor: LibStyle.colorRed, height: 40, borderRadius: 16, backgroundColor: "#fff", flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center', paddingHorizontal: 9 })} >
605
686
  <LibIcon size={18} color={LibStyle.colorRed} name="logout" style={applyStyle({ fontWeight: 'bold', transform: [{ rotate: '180deg' }] })} />
606
687
  <Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: LibStyle.colorRed, marginLeft: 10 })} >{esp.lang("event/tms_home", "temp_out")}</Text>
607
688
  </TouchableOpacity>
608
689
  <TouchableOpacity onPress={() => {
609
- // LibNavigation.navigate('event/tms_in_again')
610
- LibNavigation.navigate('component/scanner', {
611
- fromPage: 'event/tms_home',
612
- gate_type: 1,
613
- scan_type: 'entrance_again',
614
- price_type: resultTypeTicket,
615
- url_ticket_detail: result?.url_ticket_detail,
616
- url_ticket_update: result?.url_ticket_update,
617
- ...args
618
- })
690
+ if (esp.isDebug("") && UserClass?.state().get().email == "bagus@fisip.net") {
691
+ stateTypeScanTMS()?.set("gate_in_back")
692
+ actionGateInBack()
693
+ } else {
694
+ LibNavigation.navigate('component/scanner', {
695
+ fromPage: 'event/tms_home',
696
+ gate_type: 1,
697
+ scan_type: 'entrance_again',
698
+ price_type: resultTypeTicket,
699
+ url_ticket_detail: result?.url_ticket_detail,
700
+ url_ticket_update: result?.url_ticket_update,
701
+ ...args
702
+ })
703
+ }
704
+
619
705
  }} style={applyStyle({ width: (LibStyle.width - 40) * 0.5, borderWidth: 2, borderColor: LibStyle.colorGreen, height: 40, borderRadius: 16, backgroundColor: 'white', flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center', paddingHorizontal: 9 })} >
620
706
  <Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: LibStyle.colorGreen, marginRight: 15 })} >{esp.lang("event/tms_home", "re_in")}</Text>
621
707
  <LibIcon size={18} color={LibStyle.colorGreen} name="login" />
@@ -1,22 +1,22 @@
1
1
  // withHooks
2
2
 
3
- import { EventButton } from 'esoftplay/cache/event/button/import';
4
3
  import { EventHeader } from 'esoftplay/cache/event/header/import';
5
4
  import { EventSheet } from 'esoftplay/cache/event/sheet/import';
6
5
  import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
7
- import { EventTms_in_successProperty } from 'esoftplay/cache/event/tms_in_success/import';
6
+ // import { EventTms_in_successProperty } from 'esoftplay/cache/event/tms_in_success/import';
8
7
  import { LibCurl } from 'esoftplay/cache/lib/curl/import';
9
8
  import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
10
9
  import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
11
- import { LibObject } from 'esoftplay/cache/lib/object/import';
12
10
  import { LibPicture } from 'esoftplay/cache/lib/picture/import';
13
11
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
14
12
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
13
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
15
14
  import { UserClass } from 'esoftplay/cache/user/class/import';
15
+ import { reportApiError } from 'esoftplay/error';
16
16
  import esp from 'esoftplay/esp';
17
17
  import useSafeState from 'esoftplay/state';
18
18
  import React, { useEffect, useRef } from 'react';
19
- import { Text, View } from 'react-native';
19
+ import { Text, TouchableOpacity, View } from 'react-native';
20
20
 
21
21
 
22
22
  export interface EventTms_idcardArgs {
@@ -26,15 +26,6 @@ export interface EventTms_idcardProps {
26
26
 
27
27
  }
28
28
  export default function m(props: EventTms_idcardProps): any {
29
- const width = LibStyle.width
30
- const height = 12 / 9 * width
31
- const marginTop = 2.7 / 9 * width
32
- const photoHeight = 4 / 9 * width
33
- const photoWidth = 3 / 9 * width
34
- const photoMarginBot = 0.46 / 9 * width
35
-
36
- const menuRef = useRef<EventSheet>(null)
37
-
38
29
  const {
39
30
  hall,
40
31
  selectedTicket,
@@ -49,8 +40,18 @@ export default function m(props: EventTms_idcardProps): any {
49
40
  configPriority,
50
41
  scan_type
51
42
  } = LibNavigation.getArgsAll(props)
43
+
44
+ const width = LibStyle.width
45
+ const height = 12 / 9 * width
46
+ const marginTop = 3 / 9 * width
47
+ const photoHeight = 4 / 9 * width
48
+ const photoWidth = 3 / 9 * width
49
+ const photoMarginBot = 0.46 / 9 * width
50
+
51
+ const menuRef = useRef<EventSheet>(null)
52
52
 
53
53
  const [result, setResult] = useSafeState<any>()
54
+ const [useToken, TokenLeft] = selectedTicket?.token?.split("-")
54
55
 
55
56
  function loadData() {
56
57
  // load data untuk ngambil background id card
@@ -89,8 +90,15 @@ export default function m(props: EventTms_idcardProps): any {
89
90
  }
90
91
 
91
92
  EventTms_homeProperty.addCounterEntranceOpenGateIdCard(1, selectedTicket?.price_id)
92
- EventTms_in_successProperty.syncUsedTiket().set(LibObject.push(EventTms_in_successProperty.syncUsedTiket().get(), [url, post])())
93
- EventTms_homeProperty.subscribeSync().trigger(EventTms_in_successProperty.syncUsedTiket().get())
93
+ new LibCurl(url, post, (res, msg) => {
94
+ // console.log("SUCCESS CUY", res, msg)
95
+ // syncUsedTiketState.set(LibObject.push(syncUsedTiketState.get(), [url, post])())
96
+ // EventTms_homeProperty.subscribeSync().trigger(syncUsedTiketState.get())
97
+ }, (err) => {
98
+ reportApiError(url, JSON.stringify({ post, response: err }))
99
+ })
100
+ // EventTms_in_successProperty.syncUsedTiket().set(LibObject.push(EventTms_in_successProperty.syncUsedTiket().get(), [url, post])())
101
+ // EventTms_homeProperty.subscribeSync().trigger(EventTms_in_successProperty.syncUsedTiket().get())
94
102
  }
95
103
 
96
104
  function entranceHall() {
@@ -119,6 +127,7 @@ export default function m(props: EventTms_idcardProps): any {
119
127
  }, 1)
120
128
  }
121
129
 
130
+ // esp.log({ result });
122
131
 
123
132
  return (
124
133
  <View style={{ flex: 1 }}>
@@ -128,6 +137,7 @@ export default function m(props: EventTms_idcardProps): any {
128
137
  onPressMore={() => menuRef.current?.show()}
129
138
  more
130
139
  />
140
+
131
141
  <View style={{ backgroundColor: '#000', height: LibStyle.height, alignItems: 'center' }}>
132
142
  {/* ini id_card nya */}
133
143
  <LibPicture source={result?.event?.image_idcard == "" ? esp.assets('white_idcard.png') : { uri: result?.event?.image_idcard }} style={{ width: width, height: height, resizeMode: 'contain' }} />
@@ -150,13 +160,17 @@ export default function m(props: EventTms_idcardProps): any {
150
160
  <View style={{ width: width - 20, alignSelf: 'center', backgroundColor: '#4a4a4a', height: 4, marginVertical: 4 }} />
151
161
  <Text allowFontScaling={false} style={{ marginTop: -5, fontSize: 20, fontWeight: "bold", fontStyle: "normal", lineHeight: 32, textAlign: 'center', letterSpacing: 0, color: "#4a4a4a" }} >{selectedTicket?.exhibitor_name?.split('-')[0]}</Text>
152
162
  </View>
153
-
154
163
  </View>
155
- <EventButton
156
- label={esp.lang("event/tms_idcard", "btn_back")}
157
- backgroundColor={LibStyle.colorPrimary}
158
- onPress={() => {
159
- // LibNavigation.back()
164
+
165
+ <View style={{ padding: 5, flexDirection: 'row', backgroundColor: LibStyle.colorPrimary, margin: 10, borderRadius: 10 }}>
166
+ {
167
+ useToken == 1 &&
168
+ <View style={{ padding: 5, paddingHorizontal: 35, alignContent: 'center', alignItems: 'center', borderRadius: 10, backgroundColor: '#fff' }}>
169
+ <Text allowFontScaling={false} style={{ fontSize: 12, color: '#000', fontWeight: 'bold' }}>{esp.lang("event/tms_idcard", "token")}</Text>
170
+ <Text allowFontScaling={false} style={{ fontSize: 35, color: '#000', lineHeight: 35, fontWeight: 'bold' }} >{LibUtils.number(TokenLeft)}</Text>
171
+ </View>
172
+ }
173
+ <TouchableOpacity onPress={() => {
160
174
  LibNavigation.replace('component/scanner', {
161
175
  selectGate: selectGate,
162
176
  fromPage: 'event/tms_home',
@@ -170,21 +184,24 @@ export default function m(props: EventTms_idcardProps): any {
170
184
  configPriority: configPriority,
171
185
  scan_type: scan_type
172
186
  })
173
- }}
174
- style={{ marginTop: 20, marginHorizontal: 15 }}
175
- />
187
+ }} style={{ flex: 1, marginLeft: 10, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
188
+ <Text allowFontScaling={false} style={{ fontSize: 25, fontWeight: 'bold', color: '#fff' }}>{esp.lang("event/tms_idcard", "backk")}</Text>
189
+ </TouchableOpacity>
190
+
191
+ </View>
192
+
176
193
  </View>
177
194
  <EventSheet
178
195
  _ref={menuRef}
179
196
  title={"ID CARD"}
180
197
  options={[
181
198
  {
182
- text: "Tahan ID CARD",
199
+ text: esp.lang("event/tms_idcard", "hold_idcard"),
183
200
  textStyle: { color: "red" },
184
201
  onPress: () => {
185
202
  LibDialog.warningConfirm(esp.lang("event/tms_dashboard", "block_idcard_title"), esp.lang("event/tms_dashboard", "block_idcard_message"), esp.lang("event/tms_dashboard", "block_idcard_ok"), () => {
186
203
  new LibCurl("event_tms_staff_hold", { qr: encodeURIComponent(selectedTicket?.key) }, (result, message) => {
187
- LibDialog.info("Berhasil!", message)
204
+ LibDialog.info(esp.lang("event/tms_idcard", "success"), message)
188
205
  }, (error) => {
189
206
  LibDialog.warning("Oops!", error?.message)
190
207
  })
package/event/tms_in.tsx CHANGED
@@ -109,7 +109,6 @@ export default function m(props: EventTms_inProps): any {
109
109
  let tikets: any[] = []
110
110
  EventTms_homeProperty.addCounterEntranceScan(1, "0")
111
111
  get(mainPath(encodeURIComponent(encodeURIComponent(qr_code))), selectGate?.id, (res) => {
112
- esp.log({ res });
113
112
  if (!res) {
114
113
  LibNavigation.replace('event/tms_in_failed', {
115
114
  text: esp.lang("event/tms_in", "ticket_empty_today"),
@@ -131,7 +130,8 @@ export default function m(props: EventTms_inProps): any {
131
130
  qty: item[0],
132
131
  qty_used: item[2],
133
132
  qty_left: Number(item[0]) - (Number(item[2]) || 0),
134
- text: item[6] || "",
133
+ token: item[6],
134
+ text: item[7] || "",
135
135
  }
136
136
  tikets.push(x)
137
137
  })
@@ -151,7 +151,6 @@ export default function m(props: EventTms_inProps): any {
151
151
  tikets.push(a)
152
152
  }
153
153
  })
154
-
155
154
  if (tikets.length > 0) {
156
155
  if (tikets.length == 1) {
157
156
  const tiket = tikets[0];
@@ -162,7 +162,7 @@ export default function m(props: EventTms_in_failedProps): any {
162
162
  }
163
163
  {
164
164
  error &&
165
- <View style={{ width: LibStyle.width - 40, justifyContent: 'center', alignItems: 'center', padding: 15, borderRadius: 10, marginTop: 100 }}>
165
+ <View style={{ width: LibStyle.width - 40, alignSelf: 'center', justifyContent: 'center', alignItems: 'center', padding: 15, borderRadius: 10, marginTop: 100 }}>
166
166
  <Text allowFontScaling={false} style={{ flexWrap: 'wrap', fontSize: 14, lineHeight: 20, fontWeight: "bold", marginBottom: 5, color: "#fff", textAlign: "center" }}>{error?.message}</Text>
167
167
  </View>
168
168
  }
@@ -44,6 +44,7 @@ export default function m(props: EventTms_in_hallProps): any {
44
44
  var post = {
45
45
  event_id: event_id,
46
46
  user_qr: qr_code,
47
+ // user_qr: "BBO-IBT2376",
47
48
  hall_id: selectGate?.id
48
49
  }
49
50
 
@@ -71,7 +72,6 @@ export default function m(props: EventTms_in_hallProps): any {
71
72
  }
72
73
  });
73
74
 
74
- esp.log({ res });
75
75
 
76
76
  if (res?.hasOwnProperty("staff")) {
77
77
  res?.staff?.map((it: any) => {
@@ -87,6 +87,9 @@ export default function m(props: EventTms_in_hallProps): any {
87
87
  })
88
88
  }
89
89
 
90
+ esp.log({ res, ticketsData });
91
+
92
+
90
93
  if (ticketsData.length == 1) { // cek jika tiket cuma 1
91
94
  let tiket = ticketsData[0]
92
95
  if (tiket.price_id == "staff") { // jika itu adalah id card