esoftplay-event 0.0.0-a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/config.json +11 -0
  2. package/event/additional.tsx +188 -0
  3. package/event/additional_input.tsx +316 -0
  4. package/event/block_invitation.tsx +48 -0
  5. package/event/countdown.tsx +72 -0
  6. package/event/counter_cashier.tsx +180 -0
  7. package/event/counter_cashier_report.tsx +114 -0
  8. package/event/counter_cashier_sell.tsx +135 -0
  9. package/event/counter_eo.tsx +451 -0
  10. package/event/counter_history.tsx +74 -0
  11. package/event/counter_history_item.tsx +48 -0
  12. package/event/counter_info.tsx +96 -0
  13. package/event/counter_lm.tsx +273 -0
  14. package/event/counter_menu.tsx +85 -0
  15. package/event/counter_report.tsx +105 -0
  16. package/event/counter_report_breakdown.tsx +93 -0
  17. package/event/counter_report_detail.tsx +238 -0
  18. package/event/counter_report_detail_list.tsx +56 -0
  19. package/event/counter_request.tsx +136 -0
  20. package/event/counter_request_detail.tsx +211 -0
  21. package/event/counter_section.tsx +32 -0
  22. package/event/counter_send.tsx +277 -0
  23. package/event/counter_status.tsx +32 -0
  24. package/event/counter_type.tsx +23 -0
  25. package/event/counter_user_list.tsx +197 -0
  26. package/event/counter_user_list_item.tsx +143 -0
  27. package/event/coupon.tsx +124 -0
  28. package/event/coupon_claim.tsx +198 -0
  29. package/event/coupon_claim_detail.tsx +175 -0
  30. package/event/coupon_claim_history.tsx +279 -0
  31. package/event/coupon_claim_reimburse.tsx +111 -0
  32. package/event/coupon_claim_reimburse_history.tsx +72 -0
  33. package/event/coupon_claim_reimburse_history_detail.tsx +117 -0
  34. package/event/coupon_claim_staff.tsx +256 -0
  35. package/event/coupon_detail.tsx +98 -0
  36. package/event/coupon_event_list.tsx +77 -0
  37. package/event/coupon_generate.tsx +258 -0
  38. package/event/coupon_generate_event.tsx +79 -0
  39. package/event/coupon_generate_list.tsx +56 -0
  40. package/event/date_picker.tsx +152 -0
  41. package/event/detail.tsx +352 -0
  42. package/event/entrance.tsx +215 -0
  43. package/event/entrance_again.tsx +200 -0
  44. package/event/entrance_failed.tsx +190 -0
  45. package/event/entrance_idcard.tsx +203 -0
  46. package/event/entrance_list.tsx +264 -0
  47. package/event/entrance_list_item.tsx +88 -0
  48. package/event/entrance_log.tsx +130 -0
  49. package/event/entrance_success.tsx +155 -0
  50. package/event/entrance_warning.tsx +91 -0
  51. package/event/exchange_reward.tsx +31 -0
  52. package/event/exchange_reward_result.tsx +137 -0
  53. package/event/exchange_ticket.tsx +234 -0
  54. package/event/exchange_ticket_list.tsx +191 -0
  55. package/event/exchange_ticket_result.tsx +211 -0
  56. package/event/exit.tsx +91 -0
  57. package/event/exit_failed.tsx +135 -0
  58. package/event/exit_list.tsx +118 -0
  59. package/event/exit_log.tsx +131 -0
  60. package/event/exit_success.tsx +143 -0
  61. package/event/exit_temporary.tsx +226 -0
  62. package/event/hall_in.tsx +148 -0
  63. package/event/hall_in_failed.tsx +270 -0
  64. package/event/hall_in_list.tsx +222 -0
  65. package/event/hall_in_log.tsx +134 -0
  66. package/event/hall_in_success.tsx +132 -0
  67. package/event/hall_out.tsx +143 -0
  68. package/event/hall_out_failed.tsx +133 -0
  69. package/event/hall_out_list.tsx +215 -0
  70. package/event/hall_out_log.tsx +133 -0
  71. package/event/hall_out_success.tsx +130 -0
  72. package/event/list.tsx +219 -0
  73. package/event/list_filter.tsx +124 -0
  74. package/event/log.tsx +435 -0
  75. package/event/qc_idcard.tsx +209 -0
  76. package/event/qc_idcard_failed.tsx +78 -0
  77. package/event/qc_idcard_success.tsx +68 -0
  78. package/event/queue_out.tsx +186 -0
  79. package/event/queue_pricing.tsx +152 -0
  80. package/event/randomseat.tsx +33 -0
  81. package/event/review.tsx +117 -0
  82. package/event/review_add.tsx +342 -0
  83. package/event/review_detail.tsx +67 -0
  84. package/event/review_item.tsx +76 -0
  85. package/event/scan_item.tsx +66 -0
  86. package/event/schedule.tsx +135 -0
  87. package/event/seat.tsx +628 -0
  88. package/event/seat_autopick.tsx +120 -0
  89. package/event/seat_map.tsx +408 -0
  90. package/event/seat_map_matrix.tsx +94 -0
  91. package/event/seat_map_test.tsx +401 -0
  92. package/event/ticket_list.tsx +722 -0
  93. package/event/ticket_list2.tsx +680 -0
  94. package/event/timer.tsx +58 -0
  95. package/event/tms.tsx +103 -0
  96. package/event/tms_add.tsx +94 -0
  97. package/event/tms_add_result.tsx +175 -0
  98. package/event/tms_dashboard.tsx +89 -0
  99. package/event/tms_event_list.tsx +66 -0
  100. package/event/turnstile_event_gate.tsx +74 -0
  101. package/event/turnstile_event_item.tsx +41 -0
  102. package/event/turnstile_event_list.tsx +69 -0
  103. package/event/turnstile_event_ticket.tsx +95 -0
  104. package/event/turnstile_settings.tsx +327 -0
  105. package/event/turnstile_settings_otp.tsx +58 -0
  106. package/event/turnstile_settings_status.tsx +50 -0
  107. package/event/voucher.tsx +149 -0
  108. package/event/voucher_multi.tsx +181 -0
  109. package/fonts/Arial.ttf +0 -0
  110. package/fonts/ArialBold.ttf +0 -0
  111. package/fonts/DecoNumbers.ttf +0 -0
  112. package/fonts/MonoSpace.ttf +0 -0
  113. package/fonts/SFProText.ttf +0 -0
  114. package/fonts/digital.ttf +0 -0
  115. package/fonts/mono.ttf +0 -0
  116. package/id.json +1113 -0
  117. package/index.js +2 -0
  118. package/libs.json +1 -0
  119. package/mover.js +0 -0
  120. package/package.json +16 -0
  121. package/publisher.js +84 -0
