esoftplay-event 0.0.2-v → 0.0.2-x
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_new.tsx +565 -0
- package/event/artist.tsx +7 -6
- package/event/artist_detail.tsx +5 -3
- package/event/artist_detailv2.tsx +129 -69
- package/event/artistv2.tsx +2 -11
- package/event/capture.tsx +2 -0
- package/event/countdown.tsx +10 -6
- package/event/detail.tsx +10 -13
- package/event/detail2.tsx +63 -61
- package/event/loading_page.tsx +62 -82
- package/event/order_detail.tsx +13 -6
- package/event/order_detail_upgrade_payment.tsx +3 -2
- package/event/order_reschedule.tsx +28 -15
- 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/schedule.tsx +1 -1
- package/event/schedule2.tsx +86 -0
- package/event/seat_map_new.tsx +4 -4
- package/event/ticket_list2.tsx +13 -3
- package/event/ticket_list_item.tsx +61 -0
- package/event/ticket_list_new.tsx +710 -0
- package/event/tms_dashboard.tsx +62 -25
- package/event/tms_gate.tsx +7 -13
- package/event/tms_home.tsx +4 -4
- package/id.json +6 -1
- package/package.json +1 -1
package/event/detail2.tsx
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
// withHooks
|
|
2
2
|
import { applyStyle } from 'esoftplay';
|
|
3
|
-
import {
|
|
3
|
+
import { EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
|
|
4
4
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
5
|
-
import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
|
|
6
5
|
import { EventSlider } from 'esoftplay/cache/event/slider/import';
|
|
7
6
|
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
8
7
|
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
9
8
|
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
10
9
|
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
11
|
-
import { LibProgress } from 'esoftplay/cache/lib/progress/import';
|
|
12
10
|
import { LibScroll } from 'esoftplay/cache/lib/scroll/import';
|
|
13
11
|
import { LibSkeleton } from 'esoftplay/cache/lib/skeleton/import';
|
|
14
12
|
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
@@ -17,11 +15,12 @@ import { LibVideoProperty } from 'esoftplay/cache/lib/video/import';
|
|
|
17
15
|
import { LibWebview } from 'esoftplay/cache/lib/webview/import';
|
|
18
16
|
import { UseCondition } from 'esoftplay/cache/use/condition/import';
|
|
19
17
|
import { UseDeeplinkProperty } from 'esoftplay/cache/use/deeplink/import';
|
|
20
|
-
import { UserClass } from 'esoftplay/cache/user/class/import';
|
|
21
18
|
import esp from 'esoftplay/esp';
|
|
22
19
|
import useSafeState from 'esoftplay/state';
|
|
23
20
|
import { useEffect } from 'react';
|
|
24
21
|
|
|
22
|
+
import useGlobalState, { useGlobalReturn } from 'esoftplay/global';
|
|
23
|
+
import moment from 'esoftplay/moment';
|
|
25
24
|
import React from 'react';
|
|
26
25
|
import { Linking, Pressable, Text, TouchableOpacity, View } from 'react-native';
|
|
27
26
|
import MapView, { Marker } from 'react-native-maps';
|
|
@@ -33,53 +32,76 @@ export interface EventDetail2Args {
|
|
|
33
32
|
export interface EventDetail2Props {
|
|
34
33
|
|
|
35
34
|
}
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
|
|
36
|
+
const stateFeePlatform = useGlobalState({})
|
|
37
|
+
// {
|
|
38
|
+
// fee_platform_amount
|
|
39
|
+
// fee_platform_type
|
|
40
|
+
// show_fee_percentage
|
|
41
|
+
// }
|
|
42
|
+
export function stateSetFeePlatform(): useGlobalReturn<any> {
|
|
43
|
+
return stateFeePlatform
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const stateSubscribe = useGlobalState({})
|
|
47
|
+
// {
|
|
48
|
+
// is_subscribed
|
|
49
|
+
// is_subscribed_default
|
|
50
|
+
// is_subscribed_label
|
|
51
|
+
// }
|
|
52
|
+
export function stateSetSubscribe(): useGlobalReturn<any> {
|
|
53
|
+
return stateSubscribe
|
|
54
|
+
}
|
|
38
55
|
|
|
39
56
|
|
|
40
|
-
|
|
57
|
+
export default function m(props: EventDetail2Props): any {
|
|
58
|
+
const [result, setResult] = useSafeState<any>(undefined)
|
|
59
|
+
const url = LibNavigation.getArgs(props, 'url')
|
|
41
60
|
const [deeplinkParams] = UseDeeplinkProperty.params.useState()
|
|
42
|
-
const [result, setResult] = useSafeState()
|
|
43
61
|
const [priority, setPriority] = useSafeState(false)
|
|
44
|
-
const user = UserClass.state().get()
|
|
45
62
|
|
|
46
63
|
useEffect(() => {
|
|
47
64
|
loadData()
|
|
48
65
|
}, [])
|
|
49
66
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
setResult(res)
|
|
54
|
-
esp.log(res);
|
|
55
|
-
}, (error) => {
|
|
56
|
-
LibDialog.warning(esp.lang("event/detail", "load_failed"), error?.message)
|
|
57
|
-
LibNavigation.back()
|
|
58
|
-
})
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function loadDataConfig(url: string) {
|
|
62
|
-
LibProgress.show("Mohon tunggu")
|
|
67
|
+
moment().locale('id')
|
|
68
|
+
function loadData(): void {
|
|
69
|
+
// CacheHit.doHit(url)
|
|
63
70
|
new LibCurl(url, null, (res, msg) => {
|
|
64
|
-
esp.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
:
|
|
71
|
-
|
|
72
|
-
{
|
|
73
|
-
url: res.url_price,
|
|
74
|
-
is_multiprice: res?.multiprice == 1 ? 1 : 0,
|
|
71
|
+
esp.modProp("event/countdown").eventURI.set(url)
|
|
72
|
+
EventFirebase_socketProperty.eventIdQueue.set(res.id)
|
|
73
|
+
setResult(res)
|
|
74
|
+
if (res.allotment) {
|
|
75
|
+
esp.modProp("event/firebase_socket").userIdKeyReplacer.set({
|
|
76
|
+
t: Number(res.allotment.t),
|
|
77
|
+
s: Number(res.allotment.s),
|
|
78
|
+
priority: 1
|
|
75
79
|
})
|
|
80
|
+
setPriority(true)
|
|
81
|
+
} else {
|
|
82
|
+
setPriority(false)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
let fee_platform: any = {
|
|
86
|
+
fee_platform_amount: res?.fee_platform_amount,
|
|
87
|
+
fee_platform_type: res?.fee_platform_type,
|
|
88
|
+
show_fee_percentage: res?.config?.show_fee_percentage,
|
|
89
|
+
}
|
|
90
|
+
stateFeePlatform.set(fee_platform)
|
|
76
91
|
|
|
92
|
+
let subscribed = {
|
|
93
|
+
is_subscribed: res?.config?.is_subscribed,
|
|
94
|
+
is_subscribed_default: res?.config?.is_subscribed_default,
|
|
95
|
+
is_subscribed_label: res?.config?.is_subscribed_label
|
|
96
|
+
}
|
|
97
|
+
stateSubscribe.set(subscribed)
|
|
77
98
|
}, (error) => {
|
|
78
|
-
LibProgress.hide()
|
|
79
99
|
LibDialog.warning(esp.lang("event/detail", "load_failed"), error?.message)
|
|
100
|
+
LibNavigation.back()
|
|
80
101
|
})
|
|
81
102
|
}
|
|
82
103
|
|
|
104
|
+
|
|
83
105
|
if (!result) {
|
|
84
106
|
let itemWidth = LibStyle.width - 60
|
|
85
107
|
return (
|
|
@@ -268,7 +290,7 @@ export default function m(props: EventDetail2Props): any {
|
|
|
268
290
|
<View style={{ height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 }} >
|
|
269
291
|
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, textAlign: "center", textAlignVertical: 'center', color: 'black', marginHorizontal: 10 }} >
|
|
270
292
|
{
|
|
271
|
-
esp.lang("event/detail", "text_book_on",
|
|
293
|
+
esp.lang("event/detail", "text_book_on", moment(result.start_booking).serverFormat('DD MMMM YYYY H:mm:ss', result?.timezone), result?.timezone_locale || "")
|
|
272
294
|
}
|
|
273
295
|
</Text>
|
|
274
296
|
</View>
|
|
@@ -279,45 +301,25 @@ export default function m(props: EventDetail2Props): any {
|
|
|
279
301
|
{
|
|
280
302
|
result?.url_artist != "" &&
|
|
281
303
|
<TouchableOpacity onPress={() => {
|
|
282
|
-
// LibNavigation.navigate('event/artist', { title: result?.title, url: result?.url_artist, has_addition: result?.has_addition })
|
|
283
304
|
LibNavigation.navigate('event/artist', {
|
|
284
305
|
title: result?.title,
|
|
285
306
|
url: result?.url_artist,
|
|
286
307
|
has_addition: result?.has_addition
|
|
287
308
|
})
|
|
288
|
-
}} style={applyStyle({ width: (LibStyle.width - 30) * 0.5, borderWidth: 2, borderColor: LibStyle.colorGreen, height: 40, borderRadius:
|
|
309
|
+
}} style={applyStyle({ width: (LibStyle.width - 30) * 0.5, borderWidth: 2, borderColor: LibStyle.colorGreen, height: 40, borderRadius: 5, backgroundColor: 'white', flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center', paddingHorizontal: 9 })} >
|
|
289
310
|
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: LibStyle.colorGreen })} >{esp.lang("event/detail", "line_up")}</Text>
|
|
290
311
|
</TouchableOpacity>
|
|
291
312
|
}
|
|
292
313
|
<TouchableOpacity onPress={() => {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
await LibNavigation.navigateForResult('event/queue_pricing', { event_id: result?.id })
|
|
296
|
-
}
|
|
297
|
-
loadDataConfig(result?.url_config)
|
|
298
|
-
return
|
|
299
|
-
LibNavigation.navigate(
|
|
300
|
-
user?.config?.tester == 1 ?
|
|
301
|
-
'event/ticket_list2'
|
|
302
|
-
:
|
|
303
|
-
(result?.config?.hasOwnProperty('multiprice') && result?.config?.multiprice == 1 ? 'event/ticket_list2' : 'event/ticket_list'),
|
|
314
|
+
esp.modProp("event/index").isLogin(async () => {
|
|
315
|
+
LibNavigation.navigate('event/ticket_list_new',
|
|
304
316
|
{
|
|
305
|
-
url: result
|
|
306
|
-
fee_platform: {
|
|
307
|
-
fee_platform_amount: result?.fee_platform_amount,
|
|
308
|
-
fee_platform_type: result?.fee_platform_type,
|
|
309
|
-
},
|
|
310
|
-
subscribed: {
|
|
311
|
-
is_subscribed: result?.config?.is_subscribed,
|
|
312
|
-
is_subscribed_default: result?.config?.is_subscribed_default,
|
|
313
|
-
is_subscribed_label: result?.config?.is_subscribed_label
|
|
314
|
-
},
|
|
315
|
-
show_fee_percentage: result?.config?.show_fee_percentage,
|
|
317
|
+
url: result?.url_price_v2,
|
|
316
318
|
is_multiprice: result?.config?.multiprice == 1 ? 1 : 0,
|
|
317
319
|
})
|
|
318
|
-
})
|
|
319
320
|
|
|
320
|
-
|
|
321
|
+
})
|
|
322
|
+
}} style={applyStyle({ width: result?.url_artist != "" ? (LibStyle.width - 30) * 0.5 : LibStyle.width - 20, borderWidth: 2, borderColor: LibStyle.colorGreen, height: 40, borderRadius: 5, backgroundColor: LibStyle.colorGreen, flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center', paddingHorizontal: 9 })} >
|
|
321
323
|
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: "#fff" })} >{esp.lang("event/detail", "text_buy_ticket")}</Text>
|
|
322
324
|
</TouchableOpacity>
|
|
323
325
|
<UseCondition if={priority} >
|
package/event/loading_page.tsx
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// withHooks
|
|
2
2
|
|
|
3
|
+
import { ComponentDialog_custom } from 'esoftplay/cache/component/dialog_custom/import';
|
|
3
4
|
import { EventDistribution_lock } from 'esoftplay/cache/event/distribution_lock/import';
|
|
4
5
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
6
|
+
import { EventPayment_subscribeProperty } from 'esoftplay/cache/event/payment_subscribe/import';
|
|
5
7
|
import { EventRandomseat } from 'esoftplay/cache/event/randomseat/import';
|
|
6
8
|
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
7
9
|
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
@@ -80,6 +82,64 @@ export default function m(props: EventLoading_pageProps): any {
|
|
|
80
82
|
return () => LibNavigation.cancelBackResult(LibNavigation.getResultKey(props))
|
|
81
83
|
}, [])
|
|
82
84
|
|
|
85
|
+
function handleError(error: any) {
|
|
86
|
+
LibProgress.hide()
|
|
87
|
+
LibNavigation.back()
|
|
88
|
+
loadingState.set(LibObject.unset(loadingState.get(), post.trx_id)())
|
|
89
|
+
const ticketNotAvailableCodes = ['EV034', 'EV036', 'EV038', 'EV039', 'EV040']
|
|
90
|
+
if (ticketNotAvailableCodes.includes(error.status_code)) {
|
|
91
|
+
LibNavigation.back()
|
|
92
|
+
// LibNavigation.navigate(post?.is_multi == 1 ? 'event/ticket_list2' : 'event/ticket_list')
|
|
93
|
+
}
|
|
94
|
+
if (error.status_code == 'EV033') {
|
|
95
|
+
LibDialog.custom(
|
|
96
|
+
<EventRandomseat
|
|
97
|
+
onPressOk={() => {
|
|
98
|
+
LibDialog.hide()
|
|
99
|
+
PaymentTicketProperty.stateRandomSeat.set("2")
|
|
100
|
+
EventPayment_subscribeProperty.reBooking.trigger()
|
|
101
|
+
}}
|
|
102
|
+
onPressNo={() => LibDialog.hide()}
|
|
103
|
+
/>
|
|
104
|
+
)
|
|
105
|
+
} else if (error?.status_code == "EV045") {
|
|
106
|
+
EventDistribution_lock(() => {
|
|
107
|
+
EventPayment_subscribeProperty.reTryBooking.trigger(post)
|
|
108
|
+
})
|
|
109
|
+
// LibDialog.custom(
|
|
110
|
+
// <ComponentDialog_custom
|
|
111
|
+
// icon={"close-circle"}
|
|
112
|
+
// color={LibStyle.colorRed}
|
|
113
|
+
// msg={error?.message || esp.lang("bigbang/loading_page", "booking_not_complete")}
|
|
114
|
+
// onPressOK={() => {
|
|
115
|
+
// LibDialog.hide()
|
|
116
|
+
// PaymentTicketProperty.reTryBooking.trigger(post)
|
|
117
|
+
// }}
|
|
118
|
+
// onPressCancel={() => { LibDialog.hide() }}
|
|
119
|
+
// />
|
|
120
|
+
// )
|
|
121
|
+
} else if (error?.status_code == "PY0254") {
|
|
122
|
+
LibDialog.custom(
|
|
123
|
+
<ComponentDialog_custom
|
|
124
|
+
showCountdown
|
|
125
|
+
icon={"close-circle"}
|
|
126
|
+
color={LibStyle.colorRed}
|
|
127
|
+
msg={error?.message || esp.lang("bigbang/loading_page", "booking_not_complete")}
|
|
128
|
+
onPressOK={() => {
|
|
129
|
+
LibDialog.hide()
|
|
130
|
+
EventPayment_subscribeProperty.reTryBooking.trigger(post)
|
|
131
|
+
}}
|
|
132
|
+
onPressCancel={() => { LibDialog.hide() }}
|
|
133
|
+
/>
|
|
134
|
+
)
|
|
135
|
+
} else {
|
|
136
|
+
if (error?.status_code != "GE043")
|
|
137
|
+
LibDialog.warningConfirm(esp.lang("event/loading_page", "oops"), error?.message, esp.lang("event/loading_page", "back"), () => {
|
|
138
|
+
|
|
139
|
+
}, "", () => { })
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
83
143
|
function doAction() {
|
|
84
144
|
|
|
85
145
|
if (isSecure && isSecure == 1) {
|
|
@@ -95,47 +155,7 @@ export default function m(props: EventLoading_pageProps): any {
|
|
|
95
155
|
sendBackResult(dataSB)
|
|
96
156
|
|
|
97
157
|
}, (error) => {
|
|
98
|
-
|
|
99
|
-
LibNavigation.back()
|
|
100
|
-
loadingState.set(LibObject.unset(loadingState.get(), post.trx_id)())
|
|
101
|
-
const ticketNotAvailableCodes = ['EV034', 'EV036', 'EV038', 'EV039', 'EV040']
|
|
102
|
-
if (ticketNotAvailableCodes.includes(error.status_code)) {
|
|
103
|
-
LibNavigation.back()
|
|
104
|
-
// LibNavigation.navigate(post?.is_multi == 1 ? 'event/ticket_list2' : 'event/ticket_list')
|
|
105
|
-
}
|
|
106
|
-
if (error.status_code == 'EV033') {
|
|
107
|
-
LibDialog.custom(
|
|
108
|
-
<EventRandomseat
|
|
109
|
-
onPressOk={() => {
|
|
110
|
-
LibDialog.hide()
|
|
111
|
-
PaymentTicketProperty.stateRandomSeat.set("2")
|
|
112
|
-
PaymentTicketProperty.reBooking.trigger()
|
|
113
|
-
}}
|
|
114
|
-
onPressNo={() => LibDialog.hide()}
|
|
115
|
-
/>
|
|
116
|
-
)
|
|
117
|
-
} else if (error?.status_code == "EV045") {
|
|
118
|
-
EventDistribution_lock(() => {
|
|
119
|
-
PaymentTicketProperty.reTryBooking.trigger(post)
|
|
120
|
-
})
|
|
121
|
-
// LibDialog.custom(
|
|
122
|
-
// <ComponentDialog_custom
|
|
123
|
-
// icon={"close-circle"}
|
|
124
|
-
// color={LibStyle.colorRed}
|
|
125
|
-
// msg={error?.message || esp.lang("bigbang/loading_page", "booking_not_complete")}
|
|
126
|
-
// onPressOK={() => {
|
|
127
|
-
// LibDialog.hide()
|
|
128
|
-
// PaymentTicketProperty.reTryBooking.trigger(post)
|
|
129
|
-
// }}
|
|
130
|
-
// onPressCancel={() => { LibDialog.hide() }}
|
|
131
|
-
// />
|
|
132
|
-
// )
|
|
133
|
-
} else {
|
|
134
|
-
if (error?.status_code != "GE043")
|
|
135
|
-
LibDialog.warningConfirm(esp.lang("event/loading_page", "oops"), error?.message, esp.lang("event/loading_page", "back"), () => {
|
|
136
|
-
|
|
137
|
-
}, "", () => { })
|
|
138
|
-
}
|
|
158
|
+
handleError(error)
|
|
139
159
|
}, 1)
|
|
140
160
|
} else {
|
|
141
161
|
new LibCurl(url, post ? post : null, (result, msg) => {
|
|
@@ -149,47 +169,7 @@ export default function m(props: EventLoading_pageProps): any {
|
|
|
149
169
|
|
|
150
170
|
sendBackResult(dataSB)
|
|
151
171
|
}, (error) => {
|
|
152
|
-
|
|
153
|
-
LibNavigation.back()
|
|
154
|
-
loadingState.set(LibObject.unset(loadingState.get(), post.trx_id)())
|
|
155
|
-
const ticketNotAvailableCodes = ['EV034', 'EV036', 'EV038', 'EV039', 'EV040']
|
|
156
|
-
if (ticketNotAvailableCodes.includes(error.status_code)) {
|
|
157
|
-
LibNavigation.back()
|
|
158
|
-
// LibNavigation.navigate(post?.is_multi == 1 ? 'event/ticket_list2' : 'event/ticket_list')
|
|
159
|
-
}
|
|
160
|
-
if (error.status_code == 'EV033') {
|
|
161
|
-
LibDialog.custom(
|
|
162
|
-
<EventRandomseat
|
|
163
|
-
onPressOk={() => {
|
|
164
|
-
LibDialog.hide()
|
|
165
|
-
PaymentTicketProperty.stateRandomSeat.set("2")
|
|
166
|
-
PaymentTicketProperty.reBooking.trigger()
|
|
167
|
-
}}
|
|
168
|
-
onPressNo={() => LibDialog.hide()}
|
|
169
|
-
/>
|
|
170
|
-
)
|
|
171
|
-
} else if (error?.status_code == "EV045") {
|
|
172
|
-
EventDistribution_lock(() => {
|
|
173
|
-
PaymentTicketProperty.reTryBooking.trigger(post)
|
|
174
|
-
})
|
|
175
|
-
// LibDialog.custom(
|
|
176
|
-
// <ComponentDialog_custom
|
|
177
|
-
// icon={"close-circle"}
|
|
178
|
-
// color={LibStyle.colorRed}
|
|
179
|
-
// msg={error?.message || esp.lang("bigbang/loading_page", "booking_not_complete")}
|
|
180
|
-
// onPressOK={() => {
|
|
181
|
-
// LibDialog.hide()
|
|
182
|
-
// PaymentTicketProperty.reTryBooking.trigger(post)
|
|
183
|
-
// }}
|
|
184
|
-
// onPressCancel={() => { LibDialog.hide() }}
|
|
185
|
-
// />
|
|
186
|
-
// )
|
|
187
|
-
} else {
|
|
188
|
-
if (error?.status_code != "GE043")
|
|
189
|
-
LibDialog.warningConfirm(esp.lang("event/loading_page", "oops"), error?.message, esp.lang("event/loading_page", "back"), () => {
|
|
190
|
-
|
|
191
|
-
}, "", () => { })
|
|
192
|
-
}
|
|
172
|
+
handleError(error)
|
|
193
173
|
}, 1)
|
|
194
174
|
}
|
|
195
175
|
}
|
package/event/order_detail.tsx
CHANGED
|
@@ -36,6 +36,7 @@ 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';
|
|
38
38
|
import esp from 'esoftplay/esp';
|
|
39
|
+
import useGlobalState from 'esoftplay/global';
|
|
39
40
|
import moment from 'esoftplay/moment';
|
|
40
41
|
import useSafeState from 'esoftplay/state';
|
|
41
42
|
import useGlobalSubscriber, { useGlobalSubscriberReturn } from 'esoftplay/subscribe';
|
|
@@ -54,6 +55,8 @@ export function subscribe(): useGlobalSubscriberReturn {
|
|
|
54
55
|
return subs
|
|
55
56
|
}
|
|
56
57
|
|
|
58
|
+
const bookedAddons = useGlobalState<any>(undefined, { persistKey: 'event_detail_addons_booked', isUserData: true, inFile: true, loadOnInit: true })
|
|
59
|
+
|
|
57
60
|
export default function m(props: EventOrder_detailProps): any {
|
|
58
61
|
const LibCurl = esp.mod("lib/curl")
|
|
59
62
|
|
|
@@ -68,7 +71,6 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
68
71
|
|
|
69
72
|
const [, setGroupAddon, getGroupAddon] = useSafeState()
|
|
70
73
|
const [, setSelectedAddon, getSelectedAddon] = useSafeState()
|
|
71
|
-
const [addonsBooked, setAddOnsBooked] = useSafeState()
|
|
72
74
|
const [errorAddonsBooked, setErrorddOnsBooked] = useSafeState()
|
|
73
75
|
|
|
74
76
|
const dataOfflineReview = EventReview_addProperty.state().get()
|
|
@@ -154,12 +156,13 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
154
156
|
}, 1)
|
|
155
157
|
}
|
|
156
158
|
|
|
159
|
+
|
|
157
160
|
function loadDataAddonsBooked(url: string) {
|
|
158
161
|
new LibCurl(url, null, (ress: any) => {
|
|
159
|
-
|
|
162
|
+
bookedAddons?.set(ress)
|
|
160
163
|
setErrorddOnsBooked(undefined)
|
|
161
164
|
}, (error: any) => {
|
|
162
|
-
|
|
165
|
+
bookedAddons?.set(undefined)
|
|
163
166
|
setErrorddOnsBooked(error)
|
|
164
167
|
})
|
|
165
168
|
|
|
@@ -429,7 +432,7 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
429
432
|
</View>
|
|
430
433
|
{
|
|
431
434
|
result?.hasOwnProperty('url_addons_booked') && result?.url_addons_booked != "" &&
|
|
432
|
-
<EventOrder_detail_addons_booked addonsBooked={
|
|
435
|
+
<EventOrder_detail_addons_booked addonsBooked={bookedAddons?.get()} errorAddonsBooked={errorAddonsBooked} onPress={loadData} />
|
|
433
436
|
}
|
|
434
437
|
</View>
|
|
435
438
|
|
|
@@ -683,7 +686,11 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
683
686
|
<LibSlidingup ref={dialogQtyAddons}>
|
|
684
687
|
<View style={{ backgroundColor: 'white', maxHeight: LibStyle.height - (LibStyle.height / 3), borderTopRightRadius: 20, borderTopLeftRadius: 20, padding: 20 }}>
|
|
685
688
|
<Text style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", color: "#b7b7b7" }} >{esp.lang("event/order_detail", "addons")}</Text>
|
|
686
|
-
<Text style={{ fontFamily: "Arial",
|
|
689
|
+
<Text style={{ fontFamily: "Arial", fontSize: 16, fontWeight: "bold", color: "#4a4a4a" }} >{getSelectedAddon()?.title}</Text>
|
|
690
|
+
{
|
|
691
|
+
getSelectedAddon()?.info != "" &&
|
|
692
|
+
<EventHtmltext style={{ fontFamily: "Arial", marginBottom: 10, fontSize: 12, marginLeft: 10, color: "#b7b7b7" }} >{getSelectedAddon()?.info}</EventHtmltext>
|
|
693
|
+
}
|
|
687
694
|
|
|
688
695
|
<ScrollView>
|
|
689
696
|
<Text allowFontScaling={false} style={{ marginVertical: 10, fontFamily: "Arial", fontSize: 16, fontWeight: "bold", fontStyle: "normal", letterSpacing: 1.5, color: "#000" }}>{esp.lang("event/order_detail_share", "chose_ticket")}</Text>
|
|
@@ -794,7 +801,7 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
794
801
|
icon={'plus-circle-outline'}
|
|
795
802
|
title={item?.title}
|
|
796
803
|
subtitle={item?.ondate != "0000-00-00" ? LibUtils.moment(item.ondate).format("DD MMM YYYY") : ''}
|
|
797
|
-
info={item
|
|
804
|
+
info={item?.info}
|
|
798
805
|
/>
|
|
799
806
|
)
|
|
800
807
|
})
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useMemo, useRef } from 'react';
|
|
3
3
|
|
|
4
4
|
import { BigbangPayment_detail_ticket, BigbangPayment_detail_ticketProperty } from 'esoftplay/cache/bigbang/payment_detail_ticket/import';
|
|
5
|
-
import { BigbangPayment_list } from "esoftplay/cache/bigbang/payment_list/import";
|
|
5
|
+
import { BigbangPayment_list, BigbangPayment_listProperty } from "esoftplay/cache/bigbang/payment_list/import";
|
|
6
6
|
import { EventButton } from "esoftplay/cache/event/button/import";
|
|
7
7
|
import { EventHeader } from "esoftplay/cache/event/header/import";
|
|
8
8
|
import { EventTransaction } from 'esoftplay/cache/event/transaction/import';
|
|
@@ -28,9 +28,10 @@ export interface EventOrder_detail_upgrade_paymentArgs {
|
|
|
28
28
|
export interface EventOrder_detail_upgrade_paymentProps {
|
|
29
29
|
|
|
30
30
|
}
|
|
31
|
+
|
|
31
32
|
export default function m(props: EventOrder_detail_upgrade_paymentProps): any {
|
|
32
33
|
const { dataTicket, selectedTicket, fee_platform, fee_custom }: any = LibNavigation.getArgsAll(props)
|
|
33
|
-
const [selectedPayment, setSelectedPayment] =
|
|
34
|
+
const [selectedPayment, setSelectedPayment] = BigbangPayment_listProperty.paymentState.useState()
|
|
34
35
|
const [charge, setCharge] = useSafeState<any>(0)
|
|
35
36
|
const [chargePercent, setChargePercent] = useSafeState<any>()
|
|
36
37
|
|
|
@@ -14,6 +14,7 @@ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
|
14
14
|
import { LibProgress } from 'esoftplay/cache/lib/progress/import';
|
|
15
15
|
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
16
16
|
import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
|
|
17
|
+
import { LibTheme } from 'esoftplay/cache/lib/theme/import';
|
|
17
18
|
import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
|
|
18
19
|
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
19
20
|
import esp from 'esoftplay/esp';
|
|
@@ -22,7 +23,7 @@ import moment from 'esoftplay/moment';
|
|
|
22
23
|
import useSafeState from 'esoftplay/state';
|
|
23
24
|
|
|
24
25
|
import React, { useEffect } from 'react';
|
|
25
|
-
import {
|
|
26
|
+
import { RefreshControl, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
26
27
|
|
|
27
28
|
|
|
28
29
|
export interface EventOrder_rescheduleArgs {
|
|
@@ -108,7 +109,7 @@ export default function m(props: EventOrder_rescheduleProps): any {
|
|
|
108
109
|
LibProgress.hide()
|
|
109
110
|
LibNavigation.backToRoot()
|
|
110
111
|
LibNavigation.navigate('event/order')
|
|
111
|
-
LibNavigation.navigate('event/order_detail', { url: res.url })
|
|
112
|
+
// LibNavigation.navigate('event/order_detail', { url: res.url })
|
|
112
113
|
}, (error) => {
|
|
113
114
|
LibProgress.hide()
|
|
114
115
|
LibDialog.warning(esp.lang("event/order_reschedule", "process_er"), error?.message)
|
|
@@ -313,7 +314,6 @@ export default function m(props: EventOrder_rescheduleProps): any {
|
|
|
313
314
|
)
|
|
314
315
|
}
|
|
315
316
|
|
|
316
|
-
// esp.log(result);
|
|
317
317
|
function renderRefundList(item: any, i: number) {
|
|
318
318
|
let _selectTicket = item.hasOwnProperty('check') && item.check == 1
|
|
319
319
|
const styleID_12nkjf: any = { marginLeft: 10, textDecorationLine: 'line-through', textDecorationStyle: 'solid', opacity: item.is_refundable == 1 ? 1 : 0.5, marginTop: 4, fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : '#999' }
|
|
@@ -333,9 +333,15 @@ export default function m(props: EventOrder_rescheduleProps): any {
|
|
|
333
333
|
<LibTextstyle textStyle='caption1' text={esp.lang("event/order_reschedule", "chared", item.qty_shared)} style={{ color: 'orange' }} />
|
|
334
334
|
}
|
|
335
335
|
<Text allowFontScaling={false} style={{ opacity: item.is_refundable == 1 ? 1 : 0.5, fontFamily: "Arial", fontSize: 10, marginBottom: 4, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0.23, color: LibStyle.colorRed }}>{item.refund == "0.00" ? esp.lang("event/order_reschedule", "cant_refund") : esp.lang("event/order_reschedule", "refundable", LibUtils.numberAbsolute(item.refund).toString())}</Text>
|
|
336
|
-
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" :
|
|
336
|
+
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : LibTheme._colorTextSecondary() })}>{esp.lang("ticket/refund", "ticket")} {item.price_name + " (" + item.qty + " " + esp.lang("ticket/refund", "ticket") + ") "}</Text>
|
|
337
337
|
<View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
|
|
338
|
-
<
|
|
338
|
+
<View style={{ flexDirection: 'row', marginTop: 4, alignContent: 'center', alignItems: 'center' }}>
|
|
339
|
+
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 16, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : LibTheme._colorTextSecondary() })}>{LibUtils.money(item.total, item.currency)}</Text>
|
|
340
|
+
{
|
|
341
|
+
item?.tax != "0" &&
|
|
342
|
+
<Text allowFontScaling={false} style={{ marginLeft: 10, fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: LibTheme._colorTextTertiary() }}>{esp.lang("event/order_reschedule", "price+tax")}</Text>
|
|
343
|
+
}
|
|
344
|
+
</View>
|
|
339
345
|
{
|
|
340
346
|
item.refund != "0.00" && item.refund != "100.00" &&
|
|
341
347
|
<Text allowFontScaling={false} style={styleID_12nkjf}>{LibUtils.money(item.price)}</Text>
|
|
@@ -362,16 +368,20 @@ export default function m(props: EventOrder_rescheduleProps): any {
|
|
|
362
368
|
<EventHeader title={result?.global_refundable == 1 ? esp.lang("event/order_reschedule", "refund_rescedule") : esp.lang("event/order_reschedule", "rescedule")} />
|
|
363
369
|
{
|
|
364
370
|
result?.global_refundable == 1 &&
|
|
365
|
-
<View style={{ margin: 15,
|
|
371
|
+
<View style={{ margin: 15, padding: 3, borderRadius: 5, backgroundColor: '#fff', flexDirection: 'row' }}>
|
|
366
372
|
{
|
|
367
373
|
defaultTabs.map((item: any, i: number) => {
|
|
374
|
+
let active = item.id == activeTab
|
|
368
375
|
return (
|
|
369
|
-
<
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
376
|
+
<TouchableOpacity
|
|
377
|
+
key={i}
|
|
378
|
+
onPress={() => {
|
|
379
|
+
loadData()
|
|
380
|
+
setActiveTab(item.id)()
|
|
381
|
+
}}
|
|
382
|
+
style={{ borderRadius: 5, padding: 5, alignContent: 'center', alignItems: 'center', justifyContent: 'center', flex: 1, backgroundColor: active ? LibStyle.colorPrimary : '#fff', marginRight: 1, marginLeft: 1 }}>
|
|
383
|
+
<Text allowFontScaling={false} style={{ fontSize: active ? 16 : 12, color: active ? "#fff" : "#000", fontWeight: active ? 'bold' : 'normal' }}>{item?.title}</Text>
|
|
384
|
+
</TouchableOpacity>
|
|
375
385
|
)
|
|
376
386
|
})
|
|
377
387
|
}
|
|
@@ -381,8 +391,11 @@ export default function m(props: EventOrder_rescheduleProps): any {
|
|
|
381
391
|
<ScrollView refreshControl={
|
|
382
392
|
<RefreshControl refreshing={refreshing} onRefresh={onRefresh} />
|
|
383
393
|
}>
|
|
384
|
-
<View style={{ marginTop: result?.global_refundable == 1 ? 0 : 10, margin: 15,
|
|
385
|
-
|
|
394
|
+
<View style={{ marginTop: result?.global_refundable == 1 ? 0 : 10, margin: 15, borderRadius: 10, backgroundColor: '#fff', paddingBottom: activeTab == 2 ? 10 : 0 }}>
|
|
395
|
+
{
|
|
396
|
+
result?.image != "" &&
|
|
397
|
+
<LibPicture source={{ uri: result?.image }} style={applyStyle({ height: imgHeight, width: imgWidth, resizeMode: 'cover' })} />
|
|
398
|
+
}
|
|
386
399
|
|
|
387
400
|
<View style={{ flexDirection: 'row', margin: 14, marginTop: 4, justifyContent: 'space-between' }}>
|
|
388
401
|
<Text allowFontScaling={false} style={{ marginTop: 14, fontFamily: "Arial", fontSize: 20, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{result?.title}</Text>
|
|
@@ -401,7 +414,7 @@ export default function m(props: EventOrder_rescheduleProps): any {
|
|
|
401
414
|
|
|
402
415
|
{
|
|
403
416
|
activeTab == 2 &&
|
|
404
|
-
<View style={{ padding: 14, backgroundColor: '#f1f2f3' }}>
|
|
417
|
+
<View style={{ padding: 14, marginTop: 10, backgroundColor: '#f1f2f3' }}>
|
|
405
418
|
<Text style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0 }} >{esp.lang("event/order_reschedule", "ready_ticket")}</Text>
|
|
406
419
|
</View>
|
|
407
420
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
|
|
3
|
+
import useGlobalSubscriber from 'esoftplay/subscribe';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export interface EventPayment_subscribeArgs {
|
|
7
|
+
|
|
8
|
+
}
|
|
9
|
+
export interface EventPayment_subscribeProps {
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const reBooking = useGlobalSubscriber()
|
|
14
|
+
export const reTryBooking = useGlobalSubscriber()
|
|
15
|
+
|
|
16
|
+
export default function m(props: EventPayment_subscribeProps): any {
|
|
17
|
+
return null
|
|
18
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
|
|
3
|
+
import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
4
|
+
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
5
|
+
import { LibFont } from 'esoftplay/cache/lib/font/import';
|
|
6
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
7
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { ScrollView, Text, View } from 'react-native';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export interface EventPoint_eventsArgs {
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
export interface EventPoint_eventsProps {
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
export default function m(props: EventPoint_eventsProps): any {
|
|
19
|
+
return (
|
|
20
|
+
<View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
|
|
21
|
+
<EventHeader title='Pilih Event Aktif' />
|
|
22
|
+
<ScrollView>
|
|
23
|
+
<View style={{ margin: 15, }}>
|
|
24
|
+
<Text allowFontScaling={false} style={{ marginTop: 20, fontSize: 20, fontFamily: LibFont('ArialBold') }}>Pilih Event Aktif</Text>
|
|
25
|
+
<Text allowFontScaling={false} style={{ fontFamily: LibFont('SFProText'), marginTop: 3 }}>Silahkan pilih event untuk melihat point anda</Text>
|
|
26
|
+
</View>
|
|
27
|
+
|
|
28
|
+
</ScrollView>
|
|
29
|
+
<EventButton style={{ margin: 15 }} label='Selanjutnya' backgroundColor='#002045' onPress={() => {
|
|
30
|
+
LibNavigation.navigate('event/point_summary')
|
|
31
|
+
}} />
|
|
32
|
+
|
|
33
|
+
</View>
|
|
34
|
+
)
|
|
35
|
+
}
|