esoftplay-event 0.0.0-a → 0.0.0-c

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 (179) hide show
  1. package/event/additional.tsx +4 -4
  2. package/event/additional_input.tsx +15 -15
  3. package/event/alert.tsx +32 -0
  4. package/event/artist.tsx +166 -0
  5. package/event/artist_detail.tsx +521 -0
  6. package/event/artist_detail_multi.tsx +548 -0
  7. package/event/badge.tsx +22 -0
  8. package/event/button.tsx +40 -0
  9. package/event/config.ts +4 -0
  10. package/event/countdown.tsx +5 -5
  11. package/event/countdown_base.tsx +83 -0
  12. package/event/counter_cashier.tsx +13 -13
  13. package/event/counter_cashier_report.tsx +6 -6
  14. package/event/counter_cashier_sell.tsx +7 -7
  15. package/event/counter_eo.tsx +21 -21
  16. package/event/counter_history.tsx +4 -4
  17. package/event/counter_lm.tsx +18 -18
  18. package/event/counter_report.tsx +4 -4
  19. package/event/counter_report_breakdown.tsx +2 -2
  20. package/event/counter_report_detail.tsx +15 -15
  21. package/event/counter_report_detail_list.tsx +4 -4
  22. package/event/counter_request.tsx +4 -4
  23. package/event/counter_request_detail.tsx +6 -6
  24. package/event/counter_send.tsx +9 -9
  25. package/event/counter_user_list.tsx +15 -15
  26. package/event/coupon.tsx +4 -4
  27. package/event/coupon_claim.tsx +4 -4
  28. package/event/coupon_claim_detail.tsx +8 -7
  29. package/event/coupon_claim_history.tsx +9 -9
  30. package/event/coupon_claim_reimburse.tsx +7 -8
  31. package/event/coupon_claim_reimburse_history.tsx +4 -4
  32. package/event/coupon_claim_reimburse_history_detail.tsx +4 -4
  33. package/event/coupon_claim_staff.tsx +10 -10
  34. package/event/coupon_detail.tsx +3 -3
  35. package/event/coupon_event_list.tsx +4 -4
  36. package/event/coupon_generate.tsx +4 -4
  37. package/event/coupon_generate_event.tsx +4 -4
  38. package/event/coupon_generate_list.tsx +2 -2
  39. package/event/date_picker.tsx +5 -5
  40. package/event/detail.tsx +12 -15
  41. package/event/entrance.tsx +17 -17
  42. package/event/entrance_again.tsx +22 -23
  43. package/event/entrance_failed.tsx +15 -15
  44. package/event/entrance_idcard.tsx +23 -23
  45. package/event/entrance_list.tsx +24 -24
  46. package/event/entrance_list_item.tsx +6 -6
  47. package/event/entrance_log.tsx +24 -24
  48. package/event/entrance_success.tsx +8 -8
  49. package/event/entrance_warning.tsx +14 -14
  50. package/event/exchange_reward.tsx +2 -2
  51. package/event/exchange_reward_result.tsx +7 -8
  52. package/event/exchange_ticket.tsx +11 -12
  53. package/event/exchange_ticket_list.tsx +10 -12
  54. package/event/exchange_ticket_result.tsx +11 -12
  55. package/event/exit.tsx +9 -9
  56. package/event/exit_failed.tsx +12 -12
  57. package/event/exit_list.tsx +15 -15
  58. package/event/exit_log.tsx +22 -22
  59. package/event/exit_success.tsx +8 -8
  60. package/event/exit_temporary.tsx +21 -21
  61. package/event/expander.tsx +36 -0
  62. package/event/fab.tsx +24 -0
  63. package/event/firebase_socket.ts +365 -0
  64. package/event/hall_in.tsx +13 -13
  65. package/event/hall_in_failed.tsx +22 -22
  66. package/event/hall_in_list.tsx +17 -17
  67. package/event/hall_in_log.tsx +24 -24
  68. package/event/hall_in_success.tsx +8 -8
  69. package/event/hall_out.tsx +13 -13
  70. package/event/hall_out_failed.tsx +11 -11
  71. package/event/hall_out_list.tsx +17 -17
  72. package/event/hall_out_log.tsx +24 -24
  73. package/event/hall_out_success.tsx +8 -8
  74. package/event/header.tsx +119 -0
  75. package/event/header_home.tsx +108 -0
  76. package/event/index.tsx +270 -0
  77. package/event/input_rectangle.tsx +208 -0
  78. package/event/item.tsx +40 -0
  79. package/event/label_input.tsx +23 -0
  80. package/event/list.tsx +20 -21
  81. package/event/list_filter.tsx +12 -13
  82. package/event/list_item.tsx +76 -0
  83. package/event/list_item2.tsx +78 -0
  84. package/event/loading_page.tsx +248 -0
  85. package/event/log.tsx +54 -54
  86. package/event/message.tsx +32 -0
  87. package/event/notice.tsx +41 -0
  88. package/event/order.tsx +323 -0
  89. package/event/order_detail.tsx +813 -0
  90. package/event/order_detail_payment.tsx +153 -0
  91. package/event/order_detail_upgrade.tsx +164 -0
  92. package/event/order_detail_upgrade_button.tsx +60 -0
  93. package/event/order_detail_upgrade_payment.tsx +221 -0
  94. package/event/order_detail_visitor.tsx +196 -0
  95. package/event/order_detail_waiting.tsx +520 -0
  96. package/event/order_history.tsx +101 -0
  97. package/event/order_item.tsx +118 -0
  98. package/event/order_lottery.tsx +172 -0
  99. package/event/order_reschedule.tsx +439 -0
  100. package/event/order_reschedule_list.tsx +85 -0
  101. package/event/order_share_to.tsx +219 -0
  102. package/event/order_share_to_detail.tsx +181 -0
  103. package/event/order_status.tsx +66 -0
  104. package/event/order_waiting.tsx +143 -0
  105. package/event/pending_trx.tsx +50 -0
  106. package/event/qc_idcard.tsx +12 -12
  107. package/event/qc_idcard_failed.tsx +4 -4
  108. package/event/qc_idcard_success.tsx +4 -4
  109. package/event/qr_bg.tsx +22 -0
  110. package/event/queue_out.tsx +3 -3
  111. package/event/queue_pricing.tsx +2 -3
  112. package/event/rating.tsx +49 -0
  113. package/event/rating_mini.tsx +35 -0
  114. package/event/refresh_button.tsx +40 -0
  115. package/event/review.tsx +3 -3
  116. package/event/review_add.tsx +8 -8
  117. package/event/review_detail.tsx +4 -4
  118. package/event/review_item.tsx +4 -4
  119. package/event/scan_item.tsx +2 -2
  120. package/event/schedule.tsx +8 -9
  121. package/event/seat.tsx +16 -18
  122. package/event/seat_autopick.tsx +4 -4
  123. package/event/seat_map.tsx +4 -4
  124. package/event/seat_map_test.tsx +2 -2
  125. package/event/section.tsx +35 -0
  126. package/event/section_menu.tsx +40 -0
  127. package/event/sheet.tsx +73 -0
  128. package/event/slider.tsx +46 -0
  129. package/event/step.tsx +29 -0
  130. package/event/ticket_list.tsx +15 -16
  131. package/event/ticket_list2.tsx +16 -17
  132. package/event/tms.tsx +4 -4
  133. package/event/tms_add.tsx +7 -8
  134. package/event/tms_add_result.tsx +4 -4
  135. package/event/tms_check_code.tsx +160 -0
  136. package/event/tms_check_ticket.tsx +72 -0
  137. package/event/tms_check_ticket_result.tsx +384 -0
  138. package/event/tms_dashboard.tsx +7 -7
  139. package/event/tms_event_list.tsx +46 -43
  140. package/event/tms_gate.tsx +96 -0
  141. package/event/tms_home.tsx +639 -0
  142. package/event/tms_idcard.tsx +203 -0
  143. package/event/tms_in.tsx +215 -0
  144. package/event/tms_in_again.tsx +199 -0
  145. package/event/tms_in_failed.tsx +190 -0
  146. package/event/tms_in_hall.tsx +148 -0
  147. package/event/tms_in_hall_failed.tsx +270 -0
  148. package/event/tms_in_hall_list.tsx +222 -0
  149. package/event/tms_in_hall_log.tsx +134 -0
  150. package/event/tms_in_hall_success.tsx +132 -0
  151. package/event/tms_in_list.tsx +264 -0
  152. package/event/tms_in_log.tsx +130 -0
  153. package/event/tms_in_success.tsx +155 -0
  154. package/event/tms_in_warning.tsx +91 -0
  155. package/event/tms_list_item.tsx +88 -0
  156. package/event/tms_log.tsx +435 -0
  157. package/event/tms_out.tsx +91 -0
  158. package/event/tms_out_failed.tsx +135 -0
  159. package/event/tms_out_hall.tsx +143 -0
  160. package/event/tms_out_hall_failed.tsx +133 -0
  161. package/event/tms_out_hall_list.tsx +215 -0
  162. package/event/tms_out_hall_log.tsx +133 -0
  163. package/event/tms_out_hall_success.tsx +130 -0
  164. package/event/tms_out_list.tsx +118 -0
  165. package/event/tms_out_log.tsx +131 -0
  166. package/event/tms_out_success.tsx +143 -0
  167. package/event/tms_out_temporary.tsx +226 -0
  168. package/event/toggle.tsx +30 -0
  169. package/event/transaction.ts +34 -0
  170. package/event/turnstile_event_gate.tsx +2 -2
  171. package/event/turnstile_event_list.tsx +4 -4
  172. package/event/turnstile_event_ticket.tsx +4 -4
  173. package/event/turnstile_settings.tsx +11 -11
  174. package/event/turnstile_settings_otp.tsx +4 -4
  175. package/event/turnstile_settings_status.tsx +2 -2
  176. package/event/voucher.tsx +9 -10
  177. package/event/voucher_multi.tsx +4 -5
  178. package/id.json +644 -0
  179. package/package.json +1 -1
