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.
Files changed (44) hide show
  1. package/config.json +1 -1
  2. package/event/artist.tsx +3 -6
  3. package/event/detail.tsx +0 -44
  4. package/event/order.tsx +2 -1
  5. package/event/order_detail.tsx +2 -4
  6. package/event/order_detail_upgrade_payment.tsx +13 -7
  7. package/event/order_detail_waiting.tsx +21 -9
  8. package/event/order_share_to.tsx +2 -2
  9. package/event/scan_item.tsx +2 -2
  10. package/event/seat_map_new.tsx +313 -0
  11. package/event/test.tsx +240 -155
  12. package/event/ticket_list.tsx +8 -5
  13. package/event/ticket_list2.tsx +1 -1
  14. package/event/tms_check_ticket_result.tsx +5 -5
  15. package/event/tms_in_failed.tsx +1 -1
  16. package/id.json +5 -4
  17. package/package.json +1 -1
  18. package/event/entrance.tsx +0 -215
  19. package/event/entrance_again.tsx +0 -199
  20. package/event/entrance_failed.tsx +0 -190
  21. package/event/entrance_idcard.tsx +0 -199
  22. package/event/entrance_list.tsx +0 -264
  23. package/event/entrance_list_item.tsx +0 -88
  24. package/event/entrance_log.tsx +0 -130
  25. package/event/entrance_success.tsx +0 -153
  26. package/event/entrance_warning.tsx +0 -91
  27. package/event/exit.tsx +0 -91
  28. package/event/exit_failed.tsx +0 -135
  29. package/event/exit_list.tsx +0 -118
  30. package/event/exit_log.tsx +0 -130
  31. package/event/exit_success.tsx +0 -143
  32. package/event/exit_temporary.tsx +0 -226
  33. package/event/hall_in.tsx +0 -148
  34. package/event/hall_in_failed.tsx +0 -270
  35. package/event/hall_in_list.tsx +0 -222
  36. package/event/hall_in_log.tsx +0 -134
  37. package/event/hall_in_success.tsx +0 -132
  38. package/event/hall_out.tsx +0 -143
  39. package/event/hall_out_failed.tsx +0 -133
  40. package/event/hall_out_list.tsx +0 -215
  41. package/event/hall_out_log.tsx +0 -133
  42. package/event/hall_out_success.tsx +0 -130
  43. package/event/log.tsx +0 -433
  44. package/event/seat_map_test.tsx +0 -401
