esoftplay-event 0.0.1 → 0.0.2-b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/config.json +1 -1
  2. package/event/artist.tsx +11 -7
  3. package/event/artist_detail.tsx +3 -5
  4. package/event/artist_detailv2.tsx +386 -0
  5. package/event/artistv2.tsx +162 -0
  6. package/event/button_order_detail.tsx +43 -0
  7. package/event/countdown_base.tsx +16 -3
  8. package/event/countdown_event.tsx +48 -0
  9. package/event/detail.tsx +30 -37
  10. package/event/detail2.tsx +354 -0
  11. package/event/exchange_ticket.tsx +1 -1
  12. package/event/exchange_ticket_list.tsx +2 -3
  13. package/event/exchange_ticket_result.tsx +1 -1
  14. package/event/firebase_socket.ts +21 -11
  15. package/event/loading_page.tsx +4 -2
  16. package/event/order.tsx +23 -36
  17. package/event/order_detail.tsx +204 -61
  18. package/event/order_detail_upgrade.tsx +8 -5
  19. package/event/order_detail_upgrade_payment.tsx +17 -11
  20. package/event/order_detail_visitor.tsx +33 -33
  21. package/event/order_detail_waiting.tsx +45 -20
  22. package/event/order_item.tsx +1 -1
  23. package/event/order_lottery.tsx +49 -37
  24. package/event/order_reschedule.tsx +50 -52
  25. package/event/order_share_to.tsx +11 -24
  26. package/event/order_share_to_detail.tsx +8 -3
  27. package/event/order_waiting.tsx +1 -1
  28. package/event/queue_pricing.tsx +16 -3
  29. package/event/refresh_button.tsx +3 -5
  30. package/event/scan_item.tsx +2 -2
  31. package/event/seat.tsx +34 -13
  32. package/event/seat_map_new.tsx +316 -0
  33. package/event/secure_page.debug.tsx +34 -0
  34. package/event/secure_page.live.tsx +35 -0
  35. package/event/secure_page.tsx +6 -5
  36. package/event/test.tsx +240 -155
  37. package/event/ticket_list.tsx +48 -20
  38. package/event/ticket_list2.tsx +112 -39
  39. package/event/tms_check_code.tsx +6 -0
  40. package/event/tms_check_ticket_result.tsx +51 -13
  41. package/event/tms_dashboard.tsx +85 -3
  42. package/event/tms_gate.tsx +6 -0
  43. package/event/tms_home.tsx +1 -4
  44. package/event/tms_in_failed.tsx +1 -1
  45. package/event/tms_in_hall.tsx +4 -1
  46. package/event/tms_in_hall_failed.tsx +8 -10
  47. package/event/tms_in_log.tsx +2 -0
  48. package/event/tms_in_success.tsx +1 -1
  49. package/event/tms_log.tsx +10 -25
  50. package/event/tms_out.tsx +1 -1
  51. package/event/tms_out_failed.tsx +1 -1
  52. package/event/visitor_input.tsx +22 -5
  53. package/event/visitor_inputv2.tsx +453 -0
  54. package/event/voucher.tsx +2 -0
  55. package/event/voucher2.tsx +14 -6
  56. package/id.json +43 -9
  57. package/package.json +1 -1
  58. package/event/entrance.tsx +0 -215
  59. package/event/entrance_again.tsx +0 -199
  60. package/event/entrance_failed.tsx +0 -190
  61. package/event/entrance_idcard.tsx +0 -199
  62. package/event/entrance_list.tsx +0 -264
  63. package/event/entrance_list_item.tsx +0 -88
  64. package/event/entrance_log.tsx +0 -130
  65. package/event/entrance_success.tsx +0 -153
  66. package/event/entrance_warning.tsx +0 -91
  67. package/event/exit.tsx +0 -91
  68. package/event/exit_failed.tsx +0 -135
  69. package/event/exit_list.tsx +0 -118
  70. package/event/exit_log.tsx +0 -130
  71. package/event/exit_success.tsx +0 -143
  72. package/event/exit_temporary.tsx +0 -226
  73. package/event/firebase_socket.debug.ts +0 -260
  74. package/event/firebase_socket.live.ts +0 -335
  75. package/event/hall_in.tsx +0 -148
  76. package/event/hall_in_failed.tsx +0 -270
  77. package/event/hall_in_list.tsx +0 -222
  78. package/event/hall_in_log.tsx +0 -134
  79. package/event/hall_in_success.tsx +0 -132
  80. package/event/hall_out.tsx +0 -143
  81. package/event/hall_out_failed.tsx +0 -133
  82. package/event/hall_out_list.tsx +0 -215
  83. package/event/hall_out_log.tsx +0 -133
  84. package/event/hall_out_success.tsx +0 -130
  85. package/event/log.tsx +0 -433
  86. package/event/seat_map_test.tsx +0 -401
