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
package/event/seat.tsx ADDED
@@ -0,0 +1,628 @@
1
+ // withHooks
2
+ import { BigbangCardProperty } from 'esoftplay/cache/bigbang/card/import';
3
+ import { BigbangTransaction } from 'esoftplay/cache/bigbang/transaction/import';
4
+ import { ComponentButton } from 'esoftplay/cache/component/button/import';
5
+ import { ComponentHeader } from 'esoftplay/cache/component/header/import';
6
+ import { ComponentTouchable } from 'esoftplay/cache/component/touchable/import';
7
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
8
+ import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
9
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
10
+ import { LibLoading } from 'esoftplay/cache/lib/loading/import';
11
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
12
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
13
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
14
+ import { LibProgress } from 'esoftplay/cache/lib/progress/import';
15
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
16
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
17
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
18
+ import { TicketDetailProperty } from 'esoftplay/cache/ticket/detail/import';
19
+ import esp from 'esoftplay/esp';
20
+ import useSafeState from 'esoftplay/state';
21
+
22
+ import React, { useEffect } from 'react';
23
+ import { Pressable, ScrollView, Text, TouchableOpacity, View } from 'react-native';
24
+ import Animated, { Extrapolate, interpolate, useAnimatedScrollHandler, useAnimatedStyle, useSharedValue } from 'react-native-reanimated';
25
+
26
+
27
+ export interface EventSeatArgs {
28
+
29
+ }
30
+ export interface EventSeatProps {
31
+
32
+ }
33
+ export default function m(props: EventSeatProps): any {
34
+ const { url, dataTicket, receiver_email, shared, booking_id, returnTicket } = LibNavigation.getArgsAll(props)
35
+ const [trxId] = useSafeState(BigbangTransaction().getTrxId())
36
+
37
+ const [result, setResult] = useSafeState<any>(undefined)
38
+ const [counter, setCounter] = useSafeState<any>(0)
39
+ const [resultDataSize, setResultDataSize] = useSafeState<any>(0)
40
+ const [sizeBox, setSizeBox] = useSafeState(10)
41
+
42
+ const translationX = useSharedValue(0);
43
+ const translationY = useSharedValue(0);
44
+
45
+ const [completeScrollBarHeight, setCompleteScrollBarHeight] = useSafeState(1); // ini itu tinggu yang ditampilkan scroll
46
+ const [visibleScrollBarHeight, setVisibleScrollBarHeight] = useSafeState(0); // ini itu tinggu seluruh scroll
47
+
48
+ const [completeScrollBarWidth, setCompleteScrollBarWidth] = useSafeState(1); // ini itu lebar yang ditampilkan scroll
49
+ const [visibleScrollBarWidth, setVisibleScrollBarWidth] = useSafeState(0); // ini itu lebar seluruh scroll
50
+
51
+ const scrollIndicatorHeightSize = completeScrollBarHeight > visibleScrollBarHeight ? (visibleScrollBarHeight * visibleScrollBarHeight) / completeScrollBarHeight : visibleScrollBarHeight;
52
+ const scrollIndicatorWidthSize = completeScrollBarWidth > visibleScrollBarWidth ? (visibleScrollBarWidth * visibleScrollBarWidth) / completeScrollBarWidth : visibleScrollBarWidth;
53
+
54
+ const scrollHandlerX = useAnimatedScrollHandler((event) => {
55
+ translationX.value = (event.contentOffset.x);
56
+ })
57
+
58
+ const scrollHandlerY = useAnimatedScrollHandler((event) => {
59
+ translationY.value = (event.contentOffset.y);
60
+ })
61
+
62
+ const styleX = useAnimatedStyle(() => {
63
+ const transfX = interpolate(
64
+ translationX.value,
65
+ [0, completeScrollBarWidth],
66
+ [0, visibleScrollBarWidth],
67
+ Extrapolate.CLAMP
68
+ )
69
+
70
+ return {
71
+ transform: [{ translateX: transfX, }],
72
+ };
73
+ })
74
+
75
+ const styleY = useAnimatedStyle(() => {
76
+ const transfY = interpolate(
77
+ translationY.value,
78
+ [0, completeScrollBarHeight],
79
+ [0, visibleScrollBarHeight],
80
+ Extrapolate.CLAMP
81
+ )
82
+
83
+ return {
84
+ transform: [{ translateY: transfY, }],
85
+ };
86
+ })
87
+
88
+ const explanation = [
89
+ {
90
+ borderColor: LibStyle.colorBlue,
91
+ backgroundColor: "#fff",
92
+ text: esp.lang("event/seat", "text_available")
93
+ },
94
+ {
95
+ borderColor: LibStyle.colorBlue,
96
+ backgroundColor: LibStyle.colorBlue,
97
+ text: esp.lang("event/seat", "text_selected")
98
+ },
99
+ {
100
+ borderColor: LibStyle.colorGrey,
101
+ backgroundColor: LibStyle.colorGrey,
102
+ text: esp.lang("event/seat", "text_not_available")
103
+ },
104
+ ]
105
+
106
+ useEffect(() => {
107
+ if (shared) {
108
+ loadSeatShared()
109
+ } else if (returnTicket) {
110
+ loadSeatReturn()
111
+ } else {
112
+ loadDataSize()
113
+ }
114
+ }, [])
115
+
116
+ function loadSeatShared() {
117
+ let post = {
118
+ event_id: dataTicket?.event_id,
119
+ booking_id: booking_id,
120
+ price_id: dataTicket?.selected_ticket?.list?.price_id,
121
+ ondate: dataTicket?.selected_ticket?.list?.ondate,
122
+ }
123
+ new LibCurl(url, post, (res, msg) => { // event_seat_shared
124
+ for (let i = 0; i < res.list.length; i++) {
125
+ res.list[i].check = false
126
+ }
127
+ setResult(res)
128
+ }, (error) => {
129
+ LibDialog.warning(esp.lang("event/seat", "load_shared_failed"), error?.message)
130
+ LibNavigation.back()
131
+ })
132
+ }
133
+
134
+
135
+ function loadDataSize() {
136
+ let post = {
137
+ event_id: dataTicket?.event_id,
138
+ price_id: dataTicket?.selected_ticket?.list?.price_id,
139
+ ondate: dataTicket?.selected_ticket?.list?.ondate,
140
+ }
141
+ new LibCurl("event_seat_meta", post, (res, msg) => { // event_seat
142
+ setResultDataSize(res)
143
+ loadSeat("event_seat?offset_row=1&offset_column=1")
144
+ // if (Number(res.seat_column) * Number(res.seat_row) > 100) {
145
+ // // untuk menampilkan button pilih ulang kalo misal di navigate terus di back lagi, biar tidak loading
146
+ // setResult('none')
147
+ // LibNavigation.navigateForResult('event/seat_map', {
148
+ // x: res.seat_column,
149
+ // y: res.seat_row,
150
+ // url: url,
151
+ // event_id: event_id,
152
+ // price_id: price_id,
153
+ // on_date: on_date,
154
+ // }, 345).then((item: any) => {
155
+ // setResult(undefined)
156
+ // loadSeat(item)
157
+ // })
158
+ // } else {
159
+ // loadSeat("event_seat?offset_row=1&offset_column=1")
160
+ // }
161
+ }, (error) => {
162
+ LibDialog.warning(esp.lang("event/seat", "load_failed"), error?.message)
163
+ // LibNavigation.back()
164
+ })
165
+ }
166
+
167
+ function loadSeat(_url?: string) {
168
+ let post = {
169
+ event_id: dataTicket?.event_id,
170
+ price_id: dataTicket?.selected_ticket?.list?.price_id,
171
+ ondate: dataTicket?.selected_ticket?.list?.ondate,
172
+ }
173
+ new LibCurl(_url ? _url : url, post, (res, msg) => { // event_seat
174
+ for (let i = 0; i < res.length; i++) {
175
+ const element = res[i];
176
+ element.map((item: any) => {
177
+ item.check = false
178
+ })
179
+ }
180
+ setResult(res)
181
+ if (res.image_map != "") {
182
+ LibDialog.custom(viewImageMap(res.image_map))
183
+ }
184
+ }, (error) => {
185
+ LibDialog.warning(esp.lang("event/seat", "load_seat_failed"), error?.message)
186
+ LibNavigation.back()
187
+ }, 1)
188
+ }
189
+
190
+ function loadSeatReturn() {
191
+ new LibCurl(url, null, (res) => {
192
+ for (let i = 0; i < res.tickets.length; i++) {
193
+ res.tickets[i].check = false
194
+ }
195
+ setResult(res)
196
+ }, (error) => {
197
+ LibDialog.warning(esp.lang("event/seat", "load_return_failed"), error?.message);
198
+ LibNavigation.back()
199
+ }, 1)
200
+ }
201
+
202
+ function next() {
203
+ if (dataTicket?.qty != counter) {
204
+ LibToastProperty.show(esp.lang("event/seat", "select_seat"))
205
+ return
206
+ }
207
+
208
+ let _selectSeat: any[] = []
209
+ result?.list?.length > 0 && result?.list?.map((row: any) => row?.map((col: any) => {
210
+ if (col.check) {
211
+ _selectSeat.push(col)
212
+ }
213
+ }))
214
+
215
+ let _rowId = _selectSeat.filter((item: any) => item.check).map((it: any) => it.row)
216
+ let _colId = _selectSeat.filter((item: any) => item.check).map((it: any) => it.column)
217
+ let _seatName = _selectSeat.filter((item: any) => item.check).map((it: any) => it.name)
218
+ let value = {
219
+ column_id: _colId.join('|'),
220
+ row_id: _rowId.join('|'),
221
+ seat_name: _seatName
222
+ }
223
+ LibNavigation.sendBackResult(value)
224
+ }
225
+
226
+ function shareTicket() {
227
+ if (dataTicket?.qty != counter) {
228
+ LibToastProperty.show(esp.lang("event/seat", "select_seat1"))
229
+ return
230
+ }
231
+
232
+ let _rowId = result?.list?.filter((item: any) => item.check).map((it: any) => it.seat_row)
233
+ let _colId = result?.list?.filter((item: any) => item.check).map((it: any) => it.seat_column)
234
+ let _bookingMemberId = result?.list?.filter((item: any) => item.check).map((it: any) => it.id)
235
+
236
+ LibDialog.confirm(esp.lang("event/seat", "share_title"), esp.lang("event/seat", "share_msg"), esp.lang("event/seat", "share_confirm"), () => {
237
+ let post = {
238
+ receiver_email: receiver_email,
239
+ booking_id: result?.booking_id,
240
+ qty_shared: dataTicket?.qty,
241
+ row_id: _rowId.join('|'),
242
+ column_id: _colId.join('|'),
243
+ booking_member_id: _bookingMemberId.join('|'),
244
+ trx_id: trxId
245
+ }
246
+
247
+ LibProgress.show(esp.lang("event/seat", "share_wait"))
248
+ new LibCurl('event_booking_shared?id=' + dataTicket?.event_id, post, (res, msg) => {
249
+ TicketDetailProperty.subscribe().trigger()
250
+ BigbangCardProperty.reload.trigger() //reload data order
251
+ // LibNotify(res)
252
+ LibProgress.hide()
253
+ LibDialog.info(esp.lang("event/seat", "share_ok"), msg)
254
+ LibNavigation.back()
255
+ LibNavigation.back()
256
+ }, (error) => {
257
+ LibProgress.hide()
258
+ LibDialog.warning(esp.lang("event/seat", "share_no"), error?.message);
259
+ // LibNavigation.back()
260
+ })
261
+ }, esp.lang("event/seat", "share_cancel"), () => {
262
+
263
+ })
264
+ }
265
+
266
+ function sendBackTicket() {
267
+ if (dataTicket?.qty != counter) {
268
+ LibToastProperty.show(esp.lang("event/seat", "select_seat2"))
269
+ return
270
+ }
271
+
272
+ LibDialog.confirm(esp.lang("event/seat", "ticket_title"), esp.lang("event/seat", "ticket_msg"), esp.lang("event/seat", "ticket_confirm"), () => {
273
+ LibProgress.show(esp.lang("event/seat", "ticket_wait"))
274
+
275
+ let _bookingMemberId = result?.tickets?.filter((item: any) => item.check).map((it: any) => it.id)
276
+
277
+ let post = {
278
+ booking_member_id: _bookingMemberId.join('|')
279
+ }
280
+ new LibCurl('event_booking_shared_return?booking_id=' + result?.booking_id + '&qty_shared=' + dataTicket?.qty, post, (res, msg) => {
281
+ // LibNotify(res)
282
+ TicketDetailProperty.subscribe().trigger()
283
+ LibProgress.hide()
284
+ LibDialog.info(esp.lang("event/seat", "ticket_ok"), msg)
285
+ LibNavigation.back()
286
+ LibNavigation.back()
287
+ }, (error) => {
288
+ LibProgress.hide()
289
+ LibDialog.warning(esp.lang("event/seat", "ticket_failed"), error?.message);
290
+ // LibNavigation.back()
291
+ }, 1)
292
+ }, esp.lang("event/seat", "ticket_cancel"), () => { })
293
+ }
294
+
295
+ const viewImageMap = (image: string) => {
296
+ return (
297
+ <View>
298
+ <TouchableOpacity onPress={() => {
299
+ // LibNavigation.navigate('lib/gallery', { image: result?.image_map })
300
+ }}>
301
+ <LibPicture source={{ uri: image }} style={{ width: LibStyle.width - 100, height: LibStyle.width - 100, borderRadius: 10 }} resizeMode="contain" />
302
+ </TouchableOpacity>
303
+ <TouchableOpacity onPress={() => { LibDialog.hide() }} style={{ marginTop: 10, alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
304
+ <LibIcon name="close-circle-outline" color={LibStyle.colorPrimary} size={30} />
305
+ </TouchableOpacity>
306
+ </View>
307
+ )
308
+ }
309
+
310
+ function alertSelectSeat() {
311
+ LibToastProperty.show(esp.lang("event/seat", "seat_reselect", dataTicket?.qty), 5000)
312
+ }
313
+
314
+ const toggleSeat = (col: any, i: number, i1: number) => {
315
+ return () => {
316
+ if (col.status == "1") {
317
+ if (!col.check && counter + 1 > dataTicket?.qty) {
318
+ alertSelectSeat()
319
+ } else {
320
+ setResult(LibObject.set(result, !col.check)('list', i, i1, "check"))
321
+ setCounter(!col.check ? counter + 1 : counter - 1)
322
+ }
323
+ }
324
+ }
325
+ }
326
+
327
+
328
+ function renderStyleSeat(col: any) {
329
+ return {
330
+ colorBackground: col.status == "1" ? (col.check ? LibStyle.colorBlue : "#fff") : (col.status == 3 || col.status == 4) ? "#c9c9c9" : "#fff",
331
+ colorBorder: col.status == "1" ? (col.check ? LibStyle.colorBlue : LibStyle.colorBlue) : "#fff",
332
+ fontColor: (col.status == 2 || col.status == 3 || col.status == 4) ? "#fff" : col.check ? "#fff" : "#666",
333
+ }
334
+ }
335
+
336
+ const margin = sizeBox / 9
337
+ const fontSize = sizeBox / 3
338
+ function renderRow(row: any, i: number) {
339
+ const styleId_2sAMKr: any = { marginLeft: 5, marginRight: 5, flexDirection: 'row' }
340
+ return (
341
+ <View key={i} style={styleId_2sAMKr}>
342
+ {
343
+ row?.map((col: any, i1: number) => {
344
+ const { colorBackground, colorBorder, fontColor } = renderStyleSeat(col)
345
+ const styleId_Z11LKot: any = { margin: margin, marginBottom: 0, marginRight: sizeBox / 9, marginLeft: margin, height: sizeBox, width: sizeBox, backgroundColor: colorBackground, borderWidth: 1, borderColor: colorBorder, borderRadius: 4, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }
346
+ const styleId_Z6RdsD: any = { fontFamily: "Arial", fontSize: fontSize, fontWeight: "normal", textAlign: 'center', fontStyle: "normal", letterSpacing: 0, color: fontColor }
347
+ return (
348
+ <ComponentTouchable onPress={toggleSeat(col, i, i1)} key={i1} style={styleId_Z11LKot}>
349
+ <Text allowFontScaling={false} style={styleId_Z6RdsD}>{col.name}</Text>
350
+ </ComponentTouchable>
351
+ )
352
+ })
353
+ }
354
+ </View>
355
+ )
356
+ }
357
+
358
+ function renderTicketShare(item: any, i: number) {
359
+ let _selectTicket = item.hasOwnProperty('check') && item.check
360
+ return (
361
+ <TouchableOpacity onPress={() => {
362
+ if (counter + 1 > dataTicket?.qty && !item.check) {
363
+ alertSelectSeat()
364
+ } else {
365
+ let a = LibObject.set(result, item.check == false ? true : false)('list', i, 'check')
366
+ setResult(a)
367
+ setCounter(item.check ? counter - 1 : counter + 1)
368
+ }
369
+ }} key={i} style={styleId_Z1ppFKw}>
370
+ <Text allowFontScaling={false}>{item.seat_name}</Text>
371
+ <TouchableOpacity onPress={() => {
372
+ if (!item.check && counter + 1 > dataTicket?.qty) {
373
+ alertSelectSeat()
374
+ } else {
375
+ let a = LibObject.set(result, item.check == false ? true : false)('list', i, 'check')
376
+ setResult(a)
377
+ setCounter(!item.check ? counter + 1 : counter - 1)
378
+ }
379
+ }} style={styleId_ZE3xEb} >
380
+ <LibIcon name={_selectTicket ? "checkbox-marked-circle" : "radiobox-blank"} size={22} color={_selectTicket ? "#3ea4dc" : "#434343"} />
381
+ </TouchableOpacity>
382
+ </TouchableOpacity>
383
+ )
384
+ }
385
+
386
+ function renderTicketReturn(item: any, i: number) {
387
+ let _selectTicket = item.hasOwnProperty('check') && item.check
388
+ return (
389
+ <TouchableOpacity onPress={() => {
390
+ if (counter + 1 > dataTicket?.qty && !item.check) {
391
+ alertSelectSeat()
392
+ } else {
393
+ let a = LibObject.set(result, item.check == false ? true : false)('tickets', i, 'check')
394
+ setResult(a)
395
+ setCounter(item.check ? counter - 1 : counter + 1)
396
+ }
397
+ }} key={i} style={styleId_Z1ppFKw}>
398
+ <Text allowFontScaling={false}>{item.seat_name}</Text>
399
+ <TouchableOpacity onPress={() => {
400
+ if (!item.check && counter + 1 > dataTicket?.qty) {
401
+ alertSelectSeat()
402
+ } else {
403
+ let a = LibObject.set(result, item.check == false ? true : false)('tickets', i, 'check')
404
+ setResult(a)
405
+ setCounter(!item.check ? counter + 1 : counter - 1)
406
+ }
407
+ }} style={styleId_ZE3xEb} >
408
+ <LibIcon name={_selectTicket ? "checkbox-marked-circle" : "radiobox-blank"} size={22} color={_selectTicket ? "#3ea4dc" : "#434343"} />
409
+ </TouchableOpacity>
410
+ </TouchableOpacity>
411
+ )
412
+ }
413
+
414
+ useEffect(() => {
415
+ return () => LibNavigation.cancelBackResult(LibNavigation.getResultKey(props))
416
+ }, [])
417
+
418
+
419
+
420
+
421
+ // view untuk share tiket
422
+ if (shared) {
423
+ return (
424
+ <View style={{ flex: 1, backgroundColor: '#fff' }}>
425
+ <ComponentHeader title={esp.lang("event/seat", "header_title")} />
426
+ {
427
+ !result ?
428
+ <LibLoading />
429
+ :
430
+ <>
431
+ <ScrollView>
432
+ <Text allowFontScaling={false} style={{ margin: 15, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: '#999' }}>{esp.lang("event/seat", "seat_qty", LibUtils.number(dataTicket?.qty - counter))}</Text>
433
+ <View style={{ margin: 15, marginTop: 0 }}>
434
+ {
435
+ result?.list?.length > 0 && result?.list?.map?.(renderTicketShare)
436
+ }
437
+ </View>
438
+
439
+ </ScrollView>
440
+ <View style={{ paddingVertical: 10, paddingHorizontal: 20 }} >
441
+ <ComponentButton label={esp.lang("buy/index2", "button_next")} onPress={() => {
442
+ shareTicket()
443
+ }} style={{ backgroundColor: dataTicket?.qty != counter ? LibStyle.colorGrey : LibStyle.colorPrimary }} />
444
+ </View>
445
+ </>
446
+ }
447
+ </View>
448
+ )
449
+ } else if (returnTicket) {
450
+ return (
451
+ <View style={{ flex: 1, backgroundColor: '#fff' }}>
452
+ <ComponentHeader title={esp.lang("event/seat", "header_title_return")} subtitle={esp.lang("event/seat", "header_subtitle_return")} />
453
+ {
454
+ !result ?
455
+ <LibLoading />
456
+ :
457
+ <>
458
+ <ScrollView>
459
+ <Text allowFontScaling={false} style={{ margin: 15, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: '#999' }}>{esp.lang("event/seat", "return_seat", LibUtils.number(dataTicket?.qty - counter))}</Text>
460
+ <View style={{ margin: 15, marginTop: 0 }}>
461
+ {
462
+ result?.tickets?.length > 0 && result?.tickets?.map?.(renderTicketReturn)
463
+ }
464
+ </View>
465
+ </ScrollView>
466
+ <View style={{ paddingVertical: 10, paddingHorizontal: 20 }} >
467
+ <ComponentButton label={esp.lang("buy/index2", "button_next")} onPress={() => {
468
+ sendBackTicket()
469
+ }} style={{ backgroundColor: dataTicket?.qty != counter ? LibStyle.colorGrey : LibStyle.colorPrimary }} />
470
+ </View>
471
+ </>
472
+ }
473
+ </View>
474
+ )
475
+ } else {
476
+ return (
477
+ <View style={{ flex: 1, backgroundColor: '#fff' }}>
478
+ <ComponentHeader title={esp.lang("event/seat", "header_title_select")} subtitle={dataTicket?.selected_ticket?.type} />
479
+ {
480
+ !result ?
481
+ <LibLoading />
482
+ :
483
+ result == "none" ?
484
+ <View style={{ flex: 1, margin: 10, marginBottom: 0, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
485
+ <TouchableOpacity onPress={() => {
486
+ LibNavigation.navigateForResult('event/seat_map', {
487
+ x: resultDataSize.seat_column,
488
+ y: resultDataSize.seat_row,
489
+ url: url,
490
+ event_id: dataTicket?.event_id,
491
+ price_id: dataTicket?.selected_ticket?.list?.price_id,
492
+ ondate: dataTicket?.selected_ticket?.list?.ondate,
493
+ }, 345).then((item: any) => {
494
+ setResult(undefined)
495
+ loadSeat(item)
496
+ })
497
+ }} style={{ alignContent: 'center', alignItems: 'center', padding: 10, borderRadius: 5, backgroundColor: LibStyle.colorPrimary }}>
498
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontStyle: "normal", letterSpacing: 0, color: '#000' }}>{esp.lang("event/seat", "reselect")}</Text>
499
+ </TouchableOpacity>
500
+ </View>
501
+ :
502
+ <>
503
+ <View style={{ margin: 10, marginBottom: 0, flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' }}>
504
+ <View style={{ flex: 1 }}>
505
+ {/* {
506
+ Number(resultDataSize.seat_column) * Number(resultDataSize.seat_row) > 100 &&
507
+ <TouchableOpacity onPress={() => {
508
+ LibNavigation.navigateForResult('event/seat_map', {
509
+ x: resultDataSize.seat_column,
510
+ y: resultDataSize.seat_row,
511
+ url: url,
512
+ event_id: event_id,
513
+ price_id: price_id,
514
+ on_date: on_date,
515
+ }, 345).then((item: any) => {
516
+ setResult(undefined)
517
+ loadSeat(item)
518
+ })
519
+ }} style={{ marginRight: 20, alignContent: 'center', alignItems: 'center', padding: 5, borderRadius: 5, backgroundColor: LibStyle.colorPrimary }}>
520
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontStyle: "normal", letterSpacing: 0, color: '#000' }}>Pilih Ulang</Text>
521
+ </TouchableOpacity>
522
+ } */}
523
+ </View>
524
+ <View style={{ flex: 1, alignContent: 'center', alignItems: 'center' }}>
525
+ <Text allowFontScaling={false} style={{ textAlign: 'center', fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: '#000' }}>{dataTicket?.selected_ticket?.type}</Text>
526
+ </View>
527
+ {
528
+ result?.image_map != "" ?
529
+ <TouchableOpacity onPress={() => {
530
+ if (result?.image_map == "") {
531
+ LibToastProperty.show(esp.lang("event/seat", "empty_image"))
532
+ } else {
533
+ LibDialog.custom(viewImageMap(result?.image_map))
534
+ }
535
+ }} style={{ flex: 1, justifyContent: 'flex-end', alignContent: 'flex-end', alignItems: 'flex-end' }} hitSlop={{ top: 10, left: 10, right: 10, bottom: 10 }}>
536
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontStyle: "normal", letterSpacing: 0, color: LibStyle.colorBlue }}>{esp.lang("event/seat", "show_map")}</Text>
537
+ </TouchableOpacity>
538
+ :
539
+ <View style={{ flex: 1 }} />
540
+ }
541
+ </View>
542
+
543
+ <View style={{ margin: 30, marginTop: 10, marginBottom: 10, borderBottomLeftRadius: 15, borderBottomRightRadius: 15, padding: 5, justifyContent: 'center', alignItems: 'center', alignContent: 'center', backgroundColor: LibStyle.colorGreen }}>
544
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: '#fff' }}>{esp.lang("event/seat", "front")}</Text>
545
+ </View>
546
+
547
+ <View key={sizeBox} style={{ flex: 3, marginVertical: 10 }}>
548
+ <View style={{ flex: 1, flexDirection: 'row', margin: 10, marginVertical: 0 }} >
549
+ <Animated.ScrollView
550
+ horizontal
551
+ scrollEventThrottle={16}
552
+ overScrollMode="never"
553
+ showsHorizontalScrollIndicator={false}
554
+ onContentSizeChange={(width, height) => {
555
+ setCompleteScrollBarWidth(width)
556
+ }}
557
+ onLayout={(x) => {
558
+ setVisibleScrollBarWidth(x.nativeEvent.layout.width)
559
+ }}
560
+ onScroll={scrollHandlerX}>
561
+ <Animated.ScrollView
562
+ scrollEventThrottle={16}
563
+ overScrollMode="never"
564
+ showsVerticalScrollIndicator={false}
565
+ onContentSizeChange={(width, height) => {
566
+ setCompleteScrollBarHeight(height)
567
+ }}
568
+ onLayout={(x) => {
569
+ setVisibleScrollBarHeight(x.nativeEvent.layout.height)
570
+ }}
571
+ onScroll={scrollHandlerY}>
572
+ <View>
573
+ {result?.list?.map(renderRow)}
574
+ </View>
575
+ </Animated.ScrollView>
576
+ </Animated.ScrollView>
577
+ <View style={{ width: 8, height: "100%", backgroundColor: "#c9c9c9", borderRadius: 4 }}>
578
+ <Animated.View style={[{ width: 8, height: scrollIndicatorHeightSize, backgroundColor: LibStyle.colorPrimary, borderRadius: 4 }, styleY]} />
579
+ </View>
580
+ </View>
581
+ <View style={{ width: LibStyle.width - 28, margin: 10, height: 8, backgroundColor: "#c9c9c9", borderRadius: 4 }}>
582
+ <Animated.View style={[{ width: scrollIndicatorWidthSize, height: 8, backgroundColor: LibStyle.colorPrimary, borderRadius: 4 }, styleX]} />
583
+ </View>
584
+ </View>
585
+ <View style={{ flexDirection: 'row', justifyContent: 'space-around' }} >
586
+ <Pressable
587
+ style={{ opacity: sizeBox == 10 ? 0.2 : 1, height: 60, borderRadius: 30, ...LibStyle.elevation(3), backgroundColor: 'white', width: 60, justifyContent: 'center', alignItems: 'center' }}
588
+ onPress={() => setSizeBox(sizeBox >= 20 ? sizeBox - 10 : 10)} >
589
+ <LibIcon.MaterialIcons name='zoom-out' size={24} />
590
+ </Pressable>
591
+ <Pressable
592
+ style={{ opacity: sizeBox == 40 ? 0.2 : 1, height: 60, borderRadius: 30, ...LibStyle.elevation(3), backgroundColor: 'white', width: 60, justifyContent: 'center', alignItems: 'center' }}
593
+ onPress={() => setSizeBox(sizeBox <= 30 ? sizeBox + 10 : 40)} >
594
+ <LibIcon.MaterialIcons name='zoom-in' size={24} />
595
+ </Pressable>
596
+ </View>
597
+
598
+ <View style={{ flex: 0.1 }} />
599
+
600
+ <View style={{ paddingVertical: 10, paddingHorizontal: 10 }} >
601
+ <View style={{ marginHorizontal: 0, margin: 10, marginBottom: 15, flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' }}>
602
+ <Text allowFontScaling={false} style={{ marginLeft: 5, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: '#999' }}>{esp.lang("event/seat", "select_seat_1", LibUtils.number(dataTicket?.qty - counter))}</Text>
603
+ <View style={{ flexDirection: 'row' }}>
604
+ {
605
+ explanation.map((item, i) => {
606
+ return (
607
+ <View key={i} style={{ flexDirection: 'row', alignContent: 'center', justifyContent: 'center', alignItems: 'center', marginRight: 5 }}>
608
+ <View key={i} style={{ height: 20, width: 20, borderRadius: 4, borderWidth: 1, borderColor: item.borderColor, backgroundColor: item.backgroundColor }} />
609
+ <Text allowFontScaling={false} style={{ marginLeft: 5, fontFamily: "Arial", fontSize: 8, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: '#999' }}>{item.text}</Text>
610
+ </View>
611
+ )
612
+ })
613
+ }
614
+ </View>
615
+ </View>
616
+ <ComponentButton label={esp.lang("buy/index2", "button_next")} onPress={() => {
617
+ next()
618
+ }} style={{ backgroundColor: dataTicket?.qty != counter ? LibStyle.colorGrey : LibStyle.colorPrimary }} />
619
+ </View>
620
+ </>
621
+ }
622
+ </View>
623
+ )
624
+ }
625
+
626
+ }
627
+ const styleId_Z1ppFKw: any = { borderRadius: 4, alignContent: 'center', alignItems: 'center', backgroundColor: '#f5f5f5', marginBottom: 5, padding: 10, flexDirection: 'row', justifyContent: 'space-between', flex: 1 }
628
+ const styleId_ZE3xEb: any = { padding: 8, opacity: 1 }