@@ -0,0 +1,134 @@
1
+ // withHooks
2
+
3
+ import { useEffect } from 'react';
4
+
5
+ import { BigbangGate_infoProperty } from 'esoftplay/cache/bigbang/gate_info/import';
6
+ import { EventHall_in_successProperty } from 'esoftplay/cache/event/hall_in_success/import';
7
+ import { EventLogProperty } from 'esoftplay/cache/event/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 EventHall_in_logArgs {
20
+
21
+ }
22
+ export interface EventHall_in_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: EventHall_in_logProps): any {
50
+
51
+ const logHallIn = BigbangGate_infoProperty.counterState().useSelector(s => s)
52
+ const backupHallIn = EventHall_in_successProperty.syncHallIn().useSelector(s => s)
53
+ const [loading, setLoading] = useSafeState<boolean>(true)
54
+ const timeout = useTimeout()
55
+
56
+ function syncHallInData() {
57
+ BigbangGate_infoProperty.subscribeSyncHallIn().trigger(EventHall_in_successProperty.syncHallIn().get())
58
+ timeout(() => {
59
+ setLoading(false)
60
+ }, 1000)
61
+ }
62
+
63
+ function forceSyncHallInData() {
64
+ BigbangGate_infoProperty.subscribeSyncHallInReset().trigger(EventHall_in_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 = EventLogProperty.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/hall_in_log", "ticket_scanned_hall_in")} text={esp.lang("event/hall_in_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/hall_in_log", "scan_hall_in"))
86
+ }
87
+ }} />
88
+ <Item subtitle={esp.lang("event/hall_in_log", "qty_scanned_hall_in")} text={esp.lang("event/hall_in_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/hall_in_log", "qty_scan_hall_in"))
91
+ }
92
+
93
+ }} />
94
+ <Item subtitle={esp.lang("event/hall_in_log", "ticket_success_hall_in")} text={esp.lang("event/hall_in_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/hall_in_log", "opengate_hall_in"))
97
+ }
98
+
99
+ }} />
100
+ <Item subtitle={esp.lang("event/hall_in_log", "idcard_scanned_hall_in")} text={esp.lang("event/hall_in_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/hall_in_log", "opengate_hall_in_idcard"))
103
+ }
104
+
105
+ }} />
106
+ <Item subtitle={esp.lang("event/hall_in_log", "data_send_to_server")} text={esp.lang("event/hall_in_log", "data_send")} value={sumValue?.hall_in_send} onPress={() => {
107
+ if (sumValue?.hall_in_send) {
108
+ props.onPress("hall_in_send", esp.lang("event/hall_in_log", "data_send"))
109
+ }
110
+
111
+ }} />
112
+ <Item subtitle={esp.lang("event/hall_in_log", "data_not_send_to_server")} text={esp.lang("event/hall_in_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/hall_in_log", "wait")}<Text style={{ color: LibStyle.colorBlue, textDecorationStyle: 'solid', textDecorationLine: 'underline' }}>{esp.lang("event/hall_in_log", "click")}</Text> {esp.lang("event/hall_in_log", "retry")}</Text>
125
+ </Pressable>
126
+ } >
127
+ <LibTextstyle textStyle='callout'
128
+ style={{ textAlign: 'center', marginTop: 15 }}
129
+ text={esp.lang("event/hall_in_log", "already_scan")} />
130
+ </UseCondition>
131
+ </View>
132
+ </View >
133
+ )
134
+ }
@@ -0,0 +1,132 @@
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 { BigbangGate_infoProperty } from 'esoftplay/cache/bigbang/gate_info/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 EventHall_in_successArgs {
19
+
20
+ }
21
+ export interface EventHall_in_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: EventHall_in_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: 'bigbang/gate_info',
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
+ BigbangGate_infoProperty.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
+ BigbangGate_infoProperty.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/hall_in_success", "entrance")}</Text>
126
+ </View>
127
+
128
+ </LinearGradient>
129
+ </Pressable>
130
+ </View>
131
+ )
132
+ }
@@ -0,0 +1,143 @@
1
+ // withHooks
2
+
3
+ import { BigbangGate_infoProperty } from 'esoftplay/cache/bigbang/gate_info/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 EventHall_outArgs {
14
+
15
+ }
16
+ export interface EventHall_outProps {
17
+
18
+ }
19
+ export default function m(props: EventHall_outProps): 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: 'bigbang/gate_info',
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
+ BigbangGate_infoProperty.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/entrance_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/hall_out_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/hall_out_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/hall_out_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/hall_out_failed', { msgError: err, ...args, postGetData: post })
126
+ }
127
+ }
128
+ }
129
+ } else { // jika punya tiket banyak
130
+ LibNavigation.replace('event/hall_out_list', { data: ticketsData, ...args })
131
+ }
132
+
133
+
134
+ }, (error) => {
135
+ LibNavigation.replace('event/hall_out_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
+ }
@@ -0,0 +1,133 @@
1
+ // withHooks
2
+ import { useEffect } from 'react';
3
+
4
+ import { BigbangGate_infoProperty } from 'esoftplay/cache/bigbang/gate_info/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 EventHall_out_failedArgs {
18
+
19
+ }
20
+ export interface EventHall_out_failedProps {
21
+
22
+ }
23
+ export default function m(props: EventHall_out_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
+ BigbangGate_infoProperty.addCounterHallOutScanFailed(1, "0")
28
+ }, [])
29
+
30
+ function getBack() {
31
+ LibNavigation.replace('component/scanner', {
32
+ selectGate: selectGate,
33
+ fromPage: 'bigbang/gate_info',
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/hall_out_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/entrance_failed", "warn_title"), esp.lang("event/entrance_failed", "warn_msg"), esp.lang("event/entrance_failed", "warn_ok"), () => {
118
+ sendTelegram()
119
+ }, esp.lang("event/entrance_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/hall_out_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/hall_out_failed", "back")}</Text>
126
+ </Pressable>
127
+
128
+ </View>
129
+ </View>
130
+
131
+ </View>
132
+ )
133
+ }