@@ -0,0 +1,453 @@
1
+ // withHooks
2
+ import { EventButton } from 'esoftplay/cache/event/button/import';
3
+ import { EventHeader } from 'esoftplay/cache/event/header/import';
4
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
5
+ import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
6
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
7
+ import { LibInfinite } from 'esoftplay/cache/lib/infinite/import';
8
+ import { LibKeyboard_avoid } from 'esoftplay/cache/lib/keyboard_avoid/import';
9
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
10
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
11
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
12
+ import { LibProgress } from 'esoftplay/cache/lib/progress/import';
13
+ import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
14
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
15
+ import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
16
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
17
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
18
+ import esp from 'esoftplay/esp';
19
+ import useGlobalState from 'esoftplay/global';
20
+ import useSafeState from 'esoftplay/state';
21
+ import { useRef } from 'react';
22
+
23
+ import { applyStyle } from 'esoftplay';
24
+ import { EventInput_rectangle } from 'esoftplay/cache/event/input_rectangle/import';
25
+ import { EventLabel_input } from 'esoftplay/cache/event/label_input/import';
26
+ import useLazyState from 'esoftplay/lazy';
27
+ import React, { useEffect } from 'react';
28
+ import { ActivityIndicator, Platform, ScrollView, Text, TouchableOpacity, View } from 'react-native';
29
+
30
+
31
+
32
+ export interface EventVisitor_inputv2Props {
33
+ navigation: any
34
+ }
35
+
36
+ const inputsState = useGlobalState<any>({})
37
+
38
+ export default function m(props: EventVisitor_inputv2Props): any {
39
+ let _data: any = LibNavigation.getArgs(props, 'data')
40
+ const { msg, url } = LibNavigation.getArgsAll(props)
41
+
42
+ const [data, setData, getData] = useLazyState(_data)
43
+ const [_msg, set_msg] = useSafeState(msg)
44
+ const [messageGenerate, setMessageGenerate] = useSafeState<any>()
45
+ const [activeTab, setActiveTab] = useSafeState(data?.list[0])
46
+ const [counter, setCounter] = useSafeState(1)
47
+ const [listClaim, setListClaim] = useSafeState()
48
+ const [selectedCode, setSelectedCode] = useSafeState()
49
+ const [token, setToken] = useSafeState()
50
+
51
+ const dialogListClaim = useRef<LibSlidingup>(null)
52
+ const dialogClaim = useRef<LibSlidingup>(null)
53
+ let inputName = useRef<EventInput_rectangle>(null)
54
+ let inputToken = useRef<EventInput_rectangle>(null)
55
+
56
+
57
+ let _tabs: any = getData()?.list
58
+ function setText(list_id: string): (name: string) => void {
59
+ return (name) => inputsState.set(LibObject.set(inputsState.get(), name)(list_id))
60
+ }
61
+
62
+ useEffect(() => {
63
+ loadData()
64
+ }, [])
65
+
66
+ function loadData(): void {
67
+ new LibCurl(url, null, (result, msg) => {
68
+ set_msg(msg)
69
+ if (result?.hasOwnProperty('url_generate')) {
70
+ generateCode(result?.url_generate, true)
71
+ } else {
72
+ setData(result)()
73
+ }
74
+ }, (error) => {
75
+ })
76
+ }
77
+
78
+ function generateCode(url: string, loop: boolean) {
79
+ if (loop) {
80
+ new LibCurl(url, null, (res, msg) => {
81
+ generateCode(url, res?.done == 1 ? false : true)
82
+ setMessageGenerate(msg)
83
+ }, (error) => {
84
+ LibDialog.warningConfirm(esp.lang("event/visitor_input", "title"), error?.message, esp.lang("event/visitor_input", "resend"), () => {
85
+ loadData()
86
+ }, esp.lang("event/visitor_input", "back"), () => LibNavigation.back())
87
+ })
88
+ } else {
89
+ loadData()
90
+ }
91
+ }
92
+
93
+ function send(): void {
94
+ var post: any = undefined
95
+ const inputs = inputsState.get()
96
+ post = {
97
+ name: Object.values(inputs).join("|"),
98
+ list_id: Object.keys(inputs).join("|")
99
+ }
100
+ LibDialog.confirm(esp.lang("event/visitor_input", "confirm_title"), esp.lang("event/visitor_input", "confirm_msg"), esp.lang("event/visitor_input", "confirm_ok"), () => {
101
+ LibProgress.show(esp.lang("event/visitor_input", "confirm_wait"))
102
+ new LibCurl('event_exhibitor_staff?contact_id=' + data.contact_id, post, (res, msg) => {
103
+ LibProgress.hide()
104
+ LibDialog.info(esp.lang("event/visitor_input", "confirm_success"), msg);
105
+ LibNavigation.reset()
106
+ // BigbangIndexProperty.setTab(0)
107
+ // LibNavigation.navigate('bigbang/notif_index', { tabIndex: 0 }) // ini notifnya di perbarui
108
+ }, (error) => {
109
+ LibProgress.hide()
110
+ LibDialog.warning(esp.lang("event/visitor_input", "confirm_failed"), error?.message)
111
+ })
112
+ }, esp.lang("event/visitor_input", "confirm_cancel"), () => { })
113
+ }
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
+
147
+ function renderTabs(item: any, i: number) {
148
+ return (
149
+ <TouchableOpacity key={i} onPress={() => {
150
+ setActiveTab(item)
151
+ setCounter(counter + 1)
152
+ }}>
153
+ <View style={applyStyle({ height: 35, width: LibStyle.width / 4, alignItems: 'center', overflow: 'visible', justifyContent: 'center', backgroundColor: '#fff' })}>
154
+ <View style={{ width: LibStyle.width / 4, }}>
155
+ <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>
156
+ <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>
157
+ </View>
158
+ <View style={applyStyle({ width: (LibStyle.width / 4) - 20, height: 3, backgroundColor: activeTab?.id == item?.id ? "#51b596" : "#fff", position: 'absolute', bottom: -1 })} />
159
+ </View>
160
+ </TouchableOpacity>
161
+ )
162
+ }
163
+
164
+ function renderItem(item: any, i: any) {
165
+ if (activeTab?.type == "INVITE") {
166
+ let bgColor = Number(item.qty_used) != Number(item.qty) ? "#fff" : LibStyle.colorBgGrey
167
+ let borderColor = Number(item.qty_used) != Number(item.qty) ? LibStyle.colorBgGrey : "#fff"
168
+ return (
169
+ <View style={{ margin: 15, marginBottom: 0, padding: 10, borderWidth: 1.5, backgroundColor: bgColor, borderColor: borderColor, borderRadius: 5 }}>
170
+ <View style={{ flexDirection: 'row', flex: 1, justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' }}>
171
+ <Text allowFontScaling={false} style={{ fontFamily: "SFProText", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4b4b4b", }}>
172
+ {esp.lang("event/visitor_input", "code_inv") + (i + 1)}
173
+ </Text>
174
+ {
175
+ item.hasOwnProperty("url") && item.qty_used != 0 &&
176
+
177
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#51b596" }}>{LibUtils.number(item.qty_used) + "/" + LibUtils.number(item.qty)}</Text>
178
+ // <View style={{ padding: 5, borderWidth: 1, borderColor: LibStyle.colorPrimary, borderRadius: 5 }}>
179
+ // </View>
180
+ }
181
+ <TouchableOpacity activeOpacity={item.name == "" ? 0 : 1} onPress={() => {
182
+ if (Number(item.qty_used) != Number(item.qty)) {
183
+ LibUtils.copyToClipboard(item.access_code)
184
+ LibToastProperty.show(esp.lang("event/visitor_input", "success_copy", item.access_code))
185
+ }
186
+ }}>
187
+ <View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
188
+ <Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: Number(item.qty_used) == Number(item.qty) ? "#c4c4c4" : "#2980b9" })}>{item.access_code}</Text>
189
+ <LibIcon.Ionicons name='copy' size={16} style={applyStyle({ color: Number(item.qty_used) == Number(item.qty) ? "#c4c4c4" : "#2980b9", marginLeft: 7 })} />
190
+ </View>
191
+ </TouchableOpacity>
192
+ </View>
193
+ {
194
+ item.hasOwnProperty("name") &&
195
+ <Text allowFontScaling={false} style={{ marginTop: 5, fontFamily: "SFProText", color: '#4b4b4b' }}>{item?.name == "" ? esp.lang("event/visitor_input", "not_claimed") : item.name}</Text>
196
+ }
197
+ {
198
+ item.hasOwnProperty("url") &&
199
+ <View style={{ marginTop: 5, flexDirection: 'row', flex: 1 }}>
200
+ {
201
+ item.qty_used == 0 ?
202
+ <Text allowFontScaling={false} style={{ fontFamily: "SFProText", color: '#4b4b4b' }}>{esp.lang("event/visitor_input", "not_claimed")}</Text>
203
+ :
204
+ <View>
205
+ {/* <Text allowFontScaling={false} style={{ fontFamily: "SFProText", color: '#4b4b4b', marginBottom: 5 }}>{LibUtils.number(item.qty_used) + " sudah diklaim"}</Text> */}
206
+ <TouchableOpacity onPress={() => {
207
+ setListClaim(item)
208
+ LibUtils.debounce(() => {
209
+ dialogListClaim?.current?.show()
210
+ }, 200)
211
+ }} style={{ paddingHorizontal: 7, paddingVertical: 5, borderRadius: 5, borderWidth: 1, borderColor: LibStyle.colorBlue }}>
212
+ <Text allowFontScaling={false} style={{ color: LibStyle.colorBlue, fontWeight: 'bold', fontSize: 12 }}>{esp.lang("event/visitor_input", "see_list_claimed")}</Text>
213
+ </TouchableOpacity>
214
+ </View>
215
+ }
216
+ </View>
217
+ }
218
+ </View>
219
+ )
220
+ } else {
221
+ return (
222
+ <View style={{ margin: 10, marginBottom: 0, padding: 10, borderRadius: 5, borderWidth: 1, borderColor: LibStyle.colorBgGrey }}>
223
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center', }}>
224
+ <TouchableOpacity onPress={() => {
225
+ LibUtils.copyToClipboard(item.access_code)
226
+ LibToastProperty.show(esp.lang("event/visitor_input", "success_copy", item.access_code))
227
+ }} style={{ flex: 1, flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
228
+ <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>
229
+ <LibIcon.Ionicons name='copy' size={16} style={applyStyle({ color: item.is_used == 1 ? "#c4c4c4" : "#2980b9", marginLeft: 7 })} />
230
+ </TouchableOpacity>
231
+ <View style={{ flex: 1, justifyContent: 'flex-end', flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
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>
233
+ <TouchableOpacity onPress={() => {
234
+ dialogClaim?.current?.show()
235
+ setSelectedCode(item)
236
+ }}>
237
+ <LibIcon name='pencil-circle' size={20} color={LibStyle.colorRed} style={{ marginLeft: 5 }} />
238
+ </TouchableOpacity>
239
+ </View>
240
+ </View>
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>
259
+ </View>
260
+ </View>
261
+ )
262
+ }
263
+ }
264
+
265
+ if (Number(getData()?.qty_generated) != Number(getData()?.qty)) {
266
+ return (
267
+ <View style={{ flex: 1, backgroundColor: '#fff' }}>
268
+ <EventHeader title={esp.lang("event/visitor_input", "title_input_exhibitors")} />
269
+ <View style={{ backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center' }}>
270
+ <View style={{ justifyContent: 'center', alignItems: 'center', padding: 10 }}>
271
+ <LibPicture source={esp.assets('img_failed_msg.png')} resizeMode="contain" style={{ width: LibStyle.width * 0.8, height: 200, resizeMode: 'contain' }} />
272
+ <ActivityIndicator size={'large'} color={LibStyle.colorPrimary} style={{ alignItems: 'center', justifyContent: 'center' }} />
273
+ <View style={{ width: LibStyle.width - 40, justifyContent: 'center', alignItems: 'center', backgroundColor: 'white', padding: 15, borderRadius: 10, marginTop: 20 }}>
274
+ <Text allowFontScaling={false} style={{ fontFamily: 'Arial', fontSize: 16, fontWeight: "bold", marginBottom: 5, color: "#4a4a4a", textAlign: "center" }}>{_msg}</Text>
275
+ </View>
276
+ <Text allowFontScaling={false} style={{ textAlign: 'center', fontFamily: "Arial", fontSize: 14, margin: 15, marginBottom: 0 }} >{messageGenerate}</Text>
277
+ </View>
278
+ </View>
279
+ </View>
280
+ )
281
+ }
282
+
283
+ let menuHeader = [
284
+ {
285
+ id: 1,
286
+ title: activeTab?.name,
287
+ color: '#d3f1ec',
288
+ textColor: '#4fbaa8',
289
+ total: LibUtils.number(activeTab?.qty)
290
+ },
291
+ {
292
+ id: 2,
293
+ title: esp.lang("event/visitor_inputv2", "total_token"),
294
+ color: '#d7edf8',
295
+ textColor: '#64b0e0',
296
+ total: LibUtils.number(getData()?.token)
297
+ },
298
+ {
299
+ id: 3,
300
+ title: esp.lang("event/visitor_inputv2", "token_shared"),
301
+ color: '#fbe3dd',
302
+ textColor: '#ec7463',
303
+ total: LibUtils.number(getData()?.token_shared)
304
+ },
305
+ {
306
+ id: 4,
307
+ title: esp.lang("event/visitor_inputv2", "token_left"),
308
+ color: '#fef2de',
309
+ textColor: '#f6c67f',
310
+ total: LibUtils.number(getData()?.token_remaining)
311
+ },
312
+ ]
313
+
314
+ return (
315
+ <View style={{ flex: 1 }}>
316
+ <EventHeader title={esp.lang("event/visitor_input", "title_input_exhibitor")} subtitle={esp.lang("event/visitor_input", "total_staff", LibUtils.number(data.qty))} />
317
+ <LibKeyboard_avoid style={{ flex: 1 }}>
318
+ <>
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
+ }
340
+
341
+ <View style={{ height: 35, marginBottom: 2, flexDirection: 'row', backgroundColor: '#fff', ...LibStyle.elevation(2) }} >
342
+ <ScrollView horizontal showsHorizontalScrollIndicator={false} >
343
+ {
344
+ _tabs.map(renderTabs)
345
+ }
346
+ </ScrollView>
347
+ </View>
348
+ <LibInfinite
349
+ url={activeTab?.url}
350
+ // isDebug={1}
351
+ key={activeTab + counter}
352
+ // style={{ flex: 1 }}
353
+ ListHeaderComponent={
354
+ <>
355
+ {/* {
356
+ activeTab?.ondate != "0000-00-00" &&
357
+ <View style={{ margin: 10, marginBottom: 0 }}>
358
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', color: LibStyle.colorGreen }}>{"Tanggal berlaku " + LibUtils.moment(activeTab?.ondate).format("DD MMMM YYYY")}</Text>
359
+ </View>
360
+ } */}
361
+ </>
362
+ }
363
+ removeClippedSubviews={Platform.OS == 'android'}
364
+ renderItem={renderItem}
365
+ />
366
+ </>
367
+ </LibKeyboard_avoid>
368
+ <LibSlidingup ref={dialogListClaim}>
369
+ <View style={{ backgroundColor: 'white', padding: 15, height: LibStyle.height * 0.7, borderTopLeftRadius: 5, borderTopRightRadius: 5 }} >
370
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' }}>
371
+ <LibTextstyle text={esp.lang("event/visitor_input", "list_claimed")} textStyle="headline" />
372
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#51b596" }}>{LibUtils.number(listClaim?.qty_used) + "/" + LibUtils.number(listClaim?.qty)}</Text>
373
+ </View>
374
+ <LibInfinite
375
+ url={listClaim?.url}
376
+ removeClippedSubviews={Platform.OS == 'android'}
377
+ renderItem={(item: any, i: number) => {
378
+ return (
379
+ <View key={i} style={{ padding: 10, borderBottomWidth: 1.5, borderBottomColor: LibStyle.colorBgGrey, flexDirection: 'row' }}>
380
+ <Text allowFontScaling={false} style={{ fontSize: 16 }}>{(i + 1) + ". "}</Text>
381
+ <View>
382
+ <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode='tail' style={{ fontSize: 16 }}>{item.name}</Text>
383
+ <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode='tail'>{item.email}</Text>
384
+ </View>
385
+ </View>
386
+ )
387
+ }}
388
+ />
389
+ </View>
390
+ </LibSlidingup>
391
+
392
+ <LibSlidingup ref={dialogClaim}>
393
+ <View style={{ backgroundColor: 'white', padding: 15, maxHeight: LibStyle.height * 0.7, borderTopLeftRadius: 5, borderTopRightRadius: 5 }} >
394
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' }}>
395
+ <LibTextstyle text={esp.lang("event/visitor_inputv2", "code")} textStyle="headline" />
396
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#00b894" }}>{selectedCode?.access_code}</Text>
397
+ </View>
398
+
399
+ <EventLabel_input label={esp.lang("event/visitor_inputv2", "input_name")} />
400
+ <EventInput_rectangle
401
+ ref={inputName}
402
+ returnKeyType="next"
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}
409
+ />
410
+
411
+ <View style={{ flexDirection: 'row', justifyContent: 'flex-end', alignContent: 'center', alignItems: 'center' }}>
412
+ <View style={{ flex: 2 }}>
413
+ <EventLabel_input label={esp.lang("event/visitor_inputv2", "input_token")} mandatory />
414
+ <EventInput_rectangle
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 : ''}
423
+ />
424
+ </View>
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>
432
+ </View>
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>
441
+ </View>
442
+ }
443
+ </View>
444
+
445
+ <EventButton style={{ backgroundColor: '#00b894', marginTop: 15, borderRadius: 5 }} label={esp.lang("event/visitor_input", "save_btn")} onPress={() => {
446
+ assignToken()
447
+ }} />
448
+
449
+ </View>
450
+ </LibSlidingup>
451
+ </View>
452
+ )
453
+ }
package/event/voucher.tsx CHANGED
@@ -6,6 +6,7 @@ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
6
6
  import { LibProgress } from 'esoftplay/cache/lib/progress/import';
7
7
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
8
8
 
9
+ import { EventConfigProperty } from 'esoftplay/cache/event/config/import';
9
10
  import { EventLabel_input } from 'esoftplay/cache/event/label_input/import';
10
11
  import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
11
12
  import esp from 'esoftplay/esp';
@@ -33,6 +34,7 @@ export default function m(props: EventVoucherProps): any {
33
34
  let voucherCode = React.useRef<LibInput>(null)
34
35
 
35
36
  useEffect(() => {
37
+ esp.isDebug("payment_voucher") && EventConfigProperty.curlConfig('payment_config')
36
38
  return () => LibNavigation.cancelBackResult(LibNavigation.getResultKey(props))
37
39
  }, [])
38
40
 
@@ -73,13 +73,21 @@ export default function m(props: EventVoucher2Props): any {
73
73
  let url = "event_booking_voucher_check"
74
74
  LibProgress.show(esp.lang("event/voucher", "check_wait"))
75
75
  new LibCurl(url, post, (res, msg) => {
76
- let newRes = {
77
- voucher_code: post?.voucher_code,
78
- ...res
79
- }
80
- let a = LibObject.set(getData(), newRes)(item.index, 'voucher')
81
- setData(a)
82
76
 
77
+ let x = new LibObject(getData()).update((it: any) => {
78
+ it.discount_id = res?.id
79
+ it.discount_generated_id = res?.generated_id
80
+ it.discount_amount = res?.amount
81
+ it.discount_type = res?.amount_type
82
+ return it
83
+ })(item.index).update((it2: any) => {
84
+ return ({
85
+ ...it2,
86
+ ...res,
87
+ voucher_code: post?.voucher_code
88
+ })
89
+ })(item.index, 'voucher').value()
90
+ setData(x)
83
91
  cb()
84
92
  LibProgress.hide()
85
93
  LibToastProperty.show(msg)