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,148 @@
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 { LibLoading } from 'esoftplay/cache/lib/loading/import';
7
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
8
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
9
+ import { UserClass } from 'esoftplay/cache/user/class/import';
10
+ import esp from 'esoftplay/esp';
11
+ import React from 'react';
12
+ import { View } from 'react-native';
13
+
14
+
15
+ export interface EventHall_inArgs {
16
+
17
+ }
18
+ export interface EventHall_inProps {
19
+
20
+ }
21
+ export default function m(props: EventHall_inProps): any {
22
+ const { scan_type, url_ticket_update, url_ticket_detail, price_type, gate_type, qr_code, event_id, selectGate, typeScanner, event_title, configPriority }: any = LibNavigation.getArgsAll<any>(props)
23
+
24
+ let args = {
25
+ selectGate: selectGate,
26
+ fromPage: 'bigbang/gate_info',
27
+ event_id: event_id,
28
+ event_title: event_title,
29
+ typeScanner: typeScanner,
30
+ gate_type: gate_type,
31
+ price_type: price_type,
32
+ url_ticket_detail: url_ticket_detail,
33
+ url_ticket_update: url_ticket_update,
34
+ configPriority: configPriority,
35
+ scan_type: scan_type
36
+ }
37
+ useEffect(() => {
38
+ loadData()
39
+ }, [])
40
+
41
+ function loadData() {
42
+ BigbangGate_infoProperty.addCounterHallInScan(1, "0")
43
+
44
+ var post = {
45
+ event_id: event_id,
46
+ user_qr: qr_code,
47
+ hall_id: selectGate?.id
48
+ }
49
+
50
+ let ticketsData: any[] = [];
51
+
52
+ new LibCurl('event_tms_hall', 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
+ esp.log({ res });
75
+
76
+ if (res?.hasOwnProperty("staff")) {
77
+ res?.staff?.map((it: any) => {
78
+ let x = {
79
+ ...it,
80
+ price_id: "staff",
81
+ user_name: it.name,
82
+ user_image: it.image,
83
+ exhibitor_name: it.department_name + "-" + it.exhibitor_name,
84
+ checked: 0
85
+ }
86
+ ticketsData.push(x)
87
+ })
88
+ }
89
+
90
+ if (ticketsData.length == 1) { // cek jika tiket cuma 1
91
+ let tiket = ticketsData[0]
92
+ if (tiket.price_id == "staff") { // jika itu adalah id card
93
+ if (tiket.status_scanned == 2) {
94
+ /* 0 tidak diperbolehkan, 1 sudah didalam, 2 available */
95
+ LibNavigation.replace('event/entrance_idcard', {
96
+ selectedTicket: { ...tiket, key: qr_code },
97
+ hall: "in",
98
+ ...args
99
+ })
100
+ } else {
101
+ let err = {
102
+ message: tiket.status_label,
103
+ result: tiket.scanned_detail
104
+ }
105
+ LibNavigation.replace('event/hall_in_failed', { msgError: err, ...args, postGetData: post })
106
+ }
107
+ } else { // jika itu adalah tiket
108
+ if (tiket.list?.length > 1) { // jika tiket itu mempunyai banyak qty
109
+ LibNavigation.replace('event/hall_in_list', { data: ticketsData, ...args })
110
+ } else { // jika tiket itu cuma 1 qty
111
+ let defaultUse = LibObject.set(tiket?.list, tiket?.list?.[0]?.status_scanned != 2 ? 1 : 0)(0, 'checked')
112
+ let a = defaultUse?.filter((item: any) => item.checked == 1 && item.status_scanned != 2).map((it: any) => it.id)
113
+ let postOut = {
114
+ event_id: event_id,
115
+ ids: JSON.stringify(a),
116
+ hall_id: selectGate?.id,
117
+ trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
118
+ price_id: defaultUse?.filter((item: any) => item.checked == 1 && item.status_scanned != 2).map((it: any) => it.price_id)
119
+ }
120
+ if (a.length > 0) { // jika tiket itu bisa di pakai
121
+ let urlOut = "event_tms_hall_confirm"
122
+ LibNavigation.replace('event/hall_in_success', { data: [tiket], ...args, url: urlOut, post: postOut })
123
+ } else { // jika tiket itu tidak bisa dipakai
124
+ let err = {
125
+ message: tiket?.list?.[0]?.status_label,
126
+ }
127
+ LibNavigation.replace('event/hall_in_failed', { msgError: err, ...args, postGetData: post })
128
+ }
129
+ }
130
+ }
131
+ } else { // jika punya tiket banyak
132
+ LibNavigation.replace('event/hall_in_list', { data: ticketsData, ...args })
133
+ }
134
+
135
+ }, (error) => { // jika tidak punya tiket
136
+ esp.log({ error });
137
+
138
+ LibNavigation.replace('event/hall_in_failed', { msgError: error, ...args, postGetData: post })
139
+ }, 1)
140
+ }
141
+
142
+
143
+ return (
144
+ <View style={{ flex: 1, backgroundColor: '#fff' }}>
145
+ <LibLoading />
146
+ </View>
147
+ )
148
+ }
@@ -0,0 +1,270 @@
1
+ // withHooks
2
+ import { useEffect } from 'react';
3
+
4
+ import { BigbangGate_infoProperty } from 'esoftplay/cache/bigbang/gate_info/import';
5
+ import { ComponentButton } from 'esoftplay/cache/component/button/import';
6
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
7
+ import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
8
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
9
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
10
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
11
+ import { LibProgress } from 'esoftplay/cache/lib/progress/import';
12
+ import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
13
+ import { LibStatusbar } from 'esoftplay/cache/lib/statusbar/import';
14
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
15
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
16
+ import { UseCondition } from 'esoftplay/cache/use/condition/import';
17
+ import { UserClass } from 'esoftplay/cache/user/class/import';
18
+ import esp from 'esoftplay/esp';
19
+ import useSafeState from 'esoftplay/state';
20
+ import React from 'react';
21
+ import { Alert, Pressable, ScrollView, Text, View } from 'react-native';
22
+
23
+
24
+ export interface EventHall_in_failedArgs {
25
+
26
+ }
27
+ export interface EventHall_in_failedProps {
28
+
29
+ }
30
+
31
+ export default function m(props: EventHall_in_failedProps): any {
32
+ 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)
33
+
34
+ const [data, setData, getData] = useSafeState()
35
+ const [qty, setQty, getQty] = useSafeState(1)
36
+
37
+ const qtyRef = React.useRef<LibSlidingup>(null)
38
+
39
+ useEffect(() => {
40
+ BigbangGate_infoProperty.addCounterHallInScanFailed(1, "0")
41
+ }, [])
42
+
43
+ function getBack() {
44
+ LibNavigation.replace('component/scanner', {
45
+ selectGate: selectGate,
46
+ fromPage: 'bigbang/gate_info',
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
+ scan_type: scan_type,
56
+ })
57
+ }
58
+
59
+ function forceEntrance() {
60
+ let dataEntranceIn = []
61
+ let dataEntranceBackIn = []
62
+ let mustBeEntrance = 0
63
+ let doneEntrance = 0
64
+
65
+ const arr: any[] = msgError.result
66
+ dataEntranceIn = arr.filter((x: any) => x?.status_scanned == 2)
67
+ dataEntranceBackIn = arr.filter((x: any) => x?.status_scanned == 5)
68
+
69
+ qtyRef.current?.hide()
70
+ LibProgress.show("Processing")
71
+
72
+ if (dataEntranceIn.length > 0) {
73
+ mustBeEntrance += 1
74
+ let post = {
75
+ "target-url": "https://api.test.bbo.co.id/gate_checkin",
76
+ price_id: getData().ticket.price_id,
77
+ qr: encodeURIComponent(postGetData.user_qr),
78
+ trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
79
+ event_id: event_id,
80
+ gate_id: getData().gate.id,
81
+ is_tms: 1,
82
+ qty: getQty(),
83
+ tms_id: UserClass.state().get()?.id,
84
+ scanned: LibUtils.moment().format('YYYY-MM-DD HH:mm:ss'),
85
+ }
86
+ new LibCurl(url_ticket_update + "?is_turnstile=0", post,
87
+ (res) => {
88
+ doneEntrance += 1
89
+ if (mustBeEntrance <= doneEntrance) {
90
+ LibProgress.hide()
91
+ Alert.alert("Berhasil masuk ke Gate!", "Silahkan lanjutkan proses masuk ke hall", [
92
+ {
93
+ text: "OK", onPress: () => {
94
+ LibNavigation.replace("event/hall_in", { scan_type, url_ticket_update, url_ticket_detail, price_type, gate_type, qr_code: postGetData.user_qr, event_id, selectGate, typeScanner, event_title, configPriority })
95
+ }
96
+ }
97
+ ])
98
+ }
99
+ },
100
+ (error) => {
101
+ doneEntrance += 1
102
+ if (mustBeEntrance <= doneEntrance) {
103
+ LibProgress.hide()
104
+ }
105
+ },
106
+ )
107
+ }
108
+ if (dataEntranceBackIn.length > 0) {
109
+ mustBeEntrance += 1
110
+ var post = {
111
+ event_id: event_id,
112
+ ids: JSON.stringify(dataEntranceBackIn.map((x: any) => x.id_out_temporary).slice(0, getQty())),
113
+ gate_id: getData().gate.id,
114
+ }
115
+ new LibCurl('event_tms_out_temporary_in_confirm', post, (result, msg) => {
116
+ doneEntrance += 1
117
+ if (mustBeEntrance <= doneEntrance) {
118
+ LibProgress.hide()
119
+ Alert.alert("Berhasil masuk ke Gate!", "Silahkan lanjutkan proses masuk ke hall", [
120
+ {
121
+ text: "OK", onPress: () => {
122
+ LibNavigation.replace("event/hall_in", { scan_type, url_ticket_update, url_ticket_detail, price_type, gate_type, qr_code: postGetData.user_qr, event_id, selectGate, typeScanner, event_title, configPriority })
123
+ }
124
+ }
125
+ ])
126
+ // LibNavigation.replace("event/hall_in", { scan_type, url_ticket_update, url_ticket_detail, price_type, gate_type, qr_code: postGetData.user_qr, event_id, selectGate, typeScanner, event_title, configPriority })
127
+ }
128
+ }, (error) => {
129
+ doneEntrance += 1
130
+ if (mustBeEntrance <= doneEntrance) {
131
+ LibProgress.hide()
132
+ }
133
+ })
134
+ }
135
+ }
136
+
137
+ function sendTelegram() {
138
+ let data = {
139
+ '#bbohallin': ":",
140
+ reporter: {
141
+ email: UserClass.state().get().email,
142
+ name: UserClass.state().get().name
143
+ },
144
+ url: "event_tms_hall",
145
+ post: postGetData,
146
+ error_msg: msgError,
147
+ }
148
+
149
+ let post = {
150
+ text: String(JSON.stringify(data || {}, undefined, 2)).replace(/[\[\]\{\}\"]+/g, ''),
151
+ chat_id: '-1001737180019',
152
+ disable_web_page_preview: true
153
+ }
154
+
155
+ let _url = "https://api.telegram.org/bot923808407:AAEFBlllQNKCEn8E66fwEzCj5vs9qGwVGT4/sendMessage"
156
+ new LibCurl().custom(_url, post, (res, msg) => { })
157
+ }
158
+
159
+ return (
160
+ <View style={{ flex: 1 }}>
161
+ <LibStatusbar style='light' />
162
+ <View style={{ flex: 1 }}>
163
+ <LibPicture source={esp.assets('failed.png')} style={{ flex: 1, height: LibStyle.height, width: LibStyle.width }} /* resizeMode={"stretch"} */ />
164
+ </View>
165
+ <View style={{ flex: 1, position: 'absolute', top: 50, left: 0, right: 0, bottom: 0, alignItems: 'center', alignContent: 'center' }} >
166
+ <ScrollView>
167
+ <View style={{ marginBottom: 20, alignSelf: 'center', borderRadius: LibStyle.width / 3, padding: 10, backgroundColor: '#fff' }}>
168
+ <LibPicture
169
+ source={esp.assets('failed_icon.png')}
170
+ style={{ width: LibStyle.width / 3, height: LibStyle.width / 3 }}
171
+ />
172
+ </View>
173
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 25, color: '#fff', marginHorizontal: 20, textAlign: 'center', letterSpacing: 1 }}>{msgError?.message}</Text>
174
+ <ScrollView>
175
+ <View style={{ minHeight: LibStyle.height * 0.4, marginTop: 30 }}>
176
+ {
177
+ msgError?.result?.length > 0 &&
178
+ <Text allowFontScaling={false} style={{ textAlign: 'center', marginBottom: 10, fontSize: 18, fontWeight: "bold", fontStyle: "normal", letterSpacing: 1.5, color: "#fff" }}>{esp.lang("event/hall_in_failed", "history_used")}</Text>
179
+ }
180
+ {
181
+ msgError?.result?.length > 0 && msgError?.result?.map((item: any, i: number) => {
182
+ return (
183
+ <View key={i} style={{ marginBottom: 5, backgroundColor: "#fff", borderRadius: 10, overflow: 'hidden' }}>
184
+ {
185
+ item.hasOwnProperty("status_label") && item?.status_label != "" &&
186
+ <View style={{ backgroundColor: '#37c2d0', padding: 10, }} >
187
+ <Text allowFontScaling={false} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", letterSpacing: 1.5, color: item?.status == 1 ? item?.status_background : "#fff" }}>{(item?.status_label)?.toUpperCase()}</Text>
188
+ </View>
189
+ }
190
+ <View style={{ padding: 10, flexDirection: 'row', justifyContent: 'space-between', }}>
191
+ <View style={{ flex: 1 }}>
192
+ <Text allowFontScaling={false} style={{ marginBottom: 5, fontWeight: 'bold', fontSize: 14 }}>{esp.lang("event/hall_in_failed", "type")}</Text>
193
+ <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode="tail" style={{ letterSpacing: 1, fontSize: 12 }}>{item?.price_name}</Text>
194
+ </View>
195
+ <View style={{ flex: 2 }}>
196
+ <Text allowFontScaling={false} style={{ marginBottom: 5, fontWeight: 'bold', textAlign: 'center', fontSize: 14 }}>{esp.lang("event/hall_in_failed", "time")}</Text>
197
+ {
198
+ item?.hall_scanned != "0000-00-00 00:00:00" &&
199
+ <Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 12 }}>{LibUtils.moment(item?.hall_scanned).localeFormat("DD MMM H:mm:ss ")}</Text>
200
+ }
201
+ </View>
202
+ <View style={{ flex: 2 }}>
203
+ <Text allowFontScaling={false} style={{ marginBottom: 5, fontWeight: 'bold', textAlign: 'center', fontSize: 14 }}>{/*hall*/"TMS - Hall"}</Text>
204
+ {
205
+ item?.hall_name != null &&
206
+ <Text allowFontScaling={false} style={{ letterSpacing: 1, textAlign: 'center', fontSize: 12 }}>{item.hasOwnProperty("tms_email") ? item?.tms_email + "\n" + item?.hall_name : item?.hall_name}</Text>
207
+ }
208
+ </View>
209
+
210
+ </View>
211
+ </View>
212
+ )
213
+ })
214
+ }
215
+ </View>
216
+ </ScrollView>
217
+ </ScrollView>
218
+ <UseCondition if={msgError?.status_code == 'EV043'}>
219
+ <View style={{ flexDirection: 'row' }} >
220
+ <Pressable onPress={() => {
221
+ LibNavigation.navigateForResult("bigbang/gate_result", { type: "gate", event_id: event_id }, 2123).then((gate) => {
222
+ const ticket = msgError.result[0]
223
+ setData({ gate, ticket })
224
+ const validDataLength = msgError.result?.filter?.((x) => (x?.status_scanned == 2 || x?.status_scanned == 5))?.length
225
+ if (validDataLength > 1) {
226
+ qtyRef.current?.show()
227
+ } else if (validDataLength == 1) {
228
+ setQty(1)
229
+ forceEntrance()
230
+ }
231
+ })
232
+ }} style={{ marginHorizontal: 20, flex: 1, height: 40, borderRadius: 5, backgroundColor: LibStyle.colorPrimary, justifyContent: 'center', alignContent: 'center', alignItems: 'center', ...LibStyle.elevation(10) }} >
233
+ <Text allowFontScaling={false} style={{ textAlign: 'center', fontWeight: 'bold', color: "#fff" }}>PAKSA MASUK KE GATE</Text>
234
+ </Pressable>
235
+ </View>
236
+ </UseCondition>
237
+ <View style={{ flexDirection: 'row', width: LibStyle.width - 40, alignItems: 'center', marginVertical: 10, justifyContent: 'center' }}>
238
+ <UseCondition if={msgError?.status_code != 'EV043'}>
239
+ <Pressable onPress={() => {
240
+ LibDialog.warningConfirm(esp.lang("event/entrance_failed", "warn_title"), esp.lang("event/entrance_failed", "warn_msg"), esp.lang("event/entrance_failed", "warn_ok"), () => {
241
+ sendTelegram()
242
+ }, esp.lang("event/entrance_failed", "warn_no"), () => { })
243
+
244
+ }} style={{ width: (LibStyle.width - 45) * 0.5, height: 40, borderRadius: 5, backgroundColor: LibStyle.colorRed, borderWidth: 3, borderColor: "#fff", justifyContent: 'center', alignContent: 'center', alignItems: 'center', ...LibStyle.elevation(10) }}>
245
+ <Text allowFontScaling={false} style={{ textAlign: 'center', fontWeight: 'bold', color: "#fff" }}>{esp.lang("event/hall_in_failed", "report_error")}</Text>
246
+ </Pressable>
247
+ </UseCondition>
248
+ <Pressable onPress={getBack} style={{ width: (LibStyle.width - 45) * 0.5, height: 40, borderRadius: 5, borderWidth: 5, borderColor: LibStyle.colorGreen, justifyContent: 'center', alignContent: 'center', alignItems: 'center', ...LibStyle.elevation(10) }}>
249
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', color: "#fff" }}>{esp.lang("event/hall_in_failed", "back")}</Text>
250
+ </Pressable>
251
+
252
+ </View>
253
+ </View>
254
+ <LibSlidingup ref={qtyRef}>
255
+ <View style={{ backgroundColor: 'white', padding: 20, borderTopLeftRadius: 30, borderTopRightRadius: 30 }} >
256
+ <View style={{ flexDirection: 'row', padding: 20, alignItems: 'center' }} >
257
+ <Pressable onPress={() => { setQty(Math.max(1, qty - 1)) }} >
258
+ <LibIcon.SimpleLineIcons size={40} name='minus' />
259
+ </Pressable>
260
+ <Text allowFontScaling={false} style={{ fontSize: 50, fontWeight: 'bold', textAlign: 'center', flex: 1 }}>{qty}</Text>
261
+ <Pressable onPress={() => { setQty(Math.min(msgError.result?.filter?.((x) => (x?.status_scanned == 2 || x?.status_scanned == 5))?.length, qty + 1)) }} >
262
+ <LibIcon.SimpleLineIcons size={40} name='plus' />
263
+ </Pressable>
264
+ </View>
265
+ <ComponentButton label='Force Entrance' onPress={() => { forceEntrance() }} />
266
+ </View>
267
+ </LibSlidingup >
268
+ </View >
269
+ )
270
+ }
@@ -0,0 +1,222 @@
1
+ // withHooks
2
+ import { useEffect, useRef } from 'react';
3
+
4
+
5
+ import { applyStyle } from 'esoftplay';
6
+ import { ComponentButton } from 'esoftplay/cache/component/button/import';
7
+ import { ComponentHeader } from 'esoftplay/cache/component/header/import';
8
+ import { ComponentSlidingup } from 'esoftplay/cache/component/slidingup/import';
9
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
10
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
11
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
12
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
13
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
14
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
15
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
16
+ import { UserClass } from 'esoftplay/cache/user/class/import';
17
+ import esp from 'esoftplay/esp';
18
+ import useSafeState from 'esoftplay/state';
19
+ import React from 'react';
20
+ import { Pressable, ScrollView, Text, TouchableOpacity, View } from 'react-native';
21
+ import { Path, Svg } from 'react-native-svg';
22
+
23
+
24
+
25
+ export interface EventHall_in_listArgs {
26
+
27
+ }
28
+ export interface EventHall_in_listProps {
29
+
30
+ }
31
+ export default function m(props: EventHall_in_listProps): any {
32
+ 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)
33
+ const [useAll, setUseAll] = useSafeState<boolean>(false)
34
+ const [list, setList] = useSafeState<any>()
35
+ const dialogQty = useRef<ComponentSlidingup>(null)
36
+
37
+ let args = {
38
+ selectGate: selectGate,
39
+ fromPage: 'bigbang/gate_info',
40
+ event_id: event_id,
41
+ event_title: event_title,
42
+ typeScanner: typeScanner,
43
+ gate_type: gate_type,
44
+ price_type: price_type,
45
+ url_ticket_detail: url_ticket_detail,
46
+ url_ticket_update: url_ticket_update,
47
+ configPriority: configPriority,
48
+ data: data,
49
+ scan_type: scan_type
50
+ }
51
+
52
+ useEffect(() => {
53
+ if (data?.length == 1) {
54
+ let item = data?.[0]
55
+ let defaultUse = LibObject.set(item?.list, 1)(0, 'checked')
56
+ setList(defaultUse)
57
+ dialogQty?.current?.show()
58
+ }
59
+ }, [])
60
+
61
+ function renderItem(item: any, i: number) {
62
+ const z = (200 / 500) * (LibStyle.width - 50);
63
+ if (item.price_id == "staff") {
64
+ return (
65
+ <Pressable key={i} onPress={() => {
66
+ if (item.status_scanned == 2) /* 0 tidak diperbolehkan, 1 sudah didalam, 2 available */ {
67
+ LibNavigation.replace('event/entrance_idcard', {
68
+ selectedTicket: item,
69
+ hall: "in",
70
+ ...args
71
+ })
72
+ } else {
73
+ var post = {
74
+ event_id: event_id,
75
+ hall_id: selectGate?.id
76
+ }
77
+ let err = {
78
+ message: item.status_label,
79
+ result: item.scanned_detail
80
+ }
81
+ LibNavigation.replace('event/hall_in_failed', { msgError: err, ...args, postGetData: post })
82
+ }
83
+
84
+ }} style={{ width: LibStyle.width - 50, marginBottom: 10, backgroundColor: LibStyle.colorPrimary, padding: 15, borderRadius: 10, ...LibStyle.elevation(3) }}>
85
+ <View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
86
+ <View style={{ height: 80, width: 80, borderRadius: 10, backgroundColor: LibStyle.colorBgGrey, ...LibStyle.elevation(3) }}>
87
+ <LibPicture source={{ uri: item?.user_image }} style={{ height: 80, width: 80, borderRadius: 10 }} />
88
+ </View>
89
+ <View style={{ marginHorizontal: 10, flex: 1, alignContent: 'center', justifyContent: 'center' }}>
90
+ <Text allowFontScaling={false} numberOfLines={2} style={applyStyle({ color: "#000", fontSize: 16, fontWeight: 'bold' })} >{item.user_name}</Text>
91
+ <Text allowFontScaling={false} style={applyStyle({ letterSpacing: 1, color: "#000", fontSize: 20, fontWeight: 'bold' })} >{item?.exhibitor_name?.split('-')[0]}</Text>
92
+ <Text allowFontScaling={false} numberOfLines={4} style={applyStyle({ letterSpacing: 1, color: "#000", fontSize: 16, fontWeight: 'normal' })} >{item?.exhibitor_name?.split('-')[1]}</Text>
93
+
94
+ </View>
95
+ </View>
96
+ </Pressable>
97
+ )
98
+ } else {
99
+ return (
100
+ <Pressable key={i} onPress={() => {
101
+ let defaultUse = LibObject.set(item.list, 1)(0, 'checked')
102
+ setList(defaultUse)
103
+ dialogQty?.current?.show()
104
+ }}>
105
+ <Svg width={LibStyle.width - 50} height={z} viewBox="0 0 544 210" fill="none">
106
+ <Path fill-rule="evenodd" fill={LibUtils.hexToRgba(LibStyle.colorPrimary, 0.5)} 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" />
107
+ <Path fill-rule="evenodd" fill={LibStyle.colorPrimary} 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" />
108
+ </Svg>
109
+ <View style={applyStyle({ position: 'absolute', width: LibStyle.width - 50, height: z, padding: 10, justifyContent: 'space-evenly', alignContent: 'center', alignItems: 'center' })}>
110
+ <View style={applyStyle({ flexDirection: 'row' })} >
111
+ <View style={applyStyle({ width: '35%', alignItems: 'center', justifyContent: 'center' })} >
112
+ <Text allowFontScaling={false} style={applyStyle({ color: "#000", fontWeight: 'bold', fontSize: 50, marginRight: '5%', textAlign: 'center' })}>{item.qty}</Text>
113
+ <Text allowFontScaling={false} style={applyStyle({ color: "#000", fontWeight: 'normal', fontSize: 18, marginRight: '5%', textAlign: 'center' })}>Tiket</Text>
114
+ </View>
115
+ <View style={applyStyle({ flex: 1, justifyContent: 'center', marginRight: '10%' })} >
116
+ <Text allowFontScaling={false} style={applyStyle({ color: "#000", fontSize: 25, fontWeight: 'bold', textAlign: 'center' })} >{item.price_name}</Text>
117
+ </View>
118
+ </View>
119
+ </View>
120
+ </Pressable>
121
+ )
122
+ }
123
+ }
124
+
125
+ function findLastIndex(arr: any[], condition: (value: any, index: number, obj: any[]) => unknown) {
126
+ const reversedArray = arr.slice().reverse();
127
+ const indexInReversedArray = reversedArray.findIndex(condition);
128
+
129
+ if (indexInReversedArray === -1) {
130
+ return -1; // No matching element found
131
+ }
132
+
133
+ const lastIndex = arr.length - 1 - indexInReversedArray;
134
+ return lastIndex;
135
+ }
136
+
137
+ function quit(): void {
138
+ let a = list?.filter((item: any) => item.checked == 1).map((it: any) => it.id)
139
+ if (a.length == 0) {
140
+ LibToastProperty.show("Silahkan Pilih Tiket dahulu")
141
+ return
142
+ } else {
143
+ let url = "event_tms_hall_confirm"
144
+ let post = {
145
+ event_id: event_id,
146
+ ids: JSON.stringify(a),
147
+ hall_id: selectGate?.id,
148
+ trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
149
+ price_id: list?.filter((item: any) => item.checked == 1 && item.status_scanned != 2).map((it: any) => it.price_id)
150
+ }
151
+
152
+ LibNavigation.replace('event/hall_in_success', { ...args, url, post })
153
+ }
154
+ }
155
+
156
+ return (
157
+ <View style={{ flex: 1, backgroundColor: '#fff' }}>
158
+ <ComponentHeader title={esp.lang("event/hall_in_list", "header_title")} subtitle='HALL' />
159
+ <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center', paddingTop: 15, paddingBottom: 0 }}>
160
+ <ScrollView style={{ flex: 1 }}>
161
+ {
162
+ data?.map(renderItem)
163
+ }
164
+ </ScrollView>
165
+ </View>
166
+
167
+ <ComponentSlidingup ref={dialogQty}>
168
+ <View style={{ borderTopRightRadius: 20, borderTopLeftRadius: 20, padding: 10, backgroundColor: '#fff', maxHeight: LibStyle.height - (LibStyle.height / 3) }}>
169
+ <View style={{ flexDirection: 'row', alignItems: 'center', marginVertical: 20 }} >
170
+ <TouchableOpacity
171
+ onPress={() => {
172
+ const index = findLastIndex(list, (x: any) => x.checked == 1)
173
+ if (index > 0) {
174
+ setList(LibObject.set(list, 0)(index, 'checked'))
175
+ }
176
+ }}
177
+ style={{ height: 70, width: 70, borderRadius: 10, backgroundColor: '#c1c2c3', alignItems: 'center', justifyContent: 'center' }} >
178
+ <LibIcon name='minus' size={50} />
179
+ </TouchableOpacity>
180
+ <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }} >
181
+ <Text style={{ fontSize: 50 }} >{list?.filter?.((x: any) => x.checked == 1).length}</Text>
182
+ </View>
183
+ <TouchableOpacity
184
+ onPress={() => {
185
+ const index = list?.findIndex?.((x: any) => x.checked == 0)
186
+ if (index > -1)
187
+ setList(LibObject.set(list, 1)(index, 'checked'))
188
+ }}
189
+ style={{ height: 70, width: 70, borderRadius: 10, backgroundColor: '#c1c2c3', alignItems: 'center', justifyContent: 'center' }} >
190
+ <LibIcon name='plus' size={50} />
191
+ </TouchableOpacity>
192
+ </View>
193
+
194
+ <View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'space-between' }}>
195
+ <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode={'tail'} style={{ fontWeight: 'bold', fontSize: 14, letterSpacing: 1 }}>{list?.filter((item: any) => !item.hasOwnProperty("type") && item.checked == 1).length + " Tiket digunakan"}</Text>
196
+ <TouchableOpacity onPress={() => {
197
+ let a = list?.map((item: any, i: number) => {
198
+ return { ...item, checked: item.status_scanned == 2 ? 0 : (useAll ? 0 : 1) }
199
+ })
200
+ setList(a)
201
+ setUseAll(useAll ? false : true)
202
+ }} 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' })} >
203
+ <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>
204
+ <LibIcon.Ionicons size={18} color="#fff" name={useAll ? "close" : "checkmark-done"} />
205
+ </TouchableOpacity>
206
+ </View>
207
+
208
+ <ComponentButton
209
+ label={esp.lang("event/hall_in_list", "btn_entrance")}
210
+ backgroundColor={LibStyle.colorGreen}
211
+ onPress={() => {
212
+ quit()
213
+ }}
214
+ style={{ marginTop: 30 }}
215
+ />
216
+
217
+ </View>
218
+ </ComponentSlidingup>
219
+
220
+ </View>
221
+ )
222
+ }