@@ -1,130 +0,0 @@
1
- // withHooks
2
- import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
3
- import { EventTms_in_successProperty } from 'esoftplay/cache/event/tms_in_success/import';
4
- import { EventTms_logProperty } from 'esoftplay/cache/event/tms_log/import';
5
- import { LibLoading } from 'esoftplay/cache/lib/loading/import';
6
- import { LibStyle } from 'esoftplay/cache/lib/style/import';
7
- import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
8
- import { LibUtils } from 'esoftplay/cache/lib/utils/import';
9
- import { UseCondition } from 'esoftplay/cache/use/condition/import';
10
- import esp from 'esoftplay/esp';
11
- import useSafeState from 'esoftplay/state';
12
- import { useTimeout } from 'esoftplay/timeout';
13
- import React, { useEffect } from 'react';
14
- import { Pressable, Text, View } from 'react-native';
15
-
16
- export interface EventTms_in_logArgs {
17
-
18
- }
19
- export interface EventTms_in_logProps {
20
- onPress: (type: string, title: string) => void
21
- }
22
-
23
- export interface EntranceLogItem {
24
- text: string
25
- subtitle: string
26
- value: string
27
- onPress: () => void
28
- valuecolor?: string
29
- }
30
-
31
- function Item(props: EntranceLogItem) {
32
- return (
33
- <Pressable
34
- onPress={() => {
35
- props.onPress()
36
- }} style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center', marginHorizontal: 15, paddingVertical: 6, borderBottomWidth: 1, borderBottomColor: LibStyle.colorLightGrey }}>
37
- <View>
38
- <LibTextstyle text={props.text} textStyle="subhead" />
39
- <Text style={{ letterSpacing: 0.5, marginTop: 3, fontSize: 12, color: LibStyle.colorBrown }}>{props.subtitle}</Text>
40
- </View>
41
- <LibTextstyle text={LibUtils.number(props.value)} style={{ color: props.valuecolor ? props.valuecolor : "#000" }} textStyle="title2" />
42
- </Pressable>
43
- )
44
- }
45
-
46
- export default function m(props: EventTms_in_logProps): any {
47
- const log = EventTms_homeProperty.counterState().useSelector(s => s)
48
- const backup = EventTms_in_successProperty.syncUsedTiket().useSelector(s => s)
49
- const [loading, setLoading] = useSafeState<boolean>(true)
50
- const timeout = useTimeout()
51
-
52
- function syncData() {
53
- EventTms_homeProperty.subscribeSync().trigger(EventTms_in_successProperty.syncUsedTiket().get())
54
- timeout(() => {
55
- setLoading(false)
56
- }, 1000)
57
- }
58
-
59
- function forceSyncData() {
60
- EventTms_homeProperty.subscribeSyncReset().trigger(EventTms_in_successProperty.syncUsedTiket().get())
61
- timeout(() => {
62
- setLoading(false)
63
- }, 1000)
64
- }
65
-
66
- useEffect(() => {
67
- syncData()
68
- }, [])
69
-
70
- if (loading) {
71
- return <LibLoading />
72
- }
73
-
74
- const sumValue = EventTms_logProperty.sumValuesPerCategory(log)
75
-
76
- return (
77
- <View style={{ flex: 1, backgroundColor: '#fff', margin: 17, marginTop: 0, paddingBottom: 10, marginBottom: 0, borderBottomRightRadius: 10, borderBottomLeftRadius: 10, ...LibStyle.elevation(2) }}>
78
- <Item text='Scan' subtitle={esp.lang("event/tms_in_log", "ticket_scanned")} value={sumValue?.entrance_scan} onPress={() => {
79
- if (sumValue?.entrance_scan) {
80
- props.onPress("entrance_scan", esp.lang("event/tms_in_log", "scan_gate"))
81
- }
82
-
83
- }} />
84
- <Item text={esp.lang("event/tms_in_log", "qty_ticket_scan")} subtitle={esp.lang("event/tms_in_log", "qty_ticket_scanned")} value={sumValue?.entrance_ticket} onPress={() => {
85
- if (sumValue?.entrance_ticket) {
86
- props.onPress("entrance_ticket", esp.lang("event/tms_in_log", "qty_ticket_scan"))
87
- }
88
-
89
- }} />
90
- <Item text={esp.lang("event/tms_in_log", "open_gate")} subtitle={esp.lang("event/tms_in_log", "ticket_scanned_id")} value={sumValue?.entrance_opengate} onPress={() => {
91
- if (sumValue?.entrance_opengate) {
92
- props.onPress("entrance_opengate", esp.lang("event/tms_in_log", "open_gate"))
93
- }
94
- }} />
95
- <Item text={esp.lang("event/tms_in_log", "opengate_idcard")} subtitle={esp.lang("event/tms_in_log", "idcard_scanned_in")} value={sumValue?.entrance_opengate_idcard} onPress={() => {
96
- if (sumValue?.entrance_opengate_idcard) {
97
- props.onPress("entrance_opengate_idcard", esp.lang("event/tms_in_log", "opengate_idcard"))
98
- }
99
- }} />
100
- <Item text={esp.lang("event/tms_in_log", "data_send")} subtitle={esp.lang("event/tms_in_log", "data_send_to_server")} value={sumValue?.entrance_send} onPress={() => {
101
- if (sumValue?.entrance_send) {
102
- props.onPress("entrance_send", esp.lang("event/tms_in_log", "data_send"))
103
- }
104
-
105
- }} />
106
- <Item text={esp.lang("event/tms_in_log", "data_not_send")} subtitle={esp.lang("event/tms_in_log", "data_not_send_to_server")} value={backup.length} valuecolor={LibStyle.colorRed} onPress={() => {
107
-
108
- }} />
109
-
110
- <View style={{ marginHorizontal: 15 }} >
111
- <UseCondition
112
- if={backup.length == 0}
113
- fallback={
114
- <Pressable onPress={() => {
115
-
116
- setLoading(true)
117
- forceSyncData()
118
- }}>
119
- <Text allowFontScaling={false} style={{ textAlign: 'center' }}>{esp.lang("event/tms_in_log", "please_wait")}<Text style={{ color: LibStyle.colorBlue, textDecorationStyle: 'solid', textDecorationLine: 'underline' }}>{esp.lang("event/tms_in_log", "press_here")}</Text> {esp.lang("event/tms_in_log", "press_here2")}</Text>
120
- </Pressable>
121
- } >
122
- <LibTextstyle textStyle='callout'
123
- style={{ textAlign: 'center', marginTop: 10 }}
124
- text={esp.lang("event/tms_in_log", "all_data_send")} />
125
- </UseCondition>
126
- </View>
127
- </View >
128
- )
129
- }
130
-
@@ -1,153 +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 { LibUtils } from 'esoftplay/cache/lib/utils/import';
8
- import { UserClass } from 'esoftplay/cache/user/class/import';
9
- import { useRef } from 'react';
10
-
11
- import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
12
- import esp from 'esoftplay/esp';
13
- import useGlobalState, { useGlobalReturn } from 'esoftplay/global';
14
- import useSafeState from 'esoftplay/state';
15
- import { LinearGradient } from 'expo-linear-gradient';
16
- import React, { useEffect } from 'react';
17
- import { Animated, Easing, Pressable, Text, View } from 'react-native';
18
-
19
-
20
- export interface EventTms_in_successArgs {
21
-
22
- }
23
- export interface EventTms_in_successProps {
24
-
25
- }
26
-
27
- export const syncUsedTiketState = useGlobalState<any[]>([], { persistKey: 'event_entrance_success_tiket_sync', loadOnInit: true, inFastStorage: true })
28
- export function syncUsedTiket(): useGlobalReturn<any[]> {
29
- return syncUsedTiketState
30
- }
31
-
32
- export default function m(props: EventTms_in_successProps): any {
33
- const { scan_type, url_ticket_update, url_ticket_detail, price_type, selectedTicket, gate_type, qr_code, event_id, selectGate, typeScanner, event_title, qty, configPriority } = LibNavigation.getArgsAll<any>(props)
34
- // const { set } = EventFirebase_socket()
35
- const [isPaused, setIsPaused] = useSafeState<boolean>(false)
36
- const progress = useRef(new Animated.Value(0)).current;
37
- const animation = useRef<Animated.CompositeAnimation | null>(null);
38
- const [pausedValue, setPausedValue] = useSafeState(0);
39
-
40
- function animateProgressBar() {
41
- const duration = 1000; // Ubah durasi animasi sesuai kebutuhan Anda
42
-
43
- if (!isPaused) {
44
- animation.current = Animated.timing(progress, {
45
- toValue: 1,
46
- duration: duration - duration * pausedValue,
47
- easing: Easing.linear,
48
- useNativeDriver: false,
49
- });
50
-
51
- animation.current.start(({ finished }) => {
52
- if (finished) {
53
- setIsPaused(false);
54
- setPausedValue(0);
55
-
56
- // script next nya disini
57
- LibNavigation.replace('component/scanner', {
58
- selectGate: selectGate,
59
- fromPage: 'event/tms_home',
60
- event_id: event_id,
61
- event_title: event_title,
62
- typeScanner: typeScanner,
63
- gate_type: gate_type,
64
- price_type: price_type,
65
- url_ticket_detail: url_ticket_detail,
66
- url_ticket_update: url_ticket_update,
67
- configPriority: configPriority,
68
- scan_type: scan_type
69
- })
70
- }
71
- });
72
- } else {
73
- if (animation.current) {
74
- animation.current.stop(); // Hentikan animasi
75
- animation.current = null;
76
- }
77
- setPausedValue(progress._value);
78
- }
79
-
80
- setIsPaused(!isPaused);
81
- }
82
-
83
- let _qty = qty ? qty : 1
84
-
85
- useEffect(() => {
86
- entrance()
87
- animateProgressBar()
88
- }, [])
89
-
90
-
91
- function entrance() {
92
- useTicket()
93
- }
94
-
95
- function useTicket() {
96
- let url = url_ticket_update
97
-
98
- let post = {
99
- "target-url": `https://api.${esp.config().domain}/gate_checkin`,
100
- price_id: selectedTicket?.price_id,
101
- qr: encodeURIComponent(qr_code),
102
- trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
103
- event_id: event_id,
104
- gate_id: selectGate?.id,
105
- is_tms: 1,
106
- qty: _qty,
107
- tms_id: UserClass.state().get()?.id,
108
- scanned: LibUtils.moment().format('YYYY-MM-DD HH:mm:ss'),
109
- }
110
- EventTms_homeProperty.addCounterEntranceOpenGate(1, selectedTicket?.price_id)
111
- syncUsedTiketState.set(LibObject.push(syncUsedTiketState.get(), [url, post])())
112
- EventTms_homeProperty.subscribeSync().trigger(syncUsedTiketState.get())
113
- }
114
-
115
- const widthInterpolate = progress.interpolate({
116
- inputRange: [0, 1],
117
- outputRange: ['0%', '100%'],
118
- });
119
-
120
- return (
121
- <View style={{ flex: 1 }}>
122
- <LibStatusbar style='light' />
123
- <Pressable
124
- onPressIn={animateProgressBar}
125
- onPressOut={animateProgressBar}
126
- style={{ backgroundColor: '#000', height: LibStyle.height }}>
127
- <LibPicture source={{ uri: selectedTicket && selectedTicket?.user_image != "" ? decodeURIComponent(selectedTicket?.user_image) : 'https://www.w3schools.com/howto/img_avatar.png' }} style={{ width: LibStyle.width, height: LibStyle.height - (LibStyle.height / 4) }} resizeMode={"cover"} />
128
-
129
- <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, }}>
130
- <Animated.View style={{ width: widthInterpolate, height: 5, backgroundColor: LibStyle.colorPrimary, borderRadius: 10, }} />
131
- </View>
132
-
133
- <LinearGradient
134
- // Background Linear Gradient
135
- style={{
136
- height: LibStyle.height - (LibStyle.height / 3),
137
- width: LibStyle.width,
138
- position: 'absolute',
139
- left: 0,
140
- right: 0,
141
- bottom: 0,
142
- }}
143
- colors={['rgba(255,255,255,0)', 'rgba(0,0,0,0.55)', 'rgba(0,0,0,1)', 'rgba(0,0,0,1)']}>
144
- <View style={{ flex: 1, padding: 15, justifyContent: 'flex-end', paddingBottom: 100, alignContent: 'center', alignItems: 'center' }}>
145
- <Text allowFontScaling={false} style={{ textAlign: 'center', flexWrap: 'wrap', fontSize: 35, letterSpacing: 2, fontWeight: '900', color: '#fff' }}>{selectedTicket?.title?.split("+").join(' ')}</Text>
146
- <Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 14, marginTop: 20, color: '#fff' }}>{gate_type == "1" ? esp.lang("event/tms_in_success", "in") : esp.lang("event/tms_in_success", "out")}</Text>
147
- </View>
148
-
149
- </LinearGradient>
150
- </Pressable>
151
- </View>
152
- )
153
- }
@@ -1,91 +0,0 @@
1
- // withHooks
2
-
3
- import { applyStyle } from 'esoftplay';
4
- import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
5
- import { LibStyle } from 'esoftplay/cache/lib/style/import';
6
- import { EventOrder_itemProperty } from 'esoftplay/cache/event/order_item/import';
7
- import esp from 'esoftplay/esp';
8
- import React from 'react';
9
- import { Text, TouchableOpacity, View } from 'react-native';
10
-
11
-
12
- export interface EventTms_in_warningArgs {
13
-
14
- }
15
- export interface EventTms_in_warningProps {
16
-
17
- }
18
- export default function m(props: EventTms_in_warningProps): any {
19
- const {
20
- url_ticket_update,
21
- url_ticket_detail,
22
- price_type,
23
- selectedTicket,
24
- gate_type,
25
- qr_code,
26
- event_id,
27
- selectGate,
28
- typeScanner,
29
- event_title,
30
- qty,
31
- configPriority,
32
- scan_type,
33
- is_from_list } = LibNavigation.getArgsAll<any>(props)
34
-
35
-
36
- let args = {
37
- price_type: price_type,
38
- gate_type: gate_type,
39
- qr_code: qr_code,
40
- event_id: event_id,
41
- event_title: event_title,
42
- selectGate: selectGate,
43
- typeScanner: typeScanner,
44
- url_ticket_detail: url_ticket_detail,
45
- url_ticket_update: url_ticket_update,
46
- qty: qty,
47
- configPriority: configPriority,
48
- scan_type: scan_type
49
- }
50
-
51
- return (
52
- <View style={{ flex: 1, backgroundColor: selectedTicket?.color }}>
53
- <View style={{ padding: 15, flex: 4, alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
54
- <Text allowFontScaling={false} style={{ color: EventOrder_itemProperty.textColor(selectedTicket?.color), letterSpacing: 1, fontSize: 20, textAlign: 'center', fontWeight: 'normal' }}>{esp.lang("event/tms_in_warning", "your_ticket")}</Text>
55
- <Text allowFontScaling={false} numberOfLines={5} ellipsizeMode="tail" style={{ marginVertical: 15, letterSpacing: 2, color: EventOrder_itemProperty.textColor(selectedTicket?.color), fontSize: 32, textAlign: 'center', fontWeight: 'bold' }}>{selectedTicket?.title}</Text>
56
- <Text allowFontScaling={false} style={{ paddingHorizontal: 20, color: EventOrder_itemProperty.textColor(selectedTicket?.color), letterSpacing: 1, fontSize: 20, textAlign: 'center', fontWeight: 'normal' }}>{esp.lang("event/tms_in_warning", "confirm")}</Text>
57
- </View>
58
- <View style={{ flex: 1, padding: 15, justifyContent: 'flex-end' }}>
59
- <TouchableOpacity onPress={() => {
60
- if (is_from_list == 1) {
61
- LibNavigation.replace('event/tms_in_success', {
62
- selectedTicket: selectedTicket,
63
- ...args
64
- })
65
- } else {
66
- if (selectedTicket?.qty > 1) {
67
- let tikets = [selectedTicket]
68
- LibNavigation.replace('event/tms_in_list', {
69
- tickets: tikets,
70
- ...args
71
- })
72
- } else {
73
- LibNavigation.replace('event/tms_in_success', {
74
- selectedTicket: selectedTicket,
75
- ...args
76
- })
77
- }
78
- }
79
- }} style={applyStyle({ marginBottom: 20, width: LibStyle.width - 30, height: 40, borderRadius: 16, backgroundColor: EventOrder_itemProperty.textColor(selectedTicket?.color), flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center', paddingHorizontal: 9 })} >
80
- <Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: selectedTicket?.color, marginRight: 15 })} >{esp.lang("event/tms_in_warning", "process")}</Text>
81
- </TouchableOpacity>
82
- <TouchableOpacity onPress={() => {
83
- LibNavigation.back()
84
- }} style={applyStyle({ width: LibStyle.width - 30, borderWidth: 1, borderColor: EventOrder_itemProperty.textColor(selectedTicket?.color), height: 40, borderRadius: 16, backgroundColor: selectedTicket?.color, flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center', paddingHorizontal: 9 })} >
85
- <Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: EventOrder_itemProperty.textColor(selectedTicket?.color), marginRight: 15 })} >{esp.lang("event/tms_in_warning", "cancel")}</Text>
86
- </TouchableOpacity>
87
- </View>
88
-
89
- </View>
90
- )
91
- }
package/event/exit.tsx DELETED
@@ -1,91 +0,0 @@
1
- // withHooks
2
- import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
3
- import { LibCurl } from 'esoftplay/cache/lib/curl/import';
4
- import { LibLoading } from 'esoftplay/cache/lib/loading/import';
5
- import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
6
-
7
- import { LibUtils } from 'esoftplay/cache/lib/utils/import';
8
- import { UserClass } from 'esoftplay/cache/user/class/import';
9
- import esp from 'esoftplay/esp';
10
- import React, { useEffect } from 'react';
11
- import { View } from 'react-native';
12
-
13
-
14
- export interface EventTms_outArgs {
15
-
16
- }
17
- export interface EventTms_outProps {
18
-
19
- }
20
- export default function m(props: EventTms_outProps): any {
21
- const { scan_type, url_ticket_update, url_ticket_detail, price_type, gate_type, qr_code, event_id, email, selectGate, typeScanner, event_title, qty, configPriority }: any = LibNavigation.getArgsAll<any>(props)
22
-
23
- let args = {
24
- selectGate: selectGate,
25
- fromPage: 'event/tms_home',
26
- event_id: event_id,
27
- event_title: event_title,
28
- typeScanner: typeScanner,
29
- gate_type: gate_type,
30
- price_type: price_type,
31
- url_ticket_detail: url_ticket_detail,
32
- url_ticket_update: url_ticket_update,
33
- configPriority: configPriority,
34
- scan_type: scan_type
35
- }
36
-
37
- useEffect(() => {
38
- loadData()
39
- }, [])
40
-
41
- function loadData() {
42
- EventTms_homeProperty.addCounterOutScan(1, "0")
43
-
44
- let post = {
45
- event_id: event_id,
46
- gate_id: selectGate?.id,
47
- user_qr: encodeURIComponent(qr_code),
48
- email: email ? email : "",
49
- }
50
-
51
- new LibCurl('event_tms_out', post, (res) => {
52
- // setResult(res)
53
- let modifyList = res.list.length > 0 && res.list.map((item: any, i: number) => {
54
- return ({
55
- ...item,
56
- checked: i == 0 ? 1 : 0
57
- })
58
- })
59
- let finalData = {
60
- ...res,
61
- list: modifyList
62
- }
63
-
64
- esp.log(res);
65
-
66
- if (modifyList.length == 1) {
67
- let a = modifyList?.filter((item: any) => item.checked == 1).map((it: any) => it.id)
68
- let postOut = {
69
- event_id: event_id,
70
- ids: JSON.stringify(a),
71
- gate_id: selectGate?.id,
72
- trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
73
- price_id: modifyList?.filter((item: any) => item.checked == 1).map((it: any) => it.price_id),
74
- scanned_out: LibUtils.moment().format('YYYY-MM-DD HH:mm:ss'),
75
- }
76
- let urlOut = "event_tms_out_confirm"
77
- LibNavigation.replace('event/tms_out_success', { data: finalData, ...args, url: urlOut, post: postOut })
78
- } else {
79
- LibNavigation.replace('event/tms_out_list', { data: finalData, ...args })
80
- }
81
- }, (error) => {
82
- LibNavigation.replace('event/tms_out_failed', { msgError: error, ...args, postGetData: post })
83
- }, 1)
84
- }
85
-
86
- return (
87
- <View style={{ flex: 1, backgroundColor: '#fff', alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
88
- <LibLoading />
89
- </View>
90
- )
91
- }
@@ -1,135 +0,0 @@
1
- // withHooks
2
-
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, { useEffect } from 'react';
15
- import { Pressable, ScrollView, Text, View } from 'react-native';
16
-
17
-
18
- export interface EventTms_out_failedArgs {
19
-
20
- }
21
- export interface EventTms_out_failedProps {
22
-
23
- }
24
- export default function m(props: EventTms_out_failedProps): any {
25
- 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)
26
-
27
- useEffect(() => {
28
- EventTms_homeProperty.addCounterOutScanFailed(1, "0")
29
- }, [])
30
-
31
- function getBack() {
32
- LibNavigation.replace('component/scanner', {
33
- selectGate: selectGate,
34
- fromPage: 'event/tms_home',
35
- event_id: event_id,
36
- event_title: event_title,
37
- typeScanner: typeScanner,
38
- gate_type: gate_type,
39
- price_type: price_type,
40
- url_ticket_detail: url_ticket_detail,
41
- url_ticket_update: url_ticket_update,
42
- configPriority: configPriority,
43
- scan_type: scan_type
44
- })
45
- }
46
-
47
- function sendTelegram() {
48
- let data = {
49
- '#bbotmsexit': ":",
50
- reporter: {
51
- email: UserClass.state().get().email,
52
- name: UserClass.state().get().name
53
- },
54
- url: "event_tms_out",
55
- post: postGetData,
56
- error_msg: msgError,
57
- }
58
-
59
- let post = {
60
- text: String(JSON.stringify(data || {}, undefined, 2)).replace(/[\[\]\{\}\"]+/g, ''),
61
- chat_id: '-1001737180019',
62
- disable_web_page_preview: true
63
- }
64
-
65
- let _url = "https://api.telegram.org/bot923808407:AAEFBlllQNKCEn8E66fwEzCj5vs9qGwVGT4/sendMessage"
66
- new LibCurl().custom(_url, post, (res, msg) => { })
67
- }
68
-
69
-
70
- return (
71
- <View style={{ flex: 1 }}>
72
- <LibStatusbar style='light' />
73
- <View style={{ flex: 1 }}>
74
- <LibPicture source={esp.assets('failed.png')} style={{ flex: 1, height: LibStyle.height, width: LibStyle.width }} /* resizeMode={"stretch"} */ />
75
- </View>
76
- <View style={{ position: 'absolute', top: 100, left: 0, right: 0, bottom: 0, alignItems: 'center', alignContent: 'center' }} >
77
- <ScrollView>
78
- <View style={{ marginBottom: 20, alignSelf: 'center', borderRadius: LibStyle.width / 3, padding: 10, backgroundColor: '#fff' }}>
79
- <LibPicture
80
- source={esp.assets('failed_icon.png')}
81
- style={{ width: LibStyle.width / 3, height: LibStyle.width / 3 }}
82
- />
83
- </View>
84
- <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 25, color: '#fff', marginHorizontal: 20, textAlign: 'center', letterSpacing: 1 }}>{msgError?.message}</Text>
85
-
86
- {
87
- msgError?.result?.length > 0 &&
88
- <View style={{ marginTop: 15, flexDirection: 'row', justifyContent: 'space-between', backgroundColor: '#37c2d0', borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
89
- <View style={{ flex: 1, justifyContent: 'center', borderRightWidth: 1, borderColor: LibStyle.colorBgGrey, paddingVertical: 5, padding: 5 }}>
90
- <Text allowFontScaling={false} style={{ fontWeight: 'bold', textAlign: 'center', fontSize: 14 }}>{esp.lang("event/tms_out_failed", "type")}</Text>
91
- </View>
92
- <View style={{ flex: 1, justifyContent: 'center', paddingVertical: 5 }}>
93
- <Text allowFontScaling={false} style={{ fontWeight: 'bold', textAlign: 'center', fontSize: 14 }}>{esp.lang("event/tms_out_failed", "time")}</Text>
94
- </View>
95
- </View>
96
- }
97
- {
98
- msgError?.result?.length > 0 && msgError?.result?.map((item: any, i: number) => {
99
- return (
100
- <View key={i} style={{ backgroundColor: i % 2 ? '#fff' : LibStyle.colorGrey, flexDirection: 'row', justifyContent: 'space-between', borderBottomWidth: 1, borderBottomColor: LibStyle.colorBgGrey }}>
101
- <View style={{ flex: 1, justifyContent: 'center', borderRightWidth: 1, borderColor: LibStyle.colorBgGrey, paddingVertical: 5, padding: 5 }}>
102
- <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode="tail" style={{ letterSpacing: 1, textAlign: 'center', fontSize: 12 }}>{item?.price_name}</Text>
103
- </View>
104
- <View style={{ flex: 1, justifyContent: 'center', paddingVertical: 5 }}>
105
- {
106
- item.scanned != "0000-00-00 00:00:00" &&
107
- <Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 12 }}>{LibUtils.moment(item.hall_scanned).localeFormat("DD MMM H:mm:ss ")}</Text>
108
- }
109
- </View>
110
- </View>
111
- )
112
- })
113
- }
114
-
115
- </ScrollView>
116
- <View style={{ flexDirection: 'row', width: LibStyle.width - 40, marginVertical: 10, justifyContent: 'space-between' }}>
117
- <Pressable onPress={() => {
118
-
119
- 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"), () => {
120
- sendTelegram()
121
- }, esp.lang("event/tms_in_failed", "warn_no"), () => { })
122
-
123
- }} 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) }}>
124
- <Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold', color: "#fff" }}>{esp.lang("event/tms_out_failed", "report_error")}</Text>
125
- </Pressable>
126
- <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) }}>
127
- <Text allowFontScaling={false} style={{ fontSize: 14, fontWeight: 'bold', color: "#fff" }}>{esp.lang("event/tms_out_failed", "back")}</Text>
128
- </Pressable>
129
-
130
- </View>
131
- </View>
132
-
133
- </View>
134
- )
135
- }