esoftplay-event 0.0.1-z → 0.0.2-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.
package/config.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "fonts": {
3
+ "mono": "mono.ttf",
3
4
  "Arial": "Arial.ttf",
4
5
  "ArialBold": "ArialBold.ttf",
5
6
  "SFProText": "SFProText.ttf",
6
- "mono": "mono.ttf",
7
7
  "MonoSpace": "MonoSpace.ttf",
8
8
  "DecoNumbers": "DecoNumbers.ttf",
9
9
  "digital": "digital.ttf"
@@ -35,7 +35,7 @@ export default function m(props: EventButton_order_detailProps): any {
35
35
  </LibGradient>
36
36
  <View style={{ flex: 1, margin: 3, borderRadius: 5, ...LibStyle.elevation(2), backgroundColor: props.color, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
37
37
  {/* <LibIcon name={"dice-multiple"} size={40} color={EventOrder_itemProperty.textColor(props.color)} style={{ opacity: 1 }} /> */}
38
- <LibIcon name={props.icon} size={40} color={EventOrder_itemProperty.textColor(props.color)} style={{ opacity: 1 }} />
38
+ <LibIcon name={props.icon} size={35} color={EventOrder_itemProperty.textColor(props.color)} style={{ opacity: 1 }} />
39
39
  </View>
40
40
  </View>
41
41
  </TouchableOpacity>
@@ -3,6 +3,7 @@
3
3
 
4
4
  import { EventCountdown_base } from 'esoftplay/cache/event/countdown_base/import';
5
5
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
6
+ import esp from 'esoftplay/esp';
6
7
  import React, { useEffect } from 'react';
7
8
  import { StyleProp, Text, TextStyle, View, ViewStyle } from 'react-native';
8
9
  import Animated, { useAnimatedStyle, useSharedValue, withRepeat, withTiming } from 'react-native-reanimated';
@@ -37,6 +37,7 @@ import useSafeState from 'esoftplay/state';
37
37
  import useGlobalSubscriber, { useGlobalSubscriberReturn } from 'esoftplay/subscribe';
38
38
  import React, { useEffect, useRef } from 'react';
39
39
  import { Linking, Pressable, Text, TouchableOpacity, View } from 'react-native';
40
+ import { ScrollView } from 'react-native-gesture-handler';
40
41
  import QRCode from 'react-native-qrcode-svg';
41
42
 
42
43
 
@@ -100,6 +101,7 @@ export default function m(props: EventOrder_detailProps): any {
100
101
  const [user] = UserClass.state().useState()
101
102
 
102
103
  let showQR = useRef<LibSlidingup>(null)
104
+ let dialogAddonList = useRef<LibSlidingup>(null)
103
105
  const dialogSendBack = useRef<LibSlidingup>(null)
104
106
  const url = LibNavigation.getArgs(props, 'url')
105
107
  const [result, setResult] = useSafeState<any>(EventIndexProperty?.stateTicketCache()?.get()?.filter?.((x: any) => x.url?.replace?.('?id=', '/') == url?.replace?.('?id=', '/'))?.[0]?.detail)
@@ -110,6 +112,7 @@ export default function m(props: EventOrder_detailProps): any {
110
112
 
111
113
  const [coupons, setCoupons] = useSafeState<any>()
112
114
  const [qty, setQty] = useSafeState<number>(1)
115
+ const [, setGroupAddon, getGroupAddon] = useSafeState()
113
116
 
114
117
  const dataOfflineReview = EventReview_addProperty.state().get()
115
118
  let availableOfflineReview = dataOfflineReview?.filter((z: any) => z?.booking_id == result?.id)
@@ -382,6 +385,8 @@ export default function m(props: EventOrder_detailProps): any {
382
385
 
383
386
  const termData = result?.term ? Object.values(result?.term) : []
384
387
 
388
+ // esp.log(getGroupAddon());
389
+
385
390
  return (
386
391
  <View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
387
392
  <EventHeader title={esp.lang("event/order_detail", "order_detail")} />
@@ -418,11 +423,26 @@ export default function m(props: EventOrder_detailProps): any {
418
423
 
419
424
  <View style={{ flexDirection: 'row', margin: 16, justifyContent: 'space-between', marginTop: 0 }}>
420
425
  <View style={{ flex: 1 }}>
426
+ {/* <View style={{ flexDirection: 'row' }}> */}
421
427
  <View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
422
428
  <LibIcon name="ticket-outline" size={20} />
423
429
  <Text allowFontScaling={false} style={{ marginLeft: 6, fontFamily: "Arial", fontSize: 30, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{result?.qty}</Text>
424
430
  <Text allowFontScaling={false} style={{ marginLeft: 4, fontFamily: "Arial", fontSize: 16, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{esp.lang("event/order_detail", "ticket")}</Text>
425
431
  </View>
432
+
433
+ <View style={{ position: 'absolute', right: 0, justifyContent: 'flex-end', alignContent: 'center', alignItems: 'flex-end' }}>
434
+ {
435
+ result?.qr != "" && useIndividualQr == 0 &&
436
+ <TouchableOpacity onPress={() => {
437
+ showQR?.current?.show()
438
+ }}>
439
+ <EventQr_bg>
440
+ <QRCode ecl="H" size={80} value={result?.qr} />
441
+ </EventQr_bg>
442
+ </TouchableOpacity>
443
+ }
444
+ </View>
445
+ {/* </View> */}
426
446
  <UseCondition if={result?.show_ticket_status == 1 && result?.status == 1 || result?.status == 3 || result?.status == 6}>
427
447
  <Text allowFontScaling={false} style={{ fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, marginBottom: 12, color: "#484848" }}>
428
448
  {
@@ -456,35 +476,32 @@ export default function m(props: EventOrder_detailProps): any {
456
476
  <View style={{ marginTop: 15, marginRight: 10 }}>
457
477
  <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, marginBottom: 5, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }}>{esp.lang("event/order_detail", "seat_number")}</Text>
458
478
  <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
459
- {
460
- tickets?.map((item: any, i: number) => {
479
+ {tickets?.map((item: any, i: number) => {
480
+ const [front, end] = item?.seat_name?.split("#") || ["", ""];
481
+ if (item?.seat_name?.includes("#")) {
482
+ return (
483
+ <View key={i} style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: 5, marginBottom: 7, paddingHorizontal: 5, backgroundColor: '#fff', borderRadius: 5, marginRight: 7, ...LibStyle.elevation(5), }}>
484
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 16, color: "#000" }}> {front} </Text>
485
+ <Text allowFontScaling={false} style={{ marginLeft: 3, fontWeight: 'bold', fontSize: 16, color: '#000', }}> {end} </Text>
486
+ </View>
487
+ );
488
+ } else {
461
489
  return (
462
- <View key={i} style={{ paddingVertical: 5, marginBottom: 7, paddingHorizontal: 7, borderWidth: 1, borderColor: '#000', backgroundColor: '#fff', borderRadius: 5, marginRight: 7 }}>
463
- <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 20, color: '#000' }}>{item.seat_name}</Text>
490
+ <View key={i} style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: 5, marginBottom: 7, paddingHorizontal: 5, backgroundColor: '#fff', borderRadius: 5, marginRight: 7, ...LibStyle.elevation(5), }}>
491
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 20, color: "#000" }}>{item?.seat_name}</Text>
464
492
  </View>
465
493
  )
466
- })
467
- }
494
+ }
495
+ })}
468
496
  </View>
469
497
  </View>
470
498
  }
471
499
 
472
- </View>
473
- <View style={{ marginTop: 14, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
474
- {
475
- result?.qr != "" && useIndividualQr == 0 &&
476
- <TouchableOpacity onPress={() => {
477
- showQR?.current?.show()
478
- }}>
479
- <EventQr_bg>
480
- <QRCode ecl="H" size={80} value={result?.qr} />
481
- </EventQr_bg>
482
- </TouchableOpacity>
483
- }
500
+
484
501
  </View>
485
502
  </View>
486
-
487
503
  </View>
504
+
488
505
  }
489
506
  {
490
507
  useIndividualQr > 0 && dataTickets.length > 0 ?
@@ -536,7 +553,7 @@ export default function m(props: EventOrder_detailProps): any {
536
553
 
537
554
  <UseCondition if={result?.is_luckydraw && result?.is_luckydraw == 2}>
538
555
  <View style={{ margin: 15, padding: 10, marginBottom: 0, justifyContent: 'center', alignContent: 'center', alignItems: 'center', borderRadius: 7, backgroundColor: LibStyle.colorBgGrey, paddingBottom: 10, ...LibStyle.elevation(3) }}>
539
- <LibTextstyle textStyle='headline' text={result?.config_luckydraw != null ? esp.lang("event/order_detail", "already_follow") + result?.config_luckydraw?.title : esp.lang("event/order_detail", "already_join_lucky_draw")} style={{ color: '#c9c9c9', fontWeight: 'bold' }} />
556
+ <LibTextstyle textStyle='headline' text={esp.lang("event/order_detail", "already_join_lucky_draw")} style={{ color: '#c9c9c9', fontWeight: 'bold' }} />
540
557
  </View>
541
558
  </UseCondition>
542
559
 
@@ -560,17 +577,36 @@ export default function m(props: EventOrder_detailProps): any {
560
577
  {/* tombol add on */}
561
578
  {
562
579
  result?.addons?.length > 0 && result?.addons?.map((item: any, i: number) => {
563
- return (
564
- <EventButton_order_detail
565
- color={result?.color}
566
- onPress={() => {
567
- loadDataAddons(item?.addons_id, item?.url)
568
- }}
569
- icon={'plus-circle'}
570
- title={item.title}
571
- info={item.info}
572
- />
573
- )
580
+ if (item?.hasOwnProperty("group_id")) {
581
+ return (
582
+ <EventButton_order_detail
583
+ color={result?.color}
584
+ onPress={() => {
585
+ setGroupAddon(item)
586
+ LibUtils.debounce(() => {
587
+ dialogAddonList?.current?.show()
588
+ }, 100)
589
+ // loadDataAddons(item?.addons_id, item?.url)
590
+ }}
591
+ icon={'chevron-down'}
592
+ title={item.group_title}
593
+ info={""}
594
+ />
595
+ )
596
+ } else {
597
+ return (
598
+ <EventButton_order_detail
599
+ key={i}
600
+ color={result?.color}
601
+ onPress={() => {
602
+ loadDataAddons(item?.addons_id, item?.url)
603
+ }}
604
+ icon={'plus-circle-outline'}
605
+ title={item.title}
606
+ info={item.info}
607
+ />
608
+ )
609
+ }
574
610
  })
575
611
  }
576
612
 
@@ -833,6 +869,36 @@ export default function m(props: EventOrder_detailProps): any {
833
869
  </View>
834
870
  </LibSlidingup>
835
871
 
872
+ {/* add on list */}
873
+ <LibSlidingup ref={dialogAddonList}>
874
+ <View style={{ backgroundColor: 'white', borderTopRightRadius: 20, maxHeight: LibStyle.height / 2, borderTopLeftRadius: 20, paddingBottom: 20 }}>
875
+ <View style={{ margin: 15, flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' }}>
876
+ <Text allowFontScaling={false} style={{ flex: 1, fontSize: 16, fontWeight: 'bold' }}>{getGroupAddon()?.group_title}</Text>
877
+ <TouchableOpacity style={{ flex: 1, alignItems: 'flex-end' }} onPress={() => dialogAddonList?.current?.hide()}>
878
+ <LibIcon name='close' />
879
+ </TouchableOpacity>
880
+ </View>
881
+ <ScrollView>
882
+ {
883
+ getGroupAddon()?.addons?.length > 0 && getGroupAddon()?.addons?.map((item: any, i: number) => {
884
+ return (
885
+ <EventButton_order_detail
886
+ key={i}
887
+ color={result?.color}
888
+ onPress={() => {
889
+ loadDataAddons(item?.addons_id, item?.url)
890
+ }}
891
+ icon={'plus-circle-outline'}
892
+ title={item.title}
893
+ info={item.info}
894
+ />
895
+ )
896
+ })
897
+ }
898
+ </ScrollView>
899
+ </View>
900
+ </LibSlidingup>
901
+
836
902
  <LibSlidingup ref={dialogSendBack} >
837
903
  <View style={{ backgroundColor: 'white', borderTopLeftRadius: 20, borderTopRightRadius: 20, padding: 20 }} >
838
904
  <EventPopup email={result?.sharer_email?.trim?.()} redirect={() => {
@@ -872,7 +938,6 @@ export default function m(props: EventOrder_detailProps): any {
872
938
  </View>
873
939
  }
874
940
  />
875
-
876
941
  </View>
877
942
  </LibSlidingup>
878
943
 
@@ -71,7 +71,7 @@ export default function m(props: EventOrder_lotteryProps): any {
71
71
  }
72
72
 
73
73
  LibDialog.confirm(esp.lang("event/order_lottery", "confirm"), esp.lang("event/order_lottery", "confirm_point"), esp.lang("event/order_lottery", "yes"), () => {
74
- LibProgress.show("Mohon tunggu")
74
+ LibProgress.show(esp.lang("event/order_lottery", "please_wait"))
75
75
  new LibCurl("event_order_detail_luckydraw_claim?id=" + id, post, (res: any) => {
76
76
  LibProgress.hide()
77
77
  esp.log(res);
@@ -152,8 +152,10 @@ export default function m(props: EventOrder_lotteryProps): any {
152
152
 
153
153
  return (
154
154
  <View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey /* "#FFC523" */ }}>
155
- <EventHeader title={result?.config != null ? result?.config?.title : esp.lang("event/order_lottery", "follow_lucky_draw")}
156
- subtitle={result?.config != null ? result?.config?.subtitle : ""} />
155
+ <EventHeader
156
+ title={result?.config != null ? result?.config?.title : esp.lang("event/order_lottery", "follow_lucky_draw")}
157
+ // subtitle={result?.config != null ? result?.config?.subtitle : ""}
158
+ />
157
159
 
158
160
  <ScrollView>
159
161
  {
package/event/seat.tsx CHANGED
@@ -355,6 +355,8 @@ export default function m(props: EventSeatProps): any {
355
355
 
356
356
  function renderTicketShare(item: any, i: number) {
357
357
  let _selectTicket = item.hasOwnProperty('check') && item.check
358
+ const [front, end] = item?.seat_name?.split("#") || ["", ""];
359
+
358
360
  return (
359
361
  <TouchableOpacity onPress={() => {
360
362
  if (counter + 1 > dataTicket?.qty && !item.check) {
@@ -365,7 +367,12 @@ export default function m(props: EventSeatProps): any {
365
367
  setCounter(item.check ? counter - 1 : counter + 1)
366
368
  }
367
369
  }} key={i} style={styleId_Z1ppFKw}>
368
- <Text allowFontScaling={false}>{item.seat_name}</Text>
370
+ <View key={i} style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: 5, paddingHorizontal: 5, backgroundColor: '#fff', borderRadius: 5, marginRight: 7, ...LibStyle.elevation(5), }}>
371
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 16, color: "#000" }}> {front} </Text>
372
+ <Text allowFontScaling={false} style={{ marginLeft: 3, fontWeight: 'bold', fontSize: 16, color: '#000', }}> {end} </Text>
373
+ </View>
374
+
375
+ {/* <Text allowFontScaling={false}>{item.seat_name}</Text> */}
369
376
  <TouchableOpacity onPress={() => {
370
377
  if (!item.check && counter + 1 > dataTicket?.qty) {
371
378
  alertSelectSeat()
@@ -383,6 +390,7 @@ export default function m(props: EventSeatProps): any {
383
390
 
384
391
  function renderTicketReturn(item: any, i: number) {
385
392
  let _selectTicket = item.hasOwnProperty('check') && item.check
393
+ const [front, end] = item?.seat_name?.split("#") || ["", ""];
386
394
  return (
387
395
  <TouchableOpacity onPress={() => {
388
396
  if (counter + 1 > dataTicket?.qty && !item.check) {
@@ -393,7 +401,12 @@ export default function m(props: EventSeatProps): any {
393
401
  setCounter(item.check ? counter - 1 : counter + 1)
394
402
  }
395
403
  }} key={i} style={styleId_Z1ppFKw}>
396
- <Text allowFontScaling={false}>{item.seat_name}</Text>
404
+ <View key={i} style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: 5, paddingHorizontal: 5, backgroundColor: '#fff', borderRadius: 5, marginRight: 7, ...LibStyle.elevation(5), }}>
405
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 16, color: "#000" }}> {front} </Text>
406
+ <Text allowFontScaling={false} style={{ marginLeft: 3, fontWeight: 'bold', fontSize: 16, color: '#000', }}> {end} </Text>
407
+ </View>
408
+
409
+ {/* <Text allowFontScaling={false}>{item.seat_name}</Text> */}
397
410
  <TouchableOpacity onPress={() => {
398
411
  if (!item.check && counter + 1 > dataTicket?.qty) {
399
412
  alertSelectSeat()
@@ -202,15 +202,16 @@ export default function m(props: any): any {
202
202
  }}>
203
203
  {
204
204
  getData()?.map(([x, y, name, status], i) => {
205
+ let newName = name?.replace(/^.*#/, "")
205
206
  const isSelected = getSelectedSeat()?.includes(name)
206
207
  const color = isSelected ? "#8EF67B" : getColorByStatus(status)
207
208
  const xSize = (boxSize / 2) + (x * boxSize)
208
209
  const ySize = (boxSize / 2) + (y * boxSize)
209
210
 
210
- const fontSize = getFontSizeByLength(name?.length);
211
- const font = getFontByLength(name?.length);
211
+ const fontSize = getFontSizeByLength(newName?.length);
212
+ const font = getFontByLength(newName?.length);
212
213
 
213
- const textWidthApprox = fontSize * name?.length * 0.6;
214
+ const textWidthApprox = fontSize * newName?.length * 0.6;
214
215
  const textX = xSize + (boxSize - textWidthApprox) / 2;
215
216
 
216
217
  return (
@@ -236,7 +237,7 @@ export default function m(props: any): any {
236
237
  x={textX}
237
238
  y={(ySize) + boxSize * 0.60}
238
239
  color={"#020202"}
239
- text={name}
240
+ text={newName}
240
241
  transform={[{ scale }]}
241
242
  font={font} />
242
243
  )}
@@ -269,6 +270,8 @@ export default function m(props: any): any {
269
270
  let value = {
270
271
  seat_label: getSelectedSeat()
271
272
  }
273
+ esp.log({ value });
274
+ // return
272
275
  if (getSelectedSeat()?.length < qty) {
273
276
  LibToastProperty.show(esp.lang("event/seat_map", "seat_more", (qty - (getSelectedSeat()?.length)).toString()))
274
277
  } else {
@@ -143,7 +143,7 @@ export default function m(props: EventTicket_listProps): any {
143
143
  const [timer] = EventCountdownProperty.countdownTime.useState()
144
144
 
145
145
  const [unAvailableResult, setUnavailableResult] = useLazyState<any>()
146
- const [availableResult, setAvailableResult] = useSafeState<Result>()
146
+ const [availableResult, setAvailableResult, getAvailableResult] = useSafeState<Result>()
147
147
  const [urlPayment, setUrlPayment] = useLazyState<any>()
148
148
 
149
149
  const [qty, setQty, getQty] = useSafeState<number>(1)
@@ -348,7 +348,7 @@ export default function m(props: EventTicket_listProps): any {
348
348
  let colorBackground = item.status != 1 ? LibStyle.colorLightGrey : itemT.status != 1 ? LibStyle.colorLightGrey : colorDefault
349
349
  let textOpacity = /* item.status == 1 ? 1 : */itemT?.status == 1 ? 1 : 0.3
350
350
 
351
- let showCountDown = esp.isDebug("show_countdown") && itemT.status != 0 && item?.date_start != "0000-00-00 00:00:00" && item?.date_end != "0000-00-00 00:00:00"
351
+ let showCountDown = getAvailableResult()?.countdown_booking == "1" && itemT?.status == 1 && item?.status == 1 && item?.date_start != "0000-00-00 00:00:00" && item?.date_end != "0000-00-00 00:00:00" && moment(item?.date_end).format("YYYY-MM-DD HH:mm:ss") >= moment().format("YYYY-MM-DD HH:mm:ss")
352
352
  let dateShowed = item?.price_date == 1 ?
353
353
  moment(item?.date_end).format("YYYY-MM-DD HH:mm:ss") > moment(itemT?.ondate).format("YYYY-MM-DD HH:mm:ss") ? moment(itemT?.ondate).add(1, "days").format("YYYY-MM-DD HH:mm:ss") : item?.date_end
354
354
  : item?.date_end
@@ -629,7 +629,7 @@ export default function m(props: EventTicket_listProps): any {
629
629
  }
630
630
  </EventHtmltext>
631
631
  {
632
- availableResult?.countdown_booking == "1" && displayedData?.length == 1 && item?.date_start != "0000-00-00 00:00:00" && item?.date_end != "0000-00-00 00:00:00" &&
632
+ availableResult?.countdown_booking == "1" && displayedData?.length == 1 && item?.status == 1 && item?.date_start != "0000-00-00 00:00:00" && item?.date_end != "0000-00-00 00:00:00" && moment(item?.date_end).format("YYYY-MM-DD HH:mm:ss") >= moment().format("YYYY-MM-DD HH:mm:ss") &&
633
633
  <EventCountdown_event date={item?.date_end} containerStyle={{ marginVertical: -5 }} />
634
634
  }
635
635
  {
@@ -22,6 +22,7 @@ import { EventAlert } from 'esoftplay/cache/event/alert/import';
22
22
  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
+ import { EventCountdown_event } from 'esoftplay/cache/event/countdown_event/import';
25
26
  import { EventFirebase_socket, EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
26
27
  import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
27
28
  import { EventLoading_pageProperty } from 'esoftplay/cache/event/loading_page/import';
@@ -55,6 +56,7 @@ type Result = {
55
56
  "status": string,
56
57
  "quota_checkout": string,
57
58
  "show_price": string,
59
+ "countdown_booking": string,
58
60
  "config_queue": {
59
61
  "limit": number,
60
62
  "time": number,
@@ -399,6 +401,12 @@ export default function m(props: EventTicket_list2Props): any {
399
401
  let colorBackground = item.status != 1 ? LibStyle.colorLightGrey : itemC.status != 1 ? LibStyle.colorLightGrey : colorDefault
400
402
  let textOpacity = /* item.status == 1 ? 1 : */itemC?.status == 1 ? 1 : 0.3
401
403
 
404
+ let showCountDown = getAvailableResult()?.countdown_booking == "1" && itemC?.status == 1 && item?.status == 1 && item?.date_start != "0000-00-00 00:00:00" && item?.date_end != "0000-00-00 00:00:00" && moment(item?.date_end).format("YYYY-MM-DD HH:mm:ss") >= moment().format("YYYY-MM-DD HH:mm:ss")
405
+ let dateShowed = item?.price_date == 1 ?
406
+ moment(item?.date_end).format("YYYY-MM-DD HH:mm:ss") > moment(itemC?.ondate).format("YYYY-MM-DD HH:mm:ss") ? moment(itemC?.ondate).add(1, "days").format("YYYY-MM-DD HH:mm:ss") : item?.date_end
407
+ : item?.date_end
408
+
409
+
402
410
  return (
403
411
  <TouchableOpacity key={iC} onPress={() => {
404
412
  let msg = ""
@@ -463,11 +471,22 @@ export default function m(props: EventTicket_list2Props): any {
463
471
  </View>
464
472
  </View>
465
473
  }
466
- <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemC.ondate).localeFormat('dddd')}</Text>
467
- <View style={applyStyle({ flexDirection: 'row' })}>
468
- <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemC.ondate).localeFormat('MMMM')}</Text>
469
- <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, marginLeft: 7, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemC.ondate).localeFormat('YYYY')}</Text>
470
- </View>
474
+ {
475
+ showCountDown ?
476
+ <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemC?.ondate).localeFormat('dddd, MMMM YYYY')}</Text>
477
+ :
478
+ <>
479
+ <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemC.ondate).localeFormat('dddd')}</Text>
480
+ <View style={applyStyle({ flexDirection: 'row' })}>
481
+ <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemC.ondate).localeFormat('MMMM')}</Text>
482
+ <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, marginLeft: 7, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemC.ondate).localeFormat('YYYY')}</Text>
483
+ </View>
484
+ </>
485
+ }
486
+ {
487
+ showCountDown &&
488
+ <EventCountdown_event date={dateShowed} containerStyle={{ marginVertical: -5 }} />
489
+ }
471
490
  </View>
472
491
  </View>
473
492
  :
@@ -647,6 +666,11 @@ export default function m(props: EventTicket_list2Props): any {
647
666
  <Text style={{ color: LibStyle.colorRed, fontSize: 10, fontWeight: 'normal' }}> {"(" + esp.lang("event/ticket_list", "min_order") + LibUtils.number(item.qty_min) + ")"}</Text>
648
667
  }
649
668
  </EventHtmltext>
669
+ {
670
+ availableResult?.countdown_booking == "1" && displayedData?.length == 1 && item?.status == 1 && item?.date_start != "0000-00-00 00:00:00" && item?.date_end != "0000-00-00 00:00:00" && moment(item?.date_end).format("YYYY-MM-DD HH:mm:ss") >= moment().format("YYYY-MM-DD HH:mm:ss") &&
671
+ <EventCountdown_event date={item?.date_end} containerStyle={{ marginVertical: -5 }} />
672
+ }
673
+
650
674
  {
651
675
  deeplinkParams?.type == 'event-voucher' && deeplinkParams?.price_id == item.price_id ?
652
676
  <Text allowFontScaling={false} style={{ color: "coral", fontSize: 12, fontWeight: 'bold' }}>{esp.lang("event/ticket_list", "applied_code", deeplinkParams?.code)}</Text>
@@ -248,16 +248,25 @@ export default function m(props: EventTms_check_ticket_resultProps): any {
248
248
  <Text allowFontScaling={false} style={{ fontSize: 14 }}>{LibUtils.moment(item?.ondate).localeFormat('DD MMMM YYYY')}</Text>
249
249
  }
250
250
  </View>
251
- <View style={{ marginBottom: 10, flexDirection: 'row', flexWrap: 'wrap', marginLeft: -10 }}>
251
+ <View style={{ marginBottom: 10, flexDirection: 'row', flexWrap: 'wrap' }}>
252
252
  {
253
253
  item?.tickets?.map((x: any, i: number) => {
254
+ const [front, end] = x?.seat_label?.split("#") || ["", ""];
254
255
  if (x.seat_label != "") {
255
- return (
256
- <View key={i} style={{ marginLeft: 10, paddingVertical: 5, marginBottom: 7, paddingHorizontal: 7, borderWidth: 1, borderColor: '#000', backgroundColor: '#fff', borderRadius: 5 }}>
257
- <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 20, color: '#000' }}>{x.seat_label}</Text>
258
- </View>
259
-
260
- )
256
+ if (x?.seat_label?.includes("#")) {
257
+ return (
258
+ <View key={i} style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: 5, marginBottom: 7, paddingHorizontal: 5, backgroundColor: '#fff', borderRadius: 5, marginRight: 7, ...LibStyle.elevation(5), }}>
259
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 16, color: "#000" }}> {front} </Text>
260
+ <Text allowFontScaling={false} style={{ marginLeft: 3, fontWeight: 'bold', fontSize: 16, color: '#000', }}> {end} </Text>
261
+ </View>
262
+ )
263
+ } else {
264
+ return (
265
+ <View key={i} style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: 5, marginBottom: 7, paddingHorizontal: 5, backgroundColor: '#fff', borderRadius: 5, marginRight: 7, ...LibStyle.elevation(5), }}>
266
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 16, color: "#000" }}>{x?.seat_label}</Text>
267
+ </View>
268
+ )
269
+ }
261
270
  } else {
262
271
  return null
263
272
  }
@@ -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
@@ -180,7 +180,7 @@ export default function m(props: EventTms_in_hall_failedProps): any {
180
180
  {
181
181
  msgError?.result?.length > 0 && msgError?.result?.map((item: any, i: number) => {
182
182
  return (
183
- <View key={i} style={{ marginBottom: 5, backgroundColor: "#fff", borderRadius: 10, overflow: 'hidden' }}>
183
+ <View key={i} style={{ marginHorizontal: 10, marginBottom: 5, backgroundColor: "#fff", borderRadius: 10, overflow: 'hidden' }}>
184
184
  {
185
185
  item.hasOwnProperty("status_label") && item?.status_label != "" &&
186
186
  <View style={{ backgroundColor: '#37c2d0', padding: 10, }} >
@@ -235,16 +235,14 @@ export default function m(props: EventTms_in_hall_failedProps): any {
235
235
  </View>
236
236
  </UseCondition>
237
237
  <View style={{ flexDirection: 'row', width: LibStyle.width - 40, alignItems: 'center', marginVertical: 10, justifyContent: 'space-between' }}>
238
- <UseCondition if={msgError?.status_code != 'EV043'}>
239
- <Pressable onPress={() => {
240
- LibDialog.warningConfirm(esp.lang("event/tms_in_failed", "warn_title"), esp.lang("event/tms_in_failed", "warn_msg"), esp.lang("event/tms_in_failed", "warn_ok"), () => {
241
- sendTelegram()
242
- }, esp.lang("event/tms_in_failed", "warn_no"), () => { })
238
+ <Pressable onPress={() => {
239
+ LibDialog.warningConfirm(esp.lang("event/tms_in_failed", "warn_title"), esp.lang("event/tms_in_failed", "warn_msg"), esp.lang("event/tms_in_failed", "warn_ok"), () => {
240
+ sendTelegram()
241
+ }, esp.lang("event/tms_in_failed", "warn_no"), () => { })
243
242
 
244
- }} style={{ width: (LibStyle.width - 45) * 0.5, height: 40, borderRadius: 5, backgroundColor: LibStyle.colorRed, borderWidth: 3, borderColor: "#fff", justifyContent: 'center', alignContent: 'center', alignItems: 'center', ...LibStyle.elevation(10) }}>
245
- <Text allowFontScaling={false} style={{ textAlign: 'center', fontWeight: 'bold', color: "#fff" }}>{esp.lang("event/tms_in_hall_failed", "report_error")}</Text>
246
- </Pressable>
247
- </UseCondition>
243
+ }} style={{ width: (LibStyle.width - 45) * 0.5, height: 40, borderRadius: 5, backgroundColor: LibStyle.colorRed, borderWidth: 3, borderColor: "#fff", justifyContent: 'center', alignContent: 'center', alignItems: 'center', ...LibStyle.elevation(10) }}>
244
+ <Text allowFontScaling={false} style={{ textAlign: 'center', fontWeight: 'bold', color: "#fff" }}>{esp.lang("event/tms_in_hall_failed", "report_error")}</Text>
245
+ </Pressable>
248
246
  <Pressable onPress={getBack} style={{ width: (LibStyle.width - 45) * 0.5, backgroundColor: LibStyle.colorGreen, height: 40, borderRadius: 5, borderWidth: 5, borderColor: LibStyle.colorGreen, justifyContent: 'center', alignContent: 'center', alignItems: 'center', ...LibStyle.elevation(10) }}>
249
247
  <Text allowFontScaling={false} style={{ fontWeight: 'bold', color: "#fff" }}>{esp.lang("event/tms_in_hall_failed", "back")}</Text>
250
248
  </Pressable>
@@ -23,7 +23,6 @@ import { useRef } from 'react';
23
23
  import { applyStyle } from 'esoftplay';
24
24
  import { EventInput_rectangle } from 'esoftplay/cache/event/input_rectangle/import';
25
25
  import { EventLabel_input } from 'esoftplay/cache/event/label_input/import';
26
- import { UserClass } from 'esoftplay/cache/user/class/import';
27
26
  import useLazyState from 'esoftplay/lazy';
28
27
  import React, { useEffect } from 'react';
29
28
  import { ActivityIndicator, Platform, ScrollView, Text, TouchableOpacity, View } from 'react-native';
@@ -55,7 +54,7 @@ export default function m(props: EventVisitor_inputProps): any {
55
54
  }
56
55
 
57
56
  useEffect(() => {
58
- if (UserClass.state().get().email == 'bagus@fisip.net') {
57
+ if (esp.isDebug("")) {
59
58
  LibNavigation.replace('event/visitor_inputv2', { data: _data, url: url })
60
59
  } else {
61
60
  loadData()
@@ -46,9 +46,13 @@ export default function m(props: EventVisitor_inputv2Props): any {
46
46
  const [counter, setCounter] = useSafeState(1)
47
47
  const [listClaim, setListClaim] = useSafeState()
48
48
  const [selectedCode, setSelectedCode] = useSafeState()
49
+ const [token, setToken] = useSafeState()
49
50
 
50
51
  const dialogListClaim = useRef<LibSlidingup>(null)
51
52
  const dialogClaim = useRef<LibSlidingup>(null)
53
+ let inputName = useRef<EventInput_rectangle>(null)
54
+ let inputToken = useRef<EventInput_rectangle>(null)
55
+
52
56
 
53
57
  let _tabs: any = getData()?.list
54
58
  function setText(list_id: string): (name: string) => void {
@@ -108,6 +112,38 @@ export default function m(props: EventVisitor_inputv2Props): any {
108
112
  }, esp.lang("event/visitor_input", "confirm_cancel"), () => { })
109
113
  }
110
114
 
115
+ function assignToken() {
116
+
117
+ if (token && token != 0 && token > getData()?.token_remaining) {
118
+ LibToastProperty?.show(esp.lang("event/visitor_inputv2", "max_token_is") + getData()?.token_remaining)
119
+ return
120
+ }
121
+
122
+ let post = {
123
+ name: inputName?.current?.getText(),
124
+ token: inputToken?.current?.getText() == "" ? 0 : inputToken?.current?.getText(),
125
+ code: selectedCode?.access_code
126
+ }
127
+
128
+ LibDialog.confirm(esp.lang("event/visitor_input", "confirm_title"), esp.lang("event/visitor_inputv2", "confirm_input_token"), esp.lang("event/visitor_inputv2", "yes"), () => {
129
+ LibProgress.show(esp.lang("event/visitor_inputv2", "please_wait"))
130
+ new LibCurl('event_exhibitor_staff_token', post, (res, msg) => {
131
+ LibProgress.hide()
132
+ LibDialog.info(esp.lang("event/visitor_input", "confirm_success"), msg);
133
+ loadData()
134
+ setCounter(counter + 1)
135
+ dialogClaim?.current?.hide()
136
+ }, (error) => {
137
+ dialogClaim?.current?.hide()
138
+ LibProgress.hide()
139
+ LibDialog.warning(esp.lang("event/visitor_input", "confirm_failed"), error?.message)
140
+ })
141
+
142
+ }, esp.lang("event/visitor_inputv2", "no"), () => { })
143
+ }
144
+
145
+ esp.log(selectedCode);
146
+
111
147
  function renderTabs(item: any, i: number) {
112
148
  return (
113
149
  <TouchableOpacity key={i} onPress={() => {
@@ -193,7 +229,7 @@ export default function m(props: EventVisitor_inputv2Props): any {
193
229
  <LibIcon.Ionicons name='copy' size={16} style={applyStyle({ color: item.is_used == 1 ? "#c4c4c4" : "#2980b9", marginLeft: 7 })} />
194
230
  </TouchableOpacity>
195
231
  <View style={{ flex: 1, justifyContent: 'flex-end', flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
196
- <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 13, fontWeight: "normal", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#9b9b9b", }}>{"Belum digunakan"}</Text>
232
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 13, fontWeight: "normal", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#9b9b9b", }}>{item?.is_used == 1 ? "" : esp.lang("event/visitor_inputv2", "notyet_used")}</Text>
197
233
  <TouchableOpacity onPress={() => {
198
234
  dialogClaim?.current?.show()
199
235
  setSelectedCode(item)
@@ -202,8 +238,24 @@ export default function m(props: EventVisitor_inputv2Props): any {
202
238
  </TouchableOpacity>
203
239
  </View>
204
240
  </View>
205
- <View style={{ padding: 10, borderWidth: 1, borderColor: LibStyle.colorBgGrey, borderRadius: 5, marginTop: 5 }}>
206
241
 
242
+ <View style={{ padding: 5, borderWidth: 1, borderColor: LibStyle.colorBgGrey, borderRadius: 5, marginTop: 5 }}>
243
+ <Text allowFontScaling={false} style={{ fontSize: 10, color: '#9b9b9b' }}>{esp.lang("event/visitor_inputv2", "name")}</Text>
244
+ <Text allowFontScaling={false} style={{ fontSize: 14 }}>{item.name == null ? "-" : item.name}</Text>
245
+ <View style={{ marginTop: 5, flexDirection: 'row', justifyContent: 'space-between' }}>
246
+ <View style={{ flex: 1 }}>
247
+ <Text allowFontScaling={false} style={{ fontSize: 10, color: '#9b9b9b' }}>{esp.lang("event/visitor_inputv2", "total_token")}</Text>
248
+ <Text allowFontScaling={false} style={{ fontSize: 14 }}>{Number(item?.token)}</Text>
249
+ </View>
250
+ <View style={{ flex: 1 }}>
251
+ <Text allowFontScaling={false} style={{ fontSize: 10, color: '#9b9b9b' }}>{esp.lang("event/visitor_inputv2", "token_used")}</Text>
252
+ <Text allowFontScaling={false} style={{ fontSize: 14 }}>{Number(item?.token_used)}</Text>
253
+ </View>
254
+ <View style={{ flex: 1 }}>
255
+ <Text allowFontScaling={false} style={{ fontSize: 10, color: '#9b9b9b' }}>{esp.lang("event/visitor_inputv2", "token_left")}</Text>
256
+ <Text allowFontScaling={false} style={{ fontSize: 14 }}>{Number(item?.token_remaining)}</Text>
257
+ </View>
258
+ </View>
207
259
  </View>
208
260
  </View>
209
261
  )
@@ -238,24 +290,24 @@ export default function m(props: EventVisitor_inputv2Props): any {
238
290
  },
239
291
  {
240
292
  id: 2,
241
- title: "Total Token",
293
+ title: esp.lang("event/visitor_inputv2", "total_token"),
242
294
  color: '#d7edf8',
243
295
  textColor: '#64b0e0',
244
- total: 4275
296
+ total: LibUtils.number(getData()?.token)
245
297
  },
246
298
  {
247
299
  id: 3,
248
- title: "Token dialokasikan",
300
+ title: esp.lang("event/visitor_inputv2", "token_shared"),
249
301
  color: '#fbe3dd',
250
302
  textColor: '#ec7463',
251
- total: 4170
303
+ total: LibUtils.number(getData()?.token_shared)
252
304
  },
253
305
  {
254
306
  id: 4,
255
- title: "Token tersisa",
307
+ title: esp.lang("event/visitor_inputv2", "token_left"),
256
308
  color: '#fef2de',
257
309
  textColor: '#f6c67f',
258
- total: 105
310
+ total: LibUtils.number(getData()?.token_remaining)
259
311
  },
260
312
  ]
261
313
 
@@ -264,7 +316,27 @@ export default function m(props: EventVisitor_inputv2Props): any {
264
316
  <EventHeader title={esp.lang("event/visitor_input", "title_input_exhibitor")} subtitle={esp.lang("event/visitor_input", "total_staff", LibUtils.number(data.qty))} />
265
317
  <LibKeyboard_avoid style={{ flex: 1 }}>
266
318
  <>
267
- {/* <ComponentTabheader titles={tabTitles} activeIndex={tabIndex} onPress={(index) => setTabIndex(index)} /> */}
319
+ {
320
+ activeTab?.type == "STAFF" &&
321
+ <View style={{ padding: 10, paddingBottom: 0, flexDirection: 'row', justifyContent: 'space-between', flexWrap: 'wrap' }}>
322
+ {
323
+ menuHeader?.map((item, i) => {
324
+ return (
325
+ <View key={i} style={{ width: (LibStyle.width - 30) / 2, alignContent: 'center', alignItems: 'center', marginBottom: 10, overflow: 'hidden', backgroundColor: item.color, borderRadius: 5, padding: 5, flexDirection: 'row', justifyContent: 'space-between' }}>
326
+ <View style={{ flex: 2, }}>
327
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4b4b4b" }}>{item.title}</Text>
328
+ </View>
329
+ <View style={{ marginLeft: 5, flex: 1 }}>
330
+ <View style={{ alignContent: 'center', alignItems: 'center', backgroundColor: item.textColor, paddingHorizontal: 7, paddingVertical: 3, borderRadius: 5 }}>
331
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{item.total}</Text>
332
+ </View>
333
+ </View>
334
+ </View>
335
+ )
336
+ })
337
+ }
338
+ </View>
339
+ }
268
340
 
269
341
  <View style={{ height: 35, marginBottom: 2, flexDirection: 'row', backgroundColor: '#fff', ...LibStyle.elevation(2) }} >
270
342
  <ScrollView horizontal showsHorizontalScrollIndicator={false} >
@@ -280,43 +352,17 @@ export default function m(props: EventVisitor_inputv2Props): any {
280
352
  // style={{ flex: 1 }}
281
353
  ListHeaderComponent={
282
354
  <>
283
- {
355
+ {/* {
284
356
  activeTab?.ondate != "0000-00-00" &&
285
357
  <View style={{ margin: 10, marginBottom: 0 }}>
286
358
  <Text allowFontScaling={false} style={{ fontWeight: 'bold', color: LibStyle.colorGreen }}>{"Tanggal berlaku " + LibUtils.moment(activeTab?.ondate).format("DD MMMM YYYY")}</Text>
287
359
  </View>
288
- }
289
- {
290
- activeTab?.type == "STAFF" &&
291
- <View style={{ padding: 10, paddingBottom: 0, flexDirection: 'row', justifyContent: 'space-between', flexWrap: 'wrap' }}>
292
- {
293
- menuHeader?.map((item, i) => {
294
- return (
295
- <View key={i} style={{ width: (LibStyle.width - 30) / 2, alignContent: 'center', alignItems: 'center', marginBottom: 10, overflow: 'hidden', backgroundColor: item.color, borderRadius: 5, padding: 5, flexDirection: 'row', justifyContent: 'space-between' }}>
296
- <View style={{ flex: 2, }}>
297
- <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4b4b4b" }}>{item.title}</Text>
298
- </View>
299
- <View style={{ marginLeft: 5, flex: 1 }}>
300
- <View style={{ alignContent: 'center', alignItems: 'center', backgroundColor: item.textColor, paddingHorizontal: 7, paddingVertical: 3, borderRadius: 5 }}>
301
- <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{item.total}</Text>
302
- </View>
303
- </View>
304
- </View>
305
- )
306
- })
307
- }
308
- </View>
309
- }
310
-
360
+ } */}
311
361
  </>
312
362
  }
313
363
  removeClippedSubviews={Platform.OS == 'android'}
314
364
  renderItem={renderItem}
315
365
  />
316
- {
317
- activeTab?.type == "STAFF" &&
318
- <EventButton style={{ backgroundColor: '#00b894', margin: 5 }} label={esp.lang("event/visitor_input", "save_btn")} onPress={() => { send() }} />
319
- }
320
366
  </>
321
367
  </LibKeyboard_avoid>
322
368
  <LibSlidingup ref={dialogListClaim}>
@@ -327,8 +373,6 @@ export default function m(props: EventVisitor_inputv2Props): any {
327
373
  </View>
328
374
  <LibInfinite
329
375
  url={listClaim?.url}
330
- // isDebug={1}
331
- // key={}
332
376
  removeClippedSubviews={Platform.OS == 'android'}
333
377
  renderItem={(item: any, i: number) => {
334
378
  return (
@@ -348,47 +392,59 @@ export default function m(props: EventVisitor_inputv2Props): any {
348
392
  <LibSlidingup ref={dialogClaim}>
349
393
  <View style={{ backgroundColor: 'white', padding: 15, maxHeight: LibStyle.height * 0.7, borderTopLeftRadius: 5, borderTopRightRadius: 5 }} >
350
394
  <View style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' }}>
351
- <LibTextstyle text={"Kode"} textStyle="headline" />
395
+ <LibTextstyle text={esp.lang("event/visitor_inputv2", "code")} textStyle="headline" />
352
396
  <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#00b894" }}>{selectedCode?.access_code}</Text>
353
397
  </View>
354
398
 
355
- <EventLabel_input label={"Masukkan nama"} />
399
+ <EventLabel_input label={esp.lang("event/visitor_inputv2", "input_name")} />
356
400
  <EventInput_rectangle
401
+ ref={inputName}
357
402
  returnKeyType="next"
358
- style={applyStyle({ borderRadius: 4, borderColor: '#c4c4c4', height: 35, marginTop: 8, backgroundColor: '#fff' })}
359
- onChangeText={(t) => {
360
-
361
- }}
362
- placeholder={"Masukkan nama"}
403
+ style={applyStyle({ borderRadius: 4, borderColor: '#c4c4c4', marginTop: 8, backgroundColor: '#fff' })}
404
+ inputStyle={{ color: selectedCode?.is_used == "1" ? "#c4c4c4" : "#000" }}
405
+ onSubmitEditing={() => inputToken?.current?.focus()}
406
+ placeholder={esp.lang("event/visitor_inputv2", "input_name")}
407
+ defaultValue={selectedCode?.name}
408
+ editable={selectedCode?.is_used == "1" ? false : true}
363
409
  />
364
410
 
365
411
  <View style={{ flexDirection: 'row', justifyContent: 'flex-end', alignContent: 'center', alignItems: 'center' }}>
366
412
  <View style={{ flex: 2 }}>
367
- <EventLabel_input label={"Masukkan token"} />
413
+ <EventLabel_input label={esp.lang("event/visitor_inputv2", "input_token")} mandatory />
368
414
  <EventInput_rectangle
369
- returnKeyType="next"
370
- style={applyStyle({ borderRadius: 4, borderColor: '#c4c4c4', height: 35, marginTop: 8, backgroundColor: '#fff' })}
371
- onChangeText={(t) => {
372
-
373
- }}
374
- placeholder={"Masukkan token"}
415
+ ref={inputToken}
416
+ keyboardType='phone-pad'
417
+ returnKeyType="done"
418
+ style={applyStyle({ borderRadius: 4, borderColor: '#c4c4c4', marginTop: 8, backgroundColor: '#fff' })}
419
+ placeholder={esp.lang("event/visitor_inputv2", "input_token")}
420
+ onChangeText={(t) => setToken(t)}
421
+ onSubmitEditing={assignToken}
422
+ defaultValue={selectedCode?.token != "0" ? selectedCode?.token : ''}
375
423
  />
376
424
  </View>
377
- <View style={{ flex: 1, justifyContent: 'flex-end', marginLeft: 10, marginTop: 5 }}>
378
- <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4b4b4b" }}>{"Token terpakai"}</Text>
379
- <View style={{ marginTop: 12, alignContent: 'center', alignItems: 'center', backgroundColor: "#ec7463", paddingHorizontal: 7, paddingVertical: 3, borderRadius: 5 }}>
380
- <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{10}</Text>
425
+ {
426
+ selectedCode?.token != "0" &&
427
+ <View style={{ flex: 1, justifyContent: 'flex-end', marginLeft: 10, marginTop: 5 }}>
428
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4b4b4b" }}>{esp.lang("event/visitor_inputv2", "token_used")}</Text>
429
+ <View style={{ marginTop: 12, alignContent: 'center', alignItems: 'center', backgroundColor: "#ec7463", paddingHorizontal: 7, paddingVertical: 3, borderRadius: 5 }}>
430
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{LibUtils.number(selectedCode?.token_used)}</Text>
431
+ </View>
381
432
  </View>
382
- </View>
383
- <View style={{ flex: 1, justifyContent: 'flex-end', marginLeft: 10, marginTop: 5 }}>
384
- <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4b4b4b" }}>{"Token tersisa"}</Text>
385
- <View style={{ marginTop: 12, alignContent: 'center', alignItems: 'center', backgroundColor: "#f6c67f", paddingHorizontal: 7, paddingVertical: 3, borderRadius: 5 }}>
386
- <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{120}</Text>
433
+ }
434
+ {
435
+ selectedCode?.token != "0" &&
436
+ <View style={{ flex: 1, justifyContent: 'flex-end', marginLeft: 10, marginTop: 5 }}>
437
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4b4b4b" }}>{esp.lang("event/visitor_inputv2", "token_left")}</Text>
438
+ <View style={{ marginTop: 12, alignContent: 'center', alignItems: 'center', backgroundColor: "#f6c67f", paddingHorizontal: 7, paddingVertical: 3, borderRadius: 5 }}>
439
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{LibUtils.number(selectedCode?.token_remaining)}</Text>
440
+ </View>
387
441
  </View>
388
- </View>
442
+ }
389
443
  </View>
390
444
 
391
- <EventButton style={{ backgroundColor: '#00b894', marginTop: 15 }} label={esp.lang("event/visitor_input", "save_btn")} onPress={() => { }} />
445
+ <EventButton style={{ backgroundColor: '#00b894', marginTop: 15, borderRadius: 5 }} label={esp.lang("event/visitor_input", "save_btn")} onPress={() => {
446
+ assignToken()
447
+ }} />
392
448
 
393
449
  </View>
394
450
  </LibSlidingup>
package/id.json CHANGED
@@ -931,7 +931,7 @@
931
931
  "Checked_within_10_minutes_after_payment_is_made": "Dicek dalam 10 menit setelah pembayaran dilakukan",
932
932
  "This_Event_Has_Changed_the_Event_Date_Please_Reschedule_or_Refund": "Event ini Mengalami Perubahan Tanggal Event, Silahkan Reschedule atau Melakukan Refund",
933
933
  "already_follow": "Sudah memilih ",
934
- "already_join_lucky_draw": "Sudah memilih lucky draw",
934
+ "already_join_lucky_draw": "Pilihan sudah dibuat",
935
935
  "back_err": "Oops",
936
936
  "back_to_homepage": "Kembali ke Halaman Utama",
937
937
  "birtdate": "Tanggal Lahir",
@@ -1078,15 +1078,16 @@
1078
1078
  "used_once": "Bisa digunakan sekali selama acara berlangsung"
1079
1079
  },
1080
1080
  "event/order_lottery": {
1081
- "chance_for_exchange": " kesempatan untuk ditukarkan",
1081
+ "chance_for_exchange": " pilihan untuk dibuat",
1082
1082
  "confirm": "Konfirmasi",
1083
- "confirm_point": "Apakah kupon yang anda masukkan sudah benar?",
1083
+ "confirm_point": "Apakah pilihan yang anda masukkan sudah benar?",
1084
1084
  "follow_lucky_draw": "Ikuti Lucky Draw",
1085
1085
  "information": "Informasi",
1086
1086
  "no": "Tidak",
1087
1087
  "oops": "Oops",
1088
1088
  "please_enter_all_point": "Silahkan masukkan semua kupon lucky draw anda",
1089
- "submit": "Tukarkan Kupon",
1089
+ "please_wait": "Mohon tunggu",
1090
+ "submit": "Lanjutkan untuk konfirmasi",
1090
1091
  "token_for_luckydraw": " kupon untuk mengikuti undian Lucky Draw",
1091
1092
  "u_have": "Anda mempunyai ",
1092
1093
  "yes": "Ya",
@@ -1868,6 +1869,23 @@
1868
1869
  "title_input_exhibitors": "Masukkan Exhibitors",
1869
1870
  "total_staff": "Total %s "
1870
1871
  },
1872
+ "event/visitor_inputv2": {
1873
+ "code": "Kode",
1874
+ "confirm_input_token": "Apakah data yang anda masukkan sudah benar?",
1875
+ "esp.lang(\"event/visitor_input\", \"confirm_title\")": "Info",
1876
+ "input_name": "Masukkan nama",
1877
+ "input_token": "Masukkan token",
1878
+ "max_token_is": "Maksimal token yang anda punya adalah ",
1879
+ "name": "Nama",
1880
+ "no": "Tidak",
1881
+ "notyet_used": "Belum digunakan",
1882
+ "please_wait": "Mohon tunggu",
1883
+ "token_left": "Token tersisa",
1884
+ "token_shared": "Token dialokasikan",
1885
+ "token_used": "Total terpakai",
1886
+ "total_token": "Total token",
1887
+ "yes": "Ya"
1888
+ },
1871
1889
  "event/voucher": {
1872
1890
  "check_wait": "Mohon Tunggu",
1873
1891
  "header": "Silahkan input kode",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay-event",
3
- "version": "0.0.1-z",
3
+ "version": "0.0.2-a",
4
4
  "description": "event module on esoftplay framework",
5
5
  "main": "index.js",
6
6
  "scripts": {