esoftplay-event 0.0.1-c → 0.0.1-e
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 +1 -1
- package/event/artist.tsx +3 -6
- package/event/detail.tsx +0 -44
- package/event/order.tsx +2 -1
- package/event/order_detail.tsx +2 -4
- package/event/order_detail_upgrade_payment.tsx +13 -7
- package/event/order_detail_waiting.tsx +21 -9
- package/event/order_share_to.tsx +2 -2
- package/event/scan_item.tsx +2 -2
- package/event/seat_map_new.tsx +313 -0
- package/event/test.tsx +240 -155
- package/event/ticket_list.tsx +8 -5
- package/event/ticket_list2.tsx +1 -1
- package/event/tms_check_ticket_result.tsx +5 -5
- package/event/tms_in_failed.tsx +1 -1
- package/id.json +5 -4
- 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/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
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
// withHooks
|
|
2
|
-
|
|
3
|
-
import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
4
|
-
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
5
|
-
import { EventSheet } from 'esoftplay/cache/event/sheet/import';
|
|
6
|
-
import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
|
|
7
|
-
import { EventTms_in_successProperty } from 'esoftplay/cache/event/tms_in_success/import';
|
|
8
|
-
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
9
|
-
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
10
|
-
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
11
|
-
import { LibObject } from 'esoftplay/cache/lib/object/import';
|
|
12
|
-
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
13
|
-
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
14
|
-
import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
|
|
15
|
-
import { UserClass } from 'esoftplay/cache/user/class/import';
|
|
16
|
-
import esp from 'esoftplay/esp';
|
|
17
|
-
import useSafeState from 'esoftplay/state';
|
|
18
|
-
import React, { useEffect, useRef } from 'react';
|
|
19
|
-
import { Text, View } from 'react-native';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export interface EventTms_idcardArgs {
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
export interface EventTms_idcardProps {
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
export default function m(props: EventTms_idcardProps): any {
|
|
29
|
-
const width = LibStyle.width
|
|
30
|
-
const height = 12 / 9 * width
|
|
31
|
-
const marginTop = 2.7 / 9 * width
|
|
32
|
-
const photoHeight = 4 / 9 * width
|
|
33
|
-
const photoWidth = 3 / 9 * width
|
|
34
|
-
const photoMarginBot = 0.46 / 9 * width
|
|
35
|
-
|
|
36
|
-
const menuRef = useRef<EventSheet>(null)
|
|
37
|
-
|
|
38
|
-
const {
|
|
39
|
-
hall,
|
|
40
|
-
selectedTicket,
|
|
41
|
-
event_id,
|
|
42
|
-
selectGate,
|
|
43
|
-
url_ticket_update,
|
|
44
|
-
price_type,
|
|
45
|
-
gate_type,
|
|
46
|
-
event_title,
|
|
47
|
-
typeScanner,
|
|
48
|
-
url_ticket_detail,
|
|
49
|
-
configPriority,
|
|
50
|
-
scan_type
|
|
51
|
-
} = LibNavigation.getArgsAll(props)
|
|
52
|
-
|
|
53
|
-
const [result, setResult] = useSafeState<any>()
|
|
54
|
-
|
|
55
|
-
function loadData() {
|
|
56
|
-
// load data untuk ngambil background id card
|
|
57
|
-
new LibCurl('event_tms_visitor?event_id=' + event_id, null, (res, message) => {
|
|
58
|
-
setResult(res)
|
|
59
|
-
}, (error) => {
|
|
60
|
-
LibToastProperty?.show(error?.message)
|
|
61
|
-
LibNavigation.back()
|
|
62
|
-
}, 1)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
loadData()
|
|
67
|
-
if (hall && hall == "in") {
|
|
68
|
-
entranceHall()
|
|
69
|
-
} else if (hall && hall == "out") {
|
|
70
|
-
exitHall()
|
|
71
|
-
} else {
|
|
72
|
-
entrance()
|
|
73
|
-
}
|
|
74
|
-
}, [])
|
|
75
|
-
|
|
76
|
-
function entrance() {
|
|
77
|
-
let url = url_ticket_update
|
|
78
|
-
let post = {
|
|
79
|
-
"target-url": `https://api.${esp.config().domain}/gate_checkin`,
|
|
80
|
-
price_id: 0,
|
|
81
|
-
qr: encodeURIComponent(selectedTicket?.key),
|
|
82
|
-
trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
|
|
83
|
-
event_id: event_id,
|
|
84
|
-
gate_id: selectGate?.id,
|
|
85
|
-
is_tms: 1,
|
|
86
|
-
qty: selectedTicket?.qty,
|
|
87
|
-
tms_id: UserClass.state().get()?.id
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
EventTms_homeProperty.addCounterEntranceOpenGateIdCard(1, selectedTicket?.price_id)
|
|
91
|
-
EventTms_in_successProperty.syncUsedTiket().set(LibObject.push(EventTms_in_successProperty.syncUsedTiket().get(), [url, post])())
|
|
92
|
-
EventTms_homeProperty.subscribeSync().trigger(EventTms_in_successProperty.syncUsedTiket().get())
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function entranceHall() {
|
|
96
|
-
let post = {
|
|
97
|
-
event_id: event_id,
|
|
98
|
-
hall_id: selectGate?.id,
|
|
99
|
-
staff_id: selectedTicket?.id
|
|
100
|
-
}
|
|
101
|
-
new LibCurl('event_tms_hall_confirm_staff', post, (res, message) => {
|
|
102
|
-
// setResult(res)
|
|
103
|
-
EventTms_homeProperty.addCounterHallInGateIdcard(1, selectedTicket?.price_id)
|
|
104
|
-
}, (error) => {
|
|
105
|
-
}, 1)
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function exitHall() {
|
|
109
|
-
let post = {
|
|
110
|
-
event_id: event_id,
|
|
111
|
-
hall_id: selectGate?.id,
|
|
112
|
-
id: selectedTicket?.id // ini id stafff
|
|
113
|
-
}
|
|
114
|
-
new LibCurl('event_tms_hall_out_confirm_staff', post, (res, message) => {
|
|
115
|
-
// setResult(res)
|
|
116
|
-
EventTms_homeProperty.addCounterHallOutOpenGateIdCard(1, selectedTicket?.price_id)
|
|
117
|
-
}, (error) => {
|
|
118
|
-
}, 1)
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return (
|
|
123
|
-
<View style={{ flex: 1 }}>
|
|
124
|
-
<EventHeader
|
|
125
|
-
title={esp.lang("event/tms_idcard", "header")}
|
|
126
|
-
notif
|
|
127
|
-
onPressMore={() => menuRef.current?.show()}
|
|
128
|
-
more
|
|
129
|
-
/>
|
|
130
|
-
<View style={{ backgroundColor: '#000', height: LibStyle.height, alignItems: 'center' }}>
|
|
131
|
-
{/* ini id_card nya */}
|
|
132
|
-
<LibPicture source={result?.event?.image_idcard == "" ? esp.assets('white_idcard.png') : { uri: result?.event?.image_idcard }} style={{ width: width, height: height, resizeMode: 'contain' }} />
|
|
133
|
-
<View style={{ position: 'absolute' }}>
|
|
134
|
-
<LibPicture source={{ uri: selectedTicket?.user_image != '' ? decodeURIComponent(selectedTicket?.user_image) : 'https://www.w3schools.com/howto/img_avatar.png' }} style={{ marginBottom: photoMarginBot, marginTop: marginTop, height: photoHeight, width: photoWidth, alignSelf: 'center', resizeMode: 'cover', }} />
|
|
135
|
-
<View style={{ padding: 10, marginTop: 5 }} >
|
|
136
|
-
{/* view nama */}
|
|
137
|
-
<View style={{ flexDirection: 'row' }} >
|
|
138
|
-
<Text allowFontScaling={false} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a", flex: 3 }} >{esp.lang("event/tms_idcard", "name")}</Text>
|
|
139
|
-
<Text allowFontScaling={false} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a" }} > : </Text>
|
|
140
|
-
<Text allowFontScaling={false} numberOfLines={1} ellipsizeMode={"tail"} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a", flex: 5 }} >{selectedTicket ? decodeURIComponent((selectedTicket?.user_name))?.split("+").join(' ') : esp.lang("event/tms_idcard", "visitor")}</Text>
|
|
141
|
-
</View>
|
|
142
|
-
{/* view company */}
|
|
143
|
-
<View style={{ flexDirection: 'row' }} >
|
|
144
|
-
<Text allowFontScaling={false} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a", flex: 3 }} >{esp.lang("event/tms_idcard", "company")}</Text>
|
|
145
|
-
<Text allowFontScaling={false} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a" }} > : </Text>
|
|
146
|
-
<Text allowFontScaling={false} numberOfLines={1} ellipsizeMode={"tail"} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a", flex: 5 }} >{selectedTicket?.exhibitor_name?.split('-')[1]}</Text>
|
|
147
|
-
</View>
|
|
148
|
-
|
|
149
|
-
<View style={{ width: width - 20, alignSelf: 'center', backgroundColor: '#4a4a4a', height: 4, marginVertical: 4 }} />
|
|
150
|
-
<Text allowFontScaling={false} style={{ marginTop: -5, fontSize: 20, fontWeight: "bold", fontStyle: "normal", lineHeight: 32, textAlign: 'center', letterSpacing: 0, color: "#4a4a4a" }} >{selectedTicket?.exhibitor_name?.split('-')[0]}</Text>
|
|
151
|
-
</View>
|
|
152
|
-
|
|
153
|
-
</View>
|
|
154
|
-
<EventButton
|
|
155
|
-
label={esp.lang("event/tms_idcard", "btn_back")}
|
|
156
|
-
backgroundColor={LibStyle.colorPrimary}
|
|
157
|
-
onPress={() => {
|
|
158
|
-
// LibNavigation.back()
|
|
159
|
-
LibNavigation.replace('component/scanner', {
|
|
160
|
-
selectGate: selectGate,
|
|
161
|
-
fromPage: 'event/tms_home',
|
|
162
|
-
event_id: event_id,
|
|
163
|
-
event_title: event_title,
|
|
164
|
-
typeScanner: typeScanner,
|
|
165
|
-
gate_type: gate_type,
|
|
166
|
-
price_type: price_type,
|
|
167
|
-
url_ticket_detail: url_ticket_detail,
|
|
168
|
-
url_ticket_update: url_ticket_update,
|
|
169
|
-
configPriority: configPriority,
|
|
170
|
-
scan_type: scan_type
|
|
171
|
-
})
|
|
172
|
-
}}
|
|
173
|
-
style={{ marginTop: 20, marginHorizontal: 15 }}
|
|
174
|
-
/>
|
|
175
|
-
</View>
|
|
176
|
-
<EventSheet
|
|
177
|
-
_ref={menuRef}
|
|
178
|
-
title={"ID CARD"}
|
|
179
|
-
options={[
|
|
180
|
-
{
|
|
181
|
-
text: "Tahan ID CARD",
|
|
182
|
-
textStyle: { color: "red" },
|
|
183
|
-
onPress: () => {
|
|
184
|
-
LibDialog.warningConfirm(esp.lang("event/tms_dashboard", "block_idcard_title"), esp.lang("event/tms_dashboard", "block_idcard_message"), esp.lang("event/tms_dashboard", "block_idcard_ok"), () => {
|
|
185
|
-
new LibCurl("event_tms_staff_hold", { qr: encodeURIComponent(selectedTicket?.key) }, (result, message) => {
|
|
186
|
-
LibDialog.info("Berhasil!", message)
|
|
187
|
-
}, (error) => {
|
|
188
|
-
LibDialog.warning("Oops!", error?.message)
|
|
189
|
-
})
|
|
190
|
-
}, esp.lang("event/tms_dashboard", "block_idcard_no"), () => {
|
|
191
|
-
LibDialog.hide()
|
|
192
|
-
})
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
]}
|
|
196
|
-
/>
|
|
197
|
-
</View>
|
|
198
|
-
)
|
|
199
|
-
}
|
package/event/entrance_list.tsx
DELETED
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
// withHooks
|
|
2
|
-
import { applyStyle } from 'esoftplay';
|
|
3
|
-
import { EventTms_list_item } from 'esoftplay/cache/event/tms_list_item/import';
|
|
4
|
-
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
5
|
-
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
6
|
-
import { LibObject } from 'esoftplay/cache/lib/object/import';
|
|
7
|
-
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
8
|
-
import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
|
|
9
|
-
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
10
|
-
|
|
11
|
-
import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
12
|
-
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
13
|
-
import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
|
|
14
|
-
import esp from 'esoftplay/esp';
|
|
15
|
-
import useSafeState from 'esoftplay/state';
|
|
16
|
-
import React, { useEffect, useRef } from 'react';
|
|
17
|
-
import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export interface EventEntrancre_listArgs {
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
export interface EventEntrancre_listProps {
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
export default function m(props: EventEntrancre_listProps): any {
|
|
27
|
-
const {
|
|
28
|
-
price_type,
|
|
29
|
-
url_ticket_detail,
|
|
30
|
-
url_ticket_update,
|
|
31
|
-
tickets,
|
|
32
|
-
gate_type,
|
|
33
|
-
qr_code,
|
|
34
|
-
event_id,
|
|
35
|
-
selectGate,
|
|
36
|
-
typeScanner,
|
|
37
|
-
event_title,
|
|
38
|
-
scan_type,
|
|
39
|
-
configPriority, }: any = LibNavigation.getArgsAll(props)
|
|
40
|
-
|
|
41
|
-
const [ticket, setTicket] = useSafeState<any>()
|
|
42
|
-
const [list, setList] = useSafeState<any>()
|
|
43
|
-
const [useAll, setUseAll] = useSafeState<boolean>(false)
|
|
44
|
-
const dialogQty = useRef<LibSlidingup>(null)
|
|
45
|
-
|
|
46
|
-
let args = {
|
|
47
|
-
price_type: price_type,
|
|
48
|
-
gate_type: gate_type,
|
|
49
|
-
qr_code: qr_code,
|
|
50
|
-
event_id: event_id,
|
|
51
|
-
event_title: event_title,
|
|
52
|
-
selectGate: selectGate,
|
|
53
|
-
typeScanner: typeScanner,
|
|
54
|
-
url_ticket_detail: url_ticket_detail,
|
|
55
|
-
url_ticket_update: url_ticket_update,
|
|
56
|
-
qty: 1,
|
|
57
|
-
configPriority: configPriority,
|
|
58
|
-
scan_type: scan_type
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
if (tickets?.length == 1) {
|
|
63
|
-
let item = tickets?.[0]
|
|
64
|
-
let a = new Array(Number(item?.qty_left)).fill({
|
|
65
|
-
...item,
|
|
66
|
-
selected: 0
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
let b = a?.map((item: any, i: number) => {
|
|
70
|
-
return { ...item, selected: i == 0 ? 1 : 0 }
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
setUseAll(false)
|
|
74
|
-
setList(b)
|
|
75
|
-
setTicket(item)
|
|
76
|
-
LibUtils.debounce(() => {
|
|
77
|
-
if (item.hasOwnProperty("exhibitor_name")) {
|
|
78
|
-
LibNavigation.replace('event/tms_idcard', {
|
|
79
|
-
selectedTicket: item,
|
|
80
|
-
...args
|
|
81
|
-
})
|
|
82
|
-
} else {
|
|
83
|
-
dialogQty.current!.show()
|
|
84
|
-
}
|
|
85
|
-
}, 100)
|
|
86
|
-
}
|
|
87
|
-
}, [])
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
useEffect(() => {
|
|
91
|
-
setUseAll(list?.some((x: any) => x.selected == 0) ? false : true)
|
|
92
|
-
}, [list])
|
|
93
|
-
|
|
94
|
-
function useTicket() {
|
|
95
|
-
// LibNavigation.back()
|
|
96
|
-
let arg = {
|
|
97
|
-
...args,
|
|
98
|
-
qty: list?.filter((it: any) => it.selected).length
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (tickets?.length == 1) {
|
|
102
|
-
LibNavigation.replace('event/tms_in_success', {
|
|
103
|
-
selectedTicket: ticket,
|
|
104
|
-
...arg
|
|
105
|
-
})
|
|
106
|
-
} else {
|
|
107
|
-
if (configPriority) { // ini untuk memunculkan priority
|
|
108
|
-
if (configPriority?.filter?.((item: any) => item.id == ticket.price_id).length > 0) {
|
|
109
|
-
LibNavigation.replace('event/tms_in_success', {
|
|
110
|
-
selectedTicket: ticket,
|
|
111
|
-
...arg
|
|
112
|
-
})
|
|
113
|
-
} else {
|
|
114
|
-
LibNavigation.replace('event/tms_in_warning', {
|
|
115
|
-
selectedTicket: ticket,
|
|
116
|
-
is_from_list: 1, // digunakan untuk membedakan navigasi kalau scan QR Member
|
|
117
|
-
...arg
|
|
118
|
-
})
|
|
119
|
-
}
|
|
120
|
-
} else {
|
|
121
|
-
LibNavigation.replace('event/tms_in_success', {
|
|
122
|
-
selectedTicket: ticket,
|
|
123
|
-
...arg
|
|
124
|
-
})
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function renderItem(item: any, i?: number) {
|
|
131
|
-
return (
|
|
132
|
-
<EventTms_list_item
|
|
133
|
-
key={i}
|
|
134
|
-
item={item}
|
|
135
|
-
onPress={() => {
|
|
136
|
-
if (item.text == "") {
|
|
137
|
-
if (item.qty_left == 0) {
|
|
138
|
-
LibNavigation.back()
|
|
139
|
-
LibNavigation.navigate('event/tms_in_failed', {
|
|
140
|
-
text: esp.lang("event/tms_in_list", "ticket_habis"),
|
|
141
|
-
ticketItem: item,
|
|
142
|
-
...args
|
|
143
|
-
})
|
|
144
|
-
} else {
|
|
145
|
-
let a = new Array(Number(item?.qty_left)).fill({
|
|
146
|
-
...item,
|
|
147
|
-
selected: 0
|
|
148
|
-
})
|
|
149
|
-
|
|
150
|
-
let b = a?.map((item: any, i: number) => {
|
|
151
|
-
return { ...item, selected: i == 0 ? 1 : 0 }
|
|
152
|
-
})
|
|
153
|
-
|
|
154
|
-
setUseAll(false)
|
|
155
|
-
setList(b)
|
|
156
|
-
setTicket(item)
|
|
157
|
-
LibUtils.debounce(() => {
|
|
158
|
-
if (item.hasOwnProperty("exhibitor_name")) {
|
|
159
|
-
LibNavigation.replace('event/tms_idcard', {
|
|
160
|
-
selectedTicket: item,
|
|
161
|
-
...args
|
|
162
|
-
})
|
|
163
|
-
} else {
|
|
164
|
-
dialogQty.current!.show()
|
|
165
|
-
}
|
|
166
|
-
}, 100)
|
|
167
|
-
}
|
|
168
|
-
} else {
|
|
169
|
-
LibNavigation.back()
|
|
170
|
-
LibNavigation.navigate('event/tms_in_failed', {
|
|
171
|
-
text: item.text,
|
|
172
|
-
...args
|
|
173
|
-
})
|
|
174
|
-
}
|
|
175
|
-
}}
|
|
176
|
-
/>
|
|
177
|
-
)
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
return (
|
|
181
|
-
<View style={{ flex: 1, backgroundColor: '#fff' }}>
|
|
182
|
-
<EventHeader title={esp.lang("event/tms_in_list", "header_title")} subtitle='TMS' />
|
|
183
|
-
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center', paddingTop: 15, paddingBottom: 0 }}>
|
|
184
|
-
<ScrollView style={{ flex: 1 }}>
|
|
185
|
-
{
|
|
186
|
-
tickets?.map(renderItem)
|
|
187
|
-
}
|
|
188
|
-
</ScrollView>
|
|
189
|
-
</View>
|
|
190
|
-
|
|
191
|
-
{/* dialog qty */}
|
|
192
|
-
<LibSlidingup ref={dialogQty}>
|
|
193
|
-
<View style={{ borderTopRightRadius: 20, borderTopLeftRadius: 20, padding: 20, paddingBottom: 0, backgroundColor: '#fff', maxHeight: LibStyle.height - (LibStyle.height / 3) }}>
|
|
194
|
-
<Text allowFontScaling={false} style={applyStyle({ letterSpacing: 1, fontSize: 30, marginTop: 0, fontWeight: 'bold', textAlign: "center", textAlignVertical: 'center', color: '#000', margin: 15 })} >{esp.lang("event/tms_in_list", "total_ticket", list?.length)}</Text>
|
|
195
|
-
|
|
196
|
-
<View style={{ flexDirection: 'row', alignItems: 'center', marginVertical: 20 }} >
|
|
197
|
-
<TouchableOpacity
|
|
198
|
-
onPress={() => {
|
|
199
|
-
const index = findLastIndex(list, (x: any) => x.selected == 1)
|
|
200
|
-
if (index > 0) {
|
|
201
|
-
setList(LibObject.set(list, 0)(index, 'selected'))
|
|
202
|
-
}
|
|
203
|
-
}}
|
|
204
|
-
style={{ height: 70, width: 70, borderRadius: 10, backgroundColor: '#c1c2c3', alignItems: 'center', justifyContent: 'center' }} >
|
|
205
|
-
<LibIcon name='minus' size={50} />
|
|
206
|
-
</TouchableOpacity>
|
|
207
|
-
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }} >
|
|
208
|
-
<Text style={{ fontSize: 50 }} >{list?.filter?.((x: any) => x.selected == 1).length}</Text>
|
|
209
|
-
</View>
|
|
210
|
-
<TouchableOpacity
|
|
211
|
-
onPress={() => {
|
|
212
|
-
const index = list?.findIndex?.((x: any) => x.selected == 0)
|
|
213
|
-
if (index > -1)
|
|
214
|
-
setList(LibObject.set(list, 1)(index, 'selected'))
|
|
215
|
-
}}
|
|
216
|
-
style={{ height: 70, width: 70, borderRadius: 10, backgroundColor: '#c1c2c3', alignItems: 'center', justifyContent: 'center' }} >
|
|
217
|
-
<LibIcon name='plus' size={50} />
|
|
218
|
-
</TouchableOpacity>
|
|
219
|
-
</View>
|
|
220
|
-
<View style={{ flexDirection: 'row', justifyContent: 'space-between', padding: 10, marginBottom: 20, alignContent: 'center', alignItems: 'center' }}>
|
|
221
|
-
<Text allowFontScaling={false} numberOfLines={2} ellipsizeMode={'tail'} style={{ flex: 1, fontWeight: 'bold', fontSize: 14, letterSpacing: 1 }}>{esp.lang("event/tms_in_list", "total_ticket_use", list?.filter((it: any) => it.selected).length)}</Text>
|
|
222
|
-
<TouchableOpacity onPress={() => {
|
|
223
|
-
let a = list?.map((item: any, i: number) => {
|
|
224
|
-
return { ...item, selected: useAll ? 0 : 1 }
|
|
225
|
-
})
|
|
226
|
-
setList(a)
|
|
227
|
-
}} style={applyStyle({ paddingHorizontal: 10, borderWidth: 1, borderColor: 'rgba(0, 0, 0, 0)', height: 35, borderRadius: 16, backgroundColor: useAll ? LibStyle.colorRed : LibStyle.colorGreen, flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center' })} >
|
|
228
|
-
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: '#fff', marginRight: 15 })} >{useAll ? esp.lang("event/tms_in_list", "cancel_use") : esp.lang("event/tms_in_list", "use_all")}</Text>
|
|
229
|
-
<LibIcon.Ionicons size={18} color="#fff" name={useAll ? "close" : "checkmark-done"} />
|
|
230
|
-
</TouchableOpacity>
|
|
231
|
-
</View>
|
|
232
|
-
|
|
233
|
-
<EventButton
|
|
234
|
-
label={esp.lang("event/tms_in_list", "btn_entrance")}
|
|
235
|
-
style={{ borderRadius: 10, marginHorizontal: 5, marginBottom: 10 }}
|
|
236
|
-
backgroundColor={list?.filter((it: any) => it.selected).length == 0 ? LibStyle.colorBgGrey : LibStyle.colorGreen}
|
|
237
|
-
onPress={() => {
|
|
238
|
-
if (list?.filter((it: any) => it.selected).length == 0) {
|
|
239
|
-
LibToastProperty.show(esp.lang("event/tms_in_list", "ticket_not_select"))
|
|
240
|
-
} else {
|
|
241
|
-
useTicket()
|
|
242
|
-
}
|
|
243
|
-
}}
|
|
244
|
-
/>
|
|
245
|
-
</View>
|
|
246
|
-
|
|
247
|
-
</LibSlidingup >
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
</View >
|
|
251
|
-
)
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
function findLastIndex(arr: any[], condition: (value: any, index: number, obj: any[]) => unknown) {
|
|
255
|
-
const reversedArray = arr.slice().reverse();
|
|
256
|
-
const indexInReversedArray = reversedArray.findIndex(condition);
|
|
257
|
-
|
|
258
|
-
if (indexInReversedArray === -1) {
|
|
259
|
-
return -1; // No matching element found
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
const lastIndex = arr.length - 1 - indexInReversedArray;
|
|
263
|
-
return lastIndex;
|
|
264
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
// withHooks
|
|
2
|
-
|
|
3
|
-
import { applyStyle } from 'esoftplay';
|
|
4
|
-
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
5
|
-
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
6
|
-
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
7
|
-
import { EventOrder_itemProperty } from 'esoftplay/cache/event/order_item/import';
|
|
8
|
-
import esp from 'esoftplay/esp';
|
|
9
|
-
|
|
10
|
-
import React from 'react';
|
|
11
|
-
import { Pressable, Text, View } from 'react-native';
|
|
12
|
-
import Svg, { Path } from 'react-native-svg';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export interface EventTms_list_itemArgs {
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
export interface EventTms_list_itemProps {
|
|
19
|
-
item: any,
|
|
20
|
-
onPress: () => void,
|
|
21
|
-
}
|
|
22
|
-
function debouncer() {
|
|
23
|
-
let timeout: any
|
|
24
|
-
return (func: () => any, delay: number): Function => {
|
|
25
|
-
clearTimeout(timeout)
|
|
26
|
-
timeout = setTimeout(func, delay);
|
|
27
|
-
return () => clearTimeout(timeout)
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
const debounce = debouncer()
|
|
31
|
-
|
|
32
|
-
export default function m(props: EventTms_list_itemProps): any {
|
|
33
|
-
const { item } = props
|
|
34
|
-
const z = (200 / 500) * (LibStyle.width - 50);
|
|
35
|
-
|
|
36
|
-
// let colorBg = item?.qty_left == 0 ? LibStyle.colorBgGrey : item.color == "#FFFFFF" ? LibStyle.colorPrimary : item?.color
|
|
37
|
-
let colorBg = item?.qty_left <= 0 ? LibStyle.colorBgGrey : item.color?.toUpperCase() == "#FFFFFF" ? LibStyle.colorPrimary : item?.color
|
|
38
|
-
let colorFg = item?.qty_left <= 0 ? "#aaa" : LibUtils.hexToRgba(item?.color, 0.5)
|
|
39
|
-
let colorText = item?.qty_left == 0 ? "#979797" : EventOrder_itemProperty.textColor(item.color)
|
|
40
|
-
|
|
41
|
-
if (item.price_id == "staff") {
|
|
42
|
-
return (
|
|
43
|
-
<Pressable onPress={() => { debounce(() => props.onPress(), 500) }} style={{ width: LibStyle.width - 50, marginBottom: 10, backgroundColor: colorBg, padding: 15, borderRadius: 10, ...LibStyle.elevation(3) }}>
|
|
44
|
-
<View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
|
|
45
|
-
<View style={{ height: 80, width: 80, borderRadius: 10, backgroundColor: LibStyle.colorBgGrey, ...LibStyle.elevation(3) }}>
|
|
46
|
-
<LibPicture source={{ uri: item?.user_image }} style={{ height: 80, width: 80, borderRadius: 10 }} />
|
|
47
|
-
</View>
|
|
48
|
-
<View style={{ marginHorizontal: 10, flex: 1, alignContent: 'center', justifyContent: 'center' }}>
|
|
49
|
-
<Text allowFontScaling={false} numberOfLines={2} style={applyStyle({ color: colorText, fontSize: 16, fontWeight: 'bold' })} >{item.user_name}</Text>
|
|
50
|
-
<Text allowFontScaling={false} style={applyStyle({ letterSpacing: 1, color: colorText, fontSize: 20, fontWeight: 'bold' })} >{item?.exhibitor_name?.split('-')[0]}</Text>
|
|
51
|
-
<Text allowFontScaling={false} numberOfLines={4} style={applyStyle({ letterSpacing: 1, color: colorText, fontSize: 16, fontWeight: 'normal' })} >{item?.exhibitor_name?.split('-')[1]}</Text>
|
|
52
|
-
|
|
53
|
-
</View>
|
|
54
|
-
</View>
|
|
55
|
-
</Pressable>
|
|
56
|
-
)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
<Pressable onPress={() => { debounce(() => props.onPress(), 500) }} style={applyStyle({ marginBottom: 10 })}>
|
|
61
|
-
<Svg width={LibStyle.width - 50} height={z} viewBox="0 0 544 210" fill="none">
|
|
62
|
-
<Path fill-rule="evenodd" fill={colorBg} clip-rule="evenodd" d="M0 15C0 6.71573 6.71573 0 15 0H529C537.284 0 544 6.71573 544 15V90C535.716 90 529 96.7157 529 105C529 113.284 535.716 120 544 120V195C544 203.284 537.284 210 529 210H15C6.71573 210 0 203.284 0 195V120C8.28427 120 15 113.284 15 105C15 96.7157 8.28427 90 0 90V15Z" />
|
|
63
|
-
<Path fill-rule="evenodd" fill={colorFg} clip-rule="evenodd" d="M16 0C7.16345 0 0 7.16344 0 16V91C8.2843 91 15 97.7157 15 106C15 114.284 8.2843 121 0 121V194C0 202.837 7.16345 210 16 210H185.924C187.623 210 189 208.623 189 206.924C189 205.281 187.68 203.974 186.124 203.446C181.981 202.04 179 198.118 179 193.5C179 190.516 180.245 187.823 182.244 185.911C182.407 185.755 182.572 185.597 182.739 185.439C185.671 182.647 189 179.478 189 175.5C189 171.522 185.671 168.353 182.739 165.561C182.572 165.403 182.407 165.245 182.244 165.089C180.245 163.177 179 160.484 179 157.5C179 154.156 180.563 151.178 182.998 149.255C185.858 146.996 189 144.145 189 140.5C189 136.855 185.858 134.004 182.998 131.745C180.563 129.822 179 126.844 179 123.5C179 120.516 180.245 117.823 182.244 115.911C182.407 115.755 182.572 115.597 182.739 115.439C185.671 112.647 189 109.478 189 105.5C189 101.522 185.671 98.3527 182.739 95.5614C182.572 95.4028 182.407 95.2454 182.244 95.0891C180.245 93.1775 179 90.4841 179 87.5C179 84.1564 180.563 81.1778 182.998 79.2549C185.858 76.9962 189 74.1446 189 70.5C189 66.8554 185.858 64.0038 182.998 61.7451C180.563 59.8222 179 56.8436 179 53.5C179 50.5159 180.245 47.8225 182.244 45.9109C182.407 45.7546 182.572 45.5972 182.739 45.4386C185.671 42.6473 189 39.4782 189 35.5C189 31.5218 185.671 28.3527 182.739 25.5614C182.572 25.4028 182.407 25.2454 182.244 25.0891C180.245 23.1775 179 20.4841 179 17.5C179 13.0541 181.763 9.25356 185.666 7.72205C187.45 7.02203 189 5.50424 189 3.58798C189 1.60639 187.394 0 185.412 0H16Z" />
|
|
64
|
-
</Svg>
|
|
65
|
-
|
|
66
|
-
<View style={applyStyle({ position: 'absolute', width: LibStyle.width - 50, height: z, padding: 10, justifyContent: 'space-evenly', alignContent: 'center', alignItems: 'center' })}>
|
|
67
|
-
{
|
|
68
|
-
item.price_id == "staff" &&
|
|
69
|
-
<View style={applyStyle({ position: 'absolute', top: 12, right: 10, padding: 5, paddingHorizontal: 10, borderBottomLeftRadius: 10, borderTopRightRadius: 10, backgroundColor: 'red', margin: -10, marginBottom: 5 })}>
|
|
70
|
-
<Text allowFontScaling={false} style={applyStyle({ fontWeight: 'bold', color: colorText, fontSize: 12, })}>{item.price_id}</Text>
|
|
71
|
-
</View>
|
|
72
|
-
}
|
|
73
|
-
<View style={applyStyle({ flexDirection: 'row' })} >
|
|
74
|
-
<View style={applyStyle({ width: '35%', alignItems: 'center', justifyContent: 'center' })} >
|
|
75
|
-
<Text allowFontScaling={false} style={applyStyle({ color: colorText, fontWeight: 'bold', fontSize: 60, marginRight: '5%', textAlign: 'center' })}>{item.qty_left}</Text>
|
|
76
|
-
<Text allowFontScaling={false} style={applyStyle({ color: colorText, fontWeight: 'normal', fontSize: 20, marginRight: '5%', textAlign: 'center' })}>
|
|
77
|
-
<Text style={{ fontSize: 16 }}>{esp.lang("event/tms_list_item", "total")}</Text>
|
|
78
|
-
{item.qty}</Text>
|
|
79
|
-
|
|
80
|
-
</View>
|
|
81
|
-
<View style={applyStyle({ flex: 1, justifyContent: 'center', marginRight: '10%' })} >
|
|
82
|
-
<Text allowFontScaling={false} style={applyStyle({ color: colorText, fontSize: 25, fontWeight: 'bold', textAlign: 'center' })} >{item.title}</Text>
|
|
83
|
-
</View>
|
|
84
|
-
</View>
|
|
85
|
-
</View>
|
|
86
|
-
</Pressable>
|
|
87
|
-
)
|
|
88
|
-
}
|