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,203 @@
1
+ // withHooks
2
+
3
+ import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
4
+ import { EventButton } from 'esoftplay/cache/event/button/import';
5
+ import { EventTms_in_successProperty } from 'esoftplay/cache/event/tms_in_success/import';
6
+ import { EventHeader } from 'esoftplay/cache/event/header/import';
7
+ import { EventSheet } from 'esoftplay/cache/event/sheet/import';
8
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
9
+ import { LibDialog } from 'esoftplay/cache/lib/dialog/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, { useEffect, useRef } from 'react';
20
+ import { Text, View } from 'react-native';
21
+
22
+
23
+ export interface EventTms_idcardArgs {
24
+
25
+ }
26
+ export interface EventTms_idcardProps {
27
+
28
+ }
29
+ export default function m(props: EventTms_idcardProps): any {
30
+ const width = LibStyle.width
31
+ const height = 12 / 9 * width
32
+ const marginTop = 2.7 / 9 * width
33
+ const photoHeight = 4 / 9 * width
34
+ const photoWidth = 3 / 9 * width
35
+ const photoMarginBot = 0.46 / 9 * width
36
+
37
+ const menuRef = useRef<EventSheet>(null)
38
+
39
+ const {
40
+ hall,
41
+ selectedTicket,
42
+ event_id,
43
+ selectGate,
44
+ url_ticket_update,
45
+ price_type,
46
+ gate_type,
47
+ event_title,
48
+ typeScanner,
49
+ url_ticket_detail,
50
+ configPriority,
51
+ scan_type
52
+ } = LibNavigation.getArgsAll(props)
53
+
54
+ const [result, setResult] = useSafeState<any>()
55
+
56
+ function loadData() {
57
+ // load data untuk ngambil background id card
58
+ new LibCurl('event_tms_visitor?event_id=' + event_id, null, (res, message) => {
59
+ setResult(res)
60
+ }, (error) => {
61
+ LibToastProperty?.show(error?.message)
62
+ LibNavigation.back()
63
+ }, 1)
64
+ }
65
+
66
+ useEffect(() => {
67
+ loadData()
68
+ if (hall && hall == "in") {
69
+ entranceHall()
70
+ } else if (hall && hall == "out") {
71
+ exitHall()
72
+ } else {
73
+ entrance()
74
+ }
75
+ }, [])
76
+
77
+ function entrance() {
78
+ let url = url_ticket_update + LibUtils.objectToUrlParam({
79
+ is_turnstile: 0,
80
+ })
81
+
82
+ let post = {
83
+ "target-url": "https://api.test.bbo.co.id/gate_checkin",
84
+ price_id: 0,
85
+ qr: encodeURIComponent(selectedTicket?.key),
86
+ trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
87
+ event_id: event_id,
88
+ gate_id: selectGate?.id,
89
+ is_tms: 1,
90
+ qty: selectedTicket?.qty,
91
+ tms_id: UserClass.state().get()?.id
92
+ }
93
+
94
+ EventTms_homeProperty.addCounterEntranceOpenGateIdCard(1, selectedTicket?.price_id)
95
+ EventTms_in_successProperty.syncUsedTiket().set(LibObject.push(EventTms_in_successProperty.syncUsedTiket().get(), [url, post])())
96
+ EventTms_homeProperty.subscribeSync().trigger(EventTms_in_successProperty.syncUsedTiket().get())
97
+ }
98
+
99
+ function entranceHall() {
100
+ let post = {
101
+ event_id: event_id,
102
+ hall_id: selectGate?.id,
103
+ staff_id: selectedTicket?.id
104
+ }
105
+ new LibCurl('event_tms_hall_confirm_staff', post, (res, message) => {
106
+ // setResult(res)
107
+ EventTms_homeProperty.addCounterHallInGateIdcard(1, selectedTicket?.price_id)
108
+ }, (error) => {
109
+ }, 1)
110
+ }
111
+
112
+ function exitHall() {
113
+ let post = {
114
+ event_id: event_id,
115
+ hall_id: selectGate?.id,
116
+ id: selectedTicket?.id // ini id stafff
117
+ }
118
+ new LibCurl('event_tms_hall_out_confirm_staff', post, (res, message) => {
119
+ // setResult(res)
120
+ EventTms_homeProperty.addCounterHallOutOpenGateIdCard(1, selectedTicket?.price_id)
121
+ }, (error) => {
122
+ }, 1)
123
+ }
124
+
125
+
126
+ return (
127
+ <View style={{ flex: 1 }}>
128
+ <EventHeader
129
+ title={esp.lang("event/tms_idcard", "header")}
130
+ notif
131
+ onPressMore={() => menuRef.current?.show()}
132
+ more
133
+ />
134
+ <View style={{ backgroundColor: '#000', height: LibStyle.height, alignItems: 'center' }}>
135
+ {/* ini id_card nya */}
136
+ <LibPicture source={result?.event?.image_idcard == "" ? esp.assets('white_idcard.png') : { uri: result?.event?.image_idcard }} style={{ width: width, height: height, resizeMode: 'contain' }} />
137
+ <View style={{ position: 'absolute' }}>
138
+ <LibPicture source={{ uri: selectedTicket?.user_image != '' ? decodeURIComponent(selectedTicket?.user_image) : 'https://www.w3schools.com/howto/img_avatar.png' }} style={{ marginBottom: photoMarginBot, marginTop: marginTop, height: photoHeight, width: photoWidth, alignSelf: 'center', resizeMode: 'cover', }} />
139
+ <View style={{ padding: 10, marginTop: 5 }} >
140
+ {/* view nama */}
141
+ <View style={{ flexDirection: 'row' }} >
142
+ <Text allowFontScaling={false} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a", flex: 3 }} >{esp.lang("event/tms_idcard", "name")}</Text>
143
+ <Text allowFontScaling={false} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a" }} > : </Text>
144
+ <Text allowFontScaling={false} numberOfLines={1} ellipsizeMode={"tail"} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a", flex: 5 }} >{selectedTicket ? decodeURIComponent((selectedTicket?.user_name))?.split("+").join(' ') : esp.lang("event/tms_idcard", "visitor")}</Text>
145
+ </View>
146
+ {/* view company */}
147
+ <View style={{ flexDirection: 'row' }} >
148
+ <Text allowFontScaling={false} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a", flex: 3 }} >{esp.lang("event/tms_idcard", "company")}</Text>
149
+ <Text allowFontScaling={false} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a" }} > : </Text>
150
+ <Text allowFontScaling={false} numberOfLines={1} ellipsizeMode={"tail"} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a", flex: 5 }} >{selectedTicket?.exhibitor_name?.split('-')[1]}</Text>
151
+ </View>
152
+
153
+ <View style={{ width: width - 20, alignSelf: 'center', backgroundColor: '#4a4a4a', height: 4, marginVertical: 4 }} />
154
+ <Text allowFontScaling={false} style={{ marginTop: -5, fontSize: 20, fontWeight: "bold", fontStyle: "normal", lineHeight: 32, textAlign: 'center', letterSpacing: 0, color: "#4a4a4a" }} >{selectedTicket?.exhibitor_name?.split('-')[0]}</Text>
155
+ </View>
156
+
157
+ </View>
158
+ <EventButton
159
+ label={esp.lang("event/tms_idcard", "btn_back")}
160
+ backgroundColor={LibStyle.colorPrimary}
161
+ onPress={() => {
162
+ // LibNavigation.back()
163
+ LibNavigation.replace('component/scanner', {
164
+ selectGate: selectGate,
165
+ fromPage: 'event/tms_home',
166
+ event_id: event_id,
167
+ event_title: event_title,
168
+ typeScanner: typeScanner,
169
+ gate_type: gate_type,
170
+ price_type: price_type,
171
+ url_ticket_detail: url_ticket_detail,
172
+ url_ticket_update: url_ticket_update,
173
+ configPriority: configPriority,
174
+ scan_type: scan_type
175
+ })
176
+ }}
177
+ style={{ marginTop: 20, marginHorizontal: 15 }}
178
+ />
179
+ </View>
180
+ <EventSheet
181
+ _ref={menuRef}
182
+ title={"ID CARD"}
183
+ options={[
184
+ {
185
+ text: "Tahan ID CARD",
186
+ textStyle: { color: "red" },
187
+ onPress: () => {
188
+ LibDialog.warningConfirm(esp.lang("event/tms_dashboard", "block_idcard_title"), esp.lang("event/tms_dashboard", "block_idcard_message"), esp.lang("event/tms_dashboard", "block_idcard_ok"), () => {
189
+ new LibCurl("event_tms_staff_hold", { qr: encodeURIComponent(selectedTicket?.key) }, (result, message) => {
190
+ LibDialog.info("Berhasil!", message)
191
+ }, (error) => {
192
+ LibDialog.warning("Oops!", error?.message)
193
+ })
194
+ }, esp.lang("event/tms_dashboard", "block_idcard_no"), () => {
195
+ LibDialog.hide()
196
+ })
197
+ }
198
+ }
199
+ ]}
200
+ />
201
+ </View>
202
+ )
203
+ }
@@ -0,0 +1,215 @@
1
+ // withHooks
2
+ import { LibLoading } from 'esoftplay/cache/lib/loading/import';
3
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
4
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
5
+
6
+ import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
7
+ import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
8
+ import esp from 'esoftplay/esp';
9
+ import React, { useEffect } from 'react';
10
+ import { View } from 'react-native';
11
+ import useFirebaseSocket from '../lib/firebase_socket';
12
+
13
+
14
+ export interface EventTms_inArgs {
15
+
16
+ }
17
+ export interface EventTms_inProps {
18
+
19
+ }
20
+
21
+
22
+ export default function m(props: EventTms_inProps): any {
23
+
24
+ const { price_type,
25
+ gate_type,
26
+ qr_code,
27
+ event_id,
28
+ selectGate,
29
+ typeScanner,
30
+ event_title,
31
+ url_ticket_detail,
32
+ url_ticket_update,
33
+ configPriority,
34
+ scan_type
35
+ } = LibNavigation.getArgsAll<any>(props)
36
+
37
+ const { get } = useFirebaseSocket()
38
+
39
+ let whatTypeGate = gate_type == "1" ? 'in' : 'out'
40
+
41
+ /* price_id */
42
+ /* qty */
43
+ /* name */
44
+ /* qty_used */
45
+ /* image */
46
+ // sample: [
47
+ // "1121": [
48
+ // 2,
49
+ // "Muhammad Bagus Yulianto",
50
+ // 2,
51
+ // "https://api.test.bbo.co.id/images/modules/user/avatar/122674696.jpg"
52
+ // ],
53
+ // "staff": [
54
+ // [
55
+ // 1,
56
+ // "Muhammad Bagus Yulianto",
57
+ // 0,
58
+ // "https://api.test.bbo.co.id/images/modules/bigbang/exhibitor/1/staff/1211616174.jpg",
59
+ // "VIP-Expo Indonesia Jaya"
60
+ // ]
61
+ // ]
62
+ // ]
63
+
64
+
65
+ function mainPath(qr: string) {
66
+ let a = ['event', event_id, whatTypeGate, qr]
67
+ return a.join('/')
68
+ }
69
+
70
+ let args = {
71
+ price_type: price_type,
72
+ gate_type: gate_type,
73
+ qr_code: qr_code,
74
+ event_id: event_id,
75
+ event_title: event_title,
76
+ selectGate: selectGate,
77
+ typeScanner: typeScanner,
78
+ url_ticket_detail: url_ticket_detail,
79
+ url_ticket_update: url_ticket_update,
80
+ configPriority: configPriority,
81
+ scan_type: scan_type
82
+ }
83
+
84
+ useEffect(() => {
85
+ if (qr_code) {
86
+ loadData()
87
+ } else {
88
+ LibDialog.warningConfirm("Oops", "QR Code tidak ditemukan", "Kembali", () => {
89
+ LibNavigation.back()
90
+ }, "", () => { })
91
+ }
92
+ }, [])
93
+
94
+ function direction(tikets: any, tiket: any) {
95
+ if (tiket.qty > 1) {
96
+ LibNavigation.replace('event/tms_in_list', {
97
+ tickets: tikets,
98
+ ...args
99
+ })
100
+ } else {
101
+ LibNavigation.replace('event/tms_in_success', {
102
+ selectedTicket: tiket,
103
+ ...args
104
+ })
105
+ }
106
+ }
107
+
108
+ function loadData() {
109
+ let tikets: any[] = []
110
+ EventTms_homeProperty.addCounterEntranceScan(1, "0")
111
+ get(mainPath(encodeURIComponent(encodeURIComponent(qr_code))), selectGate?.id, (res) => {
112
+ esp.log({ res });
113
+ if (!res) {
114
+ LibNavigation.replace('event/tms_in_failed', {
115
+ text: esp.lang("event/tms_in", "ticket_empty_today"),
116
+ ...args
117
+ })
118
+ return
119
+ } else {
120
+ Object.keys(res).forEach((key) => {
121
+ if (key == 'staff') {
122
+ Object.values(res[key]).map((item: any) => {
123
+ let x = {
124
+ price_id: key,
125
+ title: decodeURIComponent(item[4])?.split("+").join(' '),
126
+ color: LibStyle.colorPrimary,
127
+ key: item[5],
128
+ user_name: item[1],
129
+ user_image: item[3],
130
+ exhibitor_name: decodeURIComponent(item[4])?.split("+").join(' '),
131
+ qty: item[0],
132
+ qty_used: item[2],
133
+ qty_left: Number(item[0]) - (Number(item[2]) || 0),
134
+ text: item[6] || "",
135
+ }
136
+ tikets.push(x)
137
+ })
138
+ } else {
139
+ let a = {
140
+ price_id: key,
141
+ title: price_type?.filter?.((item: any) => item.id == key)[0]?.name,
142
+ color: price_type?.filter?.((item: any) => item.id == key)[0]?.color,
143
+ key: qr_code,
144
+ user_name: Object.values(res[key])?.[1],
145
+ user_image: Object.values(res[key])?.[3],
146
+ qty: Object.values(res[key])?.[0],
147
+ qty_used: Object.values(res[key])?.[2],
148
+ qty_left: Number(Object.values(res[key])?.[0]) - (Number(Object.values(res[key])?.[2]) || 0),
149
+ text: (Object.values(res[key])?.[4] == 'k' ? Object.values(res[key]) : Object.values(res[key])?.[4]) || ""
150
+ }
151
+ tikets.push(a)
152
+ }
153
+ })
154
+
155
+ if (tikets.length > 0) {
156
+ if (tikets.length == 1) {
157
+ const tiket = tikets[0];
158
+
159
+ if (tiket?.text == "") { // jika index ke 5 di result get nya TIDAK ADA text nya
160
+ if (tiket.qty_left <= 0) { // jika qty left nya 0 maka tiketnya habis
161
+ LibNavigation.replace('event/tms_in_failed', {
162
+ text: esp.lang("event/tms_in", "ticket_empty"),
163
+ ticketItem: tiket,
164
+ ...args
165
+ })
166
+ } else { // jika masih punya tiket
167
+ if (tiket.hasOwnProperty("exhibitor_name")) { // jika dia punya id card
168
+ LibNavigation.replace('event/tms_idcard', {
169
+ selectedTicket: tiket,
170
+ ...args
171
+ })
172
+ } else { // ini data tiket user yang available
173
+ if (configPriority) { // ini untuk memunculkan priority
174
+ if (configPriority?.filter?.((item: any) => item.id == tiket.price_id).length > 0) {
175
+ direction(tikets, tiket)
176
+ } else { // ini jika di tms tidak memiliki hak scan tipe tiket tertentu
177
+ LibNavigation.replace('event/tms_in_warning', {
178
+ selectedTicket: tiket,
179
+ ...args
180
+ })
181
+ }
182
+ } else {
183
+ direction(tikets, tiket)
184
+ }
185
+ }
186
+ }
187
+ } else {// jika index ke 5 di result get nya ADA text nya
188
+ LibNavigation.replace('event/tms_in_failed', {
189
+ text: tiket?.text,
190
+ ticketItem: tiket,
191
+ ...args
192
+ })
193
+ }
194
+ } else { // ini jika tiketnya ada banyak
195
+ LibNavigation.replace('event/tms_in_list', {
196
+ tickets: tikets,
197
+ ...args
198
+ })
199
+ }
200
+ } else { // ini jika tiketnya tidak ada
201
+ LibNavigation.replace('event/tms_in_failed', {
202
+ text: esp.lang("event/tms_in", "ticket_not_found"),
203
+ ...args
204
+ })
205
+ }
206
+ }
207
+ })
208
+ }
209
+
210
+ return (
211
+ <View style={{ flex: 1, backgroundColor: '#fff' }}>
212
+ <LibLoading />
213
+ </View>
214
+ )
215
+ }
@@ -0,0 +1,199 @@
1
+ // withHooks
2
+
3
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
4
+ import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
5
+ import { LibLoading } from 'esoftplay/cache/lib/loading/import';
6
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
7
+ import { LibProgress } from 'esoftplay/cache/lib/progress/import';
8
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
9
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
10
+
11
+ import { applyStyle } from 'esoftplay';
12
+ import { EventButton } from 'esoftplay/cache/event/button/import';
13
+ import { EventHeader } from 'esoftplay/cache/event/header/import';
14
+ import { EventScan_item } from 'esoftplay/cache/event/scan_item/import';
15
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
16
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
17
+ import esp from 'esoftplay/esp';
18
+ import moment from 'esoftplay/moment';
19
+ import useSafeState from 'esoftplay/state';
20
+ import React, { useEffect } from 'react';
21
+ import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
22
+ moment().locale('id')
23
+
24
+
25
+ export interface EventTms_in_againArgs {
26
+
27
+ }
28
+ export interface EventTms_in_againProps {
29
+
30
+ }
31
+ export default function m(props: EventTms_in_againProps): any {
32
+ const [result, setResult] = useSafeState<any>(undefined)
33
+
34
+ const user_qr = LibNavigation.getArgs(props, 'qr_code')
35
+ const { scan_type, event_id, event_title, selectGate, typeScanner }: any = LibNavigation.getArgsAll(props)
36
+
37
+ useEffect(() => {
38
+ loadData()
39
+ }, [])
40
+
41
+
42
+ function loadData(): void {
43
+ var post = {
44
+ // event_id: "264",
45
+ // user_qr: encodeURIComponent("BBO-H6851"),
46
+ // gate_id: "182"
47
+ event_id: event_id,
48
+ user_qr: encodeURIComponent(user_qr),
49
+ gate_id: selectGate?.id
50
+ }
51
+
52
+ new LibCurl('event_tms_out_temporary_in', post, (res) => {
53
+ let a = res?.list?.length > 0 && res.list.map((item: any, i: number) => {
54
+ return ({
55
+ ...item,
56
+ checked: 0
57
+ })
58
+ })
59
+ let b = res?.staff?.length > 0 && res.staff.map((item: any, i: number) => {
60
+ return ({
61
+ ...item,
62
+ checked: 0
63
+ })
64
+ })
65
+
66
+ let c = {
67
+ ...res,
68
+ list: res?.list?.length == 0 ? [] : a,
69
+ staff: res?.staff?.length == 0 ? [] : b
70
+ }
71
+ esp.log({ res, c });
72
+ setResult(c)
73
+ }, (error) => {
74
+ LibDialog.warningConfirm(esp.lang("event/tms_in_again", "fault"), error?.message, esp.lang("event/tms_in_again", "back"), () => LibNavigation.back(), "", () => { })
75
+ }, 1)
76
+ }
77
+
78
+ function entrance(): void {
79
+ let newData = [...result?.staff, ...result?.list]
80
+ let _ids = newData?.filter((item: any) => item.checked == 1).map((it: any) => it.id)
81
+ if (_ids.length == 0) {
82
+ LibToastProperty.show(esp.lang("event/tms_in_again", "warning_ticket"))
83
+ return
84
+ }
85
+
86
+ if (_ids.length == 0) {
87
+ LibToastProperty.show(esp.lang("event/tms_in_again", "warning_ticket"))
88
+ return
89
+ }
90
+ var post = {
91
+ event_id: event_id,
92
+ ids: JSON.stringify(_ids),
93
+ gate_id: selectGate.id
94
+ }
95
+
96
+ LibProgress.show(esp.lang("event/tms_in_again", "wait"))
97
+ new LibCurl('event_tms_out_temporary_in_confirm', post, (result, msg) => {
98
+ esp.log({ result, msg, post });
99
+ LibProgress.hide()
100
+ LibDialog.confirm(esp.lang("event/tms_in_again", "info"), result, esp.lang("event/tms_in_again", "ok"), () => {
101
+ LibNavigation.replace('component/scanner', {
102
+ selectGate: selectGate,
103
+ fromPage: 'event/tms_home',
104
+ event_id: event_id,
105
+ event_title: event_title,
106
+ typeScanner: typeScanner,
107
+ scan_type: scan_type
108
+ })
109
+ }, "", () => { })
110
+ }, (error) => {
111
+ esp.log({ error });
112
+ LibDialog.warning(esp.lang("event/tms_in_again", "oops"), error?.message)
113
+ LibProgress.hide()
114
+ })
115
+ }
116
+
117
+ function renderTicket(item: any, i: number) {
118
+ return (
119
+ <EventScan_item
120
+ key={i}
121
+ item={item}
122
+ colorFont={"#fff"}
123
+ event_image={result?.event_image}
124
+ style={{ backgroundColor: "#fff" }}
125
+ event_name={result?.event_name}
126
+ event_ondate={result?.event_ondate}
127
+ label={item.status == 0 ? esp.lang("event/tms_in_again", "used") : item.checked == 0 ? esp.lang("event/tms_in_again", "use") : esp.lang("event/tms_in_again", "cancel")}
128
+ onPress={() => {
129
+ if (item?.status == 1) {
130
+ let a = LibObject.set(result, item.checked == 1 ? 0 : 1)('list', i, 'checked')
131
+ setResult(a)
132
+ }
133
+ }}
134
+ colorBackground={item.status == 0 ? LibStyle.colorLightGrey : item.checked == 0 ? LibStyle.colorGreen : LibStyle.colorRed}
135
+ />
136
+
137
+ )
138
+ }
139
+
140
+ function renderStaff(item: any, i: number) {
141
+ return (
142
+ <View key={i}>
143
+
144
+ <View style={{ padding: 10, overflow: 'hidden', flex: 1, flexDirection: 'row', backgroundColor: '#fff', borderBottomColor: LibStyle.colorGrey, borderBottomWidth: 1.5 }}>
145
+ <LibPicture style={applyStyle({ borderRadius: 5, width: LibStyle.width / 4.5, height: LibStyle.width / 4.5, backgroundColor: LibStyle.colorBgGrey })} source={{ uri: item?.image }} />
146
+ <View style={{ marginLeft: 10, flex: 1 }}>
147
+ <Text allowFontScaling={false} ellipsizeMode={'tail'} numberOfLines={2} style={applyStyle({ color: "#000", marginBottom: 4, fontSize: 18, fontWeight: 'bold' })}>{item.name}</Text>
148
+ <Text allowFontScaling={false} ellipsizeMode={'tail'} numberOfLines={2} style={applyStyle({ color: "#000", marginBottom: 4, fontSize: 14 })}>{item.department_name}</Text>
149
+ <Text allowFontScaling={false} ellipsizeMode={'tail'} numberOfLines={2} style={applyStyle({ color: "#000", marginBottom: 4, fontSize: 16 })}>{item.exhibitor_name}</Text>
150
+ {
151
+ item.status == 1 &&
152
+ <EventButton style={applyStyle({ marginTop: 10, alignSelf: 'flex-end', width: LibStyle.width / 3, backgroundColor: (item.status == 0 || item.is_limit == 1) ? LibStyle.colorLightGrey : (item.checked == 0) ? LibStyle.colorGreen : LibStyle.colorRed })} label={
153
+ item.status == 0 ?
154
+ esp.lang("event/tms_out_temporary", "used") :
155
+ item.hasOwnProperty("checked") && item.checked == 0 ?
156
+ esp.lang("event/tms_out_temporary", "use") :
157
+ esp.lang("event/tms_out_temporary", "cancel")
158
+ } fontColor={"#fff"} onPress={() => {
159
+ let a = LibObject.set(result, item.checked == 1 ? 0 : 1)('staff', i, 'checked')
160
+ setResult(a)
161
+ }} />
162
+ }
163
+ </View>
164
+ <View pointerEvents='none' style={{ position: 'absolute', justifyContent: 'center', transform: [{ rotate: '45deg' }], margin: 1, ...LibStyle.elevation(2), height: 20, width: 170, backgroundColor: LibStyle.colorPrimary, right: -50, top: 25 }} >
165
+ <Text style={{ color: 'white', alignSelf: 'center', fontWeight: 'bold' }} >ID CARD</Text>
166
+ </View>
167
+ </View>
168
+ </View>
169
+ )
170
+ }
171
+
172
+ if (!result) return <LibLoading />
173
+
174
+ return (
175
+ <View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
176
+ <EventHeader title={esp.lang("event/tms_in_again", "entrance_again")} subtitle={selectGate?.name} cart />
177
+ <ScrollView>
178
+ <View style={{ margin: 15, marginBottom: 0, borderRadius: 7, overflow: 'hidden' }}>
179
+ {
180
+ result?.staff?.length > 0 && result?.staff?.map(renderStaff)
181
+ }
182
+ </View>
183
+ <View style={{ margin: 15, marginBottom: 0, borderRadius: 7, overflow: 'hidden' }}>
184
+ {
185
+ result?.list?.length > 0 && result?.list?.map(renderTicket)
186
+ }
187
+ </View>
188
+ </ScrollView>
189
+ <TouchableOpacity onPress={() => {
190
+ entrance()
191
+ }}>
192
+ <View style={applyStyle({ margin: 10, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorGreen, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 })} >
193
+ <Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 12, textAlign: "center", textAlignVertical: 'center', color: 'white', marginRight: 13, marginLeft: 10 })} >{esp.lang("event/tms_in_again", "entrance")}</Text>
194
+ </View>
195
+ </TouchableOpacity>
196
+
197
+ </View >
198
+ )
199
+ }