esoftplay-event 0.0.2-j → 0.0.2-k
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/coupon.tsx +1 -1
- package/event/coupon_generate.tsx +35 -22
- package/event/order_detail_payment.tsx +1 -1
- package/event/order_detail_upgrade_payment.tsx +1 -0
- package/event/tms_home.tsx +38 -38
- package/event/tms_idcard.tsx +11 -4
- package/event/tms_in_hall_failed.tsx +26 -4
- 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/visitor_index.tsx +60 -49
- package/id.json +3 -0
- package/package.json +1 -1
- package/event/secure_page.debug.tsx +0 -34
- package/event/secure_page.live.tsx +0 -35
package/event/coupon.tsx
CHANGED
|
@@ -81,7 +81,7 @@ export default function m(props: EventCouponProps): any {
|
|
|
81
81
|
renderItem={(item, index) => (
|
|
82
82
|
<View style={{ flex: 1 }} key={index}>
|
|
83
83
|
<TouchableOpacity onPress={() => {
|
|
84
|
-
if (item?.status == 0) {
|
|
84
|
+
if (item?.status == 0 && item?.show_qr != 0) {
|
|
85
85
|
esp.mod("lib/navigation").navigate("event/coupon_detail", { ...item })
|
|
86
86
|
}
|
|
87
87
|
}} style={[{ marginBottom: 4, margin: 15, borderRadius: 10, backgroundColor: '#fff' }, LibStyle.elevation(2)]}>
|
|
@@ -9,6 +9,7 @@ import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
|
9
9
|
import { EventMessage } from 'esoftplay/cache/event/message/import';
|
|
10
10
|
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
11
11
|
import { LibInfinite } from 'esoftplay/cache/lib/infinite/import';
|
|
12
|
+
import { LibKeyboard_avoid } from 'esoftplay/cache/lib/keyboard_avoid/import';
|
|
12
13
|
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
13
14
|
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
14
15
|
import { LibScroll } from 'esoftplay/cache/lib/scroll/import';
|
|
@@ -43,7 +44,8 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
43
44
|
|
|
44
45
|
function load() {
|
|
45
46
|
const curl = esp.mod("lib/curl")
|
|
46
|
-
|
|
47
|
+
const url = "event_coupon_admin_detail?event_id=" + event_id + "&coupon_id=" + getCoupon()?.coupon_id
|
|
48
|
+
new curl(url, null, (result, message) => {
|
|
47
49
|
setData(result)()
|
|
48
50
|
}, (error) => {
|
|
49
51
|
setError(error?.message)
|
|
@@ -64,16 +66,12 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
64
66
|
esp.modProp("lib/toast").show(esp.lang("event/coupon_generate", "email_invalid"))
|
|
65
67
|
return
|
|
66
68
|
}
|
|
67
|
-
if (amount == "") {
|
|
68
|
-
esp.modProp("lib/toast").show(esp.lang("event/coupon_generate", "nominal_empty"))
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
69
|
|
|
72
70
|
let post: any = {
|
|
73
71
|
event_id,
|
|
74
72
|
coupon_id: getCoupon()?.coupon_id,
|
|
75
73
|
user_email_to: email,
|
|
76
|
-
amount: amount
|
|
74
|
+
amount: amount || 0
|
|
77
75
|
}
|
|
78
76
|
|
|
79
77
|
if (notes != "") {
|
|
@@ -104,6 +102,14 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
104
102
|
}
|
|
105
103
|
|
|
106
104
|
function buildUrl(url: string) {
|
|
105
|
+
if (event_id) {
|
|
106
|
+
url += url.includes('?') ? '&' : '?'
|
|
107
|
+
url += 'event_id=' + event_id
|
|
108
|
+
}
|
|
109
|
+
if (getCoupon()?.coupon_id) {
|
|
110
|
+
url += url.includes('?') ? '&' : '?'
|
|
111
|
+
url += 'coupon_id=' + getCoupon()?.coupon_id
|
|
112
|
+
}
|
|
107
113
|
if (t) {
|
|
108
114
|
url += url.includes('?') ? '&' : '?'
|
|
109
115
|
url += 't=' + t
|
|
@@ -114,13 +120,13 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
114
120
|
return (
|
|
115
121
|
<View style={{ flex: 1 }}>
|
|
116
122
|
<EventHeader title={esp.lang("event/coupon_generate", "header")} subtitle={event_name} />
|
|
117
|
-
{
|
|
123
|
+
<LibKeyboard_avoid style={{ flex: 1 }} >
|
|
118
124
|
<LibScroll onRefresh={() => infiniteRef.current?.loadData()}>
|
|
119
125
|
<View style={[{ backgroundColor: "white", marginHorizontal: 15, marginTop: 15, padding: 10, borderRadius: 10 }, LibStyle.elevation(3)]}>
|
|
120
126
|
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 14 }}>{event_name}</Text>
|
|
121
127
|
|
|
122
|
-
<View style={[{ marginTop: 5, borderRadius:
|
|
123
|
-
<LibPicture source={{ uri: image }} resizeMode="cover" style={{ height: imgHeight, width: imgWidth, borderRadius:
|
|
128
|
+
<View style={[{ marginTop: 5, borderRadius: 10, backgroundColor: '#fff' }, LibStyle.elevation(2)]}>
|
|
129
|
+
<LibPicture source={{ uri: image }} resizeMode="cover" style={{ height: imgHeight, width: imgWidth, borderRadius: 10, backgroundColor: "#f1f1f1" }} />
|
|
124
130
|
</View>
|
|
125
131
|
</View>
|
|
126
132
|
|
|
@@ -129,7 +135,7 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
129
135
|
{
|
|
130
136
|
coupon &&
|
|
131
137
|
<View style={[{ marginBottom: 4, borderRadius: 10, backgroundColor: '#fff' }, LibStyle.elevation(2)]}>
|
|
132
|
-
<LibPicture source={{ uri: coupon?.image }} resizeMode="cover" style={{ height: (LibStyle.width - 50) * 0.43, width: LibStyle.width - 50, borderRadius: 10 }} />
|
|
138
|
+
<LibPicture source={{ uri: coupon?.image }} resizeMode="cover" style={{ height: (LibStyle.width - 50) * 0.43, width: LibStyle.width - 50, borderRadius: 10, backgroundColor: "#f1f1f1" }} />
|
|
133
139
|
<View style={{ backgroundColor: "rgba(0, 0, 0, 0.5)", position: 'absolute', borderBottomLeftRadius: 10, borderBottomRightRadius: 10, bottom: 0, left: 0, right: 0, padding: 10 }}>
|
|
134
140
|
<Text allowFontScaling={false} style={{ flex: 1, fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{coupon?.coupon_title}</Text>
|
|
135
141
|
</View>
|
|
@@ -146,7 +152,7 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
146
152
|
setCoupon(value)()
|
|
147
153
|
load()
|
|
148
154
|
})
|
|
149
|
-
}} style={{ borderWidth: 1, borderColor: "#e6e6e6", height:
|
|
155
|
+
}} style={{ borderWidth: 1, borderColor: "#e6e6e6", height: 40, borderRadius: 10, marginTop: 10, flexDirection: "row", alignItems: "center", paddingHorizontal: 10 }}>
|
|
150
156
|
{
|
|
151
157
|
coupon ?
|
|
152
158
|
<>
|
|
@@ -154,17 +160,18 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
154
160
|
<LibIcon name='pencil' size={18} />
|
|
155
161
|
</>
|
|
156
162
|
: <>
|
|
157
|
-
<Text allowFontScaling={false} style={{ flex: 1, fontFamily: "
|
|
163
|
+
<Text allowFontScaling={false} style={{ flex: 1, fontFamily: "ArialBold", fontSize: 14, color: "#999999" }}>{esp.lang("event/coupon_generate", "select_coupon")}</Text>
|
|
158
164
|
<LibIcon name='chevron-right' />
|
|
159
165
|
</>
|
|
160
166
|
}
|
|
161
167
|
</Pressable>
|
|
162
|
-
<View style={{ borderWidth: 1, borderColor: "#e6e6e6", height:
|
|
163
|
-
<Text>Rp. </Text>
|
|
168
|
+
<View style={{ borderWidth: 1, borderColor: "#e6e6e6", height: 40, borderRadius: 10, marginTop: 10, flexDirection: "row", alignItems: "center", paddingHorizontal: 10 }}>
|
|
169
|
+
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, color: "#4b4b4b" }} >Rp. </Text>
|
|
164
170
|
<LibInput
|
|
165
171
|
ref={inputNominalRef}
|
|
166
172
|
base
|
|
167
173
|
placeholder={esp.lang("event/coupon_generate", "input_nominal")}
|
|
174
|
+
placeholderTextColor='#999999'
|
|
168
175
|
onChangeText={() => { }}
|
|
169
176
|
keyboardType='numeric'
|
|
170
177
|
mask='###.###.###.###.###.###.###.###.###.###'
|
|
@@ -176,11 +183,13 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
176
183
|
style={{ flex: 1, paddingHorizontal: 5 }}
|
|
177
184
|
/>
|
|
178
185
|
</View>
|
|
179
|
-
<View style={{ borderWidth: 1, borderColor: "#e6e6e6", height:
|
|
186
|
+
<View style={{ borderWidth: 1, borderColor: "#e6e6e6", height: 40, borderRadius: 10, marginTop: 10, flexDirection: "row", alignItems: "center", paddingHorizontal: 10 }}>
|
|
187
|
+
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, color: "#4b4b4b" }} >@ </Text>
|
|
180
188
|
<LibInput
|
|
181
189
|
ref={inputEmailRef}
|
|
182
190
|
base
|
|
183
191
|
placeholder={esp.lang("event/coupon_generate", "input_email")}
|
|
192
|
+
placeholderTextColor='#999999'
|
|
184
193
|
onChangeText={() => { }}
|
|
185
194
|
keyboardType='email-address'
|
|
186
195
|
returnKeyType='next'
|
|
@@ -195,6 +204,7 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
195
204
|
ref={inputDescRef}
|
|
196
205
|
base
|
|
197
206
|
placeholder={"notes"}
|
|
207
|
+
placeholderTextColor='#999999'
|
|
198
208
|
multiline
|
|
199
209
|
onChangeText={() => { }}
|
|
200
210
|
returnKeyType='go'
|
|
@@ -207,10 +217,10 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
207
217
|
if (getCoupon()) {
|
|
208
218
|
doSendVoucher()
|
|
209
219
|
} else {
|
|
210
|
-
esp.modProp("lib/toast").show("
|
|
220
|
+
esp.modProp("lib/toast").show(esp.lang("event/coupon_generate", "select_coupon_alert"))
|
|
211
221
|
}
|
|
212
222
|
}}
|
|
213
|
-
style={{ backgroundColor: coupon ? LibStyle.colorGreen : "#e6e6e6", height:
|
|
223
|
+
style={{ backgroundColor: coupon ? LibStyle.colorGreen : "#e6e6e6", height: 40, alignItems: "center", justifyContent: "center", paddingHorizontal: 10, borderRadius: 10 }}>
|
|
214
224
|
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, color: "white" }}>{esp.lang("event/coupon_generate", "btn_send")}</Text>
|
|
215
225
|
</Pressable>
|
|
216
226
|
{
|
|
@@ -225,19 +235,22 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
225
235
|
data && coupon &&
|
|
226
236
|
<LibInfinite
|
|
227
237
|
ref={infiniteRef}
|
|
228
|
-
key={coupon?.coupon_id + buildUrl("event_coupon_admin_claimed
|
|
229
|
-
url={buildUrl("event_coupon_admin_claimed
|
|
238
|
+
key={coupon?.coupon_id + buildUrl("event_coupon_admin_claimed")}
|
|
239
|
+
url={buildUrl("event_coupon_admin_claimed")}
|
|
230
240
|
errorView={(error: any) => (
|
|
231
241
|
<EventMessage message={error} />
|
|
232
242
|
)}
|
|
233
243
|
renderItem={(item, index) => (
|
|
234
|
-
<View style={[{ backgroundColor: "white", marginHorizontal: 15, marginTop: 10, marginBottom: 5, padding: 10, borderRadius: 10, flexDirection: "row", alignItems: "center" }, LibStyle.elevation(3)]}>
|
|
244
|
+
<View key={index} style={[{ backgroundColor: "white", marginHorizontal: 15, marginTop: 10, marginBottom: 5, padding: 10, borderRadius: 10, flexDirection: "row", alignItems: "center" }, LibStyle.elevation(3)]}>
|
|
235
245
|
<View style={{ width: 36, height: 36, borderRadius: 18, backgroundColor: "#909090", alignItems: "center", justifyContent: "center" }}>
|
|
236
246
|
<LibIcon name='send' size={20} color='#f1f1f1' />
|
|
237
247
|
</View>
|
|
238
248
|
<View style={{ flex: 1, marginLeft: 10 }}>
|
|
239
249
|
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, marginBottom: 5 }}>{item?.coupon_title}</Text>
|
|
240
|
-
|
|
250
|
+
{
|
|
251
|
+
item?.amount && item?.amount != "" && item?.amount != 0 &&
|
|
252
|
+
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 14 }}>{LibUtils.money(item?.amount)}</Text>
|
|
253
|
+
}
|
|
241
254
|
<View style={{ flexDirection: "row", marginVertical: 5 }}>
|
|
242
255
|
<Text allowFontScaling={false} style={{ flex: 1, fontFamily: "Arial", fontSize: 12 }}>{String(item?.user_email).toLowerCase()}</Text>
|
|
243
256
|
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, color: "#606060" }}>{moment(item?.claimed_time).localeFormat("DD MMM YYYY HH:mm:ss")}</Text>
|
|
@@ -252,7 +265,7 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
252
265
|
/>
|
|
253
266
|
}
|
|
254
267
|
</LibScroll>
|
|
255
|
-
|
|
268
|
+
</LibKeyboard_avoid>
|
|
256
269
|
</View>
|
|
257
270
|
)
|
|
258
271
|
}
|
|
@@ -48,7 +48,7 @@ export default function m(props: EventOrder_detail_paymentProps): any {
|
|
|
48
48
|
<Text allowFontScaling={false} style={{ fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "left", color: "#4a4a4a" }}>{esp.lang("event/order_detail_payment", "virtual_number_account")}</Text>
|
|
49
49
|
<View style={{ marginTop: 10, flexDirection: "row", alignItems: "center", }}>
|
|
50
50
|
<View style={{ flex: 1, backgroundColor: '#f1f2f3', borderRadius: 5, marginRight: 10, padding: 5 }} >
|
|
51
|
-
<Text allowFontScaling={false}
|
|
51
|
+
<Text allowFontScaling={false} adjustsFontSizeToFit numberOfLines={1} style={{ fontSize: 30, fontStyle: "normal", letterSpacing: 0, textAlign: "left", color: LibStyle.colorPrimaryDark }}>{va_no}</Text>
|
|
52
52
|
</View>
|
|
53
53
|
<TouchableOpacity onPress={() => {
|
|
54
54
|
LibUtils.copyToClipboard(va_no)
|
|
@@ -244,6 +244,7 @@ export default function m(props: EventOrder_detail_upgrade_paymentProps): any {
|
|
|
244
244
|
<BigbangPayment_list
|
|
245
245
|
eventId={dataTicket?.event_id}
|
|
246
246
|
url_payment={dataTicket?.url_payment}
|
|
247
|
+
previous_total={dataTicket?.previous_total || 0}
|
|
247
248
|
onToggleCC={() => { scrollRef.current?.scrollToEnd({ animated: true }) }}
|
|
248
249
|
order_type={14} // upgrade ticekt
|
|
249
250
|
currency={selectedTicket?.selected_ticket?.currency}
|
package/event/tms_home.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// withHooks
|
|
2
2
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
3
|
-
import { EventTms_in_successProperty } from 'esoftplay/cache/event/tms_in_success/import';
|
|
3
|
+
// import { EventTms_in_successProperty } from 'esoftplay/cache/event/tms_in_success/import';
|
|
4
4
|
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
5
5
|
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
6
6
|
import { LibFocus } from 'esoftplay/cache/lib/focus/import';
|
|
@@ -234,42 +234,42 @@ export default function m(props: EventTms_homeProps): any {
|
|
|
234
234
|
|
|
235
235
|
// esp.log(counterState().get());
|
|
236
236
|
|
|
237
|
-
const timeoutSync = useRef<any>()
|
|
237
|
+
const timeoutSync = useRef<any>(null)
|
|
238
238
|
const timeout = useTimeout()
|
|
239
|
-
const [syncUseTicket, resetSyncUseTicket] = useTasks((item: any) => new Promise((next) => {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}), () => {
|
|
262
|
-
|
|
263
|
-
})
|
|
264
|
-
|
|
265
|
-
subscriber.useSubscribe(() => {
|
|
266
|
-
|
|
267
|
-
})
|
|
268
|
-
|
|
269
|
-
subscriberReset.useSubscribe(() => {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
})
|
|
239
|
+
// const [syncUseTicket, resetSyncUseTicket] = useTasks((item: any) => new Promise((next) => {
|
|
240
|
+
// const [url, post] = item;
|
|
241
|
+
// let _post = LibObject.assign({}, post)()
|
|
242
|
+
// clearTimeout?.(timeoutSync.current)
|
|
243
|
+
// timeoutSync.current = timeout(() => {
|
|
244
|
+
// addCounterEntranceTimeout(1, _post?.price_id)
|
|
245
|
+
// next()
|
|
246
|
+
// }, 30000);
|
|
247
|
+
// addCounterEntranceSend(1, _post?.price_id)
|
|
248
|
+
// _post["trx_id"] = new Date().getTime() + "" + UserClass.state().get()?.id;
|
|
249
|
+
|
|
250
|
+
// // new LibCurl(url, _post, (res, msg) => {
|
|
251
|
+
// // // EventTms_in_successProperty.syncUsedTiket().set((old) => old.filter((x) => !isEqual([url, post], x)))
|
|
252
|
+
// // addCounterEntranceOk(1, _post?.price_id)
|
|
253
|
+
// // addCounterEntranceTicket(post?.qty, _post?.price_id)
|
|
254
|
+
// // next()
|
|
255
|
+
// // }, (err: any) => {
|
|
256
|
+
// // addCounterEntranceNo(1, _post?.price_id)
|
|
257
|
+
// // reportApiError(url, JSON.stringify({ post, response: err }))
|
|
258
|
+
// // next()
|
|
259
|
+
// // }, 1)
|
|
260
|
+
|
|
261
|
+
// }), () => {
|
|
262
|
+
|
|
263
|
+
// })
|
|
264
|
+
|
|
265
|
+
// subscriber.useSubscribe(() => {
|
|
266
|
+
// syncUseTicket(subscriber.getValue())
|
|
267
|
+
// })
|
|
268
|
+
|
|
269
|
+
// subscriberReset.useSubscribe(() => {
|
|
270
|
+
// resetSyncUseTicket()
|
|
271
|
+
// syncUseTicket(subscriberReset.getValue())
|
|
272
|
+
// })
|
|
273
273
|
|
|
274
274
|
|
|
275
275
|
const [syncTicketExit, resetSyncTicketExit] = useTasksExit((item: any) => new Promise((next) => {
|
|
@@ -371,7 +371,7 @@ export default function m(props: EventTms_homeProps): any {
|
|
|
371
371
|
const date = LibUtils.moment().localeFormat('YYYY-MM-DD HH:mm:ss')
|
|
372
372
|
|
|
373
373
|
useEffect(() => {
|
|
374
|
-
resetSyncUseTicket()
|
|
374
|
+
// resetSyncUseTicket()
|
|
375
375
|
resetSyncTicketExit()
|
|
376
376
|
resetSyncTicketHallIn()
|
|
377
377
|
resetSyncTicketHallOut()
|
|
@@ -394,7 +394,7 @@ export default function m(props: EventTms_homeProps): any {
|
|
|
394
394
|
}
|
|
395
395
|
|
|
396
396
|
function loadData() {
|
|
397
|
-
subscriber.trigger(EventTms_in_successProperty.syncUsedTiket().get())
|
|
397
|
+
// subscriber.trigger(EventTms_in_successProperty.syncUsedTiket().get())
|
|
398
398
|
new LibCurl('event_tms_visitor?event_id=' + is_scanner?.id, null, (res, msg) => {
|
|
399
399
|
setResult(res)
|
|
400
400
|
setRefreshing(false)
|
package/event/tms_idcard.tsx
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
4
4
|
import { EventSheet } from 'esoftplay/cache/event/sheet/import';
|
|
5
5
|
import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
|
|
6
|
-
import { EventTms_in_successProperty } from 'esoftplay/cache/event/tms_in_success/import';
|
|
6
|
+
// import { EventTms_in_successProperty } from 'esoftplay/cache/event/tms_in_success/import';
|
|
7
7
|
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
8
8
|
import { LibDialog } from 'esoftplay/cache/lib/dialog/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 { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
13
12
|
import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
|
|
14
13
|
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
15
14
|
import { UserClass } from 'esoftplay/cache/user/class/import';
|
|
15
|
+
import { reportApiError } from 'esoftplay/error';
|
|
16
16
|
import esp from 'esoftplay/esp';
|
|
17
17
|
import useSafeState from 'esoftplay/state';
|
|
18
18
|
import React, { useEffect, useRef } from 'react';
|
|
@@ -90,8 +90,15 @@ export default function m(props: EventTms_idcardProps): any {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
EventTms_homeProperty.addCounterEntranceOpenGateIdCard(1, selectedTicket?.price_id)
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
new LibCurl(url, post, (res, msg) => {
|
|
94
|
+
// console.log("SUCCESS CUY", res, msg)
|
|
95
|
+
// syncUsedTiketState.set(LibObject.push(syncUsedTiketState.get(), [url, post])())
|
|
96
|
+
// EventTms_homeProperty.subscribeSync().trigger(syncUsedTiketState.get())
|
|
97
|
+
}, (err) => {
|
|
98
|
+
reportApiError(url, JSON.stringify({ post, response: err }))
|
|
99
|
+
})
|
|
100
|
+
// EventTms_in_successProperty.syncUsedTiket().set(LibObject.push(EventTms_in_successProperty.syncUsedTiket().get(), [url, post])())
|
|
101
|
+
// EventTms_homeProperty.subscribeSync().trigger(EventTms_in_successProperty.syncUsedTiket().get())
|
|
95
102
|
}
|
|
96
103
|
|
|
97
104
|
function entranceHall() {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { useEffect } from 'react';
|
|
3
3
|
|
|
4
4
|
import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
5
|
+
import { EventFirebase_socket } from 'esoftplay/cache/event/firebase_socket/import';
|
|
5
6
|
import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
|
|
6
7
|
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
7
8
|
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
@@ -33,7 +34,7 @@ export default function m(props: EventTms_in_hall_failedProps): any {
|
|
|
33
34
|
|
|
34
35
|
const [, setData, getData] = useSafeState()
|
|
35
36
|
const [qty, setQty, getQty] = useSafeState(1)
|
|
36
|
-
|
|
37
|
+
const { get } = EventFirebase_socket()
|
|
37
38
|
const qtyRef = React.useRef<LibSlidingup>(null)
|
|
38
39
|
|
|
39
40
|
useEffect(() => {
|
|
@@ -56,6 +57,24 @@ export default function m(props: EventTms_in_hall_failedProps): any {
|
|
|
56
57
|
})
|
|
57
58
|
}
|
|
58
59
|
|
|
60
|
+
function mainPath(qr: string) {
|
|
61
|
+
let a = ['event', event_id, '1', qr]
|
|
62
|
+
return a.join('/')
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
function isGateCheckValid(onValid: Function) {
|
|
67
|
+
get(mainPath(encodeURIComponent(encodeURIComponent(postGetData.user_qr))), getData()?.gate?.id, (res) => {
|
|
68
|
+
const errorMessage = Object.values(res)?.[0]?.[4]
|
|
69
|
+
if (Boolean(errorMessage)) {
|
|
70
|
+
Alert.alert("Oops!", errorMessage)
|
|
71
|
+
} else {
|
|
72
|
+
onValid()
|
|
73
|
+
}
|
|
74
|
+
})
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
59
78
|
function forceEntrance() {
|
|
60
79
|
let dataEntranceIn = []
|
|
61
80
|
let dataEntranceBackIn = []
|
|
@@ -77,7 +96,7 @@ export default function m(props: EventTms_in_hall_failedProps): any {
|
|
|
77
96
|
qr: encodeURIComponent(postGetData.user_qr),
|
|
78
97
|
trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
|
|
79
98
|
event_id: event_id,
|
|
80
|
-
gate_id: getData()
|
|
99
|
+
gate_id: getData()?.gate?.id,
|
|
81
100
|
is_tms: 1,
|
|
82
101
|
qty: getQty(),
|
|
83
102
|
tms_id: UserClass.state().get()?.id,
|
|
@@ -226,7 +245,7 @@ export default function m(props: EventTms_in_hall_failedProps): any {
|
|
|
226
245
|
qtyRef.current?.show()
|
|
227
246
|
} else if (validDataLength == 1) {
|
|
228
247
|
setQty(1)
|
|
229
|
-
forceEntrance
|
|
248
|
+
isGateCheckValid(forceEntrance)
|
|
230
249
|
}
|
|
231
250
|
})
|
|
232
251
|
}} style={{ marginHorizontal: 20, flex: 1, height: 40, borderRadius: 5, backgroundColor: LibStyle.colorPrimary, justifyContent: 'center', alignContent: 'center', alignItems: 'center', ...LibStyle.elevation(10) }} >
|
|
@@ -260,7 +279,10 @@ export default function m(props: EventTms_in_hall_failedProps): any {
|
|
|
260
279
|
<LibIcon.SimpleLineIcons size={40} name='plus' />
|
|
261
280
|
</Pressable>
|
|
262
281
|
</View>
|
|
263
|
-
<EventButton label='Force Entrance' onPress={() => {
|
|
282
|
+
<EventButton label='Force Entrance' onPress={() => {
|
|
283
|
+
qtyRef.current?.hide()
|
|
284
|
+
isGateCheckValid(forceEntrance)
|
|
285
|
+
}} />
|
|
264
286
|
</View>
|
|
265
287
|
</LibSlidingup >
|
|
266
288
|
</View >
|
package/event/tms_in_log.tsx
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
// withHooks
|
|
2
2
|
import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
|
|
3
|
-
import { EventTms_in_successProperty } from 'esoftplay/cache/event/tms_in_success/import';
|
|
4
3
|
import { EventTms_logProperty } from 'esoftplay/cache/event/tms_log/import';
|
|
5
4
|
import { LibLoading } from 'esoftplay/cache/lib/loading/import';
|
|
6
5
|
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
7
6
|
import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
|
|
8
7
|
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
9
|
-
import { UseCondition } from 'esoftplay/cache/use/condition/import';
|
|
10
8
|
import esp from 'esoftplay/esp';
|
|
11
9
|
import useSafeState from 'esoftplay/state';
|
|
12
10
|
import { useTimeout } from 'esoftplay/timeout';
|
|
@@ -45,21 +43,21 @@ function Item(props: EntranceLogItem) {
|
|
|
45
43
|
|
|
46
44
|
export default function m(props: EventTms_in_logProps): any {
|
|
47
45
|
const log = EventTms_homeProperty.counterState().useSelector(s => s)
|
|
48
|
-
const backup = EventTms_in_successProperty.syncUsedTiket().useSelector(s => s)
|
|
46
|
+
// const backup = EventTms_in_successProperty.syncUsedTiket().useSelector(s => s)
|
|
49
47
|
const [loading, setLoading] = useSafeState<boolean>(true)
|
|
50
48
|
const timeout = useTimeout()
|
|
51
49
|
|
|
52
50
|
esp.log({ log });
|
|
53
51
|
|
|
54
52
|
function syncData() {
|
|
55
|
-
EventTms_homeProperty.subscribeSync().trigger(EventTms_in_successProperty.syncUsedTiket().get())
|
|
53
|
+
// EventTms_homeProperty.subscribeSync().trigger(EventTms_in_successProperty.syncUsedTiket().get())
|
|
56
54
|
timeout(() => {
|
|
57
55
|
setLoading(false)
|
|
58
56
|
}, 1000)
|
|
59
57
|
}
|
|
60
58
|
|
|
61
59
|
function forceSyncData() {
|
|
62
|
-
EventTms_homeProperty.subscribeSyncReset().trigger(EventTms_in_successProperty.syncUsedTiket().get())
|
|
60
|
+
// EventTms_homeProperty.subscribeSyncReset().trigger(EventTms_in_successProperty.syncUsedTiket().get())
|
|
63
61
|
timeout(() => {
|
|
64
62
|
setLoading(false)
|
|
65
63
|
}, 1000)
|
|
@@ -105,12 +103,12 @@ export default function m(props: EventTms_in_logProps): any {
|
|
|
105
103
|
}
|
|
106
104
|
|
|
107
105
|
}} />
|
|
108
|
-
<Item text={esp.lang("event/tms_in_log", "data_not_send")} subtitle={esp.lang("event/tms_in_log", "data_not_send_to_server")} value={
|
|
106
|
+
<Item text={esp.lang("event/tms_in_log", "data_not_send")} subtitle={esp.lang("event/tms_in_log", "data_not_send_to_server")} value={"0"} valuecolor={LibStyle.colorRed} onPress={() => {
|
|
109
107
|
|
|
110
108
|
}} />
|
|
111
109
|
|
|
112
|
-
<View style={{ marginHorizontal: 15 }} >
|
|
113
|
-
<UseCondition
|
|
110
|
+
{/* <View style={{ marginHorizontal: 15 }} > */}
|
|
111
|
+
{/* <UseCondition
|
|
114
112
|
if={backup.length == 0}
|
|
115
113
|
fallback={
|
|
116
114
|
<Pressable onPress={() => {
|
|
@@ -124,9 +122,9 @@ export default function m(props: EventTms_in_logProps): any {
|
|
|
124
122
|
<LibTextstyle textStyle='callout'
|
|
125
123
|
style={{ textAlign: 'center', marginTop: 10 }}
|
|
126
124
|
text={esp.lang("event/tms_in_log", "all_data_send")} />
|
|
127
|
-
</UseCondition>
|
|
128
|
-
</View>
|
|
129
|
-
</View
|
|
125
|
+
</UseCondition> */}
|
|
126
|
+
{/* </View> */}
|
|
127
|
+
</View>
|
|
130
128
|
)
|
|
131
129
|
}
|
|
132
130
|
|
package/event/tms_in_success.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// withHooks
|
|
2
2
|
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
3
|
-
import { LibObject } from 'esoftplay/cache/lib/object/import';
|
|
4
3
|
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
5
4
|
import { LibStatusbar } from 'esoftplay/cache/lib/statusbar/import';
|
|
6
5
|
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
@@ -9,8 +8,9 @@ import { UserClass } from 'esoftplay/cache/user/class/import';
|
|
|
9
8
|
import { useRef } from 'react';
|
|
10
9
|
|
|
11
10
|
import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
|
|
11
|
+
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
12
|
+
import { reportApiError } from 'esoftplay/error';
|
|
12
13
|
import esp from 'esoftplay/esp';
|
|
13
|
-
import useGlobalState, { useGlobalReturn } from 'esoftplay/global';
|
|
14
14
|
import useSafeState from 'esoftplay/state';
|
|
15
15
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
16
16
|
import React, { useEffect } from 'react';
|
|
@@ -24,10 +24,10 @@ export interface EventTms_in_successProps {
|
|
|
24
24
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export const syncUsedTiketState = useGlobalState<any[]>([], { persistKey: 'event_entrance_success_tiket_sync', loadOnInit: true, inFastStorage: true })
|
|
28
|
-
export function syncUsedTiket(): useGlobalReturn<any[]> {
|
|
29
|
-
|
|
30
|
-
}
|
|
27
|
+
// export const syncUsedTiketState = useGlobalState<any[]>([], { persistKey: 'event_entrance_success_tiket_sync', loadOnInit: true, inFastStorage: true })
|
|
28
|
+
// export function syncUsedTiket(): useGlobalReturn<any[]> {
|
|
29
|
+
// return syncUsedTiketState
|
|
30
|
+
// }
|
|
31
31
|
|
|
32
32
|
export default function m(props: EventTms_in_successProps): any {
|
|
33
33
|
const { scan_type, url_ticket_update, url_ticket_detail, price_type, selectedTicket, gate_type, qr_code, event_id, selectGate, typeScanner, event_title, qty, configPriority } = LibNavigation.getArgsAll<any>(props)
|
|
@@ -108,8 +108,13 @@ export default function m(props: EventTms_in_successProps): any {
|
|
|
108
108
|
scanned: LibUtils.moment().localeFormat('YYYY-MM-DD HH:mm:ss'),
|
|
109
109
|
}
|
|
110
110
|
EventTms_homeProperty.addCounterEntranceOpenGate(1, selectedTicket?.price_id)
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
new LibCurl(url, post, (res, msg) => {
|
|
112
|
+
// console.log("SUCCESS CUY", res, msg)
|
|
113
|
+
// syncUsedTiketState.set(LibObject.push(syncUsedTiketState.get(), [url, post])())
|
|
114
|
+
// EventTms_homeProperty.subscribeSync().trigger(syncUsedTiketState.get())
|
|
115
|
+
}, (err) => {
|
|
116
|
+
reportApiError(url, JSON.stringify({ post, response: err }))
|
|
117
|
+
})
|
|
113
118
|
}
|
|
114
119
|
|
|
115
120
|
const widthInterpolate = progress.interpolate({
|
package/event/tms_log.tsx
CHANGED
|
@@ -8,7 +8,6 @@ import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
|
|
|
8
8
|
import { EventTms_in_hall_log } from 'esoftplay/cache/event/tms_in_hall_log/import';
|
|
9
9
|
import { EventTms_in_hall_successProperty } from 'esoftplay/cache/event/tms_in_hall_success/import';
|
|
10
10
|
import { EventTms_in_log } from 'esoftplay/cache/event/tms_in_log/import';
|
|
11
|
-
import { EventTms_in_successProperty } from 'esoftplay/cache/event/tms_in_success/import';
|
|
12
11
|
import { EventTms_out_hall_log } from 'esoftplay/cache/event/tms_out_hall_log/import';
|
|
13
12
|
import { EventTms_out_hall_successProperty } from 'esoftplay/cache/event/tms_out_hall_success/import';
|
|
14
13
|
import { EventTms_out_log } from 'esoftplay/cache/event/tms_out_log/import';
|
|
@@ -104,8 +103,8 @@ export default function m(props: EventTms_logProps): any {
|
|
|
104
103
|
const event_id = EventTms_dashboardProperty?.closingDataState()?.get().event_id
|
|
105
104
|
const gate_id = EventTms_dashboardProperty?.closingDataState()?.get().gate_id
|
|
106
105
|
|
|
107
|
-
const backupEntrance = EventTms_in_successProperty.syncUsedTiket().useSelector(s => s)
|
|
108
|
-
const
|
|
106
|
+
// const backupEntrance = EventTms_in_successProperty.syncUsedTiket().useSelector(s => s)
|
|
107
|
+
// const useDetectStateChange(backupEntrance, 10000)
|
|
109
108
|
|
|
110
109
|
const backupExit = EventTms_out_successProperty.syncTicketExit().useSelector(s => s)
|
|
111
110
|
const isStuckExit = useDetectStateChange(backupExit, 10000)
|
|
@@ -154,7 +153,7 @@ export default function m(props: EventTms_logProps): any {
|
|
|
154
153
|
|
|
155
154
|
// reset counter
|
|
156
155
|
EventTms_homeProperty.counterState().reset()
|
|
157
|
-
EventTms_in_successProperty.syncUsedTiket().reset()
|
|
156
|
+
// EventTms_in_successProperty.syncUsedTiket().reset()
|
|
158
157
|
EventTms_out_successProperty.syncTicketExit().reset()
|
|
159
158
|
EventTms_in_hall_successProperty.syncHallIn().reset()
|
|
160
159
|
EventTms_out_hall_successProperty.syncHallOut().reset()
|
|
@@ -262,8 +261,8 @@ export default function m(props: EventTms_logProps): any {
|
|
|
262
261
|
</LibCollaps>
|
|
263
262
|
|
|
264
263
|
</ScrollView>
|
|
265
|
-
<UseCondition if={backupExit.length == 0 &&
|
|
266
|
-
<UseCondition if={
|
|
264
|
+
<UseCondition if={backupExit.length == 0 && backupHall.length == 0 && backupHall_out.length == 0} fallback={
|
|
265
|
+
<UseCondition if={isStuckExit || isStuckHall || isStuckHall_out} >
|
|
267
266
|
<View style={{ padding: 10 }}>
|
|
268
267
|
<LibTextstyle textStyle='caption2' text={esp.lang("event/tms_log", "alert")} />
|
|
269
268
|
<EventButton
|
|
@@ -272,17 +271,17 @@ export default function m(props: EventTms_logProps): any {
|
|
|
272
271
|
backgroundColor='#000'
|
|
273
272
|
onPress={() => {
|
|
274
273
|
LibDialog.confirm(esp.lang("event/tms_log", "send_title"), esp.lang("event/tms_log", "send_msg"), esp.lang("event/tms_log", "send_ok"), () => {
|
|
275
|
-
if (backupEntrance.length > 0) {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
274
|
+
// if (backupEntrance.length > 0) {
|
|
275
|
+
// counter = counter + 1
|
|
276
|
+
// Storage.setItem('event/tms_in_log_copy_scanned', JSON.stringify(backupEntrance)).then(() => {
|
|
277
|
+
// sendFileTelegram('event/tms_in_log_copy_scanned', () => {
|
|
278
|
+
// counterDone = counterDone + 1
|
|
279
|
+
// if (counter == counterDone) {
|
|
280
|
+
// closing()
|
|
281
|
+
// }
|
|
282
|
+
// })
|
|
283
|
+
// })
|
|
284
|
+
// }
|
|
286
285
|
|
|
287
286
|
if (backupExit.length > 0) {
|
|
288
287
|
counter = counter + 1
|
package/event/visitor_index.tsx
CHANGED
|
@@ -9,15 +9,14 @@ import { LibInfinite } from 'esoftplay/cache/lib/infinite/import';
|
|
|
9
9
|
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
10
10
|
import { LibProgress } from 'esoftplay/cache/lib/progress/import';
|
|
11
11
|
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
12
|
-
import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
|
|
13
12
|
import esp from 'esoftplay/esp';
|
|
14
13
|
import useSafeState from 'esoftplay/state';
|
|
15
14
|
|
|
16
|
-
import {
|
|
17
|
-
import { EventLabel_input } from 'esoftplay/cache/event/label_input/import';
|
|
15
|
+
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
18
16
|
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
17
|
+
import useLazyState from 'esoftplay/lazy';
|
|
19
18
|
import React, { useEffect, useRef } from 'react';
|
|
20
|
-
import { Text, TouchableOpacity, View } from 'react-native';
|
|
19
|
+
import { Pressable, Text, TouchableOpacity, View } from 'react-native';
|
|
21
20
|
|
|
22
21
|
export interface EventVisitor_indexArgs {
|
|
23
22
|
|
|
@@ -30,8 +29,9 @@ export default function m(props: EventVisitor_indexProps): any {
|
|
|
30
29
|
const url = 'event_history'
|
|
31
30
|
const [argsCode, setArgsCode] = useSafeState(code)
|
|
32
31
|
const [isExist, setIsExist] = useSafeState(0)
|
|
32
|
+
const [types, setTypes] = useLazyState<any>(undefined)
|
|
33
|
+
const [activeType, setActiveType] = useLazyState<any>()
|
|
33
34
|
const ref = useRef<LibInfinite>(null)
|
|
34
|
-
let inputAccessCode = React.useRef<EventInput_rectangle>(null)
|
|
35
35
|
|
|
36
36
|
function loadButtonHistoryExist() {
|
|
37
37
|
new LibCurl('event_history_history_exists', null, (res, msg) => {
|
|
@@ -41,10 +41,22 @@ export default function m(props: EventVisitor_indexProps): any {
|
|
|
41
41
|
})
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
function loadCategories() {
|
|
45
|
+
new LibCurl('event_history_cat', null, (res, msg) => {
|
|
46
|
+
setTypes(res)
|
|
47
|
+
setActiveType(res?.[0])()
|
|
48
|
+
}, (error) => { })
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function buildUrl(type: any): string {
|
|
52
|
+
return type?.url || url
|
|
53
|
+
}
|
|
54
|
+
|
|
44
55
|
useEffect(() => {
|
|
56
|
+
loadCategories()
|
|
45
57
|
loadButtonHistoryExist()
|
|
58
|
+
|
|
46
59
|
if (argsCode) {
|
|
47
|
-
inputAccessCode?.current?.setText(argsCode)
|
|
48
60
|
LibUtils.debounce(() => {
|
|
49
61
|
doSubmit()
|
|
50
62
|
}, 200)
|
|
@@ -74,19 +86,15 @@ export default function m(props: EventVisitor_indexProps): any {
|
|
|
74
86
|
|
|
75
87
|
function doSubmit(): void {
|
|
76
88
|
if (!argsCode) {
|
|
77
|
-
|
|
78
|
-
LibToastProperty.show(esp.lang("event/visitor_index", "alert_error_not_empty_code"))
|
|
79
|
-
return
|
|
80
|
-
}
|
|
89
|
+
return
|
|
81
90
|
}
|
|
82
91
|
var post = {
|
|
83
|
-
access_code: argsCode
|
|
92
|
+
access_code: argsCode
|
|
84
93
|
}
|
|
85
94
|
LibProgress.show(esp.lang("event/visitor_index", "waiting_msg"))
|
|
86
95
|
new LibCurl('event_exhibitor_code', post, (res, msg) => {
|
|
87
96
|
setArgsCode(undefined) // reset code supaya pas textbox kosong tidak bisa submit
|
|
88
97
|
ref.current?.loadData()
|
|
89
|
-
inputAccessCode.current?.setText("")
|
|
90
98
|
if (res.hasOwnProperty('qty')) {
|
|
91
99
|
new LibCurl(res?.url, null, (result, msg) => {
|
|
92
100
|
LibNavigation.navigate('event/visitor_input', { data: result, msg: msg, url: res.url })
|
|
@@ -114,51 +122,45 @@ export default function m(props: EventVisitor_indexProps): any {
|
|
|
114
122
|
|
|
115
123
|
return (
|
|
116
124
|
<View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
|
|
117
|
-
<EventHeader title={esp.lang("event/visitor_index", "
|
|
125
|
+
<EventHeader title={esp.lang("event/visitor_index", "header_title")} />
|
|
126
|
+
<>
|
|
127
|
+
{
|
|
128
|
+
types && types?.length > 0 &&
|
|
129
|
+
<View style={[{ flexDirection: "row", alignItems: "center", marginHorizontal: 15, marginTop: 10 }]}>
|
|
130
|
+
{
|
|
131
|
+
types?.map?.((item: any, index: number) => {
|
|
132
|
+
const tabsLength = types?.length
|
|
133
|
+
const itemWidth = (LibStyle.width - 30) / tabsLength
|
|
134
|
+
return (
|
|
135
|
+
<Pressable key={index} onPress={() => {
|
|
136
|
+
setActiveType(item)()
|
|
137
|
+
}}>
|
|
138
|
+
<View key={index} style={applyStyle({ height: 43, width: itemWidth, alignItems: 'center', overflow: 'visible', justifyContent: 'center', backgroundColor: '#fff' })}>
|
|
139
|
+
<Text allowFontScaling={false} style={{
|
|
140
|
+
width: itemWidth, fontFamily: "Arial", fontSize: item?.type == activeType?.type ? 13 : 12,
|
|
141
|
+
fontWeight: item?.type == activeType?.type ? "bold" : "normal",
|
|
142
|
+
fontStyle: "normal", letterSpacing: 0, textAlign: "center",
|
|
143
|
+
color: item?.type == activeType?.type ? "#51b596" : "#c5c5c5"
|
|
144
|
+
}}>{item.title}</Text>
|
|
145
|
+
<View style={{ width: (itemWidth) - 20, height: 3, backgroundColor: item?.type == activeType?.type ? "#51b596" : "#fff", position: 'absolute', bottom: 0 }} />
|
|
146
|
+
</View>
|
|
147
|
+
</Pressable>
|
|
148
|
+
)
|
|
149
|
+
})
|
|
150
|
+
}
|
|
151
|
+
</View>
|
|
152
|
+
}
|
|
153
|
+
</>
|
|
118
154
|
<LibInfinite
|
|
119
155
|
ref={ref}
|
|
120
156
|
// isDebug={1}
|
|
121
|
-
|
|
122
|
-
<>
|
|
123
|
-
<View style={{ flexDirection: 'row', borderRadius: 10, backgroundColor: '#FEFBEB', borderColor: "#FFCC29", borderWidth: 1, borderStyle: 'dashed', alignContent: 'center', alignItems: 'center', margin: 15, marginBottom: 0, padding: 10 }}>
|
|
124
|
-
<Text allowFontScaling={false} style={{ flex: 1, fontFamily: "Arial", fontSize: 12, fontStyle: "normal", letterSpacing: 0 }} >{esp.lang("event/visitor_index", "please_input_your_exhibitor_code")}</Text>
|
|
125
|
-
</View>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
<View style={[{ margin: 15, backgroundColor: 'white', padding: 15, paddingTop: 8 }, LibStyle.elevation(2)]}>
|
|
129
|
-
<EventLabel_input label={esp.lang("event/visitor_index", "label_input_code")} mandatory />
|
|
130
|
-
<EventInput_rectangle
|
|
131
|
-
ref={inputAccessCode}
|
|
132
|
-
placeholder={esp.lang("event/visitor_index", "input_code")}
|
|
133
|
-
style={{ borderRadius: 3, height: 35 }}
|
|
134
|
-
autoCapitalize='characters'
|
|
135
|
-
returnKeyType='go'
|
|
136
|
-
onSubmitEditing={() => {
|
|
137
|
-
inputAccessCode.current!.blur()
|
|
138
|
-
doSubmit()
|
|
139
|
-
}}
|
|
140
|
-
blurOnSubmit
|
|
141
|
-
/>
|
|
142
|
-
|
|
143
|
-
<TouchableOpacity onPress={() => {
|
|
144
|
-
inputAccessCode.current!.blur()
|
|
145
|
-
doSubmit()
|
|
146
|
-
}}>
|
|
147
|
-
<View style={{ marginTop: 20, height: 35, borderRadius: 5, backgroundColor: "#6c432c", justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 }} >
|
|
148
|
-
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, textAlign: "center", textAlignVertical: 'center', color: 'white', marginRight: 13, marginLeft: 10 }} >{esp.lang("event/visitor_index", "submit")}</Text>
|
|
149
|
-
</View>
|
|
150
|
-
</TouchableOpacity>
|
|
151
|
-
</View>
|
|
152
|
-
|
|
153
|
-
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 14, margin: 15, marginBottom: 0 }} >{esp.lang("event/visitor_index", "history")}</Text>
|
|
154
|
-
</>
|
|
155
|
-
}
|
|
157
|
+
key={buildUrl(activeType)}
|
|
156
158
|
errorView={(err: any) => (
|
|
157
159
|
<View style={{ margin: 15 }}>
|
|
158
160
|
<EventMessage message={err} />
|
|
159
161
|
</View>
|
|
160
162
|
)}
|
|
161
|
-
url={
|
|
163
|
+
url={buildUrl(activeType)}
|
|
162
164
|
renderItem={renderItem}
|
|
163
165
|
ListEndedComponent={
|
|
164
166
|
esp.isDebug('') && isExist == 1 &&
|
|
@@ -170,6 +172,15 @@ export default function m(props: EventVisitor_indexProps): any {
|
|
|
170
172
|
}
|
|
171
173
|
/>
|
|
172
174
|
|
|
175
|
+
<TouchableOpacity onPress={() => {
|
|
176
|
+
LibNavigation.replace('bigbang/input_code')
|
|
177
|
+
}} 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)' }}>
|
|
178
|
+
<View style={{ padding: 5, backgroundColor: LibStyle.colorPrimary, ...LibStyle.elevation(3), borderRadius: 30, alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
|
|
179
|
+
<LibPicture source={esp.assets('icons/ic_input.png')} style={{ marginTop: 1, height: 13, width: 26 }} />
|
|
180
|
+
<Text allowFontScaling={false} style={{ fontWeight: 'bold', color: '#000', marginTop: 2, fontSize: 9 }}>{"Code"}</Text>
|
|
181
|
+
</View>
|
|
182
|
+
</TouchableOpacity>
|
|
183
|
+
|
|
173
184
|
</View >
|
|
174
185
|
)
|
|
175
186
|
}
|
package/id.json
CHANGED
|
@@ -469,6 +469,8 @@
|
|
|
469
469
|
"input_nominal": "masukkan nominal kupon",
|
|
470
470
|
"nominal_empty": "Nominal kupon tidak boleh kosong",
|
|
471
471
|
"quota_left": "sisa kuota generate",
|
|
472
|
+
"select_coupon": "Pilih kupon untuk dikirm",
|
|
473
|
+
"select_coupon_alert": "Silahkan pilih kupon terlebih dahulu",
|
|
472
474
|
"send_btn": "KIRIM",
|
|
473
475
|
"send_cancel": "BATAL",
|
|
474
476
|
"send_failed": "Terjadi Kesalahan",
|
|
@@ -1840,6 +1842,7 @@
|
|
|
1840
1842
|
"alert_error_not_empty_code": "Kode Tidak Boleh kosong",
|
|
1841
1843
|
"alert_success_submit": "Selamat!",
|
|
1842
1844
|
"err": "Kesalahan",
|
|
1845
|
+
"header_title": "Riwayat Akses",
|
|
1843
1846
|
"history": "History Staff/PIC/Exhibitor",
|
|
1844
1847
|
"input_code": "Masukkan Kode...",
|
|
1845
1848
|
"label_input_code": "Masukkan Kode",
|
package/package.json
CHANGED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// // useLibs
|
|
2
|
-
|
|
3
|
-
// import { UserClass } from 'esoftplay/cache/user/class/import';
|
|
4
|
-
// import { useEffect } from 'react';
|
|
5
|
-
// import { CaptureProtection } from 'react-native-capture-protection';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// export interface EventSecure_pageProps {
|
|
9
|
-
|
|
10
|
-
// }
|
|
11
|
-
// export default function m(): any {
|
|
12
|
-
// const can_screencapture = UserClass.state().get('config', 'can_screencapture')
|
|
13
|
-
// // const focus = useIsFocused()
|
|
14
|
-
|
|
15
|
-
// useEffect(() => {
|
|
16
|
-
// let subs: any
|
|
17
|
-
// if (!__DEV__)
|
|
18
|
-
// if (can_screencapture != 1) {
|
|
19
|
-
// CaptureProtection.prevent();
|
|
20
|
-
// // subs = RNPrevent?.addListener?.(() => { })
|
|
21
|
-
// }
|
|
22
|
-
// return () => {
|
|
23
|
-
// if (!__DEV__)
|
|
24
|
-
// if (can_screencapture != 1) {
|
|
25
|
-
// setTimeout(() => {
|
|
26
|
-
// CaptureProtection.allow();
|
|
27
|
-
// }, 500);
|
|
28
|
-
// // subs?.remove?.()
|
|
29
|
-
// }
|
|
30
|
-
// }
|
|
31
|
-
// }, [])
|
|
32
|
-
|
|
33
|
-
// return null
|
|
34
|
-
// }
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// // useLibs
|
|
2
|
-
|
|
3
|
-
// import { UserClass } from 'esoftplay/cache/user/class/import';
|
|
4
|
-
// import { useEffect } from 'react';
|
|
5
|
-
// import RNPrevent from "react-native-screenshot-prevent";
|
|
6
|
-
|
|
7
|
-
// export interface EventSecure_pageProps {
|
|
8
|
-
|
|
9
|
-
// }
|
|
10
|
-
// export default function m(): any {
|
|
11
|
-
// const can_screencapture = UserClass.state().get('config', 'can_screencapture')
|
|
12
|
-
// // const focus = useIsFocused()
|
|
13
|
-
|
|
14
|
-
// useEffect(() => {
|
|
15
|
-
// let subs: any
|
|
16
|
-
// if (!__DEV__)
|
|
17
|
-
// if (can_screencapture != 1) {
|
|
18
|
-
// RNPrevent?.enabled?.(true)
|
|
19
|
-
// RNPrevent?.enableSecureView?.()
|
|
20
|
-
// // subs = RNPrevent?.addListener?.(() => { })
|
|
21
|
-
// }
|
|
22
|
-
// return () => {
|
|
23
|
-
// if (!__DEV__)
|
|
24
|
-
// if (can_screencapture != 1) {
|
|
25
|
-
// setTimeout(() => {
|
|
26
|
-
// RNPrevent?.disableSecureView?.()
|
|
27
|
-
// RNPrevent?.enabled?.(false)
|
|
28
|
-
// }, 500)
|
|
29
|
-
// // subs?.remove?.()
|
|
30
|
-
// }
|
|
31
|
-
// }
|
|
32
|
-
// }, [])
|
|
33
|
-
|
|
34
|
-
// return null
|
|
35
|
-
// }
|