esoftplay-event 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/event/additional.tsx +1 -1
- package/event/additional_input.tsx +15 -0
- package/event/additional_new.tsx +565 -0
- package/event/artist.tsx +14 -34
- package/event/artist_detail.tsx +336 -239
- package/event/artist_detail_multi.tsx +266 -157
- package/event/artist_detailv2.tsx +129 -69
- package/event/artistv2.tsx +5 -13
- package/event/button.tsx +2 -2
- package/event/button_order_detail.tsx +20 -8
- package/event/capture.tsx +2 -0
- package/event/checkout.ts +135 -0
- package/event/countdown.tsx +13 -9
- package/event/countdown_base.tsx +88 -48
- package/event/countdown_event.tsx +3 -0
- package/event/countdown_timestamp.tsx +106 -0
- package/event/coupon.tsx +1 -1
- package/event/coupon_generate.tsx +35 -22
- package/event/detail.tsx +9 -15
- package/event/detail2.tsx +63 -61
- package/event/dialog_custom.tsx +67 -0
- package/event/exchange_ticket_list.tsx +23 -14
- package/event/exchange_ticket_result.tsx +1 -1
- package/event/firebase_socket.ts +14 -12
- package/event/htmltext.tsx +40 -28
- package/event/index.tsx +8 -2
- package/event/label_input.tsx +2 -2
- package/event/layout.tsx +312 -0
- package/event/loading_page.tsx +62 -82
- package/event/message.tsx +2 -2
- package/event/order_detail.tsx +408 -477
- package/event/order_detail_addons.tsx +60 -0
- package/event/order_detail_addons_booked.tsx +61 -0
- package/event/order_detail_coupon.tsx +66 -0
- package/event/order_detail_instruction.tsx +96 -0
- package/event/order_detail_payment.tsx +1 -1
- package/event/order_detail_reschedule.tsx +109 -0
- package/event/order_detail_return.tsx +231 -0
- package/event/order_detail_review.tsx +174 -0
- package/event/order_detail_share.tsx +304 -0
- package/event/order_detail_tnc.tsx +76 -0
- package/event/order_detail_upgrade.tsx +140 -90
- package/event/order_detail_upgrade_payment.tsx +120 -38
- package/event/order_detail_visitor.tsx +21 -10
- package/event/order_detail_waiting.tsx +3 -3
- package/event/order_history.tsx +1 -1
- package/event/order_item.tsx +1 -1
- package/event/order_lottery.tsx +1 -1
- package/event/order_reschedule.tsx +29 -16
- package/event/order_share_to.tsx +14 -0
- package/event/order_waiting.tsx +1 -1
- package/event/payment_subscribe.tsx +18 -0
- package/event/point_events.tsx +35 -0
- package/event/point_redemption.tsx +101 -0
- package/event/point_redemption_exchange.tsx +60 -0
- package/event/point_redemption_input.tsx +56 -0
- package/event/point_redemption_success.tsx +50 -0
- package/event/point_summary.tsx +48 -0
- package/event/popup.tsx +4 -4
- package/event/queue.tsx +111 -0
- package/event/queue_pricing.tsx +17 -6
- package/event/review_add.tsx +2 -2
- package/event/scan_item.tsx +1 -1
- package/event/schedule.tsx +33 -30
- package/event/schedule2.tsx +86 -0
- package/event/seat.tsx +135 -374
- package/event/seat_map.tsx +8 -8
- package/event/seat_map_new.tsx +211 -38
- package/event/step.tsx +1 -1
- package/event/test.tsx +8 -8
- package/event/ticket.tsx +326 -0
- package/event/ticket_list.tsx +316 -258
- package/event/ticket_list2.tsx +349 -224
- package/event/ticket_list_item.tsx +61 -0
- package/event/ticket_list_new.tsx +710 -0
- package/event/tms_add_result.tsx +10 -5
- package/event/tms_check_ticket_result.tsx +16 -7
- package/event/tms_dashboard.tsx +87 -12
- package/event/tms_gate.tsx +32 -15
- package/event/tms_home.tsx +178 -92
- package/event/tms_idcard.tsx +43 -26
- package/event/tms_in.tsx +2 -3
- package/event/tms_in_failed.tsx +1 -1
- package/event/tms_in_hall.tsx +4 -1
- package/event/tms_in_hall_failed.tsx +36 -16
- package/event/tms_in_log.tsx +9 -11
- package/event/tms_in_success.tsx +13 -8
- package/event/tms_log.tsx +16 -17
- package/event/tms_out_hall_failed.tsx +1 -1
- package/event/tms_out_temporary.tsx +3 -4
- package/event/token_order.tsx +103 -0
- package/event/token_payment.tsx +79 -0
- package/event/visitor_index.tsx +60 -49
- package/event/visitor_input.tsx +336 -54
- package/event/visitor_inputv2.tsx +173 -88
- package/event/voucher.tsx +1 -1
- package/id.json +76 -4
- package/package.json +1 -1
- package/event/secure_page.debug.tsx +0 -34
- package/event/secure_page.live.tsx +0 -35
package/event/visitor_input.tsx
CHANGED
|
@@ -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,14 +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';
|
|
26
|
-
import {
|
|
24
|
+
import { EventSheet } from 'esoftplay/cache/event/sheet/import';
|
|
27
25
|
import useLazyState from 'esoftplay/lazy';
|
|
28
26
|
import React, { useEffect } from 'react';
|
|
29
27
|
import { ActivityIndicator, Platform, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
@@ -34,8 +32,6 @@ export interface EventVisitor_inputProps {
|
|
|
34
32
|
navigation: any
|
|
35
33
|
}
|
|
36
34
|
|
|
37
|
-
const inputsState = useGlobalState<any>({})
|
|
38
|
-
|
|
39
35
|
export default function m(props: EventVisitor_inputProps): any {
|
|
40
36
|
let _data: any = LibNavigation.getArgs(props, 'data')
|
|
41
37
|
const { msg, url } = LibNavigation.getArgsAll(props)
|
|
@@ -46,20 +42,22 @@ export default function m(props: EventVisitor_inputProps): any {
|
|
|
46
42
|
const [activeTab, setActiveTab] = useSafeState(data?.list[0])
|
|
47
43
|
const [counter, setCounter] = useSafeState(1)
|
|
48
44
|
const [listClaim, setListClaim] = useSafeState()
|
|
45
|
+
const [selectedCode, setSelectedCode] = useSafeState()
|
|
46
|
+
const [token, setToken] = useSafeState()
|
|
49
47
|
|
|
50
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
|
+
|
|
51
56
|
|
|
52
57
|
let _tabs: any = getData()?.list
|
|
53
|
-
function setText(list_id: string): (name: string) => void {
|
|
54
|
-
return (name) => inputsState.set(LibObject.set(inputsState.get(), name)(list_id))
|
|
55
|
-
}
|
|
56
58
|
|
|
57
59
|
useEffect(() => {
|
|
58
|
-
|
|
59
|
-
LibNavigation.replace('event/visitor_inputv2', { data: _data, url: url })
|
|
60
|
-
} else {
|
|
61
|
-
loadData()
|
|
62
|
-
}
|
|
60
|
+
loadData()
|
|
63
61
|
}, [])
|
|
64
62
|
|
|
65
63
|
function loadData(): void {
|
|
@@ -89,26 +87,70 @@ export default function m(props: EventVisitor_inputProps): any {
|
|
|
89
87
|
}
|
|
90
88
|
}
|
|
91
89
|
|
|
92
|
-
function
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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()
|
|
98
103
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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) => {
|
|
102
108
|
LibProgress.hide()
|
|
103
109
|
LibDialog.info(esp.lang("event/visitor_input", "confirm_success"), msg);
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
110
|
+
loadData()
|
|
111
|
+
setCounter(counter + 1)
|
|
112
|
+
dialogClaim?.current?.hide()
|
|
107
113
|
}, (error) => {
|
|
114
|
+
dialogClaim?.current?.hide()
|
|
108
115
|
LibProgress.hide()
|
|
109
116
|
LibDialog.warning(esp.lang("event/visitor_input", "confirm_failed"), error?.message)
|
|
110
117
|
})
|
|
111
|
-
|
|
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");
|
|
112
154
|
}
|
|
113
155
|
|
|
114
156
|
function renderTabs(item: any, i: number) {
|
|
@@ -117,8 +159,8 @@ export default function m(props: EventVisitor_inputProps): any {
|
|
|
117
159
|
setActiveTab(item)
|
|
118
160
|
setCounter(counter + 1)
|
|
119
161
|
}}>
|
|
120
|
-
<View style={applyStyle({ height: 35, width: LibStyle.width /
|
|
121
|
-
<View style={{ width: LibStyle.width /
|
|
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, }}>
|
|
122
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>
|
|
123
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>
|
|
124
166
|
</View>
|
|
@@ -186,28 +228,47 @@ export default function m(props: EventVisitor_inputProps): any {
|
|
|
186
228
|
)
|
|
187
229
|
} else {
|
|
188
230
|
return (
|
|
189
|
-
<View style={
|
|
190
|
-
<View style={
|
|
191
|
-
<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', }}>
|
|
192
233
|
<TouchableOpacity onPress={() => {
|
|
193
234
|
LibUtils.copyToClipboard(item.access_code)
|
|
194
235
|
LibToastProperty.show(esp.lang("event/visitor_input", "success_copy", item.access_code))
|
|
195
|
-
}}>
|
|
196
|
-
<
|
|
197
|
-
|
|
198
|
-
<LibIcon.Ionicons name='copy' size={16} style={applyStyle({ color: item.is_used == 1 ? "#c4c4c4" : "#2980b9", marginLeft: 7 })} />
|
|
199
|
-
</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 })} />
|
|
200
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
|
+
}
|
|
201
271
|
</View>
|
|
202
|
-
<EventInput_rectangle
|
|
203
|
-
returnKeyType="next"
|
|
204
|
-
key={activeTab?.id + "??" + i}
|
|
205
|
-
editable={item.is_used == 0}
|
|
206
|
-
style={applyStyle({ borderRadius: 4, borderColor: '#c4c4c4', height: 35, marginTop: 8, backgroundColor: item.is_used == 1 ? "#e9e9e9" : '#fff' })}
|
|
207
|
-
defaultValue={item.name}
|
|
208
|
-
onChangeText={setText(item.list_id)}
|
|
209
|
-
placeholder={esp.lang("event/visitor_input", "placeholder_input_name", (i + 1))}
|
|
210
|
-
/>
|
|
211
272
|
</View>
|
|
212
273
|
)
|
|
213
274
|
}
|
|
@@ -231,14 +292,65 @@ export default function m(props: EventVisitor_inputProps): any {
|
|
|
231
292
|
)
|
|
232
293
|
}
|
|
233
294
|
|
|
234
|
-
|
|
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 });
|
|
235
327
|
|
|
236
328
|
return (
|
|
237
329
|
<View style={{ flex: 1 }}>
|
|
238
330
|
<EventHeader title={esp.lang("event/visitor_input", "title_input_exhibitor")} subtitle={esp.lang("event/visitor_input", "total_staff", LibUtils.number(data.qty))} />
|
|
239
331
|
<LibKeyboard_avoid style={{ flex: 1 }}>
|
|
240
332
|
<>
|
|
241
|
-
{
|
|
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
|
+
}
|
|
242
354
|
|
|
243
355
|
<View style={{ height: 35, marginBottom: 2, flexDirection: 'row', backgroundColor: '#fff', ...LibStyle.elevation(2) }} >
|
|
244
356
|
<ScrollView horizontal showsHorizontalScrollIndicator={false} >
|
|
@@ -254,20 +366,28 @@ export default function m(props: EventVisitor_inputProps): any {
|
|
|
254
366
|
// style={{ flex: 1 }}
|
|
255
367
|
ListHeaderComponent={
|
|
256
368
|
<>
|
|
257
|
-
{
|
|
369
|
+
{/* {
|
|
258
370
|
activeTab?.ondate != "0000-00-00" &&
|
|
259
|
-
<View style={{ margin:
|
|
371
|
+
<View style={{ margin: 10, marginBottom: 0 }}>
|
|
260
372
|
<Text allowFontScaling={false} style={{ fontWeight: 'bold', color: LibStyle.colorGreen }}>{"Tanggal berlaku " + LibUtils.moment(activeTab?.ondate).format("DD MMMM YYYY")}</Text>
|
|
261
373
|
</View>
|
|
262
|
-
}
|
|
374
|
+
} */}
|
|
263
375
|
</>
|
|
264
376
|
}
|
|
265
377
|
removeClippedSubviews={Platform.OS == 'android'}
|
|
266
378
|
renderItem={renderItem}
|
|
267
379
|
/>
|
|
380
|
+
|
|
268
381
|
{
|
|
269
|
-
|
|
270
|
-
<
|
|
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>
|
|
271
391
|
}
|
|
272
392
|
</>
|
|
273
393
|
</LibKeyboard_avoid>
|
|
@@ -279,8 +399,6 @@ export default function m(props: EventVisitor_inputProps): any {
|
|
|
279
399
|
</View>
|
|
280
400
|
<LibInfinite
|
|
281
401
|
url={listClaim?.url}
|
|
282
|
-
// isDebug={1}
|
|
283
|
-
// key={}
|
|
284
402
|
removeClippedSubviews={Platform.OS == 'android'}
|
|
285
403
|
renderItem={(item: any, i: number) => {
|
|
286
404
|
return (
|
|
@@ -296,6 +414,170 @@ export default function m(props: EventVisitor_inputProps): any {
|
|
|
296
414
|
/>
|
|
297
415
|
</View>
|
|
298
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
|
+
|
|
299
581
|
</View>
|
|
300
582
|
)
|
|
301
583
|
}
|