esoftplay-event 0.0.2-t → 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 +37 -547
- 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_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/order_detail.tsx
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
3
3
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
4
4
|
import { EventOrder_itemProperty } from 'esoftplay/cache/event/order_item/import';
|
|
5
|
-
import { EventReviewProperty } from 'esoftplay/cache/event/review/import';
|
|
6
5
|
import { EventReview_addProperty } from 'esoftplay/cache/event/review_add/import';
|
|
7
6
|
import { LibCarrousel_snap } from 'esoftplay/cache/lib/carrousel_snap/import';
|
|
8
7
|
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
@@ -16,7 +15,6 @@ import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
|
16
15
|
import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
|
|
17
16
|
import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
|
|
18
17
|
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
19
|
-
import { UserClass } from 'esoftplay/cache/user/class/import';
|
|
20
18
|
|
|
21
19
|
import { applyStyle } from 'esoftplay';
|
|
22
20
|
import { EventAlert } from 'esoftplay/cache/event/alert/import';
|
|
@@ -24,14 +22,16 @@ import { EventButton_order_detail } from 'esoftplay/cache/event/button_order_det
|
|
|
24
22
|
import { EventConfigProperty } from 'esoftplay/cache/event/config/import';
|
|
25
23
|
import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
|
|
26
24
|
import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
25
|
+
import { EventOrder_detail_addons } from 'esoftplay/cache/event/order_detail_addons/import';
|
|
26
|
+
import { EventOrder_detail_addons_booked } from 'esoftplay/cache/event/order_detail_addons_booked/import';
|
|
27
|
+
import { EventOrder_detail_coupon } from 'esoftplay/cache/event/order_detail_coupon/import';
|
|
28
|
+
import { EventOrder_detail_instruction } from 'esoftplay/cache/event/order_detail_instruction/import';
|
|
29
|
+
import { EventOrder_detail_reschedule } from 'esoftplay/cache/event/order_detail_reschedule/import';
|
|
30
|
+
import { EventOrder_detail_review } from 'esoftplay/cache/event/order_detail_review/import';
|
|
31
|
+
import { EventOrder_detail_tnc } from 'esoftplay/cache/event/order_detail_tnc/import';
|
|
29
32
|
import { EventQr_bg } from 'esoftplay/cache/event/qr_bg/import';
|
|
30
|
-
import { EventRating } from 'esoftplay/cache/event/rating/import';
|
|
31
33
|
import { EventSecure_page } from 'esoftplay/cache/event/secure_page/import';
|
|
32
|
-
import { EventStep } from 'esoftplay/cache/event/step/import';
|
|
33
34
|
import { LibCollaps } from 'esoftplay/cache/lib/collaps/import';
|
|
34
|
-
import { LibCurl_view } from 'esoftplay/cache/lib/curl_view/import';
|
|
35
35
|
import { LibObject } from 'esoftplay/cache/lib/object/import';
|
|
36
36
|
import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
|
|
37
37
|
import { UseCondition } from 'esoftplay/cache/use/condition/import';
|
|
@@ -40,7 +40,7 @@ import moment from 'esoftplay/moment';
|
|
|
40
40
|
import useSafeState from 'esoftplay/state';
|
|
41
41
|
import useGlobalSubscriber, { useGlobalSubscriberReturn } from 'esoftplay/subscribe';
|
|
42
42
|
import React, { useEffect, useRef } from 'react';
|
|
43
|
-
import {
|
|
43
|
+
import { Text, TouchableOpacity, View } from 'react-native';
|
|
44
44
|
import { ScrollView } from 'react-native-gesture-handler';
|
|
45
45
|
import QRCode from 'react-native-qrcode-svg';
|
|
46
46
|
|
|
@@ -49,71 +49,23 @@ export interface EventOrder_detailProps {
|
|
|
49
49
|
navigation: any
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
function renderTermItem(item: any, i: number) {
|
|
54
|
-
return (
|
|
55
|
-
<View key={i} style={{ marginTop: 10 }}>
|
|
56
|
-
<EventStep text={item} />
|
|
57
|
-
</View>
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
let urlsInstruction: any[] = []
|
|
63
|
-
|
|
64
52
|
const subs = useGlobalSubscriber()
|
|
65
53
|
export function subscribe(): useGlobalSubscriberReturn {
|
|
66
54
|
return subs
|
|
67
55
|
}
|
|
68
56
|
|
|
69
|
-
function getStringReview(data: any) {
|
|
70
|
-
const groupedData = data.reduce((acc: any[], obj: any) => {
|
|
71
|
-
const { survey_id, survey_question, survey_option, content } = obj;
|
|
72
|
-
|
|
73
|
-
if (!acc[survey_id]) {
|
|
74
|
-
acc[survey_id] = {
|
|
75
|
-
survey_id,
|
|
76
|
-
survey_question,
|
|
77
|
-
values: []
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (survey_option) {
|
|
82
|
-
acc[survey_id].values.push(survey_option);
|
|
83
|
-
}
|
|
84
|
-
if (content) {
|
|
85
|
-
acc[survey_id].values.push(content);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return acc;
|
|
89
|
-
}, {});
|
|
90
|
-
|
|
91
|
-
const finalResult = Object.values(groupedData).map((group: any) => {
|
|
92
|
-
const { survey_question, values } = group;
|
|
93
|
-
const valuesString = values.join(", ");
|
|
94
|
-
return `\nQ: ${survey_question}\nA: ${valuesString}`;
|
|
95
|
-
})
|
|
96
|
-
return finalResult
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
57
|
export default function m(props: EventOrder_detailProps): any {
|
|
102
58
|
const LibCurl = esp.mod("lib/curl")
|
|
103
59
|
|
|
104
60
|
EventSecure_page()
|
|
105
|
-
const [user] = UserClass.state().useState()
|
|
106
61
|
|
|
107
62
|
let showQR = useRef<LibSlidingup>(null)
|
|
108
63
|
let dialogAddonList = useRef<LibSlidingup>(null)
|
|
109
64
|
let dialogQtyAddons = useRef<LibSlidingup>(null)
|
|
110
|
-
const dialogSendBack = useRef<LibSlidingup>(null)
|
|
111
65
|
const url = LibNavigation.getArgs(props, 'url')
|
|
112
66
|
const [result, setResult] = useSafeState<any>(EventIndexProperty?.stateTicketCache()?.get()?.filter?.((x: any) => x.url?.replace?.('?id=', '/') == url?.replace?.('?id=', '/'))?.[0]?.detail)
|
|
113
67
|
const useIndividualQr = result?.config?.use_individual_qr_ticket
|
|
114
68
|
|
|
115
|
-
const [qty, setQty] = useSafeState<number>(1)
|
|
116
|
-
|
|
117
69
|
const [, setGroupAddon, getGroupAddon] = useSafeState()
|
|
118
70
|
const [, setSelectedAddon, getSelectedAddon] = useSafeState()
|
|
119
71
|
const [addonsBooked, setAddOnsBooked] = useSafeState()
|
|
@@ -234,35 +186,6 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
234
186
|
loadData()
|
|
235
187
|
})
|
|
236
188
|
|
|
237
|
-
function add(max: number): void {
|
|
238
|
-
if (qty < max) {
|
|
239
|
-
setQty(qty + 1)
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
function min(): void {
|
|
244
|
-
setQty(qty == 1 ? 1 : qty - 1)
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
function sendBack(p: any) {
|
|
248
|
-
LibDialog.confirm(esp.lang("event/order_detail", "warning"), esp.lang("event/order_detail", "return_this_ticket"), esp.lang("event/order_detail", "btn_yes"), () => {
|
|
249
|
-
LibProgress.show(esp.lang("event/order_detail", "please_wait"))
|
|
250
|
-
let post = {
|
|
251
|
-
pin: p
|
|
252
|
-
}
|
|
253
|
-
new LibCurl('event_booking_shared_return?booking_id=' + result?.id + '&qty_shared=' + qty, post, (res: any, msg: any) => {
|
|
254
|
-
// LibNotify(res)
|
|
255
|
-
LibProgress.hide()
|
|
256
|
-
LibDialog.info(esp.lang("event/order_detail", "information"), msg)
|
|
257
|
-
LibNavigation.back()
|
|
258
|
-
}, (error: any) => {
|
|
259
|
-
LibProgress.hide()
|
|
260
|
-
LibDialog.warning(esp.lang("event/order_detail", "back_err"), error?.message);
|
|
261
|
-
LibNavigation.back()
|
|
262
|
-
}, 1)
|
|
263
|
-
}, esp.lang("event/order_detail", "btn_cancel"), () => { })
|
|
264
|
-
}
|
|
265
|
-
|
|
266
189
|
function loadDataAddons(id: any, url: string) {
|
|
267
190
|
LibProgress.show(esp.lang("event/order_detail", "wait"))
|
|
268
191
|
new LibCurl(url, null, (res: any, msg: any) => {
|
|
@@ -376,83 +299,11 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
376
299
|
let isInvitationDate = result?.ondate == "0000-00-00" && result?.kind_detail?.use_code == 1
|
|
377
300
|
let isOnlineWithoutDate = result?.ondate == "0000-00-00" && result?.kind_detail?.everyday_pass == 0
|
|
378
301
|
|
|
379
|
-
if ((result?.status == 1 || (result?.qty == 0 && result?.qty_shared > 0)) && result?.is_reschedule == 1) {
|
|
380
|
-
return (
|
|
381
|
-
<View style={{ flex: 1, backgroundColor: '#f6f6f6' }}>
|
|
382
|
-
<EventHeader title={esp.lang("event/order_detail", "order_detail")} />
|
|
383
|
-
<View style={[{ margin: 18, borderTopLeftRadius: 7, borderTopRightRadius: 7, backgroundColor: '#fff', paddingBottom: 10 }, LibStyle.elevation(3)]}>
|
|
384
|
-
|
|
385
|
-
<TouchableOpacity onPress={() => {
|
|
386
|
-
LibNavigation.navigate('lib/gallery', { image: result?.image })
|
|
387
|
-
}}>
|
|
388
|
-
<LibPicture source={{ uri: result?.image }} style={{ borderTopLeftRadius: 7, borderTopRightRadius: 7, height: imgHeight, width: imgWidth }} resizeMode="cover" />
|
|
389
|
-
</TouchableOpacity>
|
|
390
|
-
<View style={{ flexDirection: 'row', margin: 14, marginTop: 4, justifyContent: 'space-between' }}>
|
|
391
|
-
<View style={{ marginTop: 14 }}>
|
|
392
|
-
<EventHtmltext allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{esp.lang("event/order_detail", "ticket")}{result?.price_name}</EventHtmltext>
|
|
393
|
-
<View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
|
|
394
|
-
<LibIcon name="ticket-outline" size={20} />
|
|
395
|
-
<Text allowFontScaling={false} style={{ marginLeft: 6, fontFamily: "Arial", fontSize: 30, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{result?.qty}</Text>
|
|
396
|
-
<Text allowFontScaling={false} style={{ marginLeft: 4, fontFamily: "Arial", fontSize: 16, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{esp.lang("event/order_detail", "ticket")}</Text>
|
|
397
|
-
</View>
|
|
398
|
-
<UseCondition if={result?.show_ticket_status == 1 && result?.status == 1 || result?.status == 3 || result?.status == 6}>
|
|
399
|
-
<Text allowFontScaling={false} style={{ fontSize: 12, fontWeight: "normal", fontStyle: "normal", flexWrap: 'wrap', letterSpacing: 0, marginBottom: 12, color: "#484848" }}>
|
|
400
|
-
{
|
|
401
|
-
result?.qty_used == 0 ? esp.lang("event/order", "have_not_been_used")
|
|
402
|
-
:
|
|
403
|
-
result.kind_detail?.everyday_pass == 1 ?
|
|
404
|
-
"(" + result?.qty_used_today + " " + esp.lang("event/order_detail", "used_today") + ")"
|
|
405
|
-
:
|
|
406
|
-
"(" + result?.qty_used + " " + esp.lang("event/order_detail", "used") + ")"
|
|
407
|
-
}
|
|
408
|
-
</Text>
|
|
409
|
-
</UseCondition>
|
|
410
|
-
<View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
|
|
411
|
-
<LibIcon name="calendar-blank-outline" size={20} />
|
|
412
|
-
<Text allowFontScaling={false} style={{ marginLeft: 6, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{result?.ondate != "0000-00-00" ? moment(result?.ondate).localeFormat("DD MMMM YYYY") : ((isInvitationDate || isOnlineWithoutDate) ? esp.lang("event/order_item", "used_once") : dateRange)}</Text>
|
|
413
|
-
</View>
|
|
414
|
-
</View>
|
|
415
|
-
{
|
|
416
|
-
result?.status == "1" &&
|
|
417
|
-
<View style={{ marginTop: 14, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
|
|
418
|
-
{
|
|
419
|
-
result?.qr != "" &&
|
|
420
|
-
<TouchableOpacity onPress={() => {
|
|
421
|
-
result?.status == "1" && showQR?.current?.show()
|
|
422
|
-
}}>
|
|
423
|
-
<EventQr_bg>
|
|
424
|
-
<QRCode ecl="H" size={80} value={result?.qr} />
|
|
425
|
-
</EventQr_bg>
|
|
426
|
-
</TouchableOpacity>
|
|
427
|
-
}
|
|
428
|
-
</View>
|
|
429
|
-
}
|
|
430
|
-
</View>
|
|
431
|
-
|
|
432
|
-
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }} >
|
|
433
|
-
<View style={{ width: 19, height: 19, borderRadius: 9.5, backgroundColor: "#f6f6f6", marginLeft: -9.5 }} />
|
|
434
|
-
{/* <Text style={{ marginTop: 5, alignSelf: 'center', fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "center", color: "#f39c12" }} ></Text> */}
|
|
435
|
-
<View style={{ width: 19, height: 19, borderRadius: 9.5, backgroundColor: "#f6f6f6", marginRight: -9.5 }} />
|
|
436
|
-
</View>
|
|
437
302
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
</View>
|
|
441
|
-
{
|
|
442
|
-
result?.par_id > 0 ?
|
|
443
|
-
null
|
|
444
|
-
:
|
|
445
|
-
<EventButton onPress={() => {
|
|
446
|
-
LibNavigation.navigate('event/order_reschedule', { url: result?.url_reschedule })
|
|
447
|
-
}} label={result?.is_refundable == 1 ? esp.lang("event/order_detail", "refund_rescedule") : esp.lang("event/order_detail", "rescedule")} backgroundColor={LibStyle.colorGreen} style={{ marginLeft: 20, marginRight: 20, marginBottom: 10 }} />
|
|
448
|
-
}
|
|
449
|
-
</View>
|
|
450
|
-
</View>
|
|
451
|
-
)
|
|
303
|
+
if ((result?.status == 1 || (result?.qty == 0 && result?.qty_shared > 0)) && result?.is_reschedule == 1) {
|
|
304
|
+
return <EventOrder_detail_reschedule dataTicket={result} onPressQr={() => { showQR?.current?.show() }} />
|
|
452
305
|
}
|
|
453
306
|
|
|
454
|
-
let startEvent = result?.start_date + " " + result?.start_time
|
|
455
|
-
let dateNow = LibUtils.moment().localeFormat("YYYY-MM-DD HH:mm")
|
|
456
307
|
let valid = dataTicket?.some((item: any) => item.status == 1 && item.checked == 1);
|
|
457
308
|
|
|
458
309
|
return (
|
|
@@ -578,44 +429,7 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
578
429
|
</View>
|
|
579
430
|
{
|
|
580
431
|
result?.hasOwnProperty('url_addons_booked') && result?.url_addons_booked != "" &&
|
|
581
|
-
<
|
|
582
|
-
{
|
|
583
|
-
addonsBooked?.length > 0 && addonsBooked?.map((x: any, i: number) => {
|
|
584
|
-
return (
|
|
585
|
-
<View key={i} style={{ flexDirection: 'row', marginBottom: 10 }}>
|
|
586
|
-
<LibIcon name='check-decagram' size={20} color={LibStyle.colorGreen} />
|
|
587
|
-
<View style={{ marginLeft: 10 }}>
|
|
588
|
-
<Text allowFontScaling={false} style={{ color: '#484848', fontSize: 14, fontWeight: 'bold', fontFamily: "Arial" }}>
|
|
589
|
-
{x.price_name}
|
|
590
|
-
{x?.list?.length == 1 ? " (" + Number(x?.list?.[0]?.qty) + " Tiket)" : ""}
|
|
591
|
-
</Text>
|
|
592
|
-
{
|
|
593
|
-
x?.list?.length > 0 && x?.list?.map((z: any, i: number) => {
|
|
594
|
-
if (z?.ondate != "0000-00-00") {
|
|
595
|
-
return (
|
|
596
|
-
<Text key={i} allowFontScaling={false}>{LibUtils.moment(z.ondate).localeFormat('DD MMM YYYY') + " (" + Number(z.qty) + " Tiket)"}</Text>
|
|
597
|
-
)
|
|
598
|
-
} else {
|
|
599
|
-
return null
|
|
600
|
-
}
|
|
601
|
-
})
|
|
602
|
-
}
|
|
603
|
-
</View>
|
|
604
|
-
</View>
|
|
605
|
-
)
|
|
606
|
-
})
|
|
607
|
-
}
|
|
608
|
-
{
|
|
609
|
-
errorAddonsBooked &&
|
|
610
|
-
<EventMessage
|
|
611
|
-
message={errorAddonsBooked?.message}
|
|
612
|
-
children={<EventButton label='Segarkan' onPress={() => {
|
|
613
|
-
esp.log("dipencet");
|
|
614
|
-
loadData()
|
|
615
|
-
}} />}
|
|
616
|
-
/>
|
|
617
|
-
}
|
|
618
|
-
</View>
|
|
432
|
+
<EventOrder_detail_addons_booked addonsBooked={addonsBooked} errorAddonsBooked={errorAddonsBooked} onPress={loadData} />
|
|
619
433
|
}
|
|
620
434
|
</View>
|
|
621
435
|
|
|
@@ -703,157 +517,37 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
703
517
|
</View>
|
|
704
518
|
)
|
|
705
519
|
}} >
|
|
706
|
-
<
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
}, 100)
|
|
727
|
-
}}
|
|
728
|
-
icon={'chevron-down'}
|
|
729
|
-
title={item.title}
|
|
730
|
-
info={item.info}
|
|
731
|
-
/>
|
|
732
|
-
)
|
|
733
|
-
} else {
|
|
734
|
-
return (
|
|
735
|
-
<EventButton_order_detail
|
|
736
|
-
disable={item?.hasOwnProperty('status') && item.status == 0 ? true : false}
|
|
737
|
-
status_message={item?.status_message}
|
|
738
|
-
key={i}
|
|
739
|
-
color={result?.color}
|
|
740
|
-
onPress={() => {
|
|
741
|
-
if (item?.hasOwnProperty('status') && item?.status == 1) {
|
|
742
|
-
setGroupAddon(item)
|
|
743
|
-
setSelectedAddon(item?.list?.[0])
|
|
744
|
-
loadDataTicket(result?.id, item?.list?.[0]?.price_id, item?.list?.[0]?.ondate)
|
|
745
|
-
}
|
|
746
|
-
}}
|
|
747
|
-
icon={'plus-circle-outline'}
|
|
748
|
-
title={item.title}
|
|
749
|
-
info={item.info}
|
|
750
|
-
/>
|
|
751
|
-
)
|
|
752
|
-
}
|
|
753
|
-
})
|
|
754
|
-
}
|
|
755
|
-
</View>
|
|
756
|
-
)
|
|
757
|
-
}}
|
|
758
|
-
onError={(err) => {
|
|
759
|
-
return (
|
|
760
|
-
<EventMessage
|
|
761
|
-
message={err?.message}
|
|
762
|
-
/>
|
|
763
|
-
)
|
|
764
|
-
}}
|
|
765
|
-
/>
|
|
766
|
-
</View>
|
|
520
|
+
<EventOrder_detail_addons
|
|
521
|
+
dataTicket={result}
|
|
522
|
+
onPress={(item: any) => {
|
|
523
|
+
const isMultiple = item?.list?.length > 1
|
|
524
|
+
if (isMultiple) {
|
|
525
|
+
setGroupAddon(item)
|
|
526
|
+
LibUtils.debounce(() => {
|
|
527
|
+
dialogAddonList?.current?.show()
|
|
528
|
+
}, 100)
|
|
529
|
+
} else {
|
|
530
|
+
if (item?.status == 1) {
|
|
531
|
+
const addon = item?.list?.[0]
|
|
532
|
+
setGroupAddon(item)
|
|
533
|
+
setSelectedAddon(addon)
|
|
534
|
+
loadDataTicket(result?.id, addon?.price_id, addon?.ondate)
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
}}
|
|
539
|
+
/>
|
|
767
540
|
</LibCollaps>
|
|
768
541
|
}
|
|
769
542
|
|
|
770
|
-
{
|
|
771
|
-
|
|
772
|
-
// view_reviewed
|
|
773
|
-
dataReview?.status == 1 ?
|
|
774
|
-
<View style={{ margin: 15, marginBottom: 0, borderRadius: 7, backgroundColor: 'white', padding: 10 }}>
|
|
775
|
-
<View style={{ flexDirection: 'row', alignItems: 'flex-start', marginTop: 10 }}>
|
|
776
|
-
<LibPicture source={{ uri: user?.image }} style={{ height: 50, width: 50, borderRadius: 25 }} />
|
|
777
|
-
<View style={{ marginLeft: 10, flex: 1 }}>
|
|
778
|
-
<Text allowFontScaling={false} numberOfLines={1} ellipsizeMode='tail' style={{ fontSize: 16, fontWeight: 'bold' }}>{user?.name}</Text>
|
|
779
|
-
<Text allowFontScaling={false} style={{ fontSize: 12, color: '#c9c9c9' }}>{LibUtils.moment(dataReview?.review?.created).localeFormat("D MMM YYYY")}</Text>
|
|
780
|
-
<View style={{ marginTop: 5 }}>
|
|
781
|
-
<EventRating disabled onChangeRating={() => { }} defaultValue={dataReview?.review?.rating} size={18} containerStyle={{ padding: 0, justifyContent: 'flex-start' }} />
|
|
782
|
-
{
|
|
783
|
-
dataReview?.review?.content != "" &&
|
|
784
|
-
<Text allowFontScaling={false} style={{ marginTop: 10, fontSize: 12, color: '#000' }}>{dataReview?.review?.content.replace(/\\n/g, '\n')}</Text>
|
|
785
|
-
}
|
|
786
|
-
{
|
|
787
|
-
dataReview?.surveys?.length > 0 &&
|
|
788
|
-
getStringReview(dataReview?.surveys).map((sur) => (
|
|
789
|
-
<Text allowFontScaling={false} style={{ fontSize: 12, color: '#000' }}>{sur}</Text>
|
|
790
|
-
))
|
|
791
|
-
}
|
|
792
|
-
</View>
|
|
793
|
-
</View>
|
|
794
|
-
</View>
|
|
795
|
-
{
|
|
796
|
-
dataReview?.status == 2 &&
|
|
797
|
-
<View style={applyStyle({ borderColor: '#FC9722', backgroundColor: '#FDF1DE', borderWidth: 1, borderStyle: 'dashed', borderRadius: 5, padding: 5, marginTop: 15, marginBottom: 0 })} >
|
|
798
|
-
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 12, fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" })}>{esp.lang("event/order_detail", "thanks")}</Text>
|
|
799
|
-
</View>
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
</View>
|
|
803
|
-
:
|
|
804
|
-
dateNow > startEvent ?
|
|
805
|
-
<View style={{ margin: 15, marginBottom: 0, borderRadius: 7, backgroundColor: '#000', padding: 10 }}>
|
|
806
|
-
{
|
|
807
|
-
dataReview?.review == null ?
|
|
808
|
-
<Pressable>
|
|
809
|
-
<EventRating onChangeRating={(rate) => {
|
|
810
|
-
let type = EventReviewProperty.calculateProb(result?.config?.review)
|
|
811
|
-
let urlForm = "event_order_detail_review_form?id=" + result?.id + "&type=" + type?.type
|
|
812
|
-
let args = {
|
|
813
|
-
url_form: urlForm,
|
|
814
|
-
type: type?.type,
|
|
815
|
-
booking_id: result?.id,
|
|
816
|
-
rate: rate
|
|
817
|
-
}
|
|
818
|
-
if (result?.review_status != 1) {
|
|
819
|
-
LibNavigation.navigate('event/review_add', args)
|
|
820
|
-
}
|
|
821
|
-
}} defaultValue={5} size={50} containerStyle={{ padding: 0, backgroundColor: 'transparent' }} />
|
|
822
|
-
<Text allowFontScaling={false} style={{ alignSelf: 'center', marginTop: 15, fontSize: 18, fontWeight: 'bold', color: '#fff' }}>{esp.lang("event/order_detail", "leave_review")}</Text>
|
|
823
|
-
<Text allowFontScaling={false} style={{ alignSelf: 'center', marginTop: 7, fontSize: 14, color: '#fff' }}>{esp.lang("event/order_detail", "review_info")}</Text>
|
|
824
|
-
|
|
825
|
-
</Pressable>
|
|
826
|
-
:
|
|
827
|
-
// view_reviewed
|
|
828
|
-
<View style={{ margin: -10, backgroundColor: '#fff', padding: 10, borderRadius: 7 }}>
|
|
829
|
-
<View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
|
|
830
|
-
<LibPicture source={{ uri: user?.image }} style={{ height: 50, width: 50, borderRadius: 25 }} />
|
|
831
|
-
<View style={{ marginLeft: 10 }}>
|
|
832
|
-
<Text allowFontScaling={false} numberOfLines={1} ellipsizeMode='tail' style={{ fontSize: 16, fontWeight: 'bold' }}>{user?.name}</Text>
|
|
833
|
-
<Text allowFontScaling={false} style={{ fontSize: 12, color: '#c9c9c9' }}>{LibUtils.moment(dataReview?.review?.created).localeFormat("D MMM YYYY")}</Text>
|
|
834
|
-
<View style={{ marginTop: 5 }}>
|
|
835
|
-
<EventRating disabled onChangeRating={() => { }} defaultValue={dataReview?.review?.rating} size={18} containerStyle={{ padding: 0, backgroundColor: 'transparent' }} />
|
|
836
|
-
</View>
|
|
837
|
-
</View>
|
|
838
|
-
</View>
|
|
839
|
-
|
|
840
|
-
<Text allowFontScaling={false} numberOfLines={5} ellipsizeMode='tail' style={{ marginTop: 10, fontSize: 12, color: '#000' }}>{dataReview?.review?.content}</Text>
|
|
841
|
-
{
|
|
842
|
-
dataReview?.status == 2 &&
|
|
843
|
-
<View style={applyStyle({ borderColor: '#FC9722', backgroundColor: '#FDF1DE', borderWidth: 1, borderStyle: 'dashed', borderRadius: 5, padding: 5, marginTop: 15, marginBottom: 0 })} >
|
|
844
|
-
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 12, fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" })}>{esp.lang("event/order_detail", "thanks")}</Text>
|
|
845
|
-
</View>
|
|
846
|
-
}
|
|
847
|
-
</View>
|
|
848
|
-
}
|
|
849
|
-
</View>
|
|
850
|
-
: null
|
|
851
|
-
}
|
|
543
|
+
{/* review */}
|
|
544
|
+
<EventOrder_detail_review dataReview={dataReview} dataTicket={result} />
|
|
852
545
|
|
|
853
546
|
{/* view for coupon */}
|
|
854
547
|
{
|
|
855
548
|
result?.url_coupon != "" &&
|
|
856
549
|
<LibCollaps
|
|
550
|
+
show={Number(result?.show_voucher) == 0 ? false : true}
|
|
857
551
|
header={(show) =>
|
|
858
552
|
<View style={{ margin: 15, alignContent: 'center', alignItems: 'center', paddingHorizontal: 15, marginBottom: 0, borderRadius: 7, backgroundColor: '#fff', paddingBottom: 10, paddingTop: 10, flexDirection: 'row' }}>
|
|
859
553
|
<View style={{ flex: 1 }}>
|
|
@@ -863,49 +557,7 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
863
557
|
</View>
|
|
864
558
|
}
|
|
865
559
|
>
|
|
866
|
-
<
|
|
867
|
-
<LibCurl_view
|
|
868
|
-
url={result?.url_coupon}
|
|
869
|
-
onSuccess={(res, msg): any => {
|
|
870
|
-
return (
|
|
871
|
-
<View>
|
|
872
|
-
<Text style={{ margin: 15, marginBottom: 0, fontWeight: 'bold', fontSize: 14, color: "#495057" }}>{res?.title}</Text>
|
|
873
|
-
|
|
874
|
-
{
|
|
875
|
-
res?.list?.map((item: any, i: number) => {
|
|
876
|
-
return (
|
|
877
|
-
<TouchableOpacity key={i} onPress={() => {
|
|
878
|
-
if (item?.show_qr != 0) {
|
|
879
|
-
esp.modProp("event/coupon").getCouponDetail(item?.url_detail_coupon)
|
|
880
|
-
}
|
|
881
|
-
}} style={[{ marginBottom: 10, margin: 15, borderRadius: 15, backgroundColor: '#fff' }, LibStyle.elevation(2)]}>
|
|
882
|
-
<LibPicture source={{ uri: item.image }} resizeMode="cover" style={{ height: (LibStyle.width - 60) * 0.43, width: LibStyle.width - 60, borderRadius: 5 }} />
|
|
883
|
-
</TouchableOpacity>
|
|
884
|
-
)
|
|
885
|
-
})
|
|
886
|
-
}
|
|
887
|
-
{
|
|
888
|
-
res?.pages > 1 &&
|
|
889
|
-
<TouchableOpacity onPress={() => {
|
|
890
|
-
LibNavigation.navigate("event/coupon")
|
|
891
|
-
}}>
|
|
892
|
-
<View style={{ marginTop: 10, alignContent: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: LibStyle.colorPrimary, height: 50 }}>
|
|
893
|
-
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 16, fontWeight: "bold", textAlign: 'center', fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{esp.lang("event/order_detail", "see_all_coupon")}</Text>
|
|
894
|
-
</View>
|
|
895
|
-
</TouchableOpacity>
|
|
896
|
-
}
|
|
897
|
-
</View>
|
|
898
|
-
)
|
|
899
|
-
}}
|
|
900
|
-
onError={(err) => {
|
|
901
|
-
return (
|
|
902
|
-
<EventMessage
|
|
903
|
-
message={err?.message}
|
|
904
|
-
/>
|
|
905
|
-
)
|
|
906
|
-
}}
|
|
907
|
-
/>
|
|
908
|
-
</View>
|
|
560
|
+
<EventOrder_detail_coupon dataTicket={result} />
|
|
909
561
|
</LibCollaps>
|
|
910
562
|
}
|
|
911
563
|
|
|
@@ -923,77 +575,7 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
923
575
|
</View>
|
|
924
576
|
)
|
|
925
577
|
}}>
|
|
926
|
-
<
|
|
927
|
-
<LibCurl_view
|
|
928
|
-
url={result?.url_instructions}
|
|
929
|
-
onSuccess={(res, msg): any => {
|
|
930
|
-
urlsInstruction = []
|
|
931
|
-
res?.map?.((item: any) => {
|
|
932
|
-
let matches = item.match(/(https?:\/\/[^\s]+)/g);
|
|
933
|
-
if (matches) {
|
|
934
|
-
urlsInstruction.push(...matches)
|
|
935
|
-
}
|
|
936
|
-
})
|
|
937
|
-
return (
|
|
938
|
-
<View style={{ margin: 15 }}>
|
|
939
|
-
{
|
|
940
|
-
res?.map((item: any, i: number) => {
|
|
941
|
-
const urls = item.match(/(https?:\/\/[^\s]+)/g)
|
|
942
|
-
const text = item.replace(urls?.[0], '~:::~')
|
|
943
|
-
const texts = text.split('~:::~')
|
|
944
|
-
return (
|
|
945
|
-
<TouchableOpacity key={i + 1} onPress={() => {
|
|
946
|
-
if (item.match(/(https?:\/\/[^\s]+)/g)) {
|
|
947
|
-
Linking.openURL(urls[0])
|
|
948
|
-
}
|
|
949
|
-
}}>
|
|
950
|
-
<Text allowFontScaling={false} style={{ flexWrap: 'wrap', marginBottom: 5, fontSize: 14, fontWeight: "normal", fontStyle: "normal", lineHeight: 18, color: "#4a4a4a", marginTop: 4 }}>
|
|
951
|
-
{texts?.[0]}
|
|
952
|
-
{urls && <Text allowFontScaling={false} style={{ flexWrap: 'wrap', marginBottom: 5, fontSize: 14, fontWeight: "normal", fontStyle: "normal", lineHeight: 18, color: LibStyle.colorBlue, marginTop: 4 }}>{urls[0]}</Text>}
|
|
953
|
-
{texts?.[1]}
|
|
954
|
-
</Text>
|
|
955
|
-
</TouchableOpacity>
|
|
956
|
-
)
|
|
957
|
-
})
|
|
958
|
-
}
|
|
959
|
-
|
|
960
|
-
{
|
|
961
|
-
urlsInstruction?.length > 0 && urlsInstruction?.map((item: any, i: number) => {
|
|
962
|
-
return (
|
|
963
|
-
<View key={i + 1} style={{ padding: 10, marginTop: 10, flexDirection: 'row-reverse' }}>
|
|
964
|
-
<TouchableOpacity onPress={() => {
|
|
965
|
-
LibUtils.share(item)
|
|
966
|
-
}} style={{ ...LibStyle.elevation(5), alignContent: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: LibStyle.colorPrimary, height: 40, width: 40, borderRadius: 20, marginHorizontal: 10 }}>
|
|
967
|
-
<LibIcon color="#fff" name="share" />
|
|
968
|
-
</TouchableOpacity>
|
|
969
|
-
<TouchableOpacity onPress={() => {
|
|
970
|
-
LibUtils.copyToClipboard(item)
|
|
971
|
-
LibToastProperty.show(esp.lang("event/order_detail", "copied"))
|
|
972
|
-
}} style={{ ...LibStyle.elevation(5), alignContent: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: LibStyle.colorPrimary, height: 40, width: 40, borderRadius: 20, marginHorizontal: 10 }}>
|
|
973
|
-
<LibIcon color="#fff" name="content-copy" />
|
|
974
|
-
</TouchableOpacity>
|
|
975
|
-
<TouchableOpacity onPress={() => {
|
|
976
|
-
Linking.openURL(item)
|
|
977
|
-
}} style={{ ...LibStyle.elevation(5), alignContent: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: LibStyle.colorPrimary, height: 40, width: 40, borderRadius: 20, marginHorizontal: 10 }}>
|
|
978
|
-
<LibIcon.MaterialIcons color="#fff" name="open-in-browser" />
|
|
979
|
-
</TouchableOpacity>
|
|
980
|
-
</View>
|
|
981
|
-
)
|
|
982
|
-
})
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
</View>
|
|
986
|
-
)
|
|
987
|
-
}}
|
|
988
|
-
onError={(err) => {
|
|
989
|
-
return (
|
|
990
|
-
<EventMessage
|
|
991
|
-
message={err?.message}
|
|
992
|
-
/>
|
|
993
|
-
)
|
|
994
|
-
}}
|
|
995
|
-
/>
|
|
996
|
-
</View>
|
|
578
|
+
<EventOrder_detail_instruction dataTicket={result} />
|
|
997
579
|
</LibCollaps>
|
|
998
580
|
}
|
|
999
581
|
|
|
@@ -1010,51 +592,7 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
1010
592
|
</View>
|
|
1011
593
|
}
|
|
1012
594
|
>
|
|
1013
|
-
<
|
|
1014
|
-
<LibCurl_view
|
|
1015
|
-
url={result?.url_term}
|
|
1016
|
-
onSuccess={(res, msg): any => {
|
|
1017
|
-
esp.log(res);
|
|
1018
|
-
if (Array.isArray(res)) {
|
|
1019
|
-
return (
|
|
1020
|
-
<View>
|
|
1021
|
-
{res?.map(renderTermItem)}
|
|
1022
|
-
</View>
|
|
1023
|
-
)
|
|
1024
|
-
} else {
|
|
1025
|
-
return (
|
|
1026
|
-
<View>
|
|
1027
|
-
{
|
|
1028
|
-
Object.entries(res).map(([title, items]: any) => {
|
|
1029
|
-
return (
|
|
1030
|
-
<View key={title}>
|
|
1031
|
-
<LibCollaps header={(show) =>
|
|
1032
|
-
<View style={{ padding: 15, paddingRight: 25, paddingLeft: 20, paddingBottom: 10, borderBottomWidth: 1, borderColor: LibStyle.colorBgGrey, alignContent: 'center', alignItems: 'center', borderRadius: 7, backgroundColor: '#f9f9f9', flexDirection: 'row' }}>
|
|
1033
|
-
<View style={{ flex: 1 }}>
|
|
1034
|
-
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 1.5, color: "#495057" }}>{title}</Text>
|
|
1035
|
-
</View>
|
|
1036
|
-
<LibIcon name={!show ? "chevron-down" : "chevron-up"} color='#495057' />
|
|
1037
|
-
</View>
|
|
1038
|
-
}>
|
|
1039
|
-
{items.map(renderTermItem)}
|
|
1040
|
-
</LibCollaps>
|
|
1041
|
-
</View>
|
|
1042
|
-
)
|
|
1043
|
-
})
|
|
1044
|
-
}
|
|
1045
|
-
</View>
|
|
1046
|
-
)
|
|
1047
|
-
}
|
|
1048
|
-
}}
|
|
1049
|
-
onError={(err) => {
|
|
1050
|
-
return (
|
|
1051
|
-
<EventMessage
|
|
1052
|
-
message={err?.message}
|
|
1053
|
-
/>
|
|
1054
|
-
)
|
|
1055
|
-
}}
|
|
1056
|
-
/>
|
|
1057
|
-
</View>
|
|
595
|
+
<EventOrder_detail_tnc dataTicket={result} />
|
|
1058
596
|
</LibCollaps>
|
|
1059
597
|
}
|
|
1060
598
|
|
|
@@ -1265,54 +803,6 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
1265
803
|
</View>
|
|
1266
804
|
</LibSlidingup>
|
|
1267
805
|
|
|
1268
|
-
<LibSlidingup ref={dialogSendBack} >
|
|
1269
|
-
<View style={{ backgroundColor: 'white', borderTopLeftRadius: 20, borderTopRightRadius: 20, padding: 20 }} >
|
|
1270
|
-
<EventPopup email={result?.sharer_email?.trim?.()} redirect={() => {
|
|
1271
|
-
if (result?.use_seat == 1) {
|
|
1272
|
-
let data = {
|
|
1273
|
-
qty: qty
|
|
1274
|
-
}
|
|
1275
|
-
LibNavigation.navigate('event/seat', {
|
|
1276
|
-
url: result?.url_ticket,
|
|
1277
|
-
dataTicket: data,
|
|
1278
|
-
returnTicket: true,
|
|
1279
|
-
})
|
|
1280
|
-
} else {
|
|
1281
|
-
LibNavigation.navigateForResult("bigbang/payment_pin", undefined, 1132).then((p) => {
|
|
1282
|
-
if (p) {
|
|
1283
|
-
sendBack(p)
|
|
1284
|
-
}
|
|
1285
|
-
})
|
|
1286
|
-
}
|
|
1287
|
-
dialogSendBack.current!.hide()
|
|
1288
|
-
}} cancel={() => {
|
|
1289
|
-
dialogSendBack.current!.hide()
|
|
1290
|
-
}}
|
|
1291
|
-
view={
|
|
1292
|
-
<View style={{ flexDirection: 'row', alignItems: 'center', marginVertical: 20 }} >
|
|
1293
|
-
<TouchableOpacity
|
|
1294
|
-
onPress={() => {
|
|
1295
|
-
min()
|
|
1296
|
-
}}
|
|
1297
|
-
style={{ height: 70, width: 70, borderRadius: 10, backgroundColor: '#f1f1f1', alignItems: 'center', justifyContent: 'center' }} >
|
|
1298
|
-
<LibIcon name='minus' color={LibStyle.colorRed} size={50} />
|
|
1299
|
-
</TouchableOpacity>
|
|
1300
|
-
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }} >
|
|
1301
|
-
<Text style={{ fontSize: 50 }} >{qty}</Text>
|
|
1302
|
-
</View>
|
|
1303
|
-
<TouchableOpacity
|
|
1304
|
-
onPress={() => {
|
|
1305
|
-
add(Number(result.qty_returnable))
|
|
1306
|
-
}}
|
|
1307
|
-
style={{ height: 70, width: 70, borderRadius: 10, backgroundColor: '#f1f1f1', alignItems: 'center', justifyContent: 'center' }} >
|
|
1308
|
-
<LibIcon name='plus' color={LibStyle.colorGreen} size={50} />
|
|
1309
|
-
</TouchableOpacity>
|
|
1310
|
-
</View>
|
|
1311
|
-
}
|
|
1312
|
-
/>
|
|
1313
|
-
</View>
|
|
1314
|
-
</LibSlidingup>
|
|
1315
|
-
|
|
1316
806
|
</View >
|
|
1317
807
|
)
|
|
1318
808
|
}
|