esoftplay-event 0.0.1 → 0.0.2
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/artist.tsx +11 -7
- package/event/artist_detail.tsx +3 -5
- package/event/artist_detailv2.tsx +386 -0
- package/event/artistv2.tsx +162 -0
- package/event/button_order_detail.tsx +43 -0
- package/event/countdown_base.tsx +16 -3
- package/event/countdown_event.tsx +47 -0
- package/event/detail.tsx +30 -37
- package/event/detail2.tsx +354 -0
- package/event/exchange_ticket.tsx +1 -1
- package/event/exchange_ticket_list.tsx +2 -3
- package/event/exchange_ticket_result.tsx +1 -1
- package/event/firebase_socket.ts +8 -0
- package/event/loading_page.tsx +4 -2
- package/event/order.tsx +23 -36
- package/event/order_detail.tsx +119 -41
- package/event/order_detail_upgrade.tsx +8 -5
- package/event/order_detail_upgrade_payment.tsx +17 -11
- package/event/order_detail_visitor.tsx +33 -33
- package/event/order_detail_waiting.tsx +45 -20
- package/event/order_item.tsx +1 -1
- package/event/order_lottery.tsx +48 -36
- package/event/order_reschedule.tsx +50 -52
- package/event/order_share_to.tsx +11 -24
- package/event/order_share_to_detail.tsx +8 -3
- package/event/order_waiting.tsx +1 -1
- package/event/queue_pricing.tsx +16 -3
- package/event/refresh_button.tsx +3 -5
- package/event/scan_item.tsx +2 -2
- package/event/seat.tsx +19 -11
- package/event/seat_map_new.tsx +313 -0
- package/event/secure_page.debug.tsx +34 -0
- package/event/secure_page.live.tsx +35 -0
- package/event/secure_page.tsx +6 -5
- package/event/test.tsx +240 -155
- package/event/ticket_list.tsx +49 -21
- package/event/ticket_list2.tsx +83 -34
- package/event/tms_check_code.tsx +6 -0
- package/event/tms_check_ticket_result.tsx +36 -7
- package/event/tms_dashboard.tsx +85 -3
- package/event/tms_gate.tsx +6 -0
- package/event/tms_home.tsx +1 -4
- package/event/tms_in_failed.tsx +1 -1
- package/event/tms_in_log.tsx +2 -0
- package/event/tms_in_success.tsx +1 -1
- package/event/tms_log.tsx +10 -25
- package/event/tms_out.tsx +1 -1
- package/event/tms_out_failed.tsx +1 -1
- package/event/visitor_input.tsx +23 -5
- package/event/visitor_inputv2.tsx +397 -0
- package/event/voucher.tsx +2 -0
- package/event/voucher2.tsx +14 -6
- package/id.json +25 -9
- package/package.json +1 -1
- package/event/entrance.tsx +0 -215
- package/event/entrance_again.tsx +0 -199
- package/event/entrance_failed.tsx +0 -190
- package/event/entrance_idcard.tsx +0 -199
- package/event/entrance_list.tsx +0 -264
- package/event/entrance_list_item.tsx +0 -88
- package/event/entrance_log.tsx +0 -130
- package/event/entrance_success.tsx +0 -153
- package/event/entrance_warning.tsx +0 -91
- package/event/exit.tsx +0 -91
- package/event/exit_failed.tsx +0 -135
- package/event/exit_list.tsx +0 -118
- package/event/exit_log.tsx +0 -130
- package/event/exit_success.tsx +0 -143
- package/event/exit_temporary.tsx +0 -226
- package/event/firebase_socket.debug.ts +0 -260
- package/event/firebase_socket.live.ts +0 -335
- package/event/hall_in.tsx +0 -148
- package/event/hall_in_failed.tsx +0 -270
- package/event/hall_in_list.tsx +0 -222
- package/event/hall_in_log.tsx +0 -134
- package/event/hall_in_success.tsx +0 -132
- package/event/hall_out.tsx +0 -143
- package/event/hall_out_failed.tsx +0 -133
- package/event/hall_out_list.tsx +0 -215
- package/event/hall_out_log.tsx +0 -133
- package/event/hall_out_success.tsx +0 -130
- package/event/log.tsx +0 -433
- package/event/seat_map_test.tsx +0 -401
package/event/tms_log.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { useEffect, useRef } from 'react';
|
|
|
3
3
|
|
|
4
4
|
import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
5
5
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
6
|
+
import { EventTms_dashboardProperty } from 'esoftplay/cache/event/tms_dashboard/import';
|
|
6
7
|
import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
|
|
7
8
|
import { EventTms_in_hall_log } from 'esoftplay/cache/event/tms_in_hall_log/import';
|
|
8
9
|
import { EventTms_in_hall_successProperty } from 'esoftplay/cache/event/tms_in_hall_success/import';
|
|
@@ -48,17 +49,6 @@ export interface LogItem {
|
|
|
48
49
|
valuecolor?: string
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
function Item(props: LogItem) {
|
|
52
|
-
return (
|
|
53
|
-
<Pressable
|
|
54
|
-
onPress={() => {
|
|
55
|
-
props.onPress()
|
|
56
|
-
}} style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center', marginHorizontal: 15, paddingVertical: 6, borderBottomWidth: 1, borderBottomColor: LibStyle.colorLightGrey }}>
|
|
57
|
-
<LibTextstyle text={props.text} textStyle="subhead" />
|
|
58
|
-
<LibTextstyle text={LibUtils.number(props.value)} style={{ color: props.valuecolor ? props.valuecolor : "#000" }} textStyle="title2" />
|
|
59
|
-
</Pressable>
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
52
|
|
|
63
53
|
// Fungsi untuk menjumlahkan nilai per kategori
|
|
64
54
|
export function sumValuesPerCategory(data: any) {
|
|
@@ -105,12 +95,15 @@ const useDetectStateChange = (state: any, duration: number) => {
|
|
|
105
95
|
|
|
106
96
|
export default function m(props: EventTms_logProps): any {
|
|
107
97
|
const selectedRef = useRef<LibSlidingup>(null)
|
|
108
|
-
const { event_id, gate
|
|
98
|
+
// const { event_id, gate }: any = LibNavigation.getArgsAll(props)
|
|
109
99
|
const [, setSelectedData, getSelectedData] = useSafeState<any[]>([])
|
|
110
100
|
const [titleSliding, setTitleSliding] = useSafeState()
|
|
111
101
|
let counter = useRef(0).current
|
|
112
102
|
let counterDone = useRef(0).current
|
|
113
103
|
|
|
104
|
+
const event_id = EventTms_dashboardProperty?.closingDataState()?.get().event_id
|
|
105
|
+
const gate_id = EventTms_dashboardProperty?.closingDataState()?.get().gate_id
|
|
106
|
+
|
|
114
107
|
const backupEntrance = EventTms_in_successProperty.syncUsedTiket().useSelector(s => s)
|
|
115
108
|
const isStuckEntrance = useDetectStateChange(backupEntrance, 10000)
|
|
116
109
|
|
|
@@ -147,7 +140,7 @@ export default function m(props: EventTms_logProps): any {
|
|
|
147
140
|
|
|
148
141
|
function closing() {
|
|
149
142
|
const counter = EventTms_homeProperty.getDataByDate()
|
|
150
|
-
let url = 'event_tms_closing' + LibUtils.objectToUrlParam({ event_id: event_id, gate_id:
|
|
143
|
+
let url = 'event_tms_closing' + LibUtils.objectToUrlParam({ event_id: event_id, gate_id: gate_id })
|
|
151
144
|
let post = {
|
|
152
145
|
closing: JSON.stringify(counter)
|
|
153
146
|
}
|
|
@@ -285,9 +278,7 @@ export default function m(props: EventTms_logProps): any {
|
|
|
285
278
|
sendFileTelegram('event/tms_in_log_copy_scanned', () => {
|
|
286
279
|
counterDone = counterDone + 1
|
|
287
280
|
if (counter == counterDone) {
|
|
288
|
-
|
|
289
|
-
closing()
|
|
290
|
-
}
|
|
281
|
+
closing()
|
|
291
282
|
}
|
|
292
283
|
})
|
|
293
284
|
})
|
|
@@ -299,9 +290,7 @@ export default function m(props: EventTms_logProps): any {
|
|
|
299
290
|
sendFileTelegram('event/tms_out_log_copy_scanned', () => {
|
|
300
291
|
counterDone = counterDone + 1
|
|
301
292
|
if (counter == counterDone) {
|
|
302
|
-
|
|
303
|
-
closing()
|
|
304
|
-
}
|
|
293
|
+
closing()
|
|
305
294
|
}
|
|
306
295
|
})
|
|
307
296
|
})
|
|
@@ -313,9 +302,7 @@ export default function m(props: EventTms_logProps): any {
|
|
|
313
302
|
sendFileTelegram('event/hall_log_copy_scanned', () => {
|
|
314
303
|
counterDone = counterDone + 1
|
|
315
304
|
if (counter == counterDone) {
|
|
316
|
-
|
|
317
|
-
closing()
|
|
318
|
-
}
|
|
305
|
+
closing()
|
|
319
306
|
}
|
|
320
307
|
})
|
|
321
308
|
})
|
|
@@ -327,9 +314,7 @@ export default function m(props: EventTms_logProps): any {
|
|
|
327
314
|
sendFileTelegram('event/hallout_log_copy_scanned', () => {
|
|
328
315
|
counterDone = counterDone + 1
|
|
329
316
|
if (counter == counterDone) {
|
|
330
|
-
|
|
331
|
-
closing()
|
|
332
|
-
}
|
|
317
|
+
closing()
|
|
333
318
|
}
|
|
334
319
|
})
|
|
335
320
|
})
|
package/event/tms_out.tsx
CHANGED
|
@@ -71,7 +71,7 @@ export default function m(props: EventTms_outProps): any {
|
|
|
71
71
|
gate_id: selectGate?.id,
|
|
72
72
|
trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
|
|
73
73
|
price_id: modifyList?.filter((item: any) => item.checked == 1).map((it: any) => it.price_id),
|
|
74
|
-
scanned_out: LibUtils.moment().
|
|
74
|
+
scanned_out: LibUtils.moment().localeFormat('YYYY-MM-DD HH:mm:ss'),
|
|
75
75
|
}
|
|
76
76
|
let urlOut = "event_tms_out_confirm"
|
|
77
77
|
LibNavigation.replace('event/tms_out_success', { data: finalData, ...args, url: urlOut, post: postOut })
|
package/event/tms_out_failed.tsx
CHANGED
|
@@ -104,7 +104,7 @@ export default function m(props: EventTms_out_failedProps): any {
|
|
|
104
104
|
<View style={{ flex: 1, justifyContent: 'center', paddingVertical: 5 }}>
|
|
105
105
|
{
|
|
106
106
|
item.scanned != "0000-00-00 00:00:00" &&
|
|
107
|
-
<Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 12 }}>{LibUtils.moment(item.hall_scanned).localeFormat("DD MMM H:mm:ss ")}</Text>
|
|
107
|
+
<Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 12 }}>{LibUtils.moment(item.hall_scanned).localeFormat("DD MMM H:mm:ss ") + (item.timezone_locale != "" ? item.timezone_locale : "")}</Text>
|
|
108
108
|
}
|
|
109
109
|
</View>
|
|
110
110
|
</View>
|
package/event/visitor_input.tsx
CHANGED
|
@@ -23,6 +23,7 @@ import { useRef } from 'react';
|
|
|
23
23
|
import { applyStyle } from 'esoftplay';
|
|
24
24
|
import { EventInput_rectangle } from 'esoftplay/cache/event/input_rectangle/import';
|
|
25
25
|
import { EventLabel_input } from 'esoftplay/cache/event/label_input/import';
|
|
26
|
+
import { UserClass } from 'esoftplay/cache/user/class/import';
|
|
26
27
|
import useLazyState from 'esoftplay/lazy';
|
|
27
28
|
import React, { useEffect } from 'react';
|
|
28
29
|
import { ActivityIndicator, Platform, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
@@ -53,10 +54,12 @@ export default function m(props: EventVisitor_inputProps): any {
|
|
|
53
54
|
return (name) => inputsState.set(LibObject.set(inputsState.get(), name)(list_id))
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
// esp.log(url_invitation);
|
|
57
|
-
|
|
58
57
|
useEffect(() => {
|
|
59
|
-
|
|
58
|
+
if (UserClass.state().get().email == 'bagus@fisip.net') {
|
|
59
|
+
LibNavigation.replace('event/visitor_inputv2', { data: _data, url: url })
|
|
60
|
+
} else {
|
|
61
|
+
loadData()
|
|
62
|
+
}
|
|
60
63
|
}, [])
|
|
61
64
|
|
|
62
65
|
function loadData(): void {
|
|
@@ -115,8 +118,11 @@ export default function m(props: EventVisitor_inputProps): any {
|
|
|
115
118
|
setCounter(counter + 1)
|
|
116
119
|
}}>
|
|
117
120
|
<View style={applyStyle({ height: 35, width: LibStyle.width / 4, alignItems: 'center', overflow: 'visible', justifyContent: 'center', backgroundColor: '#fff' })}>
|
|
118
|
-
<
|
|
119
|
-
|
|
121
|
+
<View style={{ width: LibStyle.width / 4, }}>
|
|
122
|
+
<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
|
+
<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
|
+
</View>
|
|
125
|
+
<View style={applyStyle({ width: (LibStyle.width / 4) - 20, height: 3, backgroundColor: activeTab?.id == item?.id ? "#51b596" : "#fff", position: 'absolute', bottom: -1 })} />
|
|
120
126
|
</View>
|
|
121
127
|
</TouchableOpacity>
|
|
122
128
|
)
|
|
@@ -225,6 +231,8 @@ export default function m(props: EventVisitor_inputProps): any {
|
|
|
225
231
|
)
|
|
226
232
|
}
|
|
227
233
|
|
|
234
|
+
// esp.log(_tabs);
|
|
235
|
+
|
|
228
236
|
return (
|
|
229
237
|
<View style={{ flex: 1 }}>
|
|
230
238
|
<EventHeader title={esp.lang("event/visitor_input", "title_input_exhibitor")} subtitle={esp.lang("event/visitor_input", "total_staff", LibUtils.number(data.qty))} />
|
|
@@ -244,6 +252,16 @@ export default function m(props: EventVisitor_inputProps): any {
|
|
|
244
252
|
// isDebug={1}
|
|
245
253
|
key={activeTab + counter}
|
|
246
254
|
// style={{ flex: 1 }}
|
|
255
|
+
ListHeaderComponent={
|
|
256
|
+
<>
|
|
257
|
+
{
|
|
258
|
+
activeTab?.ondate != "0000-00-00" &&
|
|
259
|
+
<View style={{ margin: 15, marginBottom: 0 }}>
|
|
260
|
+
<Text allowFontScaling={false} style={{ fontWeight: 'bold', color: LibStyle.colorGreen }}>{"Tanggal berlaku " + LibUtils.moment(activeTab?.ondate).format("DD MMMM YYYY")}</Text>
|
|
261
|
+
</View>
|
|
262
|
+
}
|
|
263
|
+
</>
|
|
264
|
+
}
|
|
247
265
|
removeClippedSubviews={Platform.OS == 'android'}
|
|
248
266
|
renderItem={renderItem}
|
|
249
267
|
/>
|
|
@@ -0,0 +1,397 @@
|
|
|
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
|
+
|
|
50
|
+
const dialogListClaim = useRef<LibSlidingup>(null)
|
|
51
|
+
const dialogClaim = useRef<LibSlidingup>(null)
|
|
52
|
+
|
|
53
|
+
let _tabs: any = getData()?.list
|
|
54
|
+
function setText(list_id: string): (name: string) => void {
|
|
55
|
+
return (name) => inputsState.set(LibObject.set(inputsState.get(), name)(list_id))
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
loadData()
|
|
60
|
+
}, [])
|
|
61
|
+
|
|
62
|
+
function loadData(): void {
|
|
63
|
+
new LibCurl(url, null, (result, msg) => {
|
|
64
|
+
set_msg(msg)
|
|
65
|
+
if (result?.hasOwnProperty('url_generate')) {
|
|
66
|
+
generateCode(result?.url_generate, true)
|
|
67
|
+
} else {
|
|
68
|
+
setData(result)()
|
|
69
|
+
}
|
|
70
|
+
}, (error) => {
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function generateCode(url: string, loop: boolean) {
|
|
75
|
+
if (loop) {
|
|
76
|
+
new LibCurl(url, null, (res, msg) => {
|
|
77
|
+
generateCode(url, res?.done == 1 ? false : true)
|
|
78
|
+
setMessageGenerate(msg)
|
|
79
|
+
}, (error) => {
|
|
80
|
+
LibDialog.warningConfirm(esp.lang("event/visitor_input", "title"), error?.message, esp.lang("event/visitor_input", "resend"), () => {
|
|
81
|
+
loadData()
|
|
82
|
+
}, esp.lang("event/visitor_input", "back"), () => LibNavigation.back())
|
|
83
|
+
})
|
|
84
|
+
} else {
|
|
85
|
+
loadData()
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function send(): void {
|
|
90
|
+
var post: any = undefined
|
|
91
|
+
const inputs = inputsState.get()
|
|
92
|
+
post = {
|
|
93
|
+
name: Object.values(inputs).join("|"),
|
|
94
|
+
list_id: Object.keys(inputs).join("|")
|
|
95
|
+
}
|
|
96
|
+
LibDialog.confirm(esp.lang("event/visitor_input", "confirm_title"), esp.lang("event/visitor_input", "confirm_msg"), esp.lang("event/visitor_input", "confirm_ok"), () => {
|
|
97
|
+
LibProgress.show(esp.lang("event/visitor_input", "confirm_wait"))
|
|
98
|
+
new LibCurl('event_exhibitor_staff?contact_id=' + data.contact_id, post, (res, msg) => {
|
|
99
|
+
LibProgress.hide()
|
|
100
|
+
LibDialog.info(esp.lang("event/visitor_input", "confirm_success"), msg);
|
|
101
|
+
LibNavigation.reset()
|
|
102
|
+
// BigbangIndexProperty.setTab(0)
|
|
103
|
+
// LibNavigation.navigate('bigbang/notif_index', { tabIndex: 0 }) // ini notifnya di perbarui
|
|
104
|
+
}, (error) => {
|
|
105
|
+
LibProgress.hide()
|
|
106
|
+
LibDialog.warning(esp.lang("event/visitor_input", "confirm_failed"), error?.message)
|
|
107
|
+
})
|
|
108
|
+
}, esp.lang("event/visitor_input", "confirm_cancel"), () => { })
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function renderTabs(item: any, i: number) {
|
|
112
|
+
return (
|
|
113
|
+
<TouchableOpacity key={i} onPress={() => {
|
|
114
|
+
setActiveTab(item)
|
|
115
|
+
setCounter(counter + 1)
|
|
116
|
+
}}>
|
|
117
|
+
<View style={applyStyle({ height: 35, width: LibStyle.width / 4, alignItems: 'center', overflow: 'visible', justifyContent: 'center', backgroundColor: '#fff' })}>
|
|
118
|
+
<View style={{ width: LibStyle.width / 4, }}>
|
|
119
|
+
<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>
|
|
120
|
+
<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>
|
|
121
|
+
</View>
|
|
122
|
+
<View style={applyStyle({ width: (LibStyle.width / 4) - 20, height: 3, backgroundColor: activeTab?.id == item?.id ? "#51b596" : "#fff", position: 'absolute', bottom: -1 })} />
|
|
123
|
+
</View>
|
|
124
|
+
</TouchableOpacity>
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function renderItem(item: any, i: any) {
|
|
129
|
+
if (activeTab?.type == "INVITE") {
|
|
130
|
+
let bgColor = Number(item.qty_used) != Number(item.qty) ? "#fff" : LibStyle.colorBgGrey
|
|
131
|
+
let borderColor = Number(item.qty_used) != Number(item.qty) ? LibStyle.colorBgGrey : "#fff"
|
|
132
|
+
return (
|
|
133
|
+
<View style={{ margin: 15, marginBottom: 0, padding: 10, borderWidth: 1.5, backgroundColor: bgColor, borderColor: borderColor, borderRadius: 5 }}>
|
|
134
|
+
<View style={{ flexDirection: 'row', flex: 1, justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' }}>
|
|
135
|
+
<Text allowFontScaling={false} style={{ fontFamily: "SFProText", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4b4b4b", }}>
|
|
136
|
+
{esp.lang("event/visitor_input", "code_inv") + (i + 1)}
|
|
137
|
+
</Text>
|
|
138
|
+
{
|
|
139
|
+
item.hasOwnProperty("url") && item.qty_used != 0 &&
|
|
140
|
+
|
|
141
|
+
<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>
|
|
142
|
+
// <View style={{ padding: 5, borderWidth: 1, borderColor: LibStyle.colorPrimary, borderRadius: 5 }}>
|
|
143
|
+
// </View>
|
|
144
|
+
}
|
|
145
|
+
<TouchableOpacity activeOpacity={item.name == "" ? 0 : 1} onPress={() => {
|
|
146
|
+
if (Number(item.qty_used) != Number(item.qty)) {
|
|
147
|
+
LibUtils.copyToClipboard(item.access_code)
|
|
148
|
+
LibToastProperty.show(esp.lang("event/visitor_input", "success_copy", item.access_code))
|
|
149
|
+
}
|
|
150
|
+
}}>
|
|
151
|
+
<View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
|
|
152
|
+
<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>
|
|
153
|
+
<LibIcon.Ionicons name='copy' size={16} style={applyStyle({ color: Number(item.qty_used) == Number(item.qty) ? "#c4c4c4" : "#2980b9", marginLeft: 7 })} />
|
|
154
|
+
</View>
|
|
155
|
+
</TouchableOpacity>
|
|
156
|
+
</View>
|
|
157
|
+
{
|
|
158
|
+
item.hasOwnProperty("name") &&
|
|
159
|
+
<Text allowFontScaling={false} style={{ marginTop: 5, fontFamily: "SFProText", color: '#4b4b4b' }}>{item?.name == "" ? esp.lang("event/visitor_input", "not_claimed") : item.name}</Text>
|
|
160
|
+
}
|
|
161
|
+
{
|
|
162
|
+
item.hasOwnProperty("url") &&
|
|
163
|
+
<View style={{ marginTop: 5, flexDirection: 'row', flex: 1 }}>
|
|
164
|
+
{
|
|
165
|
+
item.qty_used == 0 ?
|
|
166
|
+
<Text allowFontScaling={false} style={{ fontFamily: "SFProText", color: '#4b4b4b' }}>{esp.lang("event/visitor_input", "not_claimed")}</Text>
|
|
167
|
+
:
|
|
168
|
+
<View>
|
|
169
|
+
{/* <Text allowFontScaling={false} style={{ fontFamily: "SFProText", color: '#4b4b4b', marginBottom: 5 }}>{LibUtils.number(item.qty_used) + " sudah diklaim"}</Text> */}
|
|
170
|
+
<TouchableOpacity onPress={() => {
|
|
171
|
+
setListClaim(item)
|
|
172
|
+
LibUtils.debounce(() => {
|
|
173
|
+
dialogListClaim?.current?.show()
|
|
174
|
+
}, 200)
|
|
175
|
+
}} style={{ paddingHorizontal: 7, paddingVertical: 5, borderRadius: 5, borderWidth: 1, borderColor: LibStyle.colorBlue }}>
|
|
176
|
+
<Text allowFontScaling={false} style={{ color: LibStyle.colorBlue, fontWeight: 'bold', fontSize: 12 }}>{esp.lang("event/visitor_input", "see_list_claimed")}</Text>
|
|
177
|
+
</TouchableOpacity>
|
|
178
|
+
</View>
|
|
179
|
+
}
|
|
180
|
+
</View>
|
|
181
|
+
}
|
|
182
|
+
</View>
|
|
183
|
+
)
|
|
184
|
+
} else {
|
|
185
|
+
return (
|
|
186
|
+
<View style={{ margin: 10, marginBottom: 0, padding: 10, borderRadius: 5, borderWidth: 1, borderColor: LibStyle.colorBgGrey }}>
|
|
187
|
+
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center', }}>
|
|
188
|
+
<TouchableOpacity onPress={() => {
|
|
189
|
+
LibUtils.copyToClipboard(item.access_code)
|
|
190
|
+
LibToastProperty.show(esp.lang("event/visitor_input", "success_copy", item.access_code))
|
|
191
|
+
}} style={{ flex: 1, flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
|
|
192
|
+
<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>
|
|
193
|
+
<LibIcon.Ionicons name='copy' size={16} style={applyStyle({ color: item.is_used == 1 ? "#c4c4c4" : "#2980b9", marginLeft: 7 })} />
|
|
194
|
+
</TouchableOpacity>
|
|
195
|
+
<View style={{ flex: 1, justifyContent: 'flex-end', flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
|
|
196
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 13, fontWeight: "normal", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#9b9b9b", }}>{"Belum digunakan"}</Text>
|
|
197
|
+
<TouchableOpacity onPress={() => {
|
|
198
|
+
dialogClaim?.current?.show()
|
|
199
|
+
setSelectedCode(item)
|
|
200
|
+
}}>
|
|
201
|
+
<LibIcon name='pencil-circle' size={20} color={LibStyle.colorRed} style={{ marginLeft: 5 }} />
|
|
202
|
+
</TouchableOpacity>
|
|
203
|
+
</View>
|
|
204
|
+
</View>
|
|
205
|
+
<View style={{ padding: 10, borderWidth: 1, borderColor: LibStyle.colorBgGrey, borderRadius: 5, marginTop: 5 }}>
|
|
206
|
+
|
|
207
|
+
</View>
|
|
208
|
+
</View>
|
|
209
|
+
)
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
if (Number(getData()?.qty_generated) != Number(getData()?.qty)) {
|
|
214
|
+
return (
|
|
215
|
+
<View style={{ flex: 1, backgroundColor: '#fff' }}>
|
|
216
|
+
<EventHeader title={esp.lang("event/visitor_input", "title_input_exhibitors")} />
|
|
217
|
+
<View style={{ backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center' }}>
|
|
218
|
+
<View style={{ justifyContent: 'center', alignItems: 'center', padding: 10 }}>
|
|
219
|
+
<LibPicture source={esp.assets('img_failed_msg.png')} resizeMode="contain" style={{ width: LibStyle.width * 0.8, height: 200, resizeMode: 'contain' }} />
|
|
220
|
+
<ActivityIndicator size={'large'} color={LibStyle.colorPrimary} style={{ alignItems: 'center', justifyContent: 'center' }} />
|
|
221
|
+
<View style={{ width: LibStyle.width - 40, justifyContent: 'center', alignItems: 'center', backgroundColor: 'white', padding: 15, borderRadius: 10, marginTop: 20 }}>
|
|
222
|
+
<Text allowFontScaling={false} style={{ fontFamily: 'Arial', fontSize: 16, fontWeight: "bold", marginBottom: 5, color: "#4a4a4a", textAlign: "center" }}>{_msg}</Text>
|
|
223
|
+
</View>
|
|
224
|
+
<Text allowFontScaling={false} style={{ textAlign: 'center', fontFamily: "Arial", fontSize: 14, margin: 15, marginBottom: 0 }} >{messageGenerate}</Text>
|
|
225
|
+
</View>
|
|
226
|
+
</View>
|
|
227
|
+
</View>
|
|
228
|
+
)
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
let menuHeader = [
|
|
232
|
+
{
|
|
233
|
+
id: 1,
|
|
234
|
+
title: activeTab?.name,
|
|
235
|
+
color: '#d3f1ec',
|
|
236
|
+
textColor: '#4fbaa8',
|
|
237
|
+
total: LibUtils.number(activeTab?.qty)
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
id: 2,
|
|
241
|
+
title: "Total Token",
|
|
242
|
+
color: '#d7edf8',
|
|
243
|
+
textColor: '#64b0e0',
|
|
244
|
+
total: 4275
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
id: 3,
|
|
248
|
+
title: "Token dialokasikan",
|
|
249
|
+
color: '#fbe3dd',
|
|
250
|
+
textColor: '#ec7463',
|
|
251
|
+
total: 4170
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
id: 4,
|
|
255
|
+
title: "Token tersisa",
|
|
256
|
+
color: '#fef2de',
|
|
257
|
+
textColor: '#f6c67f',
|
|
258
|
+
total: 105
|
|
259
|
+
},
|
|
260
|
+
]
|
|
261
|
+
|
|
262
|
+
return (
|
|
263
|
+
<View style={{ flex: 1 }}>
|
|
264
|
+
<EventHeader title={esp.lang("event/visitor_input", "title_input_exhibitor")} subtitle={esp.lang("event/visitor_input", "total_staff", LibUtils.number(data.qty))} />
|
|
265
|
+
<LibKeyboard_avoid style={{ flex: 1 }}>
|
|
266
|
+
<>
|
|
267
|
+
{/* <ComponentTabheader titles={tabTitles} activeIndex={tabIndex} onPress={(index) => setTabIndex(index)} /> */}
|
|
268
|
+
|
|
269
|
+
<View style={{ height: 35, marginBottom: 2, flexDirection: 'row', backgroundColor: '#fff', ...LibStyle.elevation(2) }} >
|
|
270
|
+
<ScrollView horizontal showsHorizontalScrollIndicator={false} >
|
|
271
|
+
{
|
|
272
|
+
_tabs.map(renderTabs)
|
|
273
|
+
}
|
|
274
|
+
</ScrollView>
|
|
275
|
+
</View>
|
|
276
|
+
<LibInfinite
|
|
277
|
+
url={activeTab?.url}
|
|
278
|
+
// isDebug={1}
|
|
279
|
+
key={activeTab + counter}
|
|
280
|
+
// style={{ flex: 1 }}
|
|
281
|
+
ListHeaderComponent={
|
|
282
|
+
<>
|
|
283
|
+
{
|
|
284
|
+
activeTab?.ondate != "0000-00-00" &&
|
|
285
|
+
<View style={{ margin: 10, marginBottom: 0 }}>
|
|
286
|
+
<Text allowFontScaling={false} style={{ fontWeight: 'bold', color: LibStyle.colorGreen }}>{"Tanggal berlaku " + LibUtils.moment(activeTab?.ondate).format("DD MMMM YYYY")}</Text>
|
|
287
|
+
</View>
|
|
288
|
+
}
|
|
289
|
+
{
|
|
290
|
+
activeTab?.type == "STAFF" &&
|
|
291
|
+
<View style={{ padding: 10, paddingBottom: 0, flexDirection: 'row', justifyContent: 'space-between', flexWrap: 'wrap' }}>
|
|
292
|
+
{
|
|
293
|
+
menuHeader?.map((item, i) => {
|
|
294
|
+
return (
|
|
295
|
+
<View key={i} style={{ width: (LibStyle.width - 30) / 2, alignContent: 'center', alignItems: 'center', marginBottom: 10, overflow: 'hidden', backgroundColor: item.color, borderRadius: 5, padding: 5, flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
296
|
+
<View style={{ flex: 2, }}>
|
|
297
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4b4b4b" }}>{item.title}</Text>
|
|
298
|
+
</View>
|
|
299
|
+
<View style={{ marginLeft: 5, flex: 1 }}>
|
|
300
|
+
<View style={{ alignContent: 'center', alignItems: 'center', backgroundColor: item.textColor, paddingHorizontal: 7, paddingVertical: 3, borderRadius: 5 }}>
|
|
301
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{item.total}</Text>
|
|
302
|
+
</View>
|
|
303
|
+
</View>
|
|
304
|
+
</View>
|
|
305
|
+
)
|
|
306
|
+
})
|
|
307
|
+
}
|
|
308
|
+
</View>
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
</>
|
|
312
|
+
}
|
|
313
|
+
removeClippedSubviews={Platform.OS == 'android'}
|
|
314
|
+
renderItem={renderItem}
|
|
315
|
+
/>
|
|
316
|
+
{
|
|
317
|
+
activeTab?.type == "STAFF" &&
|
|
318
|
+
<EventButton style={{ backgroundColor: '#00b894', margin: 5 }} label={esp.lang("event/visitor_input", "save_btn")} onPress={() => { send() }} />
|
|
319
|
+
}
|
|
320
|
+
</>
|
|
321
|
+
</LibKeyboard_avoid>
|
|
322
|
+
<LibSlidingup ref={dialogListClaim}>
|
|
323
|
+
<View style={{ backgroundColor: 'white', padding: 15, height: LibStyle.height * 0.7, borderTopLeftRadius: 5, borderTopRightRadius: 5 }} >
|
|
324
|
+
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' }}>
|
|
325
|
+
<LibTextstyle text={esp.lang("event/visitor_input", "list_claimed")} textStyle="headline" />
|
|
326
|
+
<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>
|
|
327
|
+
</View>
|
|
328
|
+
<LibInfinite
|
|
329
|
+
url={listClaim?.url}
|
|
330
|
+
// isDebug={1}
|
|
331
|
+
// key={}
|
|
332
|
+
removeClippedSubviews={Platform.OS == 'android'}
|
|
333
|
+
renderItem={(item: any, i: number) => {
|
|
334
|
+
return (
|
|
335
|
+
<View key={i} style={{ padding: 10, borderBottomWidth: 1.5, borderBottomColor: LibStyle.colorBgGrey, flexDirection: 'row' }}>
|
|
336
|
+
<Text allowFontScaling={false} style={{ fontSize: 16 }}>{(i + 1) + ". "}</Text>
|
|
337
|
+
<View>
|
|
338
|
+
<Text allowFontScaling={false} numberOfLines={2} ellipsizeMode='tail' style={{ fontSize: 16 }}>{item.name}</Text>
|
|
339
|
+
<Text allowFontScaling={false} numberOfLines={2} ellipsizeMode='tail'>{item.email}</Text>
|
|
340
|
+
</View>
|
|
341
|
+
</View>
|
|
342
|
+
)
|
|
343
|
+
}}
|
|
344
|
+
/>
|
|
345
|
+
</View>
|
|
346
|
+
</LibSlidingup>
|
|
347
|
+
|
|
348
|
+
<LibSlidingup ref={dialogClaim}>
|
|
349
|
+
<View style={{ backgroundColor: 'white', padding: 15, maxHeight: LibStyle.height * 0.7, borderTopLeftRadius: 5, borderTopRightRadius: 5 }} >
|
|
350
|
+
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' }}>
|
|
351
|
+
<LibTextstyle text={"Kode"} textStyle="headline" />
|
|
352
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#00b894" }}>{selectedCode?.access_code}</Text>
|
|
353
|
+
</View>
|
|
354
|
+
|
|
355
|
+
<EventLabel_input label={"Masukkan nama"} />
|
|
356
|
+
<EventInput_rectangle
|
|
357
|
+
returnKeyType="next"
|
|
358
|
+
style={applyStyle({ borderRadius: 4, borderColor: '#c4c4c4', height: 35, marginTop: 8, backgroundColor: '#fff' })}
|
|
359
|
+
onChangeText={(t) => {
|
|
360
|
+
|
|
361
|
+
}}
|
|
362
|
+
placeholder={"Masukkan nama"}
|
|
363
|
+
/>
|
|
364
|
+
|
|
365
|
+
<View style={{ flexDirection: 'row', justifyContent: 'flex-end', alignContent: 'center', alignItems: 'center' }}>
|
|
366
|
+
<View style={{ flex: 2 }}>
|
|
367
|
+
<EventLabel_input label={"Masukkan token"} />
|
|
368
|
+
<EventInput_rectangle
|
|
369
|
+
returnKeyType="next"
|
|
370
|
+
style={applyStyle({ borderRadius: 4, borderColor: '#c4c4c4', height: 35, marginTop: 8, backgroundColor: '#fff' })}
|
|
371
|
+
onChangeText={(t) => {
|
|
372
|
+
|
|
373
|
+
}}
|
|
374
|
+
placeholder={"Masukkan token"}
|
|
375
|
+
/>
|
|
376
|
+
</View>
|
|
377
|
+
<View style={{ flex: 1, justifyContent: 'flex-end', marginLeft: 10, marginTop: 5 }}>
|
|
378
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4b4b4b" }}>{"Token terpakai"}</Text>
|
|
379
|
+
<View style={{ marginTop: 12, alignContent: 'center', alignItems: 'center', backgroundColor: "#ec7463", paddingHorizontal: 7, paddingVertical: 3, borderRadius: 5 }}>
|
|
380
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{10}</Text>
|
|
381
|
+
</View>
|
|
382
|
+
</View>
|
|
383
|
+
<View style={{ flex: 1, justifyContent: 'flex-end', marginLeft: 10, marginTop: 5 }}>
|
|
384
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4b4b4b" }}>{"Token tersisa"}</Text>
|
|
385
|
+
<View style={{ marginTop: 12, alignContent: 'center', alignItems: 'center', backgroundColor: "#f6c67f", paddingHorizontal: 7, paddingVertical: 3, borderRadius: 5 }}>
|
|
386
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{120}</Text>
|
|
387
|
+
</View>
|
|
388
|
+
</View>
|
|
389
|
+
</View>
|
|
390
|
+
|
|
391
|
+
<EventButton style={{ backgroundColor: '#00b894', marginTop: 15 }} label={esp.lang("event/visitor_input", "save_btn")} onPress={() => { }} />
|
|
392
|
+
|
|
393
|
+
</View>
|
|
394
|
+
</LibSlidingup>
|
|
395
|
+
</View>
|
|
396
|
+
)
|
|
397
|
+
}
|
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
|
|
package/event/voucher2.tsx
CHANGED
|
@@ -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)
|