esoftplay-event 0.0.2 → 0.0.3
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/additional.tsx +1 -1
- package/event/additional_input.tsx +15 -0
- package/event/additional_new.tsx +565 -0
- package/event/artist.tsx +14 -34
- package/event/artist_detail.tsx +336 -239
- package/event/artist_detail_multi.tsx +266 -157
- package/event/artist_detailv2.tsx +129 -69
- package/event/artistv2.tsx +5 -13
- package/event/button.tsx +2 -2
- package/event/button_order_detail.tsx +20 -8
- package/event/capture.tsx +2 -0
- package/event/checkout.ts +135 -0
- package/event/countdown.tsx +13 -9
- package/event/countdown_base.tsx +88 -48
- package/event/countdown_event.tsx +3 -0
- package/event/countdown_timestamp.tsx +106 -0
- package/event/coupon.tsx +1 -1
- package/event/coupon_generate.tsx +35 -22
- package/event/detail.tsx +9 -15
- package/event/detail2.tsx +63 -61
- package/event/dialog_custom.tsx +67 -0
- package/event/exchange_ticket_list.tsx +23 -14
- package/event/exchange_ticket_result.tsx +1 -1
- package/event/firebase_socket.ts +14 -12
- package/event/htmltext.tsx +40 -28
- package/event/index.tsx +8 -2
- package/event/label_input.tsx +2 -2
- package/event/layout.tsx +312 -0
- package/event/loading_page.tsx +62 -82
- package/event/message.tsx +2 -2
- package/event/order_detail.tsx +408 -477
- 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 +231 -0
- package/event/order_detail_review.tsx +174 -0
- package/event/order_detail_share.tsx +304 -0
- package/event/order_detail_tnc.tsx +76 -0
- package/event/order_detail_upgrade.tsx +140 -90
- package/event/order_detail_upgrade_payment.tsx +120 -38
- package/event/order_detail_visitor.tsx +21 -10
- package/event/order_detail_waiting.tsx +3 -3
- package/event/order_history.tsx +1 -1
- package/event/order_item.tsx +1 -1
- package/event/order_lottery.tsx +1 -1
- package/event/order_reschedule.tsx +29 -16
- package/event/order_share_to.tsx +14 -0
- package/event/order_waiting.tsx +1 -1
- package/event/payment_subscribe.tsx +18 -0
- package/event/point_events.tsx +35 -0
- package/event/point_redemption.tsx +101 -0
- package/event/point_redemption_exchange.tsx +60 -0
- package/event/point_redemption_input.tsx +56 -0
- package/event/point_redemption_success.tsx +50 -0
- package/event/point_summary.tsx +48 -0
- package/event/popup.tsx +4 -4
- package/event/queue.tsx +111 -0
- package/event/queue_pricing.tsx +17 -6
- package/event/review_add.tsx +2 -2
- package/event/scan_item.tsx +1 -1
- package/event/schedule.tsx +33 -30
- package/event/schedule2.tsx +86 -0
- package/event/seat.tsx +135 -374
- package/event/seat_map.tsx +8 -8
- package/event/seat_map_new.tsx +211 -38
- package/event/step.tsx +1 -1
- package/event/test.tsx +8 -8
- package/event/ticket.tsx +326 -0
- package/event/ticket_list.tsx +316 -258
- package/event/ticket_list2.tsx +349 -224
- package/event/ticket_list_item.tsx +61 -0
- package/event/ticket_list_new.tsx +710 -0
- package/event/tms_add_result.tsx +10 -5
- package/event/tms_check_ticket_result.tsx +16 -7
- package/event/tms_dashboard.tsx +87 -12
- package/event/tms_gate.tsx +32 -15
- package/event/tms_home.tsx +178 -92
- package/event/tms_idcard.tsx +43 -26
- package/event/tms_in.tsx +2 -3
- package/event/tms_in_failed.tsx +1 -1
- package/event/tms_in_hall.tsx +4 -1
- package/event/tms_in_hall_failed.tsx +36 -16
- package/event/tms_in_log.tsx +9 -11
- package/event/tms_in_success.tsx +13 -8
- package/event/tms_log.tsx +16 -17
- package/event/tms_out_hall_failed.tsx +1 -1
- package/event/tms_out_temporary.tsx +3 -4
- package/event/token_order.tsx +103 -0
- package/event/token_payment.tsx +79 -0
- package/event/visitor_index.tsx +60 -49
- package/event/visitor_input.tsx +336 -54
- package/event/visitor_inputv2.tsx +173 -88
- package/event/voucher.tsx +1 -1
- package/id.json +76 -4
- package/package.json +1 -1
- package/event/secure_page.debug.tsx +0 -34
- package/event/secure_page.live.tsx +0 -35
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
import { EventButton_order_detail } from 'esoftplay/cache/event/button_order_detail/import';
|
|
3
|
+
import { EventMessage } from 'esoftplay/cache/event/message/import';
|
|
4
|
+
import { LibCurl_view } from 'esoftplay/cache/lib/curl_view/import';
|
|
5
|
+
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { View } from 'react-native';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export interface EventOrder_detail_addonsArgs {
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
export interface EventOrder_detail_addonsProps {
|
|
14
|
+
dataTicket: any,
|
|
15
|
+
onPress: (item: any) => void
|
|
16
|
+
}
|
|
17
|
+
export default function m(props: EventOrder_detail_addonsProps): any {
|
|
18
|
+
let result = props.dataTicket
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<View style={{ backgroundColor: '#fff', marginTop: 1, borderRadius: 7, paddingBottom: 10, overflow: 'hidden', marginHorizontal: 15, marginBottom: 0 }}>
|
|
22
|
+
<LibCurl_view
|
|
23
|
+
url={result?.url_addons}
|
|
24
|
+
onSuccess={(res, msg): any => {
|
|
25
|
+
return (
|
|
26
|
+
<View>
|
|
27
|
+
{
|
|
28
|
+
res?.length > 0 && res?.map((item: any, i: number) => {
|
|
29
|
+
const isMultiple = item?.list?.length > 1
|
|
30
|
+
const isDisabled = item?.hasOwnProperty('status') && item.status == 0
|
|
31
|
+
const icon = isMultiple ? 'chevron-down' : 'plus-circle-outline'
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<EventButton_order_detail
|
|
35
|
+
key={i}
|
|
36
|
+
disable={isDisabled}
|
|
37
|
+
status_message={item?.status_message}
|
|
38
|
+
color={result?.color}
|
|
39
|
+
onPress={() => { props.onPress(item) }}
|
|
40
|
+
icon={icon}
|
|
41
|
+
title={item.title}
|
|
42
|
+
info={item.info}
|
|
43
|
+
/>
|
|
44
|
+
)
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
</View>
|
|
48
|
+
)
|
|
49
|
+
}}
|
|
50
|
+
onError={(err) => {
|
|
51
|
+
return (
|
|
52
|
+
<EventMessage
|
|
53
|
+
message={err?.message}
|
|
54
|
+
/>
|
|
55
|
+
)
|
|
56
|
+
}}
|
|
57
|
+
/>
|
|
58
|
+
</View>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
import { EventMessage } from 'esoftplay/cache/event/message/import';
|
|
3
|
+
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
4
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
5
|
+
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
6
|
+
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { Text, TouchableOpacity, View } from 'react-native';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
export interface EventOrder_detail_addons_bookedArgs {
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
export interface EventOrder_detail_addons_bookedProps {
|
|
15
|
+
addonsBooked: any
|
|
16
|
+
errorAddonsBooked: any
|
|
17
|
+
onPress: () => void
|
|
18
|
+
}
|
|
19
|
+
export default function m(props: EventOrder_detail_addons_bookedProps): any {
|
|
20
|
+
return (
|
|
21
|
+
<View style={{ padding: 10, paddingLeft: 15, paddingBottom: 0 }}>
|
|
22
|
+
{
|
|
23
|
+
props?.addonsBooked?.length > 0 && props?.addonsBooked?.map((x: any, i: number) => {
|
|
24
|
+
return (
|
|
25
|
+
<View key={i} style={{ flexDirection: 'row', marginBottom: 10 }}>
|
|
26
|
+
<LibIcon name='check-decagram' size={20} color={LibStyle.colorGreen} />
|
|
27
|
+
<View style={{ marginLeft: 10 }}>
|
|
28
|
+
<Text allowFontScaling={false} style={{ color: '#484848', fontSize: 14, fontWeight: 'bold', fontFamily: "Arial" }}>
|
|
29
|
+
{x.price_name}
|
|
30
|
+
{x?.list?.length == 1 && x?.list?.[0]?.ondate == "0000-00-00" ? " (" + Number(x?.list?.[0]?.qty) + " Tiket)" : ""}
|
|
31
|
+
</Text>
|
|
32
|
+
{
|
|
33
|
+
x?.list?.length > 0 && x?.list?.map((z: any, i: number) => {
|
|
34
|
+
if (z?.ondate != "0000-00-00") {
|
|
35
|
+
return (
|
|
36
|
+
<Text key={i} allowFontScaling={false}>{LibUtils.moment(z.ondate).localeFormat('DD MMM YYYY') + " (" + Number(z.qty) + " Tiket)"}</Text>
|
|
37
|
+
)
|
|
38
|
+
} else {
|
|
39
|
+
return null
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
</View>
|
|
44
|
+
</View>
|
|
45
|
+
)
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
{
|
|
49
|
+
props?.errorAddonsBooked &&
|
|
50
|
+
<EventMessage
|
|
51
|
+
message={props?.errorAddonsBooked?.message}
|
|
52
|
+
children={
|
|
53
|
+
<TouchableOpacity onPress={() => { props.onPress() }} style={{ marginTop: -10 }}>
|
|
54
|
+
<LibIcon name='refresh-circle' size={40} color={LibStyle.colorBrown} />
|
|
55
|
+
</TouchableOpacity>
|
|
56
|
+
}
|
|
57
|
+
/>
|
|
58
|
+
}
|
|
59
|
+
</View>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
import { EventMessage } from 'esoftplay/cache/event/message/import';
|
|
3
|
+
import { LibCurl_view } from 'esoftplay/cache/lib/curl_view/import';
|
|
4
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
5
|
+
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
6
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
7
|
+
import esp from 'esoftplay/esp';
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { Text, TouchableOpacity, View } from 'react-native';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export interface EventOrder_detail_couponArgs {
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
export interface EventOrder_detail_couponProps {
|
|
17
|
+
dataTicket: any
|
|
18
|
+
}
|
|
19
|
+
export default function m(props: EventOrder_detail_couponProps): any {
|
|
20
|
+
let result = props.dataTicket
|
|
21
|
+
return (
|
|
22
|
+
<View style={{ backgroundColor: '#fff', marginTop: 1, borderRadius: 7, overflow: 'hidden', marginHorizontal: 15, marginBottom: 0 }}>
|
|
23
|
+
<LibCurl_view
|
|
24
|
+
url={result?.url_coupon}
|
|
25
|
+
onSuccess={(res, msg): any => {
|
|
26
|
+
return (
|
|
27
|
+
<View>
|
|
28
|
+
<Text style={{ margin: 15, marginBottom: 0, fontWeight: 'bold', fontSize: 14, color: "#495057" }}>{res?.title}</Text>
|
|
29
|
+
|
|
30
|
+
{
|
|
31
|
+
res?.list?.map((item: any, i: number) => {
|
|
32
|
+
return (
|
|
33
|
+
<TouchableOpacity key={i} onPress={() => {
|
|
34
|
+
if (item?.show_qr != 0) {
|
|
35
|
+
esp.modProp("event/coupon").getCouponDetail(item?.url_detail_coupon)
|
|
36
|
+
}
|
|
37
|
+
}} style={[{ marginBottom: 10, margin: 15, borderRadius: 15, backgroundColor: '#fff' }, LibStyle.elevation(2)]}>
|
|
38
|
+
<LibPicture source={{ uri: item.image }} resizeMode="cover" style={{ height: (LibStyle.width - 60) * 0.43, width: LibStyle.width - 60, borderRadius: 5 }} />
|
|
39
|
+
</TouchableOpacity>
|
|
40
|
+
)
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
{
|
|
44
|
+
res?.pages > 1 &&
|
|
45
|
+
<TouchableOpacity onPress={() => {
|
|
46
|
+
LibNavigation.navigate("event/coupon")
|
|
47
|
+
}}>
|
|
48
|
+
<View style={{ marginTop: 10, alignContent: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: LibStyle.colorPrimary, height: 50 }}>
|
|
49
|
+
<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>
|
|
50
|
+
</View>
|
|
51
|
+
</TouchableOpacity>
|
|
52
|
+
}
|
|
53
|
+
</View>
|
|
54
|
+
)
|
|
55
|
+
}}
|
|
56
|
+
onError={(err) => {
|
|
57
|
+
return (
|
|
58
|
+
<EventMessage
|
|
59
|
+
message={err?.message}
|
|
60
|
+
/>
|
|
61
|
+
)
|
|
62
|
+
}}
|
|
63
|
+
/>
|
|
64
|
+
</View>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
import { EventMessage } from 'esoftplay/cache/event/message/import';
|
|
3
|
+
import { LibCurl_view } from 'esoftplay/cache/lib/curl_view/import';
|
|
4
|
+
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
5
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
6
|
+
import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
|
|
7
|
+
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
8
|
+
import esp from 'esoftplay/esp';
|
|
9
|
+
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { Linking, Text, TouchableOpacity, View } from 'react-native';
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
export interface EventOrder_detail_instructionArgs {
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
export interface EventOrder_detail_instructionProps {
|
|
18
|
+
dataTicket: any
|
|
19
|
+
}
|
|
20
|
+
export default function m(props: EventOrder_detail_instructionProps): any {
|
|
21
|
+
let urlsInstruction: any[] = []
|
|
22
|
+
let result = props?.dataTicket
|
|
23
|
+
return (
|
|
24
|
+
<View style={{ backgroundColor: '#fff', marginTop: 1, borderRadius: 7, overflow: 'hidden', marginHorizontal: 15, marginBottom: 0 }}>
|
|
25
|
+
<LibCurl_view
|
|
26
|
+
url={result?.url_instructions}
|
|
27
|
+
onSuccess={(res, msg): any => {
|
|
28
|
+
urlsInstruction = []
|
|
29
|
+
res?.map?.((item: any) => {
|
|
30
|
+
let matches = item.match(/(https?:\/\/[^\s]+)/g);
|
|
31
|
+
if (matches) {
|
|
32
|
+
urlsInstruction.push(...matches)
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
return (
|
|
36
|
+
<View style={{ margin: 15 }}>
|
|
37
|
+
{
|
|
38
|
+
res?.map((item: any, i: number) => {
|
|
39
|
+
const urls = item.match(/(https?:\/\/[^\s]+)/g)
|
|
40
|
+
const text = item.replace(urls?.[0], '~:::~')
|
|
41
|
+
const texts = text.split('~:::~')
|
|
42
|
+
return (
|
|
43
|
+
<TouchableOpacity key={i + 1} onPress={() => {
|
|
44
|
+
if (item.match(/(https?:\/\/[^\s]+)/g)) {
|
|
45
|
+
Linking.openURL(urls[0])
|
|
46
|
+
}
|
|
47
|
+
}}>
|
|
48
|
+
<Text allowFontScaling={false} style={{ flexWrap: 'wrap', marginBottom: 5, fontSize: 14, fontWeight: "normal", fontStyle: "normal", lineHeight: 18, color: "#4a4a4a", marginTop: 4 }}>
|
|
49
|
+
{texts?.[0]}
|
|
50
|
+
{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>}
|
|
51
|
+
{texts?.[1]}
|
|
52
|
+
</Text>
|
|
53
|
+
</TouchableOpacity>
|
|
54
|
+
)
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
{
|
|
59
|
+
urlsInstruction?.length > 0 && urlsInstruction?.map((item: any, i: number) => {
|
|
60
|
+
return (
|
|
61
|
+
<View key={i + 1} style={{ padding: 10, marginTop: 10, flexDirection: 'row-reverse' }}>
|
|
62
|
+
<TouchableOpacity onPress={() => {
|
|
63
|
+
LibUtils.share(item)
|
|
64
|
+
}} style={{ ...LibStyle.elevation(5), alignContent: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: LibStyle.colorPrimary, height: 40, width: 40, borderRadius: 20, marginHorizontal: 10 }}>
|
|
65
|
+
<LibIcon color="#fff" name="share" />
|
|
66
|
+
</TouchableOpacity>
|
|
67
|
+
<TouchableOpacity onPress={() => {
|
|
68
|
+
LibUtils.copyToClipboard(item)
|
|
69
|
+
LibToastProperty.show(esp.lang("event/order_detail", "copied"))
|
|
70
|
+
}} style={{ ...LibStyle.elevation(5), alignContent: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: LibStyle.colorPrimary, height: 40, width: 40, borderRadius: 20, marginHorizontal: 10 }}>
|
|
71
|
+
<LibIcon color="#fff" name="content-copy" />
|
|
72
|
+
</TouchableOpacity>
|
|
73
|
+
<TouchableOpacity onPress={() => {
|
|
74
|
+
Linking.openURL(item)
|
|
75
|
+
}} style={{ ...LibStyle.elevation(5), alignContent: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: LibStyle.colorPrimary, height: 40, width: 40, borderRadius: 20, marginHorizontal: 10 }}>
|
|
76
|
+
<LibIcon.MaterialIcons color="#fff" name="open-in-browser" />
|
|
77
|
+
</TouchableOpacity>
|
|
78
|
+
</View>
|
|
79
|
+
)
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
</View>
|
|
84
|
+
)
|
|
85
|
+
}}
|
|
86
|
+
onError={(err) => {
|
|
87
|
+
return (
|
|
88
|
+
<EventMessage
|
|
89
|
+
message={err?.message}
|
|
90
|
+
/>
|
|
91
|
+
)
|
|
92
|
+
}}
|
|
93
|
+
/>
|
|
94
|
+
</View>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
@@ -48,7 +48,7 @@ export default function m(props: EventOrder_detail_paymentProps): any {
|
|
|
48
48
|
<Text allowFontScaling={false} style={{ fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "left", color: "#4a4a4a" }}>{esp.lang("event/order_detail_payment", "virtual_number_account")}</Text>
|
|
49
49
|
<View style={{ marginTop: 10, flexDirection: "row", alignItems: "center", }}>
|
|
50
50
|
<View style={{ flex: 1, backgroundColor: '#f1f2f3', borderRadius: 5, marginRight: 10, padding: 5 }} >
|
|
51
|
-
<Text allowFontScaling={false}
|
|
51
|
+
<Text allowFontScaling={false} adjustsFontSizeToFit numberOfLines={1} style={{ fontSize: 30, fontStyle: "normal", fontFamily: 'DecoNumbers', letterSpacing: 0, textAlign: "left", color: LibStyle.colorPrimaryDark }}>{va_no.toString()}</Text>
|
|
52
52
|
</View>
|
|
53
53
|
<TouchableOpacity onPress={() => {
|
|
54
54
|
LibUtils.copyToClipboard(va_no)
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
|
|
3
|
+
import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
4
|
+
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
5
|
+
import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
|
|
6
|
+
import { EventQr_bg } from 'esoftplay/cache/event/qr_bg/import';
|
|
7
|
+
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
8
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
9
|
+
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
10
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
11
|
+
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
12
|
+
import { UseCondition } from 'esoftplay/cache/use/condition/import';
|
|
13
|
+
import esp from 'esoftplay/esp';
|
|
14
|
+
import moment from 'esoftplay/moment';
|
|
15
|
+
import React from 'react';
|
|
16
|
+
import { Text, TouchableOpacity, View } from 'react-native';
|
|
17
|
+
import QRCode from 'react-native-qrcode-svg';
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export interface EventOrder_detail_rescheduleArgs {
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
export interface EventOrder_detail_rescheduleProps {
|
|
24
|
+
dataTicket: any
|
|
25
|
+
onPressQr: () => void
|
|
26
|
+
}
|
|
27
|
+
export default function m(props: EventOrder_detail_rescheduleProps): any {
|
|
28
|
+
let result = props.dataTicket
|
|
29
|
+
const imgWidth = LibStyle.width - 35
|
|
30
|
+
const imgHeight = imgWidth / 1920 * 1080
|
|
31
|
+
moment().locale?.('id')
|
|
32
|
+
|
|
33
|
+
const dateRange = LibUtils.getDateRange(result?.start_date, result?.end_date, " - ")
|
|
34
|
+
let isInvitationDate = result?.ondate == "0000-00-00" && result?.kind_detail?.use_code == 1
|
|
35
|
+
let isOnlineWithoutDate = result?.ondate == "0000-00-00" && result?.kind_detail?.everyday_pass == 0
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<View style={{ flex: 1, backgroundColor: '#f6f6f6' }}>
|
|
39
|
+
<EventHeader title={esp.lang("event/order_detail", "order_detail")} />
|
|
40
|
+
<View style={[{ margin: 18, borderTopLeftRadius: 7, borderTopRightRadius: 7, backgroundColor: '#fff', paddingBottom: 10 }, LibStyle.elevation(3)]}>
|
|
41
|
+
|
|
42
|
+
<TouchableOpacity onPress={() => {
|
|
43
|
+
LibNavigation.navigate('lib/gallery', { image: result?.image })
|
|
44
|
+
}}>
|
|
45
|
+
<LibPicture source={{ uri: result?.image }} style={{ borderTopLeftRadius: 7, borderTopRightRadius: 7, height: imgHeight, width: imgWidth }} resizeMode="cover" />
|
|
46
|
+
</TouchableOpacity>
|
|
47
|
+
<View style={{ flexDirection: 'row', margin: 14, marginTop: 4, justifyContent: 'space-between' }}>
|
|
48
|
+
<View style={{ marginTop: 14 }}>
|
|
49
|
+
<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>
|
|
50
|
+
<View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
|
|
51
|
+
<LibIcon name="ticket-outline" size={20} />
|
|
52
|
+
<Text allowFontScaling={false} style={{ marginLeft: 6, fontFamily: "Arial", fontSize: 30, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{result?.qty}</Text>
|
|
53
|
+
<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>
|
|
54
|
+
</View>
|
|
55
|
+
<UseCondition if={result?.show_ticket_status == 1 && result?.status == 1 || result?.status == 3 || result?.status == 6}>
|
|
56
|
+
<Text allowFontScaling={false} style={{ fontSize: 12, fontWeight: "normal", fontStyle: "normal", flexWrap: 'wrap', letterSpacing: 0, marginBottom: 12, color: "#484848" }}>
|
|
57
|
+
{
|
|
58
|
+
result?.qty_used == 0 ? esp.lang("event/order", "have_not_been_used")
|
|
59
|
+
:
|
|
60
|
+
result.kind_detail?.everyday_pass == 1 ?
|
|
61
|
+
"(" + result?.qty_used_today + " " + esp.lang("event/order_detail", "used_today") + ")"
|
|
62
|
+
:
|
|
63
|
+
"(" + result?.qty_used + " " + esp.lang("event/order_detail", "used") + ")"
|
|
64
|
+
}
|
|
65
|
+
</Text>
|
|
66
|
+
</UseCondition>
|
|
67
|
+
<View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
|
|
68
|
+
<LibIcon name="calendar-blank-outline" size={20} />
|
|
69
|
+
<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>
|
|
70
|
+
</View>
|
|
71
|
+
</View>
|
|
72
|
+
{
|
|
73
|
+
result?.status == "1" &&
|
|
74
|
+
<View style={{ marginTop: 14, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
|
|
75
|
+
{
|
|
76
|
+
result?.qr != "" &&
|
|
77
|
+
<TouchableOpacity onPress={() => {
|
|
78
|
+
result?.status == "1" && props.onPressQr()
|
|
79
|
+
}}>
|
|
80
|
+
<EventQr_bg>
|
|
81
|
+
<QRCode ecl="H" size={80} value={result?.qr} />
|
|
82
|
+
</EventQr_bg>
|
|
83
|
+
</TouchableOpacity>
|
|
84
|
+
}
|
|
85
|
+
</View>
|
|
86
|
+
}
|
|
87
|
+
</View>
|
|
88
|
+
|
|
89
|
+
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }} >
|
|
90
|
+
<View style={{ width: 19, height: 19, borderRadius: 9.5, backgroundColor: "#f6f6f6", marginLeft: -9.5 }} />
|
|
91
|
+
{/* <Text style={{ marginTop: 5, alignSelf: 'center', fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "center", color: "#f39c12" }} ></Text> */}
|
|
92
|
+
<View style={{ width: 19, height: 19, borderRadius: 9.5, backgroundColor: "#f6f6f6", marginRight: -9.5 }} />
|
|
93
|
+
</View>
|
|
94
|
+
|
|
95
|
+
<View style={{ margin: 14, flexDirection: 'row' }}>
|
|
96
|
+
<Text style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: LibStyle.colorRed }} >{result?.reschedule_notes}</Text>
|
|
97
|
+
</View>
|
|
98
|
+
{
|
|
99
|
+
result?.par_id > 0 ?
|
|
100
|
+
null
|
|
101
|
+
:
|
|
102
|
+
<EventButton onPress={() => {
|
|
103
|
+
LibNavigation.navigate('event/order_reschedule', { url: result?.url_reschedule })
|
|
104
|
+
}} 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 }} />
|
|
105
|
+
}
|
|
106
|
+
</View>
|
|
107
|
+
</View>
|
|
108
|
+
)
|
|
109
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
3
|
+
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
4
|
+
import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
|
|
5
|
+
import { EventOrder_detailProperty } from 'esoftplay/cache/event/order_detail/import';
|
|
6
|
+
import { EventTransaction } from 'esoftplay/cache/event/transaction/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 { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
17
|
+
import esp from 'esoftplay/esp';
|
|
18
|
+
import useSafeState from 'esoftplay/state';
|
|
19
|
+
import { useEffect } from 'react';
|
|
20
|
+
|
|
21
|
+
import React from 'react';
|
|
22
|
+
import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
export interface EventOrder_detail_returnArgs {
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
export interface EventOrder_detail_returnProps {
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
export default function m(props: EventOrder_detail_returnProps): any {
|
|
32
|
+
const { url } = LibNavigation.getArgsAll(props)
|
|
33
|
+
|
|
34
|
+
const [result, setResult] = useSafeState()
|
|
35
|
+
const [dataUser, setDataUser] = useSafeState()
|
|
36
|
+
const [dataTicket, setDataTicket] = useSafeState()
|
|
37
|
+
const [useAll, setUseAll] = useSafeState<boolean>(false)
|
|
38
|
+
const [trxId] = useSafeState(EventTransaction().getTrxId())
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
loadData()
|
|
42
|
+
}, [])
|
|
43
|
+
|
|
44
|
+
function loadData() {
|
|
45
|
+
new LibCurl(url, null, (res, msg) => {
|
|
46
|
+
setResult(res)
|
|
47
|
+
if (res?.sharer_email != "") {
|
|
48
|
+
loadDataUser(res?.sharer_email)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (res?.hasOwnProperty('url_share')) {
|
|
52
|
+
loadDataTicket(res?.url_share, res?.price_name)
|
|
53
|
+
}
|
|
54
|
+
}, (err) => {
|
|
55
|
+
LibDialog.warning("Oops", err?.message)
|
|
56
|
+
LibNavigation.back()
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function loadDataTicket(url: any, price_name: string) {
|
|
61
|
+
new LibCurl(url, null, (res) => {
|
|
62
|
+
let data = res?.length > 0 && res?.map((item: any, i: number) => {
|
|
63
|
+
return ({
|
|
64
|
+
...item,
|
|
65
|
+
checked: i == 0 ? 1 : 0,
|
|
66
|
+
price_name: price_name
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
// esp.log({ data });
|
|
70
|
+
setDataTicket(data)
|
|
71
|
+
}, (error) => {
|
|
72
|
+
LibDialog.warning(esp.lang("event/order_share_to", "load_error"), error?.message);
|
|
73
|
+
}, 1)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function loadDataUser(email: string) {
|
|
77
|
+
let post: any = {
|
|
78
|
+
email: email
|
|
79
|
+
}
|
|
80
|
+
new LibCurl("user_search", post, (res) => {
|
|
81
|
+
setDataUser(res)
|
|
82
|
+
|
|
83
|
+
}, (error) => {
|
|
84
|
+
LibDialog.warning(esp.lang("event/order_share_to", "load_error"), error?.message);
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function sendBack(p: any) {
|
|
89
|
+
LibDialog.confirm(esp.lang("event/order_detail", "warning"), esp.lang("event/order_detail", "return_this_ticket"), esp.lang("event/order_detail", "btn_yes"), () => {
|
|
90
|
+
let _bookingMemberId = dataTicket?.filter((item: any) => item.checked == 1).map((it: any) => it.id)
|
|
91
|
+
|
|
92
|
+
LibProgress.show(esp.lang("event/order_detail", "please_wait"))
|
|
93
|
+
let post = {
|
|
94
|
+
booking_member_id: _bookingMemberId.join('|'),
|
|
95
|
+
trx_id: trxId,
|
|
96
|
+
pin: p
|
|
97
|
+
}
|
|
98
|
+
new LibCurl('event_booking_shared_return?booking_id=' + result?.id + '&qty_shared=' + dataTicket?.filter((item: any) => item.checked == 1).length, post, (res: any, msg: any) => {
|
|
99
|
+
// LibNotify(res)
|
|
100
|
+
EventOrder_detailProperty.subscribe().trigger()
|
|
101
|
+
EventIndexProperty.reload.trigger() //reload data order
|
|
102
|
+
LibProgress.hide()
|
|
103
|
+
LibDialog.info(esp.lang("event/order_detail", "information"), msg)
|
|
104
|
+
LibNavigation.back()
|
|
105
|
+
}, (error: any) => {
|
|
106
|
+
LibProgress.hide()
|
|
107
|
+
LibDialog.warning(esp.lang("event/order_detail", "back_err"), error?.message);
|
|
108
|
+
LibNavigation.back()
|
|
109
|
+
}, 1)
|
|
110
|
+
}, esp.lang("event/order_detail", "btn_cancel"), () => { })
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
if (!result) {
|
|
115
|
+
return <LibLoading />
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
let checkNotUsed = dataTicket?.length > 0 && dataTicket?.filter((x: any) => x?.checked == 0)
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
<View style={{ flex: 1 }}>
|
|
122
|
+
<EventHeader title={esp.lang("event/order_detail_return", "send_back_ticket")} />
|
|
123
|
+
<ScrollView style={{ padding: 15 }}>
|
|
124
|
+
|
|
125
|
+
<Text allowFontScaling={false} style={{ color: '#4a4a4a', fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0 }}>{"Tiket akan dikembalikan kepada"}</Text>
|
|
126
|
+
<View style={{ marginVertical: 15, flexDirection: 'row' }}>
|
|
127
|
+
<LibPicture source={{ uri: dataUser?.image }} style={{ height: 40, width: 40, borderRadius: 20 }} />
|
|
128
|
+
<View style={{ marginLeft: 10 }}>
|
|
129
|
+
<Text style={{ fontFamily: "Arial", fontSize: 16, fontWeight: "bold", color: "#4a4a4a" }} >{dataUser?.name}</Text>
|
|
130
|
+
<Text style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", color: "#b7b7b7" }} >{dataUser?.email}</Text>
|
|
131
|
+
</View>
|
|
132
|
+
</View>
|
|
133
|
+
|
|
134
|
+
<Text allowFontScaling={false} style={{ marginBottom: 10, fontFamily: "Arial", fontSize: 16, fontWeight: "bold", fontStyle: "normal", letterSpacing: 1.5, color: "#000" }}>{"PILIH TIKET"}</Text>
|
|
135
|
+
|
|
136
|
+
{
|
|
137
|
+
dataTicket?.length > 0 && dataTicket?.map((item: any, i: number) => {
|
|
138
|
+
const [front, end] = item?.seat_name?.split("#") || ["", ""];
|
|
139
|
+
return (
|
|
140
|
+
<TouchableOpacity key={i} onPress={() => {
|
|
141
|
+
let a = LibObject.set(dataTicket, item.checked == 1 ? 0 : 1)(i, 'checked')
|
|
142
|
+
setDataTicket(a)
|
|
143
|
+
setUseAll(false)
|
|
144
|
+
|
|
145
|
+
}} style={{ padding: 10, marginBottom: 10, borderRadius: 4, borderColor: item?.checked == 1 ? LibStyle.colorGreen : '#f1f1f1', borderWidth: 1, flexDirection: 'row' }}>
|
|
146
|
+
<View style={{ flex: 5 }}>
|
|
147
|
+
<Text allowFontScaling={false} style={{ fontSize: 14, fontStyle: "normal", color: "#000", fontWeight: "bold", }}>{item?.price_name}</Text>
|
|
148
|
+
{/* seat */}
|
|
149
|
+
{
|
|
150
|
+
item?.seat_name != "" &&
|
|
151
|
+
<View style={{ marginVertical: 10 }}>
|
|
152
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, marginBottom: 5, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }}>{esp.lang("event/order_detail", "seat_number")}</Text>
|
|
153
|
+
|
|
154
|
+
<View style={{ marginLeft: 7, flexDirection: 'row' }}>
|
|
155
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: 5, paddingHorizontal: 5, backgroundColor: '#f1f1f1', borderRadius: 5, marginRight: 7 }}>
|
|
156
|
+
<Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 16, color: "#000" }}> {front}</Text>
|
|
157
|
+
<Text allowFontScaling={false} style={{ marginLeft: 3, fontWeight: 'bold', fontSize: 16, color: '#000', }}>{end}</Text>
|
|
158
|
+
</View>
|
|
159
|
+
</View>
|
|
160
|
+
</View>
|
|
161
|
+
}
|
|
162
|
+
{/* add ons */}
|
|
163
|
+
{
|
|
164
|
+
item?.addons?.length > 0 &&
|
|
165
|
+
<View style={{ marginBottom: 5 }}>
|
|
166
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }}>{"Addons"}</Text>
|
|
167
|
+
</View>
|
|
168
|
+
}
|
|
169
|
+
{
|
|
170
|
+
item?.addons?.length > 0 && item?.addons?.map((x: any, ii: number) => {
|
|
171
|
+
return (
|
|
172
|
+
<View key={ii} style={{ marginLeft: 7, flexDirection: 'row' }}>
|
|
173
|
+
<View style={{}}>
|
|
174
|
+
<Text allowFontScaling={false} style={{ color: '#484848', fontSize: 12, fontWeight: 'bold', fontFamily: "Arial" }}>- {
|
|
175
|
+
x?.list?.map((y: any) => y).join(', ')
|
|
176
|
+
}</Text>
|
|
177
|
+
{
|
|
178
|
+
x?.ondate != "0000-00-00" &&
|
|
179
|
+
<Text allowFontScaling={false} style={{ marginLeft: 7, marginBottom: 3, marginTop: 3, fontFamily: "Arial", fontSize: 12, fontStyle: "normal", letterSpacing: 0, color: '#484848' }}>{
|
|
180
|
+
LibUtils.moment(x?.ondate).localeFormat('DD MMM YYYY')}</Text>
|
|
181
|
+
}
|
|
182
|
+
</View>
|
|
183
|
+
</View>
|
|
184
|
+
)
|
|
185
|
+
})
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
</View>
|
|
190
|
+
<View style={{ flex: 1, alignContent: 'flex-end', alignItems: 'flex-end' }}>
|
|
191
|
+
<LibIcon name={item?.checked == 1 ? 'check-circle' : 'radiobox-blank'} color={LibStyle.colorGreen} />
|
|
192
|
+
</View>
|
|
193
|
+
</TouchableOpacity>
|
|
194
|
+
)
|
|
195
|
+
})
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
</ScrollView>
|
|
199
|
+
|
|
200
|
+
<View style={{ marginHorizontal: 15, flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'space-between' }}>
|
|
201
|
+
<Text allowFontScaling={false} numberOfLines={2} ellipsizeMode={'tail'} style={{ fontWeight: 'bold', fontSize: 14, letterSpacing: 1 }}>{dataTicket?.filter((item: any) => item.checked == 1).length + " Tiket digunakan"}</Text>
|
|
202
|
+
<TouchableOpacity onPress={() => {
|
|
203
|
+
let a = dataTicket?.map((item: any, i: number) => {
|
|
204
|
+
return { ...item, checked: useAll ? 0 : 1 }
|
|
205
|
+
})
|
|
206
|
+
setDataTicket(a)
|
|
207
|
+
setUseAll(useAll ? false : true)
|
|
208
|
+
}} style={{ paddingHorizontal: 15, paddingRight: 10, marginTop: 10, borderWidth: 1, borderColor: 'rgba(0, 0, 0, 0)', height: 25, borderRadius: 5, backgroundColor: (useAll || checkNotUsed?.length == 0) ? LibStyle.colorRed : LibStyle.colorGreen, flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center' }} >
|
|
209
|
+
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: '#fff', marginRight: 15 }} >{(useAll || checkNotUsed?.length == 0) ? esp.lang("event/order_detail_share", "cancel") : esp.lang("event/order_detail_share", "select_all")}</Text>
|
|
210
|
+
<LibIcon.Ionicons size={18} color="#fff" name={(useAll || checkNotUsed?.length == 0) ? "close" : "checkmark-done"} />
|
|
211
|
+
</TouchableOpacity>
|
|
212
|
+
</View>
|
|
213
|
+
|
|
214
|
+
<EventButton
|
|
215
|
+
label={"Kembalikan tiket"}
|
|
216
|
+
onPress={() => {
|
|
217
|
+
LibNavigation.navigateForResult("bigbang/payment_pin", undefined, 1132).then((p) => {
|
|
218
|
+
if (p) {
|
|
219
|
+
sendBack(p)
|
|
220
|
+
}
|
|
221
|
+
})
|
|
222
|
+
}}
|
|
223
|
+
backgroundColor={"#fff"}
|
|
224
|
+
borderColor={LibStyle.colorPrimary}
|
|
225
|
+
fontColor={LibStyle.colorPrimary}
|
|
226
|
+
style={{ borderRadius: 5, marginHorizontal: 15, margin: 10 }}
|
|
227
|
+
/>
|
|
228
|
+
|
|
229
|
+
</View>
|
|
230
|
+
)
|
|
231
|
+
}
|