esoftplay-event 0.0.2-c → 0.0.2-e

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"
@@ -385,7 +385,7 @@ export default function m(props: EventOrder_detailProps): any {
385
385
 
386
386
  const termData = result?.term ? Object.values(result?.term) : []
387
387
 
388
- esp.log(result);
388
+ // esp.log(result);
389
389
 
390
390
  return (
391
391
  <View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
@@ -466,7 +466,7 @@ export default function m(props: EventOrder_detailProps): any {
466
466
 
467
467
  {
468
468
  result?.ondate == "0000-00-00" &&
469
- <View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
469
+ <View style={{ marginRight: 85, flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
470
470
  <LibIcon name="calendar-blank-outline" size={20} />
471
471
  <Text allowFontScaling={false} style={{ flex: 1, marginRight: 10, marginLeft: 6, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{((isInvitationDate || isOnlineWithoutDate) ? esp.lang("event/order_item", "used_once") : dateRange)}</Text>
472
472
  </View>
@@ -580,6 +580,7 @@ export default function m(props: EventOrder_detailProps): any {
580
580
  if (item?.hasOwnProperty("group_id")) {
581
581
  return (
582
582
  <EventButton_order_detail
583
+ key={i}
583
584
  color={result?.color}
584
585
  onPress={() => {
585
586
  setGroupAddon(item)
@@ -593,6 +594,23 @@ export default function m(props: EventOrder_detailProps): any {
593
594
  info={""}
594
595
  />
595
596
  )
597
+ } else if (item?.hasOwnProperty('list')) {
598
+ return (
599
+ <EventButton_order_detail
600
+ key={i}
601
+ color={result?.color}
602
+ onPress={() => {
603
+ setGroupAddon(item)
604
+ LibUtils.debounce(() => {
605
+ dialogAddonList?.current?.show()
606
+ }, 100)
607
+ // loadDataAddons(item?.addons_id, item?.url)
608
+ }}
609
+ icon={'chevron-down'}
610
+ title={item.title}
611
+ info={""}
612
+ />
613
+ )
596
614
  } else {
597
615
  return (
598
616
  <EventButton_order_detail
@@ -873,12 +891,32 @@ export default function m(props: EventOrder_detailProps): any {
873
891
  <LibSlidingup ref={dialogAddonList}>
874
892
  <View style={{ backgroundColor: 'white', borderTopRightRadius: 20, maxHeight: LibStyle.height / 2, borderTopLeftRadius: 20, paddingBottom: 20 }}>
875
893
  <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>
894
+ <Text allowFontScaling={false} style={{ flex: 1, fontSize: 16, fontWeight: 'bold' }}>{getGroupAddon()?.hasOwnProperty("list") ? getGroupAddon()?.title : getGroupAddon()?.group_title}</Text>
877
895
  <TouchableOpacity style={{ flex: 1, alignItems: 'flex-end' }} onPress={() => dialogAddonList?.current?.hide()}>
878
896
  <LibIcon name='close' />
879
897
  </TouchableOpacity>
880
898
  </View>
881
899
  <ScrollView>
900
+ {/* sementara dobel2 begini nanti yang dipakai itu yang list */}
901
+
902
+ {/* ini list untuk yang ondate */}
903
+ {
904
+ getGroupAddon()?.list?.length > 0 && getGroupAddon()?.list?.map((item: any, i: number) => {
905
+ return (
906
+ <EventButton_order_detail
907
+ key={i}
908
+ color={result?.color}
909
+ onPress={() => {
910
+ loadDataAddons(getGroupAddon()?.addons_id, item?.url)
911
+ }}
912
+ icon={'plus-circle-outline'}
913
+ title={getGroupAddon()?.title + " " + LibUtils.moment(item.ondate).format("DD MMM YYYY")}
914
+ info={item.hasOwnProperty("info") && item?.info}
915
+ />
916
+ )
917
+ })
918
+ }
919
+ {/* ini untuk yang grouping */}
882
920
  {
883
921
  getGroupAddon()?.addons?.length > 0 && getGroupAddon()?.addons?.map((item: any, i: number) => {
884
922
  return (
@@ -21,8 +21,8 @@ export interface EventScheduleProps {
21
21
 
22
22
  }
23
23
  export default function m(props: EventScheduleProps): any {
24
- const { schedule, dataBookingEvent, order_type, tax } = LibNavigation.getArgsAll(props)
25
- const [qty, setQty] = useSafeState<number>(dataBookingEvent?.qty)
24
+ const { schedule, dataBookingEvent, order_type, tax, is_multiprice } = LibNavigation.getArgsAll(props)
25
+ const [qty, setQty] = useSafeState<number>(dataBookingEvent?.qty || 1)
26
26
 
27
27
  function add(quota?: any, quota_used?: any): void {
28
28
  if (qty != parseInt(dataBookingEvent?.selected_ticket?.qty_max)) {
@@ -71,22 +71,22 @@ export default function m(props: EventScheduleProps): any {
71
71
  return (
72
72
  <View key={i} style={styleId_26m88j}>
73
73
  {
74
- _item.image != "" &&
75
- <LibPicture source={{ uri: _item.image }} style={styleId_15Un4S} />
74
+ Boolean(_item?.image) && _item?.image != "" &&
75
+ <LibPicture source={{ uri: _item?.image }} style={styleId_15Un4S} />
76
76
  }
77
- <Text allowFontScaling={false} style={styleId_XKKqU}>{_item.name}</Text>
77
+ <Text allowFontScaling={false} style={styleId_XKKqU}>{_item?.name || ""}</Text>
78
78
  <ScrollView>
79
79
  {
80
- _item.description != "" &&
81
- <LibWebview source={{ html: _item.description }} onFinishLoad={() => { }} style={styleId_ZoKh7U} />
80
+ Boolean(_item?.description) && _item?.description != "" &&
81
+ <LibWebview source={{ html: _item?.description }} onFinishLoad={() => { }} style={styleId_ZoKh7U} />
82
82
  }
83
83
  </ScrollView>
84
84
  {
85
- _item?.video != "" &&
85
+ Boolean(_item?.video) && _item?.video != "" &&
86
86
  <>
87
87
  <Text allowFontScaling={false} style={styleId_Z1RMsb6} >{esp.lang("event/schedule", "text_vide")}</Text>
88
- <TouchableOpacity onPress={() => LibNavigation.navigate('lib/video', { code: _item.video })} >
89
- <LibPicture source={{ uri: LibVideoProperty.getUrlThumbnail(_item.video) }} style={styleId_1g6pcd} />
88
+ <TouchableOpacity onPress={() => LibNavigation.navigate('lib/video', { code: _item?.video })} >
89
+ <LibPicture source={{ uri: LibVideoProperty.getUrlThumbnail(_item?.video) }} style={styleId_1g6pcd} />
90
90
  </TouchableOpacity>
91
91
  </>
92
92
  }
@@ -98,32 +98,35 @@ export default function m(props: EventScheduleProps): any {
98
98
 
99
99
  return (
100
100
  <View style={{ flex: 1, backgroundColor: '#fff' }}>
101
- <EventHeader title={esp.lang("event/schedule", "header_title")} />
101
+ <EventHeader title={dataBookingEvent?.event_title} />
102
102
  <ScrollView>
103
103
  {
104
- schedule?.artist.length > 0 && schedule.artist.map(renderArtist)
104
+ schedule?.artist?.length > 0 && schedule?.artist?.map?.(renderArtist)
105
105
  }
106
106
 
107
-
108
107
  </ScrollView>
109
- <View style={{ padding: 10 }} >
110
- <View style={{ flexDirection: 'row', marginVertical: 10, alignContent: 'center', alignItems: 'center', alignSelf: 'center' }}>
111
- <TouchableOpacity onPress={() => { min() }}>
112
- <View style={{ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' }}>
113
- <LibIcon name="minus" color="#e74c3c" />
114
- </View>
115
- </TouchableOpacity>
116
- <Text style={{ fontFamily: "Arial", fontSize: 20, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#9b9b9b", marginLeft: 15, marginRight: 15 }}>{qty}</Text>
117
- <TouchableOpacity onPress={() => { add(item?.quota, item?.quota_used) }}>
118
- <View style={{ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' }}>
119
- <LibIcon name="plus" color="#16a085" />
120
- </View>
121
- </TouchableOpacity>
108
+
109
+ {
110
+ is_multiprice == 0 &&
111
+ <View style={{ padding: 10 }} >
112
+ <View style={{ flexDirection: 'row', marginVertical: 10, alignContent: 'center', alignItems: 'center', alignSelf: 'center' }}>
113
+ <TouchableOpacity onPress={() => { min() }}>
114
+ <View style={{ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' }}>
115
+ <LibIcon name="minus" color="#e74c3c" />
116
+ </View>
117
+ </TouchableOpacity>
118
+ <Text style={{ fontFamily: "Arial", fontSize: 20, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#9b9b9b", marginLeft: 15, marginRight: 15 }}>{qty}</Text>
119
+ <TouchableOpacity onPress={() => { add(item?.quota, item?.quota_used) }}>
120
+ <View style={{ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' }}>
121
+ <LibIcon name="plus" color="#16a085" />
122
+ </View>
123
+ </TouchableOpacity>
124
+ </View>
125
+ <EventButton label={esp.lang("event/schedule", "next")} onPress={() => {
126
+ doBooking()
127
+ }} style={{ backgroundColor: LibStyle.colorGreen }} />
122
128
  </View>
123
- <EventButton label={esp.lang("event/schedule", "next")} onPress={() => {
124
- doBooking()
125
- }} style={{ backgroundColor: LibStyle.colorGreen }} />
126
- </View>
129
+ }
127
130
  </View>
128
131
  )
129
132
  }
@@ -500,7 +500,8 @@ export default function m(props: EventTicket_listProps): any {
500
500
  schedule: itemT.schedule,
501
501
  order_type: eventConfig?.order_type?.ticket,
502
502
  tax: selectedTicket?.tax == null ? 0 : selectedTicket?.tax,
503
- dataBookingEvent: dataPost
503
+ dataBookingEvent: dataPost,
504
+ is_multiprice: 0
504
505
  })
505
506
  }
506
507
 
@@ -556,6 +556,45 @@ export default function m(props: EventTicket_list2Props): any {
556
556
  }
557
557
  </View>
558
558
 
559
+ {
560
+ ticketWithDate && itemC.schedule?.artist?.length > 0 &&
561
+ <TouchableOpacity onPress={() => {
562
+ if (item.status == 1 && itemC.status == 1) {
563
+ let itemTicket = {
564
+ ...item
565
+ }
566
+ let replaceList = LibObject.set(itemTicket, itemC)('list')
567
+ // ini jika dia gajadi beli dari halaman schedule.
568
+ // setSelectedTicket(replaceList)
569
+ // setQtyGlobal(itemT)
570
+ // releaseQueue()
571
+ // ini untuk dikirim ke halaman schedule
572
+ let dataPost: any = {
573
+ event_id: availableResult?.id,
574
+ event_title: availableResult?.title,
575
+ charge_payment: availableResult?.charge_payment,
576
+ charge_payment_type: availableResult?.charge_payment_type,
577
+ images: availableResult?.images,
578
+ selected_ticket: replaceList,
579
+ qty: itemC.hasOwnProperty("qty") ? itemC?.qty : 1,
580
+ }
581
+
582
+ LibNavigation.navigate('event/schedule', {
583
+ schedule: itemC.schedule,
584
+ order_type: EventConfigProperty?.state()?.get()?.order_type?.ticket,
585
+ tax: item?.tax,
586
+ dataBookingEvent: dataPost,
587
+ is_multiprice: 1
588
+ })
589
+ }
590
+
591
+
592
+ }} activeOpacity={itemC.status == 1 ? 0 : 1} style={applyStyle({ padding: 5, opacity: 1 })} hitSlop={{ top: 15, left: 15, right: 15, bottom: 15 }} >
593
+ <LibIcon name="information-outline" size={18} color={"#434343"} style={{ opacity: textOpacity }} />
594
+ </TouchableOpacity>
595
+ }
596
+
597
+
559
598
  </View>
560
599
  </TouchableOpacity>
561
600
  )
@@ -11,6 +11,7 @@ import { LibObject } from 'esoftplay/cache/lib/object/import';
11
11
  import { LibPicture } from 'esoftplay/cache/lib/picture/import';
12
12
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
13
13
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
14
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
14
15
  import { UserClass } from 'esoftplay/cache/user/class/import';
15
16
  import esp from 'esoftplay/esp';
16
17
  import useSafeState from 'esoftplay/state';
@@ -50,6 +51,7 @@ export default function m(props: EventTms_idcardProps): any {
50
51
  } = LibNavigation.getArgsAll(props)
51
52
 
52
53
  const [result, setResult] = useSafeState<any>()
54
+ const [useToken, TokenLeft] = selectedTicket?.token?.split("-")
53
55
 
54
56
  function loadData() {
55
57
  // load data untuk ngambil background id card
@@ -155,10 +157,10 @@ export default function m(props: EventTms_idcardProps): any {
155
157
 
156
158
  <View style={{ padding: 5, flexDirection: 'row', backgroundColor: LibStyle.colorPrimary, margin: 10, borderRadius: 10 }}>
157
159
  {
158
- esp.isDebug("") &&
160
+ useToken == 1 &&
159
161
  <View style={{ padding: 5, paddingHorizontal: 35, alignContent: 'center', alignItems: 'center', borderRadius: 10, backgroundColor: '#fff' }}>
160
162
  <Text allowFontScaling={false} style={{ fontSize: 12, color: '#000', fontWeight: 'bold' }}>{esp.lang("event/tms_idcard", "token")}</Text>
161
- <Text allowFontScaling={false} style={{ fontSize: 35, color: '#000', lineHeight: 35, fontWeight: 'bold' }} >10</Text>
163
+ <Text allowFontScaling={false} style={{ fontSize: 35, color: '#000', lineHeight: 35, fontWeight: 'bold' }} >{LibUtils.number(TokenLeft)}</Text>
162
164
  </View>
163
165
  }
164
166
  <TouchableOpacity onPress={() => {
package/event/tms_in.tsx CHANGED
@@ -131,8 +131,8 @@ export default function m(props: EventTms_inProps): any {
131
131
  qty: item[0],
132
132
  qty_used: item[2],
133
133
  qty_left: Number(item[0]) - (Number(item[2]) || 0),
134
+ token: item[6],
134
135
  text: item[7] || "",
135
- token: item[6]
136
136
  }
137
137
  tikets.push(x)
138
138
  })
@@ -195,7 +195,7 @@ export default function m(props: EventTms_in_hall_failedProps): any {
195
195
  <View style={{ flex: 2 }}>
196
196
  <Text allowFontScaling={false} style={{ marginBottom: 5, fontWeight: 'bold', textAlign: 'center', fontSize: 14 }}>{esp.lang("event/tms_in_hall_failed", "time")}</Text>
197
197
  {
198
- item?.hall_scanned != "0000-00-00 00:00:00" &&
198
+ item.hasOwnProperty("hall_scanned") && item?.hall_scanned != "0000-00-00 00:00:00" &&
199
199
  <Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 12 }}>{LibUtils.moment(item?.hall_scanned).localeFormat("DD MMM H:mm:ss ")}</Text>
200
200
  }
201
201
  </View>
@@ -101,7 +101,7 @@ export default function m(props: EventTms_out_hall_failedProps): any {
101
101
  </View>
102
102
  <View style={{ flex: 1, justifyContent: 'center', paddingVertical: 5 }}>
103
103
  {
104
- item?.scanned != "0000-00-00 00:00:00" &&
104
+ item?.hasOwnProperty("scanned") && item?.scanned != "0000-00-00 00:00:00" &&
105
105
  <Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 12 }}>{LibUtils.moment(item.hall_scanned).localeFormat("DD MMM H:mm:ss ")}</Text>
106
106
  }
107
107
  </View>
@@ -0,0 +1,39 @@
1
+ // withHooks
2
+ import { EventHeader } from 'esoftplay/cache/event/header/import';
3
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
4
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
5
+ import esp from 'esoftplay/esp';
6
+
7
+ import React from 'react';
8
+ import { Pressable, ScrollView, Text, View } from 'react-native';
9
+
10
+
11
+ export interface EventToken_orderArgs {
12
+
13
+ }
14
+ export interface EventToken_orderProps {
15
+
16
+ }
17
+ export default function m(props: EventToken_orderProps): any {
18
+ return (
19
+ <View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
20
+ <EventHeader title='Riwayar Transaksi Token' />
21
+ <ScrollView>
22
+ <Pressable onPress={() => {
23
+
24
+ }} style={{ padding: 7, margin: 15, backgroundColor: '#fff', marginBottom: 0, borderRadius: 5, borderWidth: 1, borderColor: LibStyle.colorPrimary, flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
25
+ <Text allowFontScaling={false} style={{ marginLeft: 8 }}>{esp.lang("event/order", "wawit")}</Text>
26
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
27
+ {/* {
28
+ badge != 0 &&
29
+ <View style={{ backgroundColor: LibStyle.colorRed, height: 17, padding: 5, paddingVertical: 2, borderRadius: 10, alignContent: 'center', alignItems: 'center' }}>
30
+ <Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, letterSpacing: 0, color: "#ffffff" }}>{badge > 99 ? "99+" : LibUtils.number(badge)}</Text>
31
+ </View>
32
+ } */}
33
+ <LibIcon name='chevron-right' />
34
+ </View>
35
+ </Pressable>
36
+ </ScrollView>
37
+ </View>
38
+ )
39
+ }
@@ -0,0 +1,79 @@
1
+ // withHooks
2
+ import { BigbangPayment_list } from 'esoftplay/cache/bigbang/payment_list/import';
3
+ import { EventHeader } from 'esoftplay/cache/event/header/import';
4
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
5
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
6
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
7
+
8
+ import React from 'react';
9
+ import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
10
+
11
+
12
+ export interface EventToken_paymentArgs {
13
+
14
+ }
15
+ export interface EventToken_paymentProps {
16
+
17
+ }
18
+ export default function m(props: EventToken_paymentProps): any {
19
+
20
+ let items = [
21
+ {
22
+ id: 1,
23
+ title: 'ID Card + Token',
24
+ price: 20000,
25
+ qty: 1
26
+ },
27
+ {
28
+ id: 2,
29
+ title: 'Token',
30
+ price: 7500,
31
+ qty: 1
32
+ }
33
+ ]
34
+
35
+ return (
36
+ <View style={{ flex: 1 }}>
37
+ <EventHeader title='Beli IDCard/Token' />
38
+ <ScrollView>
39
+
40
+ {
41
+ items?.map((item: any, i: number) => {
42
+ return (
43
+ <View key={i} style={{ ...LibStyle.elevation(3), backgroundColor: '#fff', margin: 15, paddingHorizontal: 10, borderRadius: 5, marginBottom: 0, flex: 1, flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
44
+ <View style={{ flex: 2 }}>
45
+ <Text allowFontScaling={false}>{item?.title}</Text>
46
+ <Text allowFontScaling={false}>{LibUtils.money(item?.price)}</Text>
47
+ </View>
48
+ <View style={{ flex: 1 }}>
49
+ <View style={{ flexDirection: 'row', marginVertical: 10, alignContent: 'center', alignItems: 'center', alignSelf: 'center' }}>
50
+ <TouchableOpacity onPress={() => { /* min() */ }}>
51
+ <View style={{ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' }}>
52
+ <LibIcon name="minus" color="#e74c3c" />
53
+ </View>
54
+ </TouchableOpacity>
55
+ <Text style={{ fontFamily: "Arial", fontSize: 20, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#9b9b9b", marginLeft: 15, marginRight: 15 }}>{item?.qty}</Text>
56
+ <TouchableOpacity onPress={() => { /* add(item?.quota, item?.quota_used) */ }}>
57
+ <View style={{ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' }}>
58
+ <LibIcon name="plus" color="#16a085" />
59
+ </View>
60
+ </TouchableOpacity>
61
+ </View>
62
+ </View>
63
+ </View>
64
+ )
65
+ })
66
+ }
67
+
68
+ <BigbangPayment_list
69
+ priceTotal={100000}
70
+ order_type={1}
71
+ paymentId={2}
72
+ onPressPayment={() => {
73
+
74
+ }}
75
+ />
76
+ </ScrollView>
77
+ </View>
78
+ )
79
+ }
@@ -7,7 +7,6 @@ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
7
7
  import { LibInfinite } from 'esoftplay/cache/lib/infinite/import';
8
8
  import { LibKeyboard_avoid } from 'esoftplay/cache/lib/keyboard_avoid/import';
9
9
  import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
10
- import { LibObject } from 'esoftplay/cache/lib/object/import';
11
10
  import { LibPicture } from 'esoftplay/cache/lib/picture/import';
12
11
  import { LibProgress } from 'esoftplay/cache/lib/progress/import';
13
12
  import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
@@ -16,13 +15,13 @@ import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
16
15
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
17
16
  import { LibUtils } from 'esoftplay/cache/lib/utils/import';
18
17
  import esp from 'esoftplay/esp';
19
- import useGlobalState from 'esoftplay/global';
20
18
  import useSafeState from 'esoftplay/state';
21
19
  import { useRef } from 'react';
22
20
 
23
21
  import { applyStyle } from 'esoftplay';
24
22
  import { EventInput_rectangle } from 'esoftplay/cache/event/input_rectangle/import';
25
23
  import { EventLabel_input } from 'esoftplay/cache/event/label_input/import';
24
+ import { EventSheet } from 'esoftplay/cache/event/sheet/import';
26
25
  import useLazyState from 'esoftplay/lazy';
27
26
  import React, { useEffect } from 'react';
28
27
  import { ActivityIndicator, Platform, ScrollView, Text, TouchableOpacity, View } from 'react-native';
@@ -33,8 +32,6 @@ export interface EventVisitor_inputProps {
33
32
  navigation: any
34
33
  }
35
34
 
36
- const inputsState = useGlobalState<any>({})
37
-
38
35
  export default function m(props: EventVisitor_inputProps): any {
39
36
  let _data: any = LibNavigation.getArgs(props, 'data')
40
37
  const { msg, url } = LibNavigation.getArgsAll(props)
@@ -45,20 +42,22 @@ export default function m(props: EventVisitor_inputProps): any {
45
42
  const [activeTab, setActiveTab] = useSafeState(data?.list[0])
46
43
  const [counter, setCounter] = useSafeState(1)
47
44
  const [listClaim, setListClaim] = useSafeState()
45
+ const [selectedCode, setSelectedCode] = useSafeState()
46
+ const [token, setToken] = useSafeState()
48
47
 
49
48
  const dialogListClaim = useRef<LibSlidingup>(null)
49
+ const dialogClaim = useRef<LibSlidingup>(null)
50
+ let inputName = useRef<EventInput_rectangle>(null)
51
+ let inputToken = useRef<EventInput_rectangle>(null)
52
+ const tokenRef = useRef<LibSlidingup>(null)
53
+ const dialogMass = useRef<LibSlidingup>(null)
54
+ const [, setDataMass, getDataMass] = useSafeState()
55
+
50
56
 
51
57
  let _tabs: any = getData()?.list
52
- function setText(list_id: string): (name: string) => void {
53
- return (name) => inputsState.set(LibObject.set(inputsState.get(), name)(list_id))
54
- }
55
58
 
56
59
  useEffect(() => {
57
- if (esp.isDebug("")) {
58
- LibNavigation.replace('event/visitor_inputv2', { data: _data, url: url })
59
- } else {
60
- loadData()
61
- }
60
+ loadData()
62
61
  }, [])
63
62
 
64
63
  function loadData(): void {
@@ -88,26 +87,70 @@ export default function m(props: EventVisitor_inputProps): any {
88
87
  }
89
88
  }
90
89
 
91
- function send(): void {
92
- var post: any = undefined
93
- const inputs = inputsState.get()
94
- post = {
95
- name: Object.values(inputs).join("|"),
96
- list_id: Object.keys(inputs).join("|")
90
+ function assignToken() {
91
+ if (selectedCode?.use_token == 1 && token != 0 && token > getData()?.token_remaining) {
92
+ LibToastProperty?.show(esp.lang("event/visitor_input", "max_token_is") + getData()?.token_remaining)
93
+ return
94
+ }
95
+
96
+ let post: any = {
97
+ name: inputName?.current?.getText(),
98
+ code: selectedCode?.access_code
99
+ }
100
+
101
+ if (selectedCode?.use_token == 1) {
102
+ post.token = inputToken?.current?.getText()
97
103
  }
98
- LibDialog.confirm(esp.lang("event/visitor_input", "confirm_title"), esp.lang("event/visitor_input", "confirm_msg"), esp.lang("event/visitor_input", "confirm_ok"), () => {
99
- LibProgress.show(esp.lang("event/visitor_input", "confirm_wait"))
100
- new LibCurl('event_exhibitor_staff?contact_id=' + data.contact_id, post, (res, msg) => {
104
+
105
+ LibDialog.confirm(esp.lang("event/visitor_input", "confirm_title"), esp.lang("event/visitor_input", "confirm_input_token"), esp.lang("event/visitor_input", "yes"), () => {
106
+ LibProgress.show(esp.lang("event/visitor_input", "please_wait"))
107
+ new LibCurl('event_exhibitor_staff_token', post, (res, msg) => {
101
108
  LibProgress.hide()
102
109
  LibDialog.info(esp.lang("event/visitor_input", "confirm_success"), msg);
103
- LibNavigation.reset()
104
- // BigbangIndexProperty.setTab(0)
105
- // LibNavigation.navigate('bigbang/notif_index', { tabIndex: 0 }) // ini notifnya di perbarui
110
+ loadData()
111
+ setCounter(counter + 1)
112
+ dialogClaim?.current?.hide()
106
113
  }, (error) => {
114
+ dialogClaim?.current?.hide()
107
115
  LibProgress.hide()
108
116
  LibDialog.warning(esp.lang("event/visitor_input", "confirm_failed"), error?.message)
109
117
  })
110
- }, esp.lang("event/visitor_input", "confirm_cancel"), () => { })
118
+
119
+ }, esp.lang("event/visitor_input", "no"), () => { })
120
+ }
121
+
122
+ function withdrawToken() {
123
+ LibDialog.warningConfirm(esp.lang("event/visitor_input", "warning"), esp.lang("event/visitor_input", "confirm_withdraw_token"), esp.lang("event/visitor_input", "yes"), () => {
124
+ let post = {
125
+ token: inputToken?.current?.getText(),
126
+ code: selectedCode?.access_code
127
+ }
128
+ LibProgress.show(esp.lang("event/visitor_input", "please_wait"))
129
+ esp.log({ post });
130
+ new LibCurl('event_exhibitor_staff_token_withdraw', 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
+
143
+ }, esp.lang("event/visitor_input", "no"), () => {
144
+
145
+ })
146
+ }
147
+
148
+ function massAllocateToken() {
149
+ esp.log("Alokasi masal");
150
+ }
151
+
152
+ function massWithdrawToken() {
153
+ esp.log("Withdraw masal");
111
154
  }
112
155
 
113
156
  function renderTabs(item: any, i: number) {
@@ -116,8 +159,8 @@ export default function m(props: EventVisitor_inputProps): any {
116
159
  setActiveTab(item)
117
160
  setCounter(counter + 1)
118
161
  }}>
119
- <View style={applyStyle({ height: 35, width: LibStyle.width / 4, alignItems: 'center', overflow: 'visible', justifyContent: 'center', backgroundColor: '#fff' })}>
120
- <View style={{ width: LibStyle.width / 4, }}>
162
+ <View style={applyStyle({ height: 35, width: LibStyle.width / 3.5, alignItems: 'center', overflow: 'visible', justifyContent: 'center', backgroundColor: '#fff' })}>
163
+ <View style={{ width: LibStyle.width / 3.5, }}>
121
164
  <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode='tail' style={applyStyle({ fontFamily: "Arial", fontSize: 11, fontWeight: activeTab?.id == item?.id ? "bold" : "normal", fontStyle: "normal", letterSpacing: 0, textAlign: "center", color: activeTab?.id == item?.id ? "#51b596" : "#c5c5c5" })}>{item.name}</Text>
122
165
  <Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 11, fontWeight: activeTab?.id == item?.id ? "bold" : "normal", fontStyle: "normal", letterSpacing: 0, textAlign: "center", color: activeTab?.id == item?.id ? "#51b596" : "#c5c5c5" })}>({LibUtils.number(item?.qty)})</Text>
123
166
  </View>
@@ -185,28 +228,47 @@ export default function m(props: EventVisitor_inputProps): any {
185
228
  )
186
229
  } else {
187
230
  return (
188
- <View style={applyStyle({ marginHorizontal: 15 })} >
189
- <View style={applyStyle({ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' })}>
190
- <EventLabel_input label={esp.lang("event/visitor_input", "input_names", (i + 1))} />
231
+ <View style={{ margin: 10, marginBottom: 0, padding: 10, borderRadius: 5, borderWidth: 1, borderColor: LibStyle.colorBgGrey }}>
232
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center', }}>
191
233
  <TouchableOpacity onPress={() => {
192
234
  LibUtils.copyToClipboard(item.access_code)
193
235
  LibToastProperty.show(esp.lang("event/visitor_input", "success_copy", item.access_code))
194
- }}>
195
- <View style={applyStyle({ marginTop: 12, marginRight: 3, flexDirection: 'row', justifyContent: 'center', alignContent: 'center', alignItems: 'center' })}>
196
- <Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: item.is_used == 1 ? "#c4c4c4" : "#2980b9" })}>{item.access_code}</Text>
197
- <LibIcon.Ionicons name='copy' size={16} style={applyStyle({ color: item.is_used == 1 ? "#c4c4c4" : "#2980b9", marginLeft: 7 })} />
198
- </View>
236
+ }} style={{ flex: 1, flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
237
+ <Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: item.is_used == 1 ? "#c4c4c4" : "#2980b9" })}>{item.access_code}</Text>
238
+ <LibIcon.Ionicons name='copy' size={16} style={applyStyle({ color: item.is_used == 1 ? "#c4c4c4" : "#2980b9", marginLeft: 7 })} />
199
239
  </TouchableOpacity>
240
+ <View style={{ flex: 1, justifyContent: 'flex-end', flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
241
+ <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_input", "notyet_used")}</Text>
242
+ <TouchableOpacity onPress={() => {
243
+ dialogClaim?.current?.show()
244
+ setSelectedCode(item)
245
+ }}>
246
+ <LibIcon name='pencil-circle' size={20} color={LibStyle.colorRed} style={{ marginLeft: 5 }} />
247
+ </TouchableOpacity>
248
+ </View>
249
+ </View>
250
+
251
+ <View style={{ padding: 5, borderWidth: 1, borderColor: LibStyle.colorBgGrey, borderRadius: 5, marginTop: 5 }}>
252
+ <Text allowFontScaling={false} style={{ fontSize: 10, color: '#9b9b9b' }}>{esp.lang("event/visitor_input", "name")}</Text>
253
+ <Text allowFontScaling={false} style={{ fontSize: 14 }}>{item.name == null ? "-" : item.name}</Text>
254
+ {
255
+ item?.use_token == 1 &&
256
+ <View style={{ marginTop: 5, flexDirection: 'row', justifyContent: 'space-between' }}>
257
+ <View style={{ flex: 1 }}>
258
+ <Text allowFontScaling={false} style={{ fontSize: 10, color: '#9b9b9b' }}>{esp.lang("event/visitor_input", "total_token")}</Text>
259
+ <Text allowFontScaling={false} style={{ fontSize: 14 }}>{Number(item?.token)}</Text>
260
+ </View>
261
+ <View style={{ flex: 1 }}>
262
+ <Text allowFontScaling={false} style={{ fontSize: 10, color: '#9b9b9b' }}>{esp.lang("event/visitor_input", "token_used")}</Text>
263
+ <Text allowFontScaling={false} style={{ fontSize: 14 }}>{Number(item?.token_used)}</Text>
264
+ </View>
265
+ <View style={{ flex: 1 }}>
266
+ <Text allowFontScaling={false} style={{ fontSize: 10, color: '#9b9b9b' }}>{esp.lang("event/visitor_input", "token_left")}</Text>
267
+ <Text allowFontScaling={false} style={{ fontSize: 14 }}>{Number(item?.token_remaining)}</Text>
268
+ </View>
269
+ </View>
270
+ }
200
271
  </View>
201
- <EventInput_rectangle
202
- returnKeyType="next"
203
- key={activeTab?.id + "??" + i}
204
- editable={item.is_used == 0}
205
- style={applyStyle({ borderRadius: 4, borderColor: '#c4c4c4', height: 35, marginTop: 8, backgroundColor: item.is_used == 1 ? "#e9e9e9" : '#fff' })}
206
- defaultValue={item.name}
207
- onChangeText={setText(item.list_id)}
208
- placeholder={esp.lang("event/visitor_input", "placeholder_input_name", (i + 1))}
209
- />
210
272
  </View>
211
273
  )
212
274
  }
@@ -230,14 +292,65 @@ export default function m(props: EventVisitor_inputProps): any {
230
292
  )
231
293
  }
232
294
 
233
- // esp.log(_tabs);
295
+ let menuHeader = [
296
+ {
297
+ id: 1,
298
+ title: activeTab?.name,
299
+ color: '#d3f1ec',
300
+ textColor: '#4fbaa8',
301
+ total: LibUtils.number(activeTab?.qty)
302
+ },
303
+ {
304
+ id: 2,
305
+ title: esp.lang("event/visitor_input", "total_token"),
306
+ color: '#d7edf8',
307
+ textColor: '#64b0e0',
308
+ total: LibUtils.number(getData()?.token)
309
+ },
310
+ {
311
+ id: 3,
312
+ title: esp.lang("event/visitor_input", "token_shared"),
313
+ color: '#fbe3dd',
314
+ textColor: '#ec7463',
315
+ total: LibUtils.number(getData()?.token_shared)
316
+ },
317
+ {
318
+ id: 4,
319
+ title: esp.lang("event/visitor_input", "token_left"),
320
+ color: '#fef2de',
321
+ textColor: '#f6c67f',
322
+ total: LibUtils.number(getData()?.token_remaining)
323
+ },
324
+ ]
325
+
326
+ esp.log({ selectedCode });
234
327
 
235
328
  return (
236
329
  <View style={{ flex: 1 }}>
237
330
  <EventHeader title={esp.lang("event/visitor_input", "title_input_exhibitor")} subtitle={esp.lang("event/visitor_input", "total_staff", LibUtils.number(data.qty))} />
238
331
  <LibKeyboard_avoid style={{ flex: 1 }}>
239
332
  <>
240
- {/* <ComponentTabheader titles={tabTitles} activeIndex={tabIndex} onPress={(index) => setTabIndex(index)} /> */}
333
+ {
334
+ activeTab?.type == "STAFF" && data?.use_token == 1 &&
335
+ <View style={{ padding: 10, paddingBottom: 0, flexDirection: 'row', justifyContent: 'space-between', flexWrap: 'wrap' }}>
336
+ {
337
+ menuHeader?.map((item, i) => {
338
+ return (
339
+ <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' }}>
340
+ <View style={{ flex: 2, }}>
341
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4b4b4b" }}>{item.title}</Text>
342
+ </View>
343
+ <View style={{ marginLeft: 5, flex: 1 }}>
344
+ <View style={{ alignContent: 'center', alignItems: 'center', backgroundColor: item.textColor, paddingHorizontal: 7, paddingVertical: 3, borderRadius: 5 }}>
345
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{item.total}</Text>
346
+ </View>
347
+ </View>
348
+ </View>
349
+ )
350
+ })
351
+ }
352
+ </View>
353
+ }
241
354
 
242
355
  <View style={{ height: 35, marginBottom: 2, flexDirection: 'row', backgroundColor: '#fff', ...LibStyle.elevation(2) }} >
243
356
  <ScrollView horizontal showsHorizontalScrollIndicator={false} >
@@ -253,20 +366,28 @@ export default function m(props: EventVisitor_inputProps): any {
253
366
  // style={{ flex: 1 }}
254
367
  ListHeaderComponent={
255
368
  <>
256
- {
369
+ {/* {
257
370
  activeTab?.ondate != "0000-00-00" &&
258
- <View style={{ margin: 15, marginBottom: 0 }}>
371
+ <View style={{ margin: 10, marginBottom: 0 }}>
259
372
  <Text allowFontScaling={false} style={{ fontWeight: 'bold', color: LibStyle.colorGreen }}>{"Tanggal berlaku " + LibUtils.moment(activeTab?.ondate).format("DD MMMM YYYY")}</Text>
260
373
  </View>
261
- }
374
+ } */}
262
375
  </>
263
376
  }
264
377
  removeClippedSubviews={Platform.OS == 'android'}
265
378
  renderItem={renderItem}
266
379
  />
380
+
267
381
  {
268
- activeTab?.type == "STAFF" &&
269
- <EventButton style={{ backgroundColor: '#00b894', margin: 5 }} label={esp.lang("event/visitor_input", "save_btn")} onPress={() => { send() }} />
382
+ esp.isDebug("") &&
383
+ <TouchableOpacity onPress={() => {
384
+ tokenRef?.current?.show()
385
+ }} style={{ padding: 5, /* ...LibStyle.elevation(3), */ position: 'absolute', right: 0, bottom: 30, borderTopLeftRadius: 35, borderBottomLeftRadius: 35, backgroundColor: esp.isDebug("ini memang isDebug, tapi jangan di hapus") ? 'rgba(0, 191, 99, 0.1618)' : 'rgba(255, 197, 35, 0.1618)' }}>
386
+ <View style={{ padding: 5, backgroundColor: LibStyle.colorPrimary, ...LibStyle.elevation(3), borderRadius: 30, alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
387
+ <LibIcon name='recycle-variant' size={16} />
388
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', color: '#000', fontSize: 9 }}>{"Token"}</Text>
389
+ </View>
390
+ </TouchableOpacity>
270
391
  }
271
392
  </>
272
393
  </LibKeyboard_avoid>
@@ -278,8 +399,6 @@ export default function m(props: EventVisitor_inputProps): any {
278
399
  </View>
279
400
  <LibInfinite
280
401
  url={listClaim?.url}
281
- // isDebug={1}
282
- // key={}
283
402
  removeClippedSubviews={Platform.OS == 'android'}
284
403
  renderItem={(item: any, i: number) => {
285
404
  return (
@@ -295,6 +414,170 @@ export default function m(props: EventVisitor_inputProps): any {
295
414
  />
296
415
  </View>
297
416
  </LibSlidingup>
417
+
418
+ <LibSlidingup ref={dialogClaim}>
419
+ <View style={{ backgroundColor: 'white', padding: 15, maxHeight: LibStyle.height * 0.7, borderTopLeftRadius: 5, borderTopRightRadius: 5 }} >
420
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' }}>
421
+ <LibTextstyle text={esp.lang("event/visitor_input", "code")} textStyle="headline" />
422
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#00b894" }}>{selectedCode?.access_code}</Text>
423
+ </View>
424
+
425
+ <EventLabel_input label={esp.lang("event/visitor_input", "input_name")} />
426
+ <EventInput_rectangle
427
+ ref={inputName}
428
+ returnKeyType="next"
429
+ style={applyStyle({ borderRadius: 4, borderColor: '#c4c4c4', marginTop: 8, backgroundColor: '#fff' })}
430
+ inputStyle={{ color: selectedCode?.is_used == "1" ? "#c4c4c4" : "#000" }}
431
+ onSubmitEditing={() => inputToken?.current?.focus()}
432
+ placeholder={esp.lang("event/visitor_input", "input_name")}
433
+ defaultValue={selectedCode?.name}
434
+ editable={selectedCode?.is_used == "1" ? false : true}
435
+ />
436
+
437
+
438
+ <View style={{ flexDirection: 'row', justifyContent: 'flex-end', alignContent: 'center', alignItems: 'center' }}>
439
+ {
440
+ selectedCode?.use_token == 1 &&
441
+ <View style={{ flex: 2 }}>
442
+ <EventLabel_input label={esp.lang("event/visitor_input", "input_token")} mandatory />
443
+ <EventInput_rectangle
444
+ ref={inputToken}
445
+ keyboardType='phone-pad'
446
+ returnKeyType="done"
447
+ style={applyStyle({ borderRadius: 4, borderColor: '#c4c4c4', marginTop: 8, backgroundColor: '#fff' })}
448
+ placeholder={esp.lang("event/visitor_input", "input_token")}
449
+ onChangeText={(t) => setToken(t)}
450
+ onSubmitEditing={assignToken}
451
+ defaultValue={selectedCode?.token != "0" ? selectedCode?.token : ''}
452
+ />
453
+ </View>
454
+ }
455
+ {
456
+ selectedCode?.use_token == 1 &&
457
+ <View style={{ flex: 1, justifyContent: 'flex-end', marginLeft: 10, }}>
458
+ <EventLabel_input label={esp.lang("event/visitor_input", "token_used")} />
459
+ <View style={{ height: 35, marginTop: 8, alignContent: 'center', justifyContent: 'center' }}>
460
+ <Text allowFontScaling={false} style={{ fontSize: 14 }}>{LibUtils.number(selectedCode?.token_used)}</Text>
461
+ </View>
462
+ </View>
463
+ }
464
+ {
465
+ selectedCode?.use_token == 1 &&
466
+ <View style={{ flex: 1, justifyContent: 'flex-end', marginLeft: 10 }}>
467
+ <EventLabel_input label={esp.lang("event/visitor_input", "token_left")} />
468
+ <View style={{ height: 35, marginTop: 8, alignContent: 'center', justifyContent: 'center' }}>
469
+ <Text allowFontScaling={false} style={{ fontSize: 14 }}>{LibUtils.number(selectedCode?.token_remaining)}</Text>
470
+ </View>
471
+ </View>
472
+ }
473
+ </View>
474
+
475
+ <View style={{ marginTop: 15, flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
476
+ {
477
+ selectedCode?.use_token == 1 && selectedCode?.token_remaining != 0 &&
478
+ <View style={{ marginRight: 5, flex: 1 }}>
479
+ <EventButton
480
+ label={esp.lang("event/visitor_input", "withdraw_token")}
481
+ onPress={() => {
482
+ withdrawToken()
483
+ }}
484
+ backgroundColor='#fff'
485
+ borderColor={LibStyle.colorRed}
486
+ fontColor={LibStyle.colorRed}
487
+ style={{ borderRadius: 5 }}
488
+ />
489
+ </View>
490
+ }
491
+
492
+ <View style={{ marginLeft: (selectedCode?.token != "0" && selectedCode?.token_remaining != 0) ? 5 : 0, flex: 1 }}>
493
+ <EventButton
494
+ style={{ backgroundColor: '#00b894', borderRadius: 5 }}
495
+ label={esp.lang("event/visitor_input", "save_btn")}
496
+ onPress={() => {
497
+ assignToken()
498
+ }} />
499
+ </View>
500
+ </View>
501
+ </View>
502
+ </LibSlidingup>
503
+
504
+ <EventSheet
505
+ _ref={tokenRef}
506
+ // detail="All menu is ready"
507
+ title={"Menu Token"}
508
+ options={[
509
+ {
510
+ text: "Alokasi Token Masal",
511
+ onPress: () => {
512
+ let a = {
513
+ title: 'Alokasi Token Masal',
514
+ buttonText: 'Submit',
515
+ buttonColor: LibStyle.colorGreen,
516
+ onPress: () => massAllocateToken()
517
+ }
518
+ setDataMass(a)
519
+ LibUtils.debounce(() => {
520
+ dialogMass?.current?.show()
521
+ }, 100)
522
+ }
523
+ },
524
+ {
525
+ text: "Tarik Token Masal",
526
+ onPress: () => {
527
+ let a = {
528
+ title: 'Tarik Token Masal',
529
+ buttonText: 'Tarik Token',
530
+ buttonColor: LibStyle.colorRed,
531
+ onPress: () => massWithdrawToken()
532
+ }
533
+ setDataMass(a)
534
+ LibUtils.debounce(() => {
535
+ dialogMass?.current?.show()
536
+ }, 100)
537
+ }
538
+ },
539
+ {
540
+ text: "Beli ID CARD/Token",
541
+ onPress: () => {
542
+ LibNavigation.navigate('event/token_payment')
543
+ }
544
+ },
545
+ {
546
+ text: "Riwayat Transaksi Token",
547
+ onPress: () => {
548
+ LibNavigation.navigate('event/token_order')
549
+ }
550
+ },
551
+
552
+ ]}
553
+ />
554
+
555
+ <LibSlidingup ref={dialogMass}>
556
+ <View style={{ backgroundColor: 'white', padding: 15, maxHeight: LibStyle.height * 0.7, borderTopLeftRadius: 5, borderTopRightRadius: 5 }} >
557
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' }}>
558
+ <LibTextstyle text={getDataMass()?.title} textStyle="headline" />
559
+ </View>
560
+
561
+ <EventLabel_input label={esp.lang("event/visitor_input", "input_token")} mandatory />
562
+ <EventInput_rectangle
563
+ ref={inputToken}
564
+ keyboardType='phone-pad'
565
+ returnKeyType="done"
566
+ style={applyStyle({ borderRadius: 4, borderColor: '#c4c4c4', marginTop: 8, backgroundColor: '#fff' })}
567
+ placeholder={esp.lang("event/visitor_input", "input_token")}
568
+ // onChangeText={(t) => setToken(t)}
569
+ // onSubmitEditing={assignToken}
570
+ />
571
+
572
+ <EventButton
573
+ style={{ backgroundColor: getDataMass()?.buttonColor, borderRadius: 5, marginTop: 20 }}
574
+ label={getDataMass()?.buttonText}
575
+ onPress={() => {
576
+ getDataMass()?.onPress()
577
+ }} />
578
+ </View>
579
+ </LibSlidingup>
580
+
298
581
  </View>
299
582
  )
300
583
  }
package/event/voucher.tsx CHANGED
@@ -34,7 +34,7 @@ export default function m(props: EventVoucherProps): any {
34
34
  let voucherCode = React.useRef<LibInput>(null)
35
35
 
36
36
  useEffect(() => {
37
- esp.isDebug("payment_voucher") && EventConfigProperty.curlConfig('payment_config')
37
+ EventConfigProperty.curlConfig('payment_config')
38
38
  return () => LibNavigation.cancelBackResult(LibNavigation.getResultKey(props))
39
39
  }, [])
40
40
 
package/id.json CHANGED
@@ -1850,18 +1850,28 @@
1850
1850
  },
1851
1851
  "event/visitor_input": {
1852
1852
  "back": "Kembali",
1853
+ "code": "Kode",
1853
1854
  "code_inv": "Kode Undangan #",
1854
1855
  "confirm_cancel": "Batal",
1855
1856
  "confirm_failed": "Kesalahan",
1857
+ "confirm_input_token": "Apakah data yang anda masukkan sudah benar?",
1856
1858
  "confirm_msg": "Apakah Data Sudah Benar ?",
1857
1859
  "confirm_ok": "Ya",
1858
1860
  "confirm_success": "Selamat..!",
1859
1861
  "confirm_title": "Konfirmasi",
1860
1862
  "confirm_wait": "Mohon tunggu",
1863
+ "confirm_withdraw_token": "Apakah anda ingin menarik token dari ID Card ini ?",
1864
+ "input_name": "Masukkan nama",
1861
1865
  "input_names": "Nama #%s",
1866
+ "input_token": "Masukkan token",
1862
1867
  "list_claimed": "Daftar klaim kode",
1868
+ "max_token_is": "Maksimal token yang anda punya adalah ",
1869
+ "name": "Nama",
1870
+ "no": "Tidak",
1863
1871
  "not_claimed": "Belum diklaim",
1872
+ "notyet_used": "Belum digunakan",
1864
1873
  "placeholder_input_name": "Masukkan Nama #%s",
1874
+ "please_wait": "Mohon tunggu",
1865
1875
  "resend": "Ulangi",
1866
1876
  "save_btn": "Tambah",
1867
1877
  "see_list_claimed": "Lihat daftar klaim",
@@ -1871,7 +1881,14 @@
1871
1881
  "title": "Oops",
1872
1882
  "title_input_exhibitor": "Masukkan Exhibitors",
1873
1883
  "title_input_exhibitors": "Masukkan Exhibitors",
1874
- "total_staff": "Total %s "
1884
+ "token_left": "Token tersisa",
1885
+ "token_shared": "Token dialokasikan",
1886
+ "token_used": "Total terpakai",
1887
+ "total_staff": "Total %s ",
1888
+ "total_token": "Total token",
1889
+ "warning": "Peringatan",
1890
+ "withdraw_token": "Tarik Token",
1891
+ "yes": "Ya"
1875
1892
  },
1876
1893
  "event/visitor_inputv2": {
1877
1894
  "code": "Kode",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay-event",
3
- "version": "0.0.2-c",
3
+ "version": "0.0.2-e",
4
4
  "description": "event module on esoftplay framework",
5
5
  "main": "index.js",
6
6
  "scripts": {