@@ -0,0 +1,133 @@
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
+ }
@@ -0,0 +1,130 @@
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
+ }
@@ -0,0 +1,118 @@
1
+ // withHooks
2
+
3
+ import { applyStyle } from 'esoftplay';
4
+ import { EventButton } from 'esoftplay/cache/event/button/import';
5
+ import { EventHeader } from 'esoftplay/cache/event/header/import';
6
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
7
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
8
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
9
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
10
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
11
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
12
+ import { EventOrder_itemProperty } from 'esoftplay/cache/event/order_item/import';
13
+ import { UserClass } from 'esoftplay/cache/user/class/import';
14
+ import esp from 'esoftplay/esp';
15
+ import useSafeState from 'esoftplay/state';
16
+ import React from 'react';
17
+ import { Platform, Pressable, ScrollView, Text, TouchableOpacity, View } from 'react-native';
18
+
19
+
20
+ export interface EventTms_out_listArgs {
21
+
22
+ }
23
+ export interface EventTms_out_listProps {
24
+
25
+ }
26
+ export default function m(props: EventTms_out_listProps): any {
27
+ 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)
28
+ const [result, setResult] = useSafeState<any>(data)
29
+ const [useAll, setUseAll] = useSafeState<boolean>(true)
30
+
31
+ const transformStyle = Platform.OS == "ios" ? { transform: [{ scaleY: - 1 }] } : { transform: [{ rotateX: '180deg' }] }
32
+ function renderItem(item: any, i: number) {
33
+ return (
34
+ <Pressable onPress={() => {
35
+ setResult(LibObject.set(result, item?.checked == 0 ? 1 : 0)('list', i, 'checked'))
36
+ setUseAll(false)
37
+ }} key={i} style={{ margin: 10, marginBottom: 10, marginTop: 5, padding: 10, borderRadius: 10, backgroundColor: LibStyle.colorPrimary, flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'space-between' }}>
38
+ <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode='tail' style={{ fontSize: 20, fontWeight: 'bold', flexWrap: 'wrap', color: EventOrder_itemProperty.textColor(item?.color), marginRight: 10 }}>{item?.price_name}</Text>
39
+ <LibIcon.Ionicons name={item?.checked == 1 ? 'checkmark-circle' : 'radio-button-off-outline'} size={26} color={EventOrder_itemProperty.textColor(item?.color)} />
40
+ </Pressable>
41
+ )
42
+ }
43
+
44
+ let args = {
45
+ selectGate: selectGate,
46
+ fromPage: 'event/tms_home',
47
+ event_id: event_id,
48
+ event_title: event_title,
49
+ typeScanner: typeScanner,
50
+ gate_type: gate_type,
51
+ price_type: price_type,
52
+ url_ticket_detail: url_ticket_detail,
53
+ url_ticket_update: url_ticket_update,
54
+ configPriority: configPriority,
55
+ data: result,
56
+ scan_type: scan_type
57
+ }
58
+
59
+ function quit(): void {
60
+ let a = result?.list?.filter((item: any) => item.checked == 1).map((it: any) => it.id)
61
+ if (a.length == 0) {
62
+ LibToastProperty.show(esp.lang("event/tms_out_list", "select_ticket"))
63
+ return
64
+ } else {
65
+ let url = "event_tms_out_confirm"
66
+ let post = {
67
+ event_id: event_id,
68
+ ids: JSON.stringify(a),
69
+ gate_id: selectGate?.id,
70
+ trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
71
+ price_id: result?.list?.filter((item: any) => item.checked == 1).map((it: any) => it.price_id),
72
+ scanned_out: LibUtils.moment().format('YYYY-MM-DD HH:mm:ss'),
73
+ }
74
+
75
+ LibNavigation.replace('event/tms_out_success', { ...args, url, post })
76
+ }
77
+ }
78
+
79
+ return (
80
+ <View style={{ flex: 1, backgroundColor: '#fff' }}>
81
+ <EventHeader title={esp.lang("event/tms_out_list", "header_title")} subtitle={esp.lang("event/tms_out_list", "exit_gate", data?.event_name)} />
82
+ <ScrollView style={{ marginTop: 20 }}>
83
+ {
84
+ result?.list?.map(renderItem)
85
+ }
86
+ </ScrollView>
87
+ <View style={{ padding: 10 }}>
88
+ <View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'space-between' }}>
89
+ <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode={'tail'} style={{ fontWeight: 'bold', fontSize: 14, letterSpacing: 1 }}>{result?.list?.filter((item: any) => item.checked == 1).length + " Tiket digunakan"}</Text>
90
+ <TouchableOpacity onPress={() => {
91
+ let a = result?.list?.map((item: any, i: number) => {
92
+ return { ...item, checked: useAll ? 0 : 1 }
93
+ })
94
+ let b = {
95
+ ...result,
96
+ list: a
97
+ }
98
+ setResult(b)
99
+ setUseAll(useAll ? false : true)
100
+ }} 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' })} >
101
+ <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>
102
+ <LibIcon.Ionicons size={18} color="#fff" name={useAll ? "close" : "checkmark-done"} />
103
+ </TouchableOpacity>
104
+ </View>
105
+
106
+ <EventButton
107
+ label={esp.lang("event/tms_out_list", "exit")}
108
+ backgroundColor={LibStyle.colorRed}
109
+ onPress={() => {
110
+ quit()
111
+ }}
112
+ style={{ marginTop: 30 }}
113
+ />
114
+
115
+ </View>
116
+ </View>
117
+ )
118
+ }
@@ -0,0 +1,131 @@
1
+ // withHooks
2
+ import { useEffect } from 'react';
3
+
4
+ import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
5
+ import { EventTms_out_successProperty } from 'esoftplay/cache/event/tms_out_success/import';
6
+ import { EventTms_logProperty } from 'esoftplay/cache/event/tms_log/import';
7
+ import { LibLoading } from 'esoftplay/cache/lib/loading/import';
8
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
9
+ import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
10
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
11
+ import { UseCondition } from 'esoftplay/cache/use/condition/import';
12
+ import esp from 'esoftplay/esp';
13
+ import useSafeState from 'esoftplay/state';
14
+ import { useTimeout } from 'esoftplay/timeout';
15
+ import React from 'react';
16
+ import { Text, View } from 'react-native';
17
+ import Pressable from '../lib/pressable';
18
+
19
+
20
+ export interface EventTms_out_logArgs {
21
+
22
+ }
23
+ export interface EventTms_out_logProps {
24
+ onPress: (type: string, title: string) => void
25
+ }
26
+
27
+ export interface ExitLogItem {
28
+ text: string
29
+ subtitle: string
30
+ value: string
31
+ onPress: () => void
32
+ valuecolor?: string
33
+ }
34
+
35
+ function Item(props: ExitLogItem) {
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={{ 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
+
51
+ export default function m(props: EventTms_out_logProps): any {
52
+
53
+ const logExit = EventTms_homeProperty.counterState().useSelector(s => s)
54
+ const backupExit = EventTms_out_successProperty.syncTicketExit().useSelector(s => s)
55
+ const [loading, setLoading] = useSafeState<boolean>(true)
56
+ const timeout = useTimeout()
57
+
58
+ function syncExitData() {
59
+ EventTms_homeProperty.subscribeSyncExit().trigger(EventTms_out_successProperty.syncTicketExit().get())
60
+ timeout(() => {
61
+ setLoading(false)
62
+ }, 1000)
63
+ }
64
+
65
+ function forceSyncExitData() {
66
+ EventTms_homeProperty.subscribeSyncExitReset().trigger(EventTms_out_successProperty.syncTicketExit().get())
67
+ timeout(() => {
68
+ setLoading(false)
69
+ }, 1000)
70
+ }
71
+
72
+ useEffect(() => {
73
+ syncExitData()
74
+ }, [])
75
+
76
+
77
+ if (loading) {
78
+ return <LibLoading />
79
+ }
80
+
81
+ const sumValue = EventTms_logProperty.sumValuesPerCategory(logExit)
82
+
83
+ return (
84
+ <View style={{ flex: 1, backgroundColor: '#fff', margin: 17, marginTop: 0, paddingBottom: 10, marginBottom: 0, borderBottomRightRadius: 10, borderBottomLeftRadius: 10, ...LibStyle.elevation(2) }}>
85
+ <Item subtitle={esp.lang("event/tms_out_log", "ticket_scan_out")} text={esp.lang("event/tms_out_log", "scan_out")} value={sumValue?.out_scan} onPress={() => {
86
+ if (sumValue?.out_scan) {
87
+ props.onPress("out_scan", esp.lang("event/tms_out_log", "scan_out"))
88
+ }
89
+
90
+ }} />
91
+ <Item subtitle={esp.lang("event/tms_out_log", "qty_scanned_out")} text={esp.lang("event/tms_out_log", "qty_ticket_scan_out")} value={sumValue?.out_ticket} onPress={() => {
92
+ if (sumValue?.out_ticket) {
93
+ props.onPress("out_ticket", esp.lang("event/tms_out_log", "qty_ticket_scan_out"))
94
+ }
95
+
96
+ }} />
97
+ <Item subtitle={esp.lang("event/tms_out_log", "ticket_scanned_out")} text={esp.lang("event/tms_out_log", "opengate_out")} value={sumValue?.out_opengate} onPress={() => {
98
+ if (sumValue?.out_opengate) {
99
+ props.onPress("out_opengate", esp.lang("event/tms_out_log", "opengate_out"))
100
+ }
101
+
102
+ }} />
103
+ <Item subtitle={esp.lang("event/tms_out_log", "data_send_to_server")} text={esp.lang("event/tms_out_log", "data_send")} value={sumValue?.out_send} onPress={() => {
104
+ if (sumValue?.out_send) {
105
+ props.onPress("out_send", esp.lang("event/tms_out_log", "data_send"))
106
+ }
107
+
108
+ }} />
109
+ <Item subtitle={esp.lang("event/tms_out_log", "data_not_send_to_server")} text={esp.lang("event/tms_out_log", "data_not_send")} value={backupExit.length} valuecolor={LibStyle.colorRed} onPress={() => {
110
+
111
+ }} />
112
+
113
+ <View style={{ marginHorizontal: 15 }} >
114
+ <UseCondition
115
+ if={backupExit.length == 0}
116
+ fallback={
117
+ <Pressable onPress={() => {
118
+ setLoading(true)
119
+ forceSyncExitData()
120
+ }}>
121
+ <Text allowFontScaling={false} style={{ textAlign: 'center' }}>{esp.lang("event/tms_out_log", "waiting")}<Text style={{ color: LibStyle.colorBlue, textDecorationStyle: 'solid', textDecorationLine: 'underline' }}>{esp.lang("event/tms_out_log", "click")}</Text> {esp.lang("event/tms_out_log", "re_try")}</Text>
122
+ </Pressable>
123
+ } >
124
+ <LibTextstyle textStyle='callout'
125
+ style={{ textAlign: 'center', marginTop: 15 }}
126
+ text={esp.lang("event/tms_out_log", "all_data_send")} />
127
+ </UseCondition>
128
+ </View>
129
+ </View >
130
+ )
131
+ }
@@ -0,0 +1,143 @@
1
+ // withHooks
2
+ import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
3
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
4
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
5
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
6
+ import { LibStatusbar } from 'esoftplay/cache/lib/statusbar/import';
7
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
8
+ import useGlobalState, { useGlobalReturn } from 'esoftplay/global';
9
+ import { LinearGradient } from 'expo-linear-gradient';
10
+ import { useEffect, useRef } from 'react';
11
+
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_out_successArgs {
19
+
20
+ }
21
+ export interface EventTms_out_successProps {
22
+
23
+ }
24
+
25
+ const dataListTicketExit = useGlobalState<any[]>([], { persistKey: 'event_exit_tiket_sync', loadOnInit: true, inFastStorage: true })
26
+ export function syncTicketExit(): useGlobalReturn<any[]> {
27
+ return dataListTicketExit
28
+ }
29
+
30
+
31
+ export default function m(props: EventTms_out_successProps): any {
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
+
34
+ const [isPaused, setIsPaused] = useSafeState<boolean>(false)
35
+ const progress = useRef(new Animated.Value(0)).current;
36
+ const animation = useRef<Animated.CompositeAnimation | null>(null);
37
+ const [pausedValue, setPausedValue] = useSafeState(0);
38
+
39
+ function animateProgressBar() {
40
+ const duration = 1000; // Ubah durasi animasi sesuai kebutuhan Anda
41
+
42
+ if (!isPaused) {
43
+ animation.current = Animated.timing(progress, {
44
+ toValue: 1,
45
+ duration: duration - duration * pausedValue,
46
+ easing: Easing.linear,
47
+ useNativeDriver: false,
48
+ });
49
+
50
+ animation.current.start(({ finished }) => {
51
+ if (finished) {
52
+ setIsPaused(false);
53
+ setPausedValue(0);
54
+
55
+ // script next nya disini
56
+ LibNavigation.replace('component/scanner', {
57
+ selectGate: selectGate,
58
+ fromPage: 'event/tms_home',
59
+ event_id: event_id,
60
+ event_title: event_title,
61
+ typeScanner: typeScanner,
62
+ gate_type: gate_type,
63
+ price_type: price_type,
64
+ url_ticket_detail: url_ticket_detail,
65
+ url_ticket_update: url_ticket_update,
66
+ configPriority: configPriority,
67
+ scan_type: scan_type
68
+ })
69
+ }
70
+ });
71
+ } else {
72
+ if (animation.current) {
73
+ animation.current.stop(); // Hentikan animasi
74
+ animation.current = null;
75
+ }
76
+ setPausedValue(progress._value);
77
+ }
78
+
79
+ setIsPaused(!isPaused);
80
+ }
81
+
82
+ useEffect(() => {
83
+ // sementara price_id tak jupuk index 0
84
+ EventTms_homeProperty.addCounterOutOpenGate(1, post?.price_id?.[0])
85
+ dataListTicketExit?.get()
86
+ createDataExit()
87
+ animateProgressBar()
88
+ }, [])
89
+
90
+ function createDataExit() {
91
+ dataListTicketExit.set(LibObject.push(dataListTicketExit.get(), [url, post])())
92
+ EventTms_homeProperty.subscribeSyncExit().trigger(dataListTicketExit.get())
93
+ }
94
+
95
+ let uniquePrices: any = {};
96
+
97
+ data?.list?.filter((entry: any) => {
98
+ return entry.checked == 1;
99
+ }).forEach((entry: any) => {
100
+ uniquePrices[entry.price_name] = true;
101
+ });
102
+
103
+ let uniquePriceNames = Object.keys(uniquePrices);
104
+
105
+ const widthInterpolate = progress.interpolate({
106
+ inputRange: [0, 1],
107
+ outputRange: ['0%', '100%'],
108
+ });
109
+
110
+ return (
111
+ <View style={{ flex: 1 }}>
112
+ <LibStatusbar style='light' />
113
+ <Pressable
114
+ onPressIn={animateProgressBar}
115
+ onPressOut={animateProgressBar}
116
+ style={{ backgroundColor: '#000', height: LibStyle.height }}>
117
+ <LibPicture source={{ uri: 'https://www.w3schools.com/howto/img_avatar.png' }} style={{ width: LibStyle.width, height: LibStyle.height - (LibStyle.height / 4) }} resizeMode={"cover"} />
118
+
119
+ <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, }}>
120
+ <Animated.View style={{ width: widthInterpolate, height: 5, backgroundColor: LibStyle.colorPrimary, borderRadius: 10, }} />
121
+ </View>
122
+
123
+ <LinearGradient
124
+ // Background Linear Gradient
125
+ style={{
126
+ height: LibStyle.height - (LibStyle.height / 3),
127
+ width: LibStyle.width,
128
+ position: 'absolute',
129
+ left: 0,
130
+ right: 0,
131
+ bottom: 0,
132
+ }}
133
+ colors={['rgba(255,255,255,0)', 'rgba(0,0,0,0.55)', 'rgba(0,0,0,1)', 'rgba(0,0,0,1)']}>
134
+ <View style={{ flex: 1, padding: 15, justifyContent: 'flex-end', paddingBottom: 100, alignContent: 'center', alignItems: 'center' }}>
135
+ <Text allowFontScaling={false} style={{ textAlign: 'center', flexWrap: 'wrap', fontSize: 35, letterSpacing: 2, fontWeight: '900', color: '#fff' }}>{uniquePriceNames.join(',')}</Text>
136
+ <Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 26, marginTop: 20, color: LibStyle.colorRed }}>{esp.lang("event/tms_out_success", "exit")}</Text>
137
+ </View>
138
+
139
+ </LinearGradient>
140
+ </Pressable>
141
+ </View>
142
+ )
143
+ }