esoftplay-event 0.0.2-s → 0.0.2-u
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.
- package/event/htmltext.tsx +40 -28
- package/event/message.tsx +2 -2
- package/event/order_detail.tsx +45 -555
- package/event/order_detail_addons.tsx +60 -0
- package/event/order_detail_addons_booked.tsx +61 -0
- package/event/order_detail_coupon.tsx +66 -0
- package/event/order_detail_instruction.tsx +96 -0
- package/event/order_detail_payment.tsx +1 -1
- package/event/order_detail_reschedule.tsx +109 -0
- package/event/order_detail_return.tsx +1 -1
- package/event/order_detail_review.tsx +174 -0
- package/event/order_detail_share.tsx +9 -6
- package/event/order_detail_tnc.tsx +76 -0
- package/event/review_add.tsx +2 -2
- package/event/seat.tsx +130 -378
- package/event/seat_map.tsx +8 -8
- package/event/seat_map_new.tsx +191 -24
- package/event/test.tsx +8 -8
- package/id.json +9 -0
- package/package.json +1 -1
package/event/seat.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// withHooks
|
|
2
2
|
import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
3
3
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
4
|
-
import { EventOrder_detailProperty } from 'esoftplay/cache/event/order_detail/import';
|
|
5
4
|
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
6
5
|
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
7
6
|
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
@@ -9,7 +8,6 @@ import { LibLoading } from 'esoftplay/cache/lib/loading/import';
|
|
|
9
8
|
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
10
9
|
import { LibObject } from 'esoftplay/cache/lib/object/import';
|
|
11
10
|
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
12
|
-
import { LibProgress } from 'esoftplay/cache/lib/progress/import';
|
|
13
11
|
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
14
12
|
import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
|
|
15
13
|
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
@@ -17,10 +15,8 @@ import esp from 'esoftplay/esp';
|
|
|
17
15
|
import useSafeState from 'esoftplay/state';
|
|
18
16
|
|
|
19
17
|
import { applyStyle } from 'esoftplay';
|
|
20
|
-
import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
|
|
21
|
-
import { EventTransaction } from 'esoftplay/cache/event/transaction/import';
|
|
22
18
|
import React, { useEffect } from 'react';
|
|
23
|
-
import { Pressable,
|
|
19
|
+
import { Pressable, Text, TouchableOpacity, View } from 'react-native';
|
|
24
20
|
import Animated, { Extrapolate, interpolate, useAnimatedScrollHandler, useAnimatedStyle, useSharedValue } from 'react-native-reanimated';
|
|
25
21
|
|
|
26
22
|
|
|
@@ -31,8 +27,7 @@ export interface EventSeatProps {
|
|
|
31
27
|
|
|
32
28
|
}
|
|
33
29
|
export default function m(props: EventSeatProps): any {
|
|
34
|
-
const { url, dataTicket
|
|
35
|
-
const [trxId] = useSafeState(EventTransaction().getTrxId())
|
|
30
|
+
const { url, dataTicket } = LibNavigation.getArgsAll(props)
|
|
36
31
|
|
|
37
32
|
const [result, setResult] = useSafeState<any>(undefined)
|
|
38
33
|
const [counter, setCounter] = useSafeState<any>(0)
|
|
@@ -104,33 +99,9 @@ export default function m(props: EventSeatProps): any {
|
|
|
104
99
|
]
|
|
105
100
|
|
|
106
101
|
useEffect(() => {
|
|
107
|
-
|
|
108
|
-
loadSeatShared()
|
|
109
|
-
} else if (returnTicket) {
|
|
110
|
-
loadSeatReturn()
|
|
111
|
-
} else {
|
|
112
|
-
loadDataSize()
|
|
113
|
-
}
|
|
102
|
+
loadDataSize()
|
|
114
103
|
}, [])
|
|
115
104
|
|
|
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 || dataTicket?.selected_ticket?.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
105
|
function loadDataSize() {
|
|
135
106
|
let post = {
|
|
136
107
|
event_id: dataTicket?.event_id,
|
|
@@ -186,18 +157,6 @@ export default function m(props: EventSeatProps): any {
|
|
|
186
157
|
}, 1)
|
|
187
158
|
}
|
|
188
159
|
|
|
189
|
-
function loadSeatReturn() {
|
|
190
|
-
new LibCurl(url, null, (res) => {
|
|
191
|
-
for (let i = 0; i < res.tickets.length; i++) {
|
|
192
|
-
res.tickets[i].check = false
|
|
193
|
-
}
|
|
194
|
-
setResult(res)
|
|
195
|
-
}, (error) => {
|
|
196
|
-
LibDialog.warning(esp.lang("event/seat", "load_return_failed"), error?.message);
|
|
197
|
-
LibNavigation.back()
|
|
198
|
-
}, 1)
|
|
199
|
-
}
|
|
200
|
-
|
|
201
160
|
function next() {
|
|
202
161
|
if (dataTicket?.qty != counter) {
|
|
203
162
|
LibToastProperty.show(esp.lang("event/seat", "select_seat"))
|
|
@@ -222,75 +181,6 @@ export default function m(props: EventSeatProps): any {
|
|
|
222
181
|
LibNavigation.sendBackResult(value)
|
|
223
182
|
}
|
|
224
183
|
|
|
225
|
-
function shareTicket(p: any) {
|
|
226
|
-
if (dataTicket?.qty != counter) {
|
|
227
|
-
LibToastProperty.show(esp.lang("event/seat", "select_seat1"))
|
|
228
|
-
return
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
let seatName = result?.list?.filter((item: any) => item.check).map((it: any) => it.seat_name)
|
|
232
|
-
let _bookingMemberId = result?.list?.filter((item: any) => item.check).map((it: any) => it.id)
|
|
233
|
-
|
|
234
|
-
LibDialog.confirm(esp.lang("event/seat", "share_title"), esp.lang("event/seat", "share_msg"), esp.lang("event/seat", "share_confirm"), () => {
|
|
235
|
-
let post = {
|
|
236
|
-
receiver_email: receiver_email,
|
|
237
|
-
booking_id: result?.booking_id,
|
|
238
|
-
qty_shared: dataTicket?.qty,
|
|
239
|
-
seat_name: seatName.join('|'),
|
|
240
|
-
booking_member_id: _bookingMemberId.join('|'),
|
|
241
|
-
trx_id: trxId,
|
|
242
|
-
pin: p
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
LibProgress.show(esp.lang("event/seat", "share_wait"))
|
|
246
|
-
new LibCurl('event_booking_shared?id=' + dataTicket?.event_id, post, (res, msg) => {
|
|
247
|
-
EventOrder_detailProperty.subscribe().trigger()
|
|
248
|
-
EventIndexProperty.reload.trigger() //reload data order
|
|
249
|
-
// LibNotify(res)
|
|
250
|
-
LibProgress.hide()
|
|
251
|
-
LibDialog.info(esp.lang("event/seat", "share_ok"), msg)
|
|
252
|
-
LibNavigation.back()
|
|
253
|
-
LibNavigation.back()
|
|
254
|
-
}, (error) => {
|
|
255
|
-
LibProgress.hide()
|
|
256
|
-
LibDialog.warning(esp.lang("event/seat", "share_no"), error?.message);
|
|
257
|
-
// LibNavigation.back()
|
|
258
|
-
})
|
|
259
|
-
}, esp.lang("event/seat", "share_cancel"), () => {
|
|
260
|
-
|
|
261
|
-
})
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
function sendBackTicket(p: any) {
|
|
265
|
-
if (dataTicket?.qty != counter) {
|
|
266
|
-
LibToastProperty.show(esp.lang("event/seat", "select_seat2"))
|
|
267
|
-
return
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
LibDialog.confirm(esp.lang("event/seat", "ticket_title"), esp.lang("event/seat", "ticket_msg"), esp.lang("event/seat", "ticket_confirm"), () => {
|
|
271
|
-
LibProgress.show(esp.lang("event/seat", "ticket_wait"))
|
|
272
|
-
|
|
273
|
-
let _bookingMemberId = result?.tickets?.filter((item: any) => item.check).map((it: any) => it.id)
|
|
274
|
-
|
|
275
|
-
let post = {
|
|
276
|
-
booking_member_id: _bookingMemberId.join('|'),
|
|
277
|
-
pin: p
|
|
278
|
-
}
|
|
279
|
-
new LibCurl('event_booking_shared_return?booking_id=' + result?.booking_id + '&qty_shared=' + dataTicket?.qty, post, (res, msg) => {
|
|
280
|
-
// LibNotify(res)
|
|
281
|
-
EventOrder_detailProperty.subscribe().trigger()
|
|
282
|
-
LibProgress.hide()
|
|
283
|
-
LibDialog.info(esp.lang("event/seat", "ticket_ok"), msg)
|
|
284
|
-
LibNavigation.back()
|
|
285
|
-
LibNavigation.back()
|
|
286
|
-
}, (error) => {
|
|
287
|
-
LibProgress.hide()
|
|
288
|
-
LibDialog.warning(esp.lang("event/seat", "ticket_failed"), error?.message);
|
|
289
|
-
// LibNavigation.back()
|
|
290
|
-
}, 1)
|
|
291
|
-
}, esp.lang("event/seat", "ticket_cancel"), () => { })
|
|
292
|
-
}
|
|
293
|
-
|
|
294
184
|
const viewImageMap = (image: string) => {
|
|
295
185
|
return (
|
|
296
186
|
<View>
|
|
@@ -351,294 +241,156 @@ export default function m(props: EventSeatProps): any {
|
|
|
351
241
|
)
|
|
352
242
|
}
|
|
353
243
|
|
|
354
|
-
function renderTicketShare(item: any, i: number) {
|
|
355
|
-
let _selectTicket = item.hasOwnProperty('check') && item.check
|
|
356
|
-
const [front, end] = item?.seat_name?.split("#") || ["", ""];
|
|
357
|
-
|
|
358
|
-
return (
|
|
359
|
-
<TouchableOpacity onPress={() => {
|
|
360
|
-
if (counter + 1 > dataTicket?.qty && !item.check) {
|
|
361
|
-
alertSelectSeat()
|
|
362
|
-
} else {
|
|
363
|
-
let a = LibObject.set(result, item.check == false ? true : false)('list', i, 'check')
|
|
364
|
-
setResult(a)
|
|
365
|
-
setCounter(item.check ? counter - 1 : counter + 1)
|
|
366
|
-
}
|
|
367
|
-
}} key={i} style={applyStyle({ borderRadius: 4, alignContent: 'center', alignItems: 'center', backgroundColor: '#f5f5f5', marginBottom: 5, padding: 10, flexDirection: 'row', justifyContent: 'space-between', flex: 1 })}>
|
|
368
|
-
<View key={i} style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: 5, paddingHorizontal: 5, backgroundColor: '#fff', borderRadius: 5, marginRight: 7, ...LibStyle.elevation(5), }}>
|
|
369
|
-
<Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 16, color: "#000" }}> {front} </Text>
|
|
370
|
-
<Text allowFontScaling={false} style={{ marginLeft: 3, fontWeight: 'bold', fontSize: 16, color: '#000', }}> {end} </Text>
|
|
371
|
-
</View>
|
|
372
|
-
|
|
373
|
-
{/* <Text allowFontScaling={false}>{item.seat_name}</Text> */}
|
|
374
|
-
<TouchableOpacity onPress={() => {
|
|
375
|
-
if (!item.check && counter + 1 > dataTicket?.qty) {
|
|
376
|
-
alertSelectSeat()
|
|
377
|
-
} else {
|
|
378
|
-
let a = LibObject.set(result, item.check == false ? true : false)('list', i, 'check')
|
|
379
|
-
setResult(a)
|
|
380
|
-
setCounter(!item.check ? counter + 1 : counter - 1)
|
|
381
|
-
}
|
|
382
|
-
}} style={applyStyle({ padding: 8, opacity: 1 })} >
|
|
383
|
-
<LibIcon name={_selectTicket ? "checkbox-marked-circle" : "radiobox-blank"} size={22} color={_selectTicket ? "#3ea4dc" : "#434343"} />
|
|
384
|
-
</TouchableOpacity>
|
|
385
|
-
</TouchableOpacity>
|
|
386
|
-
)
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
function renderTicketReturn(item: any, i: number) {
|
|
390
|
-
let _selectTicket = item.hasOwnProperty('check') && item.check
|
|
391
|
-
const [front, end] = item?.seat_name?.split("#") || ["", ""];
|
|
392
|
-
return (
|
|
393
|
-
<TouchableOpacity onPress={() => {
|
|
394
|
-
if (counter + 1 > dataTicket?.qty && !item.check) {
|
|
395
|
-
alertSelectSeat()
|
|
396
|
-
} else {
|
|
397
|
-
let a = LibObject.set(result, item.check == false ? true : false)('tickets', i, 'check')
|
|
398
|
-
setResult(a)
|
|
399
|
-
setCounter(item.check ? counter - 1 : counter + 1)
|
|
400
|
-
}
|
|
401
|
-
}} key={i} style={applyStyle({ borderRadius: 4, alignContent: 'center', alignItems: 'center', backgroundColor: '#f5f5f5', marginBottom: 5, padding: 10, flexDirection: 'row', justifyContent: 'space-between', flex: 1 })}>
|
|
402
|
-
<View key={i} style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: 5, paddingHorizontal: 5, backgroundColor: '#fff', borderRadius: 5, marginRight: 7, ...LibStyle.elevation(5), }}>
|
|
403
|
-
<Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 16, color: "#000" }}> {front} </Text>
|
|
404
|
-
<Text allowFontScaling={false} style={{ marginLeft: 3, fontWeight: 'bold', fontSize: 16, color: '#000', }}> {end} </Text>
|
|
405
|
-
</View>
|
|
406
|
-
|
|
407
|
-
{/* <Text allowFontScaling={false}>{item.seat_name}</Text> */}
|
|
408
|
-
<TouchableOpacity onPress={() => {
|
|
409
|
-
if (!item.check && counter + 1 > dataTicket?.qty) {
|
|
410
|
-
alertSelectSeat()
|
|
411
|
-
} else {
|
|
412
|
-
let a = LibObject.set(result, item.check == false ? true : false)('tickets', i, 'check')
|
|
413
|
-
setResult(a)
|
|
414
|
-
setCounter(!item.check ? counter + 1 : counter - 1)
|
|
415
|
-
}
|
|
416
|
-
}} style={applyStyle({ padding: 8, opacity: 1 })} >
|
|
417
|
-
<LibIcon name={_selectTicket ? "checkbox-marked-circle" : "radiobox-blank"} size={22} color={_selectTicket ? "#3ea4dc" : "#434343"} />
|
|
418
|
-
</TouchableOpacity>
|
|
419
|
-
</TouchableOpacity>
|
|
420
|
-
)
|
|
421
|
-
}
|
|
422
|
-
|
|
423
244
|
useEffect(() => {
|
|
424
245
|
return () => LibNavigation.cancelBackResult(LibNavigation.getResultKey(props))
|
|
425
246
|
}, [])
|
|
426
247
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
if (p) {
|
|
453
|
-
shareTicket(p)
|
|
454
|
-
}
|
|
455
|
-
})
|
|
456
|
-
}} style={{ backgroundColor: dataTicket?.qty != counter ? LibStyle.colorGrey : LibStyle.colorPrimary }} />
|
|
457
|
-
</View>
|
|
458
|
-
</>
|
|
459
|
-
}
|
|
460
|
-
</View>
|
|
461
|
-
)
|
|
462
|
-
} else if (returnTicket) {
|
|
463
|
-
return (
|
|
464
|
-
<View style={{ flex: 1, backgroundColor: '#fff' }}>
|
|
465
|
-
<EventHeader title={esp.lang("event/seat", "header_title_return")} subtitle={esp.lang("event/seat", "header_subtitle_return")} />
|
|
466
|
-
{
|
|
467
|
-
!result ?
|
|
468
|
-
<LibLoading />
|
|
248
|
+
return (
|
|
249
|
+
<View style={{ flex: 1, backgroundColor: '#fff' }}>
|
|
250
|
+
<EventHeader title={esp.lang("event/seat", "header_title_select")} subtitle={dataTicket?.selected_ticket?.type} />
|
|
251
|
+
{
|
|
252
|
+
!result ?
|
|
253
|
+
<LibLoading />
|
|
254
|
+
:
|
|
255
|
+
result == "none" ?
|
|
256
|
+
<View style={{ flex: 1, margin: 10, marginBottom: 0, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
|
|
257
|
+
<TouchableOpacity onPress={() => {
|
|
258
|
+
LibNavigation.navigateForResult('event/seat_map', {
|
|
259
|
+
x: resultDataSize.seat_column,
|
|
260
|
+
y: resultDataSize.seat_row,
|
|
261
|
+
url: url,
|
|
262
|
+
event_id: dataTicket?.event_id,
|
|
263
|
+
price_id: dataTicket?.selected_ticket?.list?.price_id || dataTicket?.selected_ticket?.price_id,
|
|
264
|
+
ondate: dataTicket?.selected_ticket?.list?.ondate,
|
|
265
|
+
}, 345).then((item: any) => {
|
|
266
|
+
setResult(undefined)
|
|
267
|
+
loadSeat(item)
|
|
268
|
+
})
|
|
269
|
+
}} style={{ alignContent: 'center', alignItems: 'center', padding: 10, borderRadius: 5, backgroundColor: LibStyle.colorPrimary }}>
|
|
270
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontStyle: "normal", letterSpacing: 0, color: '#000' }}>{esp.lang("event/seat", "reselect")}</Text>
|
|
271
|
+
</TouchableOpacity>
|
|
272
|
+
</View>
|
|
469
273
|
:
|
|
470
274
|
<>
|
|
471
|
-
<
|
|
472
|
-
<
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
result?.tickets?.length > 0 && result?.tickets?.map?.(renderTicketReturn)
|
|
476
|
-
}
|
|
477
|
-
</View>
|
|
478
|
-
</ScrollView>
|
|
479
|
-
<View style={{ paddingVertical: 10, paddingHorizontal: 20 }} >
|
|
480
|
-
<EventButton label={esp.lang("event/seat", "next")} onPress={() => {
|
|
481
|
-
LibNavigation.navigateForResult("bigbang/payment_pin", undefined, 1132).then((p) => {
|
|
482
|
-
if (p) {
|
|
483
|
-
sendBackTicket(p)
|
|
484
|
-
}
|
|
485
|
-
})
|
|
486
|
-
|
|
487
|
-
}} style={{ backgroundColor: dataTicket?.qty != counter ? LibStyle.colorGrey : LibStyle.colorPrimary }} />
|
|
488
|
-
</View>
|
|
489
|
-
</>
|
|
490
|
-
}
|
|
491
|
-
</View>
|
|
492
|
-
)
|
|
493
|
-
} else {
|
|
494
|
-
return (
|
|
495
|
-
<View style={{ flex: 1, backgroundColor: '#fff' }}>
|
|
496
|
-
<EventHeader title={esp.lang("event/seat", "header_title_select")} subtitle={dataTicket?.selected_ticket?.type} />
|
|
497
|
-
{
|
|
498
|
-
!result ?
|
|
499
|
-
<LibLoading />
|
|
500
|
-
:
|
|
501
|
-
result == "none" ?
|
|
502
|
-
<View style={{ flex: 1, margin: 10, marginBottom: 0, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
|
|
503
|
-
<TouchableOpacity onPress={() => {
|
|
504
|
-
LibNavigation.navigateForResult('event/seat_map', {
|
|
505
|
-
x: resultDataSize.seat_column,
|
|
506
|
-
y: resultDataSize.seat_row,
|
|
507
|
-
url: url,
|
|
508
|
-
event_id: dataTicket?.event_id,
|
|
509
|
-
price_id: dataTicket?.selected_ticket?.list?.price_id || dataTicket?.selected_ticket?.price_id,
|
|
510
|
-
ondate: dataTicket?.selected_ticket?.list?.ondate,
|
|
511
|
-
}, 345).then((item: any) => {
|
|
512
|
-
setResult(undefined)
|
|
513
|
-
loadSeat(item)
|
|
514
|
-
})
|
|
515
|
-
}} style={{ alignContent: 'center', alignItems: 'center', padding: 10, borderRadius: 5, backgroundColor: LibStyle.colorPrimary }}>
|
|
516
|
-
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontStyle: "normal", letterSpacing: 0, color: '#000' }}>{esp.lang("event/seat", "reselect")}</Text>
|
|
517
|
-
</TouchableOpacity>
|
|
518
|
-
</View>
|
|
519
|
-
:
|
|
520
|
-
<>
|
|
521
|
-
<View style={{ margin: 10, marginBottom: 0, flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' }}>
|
|
522
|
-
<View style={{ flex: 1 }}>
|
|
523
|
-
{/* {
|
|
524
|
-
Number(resultDataSize.seat_column) * Number(resultDataSize.seat_row) > 100 &&
|
|
525
|
-
<TouchableOpacity onPress={() => {
|
|
526
|
-
LibNavigation.navigateForResult('event/seat_map', {
|
|
527
|
-
x: resultDataSize.seat_column,
|
|
528
|
-
y: resultDataSize.seat_row,
|
|
529
|
-
url: url,
|
|
530
|
-
event_id: event_id,
|
|
531
|
-
price_id: price_id,
|
|
532
|
-
on_date: on_date,
|
|
533
|
-
}, 345).then((item: any) => {
|
|
534
|
-
setResult(undefined)
|
|
535
|
-
loadSeat(item)
|
|
536
|
-
})
|
|
537
|
-
}} style={{ marginRight: 20, alignContent: 'center', alignItems: 'center', padding: 5, borderRadius: 5, backgroundColor: LibStyle.colorPrimary }}>
|
|
538
|
-
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontStyle: "normal", letterSpacing: 0, color: '#000' }}>Pilih Ulang</Text>
|
|
539
|
-
</TouchableOpacity>
|
|
540
|
-
} */}
|
|
541
|
-
</View>
|
|
542
|
-
<View style={{ flex: 1, alignContent: 'center', alignItems: 'center' }}>
|
|
543
|
-
<Text allowFontScaling={false} style={{ textAlign: 'center', fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: '#000' }}>{dataTicket?.selected_ticket?.type}</Text>
|
|
544
|
-
</View>
|
|
545
|
-
{
|
|
546
|
-
result?.image_map != "" ?
|
|
275
|
+
<View style={{ margin: 10, marginBottom: 0, flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' }}>
|
|
276
|
+
<View style={{ flex: 1 }}>
|
|
277
|
+
{/* {
|
|
278
|
+
Number(resultDataSize.seat_column) * Number(resultDataSize.seat_row) > 100 &&
|
|
547
279
|
<TouchableOpacity onPress={() => {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
280
|
+
LibNavigation.navigateForResult('event/seat_map', {
|
|
281
|
+
x: resultDataSize.seat_column,
|
|
282
|
+
y: resultDataSize.seat_row,
|
|
283
|
+
url: url,
|
|
284
|
+
event_id: event_id,
|
|
285
|
+
price_id: price_id,
|
|
286
|
+
on_date: on_date,
|
|
287
|
+
}, 345).then((item: any) => {
|
|
288
|
+
setResult(undefined)
|
|
289
|
+
loadSeat(item)
|
|
290
|
+
})
|
|
291
|
+
}} style={{ marginRight: 20, alignContent: 'center', alignItems: 'center', padding: 5, borderRadius: 5, backgroundColor: LibStyle.colorPrimary }}>
|
|
292
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontStyle: "normal", letterSpacing: 0, color: '#000' }}>Pilih Ulang</Text>
|
|
555
293
|
</TouchableOpacity>
|
|
556
|
-
|
|
557
|
-
<View style={{ flex: 1 }} />
|
|
558
|
-
}
|
|
294
|
+
} */}
|
|
559
295
|
</View>
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: '#fff' }}>{esp.lang("event/seat", "front")}</Text>
|
|
296
|
+
<View style={{ flex: 1, alignContent: 'center', alignItems: 'center' }}>
|
|
297
|
+
<Text allowFontScaling={false} style={{ textAlign: 'center', fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: '#000' }}>{dataTicket?.selected_ticket?.type}</Text>
|
|
563
298
|
</View>
|
|
299
|
+
{
|
|
300
|
+
result?.image_map != "" ?
|
|
301
|
+
<TouchableOpacity onPress={() => {
|
|
302
|
+
if (result?.image_map == "") {
|
|
303
|
+
LibToastProperty.show(esp.lang("event/seat", "empty_image"))
|
|
304
|
+
} else {
|
|
305
|
+
LibDialog.custom(viewImageMap(result?.image_map))
|
|
306
|
+
}
|
|
307
|
+
}} style={{ flex: 1, justifyContent: 'flex-end', alignContent: 'flex-end', alignItems: 'flex-end' }} hitSlop={{ top: 10, left: 10, right: 10, bottom: 10 }}>
|
|
308
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontStyle: "normal", letterSpacing: 0, color: LibStyle.colorBlue }}>{esp.lang("event/seat", "show_map")}</Text>
|
|
309
|
+
</TouchableOpacity>
|
|
310
|
+
:
|
|
311
|
+
<View style={{ flex: 1 }} />
|
|
312
|
+
}
|
|
313
|
+
</View>
|
|
564
314
|
|
|
565
|
-
|
|
566
|
-
|
|
315
|
+
<View style={{ margin: 30, marginTop: 10, marginBottom: 10, borderBottomLeftRadius: 15, borderBottomRightRadius: 15, padding: 5, justifyContent: 'center', alignItems: 'center', alignContent: 'center', backgroundColor: LibStyle.colorGreen }}>
|
|
316
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: '#fff' }}>{esp.lang("event/seat", "front")}</Text>
|
|
317
|
+
</View>
|
|
318
|
+
|
|
319
|
+
<View key={sizeBox} style={{ flex: 3, marginVertical: 10 }}>
|
|
320
|
+
<View style={{ flex: 1, flexDirection: 'row', margin: 10, marginVertical: 0 }} >
|
|
321
|
+
<Animated.ScrollView
|
|
322
|
+
horizontal
|
|
323
|
+
scrollEventThrottle={16}
|
|
324
|
+
overScrollMode="never"
|
|
325
|
+
showsHorizontalScrollIndicator={false}
|
|
326
|
+
onContentSizeChange={(width, height) => {
|
|
327
|
+
setCompleteScrollBarWidth(width)
|
|
328
|
+
}}
|
|
329
|
+
onLayout={(x) => {
|
|
330
|
+
setVisibleScrollBarWidth(x.nativeEvent.layout.width)
|
|
331
|
+
}}
|
|
332
|
+
onScroll={scrollHandlerX}>
|
|
567
333
|
<Animated.ScrollView
|
|
568
|
-
horizontal
|
|
569
334
|
scrollEventThrottle={16}
|
|
570
335
|
overScrollMode="never"
|
|
571
|
-
|
|
336
|
+
showsVerticalScrollIndicator={false}
|
|
572
337
|
onContentSizeChange={(width, height) => {
|
|
573
|
-
|
|
338
|
+
setCompleteScrollBarHeight(height)
|
|
574
339
|
}}
|
|
575
340
|
onLayout={(x) => {
|
|
576
|
-
|
|
341
|
+
setVisibleScrollBarHeight(x.nativeEvent.layout.height)
|
|
577
342
|
}}
|
|
578
|
-
onScroll={
|
|
579
|
-
<
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
showsVerticalScrollIndicator={false}
|
|
583
|
-
onContentSizeChange={(width, height) => {
|
|
584
|
-
setCompleteScrollBarHeight(height)
|
|
585
|
-
}}
|
|
586
|
-
onLayout={(x) => {
|
|
587
|
-
setVisibleScrollBarHeight(x.nativeEvent.layout.height)
|
|
588
|
-
}}
|
|
589
|
-
onScroll={scrollHandlerY}>
|
|
590
|
-
<View>
|
|
591
|
-
{result?.list?.map?.(renderRow)}
|
|
592
|
-
</View>
|
|
593
|
-
</Animated.ScrollView>
|
|
343
|
+
onScroll={scrollHandlerY}>
|
|
344
|
+
<View>
|
|
345
|
+
{result?.list?.map?.(renderRow)}
|
|
346
|
+
</View>
|
|
594
347
|
</Animated.ScrollView>
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
</View>
|
|
599
|
-
<View style={{ width: LibStyle.width - 28, margin: 10, height: 8, backgroundColor: "#c9c9c9", borderRadius: 4 }}>
|
|
600
|
-
<Animated.View style={[{ width: scrollIndicatorWidthSize, height: 8, backgroundColor: LibStyle.colorPrimary, borderRadius: 4 }, styleX]} />
|
|
348
|
+
</Animated.ScrollView>
|
|
349
|
+
<View style={{ width: 8, height: "100%", backgroundColor: "#c9c9c9", borderRadius: 4 }}>
|
|
350
|
+
<Animated.View style={[{ width: 8, height: scrollIndicatorHeightSize, backgroundColor: LibStyle.colorPrimary, borderRadius: 4 }, styleY]} />
|
|
601
351
|
</View>
|
|
602
352
|
</View>
|
|
603
|
-
<View style={{
|
|
604
|
-
<
|
|
605
|
-
style={{ opacity: sizeBox == 10 ? 0.2 : 1, height: 60, borderRadius: 30, ...LibStyle.elevation(3), backgroundColor: 'white', width: 60, justifyContent: 'center', alignItems: 'center' }}
|
|
606
|
-
onPress={() => setSizeBox(sizeBox >= 20 ? sizeBox - 10 : 10)} >
|
|
607
|
-
<LibIcon.MaterialIcons name='zoom-out' size={24} />
|
|
608
|
-
</Pressable>
|
|
609
|
-
<Pressable
|
|
610
|
-
style={{ opacity: sizeBox == 40 ? 0.2 : 1, height: 60, borderRadius: 30, ...LibStyle.elevation(3), backgroundColor: 'white', width: 60, justifyContent: 'center', alignItems: 'center' }}
|
|
611
|
-
onPress={() => setSizeBox(sizeBox <= 30 ? sizeBox + 10 : 40)} >
|
|
612
|
-
<LibIcon.MaterialIcons name='zoom-in' size={24} />
|
|
613
|
-
</Pressable>
|
|
353
|
+
<View style={{ width: LibStyle.width - 28, margin: 10, height: 8, backgroundColor: "#c9c9c9", borderRadius: 4 }}>
|
|
354
|
+
<Animated.View style={[{ width: scrollIndicatorWidthSize, height: 8, backgroundColor: LibStyle.colorPrimary, borderRadius: 4 }, styleX]} />
|
|
614
355
|
</View>
|
|
356
|
+
</View>
|
|
357
|
+
<View style={{ flexDirection: 'row', justifyContent: 'space-around' }} >
|
|
358
|
+
<Pressable
|
|
359
|
+
style={{ opacity: sizeBox == 10 ? 0.2 : 1, height: 60, borderRadius: 30, ...LibStyle.elevation(3), backgroundColor: 'white', width: 60, justifyContent: 'center', alignItems: 'center' }}
|
|
360
|
+
onPress={() => setSizeBox(sizeBox >= 20 ? sizeBox - 10 : 10)} >
|
|
361
|
+
<LibIcon.MaterialIcons name='zoom-out' size={24} />
|
|
362
|
+
</Pressable>
|
|
363
|
+
<Pressable
|
|
364
|
+
style={{ opacity: sizeBox == 40 ? 0.2 : 1, height: 60, borderRadius: 30, ...LibStyle.elevation(3), backgroundColor: 'white', width: 60, justifyContent: 'center', alignItems: 'center' }}
|
|
365
|
+
onPress={() => setSizeBox(sizeBox <= 30 ? sizeBox + 10 : 40)} >
|
|
366
|
+
<LibIcon.MaterialIcons name='zoom-in' size={24} />
|
|
367
|
+
</Pressable>
|
|
368
|
+
</View>
|
|
615
369
|
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
</View>
|
|
370
|
+
<View style={{ flex: 0.1 }} />
|
|
371
|
+
|
|
372
|
+
<View style={{ paddingVertical: 10, paddingHorizontal: 10 }} >
|
|
373
|
+
<View style={{ marginHorizontal: 0, margin: 10, marginBottom: 15, flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' }}>
|
|
374
|
+
<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>
|
|
375
|
+
<View style={{ flexDirection: 'row' }}>
|
|
376
|
+
{
|
|
377
|
+
explanation.map((item, i) => {
|
|
378
|
+
return (
|
|
379
|
+
<View key={i} style={{ flexDirection: 'row', alignContent: 'center', justifyContent: 'center', alignItems: 'center', marginRight: 5 }}>
|
|
380
|
+
<View key={i} style={{ height: 20, width: 20, borderRadius: 4, borderWidth: 1, borderColor: item.borderColor, backgroundColor: item.backgroundColor }} />
|
|
381
|
+
<Text allowFontScaling={false} style={{ marginLeft: 5, fontFamily: "Arial", fontSize: 8, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: '#999' }}>{item.text}</Text>
|
|
382
|
+
</View>
|
|
383
|
+
)
|
|
384
|
+
})
|
|
385
|
+
}
|
|
633
386
|
</View>
|
|
634
|
-
<EventButton label={esp.lang("event/seat", "next")} onPress={() => {
|
|
635
|
-
next()
|
|
636
|
-
}} style={{ backgroundColor: dataTicket?.qty != counter ? LibStyle.colorGrey : LibStyle.colorPrimary }} />
|
|
637
387
|
</View>
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
388
|
+
<EventButton label={esp.lang("event/seat", "next")} onPress={() => {
|
|
389
|
+
next()
|
|
390
|
+
}} style={{ backgroundColor: dataTicket?.qty != counter ? LibStyle.colorGrey : LibStyle.colorPrimary }} />
|
|
391
|
+
</View>
|
|
392
|
+
</>
|
|
393
|
+
}
|
|
394
|
+
</View>
|
|
395
|
+
)
|
|
644
396
|
}
|
package/event/seat_map.tsx
CHANGED
|
@@ -386,16 +386,16 @@ function toBase26(num: number) {
|
|
|
386
386
|
|
|
387
387
|
function getLegends() {
|
|
388
388
|
const colors: any = [
|
|
389
|
-
["#
|
|
390
|
-
["#8EF67B", esp.lang("event/seat_map", "chosen"), "-1"],
|
|
389
|
+
["#fff", esp.lang("event/seat_map", "available"), 0],
|
|
390
|
+
// ["#8EF67B", esp.lang("event/seat_map", "chosen"), "-1"],
|
|
391
391
|
["#2EBBE8", esp.lang("event/seat_map", "reserved"), 3],
|
|
392
|
-
["#6C432C", esp.lang("event/seat_map", "chosen_by"), 7],
|
|
393
|
-
["#
|
|
394
|
-
["#9FA1A4", esp.lang("event/seat_map", "not_sold"), 1],
|
|
392
|
+
// ["#6C432C", esp.lang("event/seat_map", "chosen_by"), 7],
|
|
393
|
+
// ["#f1f2f3", esp.lang("event/seat_map", "way"), 5],
|
|
394
|
+
// ["#9FA1A4", esp.lang("event/seat_map", "not_sold"), 1],
|
|
395
395
|
["#6B71E6", esp.lang("event/seat_map", "seat_hold"), 2],
|
|
396
|
-
["#FF4866", esp.lang("event/seat_map", "wall"), 6],
|
|
397
|
-
["#FFA601", esp.lang("event/seat_map", "other_type"), 4],
|
|
398
|
-
["purple", esp.lang("event/seat_map", "stage"), 8]
|
|
396
|
+
// ["#FF4866", esp.lang("event/seat_map", "wall"), 6],
|
|
397
|
+
// ["#FFA601", esp.lang("event/seat_map", "other_type"), 4],
|
|
398
|
+
// ["purple", esp.lang("event/seat_map", "stage"), 8]
|
|
399
399
|
]
|
|
400
400
|
return colors
|
|
401
401
|
}
|