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_in_log.tsx
DELETED
|
@@ -1,134 +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_in_hall_successProperty } from 'esoftplay/cache/event/tms_in_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
|
-
export interface EventTms_in_hall_logArgs {
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
export interface EventTms_in_hall_logProps {
|
|
23
|
-
onPress: (type: string, title: string) => void
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface HallInLogItem {
|
|
27
|
-
text: string
|
|
28
|
-
subtitle: string
|
|
29
|
-
value: string
|
|
30
|
-
onPress: () => void
|
|
31
|
-
valuecolor?: string
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function Item(props: HallInLogItem) {
|
|
35
|
-
return (
|
|
36
|
-
<Pressable
|
|
37
|
-
onPress={() => {
|
|
38
|
-
props.onPress()
|
|
39
|
-
}} style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center', marginHorizontal: 15, paddingVertical: 6, borderBottomWidth: 1, borderBottomColor: LibStyle.colorLightGrey }}>
|
|
40
|
-
<View>
|
|
41
|
-
<LibTextstyle text={props.text} textStyle="subhead" />
|
|
42
|
-
<Text style={{ letterSpacing: 0.5, marginTop: 3, fontSize: 12, color: LibStyle.colorBrown }}>{props.subtitle}</Text>
|
|
43
|
-
</View>
|
|
44
|
-
<LibTextstyle text={LibUtils.number(props.value)} style={{ color: props.valuecolor ? props.valuecolor : "#000" }} textStyle="title2" />
|
|
45
|
-
</Pressable>
|
|
46
|
-
)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export default function m(props: EventTms_in_hall_logProps): any {
|
|
50
|
-
|
|
51
|
-
const logHallIn = EventTms_homeProperty.counterState().useSelector(s => s)
|
|
52
|
-
const backupHallIn = EventTms_in_hall_successProperty.syncHallIn().useSelector(s => s)
|
|
53
|
-
const [loading, setLoading] = useSafeState<boolean>(true)
|
|
54
|
-
const timeout = useTimeout()
|
|
55
|
-
|
|
56
|
-
function syncHallInData() {
|
|
57
|
-
EventTms_homeProperty.subscribeSyncHallIn().trigger(EventTms_in_hall_successProperty.syncHallIn().get())
|
|
58
|
-
timeout(() => {
|
|
59
|
-
setLoading(false)
|
|
60
|
-
}, 1000)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function forceSyncHallInData() {
|
|
64
|
-
EventTms_homeProperty.subscribeSyncHallInReset().trigger(EventTms_in_hall_successProperty.syncHallIn().get())
|
|
65
|
-
timeout(() => {
|
|
66
|
-
setLoading(false)
|
|
67
|
-
}, 1000)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
useEffect(() => {
|
|
71
|
-
syncHallInData()
|
|
72
|
-
}, [])
|
|
73
|
-
|
|
74
|
-
if (loading) {
|
|
75
|
-
return <LibLoading />
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
let sumValue = EventTms_logProperty.sumValuesPerCategory(logHallIn)
|
|
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
|
-
|
|
83
|
-
<Item subtitle={esp.lang("event/tms_in_hall_log", "ticket_scanned_hall_in")} text={esp.lang("event/tms_in_hall_log", "scan_hall_in")} value={sumValue?.hall_in_scan} onPress={() => {
|
|
84
|
-
if (sumValue?.hall_in_scan) {
|
|
85
|
-
props.onPress("hall_in_scan", esp.lang("event/tms_in_hall_log", "scan_hall_in"))
|
|
86
|
-
}
|
|
87
|
-
}} />
|
|
88
|
-
<Item subtitle={esp.lang("event/tms_in_hall_log", "qty_scanned_hall_in")} text={esp.lang("event/tms_in_hall_log", "qty_scan_hall_in")} value={sumValue?.hall_in_ticket} onPress={() => {
|
|
89
|
-
if (sumValue?.hall_in_ticket) {
|
|
90
|
-
props.onPress("hall_in_ticket", esp.lang("event/tms_in_hall_log", "qty_scan_hall_in"))
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
}} />
|
|
94
|
-
<Item subtitle={esp.lang("event/tms_in_hall_log", "ticket_success_hall_in")} text={esp.lang("event/tms_in_hall_log", "opengate_hall_in")} value={sumValue?.hall_in_opengate} onPress={() => {
|
|
95
|
-
if (sumValue?.hall_in_opengate) {
|
|
96
|
-
props.onPress("hall_in_opengate", esp.lang("event/tms_in_hall_log", "opengate_hall_in"))
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
}} />
|
|
100
|
-
<Item subtitle={esp.lang("event/tms_in_hall_log", "idcard_scanned_hall_in")} text={esp.lang("event/tms_in_hall_log", "opengate_hall_in_idcard")} value={sumValue?.hall_in_opengate_idcard} onPress={() => {
|
|
101
|
-
if (sumValue?.hall_in_opengate_idcard) {
|
|
102
|
-
props.onPress("hall_in_opengate_idcard", esp.lang("event/tms_in_hall_log", "opengate_hall_in_idcard"))
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
}} />
|
|
106
|
-
<Item subtitle={esp.lang("event/tms_in_hall_log", "data_send_to_server")} text={esp.lang("event/tms_in_hall_log", "data_send")} value={sumValue?.hall_in_send} onPress={() => {
|
|
107
|
-
if (sumValue?.hall_in_send) {
|
|
108
|
-
props.onPress("hall_in_send", esp.lang("event/tms_in_hall_log", "data_send"))
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
}} />
|
|
112
|
-
<Item subtitle={esp.lang("event/tms_in_hall_log", "data_not_send_to_server")} text={esp.lang("event/tms_in_hall_log", "data_not_send")} valuecolor={LibStyle.colorRed} value={backupHallIn.length} onPress={() => {
|
|
113
|
-
|
|
114
|
-
}} />
|
|
115
|
-
|
|
116
|
-
<View style={{ marginHorizontal: 15 }} >
|
|
117
|
-
<UseCondition
|
|
118
|
-
if={backupHallIn.length == 0}
|
|
119
|
-
fallback={
|
|
120
|
-
<Pressable onPress={() => {
|
|
121
|
-
setLoading(true)
|
|
122
|
-
forceSyncHallInData()
|
|
123
|
-
}}>
|
|
124
|
-
<Text allowFontScaling={false} style={{ textAlign: 'center' }}>{esp.lang("event/tms_in_hall_log", "wait")}<Text style={{ color: LibStyle.colorBlue, textDecorationStyle: 'solid', textDecorationLine: 'underline' }}>{esp.lang("event/tms_in_hall_log", "click")}</Text> {esp.lang("event/tms_in_hall_log", "retry")}</Text>
|
|
125
|
-
</Pressable>
|
|
126
|
-
} >
|
|
127
|
-
<LibTextstyle textStyle='callout'
|
|
128
|
-
style={{ textAlign: 'center', marginTop: 15 }}
|
|
129
|
-
text={esp.lang("event/tms_in_hall_log", "already_scan")} />
|
|
130
|
-
</UseCondition>
|
|
131
|
-
</View>
|
|
132
|
-
</View >
|
|
133
|
-
)
|
|
134
|
-
}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
// withHooks
|
|
2
|
-
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
3
|
-
import { LibObject } from 'esoftplay/cache/lib/object/import';
|
|
4
|
-
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
5
|
-
import { LibStatusbar } from 'esoftplay/cache/lib/statusbar/import';
|
|
6
|
-
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
7
|
-
import useGlobalState, { useGlobalReturn } from 'esoftplay/global';
|
|
8
|
-
import { LinearGradient } from 'expo-linear-gradient';
|
|
9
|
-
import { useEffect, useRef } from 'react';
|
|
10
|
-
|
|
11
|
-
import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
|
|
12
|
-
import esp from 'esoftplay/esp';
|
|
13
|
-
import useSafeState from 'esoftplay/state';
|
|
14
|
-
import React from 'react';
|
|
15
|
-
import { Animated, Easing, Pressable, Text, View } from 'react-native';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export interface EventTms_in_hall_successArgs {
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
export interface EventTms_in_hall_successProps {
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const dataListHallIn = useGlobalState<any[]>([], { persistKey: 'ticket_list_hall_in', loadOnInit: true, inFastStorage: true })
|
|
26
|
-
export function syncHallIn(): useGlobalReturn<any[]> {
|
|
27
|
-
return dataListHallIn
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default function m(props: EventTms_in_hall_successProps): any {
|
|
31
|
-
|
|
32
|
-
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)
|
|
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
|
-
|
|
78
|
-
setIsPaused(!isPaused);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
useEffect(() => {
|
|
82
|
-
dataListHallIn.get()
|
|
83
|
-
EventTms_homeProperty.addCounterHallInGate(1, data[0]?.price_id)
|
|
84
|
-
createDataHallIn()
|
|
85
|
-
animateProgressBar()
|
|
86
|
-
}, [])
|
|
87
|
-
|
|
88
|
-
function createDataHallIn() {
|
|
89
|
-
dataListHallIn.set(LibObject.push(dataListHallIn.get(), [url, post])())
|
|
90
|
-
EventTms_homeProperty.subscribeSyncHallIn().trigger(dataListHallIn.get())
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const widthInterpolate = progress.interpolate({
|
|
94
|
-
inputRange: [0, 1],
|
|
95
|
-
outputRange: ['0%', '100%'],
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return (
|
|
100
|
-
<View style={{ flex: 1 }}>
|
|
101
|
-
<LibStatusbar style='light' />
|
|
102
|
-
<Pressable
|
|
103
|
-
onPressIn={animateProgressBar}
|
|
104
|
-
onPressOut={animateProgressBar}
|
|
105
|
-
style={{ backgroundColor: '#000', height: LibStyle.height }}>
|
|
106
|
-
<LibPicture source={{ uri: 'https://www.w3schools.com/howto/img_avatar.png' }} style={{ width: LibStyle.width, height: LibStyle.height - (LibStyle.height / 4) }} resizeMode={"cover"} />
|
|
107
|
-
|
|
108
|
-
<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, }}>
|
|
109
|
-
<Animated.View style={{ width: widthInterpolate, height: 5, backgroundColor: LibStyle.colorPrimary, borderRadius: 10, }} />
|
|
110
|
-
</View>
|
|
111
|
-
|
|
112
|
-
<LinearGradient
|
|
113
|
-
// Background Linear Gradient
|
|
114
|
-
style={{
|
|
115
|
-
height: LibStyle.height - (LibStyle.height / 3),
|
|
116
|
-
width: LibStyle.width,
|
|
117
|
-
position: 'absolute',
|
|
118
|
-
left: 0,
|
|
119
|
-
right: 0,
|
|
120
|
-
bottom: 0,
|
|
121
|
-
}}
|
|
122
|
-
colors={['rgba(255,255,255,0)', 'rgba(0,0,0,0.55)', 'rgba(0,0,0,1)', 'rgba(0,0,0,1)']}>
|
|
123
|
-
<View style={{ flex: 1, padding: 15, justifyContent: 'flex-end', paddingBottom: 100, alignContent: 'center', alignItems: 'center' }}>
|
|
124
|
-
<Text allowFontScaling={false} style={{ textAlign: 'center', flexWrap: 'wrap', fontSize: 35, letterSpacing: 2, fontWeight: '900', color: '#fff' }}>{data[0]?.price_name}</Text>
|
|
125
|
-
<Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 26, marginTop: 20, color: '#fff' }}>{esp.lang("event/tms_in_hall_success", "entrance")}</Text>
|
|
126
|
-
</View>
|
|
127
|
-
|
|
128
|
-
</LinearGradient>
|
|
129
|
-
</Pressable>
|
|
130
|
-
</View>
|
|
131
|
-
)
|
|
132
|
-
}
|
package/event/hall_out.tsx
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
// withHooks
|
|
2
|
-
|
|
3
|
-
import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
|
|
4
|
-
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
5
|
-
import { LibLoading } from 'esoftplay/cache/lib/loading/import';
|
|
6
|
-
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
7
|
-
import { LibObject } from 'esoftplay/cache/lib/object/import';
|
|
8
|
-
import { UserClass } from 'esoftplay/cache/user/class/import';
|
|
9
|
-
import React, { useEffect } from 'react';
|
|
10
|
-
import { View } from 'react-native';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export interface EventTms_out_hallArgs {
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
export interface EventTms_out_hallProps {
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
export default function m(props: EventTms_out_hallProps): any {
|
|
20
|
-
const { scan_type, url_ticket_update, url_ticket_detail, price_type, gate_type, qr_code, event_id, email, selectGate, typeScanner, event_title, configPriority }: any = LibNavigation.getArgsAll<any>(props)
|
|
21
|
-
|
|
22
|
-
let args = {
|
|
23
|
-
selectGate: selectGate,
|
|
24
|
-
fromPage: 'event/tms_home',
|
|
25
|
-
event_id: event_id,
|
|
26
|
-
event_title: event_title,
|
|
27
|
-
typeScanner: typeScanner,
|
|
28
|
-
gate_type: gate_type,
|
|
29
|
-
price_type: price_type,
|
|
30
|
-
url_ticket_detail: url_ticket_detail,
|
|
31
|
-
url_ticket_update: url_ticket_update,
|
|
32
|
-
configPriority: configPriority,
|
|
33
|
-
scan_type: scan_type
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
loadData()
|
|
38
|
-
}, [])
|
|
39
|
-
|
|
40
|
-
function loadData() {
|
|
41
|
-
EventTms_homeProperty.addCounterHallOutScan(1, "0")
|
|
42
|
-
|
|
43
|
-
var post = {
|
|
44
|
-
event_id: event_id,
|
|
45
|
-
user_qr: email ? "" : qr_code,
|
|
46
|
-
hall_id: selectGate?.id,
|
|
47
|
-
email: email ? email : "",
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
let ticketsData: any[] = [];
|
|
51
|
-
|
|
52
|
-
new LibCurl('event_tms_hall_out', post, (res) => {
|
|
53
|
-
res?.list?.forEach((item: any, i: number) => {
|
|
54
|
-
let foundIndex = ticketsData.findIndex((x: any) => x.price_id == item.price_id);
|
|
55
|
-
|
|
56
|
-
let newItem = {
|
|
57
|
-
...item,
|
|
58
|
-
checked: 0
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (foundIndex != -1) {
|
|
62
|
-
ticketsData[foundIndex].list.push(newItem);
|
|
63
|
-
ticketsData[foundIndex].qty += 1
|
|
64
|
-
} else {
|
|
65
|
-
ticketsData.push({
|
|
66
|
-
price_id: item.price_id,
|
|
67
|
-
price_name: item.price_name,
|
|
68
|
-
qty: 1,
|
|
69
|
-
list: [newItem]
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
if (res?.hasOwnProperty("staff") && res?.staff?.length > 0) {
|
|
75
|
-
res?.staff?.map((it: any) => {
|
|
76
|
-
let x = {
|
|
77
|
-
...it,
|
|
78
|
-
price_id: "staff",
|
|
79
|
-
user_name: it.name,
|
|
80
|
-
user_image: it.image,
|
|
81
|
-
exhibitor_name: it.department_name + "-" + it.exhibitor_name,
|
|
82
|
-
checked: 0
|
|
83
|
-
}
|
|
84
|
-
ticketsData.push(x)
|
|
85
|
-
})
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (ticketsData.length == 1) { // cek jika tiket cuma 1
|
|
89
|
-
let tiket = ticketsData[0]
|
|
90
|
-
if (tiket.price_id == "staff") { // jika itu adalah id card
|
|
91
|
-
if (tiket.status_scanned == 2) {
|
|
92
|
-
/* 0 tidak diperbolehkan, 1 sudah didalam, 2 available */
|
|
93
|
-
LibNavigation.replace('event/tms_idcard', {
|
|
94
|
-
selectedTicket: { ...tiket, key: qr_code },
|
|
95
|
-
hall: "out",
|
|
96
|
-
...args
|
|
97
|
-
})
|
|
98
|
-
} else {
|
|
99
|
-
let err = {
|
|
100
|
-
message: tiket.status_label,
|
|
101
|
-
result: tiket.scanned_detail
|
|
102
|
-
}
|
|
103
|
-
LibNavigation.replace('event/tms_out_hall_failed', { msgError: err, ...args, postGetData: post })
|
|
104
|
-
}
|
|
105
|
-
} else { // jika itu adalah tiket
|
|
106
|
-
if (tiket.list?.length > 1) { // jika tiket itu mempunyai banyak qty
|
|
107
|
-
LibNavigation.replace('event/tms_out_hall_list', { data: ticketsData, ...args })
|
|
108
|
-
} else { // jika tiket itu cuma 1 qty
|
|
109
|
-
let defaultUse = LibObject.set(tiket?.list, tiket?.list?.[0]?.status_scanned != 2 ? 1 : 0)(0, 'checked')
|
|
110
|
-
let a = defaultUse?.filter((item: any) => item.checked == 1 && item.status_scanned != 2).map((it: any) => it.id)
|
|
111
|
-
let postOut = {
|
|
112
|
-
event_id: event_id,
|
|
113
|
-
ids: JSON.stringify(a),
|
|
114
|
-
hall_id: selectGate?.id,
|
|
115
|
-
trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
|
|
116
|
-
price_id: defaultUse?.filter((item: any) => item.checked == 1 && item.status_scanned != 2).map((it: any) => it.price_id)
|
|
117
|
-
}
|
|
118
|
-
if (a.length > 0) { // jika tiket itu bisa di pakai
|
|
119
|
-
let urlOut = "event_tms_hall_out_confirm"
|
|
120
|
-
LibNavigation.replace('event/tms_out_hall_success', { data: [tiket], ...args, url: urlOut, post: postOut })
|
|
121
|
-
} else { // jika tiket itu tidak bisa dipakai
|
|
122
|
-
let err = {
|
|
123
|
-
message: tiket?.list?.[0]?.status_label,
|
|
124
|
-
}
|
|
125
|
-
LibNavigation.replace('event/tms_out_hall_failed', { msgError: err, ...args, postGetData: post })
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
} else { // jika punya tiket banyak
|
|
130
|
-
LibNavigation.replace('event/tms_out_hall_list', { data: ticketsData, ...args })
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}, (error) => {
|
|
135
|
-
LibNavigation.replace('event/tms_out_hall_failed', { msgError: error, ...args, postGetData: post })
|
|
136
|
-
}, 1)
|
|
137
|
-
}
|
|
138
|
-
return (
|
|
139
|
-
<View style={{ flex: 1, backgroundColor: '#fff', alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
|
|
140
|
-
<LibLoading />
|
|
141
|
-
</View>
|
|
142
|
-
)
|
|
143
|
-
}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
// withHooks
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
|
-
|
|
4
|
-
import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
|
|
5
|
-
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
6
|
-
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
7
|
-
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
8
|
-
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
9
|
-
import { LibStatusbar } from 'esoftplay/cache/lib/statusbar/import';
|
|
10
|
-
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
11
|
-
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
12
|
-
import { UserClass } from 'esoftplay/cache/user/class/import';
|
|
13
|
-
import esp from 'esoftplay/esp';
|
|
14
|
-
import React from 'react';
|
|
15
|
-
import { Pressable, ScrollView, Text, View } from 'react-native';
|
|
16
|
-
|
|
17
|
-
export interface EventTms_out_hall_failedArgs {
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
export interface EventTms_out_hall_failedProps {
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
export default function m(props: EventTms_out_hall_failedProps): any {
|
|
24
|
-
const { scan_type, msgError, postGetData, url_ticket_update, url_ticket_detail, price_type, gate_type, event_id, selectGate, typeScanner, event_title, configPriority }: any = LibNavigation.getArgsAll<any>(props)
|
|
25
|
-
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
EventTms_homeProperty.addCounterHallOutScanFailed(1, "0")
|
|
28
|
-
}, [])
|
|
29
|
-
|
|
30
|
-
function getBack() {
|
|
31
|
-
LibNavigation.replace('component/scanner', {
|
|
32
|
-
selectGate: selectGate,
|
|
33
|
-
fromPage: 'event/tms_home',
|
|
34
|
-
event_id: event_id,
|
|
35
|
-
event_title: event_title,
|
|
36
|
-
typeScanner: typeScanner,
|
|
37
|
-
gate_type: gate_type,
|
|
38
|
-
price_type: price_type,
|
|
39
|
-
url_ticket_detail: url_ticket_detail,
|
|
40
|
-
url_ticket_update: url_ticket_update,
|
|
41
|
-
configPriority: configPriority,
|
|
42
|
-
scan_type: scan_type
|
|
43
|
-
})
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function sendTelegram() {
|
|
47
|
-
let data = {
|
|
48
|
-
'#bbohallout': ":",
|
|
49
|
-
reporter: {
|
|
50
|
-
email: UserClass.state().get().email,
|
|
51
|
-
name: UserClass.state().get().name
|
|
52
|
-
},
|
|
53
|
-
url: "event_tms_hall_out",
|
|
54
|
-
post: postGetData,
|
|
55
|
-
error_msg: msgError,
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
let post = {
|
|
59
|
-
text: String(JSON.stringify(data || {}, undefined, 2)).replace(/[\[\]\{\}\"]+/g, ''),
|
|
60
|
-
chat_id: '-1001737180019',
|
|
61
|
-
disable_web_page_preview: true
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
let _url = "https://api.telegram.org/bot923808407:AAEFBlllQNKCEn8E66fwEzCj5vs9qGwVGT4/sendMessage"
|
|
65
|
-
new LibCurl().custom(_url, post, (res, msg) => { })
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<View style={{ flex: 1 }}>
|
|
70
|
-
<LibStatusbar style='light' />
|
|
71
|
-
<View style={{ flex: 1 }}>
|
|
72
|
-
<LibPicture source={esp.assets('failed.png')} style={{ flex: 1, height: LibStyle.height, width: LibStyle.width }} /* resizeMode={"stretch"} */ />
|
|
73
|
-
</View>
|
|
74
|
-
<View style={{ position: 'absolute', top: 100, left: 0, right: 0, bottom: 0, alignItems: 'center', alignContent: 'center' }} >
|
|
75
|
-
<ScrollView>
|
|
76
|
-
<View style={{ marginBottom: 20, alignSelf: 'center', borderRadius: LibStyle.width / 3, padding: 10, backgroundColor: '#fff' }}>
|
|
77
|
-
<LibPicture
|
|
78
|
-
source={esp.assets('failed_icon.png')}
|
|
79
|
-
style={{ width: LibStyle.width / 3, height: LibStyle.width / 3 }}
|
|
80
|
-
/>
|
|
81
|
-
</View>
|
|
82
|
-
<Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 25, color: '#fff', marginHorizontal: 20, textAlign: 'center', letterSpacing: 1 }}>{msgError?.message}</Text>
|
|
83
|
-
|
|
84
|
-
{
|
|
85
|
-
msgError?.result?.length > 0 &&
|
|
86
|
-
<View style={{ marginTop: 15, flexDirection: 'row', justifyContent: 'space-between', backgroundColor: '#37c2d0', borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
|
|
87
|
-
<View style={{ flex: 1, justifyContent: 'center', borderRightWidth: 1, borderColor: LibStyle.colorBgGrey, paddingVertical: 5, padding: 5 }}>
|
|
88
|
-
<Text allowFontScaling={false} style={{ fontWeight: 'bold', textAlign: 'center', fontSize: 14 }}>{"TMS - Tipe Tiket"}</Text>
|
|
89
|
-
</View>
|
|
90
|
-
<View style={{ flex: 1, justifyContent: 'center', paddingVertical: 5 }}>
|
|
91
|
-
<Text allowFontScaling={false} style={{ fontWeight: 'bold', textAlign: 'center', fontSize: 14 }}>{esp.lang("event/tms_out_hall_failed", "history")}</Text>
|
|
92
|
-
</View>
|
|
93
|
-
</View>
|
|
94
|
-
}
|
|
95
|
-
{
|
|
96
|
-
msgError?.result?.length > 0 && msgError?.result?.map((item: any, i: number) => {
|
|
97
|
-
return (
|
|
98
|
-
<View key={i} style={{ backgroundColor: i % 2 ? '#fff' : LibStyle.colorGrey, flexDirection: 'row', justifyContent: 'space-between', borderBottomWidth: 1, borderBottomColor: LibStyle.colorBgGrey }}>
|
|
99
|
-
<View style={{ flex: 1, justifyContent: 'center', borderRightWidth: 1, borderColor: LibStyle.colorBgGrey, paddingVertical: 5, padding: 5 }}>
|
|
100
|
-
<Text allowFontScaling={false} numberOfLines={2} ellipsizeMode="tail" style={{ letterSpacing: 1, textAlign: 'center', fontSize: 12 }}>{item.hasOwnProperty("tms_email") ? item?.tms_email + "\n" + item?.price_name : item?.price_name}</Text>
|
|
101
|
-
</View>
|
|
102
|
-
<View style={{ flex: 1, justifyContent: 'center', paddingVertical: 5 }}>
|
|
103
|
-
{
|
|
104
|
-
item?.scanned != "0000-00-00 00:00:00" &&
|
|
105
|
-
<Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 12 }}>{LibUtils.moment(item.hall_scanned).localeFormat("DD MMM H:mm:ss ")}</Text>
|
|
106
|
-
}
|
|
107
|
-
</View>
|
|
108
|
-
</View>
|
|
109
|
-
)
|
|
110
|
-
})
|
|
111
|
-
}
|
|
112
|
-
</ScrollView>
|
|
113
|
-
|
|
114
|
-
<View style={{ flexDirection: 'row', width: LibStyle.width - 40, marginVertical: 10, justifyContent: 'space-between' }}>
|
|
115
|
-
<Pressable onPress={() => {
|
|
116
|
-
|
|
117
|
-
LibDialog.warningConfirm(esp.lang("event/tms_in_failed", "warn_title"), esp.lang("event/tms_in_failed", "warn_msg"), esp.lang("event/tms_in_failed", "warn_ok"), () => {
|
|
118
|
-
sendTelegram()
|
|
119
|
-
}, esp.lang("event/tms_in_failed", "warn_no"), () => { })
|
|
120
|
-
|
|
121
|
-
}} style={{ width: (LibStyle.width - 45) * 0.5, height: 43, borderRadius: 5, backgroundColor: LibStyle.colorRed, borderWidth: 3, borderColor: "#fff", justifyContent: 'center', alignContent: 'center', alignItems: 'center', ...LibStyle.elevation(10) }}>
|
|
122
|
-
<Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 12, fontWeight: 'bold', color: "#fff" }}>{esp.lang("event/tms_out_hall_failed", "report_error")}</Text>
|
|
123
|
-
</Pressable>
|
|
124
|
-
<Pressable onPress={getBack} style={{ width: (LibStyle.width - 45) * 0.5, height: 43, borderRadius: 5, backgroundColor: LibStyle.colorGreen, justifyContent: 'center', alignContent: 'center', alignItems: 'center', ...LibStyle.elevation(10) }}>
|
|
125
|
-
<Text allowFontScaling={false} style={{ fontSize: 14, fontWeight: 'bold', color: "#fff" }}>{esp.lang("event/tms_out_hall_failed", "back")}</Text>
|
|
126
|
-
</Pressable>
|
|
127
|
-
|
|
128
|
-
</View>
|
|
129
|
-
</View>
|
|
130
|
-
|
|
131
|
-
</View>
|
|
132
|
-
)
|
|
133
|
-
}
|