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
package/event/hall_out_list.tsx
DELETED
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
// withHooks
|
|
2
|
-
import { useRef } from 'react';
|
|
3
|
-
|
|
4
|
-
import { applyStyle } from 'esoftplay';
|
|
5
|
-
import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
6
|
-
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
7
|
-
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
8
|
-
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
9
|
-
import { LibObject } from 'esoftplay/cache/lib/object/import';
|
|
10
|
-
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
11
|
-
import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
|
|
12
|
-
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
13
|
-
import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
|
|
14
|
-
import { LibUtils } from 'esoftplay/cache/lib/utils/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 from 'react';
|
|
19
|
-
import { Pressable, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
20
|
-
import { Path, Svg } from 'react-native-svg';
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export interface EventTms_out_hall_listArgs {
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
export interface EventTms_out_hall_listProps {
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
export default function m(props: EventTms_out_hall_listProps): any {
|
|
30
|
-
|
|
31
|
-
const { data, scan_type, url_ticket_update, url_ticket_detail, price_type, gate_type, event_id, selectGate, typeScanner, event_title, configPriority }: any = LibNavigation.getArgsAll<any>(props)
|
|
32
|
-
const [useAll, setUseAll] = useSafeState<boolean>(false)
|
|
33
|
-
const [list, setList] = useSafeState<any>()
|
|
34
|
-
const dialogQty = useRef<LibSlidingup>(null)
|
|
35
|
-
|
|
36
|
-
let args = {
|
|
37
|
-
selectGate: selectGate,
|
|
38
|
-
fromPage: 'event/tms_home',
|
|
39
|
-
event_id: event_id,
|
|
40
|
-
event_title: event_title,
|
|
41
|
-
typeScanner: typeScanner,
|
|
42
|
-
gate_type: gate_type,
|
|
43
|
-
price_type: price_type,
|
|
44
|
-
url_ticket_detail: url_ticket_detail,
|
|
45
|
-
url_ticket_update: url_ticket_update,
|
|
46
|
-
configPriority: configPriority,
|
|
47
|
-
data: data,
|
|
48
|
-
scan_type: scan_type
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
function renderItem(item: any, i: number) {
|
|
53
|
-
const z = (200 / 500) * (LibStyle.width - 50);
|
|
54
|
-
if (item.price_id == "staff") {
|
|
55
|
-
return (
|
|
56
|
-
<Pressable key={i} onPress={() => {
|
|
57
|
-
if (item.status_scanned == 2) /* 0 tidak diperbolehkan, 1 sudah didalam, 2 available */ {
|
|
58
|
-
LibNavigation.replace('event/tms_idcard', {
|
|
59
|
-
selectedTicket: item,
|
|
60
|
-
hall: "in",
|
|
61
|
-
...args
|
|
62
|
-
})
|
|
63
|
-
} else {
|
|
64
|
-
var post = {
|
|
65
|
-
event_id: event_id,
|
|
66
|
-
hall_id: selectGate?.id
|
|
67
|
-
}
|
|
68
|
-
let err = {
|
|
69
|
-
message: item.status_label,
|
|
70
|
-
result: item.scanned_detail
|
|
71
|
-
}
|
|
72
|
-
LibNavigation.replace('event/tms_in_hall_failed', { msgError: err, ...args, postGetData: post })
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
}} style={{ width: LibStyle.width - 50, marginBottom: 10, backgroundColor: LibStyle.colorPrimary, padding: 15, borderRadius: 10, ...LibStyle.elevation(3) }}>
|
|
76
|
-
<View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
|
|
77
|
-
<View style={{ height: 80, width: 80, borderRadius: 10, backgroundColor: LibStyle.colorBgGrey, ...LibStyle.elevation(3) }}>
|
|
78
|
-
<LibPicture source={{ uri: item?.user_image }} style={{ height: 80, width: 80, borderRadius: 10 }} />
|
|
79
|
-
</View>
|
|
80
|
-
<View style={{ marginHorizontal: 10, flex: 1, alignContent: 'center', justifyContent: 'center' }}>
|
|
81
|
-
<Text allowFontScaling={false} numberOfLines={2} style={applyStyle({ color: "#000", fontSize: 16, fontWeight: 'bold' })} >{item.user_name}</Text>
|
|
82
|
-
<Text allowFontScaling={false} style={applyStyle({ letterSpacing: 1, color: "#000", fontSize: 20, fontWeight: 'bold' })} >{item?.exhibitor_name?.split('-')[0]}</Text>
|
|
83
|
-
<Text allowFontScaling={false} numberOfLines={4} style={applyStyle({ letterSpacing: 1, color: "#000", fontSize: 16, fontWeight: 'normal' })} >{item?.exhibitor_name?.split('-')[1]}</Text>
|
|
84
|
-
|
|
85
|
-
</View>
|
|
86
|
-
</View>
|
|
87
|
-
</Pressable>
|
|
88
|
-
)
|
|
89
|
-
} else {
|
|
90
|
-
return (
|
|
91
|
-
<Pressable key={i} onPress={() => {
|
|
92
|
-
let defaultUse = LibObject.set(item.list, 1)(0, 'checked')
|
|
93
|
-
setList(defaultUse)
|
|
94
|
-
dialogQty?.current?.show()
|
|
95
|
-
}}>
|
|
96
|
-
<Svg width={LibStyle.width - 50} height={z} viewBox="0 0 544 210" fill="none">
|
|
97
|
-
<Path fill-rule="evenodd" fill={LibUtils.hexToRgba(LibStyle.colorPrimary, 0.5)} 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" />
|
|
98
|
-
<Path fill-rule="evenodd" fill={LibStyle.colorPrimary} 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" />
|
|
99
|
-
</Svg>
|
|
100
|
-
<View style={applyStyle({ position: 'absolute', width: LibStyle.width - 50, height: z, padding: 10, justifyContent: 'space-evenly', alignContent: 'center', alignItems: 'center' })}>
|
|
101
|
-
<View style={applyStyle({ flexDirection: 'row' })} >
|
|
102
|
-
<View style={applyStyle({ width: '35%', alignItems: 'center', justifyContent: 'center' })} >
|
|
103
|
-
<Text allowFontScaling={false} style={applyStyle({ color: "#000", fontWeight: 'bold', fontSize: 50, marginRight: '5%', textAlign: 'center' })}>{item.qty}</Text>
|
|
104
|
-
<Text allowFontScaling={false} style={applyStyle({ color: "#000", fontWeight: 'normal', fontSize: 18, marginRight: '5%', textAlign: 'center' })}>Tiket</Text>
|
|
105
|
-
</View>
|
|
106
|
-
<View style={applyStyle({ flex: 1, justifyContent: 'center', marginRight: '10%' })} >
|
|
107
|
-
<Text allowFontScaling={false} style={applyStyle({ color: "#000", fontSize: 25, fontWeight: 'bold', textAlign: 'center' })} >{item.price_name}</Text>
|
|
108
|
-
</View>
|
|
109
|
-
</View>
|
|
110
|
-
</View>
|
|
111
|
-
</Pressable>
|
|
112
|
-
)
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
function findLastIndex(arr: any[], condition: (value: any, index: number, obj: any[]) => unknown) {
|
|
118
|
-
const reversedArray = arr.slice().reverse();
|
|
119
|
-
const indexInReversedArray = reversedArray.findIndex(condition);
|
|
120
|
-
|
|
121
|
-
if (indexInReversedArray === -1) {
|
|
122
|
-
return -1; // No matching element found
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
const lastIndex = arr.length - 1 - indexInReversedArray;
|
|
126
|
-
return lastIndex;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
function quit(): void {
|
|
131
|
-
let a = list?.filter((item: any) => item.checked == 1).map((it: any) => it.id)
|
|
132
|
-
if (a.length == 0) {
|
|
133
|
-
LibToastProperty.show("Silahkan Pilih Tiket dahulu")
|
|
134
|
-
return
|
|
135
|
-
} else {
|
|
136
|
-
let url = "event_tms_hall_out_confirm"
|
|
137
|
-
let post = {
|
|
138
|
-
event_id: event_id,
|
|
139
|
-
ids: JSON.stringify(a),
|
|
140
|
-
hall_id: selectGate?.id,
|
|
141
|
-
trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
|
|
142
|
-
price_id: list?.filter((item: any) => item.checked == 1 && item.status_scanned != 2).map((it: any) => it.price_id)
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
LibNavigation.replace('event/tms_out_hall_success', { ...args, url, post })
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
return (
|
|
150
|
-
<View style={{ flex: 1, backgroundColor: '#fff' }}>
|
|
151
|
-
<EventHeader title={esp.lang("event/tms_out_hall_list", "header_title")} />
|
|
152
|
-
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center', paddingTop: 15, paddingBottom: 0 }}>
|
|
153
|
-
<ScrollView style={{ flex: 1 }}>
|
|
154
|
-
{
|
|
155
|
-
data?.map(renderItem)
|
|
156
|
-
}
|
|
157
|
-
</ScrollView>
|
|
158
|
-
</View>
|
|
159
|
-
|
|
160
|
-
<LibSlidingup ref={dialogQty}>
|
|
161
|
-
<View style={{ borderTopRightRadius: 20, borderTopLeftRadius: 20, padding: 10, backgroundColor: '#fff', maxHeight: LibStyle.height - (LibStyle.height / 3) }}>
|
|
162
|
-
<View style={{ flexDirection: 'row', alignItems: 'center', marginVertical: 20 }} >
|
|
163
|
-
<TouchableOpacity
|
|
164
|
-
onPress={() => {
|
|
165
|
-
const index = findLastIndex(list, (x: any) => x.checked == 1)
|
|
166
|
-
if (index > 0) {
|
|
167
|
-
setList(LibObject.set(list, 0)(index, 'checked'))
|
|
168
|
-
}
|
|
169
|
-
}}
|
|
170
|
-
style={{ height: 70, width: 70, borderRadius: 10, backgroundColor: '#c1c2c3', alignItems: 'center', justifyContent: 'center' }} >
|
|
171
|
-
<LibIcon name='minus' size={50} />
|
|
172
|
-
</TouchableOpacity>
|
|
173
|
-
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }} >
|
|
174
|
-
<Text style={{ fontSize: 50 }} >{list?.filter?.((x: any) => x.checked == 1).length}</Text>
|
|
175
|
-
</View>
|
|
176
|
-
<TouchableOpacity
|
|
177
|
-
onPress={() => {
|
|
178
|
-
const index = list?.findIndex?.((x: any) => x.checked == 0)
|
|
179
|
-
if (index > -1)
|
|
180
|
-
setList(LibObject.set(list, 1)(index, 'checked'))
|
|
181
|
-
}}
|
|
182
|
-
style={{ height: 70, width: 70, borderRadius: 10, backgroundColor: '#c1c2c3', alignItems: 'center', justifyContent: 'center' }} >
|
|
183
|
-
<LibIcon name='plus' size={50} />
|
|
184
|
-
</TouchableOpacity>
|
|
185
|
-
</View>
|
|
186
|
-
|
|
187
|
-
<View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'space-between' }}>
|
|
188
|
-
<Text allowFontScaling={false} numberOfLines={2} ellipsizeMode={'tail'} style={{ fontWeight: 'bold', fontSize: 14, letterSpacing: 1 }}>{list?.filter((item: any) => !item.hasOwnProperty("type") && item.checked == 1).length + " Tiket digunakan"}</Text>
|
|
189
|
-
<TouchableOpacity onPress={() => {
|
|
190
|
-
let a = list?.map((item: any, i: number) => {
|
|
191
|
-
return { ...item, checked: item.status_scanned == 2 ? 0 : (useAll ? 0 : 1) }
|
|
192
|
-
})
|
|
193
|
-
setList(a)
|
|
194
|
-
setUseAll(useAll ? false : true)
|
|
195
|
-
}} style={applyStyle({ paddingHorizontal: 15, 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' })} >
|
|
196
|
-
<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>
|
|
197
|
-
<LibIcon.Ionicons size={18} color="#fff" name={useAll ? "close" : "checkmark-done"} />
|
|
198
|
-
</TouchableOpacity>
|
|
199
|
-
</View>
|
|
200
|
-
|
|
201
|
-
<EventButton
|
|
202
|
-
label={esp.lang("event/tms_out_hall_list", "exit")}
|
|
203
|
-
backgroundColor={LibStyle.colorRed}
|
|
204
|
-
onPress={() => {
|
|
205
|
-
quit()
|
|
206
|
-
}}
|
|
207
|
-
style={{ marginTop: 30 }}
|
|
208
|
-
/>
|
|
209
|
-
|
|
210
|
-
</View>
|
|
211
|
-
</LibSlidingup>
|
|
212
|
-
|
|
213
|
-
</View>
|
|
214
|
-
)
|
|
215
|
-
}
|
package/event/hall_out_log.tsx
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
// withHooks
|
|
2
|
-
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
|
-
|
|
5
|
-
import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
|
|
6
|
-
import { EventTms_out_hall_successProperty } from 'esoftplay/cache/event/tms_out_hall_success/import';
|
|
7
|
-
import { EventTms_logProperty } from 'esoftplay/cache/event/tms_log/import';
|
|
8
|
-
import { LibLoading } from 'esoftplay/cache/lib/loading/import';
|
|
9
|
-
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
10
|
-
import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
|
|
11
|
-
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
12
|
-
import { UseCondition } from 'esoftplay/cache/use/condition/import';
|
|
13
|
-
import esp from 'esoftplay/esp';
|
|
14
|
-
import useSafeState from 'esoftplay/state';
|
|
15
|
-
import { useTimeout } from 'esoftplay/timeout';
|
|
16
|
-
import React from 'react';
|
|
17
|
-
import { Pressable, Text, View } from 'react-native';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export interface EventTms_out_hall_logArgs {
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
export interface EventTms_out_hall_logProps {
|
|
24
|
-
onPress: (type: string, title: string) => void
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface HallOutLogItem {
|
|
28
|
-
text: string
|
|
29
|
-
subtitle: string
|
|
30
|
-
value: string
|
|
31
|
-
onPress: () => void
|
|
32
|
-
valuecolor?: string
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function Item(props: HallOutLogItem) {
|
|
36
|
-
return (
|
|
37
|
-
<Pressable
|
|
38
|
-
onPress={() => {
|
|
39
|
-
props.onPress()
|
|
40
|
-
}} style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center', marginHorizontal: 15, paddingVertical: 6, borderBottomWidth: 1, borderBottomColor: LibStyle.colorLightGrey }}>
|
|
41
|
-
<View>
|
|
42
|
-
<LibTextstyle text={props.text} textStyle="subhead" />
|
|
43
|
-
<Text style={{ letterSpacing: 0.5, marginTop: 3, fontSize: 12, color: LibStyle.colorBrown }}>{props.subtitle}</Text>
|
|
44
|
-
</View>
|
|
45
|
-
<LibTextstyle text={LibUtils.number(props.value)} style={{ color: props.valuecolor ? props.valuecolor : "#000" }} textStyle="title2" />
|
|
46
|
-
</Pressable>
|
|
47
|
-
)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export default function m(props: EventTms_out_hall_logProps): any {
|
|
51
|
-
const logHallOut = EventTms_homeProperty.counterState().useSelector(s => s)
|
|
52
|
-
const backupHallOut = EventTms_out_hall_successProperty.syncHallOut().useSelector(s => s)
|
|
53
|
-
const [loading, setLoading] = useSafeState<boolean>(true)
|
|
54
|
-
const timeout = useTimeout()
|
|
55
|
-
|
|
56
|
-
function syncHallOutData() {
|
|
57
|
-
EventTms_homeProperty.subscribeSyncHallOut().trigger(EventTms_out_hall_successProperty.syncHallOut().get())
|
|
58
|
-
timeout(() => {
|
|
59
|
-
setLoading(false)
|
|
60
|
-
}, 1000)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function forceSyncHallOutData() {
|
|
64
|
-
EventTms_homeProperty.subscribeSyncHallOutReset().trigger(EventTms_out_hall_successProperty.syncHallOut().get())
|
|
65
|
-
timeout(() => {
|
|
66
|
-
setLoading(false)
|
|
67
|
-
}, 1000)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
useEffect(() => {
|
|
71
|
-
syncHallOutData()
|
|
72
|
-
}, [])
|
|
73
|
-
|
|
74
|
-
if (loading) {
|
|
75
|
-
return <LibLoading />
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const sumValue = EventTms_logProperty.sumValuesPerCategory(logHallOut)
|
|
79
|
-
|
|
80
|
-
return (
|
|
81
|
-
<View style={{ flex: 1, backgroundColor: '#fff', margin: 17, marginTop: 0, paddingBottom: 10, marginBottom: 0, borderBottomRightRadius: 10, borderBottomLeftRadius: 10, ...LibStyle.elevation(2) }}>
|
|
82
|
-
<Item subtitle={esp.lang("event/tms_out_hall_log", "ticket_scanned_hall_out")} text={esp.lang("event/tms_out_hall_log", "scan_hall_out")} value={sumValue?.hall_out_scan} onPress={() => {
|
|
83
|
-
if (sumValue?.hall_out_scan) {
|
|
84
|
-
props.onPress("hall_out_scan", esp.lang("event/tms_out_hall_log", "scan_hall_out"))
|
|
85
|
-
}
|
|
86
|
-
}} />
|
|
87
|
-
<Item subtitle={esp.lang("event/tms_out_hall_log", "scanned_ticket_hall_put")} text={esp.lang("event/tms_out_hall_log", "qty_scan_hall_out")} value={sumValue?.hall_out_ticket} onPress={() => {
|
|
88
|
-
if (sumValue?.hall_out_ticket) {
|
|
89
|
-
props.onPress("hall_out_ticket", esp.lang("event/tms_out_hall_log", "qty_scan_hall_out"))
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
}} />
|
|
93
|
-
<Item subtitle={esp.lang("event/tms_out_hall_log", "ticket_success_scanned_hall_out")} text={esp.lang("event/tms_out_hall_log", "opengate_hall_out")} value={sumValue?.hall_out_opengate} onPress={() => {
|
|
94
|
-
if (sumValue?.hall_out_opengate) {
|
|
95
|
-
props.onPress("hall_out_opengate", esp.lang("event/tms_out_hall_log", "opengate_hall_out"))
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
}} />
|
|
99
|
-
<Item subtitle={esp.lang("event/tms_out_hall_log", "idcard_scanned_hall_out")} text={esp.lang("event/tms_out_hall_log", "opengate_hall_out_idcard")} value={sumValue?.hall_out_opengate_idcard} onPress={() => {
|
|
100
|
-
if (sumValue?.hall_out_opengate_idcard) {
|
|
101
|
-
props.onPress("hall_out_opengate_idcard", esp.lang("event/tms_out_hall_log", "opengate_hall_out_idcard"))
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
}} />
|
|
105
|
-
<Item subtitle={esp.lang("event/tms_out_hall_log", "data_send_to_server")} text={esp.lang("event/tms_out_hall_log", "data_send")} value={sumValue?.hall_out_send} onPress={() => {
|
|
106
|
-
if (sumValue?.hall_out_send) {
|
|
107
|
-
props.onPress("hall_out_send", esp.lang("event/tms_out_hall_log", "data_send"))
|
|
108
|
-
}
|
|
109
|
-
}} />
|
|
110
|
-
<Item subtitle={esp.lang("event/tms_out_hall_log", "data_not_send_to_server")} text={esp.lang("event/tms_out_hall_log", "data_not_send")} valuecolor={LibStyle.colorRed} value={backupHallOut.length} onPress={() => {
|
|
111
|
-
|
|
112
|
-
}} />
|
|
113
|
-
|
|
114
|
-
<View style={{ marginHorizontal: 15 }} >
|
|
115
|
-
<UseCondition
|
|
116
|
-
if={backupHallOut.length == 0}
|
|
117
|
-
fallback={
|
|
118
|
-
<Pressable onPress={() => {
|
|
119
|
-
setLoading(true)
|
|
120
|
-
forceSyncHallOutData()
|
|
121
|
-
}}>
|
|
122
|
-
<Text allowFontScaling={false} style={{ textAlign: 'center' }}>{esp.lang("event/tms_out_hall_log", "wait")}<Text style={{ color: LibStyle.colorBlue, textDecorationStyle: 'solid', textDecorationLine: 'underline' }}>{esp.lang("event/tms_out_hall_log", "click")}</Text> {esp.lang("event/tms_out_hall_log", "retry")}</Text>
|
|
123
|
-
</Pressable>
|
|
124
|
-
} >
|
|
125
|
-
<LibTextstyle textStyle='callout'
|
|
126
|
-
style={{ textAlign: 'center', marginTop: 15 }}
|
|
127
|
-
text={esp.lang("event/tms_out_hall_log", "all_data_send")} />
|
|
128
|
-
</UseCondition>
|
|
129
|
-
</View>
|
|
130
|
-
|
|
131
|
-
</View >
|
|
132
|
-
)
|
|
133
|
-
}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
// withHooks
|
|
2
|
-
import { useEffect, useRef } from 'react';
|
|
3
|
-
|
|
4
|
-
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
5
|
-
import { LibObject } from 'esoftplay/cache/lib/object/import';
|
|
6
|
-
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
7
|
-
import { LibStatusbar } from 'esoftplay/cache/lib/statusbar/import';
|
|
8
|
-
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
9
|
-
import useGlobalState, { useGlobalReturn } from 'esoftplay/global';
|
|
10
|
-
import { LinearGradient } from 'expo-linear-gradient';
|
|
11
|
-
|
|
12
|
-
import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
|
|
13
|
-
import esp from 'esoftplay/esp';
|
|
14
|
-
import useSafeState from 'esoftplay/state';
|
|
15
|
-
import React from 'react';
|
|
16
|
-
import { Animated, Easing, Pressable, Text, View } from 'react-native';
|
|
17
|
-
|
|
18
|
-
export interface EventTms_out_hall_successArgs {
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
export interface EventTms_out_hall_successProps {
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const dataListHallOut = useGlobalState<any[]>([], { persistKey: 'ticket_list_hall_out', loadOnInit: true, inFastStorage: true })
|
|
26
|
-
export function syncHallOut(): useGlobalReturn<any[]> {
|
|
27
|
-
return dataListHallOut
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default function m(props: EventTms_out_hall_successProps): any {
|
|
31
|
-
const { scan_type, data, url, post, url_ticket_update, url_ticket_detail, price_type, gate_type, event_id, selectGate, typeScanner, event_title, configPriority }: any = LibNavigation.getArgsAll<any>(props)
|
|
32
|
-
|
|
33
|
-
const [isPaused, setIsPaused] = useSafeState<boolean>(false)
|
|
34
|
-
const progress = useRef(new Animated.Value(0)).current;
|
|
35
|
-
const animation = useRef<Animated.CompositeAnimation | null>(null);
|
|
36
|
-
const [pausedValue, setPausedValue] = useSafeState(0);
|
|
37
|
-
|
|
38
|
-
function animateProgressBar() {
|
|
39
|
-
const duration = 1000; // Ubah durasi animasi sesuai kebutuhan Anda
|
|
40
|
-
|
|
41
|
-
if (!isPaused) {
|
|
42
|
-
animation.current = Animated.timing(progress, {
|
|
43
|
-
toValue: 1,
|
|
44
|
-
duration: duration - duration * pausedValue,
|
|
45
|
-
easing: Easing.linear,
|
|
46
|
-
useNativeDriver: false,
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
animation.current.start(({ finished }) => {
|
|
50
|
-
if (finished) {
|
|
51
|
-
setIsPaused(false);
|
|
52
|
-
setPausedValue(0);
|
|
53
|
-
|
|
54
|
-
// script next nya disini
|
|
55
|
-
LibNavigation.replace('component/scanner', {
|
|
56
|
-
selectGate: selectGate,
|
|
57
|
-
fromPage: 'event/tms_home',
|
|
58
|
-
event_id: event_id,
|
|
59
|
-
event_title: event_title,
|
|
60
|
-
typeScanner: typeScanner,
|
|
61
|
-
gate_type: gate_type,
|
|
62
|
-
price_type: price_type,
|
|
63
|
-
url_ticket_detail: url_ticket_detail,
|
|
64
|
-
url_ticket_update: url_ticket_update,
|
|
65
|
-
configPriority: configPriority,
|
|
66
|
-
scan_type: scan_type
|
|
67
|
-
})
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
} else {
|
|
71
|
-
if (animation.current) {
|
|
72
|
-
animation.current.stop(); // Hentikan animasi
|
|
73
|
-
animation.current = null;
|
|
74
|
-
}
|
|
75
|
-
setPausedValue(progress._value);
|
|
76
|
-
}
|
|
77
|
-
setIsPaused(!isPaused);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
useEffect(() => {
|
|
81
|
-
dataListHallOut.get()
|
|
82
|
-
EventTms_homeProperty.addCounterHallOutOpenGate(1, "0")
|
|
83
|
-
createDataHallOut()
|
|
84
|
-
animateProgressBar()
|
|
85
|
-
}, [])
|
|
86
|
-
|
|
87
|
-
function createDataHallOut() {
|
|
88
|
-
dataListHallOut.set(LibObject.push(dataListHallOut.get(), [url, post])())
|
|
89
|
-
EventTms_homeProperty.subscribeSyncHallOut().trigger(dataListHallOut.get())
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const widthInterpolate = progress.interpolate({
|
|
93
|
-
inputRange: [0, 1],
|
|
94
|
-
outputRange: ['0%', '100%'],
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
return (
|
|
98
|
-
<View style={{ flex: 1 }}>
|
|
99
|
-
<LibStatusbar style='light' />
|
|
100
|
-
<Pressable
|
|
101
|
-
onPressIn={animateProgressBar}
|
|
102
|
-
onPressOut={animateProgressBar}
|
|
103
|
-
style={{ backgroundColor: '#000', height: LibStyle.height }}>
|
|
104
|
-
<LibPicture source={{ uri: 'https://www.w3schools.com/howto/img_avatar.png' }} style={{ width: LibStyle.width, height: LibStyle.height - (LibStyle.height / 4) }} resizeMode={"cover"} />
|
|
105
|
-
|
|
106
|
-
<View style={{ marginTop: LibStyle.STATUSBAR_HEIGHT + 5, alignSelf: 'center', height: 5, width: LibStyle.width - 20, backgroundColor: 'rgba(255,255,255,0.3)', borderRadius: 10, position: 'absolute', top: 5, }}>
|
|
107
|
-
<Animated.View style={{ width: widthInterpolate, height: 5, backgroundColor: LibStyle.colorPrimary, borderRadius: 10, }} />
|
|
108
|
-
</View>
|
|
109
|
-
|
|
110
|
-
<LinearGradient
|
|
111
|
-
// Background Linear Gradient
|
|
112
|
-
style={{
|
|
113
|
-
height: LibStyle.height - (LibStyle.height / 3),
|
|
114
|
-
width: LibStyle.width,
|
|
115
|
-
position: 'absolute',
|
|
116
|
-
left: 0,
|
|
117
|
-
right: 0,
|
|
118
|
-
bottom: 0,
|
|
119
|
-
}}
|
|
120
|
-
colors={['rgba(255,255,255,0)', 'rgba(0,0,0,0.55)', 'rgba(0,0,0,1)', 'rgba(0,0,0,1)']}>
|
|
121
|
-
<View style={{ flex: 1, padding: 15, justifyContent: 'flex-end', paddingBottom: 100, alignContent: 'center', alignItems: 'center' }}>
|
|
122
|
-
<Text allowFontScaling={false} style={{ textAlign: 'center', flexWrap: 'wrap', fontSize: 35, letterSpacing: 2, fontWeight: '900', color: '#fff' }}>{data[0]?.price_name}</Text>
|
|
123
|
-
<Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 26, marginTop: 20, color: '#fff' }}>{esp.lang("event/tms_out_hall_success", "exit")}</Text>
|
|
124
|
-
</View>
|
|
125
|
-
|
|
126
|
-
</LinearGradient>
|
|
127
|
-
</Pressable>
|
|
128
|
-
</View>
|
|
129
|
-
)
|
|
130
|
-
}
|