esoftplay-event 0.0.0-a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config.json +11 -0
- package/event/additional.tsx +188 -0
- package/event/additional_input.tsx +316 -0
- package/event/block_invitation.tsx +48 -0
- package/event/countdown.tsx +72 -0
- package/event/counter_cashier.tsx +180 -0
- package/event/counter_cashier_report.tsx +114 -0
- package/event/counter_cashier_sell.tsx +135 -0
- package/event/counter_eo.tsx +451 -0
- package/event/counter_history.tsx +74 -0
- package/event/counter_history_item.tsx +48 -0
- package/event/counter_info.tsx +96 -0
- package/event/counter_lm.tsx +273 -0
- package/event/counter_menu.tsx +85 -0
- package/event/counter_report.tsx +105 -0
- package/event/counter_report_breakdown.tsx +93 -0
- package/event/counter_report_detail.tsx +238 -0
- package/event/counter_report_detail_list.tsx +56 -0
- package/event/counter_request.tsx +136 -0
- package/event/counter_request_detail.tsx +211 -0
- package/event/counter_section.tsx +32 -0
- package/event/counter_send.tsx +277 -0
- package/event/counter_status.tsx +32 -0
- package/event/counter_type.tsx +23 -0
- package/event/counter_user_list.tsx +197 -0
- package/event/counter_user_list_item.tsx +143 -0
- package/event/coupon.tsx +124 -0
- package/event/coupon_claim.tsx +198 -0
- package/event/coupon_claim_detail.tsx +175 -0
- package/event/coupon_claim_history.tsx +279 -0
- package/event/coupon_claim_reimburse.tsx +111 -0
- package/event/coupon_claim_reimburse_history.tsx +72 -0
- package/event/coupon_claim_reimburse_history_detail.tsx +117 -0
- package/event/coupon_claim_staff.tsx +256 -0
- package/event/coupon_detail.tsx +98 -0
- package/event/coupon_event_list.tsx +77 -0
- package/event/coupon_generate.tsx +258 -0
- package/event/coupon_generate_event.tsx +79 -0
- package/event/coupon_generate_list.tsx +56 -0
- package/event/date_picker.tsx +152 -0
- package/event/detail.tsx +352 -0
- package/event/entrance.tsx +215 -0
- package/event/entrance_again.tsx +200 -0
- package/event/entrance_failed.tsx +190 -0
- package/event/entrance_idcard.tsx +203 -0
- package/event/entrance_list.tsx +264 -0
- package/event/entrance_list_item.tsx +88 -0
- package/event/entrance_log.tsx +130 -0
- package/event/entrance_success.tsx +155 -0
- package/event/entrance_warning.tsx +91 -0
- package/event/exchange_reward.tsx +31 -0
- package/event/exchange_reward_result.tsx +137 -0
- package/event/exchange_ticket.tsx +234 -0
- package/event/exchange_ticket_list.tsx +191 -0
- package/event/exchange_ticket_result.tsx +211 -0
- package/event/exit.tsx +91 -0
- package/event/exit_failed.tsx +135 -0
- package/event/exit_list.tsx +118 -0
- package/event/exit_log.tsx +131 -0
- package/event/exit_success.tsx +143 -0
- package/event/exit_temporary.tsx +226 -0
- package/event/hall_in.tsx +148 -0
- package/event/hall_in_failed.tsx +270 -0
- package/event/hall_in_list.tsx +222 -0
- package/event/hall_in_log.tsx +134 -0
- package/event/hall_in_success.tsx +132 -0
- package/event/hall_out.tsx +143 -0
- package/event/hall_out_failed.tsx +133 -0
- package/event/hall_out_list.tsx +215 -0
- package/event/hall_out_log.tsx +133 -0
- package/event/hall_out_success.tsx +130 -0
- package/event/list.tsx +219 -0
- package/event/list_filter.tsx +124 -0
- package/event/log.tsx +435 -0
- package/event/qc_idcard.tsx +209 -0
- package/event/qc_idcard_failed.tsx +78 -0
- package/event/qc_idcard_success.tsx +68 -0
- package/event/queue_out.tsx +186 -0
- package/event/queue_pricing.tsx +152 -0
- package/event/randomseat.tsx +33 -0
- package/event/review.tsx +117 -0
- package/event/review_add.tsx +342 -0
- package/event/review_detail.tsx +67 -0
- package/event/review_item.tsx +76 -0
- package/event/scan_item.tsx +66 -0
- package/event/schedule.tsx +135 -0
- package/event/seat.tsx +628 -0
- package/event/seat_autopick.tsx +120 -0
- package/event/seat_map.tsx +408 -0
- package/event/seat_map_matrix.tsx +94 -0
- package/event/seat_map_test.tsx +401 -0
- package/event/ticket_list.tsx +722 -0
- package/event/ticket_list2.tsx +680 -0
- package/event/timer.tsx +58 -0
- package/event/tms.tsx +103 -0
- package/event/tms_add.tsx +94 -0
- package/event/tms_add_result.tsx +175 -0
- package/event/tms_dashboard.tsx +89 -0
- package/event/tms_event_list.tsx +66 -0
- package/event/turnstile_event_gate.tsx +74 -0
- package/event/turnstile_event_item.tsx +41 -0
- package/event/turnstile_event_list.tsx +69 -0
- package/event/turnstile_event_ticket.tsx +95 -0
- package/event/turnstile_settings.tsx +327 -0
- package/event/turnstile_settings_otp.tsx +58 -0
- package/event/turnstile_settings_status.tsx +50 -0
- package/event/voucher.tsx +149 -0
- package/event/voucher_multi.tsx +181 -0
- package/fonts/Arial.ttf +0 -0
- package/fonts/ArialBold.ttf +0 -0
- package/fonts/DecoNumbers.ttf +0 -0
- package/fonts/MonoSpace.ttf +0 -0
- package/fonts/SFProText.ttf +0 -0
- package/fonts/digital.ttf +0 -0
- package/fonts/mono.ttf +0 -0
- package/id.json +1113 -0
- package/index.js +2 -0
- package/libs.json +1 -0
- package/mover.js +0 -0
- package/package.json +16 -0
- package/publisher.js +84 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
import { ComponentFab } from 'esoftplay/cache/component/fab/import';
|
|
3
|
+
import { ComponentHeader } from 'esoftplay/cache/component/header/import';
|
|
4
|
+
import { ComponentMessage } from 'esoftplay/cache/component/message/import';
|
|
5
|
+
import { ComponentSlidingup } from 'esoftplay/cache/component/slidingup/import';
|
|
6
|
+
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
7
|
+
import { LibInput } from 'esoftplay/cache/lib/input/import';
|
|
8
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
9
|
+
import esp from 'esoftplay/esp';
|
|
10
|
+
import useLazyState from 'esoftplay/lazy';
|
|
11
|
+
import { useRef } from 'react';
|
|
12
|
+
|
|
13
|
+
import { LibInfinite } from 'esoftplay/cache/lib/infinite/import';
|
|
14
|
+
import useSafeState from 'esoftplay/state';
|
|
15
|
+
import React from 'react';
|
|
16
|
+
import { Pressable, Text, TouchableOpacity, View } from 'react-native';
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
export interface EventCoupon_claim_staffArgs {
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
export interface EventCoupon_claim_staffProps {
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
export default function m(props: EventCoupon_claim_staffProps): any {
|
|
26
|
+
const { event_id, tenant_id } = esp.mod("lib/navigation").getArgsAll(props)
|
|
27
|
+
const [userScan, setUserScan] = useLazyState<any>()
|
|
28
|
+
const inputRef = useRef<LibInput>(null)
|
|
29
|
+
const keywordRef = useRef<LibInput>(null)
|
|
30
|
+
const scrollRef = useRef<LibInfinite>(null)
|
|
31
|
+
const [key, setKey] = useSafeState(1)
|
|
32
|
+
const [query, setQuery] = useSafeState("")
|
|
33
|
+
const slidingAddRef = useRef<ComponentSlidingup>(null)
|
|
34
|
+
|
|
35
|
+
function doAddUser() {
|
|
36
|
+
const email: any = inputRef.current?.getText()
|
|
37
|
+
|
|
38
|
+
if (email == "") {
|
|
39
|
+
esp.modProp("lib/toast").show(esp.lang("event/coupon_claim", "alert_email"))
|
|
40
|
+
return
|
|
41
|
+
}
|
|
42
|
+
let reg = /^[\w-.]+@([\w-]+.)+[\w-]{2,4}$/;
|
|
43
|
+
if (email && reg.test(email) === false) {
|
|
44
|
+
esp.modProp("lib/toast").show(esp.lang("event/coupon_claim", "alert_email_invalid"))
|
|
45
|
+
return
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const doAdd = () => {
|
|
49
|
+
const curl = esp.mod("lib/curl")
|
|
50
|
+
const post = {
|
|
51
|
+
email: String(email).toLowerCase(),
|
|
52
|
+
tenant_id,
|
|
53
|
+
event_id
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
esp.mod("lib/progress").show(esp.lang("event/coupon_claim", "add_process"))
|
|
57
|
+
new curl("event_coupon_tenant_add", post, (result, message) => {
|
|
58
|
+
esp.modProp("lib/toast").show(message)
|
|
59
|
+
esp.mod("lib/progress").hide()
|
|
60
|
+
slidingAddRef.current?.hide()
|
|
61
|
+
inputRef.current?.setText("")
|
|
62
|
+
setKey(x => x + 1)
|
|
63
|
+
scrollRef.current?.loadData()
|
|
64
|
+
}, (error) => {
|
|
65
|
+
esp.log(error);
|
|
66
|
+
esp.mod("lib/progress").hide()
|
|
67
|
+
esp.mod("lib/dialog").warning(esp.lang("event/coupon_claim", "warning_add_user"), error?.message)
|
|
68
|
+
}, 1)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
esp.mod('lib/dialog').confirm(esp.lang("event/coupon_claim", "confirm_add_user"),
|
|
72
|
+
esp.lang("event/coupon_claim", "confirm_msg_add", email),
|
|
73
|
+
esp.lang("event/coupon_claim", "confirm_add"), () => {
|
|
74
|
+
doAdd()
|
|
75
|
+
},
|
|
76
|
+
esp.lang("event/coupon_claim", "confirm_cancel_add"), () => { })
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
function deleteUser(item: any, index: number) {
|
|
81
|
+
|
|
82
|
+
const doDelete = () => {
|
|
83
|
+
const curl = esp.mod("lib/curl")
|
|
84
|
+
const post = { staff_id: item?.staff_id, event_id }
|
|
85
|
+
|
|
86
|
+
esp.mod("lib/progress").show(esp.lang("event/coupon_claim", "deleting_user"))
|
|
87
|
+
new curl("event_coupon_tenant_delete", post, (result, message) => {
|
|
88
|
+
esp.modProp("lib/toast").show(message)
|
|
89
|
+
esp.mod("lib/progress").hide()
|
|
90
|
+
setUserScan((x: any) => esp.mod("lib/object").splice(x, index, 1)())()
|
|
91
|
+
}, (error) => {
|
|
92
|
+
esp.mod("lib/progress").hide()
|
|
93
|
+
esp.mod("lib/dialog").warning(esp.lang("event/coupon_claim", "warning_delete"), error?.message)
|
|
94
|
+
}, 1)
|
|
95
|
+
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
esp.mod('lib/dialog').warningConfirm(esp.lang("event/coupon_claim", "confirm_delete_user"),
|
|
99
|
+
esp.lang("event/coupon_claim", "delete_user", item?.email),
|
|
100
|
+
esp.lang("event/coupon_claim", "delete_user_ok"), () => {
|
|
101
|
+
doDelete()
|
|
102
|
+
},
|
|
103
|
+
esp.lang("event/coupon_claim", "delete_user_cancel"), () => { })
|
|
104
|
+
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function changeUserStatus(item: any, index: number) {
|
|
108
|
+
const doChange = () => {
|
|
109
|
+
const curl = esp.mod("lib/curl")
|
|
110
|
+
const post = { staff_id: item?.staff_id, active: item?.active == true ? 0 : 1, event_id }
|
|
111
|
+
|
|
112
|
+
esp.mod("lib/progress").show(esp.lang("event/coupon_claim", "nonactive_user"))
|
|
113
|
+
new curl("event_coupon_tenant_active", post, (result, message) => {
|
|
114
|
+
esp.log({ result, message });
|
|
115
|
+
esp.mod("lib/progress").hide()
|
|
116
|
+
esp.modProp("lib/toast").show(message)
|
|
117
|
+
setUserScan((x: any) => esp.mod("lib/object").set(x, item?.active == true ? 0 : 1)(index, "active"))()
|
|
118
|
+
}, (error) => {
|
|
119
|
+
esp.mod("lib/progress").hide()
|
|
120
|
+
esp.mod("lib/dialog").warning(esp.lang("event/coupon_claim", "warning_non_active"), error?.message)
|
|
121
|
+
}, 1)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
esp.mod('lib/dialog').warningConfirm(item?.active == true ? esp.lang("event/coupon_claim", "user_nonactive") : esp.lang("event/coupon_claim_staff", "activate_staff"),
|
|
125
|
+
esp.lang("event/coupon_claim", "msg_change_status", item?.active == true ? esp.lang("event/coupon_claim", "msg_nonactive") : esp.lang("event/coupon_claim", "msg_active"), item?.email),
|
|
126
|
+
`${item?.active == true ? esp.lang("event/coupon_claim", "noncative_confirm") : esp.lang("event/coupon_claim", "active_confirm")}`, () => {
|
|
127
|
+
doChange()
|
|
128
|
+
},
|
|
129
|
+
esp.lang("event/coupon_claim", "cancel_change_status"), () => { })
|
|
130
|
+
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function buildSearchUrl(url: string): string {
|
|
134
|
+
if (query != "") {
|
|
135
|
+
url += url.includes('?') ? '&' : '?'
|
|
136
|
+
url += 'keyword=' + query
|
|
137
|
+
}
|
|
138
|
+
return url
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function doSearch() {
|
|
142
|
+
if (keywordRef.current?.getText?.() && keywordRef.current?.getText?.() != "") {
|
|
143
|
+
const email = keywordRef.current?.getText?.()
|
|
144
|
+
setQuery(email)
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return (
|
|
149
|
+
<View style={{ flex: 1 }}>
|
|
150
|
+
<ComponentHeader title={esp.lang("event/coupon_claim_staff", "manage_coupon")} subtitle={esp.lang("event/coupon_claim_staff", "manage_coupon_sub")} notif />
|
|
151
|
+
|
|
152
|
+
<View style={{ marginHorizontal: 15, marginTop: 10, flexDirection: 'row', alignItems: 'center' }}>
|
|
153
|
+
<LibInput
|
|
154
|
+
ref={keywordRef}
|
|
155
|
+
base
|
|
156
|
+
defaultValue={query}
|
|
157
|
+
placeholder={esp.lang("event/coupon_claim_history", "search_email")}
|
|
158
|
+
onChangeText={(t) => { }}
|
|
159
|
+
onSubmitEditing={() => doSearch()}
|
|
160
|
+
style={{ flex: 1, borderColor: '#E6E6E6', color: '#B8B8B8', borderWidth: 1, padding: 4, paddingLeft: 40, borderRadius: 10, backgroundColor: 'white', height: 40 }}
|
|
161
|
+
/>
|
|
162
|
+
<View style={{ position: "absolute", top: 9, bottom: 0, left: 9 }}>
|
|
163
|
+
<LibIcon name="magnify" color="#E6E6E6" />
|
|
164
|
+
</View>
|
|
165
|
+
{
|
|
166
|
+
query != "" &&
|
|
167
|
+
<Pressable onPress={() => {
|
|
168
|
+
setQuery("")
|
|
169
|
+
keywordRef.current?.setText("")
|
|
170
|
+
}} style={{ position: "absolute", top: 9, bottom: 0, right: 9 }}>
|
|
171
|
+
<LibIcon name="close" color={LibStyle.colorRed} />
|
|
172
|
+
</Pressable>
|
|
173
|
+
}
|
|
174
|
+
</View>
|
|
175
|
+
|
|
176
|
+
<LibInfinite
|
|
177
|
+
ref={scrollRef}
|
|
178
|
+
key={buildSearchUrl("event_coupon_tenant_list?tenant_id=" + tenant_id)}
|
|
179
|
+
url={buildSearchUrl("event_coupon_tenant_list?tenant_id=" + tenant_id)}
|
|
180
|
+
errorView={(e: string) => <ComponentMessage message={e} />}
|
|
181
|
+
isDebug={1}
|
|
182
|
+
injectData={userScan}
|
|
183
|
+
onDataChange={(data) => setUserScan(data)()}
|
|
184
|
+
// key={key}
|
|
185
|
+
extraData={key}
|
|
186
|
+
renderItem={(item, index) => (
|
|
187
|
+
<View key={index} style={[{ backgroundColor: "white", marginHorizontal: 15, marginBottom: 10, marginTop: 5, padding: 10, borderRadius: 10, flexDirection: "row", alignItems: "center" }, LibStyle.elevation(3)]}>
|
|
188
|
+
<View style={{ flex: 1 }}>
|
|
189
|
+
{
|
|
190
|
+
item?.name && item?.name != "" &&
|
|
191
|
+
<Text allowFontScaling={false} numberOfLines={1} style={{ fontFamily: "Arial", fontSize: 16, marginBottom: 5 }}>{esp.mod("lib/utils").ucwords(item?.name)}</Text>
|
|
192
|
+
}
|
|
193
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14 }}>{String(item?.email).toLowerCase()}</Text>
|
|
194
|
+
{
|
|
195
|
+
item?.active == 0 &&
|
|
196
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, color: LibStyle.colorRed, marginTop: 5 }}>{esp.lang("event/coupon_claim", "nonactive")}</Text>
|
|
197
|
+
}
|
|
198
|
+
</View>
|
|
199
|
+
<Pressable onPress={() => {
|
|
200
|
+
esp.modProp("market/slidingup").add(
|
|
201
|
+
<View style={{ backgroundColor: '#f6f6f6', borderTopRightRadius: 20, borderTopLeftRadius: 20, paddingBottom: 35, paddingHorizontal: 19, }}>
|
|
202
|
+
<Text allowFontScaling={false} style={{ marginTop: 26, marginBottom: 23, fontFamily: "Arial", fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, textAlign: "center", color: "#34495e" }}>{esp.lang("event/coupon_claim", "delete_user_item", String(item?.email).toLowerCase())}</Text>
|
|
203
|
+
<TouchableOpacity onPress={() => {
|
|
204
|
+
esp.modProp("market/slidingup").hide()
|
|
205
|
+
changeUserStatus(item, index)
|
|
206
|
+
}}
|
|
207
|
+
style={[{ alignItems: 'center', paddingLeft: 10, height: 50, borderRadius: 5, alignContent: 'center', justifyContent: 'center', backgroundColor: '#fff' }, LibStyle.elevation(2)]} >
|
|
208
|
+
<Text allowFontScaling={false} style={{ fontFamily: "SFProText", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#4b4b4b" }}>{esp.lang("event/coupon_claim", "change_status", item?.active == 1 ? esp.lang("event/coupon_claim", "msg_nonactive") : esp.lang("event/coupon_claim", "msg_active"))}</Text>
|
|
209
|
+
</TouchableOpacity>
|
|
210
|
+
<TouchableOpacity onPress={() => {
|
|
211
|
+
esp.modProp("market/slidingup").hide()
|
|
212
|
+
deleteUser(item, index)
|
|
213
|
+
}} style={[{ alignItems: 'center', marginTop: 15, paddingLeft: 10, height: 50, borderRadius: 5, alignContent: 'center', justifyContent: 'center', backgroundColor: LibStyle.colorRed }, LibStyle.elevation(2)]} >
|
|
214
|
+
<Text allowFontScaling={false} style={{ fontFamily: "SFProText", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{esp.lang("event/coupon_claim_staff", "delete_user_scan")}</Text>
|
|
215
|
+
</TouchableOpacity>
|
|
216
|
+
</View>
|
|
217
|
+
)
|
|
218
|
+
esp.modProp("market/slidingup").show()
|
|
219
|
+
}}>
|
|
220
|
+
<LibIcon name='delete' color={LibStyle.colorRed} />
|
|
221
|
+
</Pressable>
|
|
222
|
+
</View>
|
|
223
|
+
)}
|
|
224
|
+
/>
|
|
225
|
+
|
|
226
|
+
<ComponentFab icon={"account-plus"} colorBg={LibStyle.colorPrimary} onPress={() => slidingAddRef.current?.show?.()} />
|
|
227
|
+
|
|
228
|
+
<ComponentSlidingup ref={slidingAddRef}>
|
|
229
|
+
<View style={{ backgroundColor: "white", padding: 15, paddingBottom: 25, borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
|
|
230
|
+
<View style={{ flexDirection: "row", alignItems: "center" }}>
|
|
231
|
+
<Text allowFontScaling={false} style={{ flex: 1, fontFamily: "ArialBold", fontSize: 14, color: "#6F442D" }}>{esp.lang("event/coupon_claim", "add_user_scan")}</Text>
|
|
232
|
+
<Pressable onPress={() => slidingAddRef.current?.hide?.()}>
|
|
233
|
+
<LibIcon name='close' color={LibStyle.colorRed} />
|
|
234
|
+
</Pressable>
|
|
235
|
+
</View>
|
|
236
|
+
<View style={{ borderWidth: 1, borderColor: "#e6e6e6", height: 34, borderRadius: 10, marginVertical: 10 }}>
|
|
237
|
+
<LibInput
|
|
238
|
+
ref={inputRef}
|
|
239
|
+
base
|
|
240
|
+
placeholder={esp.lang("event/coupon_claim", "input_email")}
|
|
241
|
+
onChangeText={() => { }}
|
|
242
|
+
onSubmitEditing={doAddUser}
|
|
243
|
+
returnKeyType='go'
|
|
244
|
+
keyboardType='email-address'
|
|
245
|
+
autoCapitalize='none'
|
|
246
|
+
style={{ flex: 1, paddingHorizontal: 10 }}
|
|
247
|
+
/>
|
|
248
|
+
</View>
|
|
249
|
+
<Pressable onPress={doAddUser} style={{ backgroundColor: LibStyle.colorGreen, height: 34, alignItems: "center", justifyContent: "center", paddingHorizontal: 10, borderRadius: 10 }}>
|
|
250
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, color: "white" }}>{esp.lang("event/coupon_claim", "add_user_btn")}</Text>
|
|
251
|
+
</Pressable>
|
|
252
|
+
</View>
|
|
253
|
+
</ComponentSlidingup>
|
|
254
|
+
</View>
|
|
255
|
+
)
|
|
256
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
|
|
3
|
+
import { ComponentHeader } from 'esoftplay/cache/component/header/import';
|
|
4
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
5
|
+
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
6
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
7
|
+
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
8
|
+
import { UseSecure_page } from 'esoftplay/cache/use/secure_page/import';
|
|
9
|
+
import esp from 'esoftplay/esp';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { ScrollView, Text, View } from 'react-native';
|
|
12
|
+
import QRCode from 'react-native-qrcode-svg';
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export interface VoucherCoupon_detailArgs {
|
|
16
|
+
qr: string
|
|
17
|
+
code: string
|
|
18
|
+
amount: string
|
|
19
|
+
image: string
|
|
20
|
+
info: string
|
|
21
|
+
title: string
|
|
22
|
+
status_text: string
|
|
23
|
+
}
|
|
24
|
+
export interface VoucherCoupon_detailProps {
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
export default function m(props: VoucherCoupon_detailProps): any {
|
|
28
|
+
UseSecure_page()
|
|
29
|
+
const { qr, code, amount, image, info, title, status, status_text, event_name, merchant_name } = LibNavigation.getArgsAll(props)
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<View style={{ flex: 1, backgroundColor: "#e6e6e6" }}>
|
|
33
|
+
<ComponentHeader title={esp.lang("event/coupon_detail", "header")} notif />
|
|
34
|
+
<ScrollView>
|
|
35
|
+
<View style={{ backgroundColor: "white", margin: 20, borderRadius: 20 }}>
|
|
36
|
+
<View style={{ alignSelf: "center", marginHorizontal: 20, marginTop: 20 }}>
|
|
37
|
+
<QRCode ecl="H" size={200} value={qr} color='#333333' />
|
|
38
|
+
{
|
|
39
|
+
status != 0 &&
|
|
40
|
+
<View style={{ position: "absolute", left: 0, right: 0, top: 15, bottom: 4, alignItems: "center", justifyContent: "center" }}>
|
|
41
|
+
<View style={{ paddingHorizontal: 20, paddingVertical: 10, borderWidth: 4, borderColor: LibStyle.colorRed, backgroundColor: "white", transform: [{ rotate: '-20deg' }] }}>
|
|
42
|
+
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 16, letterSpacing: 0, color: LibStyle.colorRed }}>{esp.lang("event/coupon", "voucher_used")}</Text>
|
|
43
|
+
</View>
|
|
44
|
+
</View>
|
|
45
|
+
}
|
|
46
|
+
</View>
|
|
47
|
+
<Text allowFontScaling={false} numberOfLines={2} style={{ marginTop: 10, fontFamily: "ArialBold", fontSize: 18, fontWeight: "bold", letterSpacing: 3.5, color: "#aeacb2", textAlign: 'center' }}>{code}</Text>
|
|
48
|
+
|
|
49
|
+
<View style={{ padding: 15, paddingBottom: 20, marginTop: 40 }}>
|
|
50
|
+
{
|
|
51
|
+
image &&
|
|
52
|
+
<LibPicture source={{ uri: image }} resizeMode="cover" style={{ height: (LibStyle.width - 220) * 0.43, width: LibStyle.width - 220, borderRadius: 5, alignSelf: "center", marginBottom: 15 }} />
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
<Text allowFontScaling={false} style={{ fontFamily: "SFProText", fontSize: 12, letterSpacing: 1, color: "#555555" }}>{esp.lang("event/coupon_detail", "event_name")}</Text>
|
|
56
|
+
<Text allowFontScaling={false} style={{ fontFamily: "SFProText", fontSize: 18, letterSpacing: 0, color: "#333333" }}>{event_name}</Text>
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
{
|
|
60
|
+
title && title != "" &&
|
|
61
|
+
<>
|
|
62
|
+
<Text allowFontScaling={false} style={{ marginTop: 8, fontFamily: "SFProText", fontSize: 12, letterSpacing: 1, color: "#555555" }}>{esp.lang("event/coupon_detail", "coupon_name")}</Text>
|
|
63
|
+
<Text allowFontScaling={false} style={{ fontFamily: "SFProText", fontSize: 18, letterSpacing: 0, color: "#333333" }}>{title}</Text>
|
|
64
|
+
</>
|
|
65
|
+
}
|
|
66
|
+
{
|
|
67
|
+
amount && amount != "" && amount != 0 &&
|
|
68
|
+
<>
|
|
69
|
+
<Text allowFontScaling={false} style={{ marginTop: 8, fontFamily: "SFProText", fontSize: 12, letterSpacing: 1, color: "#555555" }}>{esp.lang("event/coupon_detail", "amount")}</Text>
|
|
70
|
+
<Text allowFontScaling={false} style={{ fontFamily: "SFProText", fontSize: 18, letterSpacing: 0, color: "#333333" }}>{LibUtils.money(amount)}</Text>
|
|
71
|
+
</>
|
|
72
|
+
}
|
|
73
|
+
{
|
|
74
|
+
merchant_name && merchant_name != "" &&
|
|
75
|
+
<>
|
|
76
|
+
<Text allowFontScaling={false} style={{ marginTop: 8, fontFamily: "SFProText", fontSize: 12, letterSpacing: 1, color: "#555555" }}>{esp.lang("event/coupon_detail", "merchant_redeem")}</Text>
|
|
77
|
+
<Text allowFontScaling={false} style={{ fontFamily: "SFProText", fontSize: 18, letterSpacing: 0, color: "#333333" }}>{merchant_name}</Text>
|
|
78
|
+
</>
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
{
|
|
82
|
+
info && info != "" &&
|
|
83
|
+
<>
|
|
84
|
+
<Text allowFontScaling={false} style={{ marginTop: 8, fontFamily: "SFProText", fontSize: 12, letterSpacing: 1, color: "#555555" }}>{esp.lang("event/coupon_detail", "info")}</Text>
|
|
85
|
+
<Text allowFontScaling={false} style={{ fontFamily: "SFProText", fontSize: 16, letterSpacing: 1, lineHeight: 24, color: "#333333", textAlign: "justify" }}>{info}</Text>
|
|
86
|
+
</>
|
|
87
|
+
}
|
|
88
|
+
</View>
|
|
89
|
+
</View>
|
|
90
|
+
|
|
91
|
+
<View style={{ backgroundColor: "#e6e6e6", width: 30, height: 30, borderRadius: 15, position: "absolute", left: 8, top: 290 }} />
|
|
92
|
+
<View style={{ backgroundColor: "#e6e6e6", width: 30, height: 30, borderRadius: 15, position: "absolute", right: 8, top: 290 }} />
|
|
93
|
+
<View style={{ borderTopWidth: 1, borderColor: "#908d94", borderStyle: "dashed", height: 0, position: "absolute", top: 305, left: 37, right: 37 }} />
|
|
94
|
+
|
|
95
|
+
</ScrollView>
|
|
96
|
+
</View>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
|
|
3
|
+
import { ComponentHeader } from 'esoftplay/cache/component/header/import';
|
|
4
|
+
import { ComponentMessage } from 'esoftplay/cache/component/message/import';
|
|
5
|
+
import { LibList } from 'esoftplay/cache/lib/list/import';
|
|
6
|
+
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
7
|
+
import { LibSkeleton } from 'esoftplay/cache/lib/skeleton/import';
|
|
8
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
9
|
+
import esp from 'esoftplay/esp';
|
|
10
|
+
import useLazyState from 'esoftplay/lazy';
|
|
11
|
+
import React, { useEffect } from 'react';
|
|
12
|
+
import { Pressable, Text, View } from 'react-native';
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export interface EventCoupon_event_listArgs {
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
export interface EventCoupon_event_listProps {
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
export default function m(props: EventCoupon_event_listProps): any {
|
|
22
|
+
const [result, setResult] = useLazyState<any>()
|
|
23
|
+
const [error, setError] = useLazyState<string>("")
|
|
24
|
+
const imgWidth = LibStyle?.width - 30
|
|
25
|
+
const imgHeight = imgWidth / 1920 * 1080
|
|
26
|
+
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
loadEvent()
|
|
29
|
+
}, [])
|
|
30
|
+
|
|
31
|
+
function loadEvent() {
|
|
32
|
+
const curl = esp.mod("lib/curl")
|
|
33
|
+
new curl("event_coupon_tenant_event", null,
|
|
34
|
+
(result) => {
|
|
35
|
+
if (result.length > 1) {
|
|
36
|
+
setResult(result)()
|
|
37
|
+
} else {
|
|
38
|
+
esp.mod("lib/navigation").replace("event/coupon_claim", { ...result?.[0] })
|
|
39
|
+
}
|
|
40
|
+
}, (error) => {
|
|
41
|
+
setError(error?.message)()
|
|
42
|
+
}, 1)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<View style={{ flex: 1 }}>
|
|
48
|
+
<ComponentHeader title={"Daftar Event"} />
|
|
49
|
+
{
|
|
50
|
+
(!result && error == "") ?
|
|
51
|
+
<LibSkeleton>
|
|
52
|
+
<LibSkeleton.BoxFull size={imgHeight} />
|
|
53
|
+
<LibSkeleton.BoxFull size={imgHeight} />
|
|
54
|
+
<LibSkeleton.BoxFull size={imgHeight} />
|
|
55
|
+
</LibSkeleton>
|
|
56
|
+
:
|
|
57
|
+
<LibList
|
|
58
|
+
onRefresh={loadEvent}
|
|
59
|
+
data={result}
|
|
60
|
+
ListEmptyComponent={
|
|
61
|
+
error != "" ? <ComponentMessage message={error} /> : null
|
|
62
|
+
}
|
|
63
|
+
renderItem={(item: any, index: number) => (
|
|
64
|
+
<Pressable key={index} onPress={() => {
|
|
65
|
+
esp.mod("lib/navigation").navigate("event/coupon_claim", { ...item })
|
|
66
|
+
}} style={{ marginHorizontal: 15, marginTop: 15 }} >
|
|
67
|
+
<LibPicture source={{ uri: item?.image }} style={{ width: imgWidth, height: imgHeight, borderRadius: 10, resizeMode: 'cover', backgroundColor: '#f1f2f3' }} />
|
|
68
|
+
<View style={{ backgroundColor: "rgba(0, 0, 0, 0.5)", position: 'absolute', borderBottomLeftRadius: 10, borderBottomRightRadius: 10, bottom: 0, left: 0, right: 0, padding: 10 }}>
|
|
69
|
+
<Text allowFontScaling={false} style={{ flex: 1, fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{item?.event_name}</Text>
|
|
70
|
+
</View>
|
|
71
|
+
</Pressable>
|
|
72
|
+
)}
|
|
73
|
+
/>
|
|
74
|
+
}
|
|
75
|
+
</View>
|
|
76
|
+
)
|
|
77
|
+
}
|