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,264 @@
1
+ // withHooks
2
+ import { applyStyle } from 'esoftplay';
3
+ import { ComponentButton } from 'esoftplay/cache/component/button/import';
4
+ import { ComponentHeader } from 'esoftplay/cache/component/header/import';
5
+ import { ComponentSlidingup } from 'esoftplay/cache/component/slidingup/import';
6
+ import { EventEntrance_list_item } from 'esoftplay/cache/event/entrance_list_item/import';
7
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
8
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
9
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
10
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
11
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
12
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
13
+
14
+ import esp from 'esoftplay/esp';
15
+ import useSafeState from 'esoftplay/state';
16
+ import React, { useEffect, useRef } from 'react';
17
+ import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
18
+
19
+
20
+ export interface EventEntrancre_listArgs {
21
+
22
+ }
23
+ export interface EventEntrancre_listProps {
24
+
25
+ }
26
+ export default function m(props: EventEntrancre_listProps): any {
27
+ const {
28
+ price_type,
29
+ url_ticket_detail,
30
+ url_ticket_update,
31
+ tickets,
32
+ gate_type,
33
+ qr_code,
34
+ event_id,
35
+ selectGate,
36
+ typeScanner,
37
+ event_title,
38
+ scan_type,
39
+ configPriority, }: any = LibNavigation.getArgsAll(props)
40
+
41
+ const [ticket, setTicket] = useSafeState<any>()
42
+ const [list, setList] = useSafeState<any>()
43
+ const [useAll, setUseAll] = useSafeState<boolean>(false)
44
+ const dialogQty = useRef<ComponentSlidingup>(null)
45
+
46
+ let args = {
47
+ price_type: price_type,
48
+ gate_type: gate_type,
49
+ qr_code: qr_code,
50
+ event_id: event_id,
51
+ event_title: event_title,
52
+ selectGate: selectGate,
53
+ typeScanner: typeScanner,
54
+ url_ticket_detail: url_ticket_detail,
55
+ url_ticket_update: url_ticket_update,
56
+ qty: 1,
57
+ configPriority: configPriority,
58
+ scan_type: scan_type
59
+ }
60
+
61
+ useEffect(() => {
62
+ if (tickets?.length == 1) {
63
+ let item = tickets?.[0]
64
+ let a = new Array(Number(item?.qty_left)).fill({
65
+ ...item,
66
+ selected: 0
67
+ })
68
+
69
+ let b = a?.map((item: any, i: number) => {
70
+ return { ...item, selected: i == 0 ? 1 : 0 }
71
+ })
72
+
73
+ setUseAll(false)
74
+ setList(b)
75
+ setTicket(item)
76
+ LibUtils.debounce(() => {
77
+ if (item.hasOwnProperty("exhibitor_name")) {
78
+ LibNavigation.replace('event/entrance_idcard', {
79
+ selectedTicket: item,
80
+ ...args
81
+ })
82
+ } else {
83
+ dialogQty.current!.show()
84
+ }
85
+ }, 100)
86
+ }
87
+ }, [])
88
+
89
+
90
+ useEffect(() => {
91
+ setUseAll(list?.some((x: any) => x.selected == 0) ? false : true)
92
+ }, [list])
93
+
94
+ function useTicket() {
95
+ // LibNavigation.back()
96
+ let arg = {
97
+ ...args,
98
+ qty: list?.filter((it: any) => it.selected).length
99
+ }
100
+
101
+ if (tickets?.length == 1) {
102
+ LibNavigation.replace('event/entrance_success', {
103
+ selectedTicket: ticket,
104
+ ...arg
105
+ })
106
+ } else {
107
+ if (configPriority) { // ini untuk memunculkan priority
108
+ if (configPriority?.filter?.((item: any) => item.id == ticket.price_id).length > 0) {
109
+ LibNavigation.replace('event/entrance_success', {
110
+ selectedTicket: ticket,
111
+ ...arg
112
+ })
113
+ } else {
114
+ LibNavigation.replace('event/entrance_warning', {
115
+ selectedTicket: ticket,
116
+ is_from_list: 1, // digunakan untuk membedakan navigasi kalau scan QR Member
117
+ ...arg
118
+ })
119
+ }
120
+ } else {
121
+ LibNavigation.replace('event/entrance_success', {
122
+ selectedTicket: ticket,
123
+ ...arg
124
+ })
125
+ }
126
+ }
127
+
128
+ }
129
+
130
+ function renderItem(item: any, i?: number) {
131
+ return (
132
+ <EventEntrance_list_item
133
+ key={i}
134
+ item={item}
135
+ onPress={() => {
136
+ if (item.text == "") {
137
+ if (item.qty_left == 0) {
138
+ LibNavigation.back()
139
+ LibNavigation.navigate('event/entrance_failed', {
140
+ text: esp.lang("event/entrance_list", "ticket_habis"),
141
+ ticketItem: item,
142
+ ...args
143
+ })
144
+ } else {
145
+ let a = new Array(Number(item?.qty_left)).fill({
146
+ ...item,
147
+ selected: 0
148
+ })
149
+
150
+ let b = a?.map((item: any, i: number) => {
151
+ return { ...item, selected: i == 0 ? 1 : 0 }
152
+ })
153
+
154
+ setUseAll(false)
155
+ setList(b)
156
+ setTicket(item)
157
+ LibUtils.debounce(() => {
158
+ if (item.hasOwnProperty("exhibitor_name")) {
159
+ LibNavigation.replace('event/entrance_idcard', {
160
+ selectedTicket: item,
161
+ ...args
162
+ })
163
+ } else {
164
+ dialogQty.current!.show()
165
+ }
166
+ }, 100)
167
+ }
168
+ } else {
169
+ LibNavigation.back()
170
+ LibNavigation.navigate('event/entrance_failed', {
171
+ text: item.text,
172
+ ...args
173
+ })
174
+ }
175
+ }}
176
+ />
177
+ )
178
+ }
179
+
180
+ return (
181
+ <View style={{ flex: 1, backgroundColor: '#fff' }}>
182
+ <ComponentHeader title={esp.lang("event/entrance_list", "header_title")} subtitle='TMS' />
183
+ <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center', paddingTop: 15, paddingBottom: 0 }}>
184
+ <ScrollView style={{ flex: 1 }}>
185
+ {
186
+ tickets?.map(renderItem)
187
+ }
188
+ </ScrollView>
189
+ </View>
190
+
191
+ {/* dialog qty */}
192
+ <ComponentSlidingup ref={dialogQty}>
193
+ <View style={{ borderTopRightRadius: 20, borderTopLeftRadius: 20, padding: 20, paddingBottom: 0, backgroundColor: '#fff', maxHeight: LibStyle.height - (LibStyle.height / 3) }}>
194
+ <Text allowFontScaling={false} style={applyStyle({ letterSpacing: 1, fontSize: 30, marginTop: 0, fontWeight: 'bold', textAlign: "center", textAlignVertical: 'center', color: '#000', margin: 15 })} >{esp.lang("event/entrance_list", "total_ticket", list?.length)}</Text>
195
+
196
+ <View style={{ flexDirection: 'row', alignItems: 'center', marginVertical: 20 }} >
197
+ <TouchableOpacity
198
+ onPress={() => {
199
+ const index = findLastIndex(list, (x: any) => x.selected == 1)
200
+ if (index > 0) {
201
+ setList(LibObject.set(list, 0)(index, 'selected'))
202
+ }
203
+ }}
204
+ style={{ height: 70, width: 70, borderRadius: 10, backgroundColor: '#c1c2c3', alignItems: 'center', justifyContent: 'center' }} >
205
+ <LibIcon name='minus' size={50} />
206
+ </TouchableOpacity>
207
+ <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }} >
208
+ <Text style={{ fontSize: 50 }} >{list?.filter?.((x: any) => x.selected == 1).length}</Text>
209
+ </View>
210
+ <TouchableOpacity
211
+ onPress={() => {
212
+ const index = list?.findIndex?.((x: any) => x.selected == 0)
213
+ if (index > -1)
214
+ setList(LibObject.set(list, 1)(index, 'selected'))
215
+ }}
216
+ style={{ height: 70, width: 70, borderRadius: 10, backgroundColor: '#c1c2c3', alignItems: 'center', justifyContent: 'center' }} >
217
+ <LibIcon name='plus' size={50} />
218
+ </TouchableOpacity>
219
+ </View>
220
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between', padding: 10, marginBottom: 20, alignContent: 'center', alignItems: 'center' }}>
221
+ <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode={'tail'} style={{ flex: 1, fontWeight: 'bold', fontSize: 14, letterSpacing: 1 }}>{esp.lang("event/entrance_list", "total_ticket_use", list?.filter((it: any) => it.selected).length)}</Text>
222
+ <TouchableOpacity onPress={() => {
223
+ let a = list?.map((item: any, i: number) => {
224
+ return { ...item, selected: useAll ? 0 : 1 }
225
+ })
226
+ setList(a)
227
+ }} style={applyStyle({ paddingHorizontal: 10, 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' })} >
228
+ <Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: '#fff', marginRight: 15 })} >{useAll ? esp.lang("event/entrance_list", "cancel_use") : esp.lang("event/entrance_list", "use_all")}</Text>
229
+ <LibIcon.Ionicons size={18} color="#fff" name={useAll ? "close" : "checkmark-done"} />
230
+ </TouchableOpacity>
231
+ </View>
232
+
233
+ <ComponentButton
234
+ label={esp.lang("event/entrance_list", "btn_entrance")}
235
+ style={{ borderRadius: 10, marginHorizontal: 5, marginBottom: 10 }}
236
+ backgroundColor={list?.filter((it: any) => it.selected).length == 0 ? LibStyle.colorBgGrey : LibStyle.colorGreen}
237
+ onPress={() => {
238
+ if (list?.filter((it: any) => it.selected).length == 0) {
239
+ LibToastProperty.show(esp.lang("event/entrance_list", "ticket_not_select"))
240
+ } else {
241
+ useTicket()
242
+ }
243
+ }}
244
+ />
245
+ </View>
246
+
247
+ </ComponentSlidingup >
248
+
249
+
250
+ </View >
251
+ )
252
+ }
253
+
254
+ function findLastIndex(arr: any[], condition: (value: any, index: number, obj: any[]) => unknown) {
255
+ const reversedArray = arr.slice().reverse();
256
+ const indexInReversedArray = reversedArray.findIndex(condition);
257
+
258
+ if (indexInReversedArray === -1) {
259
+ return -1; // No matching element found
260
+ }
261
+
262
+ const lastIndex = arr.length - 1 - indexInReversedArray;
263
+ return lastIndex;
264
+ }
@@ -0,0 +1,88 @@
1
+ // withHooks
2
+
3
+ import { applyStyle } from 'esoftplay';
4
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
5
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
6
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
7
+ import { TicketItemProperty } from 'esoftplay/cache/ticket/item/import';
8
+ import esp from 'esoftplay/esp';
9
+
10
+ import React from 'react';
11
+ import { Pressable, Text, View } from 'react-native';
12
+ import Svg, { Path } from 'react-native-svg';
13
+
14
+
15
+ export interface EventEntrance_list_itemArgs {
16
+
17
+ }
18
+ export interface EventEntrance_list_itemProps {
19
+ item: any,
20
+ onPress: () => void,
21
+ }
22
+ function debouncer() {
23
+ let timeout: any
24
+ return (func: () => any, delay: number): Function => {
25
+ clearTimeout(timeout)
26
+ timeout = setTimeout(func, delay);
27
+ return () => clearTimeout(timeout)
28
+ }
29
+ }
30
+ const debounce = debouncer()
31
+
32
+ export default function m(props: EventEntrance_list_itemProps): any {
33
+ const { item } = props
34
+ const z = (200 / 500) * (LibStyle.width - 50);
35
+
36
+ // let colorBg = item?.qty_left == 0 ? LibStyle.colorBgGrey : item.color == "#FFFFFF" ? LibStyle.colorPrimary : item?.color
37
+ let colorBg = item?.qty_left <= 0 ? LibStyle.colorBgGrey : item.color?.toUpperCase() == "#FFFFFF" ? LibStyle.colorPrimary : item?.color
38
+ let colorFg = item?.qty_left <= 0 ? "#aaa" : LibUtils.hexToRgba(item?.color, 0.5)
39
+ let colorText = item?.qty_left == 0 ? "#979797" : TicketItemProperty.textColor(item.color)
40
+
41
+ if (item.price_id == "staff") {
42
+ return (
43
+ <Pressable onPress={() => { debounce(() => props.onPress(), 500) }} style={{ width: LibStyle.width - 50, marginBottom: 10, backgroundColor: colorBg, padding: 15, borderRadius: 10, ...LibStyle.elevation(3) }}>
44
+ <View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
45
+ <View style={{ height: 80, width: 80, borderRadius: 10, backgroundColor: LibStyle.colorBgGrey, ...LibStyle.elevation(3) }}>
46
+ <LibPicture source={{ uri: item?.user_image }} style={{ height: 80, width: 80, borderRadius: 10 }} />
47
+ </View>
48
+ <View style={{ marginHorizontal: 10, flex: 1, alignContent: 'center', justifyContent: 'center' }}>
49
+ <Text allowFontScaling={false} numberOfLines={2} style={applyStyle({ color: colorText, fontSize: 16, fontWeight: 'bold' })} >{item.user_name}</Text>
50
+ <Text allowFontScaling={false} style={applyStyle({ letterSpacing: 1, color: colorText, fontSize: 20, fontWeight: 'bold' })} >{item?.exhibitor_name?.split('-')[0]}</Text>
51
+ <Text allowFontScaling={false} numberOfLines={4} style={applyStyle({ letterSpacing: 1, color: colorText, fontSize: 16, fontWeight: 'normal' })} >{item?.exhibitor_name?.split('-')[1]}</Text>
52
+
53
+ </View>
54
+ </View>
55
+ </Pressable>
56
+ )
57
+ }
58
+
59
+ return (
60
+ <Pressable onPress={() => { debounce(() => props.onPress(), 500) }} style={applyStyle({ marginBottom: 10 })}>
61
+ <Svg width={LibStyle.width - 50} height={z} viewBox="0 0 544 210" fill="none">
62
+ <Path fill-rule="evenodd" fill={colorBg} clip-rule="evenodd" d="M0 15C0 6.71573 6.71573 0 15 0H529C537.284 0 544 6.71573 544 15V90C535.716 90 529 96.7157 529 105C529 113.284 535.716 120 544 120V195C544 203.284 537.284 210 529 210H15C6.71573 210 0 203.284 0 195V120C8.28427 120 15 113.284 15 105C15 96.7157 8.28427 90 0 90V15Z" />
63
+ <Path fill-rule="evenodd" fill={colorFg} clip-rule="evenodd" d="M16 0C7.16345 0 0 7.16344 0 16V91C8.2843 91 15 97.7157 15 106C15 114.284 8.2843 121 0 121V194C0 202.837 7.16345 210 16 210H185.924C187.623 210 189 208.623 189 206.924C189 205.281 187.68 203.974 186.124 203.446C181.981 202.04 179 198.118 179 193.5C179 190.516 180.245 187.823 182.244 185.911C182.407 185.755 182.572 185.597 182.739 185.439C185.671 182.647 189 179.478 189 175.5C189 171.522 185.671 168.353 182.739 165.561C182.572 165.403 182.407 165.245 182.244 165.089C180.245 163.177 179 160.484 179 157.5C179 154.156 180.563 151.178 182.998 149.255C185.858 146.996 189 144.145 189 140.5C189 136.855 185.858 134.004 182.998 131.745C180.563 129.822 179 126.844 179 123.5C179 120.516 180.245 117.823 182.244 115.911C182.407 115.755 182.572 115.597 182.739 115.439C185.671 112.647 189 109.478 189 105.5C189 101.522 185.671 98.3527 182.739 95.5614C182.572 95.4028 182.407 95.2454 182.244 95.0891C180.245 93.1775 179 90.4841 179 87.5C179 84.1564 180.563 81.1778 182.998 79.2549C185.858 76.9962 189 74.1446 189 70.5C189 66.8554 185.858 64.0038 182.998 61.7451C180.563 59.8222 179 56.8436 179 53.5C179 50.5159 180.245 47.8225 182.244 45.9109C182.407 45.7546 182.572 45.5972 182.739 45.4386C185.671 42.6473 189 39.4782 189 35.5C189 31.5218 185.671 28.3527 182.739 25.5614C182.572 25.4028 182.407 25.2454 182.244 25.0891C180.245 23.1775 179 20.4841 179 17.5C179 13.0541 181.763 9.25356 185.666 7.72205C187.45 7.02203 189 5.50424 189 3.58798C189 1.60639 187.394 0 185.412 0H16Z" />
64
+ </Svg>
65
+
66
+ <View style={applyStyle({ position: 'absolute', width: LibStyle.width - 50, height: z, padding: 10, justifyContent: 'space-evenly', alignContent: 'center', alignItems: 'center' })}>
67
+ {
68
+ item.price_id == "staff" &&
69
+ <View style={applyStyle({ position: 'absolute', top: 12, right: 10, padding: 5, paddingHorizontal: 10, borderBottomLeftRadius: 10, borderTopRightRadius: 10, backgroundColor: 'red', margin: -10, marginBottom: 5 })}>
70
+ <Text allowFontScaling={false} style={applyStyle({ fontWeight: 'bold', color: colorText, fontSize: 12, })}>{item.price_id}</Text>
71
+ </View>
72
+ }
73
+ <View style={applyStyle({ flexDirection: 'row' })} >
74
+ <View style={applyStyle({ width: '35%', alignItems: 'center', justifyContent: 'center' })} >
75
+ <Text allowFontScaling={false} style={applyStyle({ color: colorText, fontWeight: 'bold', fontSize: 60, marginRight: '5%', textAlign: 'center' })}>{item.qty_left}</Text>
76
+ <Text allowFontScaling={false} style={applyStyle({ color: colorText, fontWeight: 'normal', fontSize: 20, marginRight: '5%', textAlign: 'center' })}>
77
+ <Text style={{ fontSize: 16 }}>{esp.lang("event/entrance_list_item", "total")}</Text>
78
+ {item.qty}</Text>
79
+
80
+ </View>
81
+ <View style={applyStyle({ flex: 1, justifyContent: 'center', marginRight: '10%' })} >
82
+ <Text allowFontScaling={false} style={applyStyle({ color: colorText, fontSize: 25, fontWeight: 'bold', textAlign: 'center' })} >{item.title}</Text>
83
+ </View>
84
+ </View>
85
+ </View>
86
+ </Pressable>
87
+ )
88
+ }
@@ -0,0 +1,130 @@
1
+ // withHooks
2
+ import { BigbangGate_infoProperty } from 'esoftplay/cache/bigbang/gate_info/import';
3
+ import { EventEntrance_successProperty } from 'esoftplay/cache/event/entrance_success/import';
4
+ import { EventLogProperty } from 'esoftplay/cache/event/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 EventEntrance_logArgs {
17
+
18
+ }
19
+ export interface EventEntrance_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: EventEntrance_logProps): any {
47
+ const log = BigbangGate_infoProperty.counterState().useSelector(s => s)
48
+ const backup = EventEntrance_successProperty.syncUsedTiket().useSelector(s => s)
49
+ const [loading, setLoading] = useSafeState<boolean>(true)
50
+ const timeout = useTimeout()
51
+
52
+ function syncData() {
53
+ BigbangGate_infoProperty.subscribeSync().trigger(EventEntrance_successProperty.syncUsedTiket().get())
54
+ timeout(() => {
55
+ setLoading(false)
56
+ }, 1000)
57
+ }
58
+
59
+ function forceSyncData() {
60
+ BigbangGate_infoProperty.subscribeSyncReset().trigger(EventEntrance_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 = EventLogProperty.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/entrance_log", "ticket_scanned")} value={sumValue?.entrance_scan} onPress={() => {
79
+ if (sumValue?.entrance_scan) {
80
+ props.onPress("entrance_scan", esp.lang("event/entrance_log", "scan_gate"))
81
+ }
82
+
83
+ }} />
84
+ <Item text={esp.lang("event/entrance_log", "qty_ticket_scan")} subtitle={esp.lang("event/entrance_log", "qty_ticket_scanned")} value={sumValue?.entrance_ticket} onPress={() => {
85
+ if (sumValue?.entrance_ticket) {
86
+ props.onPress("entrance_ticket", esp.lang("event/entrance_log", "qty_ticket_scan"))
87
+ }
88
+
89
+ }} />
90
+ <Item text={esp.lang("event/entrance_log", "open_gate")} subtitle={esp.lang("event/entrance_log", "ticket_scanned_id")} value={sumValue?.entrance_opengate} onPress={() => {
91
+ if (sumValue?.entrance_opengate) {
92
+ props.onPress("entrance_opengate", esp.lang("event/entrance_log", "open_gate"))
93
+ }
94
+ }} />
95
+ <Item text={esp.lang("event/entrance_log", "opengate_idcard")} subtitle={esp.lang("event/entrance_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/entrance_log", "opengate_idcard"))
98
+ }
99
+ }} />
100
+ <Item text={esp.lang("event/entrance_log", "data_send")} subtitle={esp.lang("event/entrance_log", "data_send_to_server")} value={sumValue?.entrance_send} onPress={() => {
101
+ if (sumValue?.entrance_send) {
102
+ props.onPress("entrance_send", esp.lang("event/entrance_log", "data_send"))
103
+ }
104
+
105
+ }} />
106
+ <Item text={esp.lang("event/entrance_log", "data_not_send")} subtitle={esp.lang("event/entrance_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/entrance_log", "please_wait")}<Text style={{ color: LibStyle.colorBlue, textDecorationStyle: 'solid', textDecorationLine: 'underline' }}>{esp.lang("event/entrance_log", "press_here")}</Text> {esp.lang("event/entrance_log", "press_here2")}</Text>
120
+ </Pressable>
121
+ } >
122
+ <LibTextstyle textStyle='callout'
123
+ style={{ textAlign: 'center', marginTop: 10 }}
124
+ text={esp.lang("event/entrance_log", "all_data_send")} />
125
+ </UseCondition>
126
+ </View>
127
+ </View >
128
+ )
129
+ }
130
+
@@ -0,0 +1,155 @@
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 { BigbangGate_infoProperty } from 'esoftplay/cache/bigbang/gate_info/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 EventEntrance_successArgs {
21
+
22
+ }
23
+ export interface EventEntrance_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: EventEntrance_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 } = useFirebaseSocket()
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: 'bigbang/gate_info',
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 + LibUtils.objectToUrlParam({
97
+ is_turnstile: 0,
98
+ })
99
+
100
+ let post = {
101
+ "target-url": "https://api.test.bbo.co.id/gate_checkin",
102
+ price_id: selectedTicket?.price_id,
103
+ qr: encodeURIComponent(qr_code),
104
+ trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
105
+ event_id: event_id,
106
+ gate_id: selectGate?.id,
107
+ is_tms: 1,
108
+ qty: _qty,
109
+ tms_id: UserClass.state().get()?.id,
110
+ scanned: LibUtils.moment().format('YYYY-MM-DD HH:mm:ss'),
111
+ }
112
+ BigbangGate_infoProperty.addCounterEntranceOpenGate(1, selectedTicket?.price_id)
113
+ syncUsedTiketState.set(LibObject.push(syncUsedTiketState.get(), [url, post])())
114
+ BigbangGate_infoProperty.subscribeSync().trigger(syncUsedTiketState.get())
115
+ }
116
+
117
+ const widthInterpolate = progress.interpolate({
118
+ inputRange: [0, 1],
119
+ outputRange: ['0%', '100%'],
120
+ });
121
+
122
+ return (
123
+ <View style={{ flex: 1 }}>
124
+ <LibStatusbar style='light' />
125
+ <Pressable
126
+ onPressIn={animateProgressBar}
127
+ onPressOut={animateProgressBar}
128
+ style={{ backgroundColor: '#000', height: LibStyle.height }}>
129
+ <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"} />
130
+
131
+ <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, }}>
132
+ <Animated.View style={{ width: widthInterpolate, height: 5, backgroundColor: LibStyle.colorPrimary, borderRadius: 10, }} />
133
+ </View>
134
+
135
+ <LinearGradient
136
+ // Background Linear Gradient
137
+ style={{
138
+ height: LibStyle.height - (LibStyle.height / 3),
139
+ width: LibStyle.width,
140
+ position: 'absolute',
141
+ left: 0,
142
+ right: 0,
143
+ bottom: 0,
144
+ }}
145
+ colors={['rgba(255,255,255,0)', 'rgba(0,0,0,0.55)', 'rgba(0,0,0,1)', 'rgba(0,0,0,1)']}>
146
+ <View style={{ flex: 1, padding: 15, justifyContent: 'flex-end', paddingBottom: 100, alignContent: 'center', alignItems: 'center' }}>
147
+ <Text allowFontScaling={false} style={{ textAlign: 'center', flexWrap: 'wrap', fontSize: 35, letterSpacing: 2, fontWeight: '900', color: '#fff' }}>{selectedTicket?.title?.split("+").join(' ')}</Text>
148
+ <Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 14, marginTop: 20, color: '#fff' }}>{gate_type == "1" ? esp.lang("event/entrance_success", "in") : esp.lang("event/entrance_success", "out")}</Text>
149
+ </View>
150
+
151
+ </LinearGradient>
152
+ </Pressable>
153
+ </View>
154
+ )
155
+ }