esoftplay-event 0.0.2-h → 0.0.2-i
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/config.json +1 -1
- package/event/artist_detail.tsx +120 -83
- package/event/artist_detail_multi.tsx +81 -15
- package/event/exchange_ticket_list.tsx +23 -14
- package/event/order_detail.tsx +330 -241
- package/event/order_detail_upgrade.tsx +170 -108
- package/event/order_detail_upgrade_payment.tsx +94 -33
- package/event/order_detail_visitor.tsx +16 -13
- package/event/step.tsx +1 -1
- package/event/ticket_list.tsx +81 -42
- package/event/ticket_list2.tsx +103 -27
- package/event/tms_gate.tsx +11 -0
- package/event/tms_home.tsx +23 -13
- package/event/tms_in.tsx +0 -2
- package/event/visitor_index.tsx +1 -1
- package/id.json +4 -1
- package/package.json +1 -1
|
@@ -9,15 +9,15 @@ import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
|
9
9
|
import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
|
|
10
10
|
import { EventMessage } from 'esoftplay/cache/event/message/import';
|
|
11
11
|
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
12
|
-
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
13
12
|
import { LibList } from 'esoftplay/cache/lib/list/import';
|
|
14
13
|
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
14
|
+
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
15
15
|
import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
|
|
16
16
|
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
17
17
|
import esp from 'esoftplay/esp';
|
|
18
18
|
import useSafeState from 'esoftplay/state';
|
|
19
19
|
import React from 'react';
|
|
20
|
-
import { Pressable, Text, View } from 'react-native';
|
|
20
|
+
import { ActivityIndicator, Pressable, Text, View } from 'react-native';
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
export interface EventOrder_detail_upgradeArgs {
|
|
@@ -28,9 +28,10 @@ export interface EventOrder_detail_upgradeProps {
|
|
|
28
28
|
}
|
|
29
29
|
export default function m(props: EventOrder_detail_upgradeProps): any {
|
|
30
30
|
const { dataTicket, url }: any = esp.mod("lib/navigation").getArgsAll(props)
|
|
31
|
-
const [selectedTicket, setSelectedTicket] = useSafeState()
|
|
32
|
-
const [result, setResult] = useSafeState()
|
|
31
|
+
const [selectedTicket, setSelectedTicket, getSelectedTicket] = useSafeState()
|
|
32
|
+
const [result, setResult, getResult] = useSafeState()
|
|
33
33
|
const [error, setError] = useSafeState()
|
|
34
|
+
const [loading, setLoading] = useSafeState(false)
|
|
34
35
|
// const [resultEvent, setResultEvent] = useSafeState()
|
|
35
36
|
|
|
36
37
|
function loadDataUpgradeTicket() {
|
|
@@ -42,6 +43,19 @@ export default function m(props: EventOrder_detail_upgradeProps): any {
|
|
|
42
43
|
})
|
|
43
44
|
}
|
|
44
45
|
|
|
46
|
+
function curlPriceConfig(price_id: string, onDone: (data: any) => void) {
|
|
47
|
+
setLoading(true)
|
|
48
|
+
if (getResult()?.url_price_config) {
|
|
49
|
+
new LibCurl(getResult()?.url_price_config, null, (res, msg) => {
|
|
50
|
+
setLoading(false)
|
|
51
|
+
onDone(res?.[price_id])
|
|
52
|
+
}, (err) => {
|
|
53
|
+
setLoading(false)
|
|
54
|
+
LibToastProperty.show(err?.message)
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
45
59
|
// function loadDataEvent() {
|
|
46
60
|
// new LibCurl("event_detail/" + dataTicket?.event_id, null, (res: any, msg: string) => {
|
|
47
61
|
// setResultEvent(res)
|
|
@@ -56,6 +70,69 @@ export default function m(props: EventOrder_detail_upgradeProps): any {
|
|
|
56
70
|
// loadDataEvent()
|
|
57
71
|
}, [])
|
|
58
72
|
|
|
73
|
+
function renderItem(item: any, i: number) {
|
|
74
|
+
let textOpacity = item?.status == 1 ? 1 : 0.3
|
|
75
|
+
let ticketWithDate = item.price_date == 1 && item.use_code == 0
|
|
76
|
+
let selTic = selectedTicket?.selected_ticket?.id == item.id
|
|
77
|
+
return (
|
|
78
|
+
<Pressable onPress={() => {
|
|
79
|
+
if (item.status == 1) {
|
|
80
|
+
let a = {
|
|
81
|
+
event_id: dataTicket?.event_id,
|
|
82
|
+
selected_ticket: {
|
|
83
|
+
...item,
|
|
84
|
+
price_id: item.price_id_to,
|
|
85
|
+
list: {
|
|
86
|
+
ondate: item.ondate
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
qty: dataTicket?.qty_upgrade,
|
|
90
|
+
// tax_event: item.tax
|
|
91
|
+
}
|
|
92
|
+
setSelectedTicket(a)
|
|
93
|
+
}
|
|
94
|
+
}} key={i} style={{
|
|
95
|
+
|
|
96
|
+
margin: 15, marginTop: 0, borderRadius: 5, overflow: 'hidden', borderWidth: 1.5, borderColor: selTic ? LibStyle.colorBlue : LibStyle.colorBgGrey
|
|
97
|
+
}}>
|
|
98
|
+
<View style={{ padding: 10, backgroundColor: '#f1f2f3', borderTopLeftRadius: 5, borderTopRightRadius: 5 }}>
|
|
99
|
+
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
100
|
+
<View style={{ flex: 3 }}>
|
|
101
|
+
<EventHtmltext allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold', color: item.status != 1 ? "#c9c9c9" : selTic ? LibStyle.colorBlue : "#000" }}>{item.price_name_to} </EventHtmltext>
|
|
102
|
+
</View>
|
|
103
|
+
{
|
|
104
|
+
item?.status != 1 &&
|
|
105
|
+
<View style={applyStyle({ alignSelf: 'center', flexDirection: 'row' })}>
|
|
106
|
+
<View style={applyStyle({ alignContent: 'center', alignItems: 'center', justifyContent: 'center', borderWidth: 1, backgroundColor: (item.status == 0 || item?.status == 3) ? LibStyle.colorRed : "#4cd964", borderColor: (item.status == 0 || item?.status == 3) ? LibStyle.colorRed : "#4cd964", borderRadius: 5, padding: 3, opacity: 0.8 })}>
|
|
107
|
+
<Text allowFontScaling={false} style={applyStyle({ fontSize: 10, fontStyle: "normal", letterSpacing: 0, color: "#fff", fontWeight: 'bold' })}>{item?.status_text}</Text>
|
|
108
|
+
</View>
|
|
109
|
+
</View>
|
|
110
|
+
}
|
|
111
|
+
</View>
|
|
112
|
+
{
|
|
113
|
+
item.info != "" && ticketWithDate &&
|
|
114
|
+
<View style={{ marginTop: 3, alignContent: 'center', alignItems: 'center', flexDirection: 'row', marginRight: 5 }}>
|
|
115
|
+
<Text allowFontScaling={false} style={{ fontSize: 12, color: LibStyle.colorBlue }}>{item.info}</Text>
|
|
116
|
+
</View>
|
|
117
|
+
}
|
|
118
|
+
</View>
|
|
119
|
+
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between', padding: 10, alignItems: 'center' }}>
|
|
120
|
+
<View style={{ flex: 1, flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
|
|
121
|
+
<LibPicture source={esp.assets('icons/ic_special2.png')} style={{ height: 42, width: 42 }} />
|
|
122
|
+
<View style={{ marginLeft: 14, flex: 1 }} >
|
|
123
|
+
{
|
|
124
|
+
item.info != "" &&
|
|
125
|
+
<EventHtmltext allowFontScaling={false} style={{ flexWrap: 'wrap', fontFamily: "Arial", fontSize: 11, fontStyle: "normal", letterSpacing: 0, color: '#999' }}>{item.info}</EventHtmltext>
|
|
126
|
+
}
|
|
127
|
+
</View>
|
|
128
|
+
<Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold', marginTop: 5, color: item.status != 1 ? "#c9c9c9" : selTic ? LibStyle.colorBlue : "#000" }}>{"+ " + LibUtils.money(item?.amount_difference, item?.currency)}</Text>
|
|
129
|
+
|
|
130
|
+
</View>
|
|
131
|
+
</View>
|
|
132
|
+
</Pressable>
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
|
|
59
136
|
if (!result && !error) {
|
|
60
137
|
const LibLoading = esp.mod("lib/loading")
|
|
61
138
|
return <LibLoading />
|
|
@@ -78,7 +155,14 @@ export default function m(props: EventOrder_detail_upgradeProps): any {
|
|
|
78
155
|
)
|
|
79
156
|
}
|
|
80
157
|
|
|
81
|
-
|
|
158
|
+
const sorted = result?.list?.sort((a: any, b: any) => {
|
|
159
|
+
// jika a.status = 1 dan b bukan 1 → a di atas
|
|
160
|
+
if (a.status == 1 && b.status != 1) return -1;
|
|
161
|
+
// jika b.status = 1 dan a bukan 1 → b di atas
|
|
162
|
+
if (b.status == 1 && a.status != 1) return 1;
|
|
163
|
+
// jika dua-duanya sama statusnya → urutan tidak berubah
|
|
164
|
+
return 0;
|
|
165
|
+
});
|
|
82
166
|
|
|
83
167
|
return (
|
|
84
168
|
<View style={{ flex: 1 }} >
|
|
@@ -88,7 +172,7 @@ export default function m(props: EventOrder_detail_upgradeProps): any {
|
|
|
88
172
|
|
|
89
173
|
<View style={{ ...LibStyle.elevation(2), margin: 15, width: LibStyle.width - 30, borderRadius: 10, backgroundColor: LibStyle.colorBgGrey, padding: 10, height: 100, alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
|
|
90
174
|
<EventHtmltext allowFontScaling={false} style={{ marginHorizontal: 5, fontSize: 20, color: "#000", textAlign: 'center', fontWeight: 'bold' }} numberOfLines={2} ellipsizeMode={'tail'}>{dataTicket?.price_name}</EventHtmltext>
|
|
91
|
-
<Text allowFontScaling={false} style={{ color: "#000", marginTop: 10 }}>{LibUtils.money(
|
|
175
|
+
<Text allowFontScaling={false} style={{ color: "#000", marginTop: 10 }}>{LibUtils.money(result?.total_from, dataTicket?.currency)}</Text>
|
|
92
176
|
|
|
93
177
|
<View style={applyStyle({ flexDirection: 'row', alignItems: 'center', justifyContent: 'center', position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 })}>
|
|
94
178
|
<View style={applyStyle({ width: 25, height: 25, borderRadius: 12.5, backgroundColor: "#fff", marginLeft: -12.5 })} />
|
|
@@ -100,114 +184,92 @@ export default function m(props: EventOrder_detail_upgradeProps): any {
|
|
|
100
184
|
<LibTextstyle textStyle='m_overline' text={esp.lang("event/order_detail_upgrade", "upgrade_to")} style={{ fontSize: 12, margin: 15, marginBottom: 10 }} />
|
|
101
185
|
|
|
102
186
|
<LibList
|
|
103
|
-
data={
|
|
187
|
+
data={sorted}
|
|
104
188
|
extraData={selectedTicket}
|
|
105
|
-
renderItem={
|
|
106
|
-
return (
|
|
107
|
-
<Pressable onPress={() => {
|
|
108
|
-
if (item.status == 1) {
|
|
109
|
-
let a = {
|
|
110
|
-
event_id: dataTicket?.event_id,
|
|
111
|
-
selected_ticket: {
|
|
112
|
-
...item,
|
|
113
|
-
price_id: item.price_id_to,
|
|
114
|
-
list: {
|
|
115
|
-
ondate: item.ondate
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
qty: dataTicket?.qty_upgrade,
|
|
119
|
-
tax_event: item.tax
|
|
120
|
-
}
|
|
121
|
-
setSelectedTicket(a)
|
|
122
|
-
} else {
|
|
123
|
-
LibDialog.warning(esp.lang("event/order_detail_upgrade", "oops"), item.message_error)
|
|
124
|
-
}
|
|
125
|
-
}} key={i} style={{
|
|
126
|
-
...LibStyle.elevation(2), marginHorizontal: 15, marginTop: 2.5, marginBottom: 10, borderRadius: 10,
|
|
127
|
-
backgroundColor: item.status != 1 ? LibStyle.colorBgGrey : selectedTicket?.selected_ticket?.id == item.id ? LibStyle.colorGreen : "#fff", padding: 10, /* alignContent: 'center', alignItems: 'center', justifyContent: 'center' */
|
|
128
|
-
}}>
|
|
129
|
-
{
|
|
130
|
-
item?.status != 1 &&
|
|
131
|
-
<View style={applyStyle({ flexDirection: 'row' })}>
|
|
132
|
-
<View style={applyStyle({ alignContent: 'center', alignItems: 'center', justifyContent: 'center', borderWidth: 1, backgroundColor: (item.status == 0 || item?.status == 3) ? LibStyle.colorRed : "#4cd964", borderColor: (item.status == 0 || item?.status == 3) ? LibStyle.colorRed : "#4cd964", borderRadius: 5, padding: 3, opacity: 0.8 })}>
|
|
133
|
-
<Text allowFontScaling={false} style={applyStyle({ fontSize: 10, fontStyle: "normal", letterSpacing: 0, color: "#fff", fontWeight: 'bold' })}>{item?.status_text}</Text>
|
|
134
|
-
</View>
|
|
135
|
-
</View>
|
|
136
|
-
}
|
|
137
|
-
<EventHtmltext allowFontScaling={false} style={{ marginHorizontal: 5, fontSize: 16, color: item.status != 1 ? "#c9c9c9" : selectedTicket?.selected_ticket?.id == item.id ? "#fff" : "#000", textAlign: 'center', fontWeight: 'bold' }} numberOfLines={2} ellipsizeMode={'tail'}>{item?.price_name_to}</EventHtmltext>
|
|
138
|
-
<Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold', marginTop: 5, color: item.status != 1 ? "#c9c9c9" : selectedTicket?.selected_ticket?.id == item.id ? "#fff" : "#000" }}>{"+ " + LibUtils.money(Number(dataTicket?.qty_upgrade) * Number(item?.amount), item?.currency)}</Text>
|
|
139
|
-
|
|
140
|
-
{
|
|
141
|
-
item.info &&
|
|
142
|
-
<Text allowFontScaling={false} style={{ textAlign: 'center', marginTop: 10, fontSize: 12, color: selectedTicket?.selected_ticket?.id == item.id ? "#fff" : "#c9c9c9" }}>{item.info}</Text>
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
</Pressable>
|
|
146
|
-
)
|
|
147
|
-
}}
|
|
189
|
+
renderItem={renderItem}
|
|
148
190
|
/>
|
|
149
191
|
|
|
150
192
|
</View>
|
|
151
193
|
<View style={{ padding: 10 }}>
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
194
|
+
{
|
|
195
|
+
loading ?
|
|
196
|
+
<View style={{ minWidth: '100%', alignSelf: 'center' }} >
|
|
197
|
+
<View style={{ borderWidth: 1, borderColor: 'rgba(0, 0, 0, 0)', height: 40, borderRadius: 16, backgroundColor: "#e6e6e6", alignItems: 'center', justifyContent: 'center', paddingHorizontal: 9 }} >
|
|
198
|
+
<ActivityIndicator size={"small"} color={LibStyle.colorPrimary} />
|
|
199
|
+
</View>
|
|
200
|
+
</View> :
|
|
201
|
+
<EventButton label={esp.lang("event/order_detail_upgrade", "btn_next")} onPress={() => {
|
|
202
|
+
const selectedTicket = getSelectedTicket()
|
|
203
|
+
if (selectedTicket) {
|
|
204
|
+
if (selectedTicket?.selected_ticket?.use_seat == 1 && selectedTicket?.selected_ticket?.seat_autopick == 0) {
|
|
205
|
+
LibNavigation.navigateForResult('event/seat_map_new', {
|
|
206
|
+
url: 'event_seat',
|
|
207
|
+
dataTicket: selectedTicket
|
|
208
|
+
}).then((value) => {
|
|
209
|
+
let seatData: any = {}
|
|
210
|
+
seatData.seat_label = value?.seat_label
|
|
211
|
+
|
|
212
|
+
curlPriceConfig(selectedTicket.selected_ticket?.price_id_to, (config) => {
|
|
213
|
+
LibNavigation.navigate('event/order_detail_upgrade_payment', {
|
|
214
|
+
dataTicket: {
|
|
215
|
+
url_payment: result?.url_payment,
|
|
216
|
+
url_upgrade: result?.url_upgrade,
|
|
217
|
+
price_name: dataTicket?.price_name,
|
|
218
|
+
previous_total: Number(result?.total_from),
|
|
219
|
+
booking_id: dataTicket?.id,
|
|
220
|
+
qty_upgrade: dataTicket?.qty_upgrade,
|
|
221
|
+
tax_event: config?.tax,
|
|
222
|
+
ondate: dataTicket?.ondate,
|
|
223
|
+
event_title: dataTicket?.event_name,
|
|
224
|
+
event_id: dataTicket?.event_id,
|
|
225
|
+
// ...dataTicket
|
|
226
|
+
},
|
|
227
|
+
selectedTicket: {
|
|
228
|
+
...selectedTicket,
|
|
229
|
+
...seatData
|
|
230
|
+
},
|
|
231
|
+
fee_platform: {
|
|
232
|
+
fee_platform_amount: config?.fee_platform_amount,
|
|
233
|
+
fee_platform_type: config?.fee_platform_type,
|
|
234
|
+
},
|
|
235
|
+
})
|
|
236
|
+
})
|
|
237
|
+
|
|
238
|
+
})
|
|
239
|
+
} else {
|
|
240
|
+
curlPriceConfig(selectedTicket.selected_ticket?.price_id_to, (config) => {
|
|
241
|
+
LibNavigation.navigate('event/order_detail_upgrade_payment', {
|
|
242
|
+
dataTicket: {
|
|
243
|
+
url_payment: result?.url_payment,
|
|
244
|
+
url_upgrade: result?.url_upgrade,
|
|
245
|
+
price_name: dataTicket?.price_name,
|
|
246
|
+
booking_id: dataTicket?.id,
|
|
247
|
+
previous_total: Number(result?.total_from),
|
|
248
|
+
qty_upgrade: dataTicket?.qty_upgrade,
|
|
249
|
+
tax_event: config?.tax,
|
|
250
|
+
ondate: dataTicket?.ondate,
|
|
251
|
+
event_title: dataTicket?.event_name,
|
|
252
|
+
event_id: dataTicket?.event_id,
|
|
253
|
+
// ...dataTicket
|
|
254
|
+
},
|
|
255
|
+
selectedTicket: selectedTicket,
|
|
256
|
+
fee_platform: {
|
|
257
|
+
fee_platform_amount: config?.fee_platform_amount,
|
|
258
|
+
fee_platform_type: config?.fee_platform_type,
|
|
259
|
+
}
|
|
260
|
+
})
|
|
261
|
+
})
|
|
262
|
+
|
|
200
263
|
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
/>
|
|
264
|
+
} else {
|
|
265
|
+
LibToastProperty.show(esp.lang("event/order_detail_upgrade", "select_ticket"))
|
|
266
|
+
return
|
|
267
|
+
}
|
|
268
|
+
}}
|
|
269
|
+
backgroundColor={selectedTicket ? LibStyle.colorGreen : LibStyle.colorGrey}
|
|
270
|
+
fontColor='#fff'
|
|
271
|
+
/>
|
|
272
|
+
}
|
|
211
273
|
</View>
|
|
212
274
|
</View>
|
|
213
275
|
)
|
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
// withHooks
|
|
2
|
-
import { useRef } from 'react';
|
|
2
|
+
import { useMemo, useRef } from 'react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { BigbangPayment_detail_ticket, BigbangPayment_detail_ticketProperty } from 'esoftplay/cache/bigbang/payment_detail_ticket/import';
|
|
5
5
|
import { BigbangPayment_list } 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';
|
|
9
9
|
import { LibCurl } from "esoftplay/cache/lib/curl/import";
|
|
10
10
|
import { LibDialog } from "esoftplay/cache/lib/dialog/import";
|
|
11
|
+
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
11
12
|
import { LibNavigation } from "esoftplay/cache/lib/navigation/import";
|
|
12
13
|
import { LibProgress } from "esoftplay/cache/lib/progress/import";
|
|
13
14
|
import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
|
|
14
15
|
import { LibStyle } from "esoftplay/cache/lib/style/import";
|
|
15
16
|
import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
|
|
17
|
+
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
18
|
+
import { PaymentFee_calculate } from 'esoftplay/cache/payment/fee_calculate/import';
|
|
16
19
|
import esp from "esoftplay/esp";
|
|
17
20
|
import useSafeState from "esoftplay/state";
|
|
18
|
-
import { Linking, ScrollView, Text, View } from "react-native";
|
|
21
|
+
import { Linking, Pressable, ScrollView, Text, View } from "react-native";
|
|
19
22
|
|
|
20
23
|
|
|
21
24
|
|
|
@@ -28,7 +31,6 @@ export interface EventOrder_detail_upgrade_paymentProps {
|
|
|
28
31
|
export default function m(props: EventOrder_detail_upgrade_paymentProps): any {
|
|
29
32
|
const { dataTicket, selectedTicket, fee_platform }: any = LibNavigation.getArgsAll(props)
|
|
30
33
|
const [selectedPayment, setSelectedPayment] = useSafeState<any>()
|
|
31
|
-
const [platformFee, setPlatformFee] = useSafeState<any>(fee_platform)
|
|
32
34
|
const [charge, setCharge] = useSafeState<any>(0)
|
|
33
35
|
const [chargePercent, setChargePercent] = useSafeState<any>()
|
|
34
36
|
|
|
@@ -37,7 +39,6 @@ export default function m(props: EventOrder_detail_upgrade_paymentProps): any {
|
|
|
37
39
|
const scrollYRef = useRef(0)
|
|
38
40
|
const dialogSeat = useRef<LibSlidingup>(null)
|
|
39
41
|
|
|
40
|
-
esp.log({ dataTicket, selectedTicket });
|
|
41
42
|
|
|
42
43
|
function doUpgrade(pin?: any) {
|
|
43
44
|
const LibToastProperty = esp.modProp("lib/toast")
|
|
@@ -67,7 +68,7 @@ export default function m(props: EventOrder_detail_upgrade_paymentProps): any {
|
|
|
67
68
|
post.pin = pin
|
|
68
69
|
}
|
|
69
70
|
LibProgress.show(esp.lang("event/order_detail_upgrade_payment", "confirm_wait"))
|
|
70
|
-
new LibCurl('event_order_detail_upgrade_checkout', post, (res, msg) => {
|
|
71
|
+
new LibCurl(dataTicket?.url_upgrade || 'event_order_detail_upgrade_checkout', post, (res, msg) => {
|
|
71
72
|
LibProgress.hide()
|
|
72
73
|
LibNavigation.reset()
|
|
73
74
|
if (res?.hasOwnProperty('url_mobile') && res?.url_mobile != null) {
|
|
@@ -110,14 +111,22 @@ export default function m(props: EventOrder_detail_upgrade_paymentProps): any {
|
|
|
110
111
|
return (percent * amount) / 100
|
|
111
112
|
}
|
|
112
113
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
const price = Number(selectedTicket?.selected_ticket?.price_to)
|
|
115
|
+
const qty = Number(dataTicket?.qty_upgrade)
|
|
116
|
+
|
|
117
|
+
const calculate = PaymentFee_calculate(price, qty,
|
|
118
|
+
{
|
|
119
|
+
fee_platform_type: fee_platform?.fee_platform_type || "NONE",
|
|
120
|
+
fee_platform_amount: fee_platform?.fee_platform_amount || 0,
|
|
121
|
+
discount_type: "NONE",
|
|
122
|
+
discount_amount: 0,
|
|
123
|
+
tax: dataTicket?.tax_event || 0
|
|
124
|
+
}
|
|
125
|
+
)
|
|
116
126
|
|
|
117
|
-
let _fee_platform_type = platformFee?.fee_platform_type
|
|
118
|
-
let _fee_platform = _fee_platform_type == "NOMINAL" ? Number(platformFee?.fee_platform_amount || 0) : _fee_platform_type == "PERCENTAGE" ? percentageCalculator(amount, Number(platformFee?.fee_platform_amount || 0)) : 0
|
|
119
127
|
|
|
120
|
-
let
|
|
128
|
+
let amount = Number(selectedTicket?.selected_ticket?.price_to || selectedTicket?.selected_ticket?.amount_difference) * Number(dataTicket?.qty_upgrade)
|
|
129
|
+
let subtotalWithTaxWithFeePlatform = calculate.subtotal
|
|
121
130
|
|
|
122
131
|
let _charge = amount == 0 ? 0 : Number(charge)
|
|
123
132
|
let _charge_percent = chargePercent == 0 ? 0 : percentageCalculator(subtotalWithTaxWithFeePlatform, chargePercent)
|
|
@@ -133,6 +142,71 @@ export default function m(props: EventOrder_detail_upgrade_paymentProps): any {
|
|
|
133
142
|
)
|
|
134
143
|
}
|
|
135
144
|
|
|
145
|
+
const currency = selectedTicket?.selected_ticket?.currency || "IDR"
|
|
146
|
+
|
|
147
|
+
const itemData = useMemo(() => {
|
|
148
|
+
const items: BigbangPayment_detail_ticketProperty.BigbangPayment_detail_ticketItem[] = []
|
|
149
|
+
|
|
150
|
+
items.push({
|
|
151
|
+
label: esp.lang("event/order_detail_upgrade_payment", "upgrade_to", dataTicket?.price_name, selectedTicket?.selected_ticket?.price_name_to),
|
|
152
|
+
caption: dataTicket?.ondate != "0000-00-00" ? LibUtils.moment(dataTicket?.ondate).localeFormat("DD MMMM YYYY") : "",
|
|
153
|
+
value: LibUtils.money(price, currency),
|
|
154
|
+
qty: LibUtils.number(qty)
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
//seat
|
|
158
|
+
const name_seat = selectedTicket?.seat_name
|
|
159
|
+
if (name_seat && name_seat.length > 0) {
|
|
160
|
+
items.push({
|
|
161
|
+
label: esp.lang("bigbang/payment_detail", "text_seat"),
|
|
162
|
+
value:
|
|
163
|
+
<Pressable onPress={() => dialogSeat.current?.show()} style={{ flexDirection: 'row', justifyContent: 'center', alignContent: 'center', alignItems: 'center' }} >
|
|
164
|
+
<View style={{ marginRight: 5, marginLeft: 5, height: 25, width: 25, backgroundColor: LibStyle.colorBlue, borderWidth: 1, borderColor: LibStyle.colorBlue, borderRadius: 4, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
|
|
165
|
+
<Text allowFontScaling={false} style={{ fontSize: 10, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{name_seat?.[0]}</Text>
|
|
166
|
+
</View>
|
|
167
|
+
{
|
|
168
|
+
name_seat && name_seat?.length > 1 &&
|
|
169
|
+
<LibIcon.MaterialIcons name="more" style={{ transform: [{ rotate: '180deg' }] }} size={32} color={LibStyle.colorBlue} />
|
|
170
|
+
}
|
|
171
|
+
</Pressable>
|
|
172
|
+
})
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Gov tax
|
|
176
|
+
if (dataTicket?.tax_event) {
|
|
177
|
+
items.push({
|
|
178
|
+
label: esp.lang("bigbang/payment_detail", "tax", String(Number(dataTicket?.tax_event))),
|
|
179
|
+
value: LibUtils.money(calculate.tax, currency)
|
|
180
|
+
})
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Platform fee
|
|
184
|
+
if (calculate.platform !== 0) {
|
|
185
|
+
items.push({
|
|
186
|
+
label: esp.lang("bigbang/payment_detail", "fee_apps"),
|
|
187
|
+
value: LibUtils.money(calculate.platform, currency),
|
|
188
|
+
sublabel: (fee_platform?.fee_platform_type !== "NOMINAL") ? "(" + fee_platform?.fee_platform_amount + "%)" : ""
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
//potongan sebelumnya
|
|
193
|
+
if (dataTicket?.previous_total && dataTicket?.previous_total > 0) {
|
|
194
|
+
items.push({
|
|
195
|
+
label: esp.lang("bigbang/payment_detail_ticket", "previous_total"),
|
|
196
|
+
value: "-" + LibUtils.money(dataTicket?.previous_total, currency),
|
|
197
|
+
})
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Admin bank
|
|
201
|
+
items.push({
|
|
202
|
+
label: esp.lang("bigbang/payment_detail", "admin_fee"),
|
|
203
|
+
sublabel: esp.modProp("bigbang/payment_detail_ticket").processAdminBank(chargePercent, charge, currency),
|
|
204
|
+
caption: esp.lang("bigbang/payment_detail", "info"),
|
|
205
|
+
value: LibUtils.money(_charge_total, currency),
|
|
206
|
+
})
|
|
207
|
+
|
|
208
|
+
return items
|
|
209
|
+
}, [charge, chargePercent, _charge_total, dataTicket, calculate, price, qty])
|
|
136
210
|
|
|
137
211
|
return (
|
|
138
212
|
<View style={{ flex: 1, backgroundColor: '#fff' }}>
|
|
@@ -144,32 +218,20 @@ export default function m(props: EventOrder_detail_upgrade_paymentProps): any {
|
|
|
144
218
|
if (currentYPosition >= (LibStyle.height * 0.3)) {
|
|
145
219
|
if (oldPosition == 0) {
|
|
146
220
|
scrollYRef.current = nativeEvent.contentOffset.y
|
|
147
|
-
|
|
221
|
+
BigbangPayment_detail_ticketProperty.stateShow.set(false)
|
|
148
222
|
}
|
|
149
223
|
}
|
|
150
224
|
}}>
|
|
151
225
|
|
|
152
226
|
{/* detail */}
|
|
153
227
|
<View style={{ backgroundColor: 'white' }}>
|
|
154
|
-
<
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
fee_platform_amount={platformFee?.fee_platform_amount}
|
|
162
|
-
charge_percent={chargePercent}
|
|
163
|
-
// typeTicket={dataBookingEvent?.selected_ticket?.type}
|
|
164
|
-
currency={selectedTicket?.selected_ticket?.currency}
|
|
165
|
-
qty={dataTicket?.qty_upgrade}
|
|
166
|
-
tax={dataTicket?.tax_event}
|
|
167
|
-
name_seat={selectedTicket?.seat_name}
|
|
168
|
-
onPressSeat={() => {
|
|
169
|
-
dialogSeat.current?.show()
|
|
170
|
-
}}
|
|
171
|
-
title={esp.lang("event/order_detail_upgrade_payment", "upgrade_to", dataTicket?.price_name, selectedTicket?.selected_ticket?.price_name_to)}
|
|
172
|
-
event_name={dataTicket?.event_title} />
|
|
228
|
+
<BigbangPayment_detail_ticket
|
|
229
|
+
product_title={esp.lang("event/order_detail_upgrade_payment", "upgrade_to", dataTicket?.price_name, selectedTicket?.selected_ticket?.price_name_to)}
|
|
230
|
+
product_subtitle={dataTicket?.event_title}
|
|
231
|
+
product_price={LibUtils.money(_amountTotal - (dataTicket?.previous_total || 0), currency)}
|
|
232
|
+
itemData={itemData}
|
|
233
|
+
isFree={calculate.subtotal == 0 && calculate.discount == 0} //tiket gratis
|
|
234
|
+
/>
|
|
173
235
|
</View>
|
|
174
236
|
|
|
175
237
|
|
|
@@ -186,7 +248,6 @@ export default function m(props: EventOrder_detail_upgrade_paymentProps): any {
|
|
|
186
248
|
payment_type: Number(item.type),
|
|
187
249
|
}
|
|
188
250
|
setSelectedPayment(payment)
|
|
189
|
-
setPlatformFee({ fee_platform_type: item?.fee_platform_type || 'NONE', fee_platform_amount: item?.fee_platform_amount || 0 })
|
|
190
251
|
setCharge(item.charge)
|
|
191
252
|
setChargePercent(item.charge_percent)
|
|
192
253
|
}}
|
|
@@ -150,19 +150,22 @@ export default function m(props: EventOrder_detail_visitorProps): any {
|
|
|
150
150
|
}
|
|
151
151
|
</View>
|
|
152
152
|
</View>
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
<
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
153
|
+
{
|
|
154
|
+
item.hasOwnProperty('seat_name') && item?.seat_name != "" &&
|
|
155
|
+
<View style={{ alignContent: 'center', alignItems: 'center' }}>
|
|
156
|
+
{
|
|
157
|
+
item?.seat_name?.includes('#') ?
|
|
158
|
+
<View key={i} style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: 5, marginBottom: 7, paddingHorizontal: 5, backgroundColor: '#fff', borderRadius: 5, marginRight: 7, ...LibStyle.elevation(5), }}>
|
|
159
|
+
<Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 16, color: "#000" }}> {front} </Text>
|
|
160
|
+
<Text allowFontScaling={false} style={{ marginLeft: 3, fontWeight: 'bold', fontSize: 16, color: '#000', }}> {end} </Text>
|
|
161
|
+
</View>
|
|
162
|
+
:
|
|
163
|
+
<View key={i} style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: 5, marginBottom: 7, paddingHorizontal: 5, backgroundColor: '#fff', borderRadius: 5, marginRight: 7, ...LibStyle.elevation(5), }}>
|
|
164
|
+
<Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 20, color: "#000" }}>{item?.seat_name}</Text>
|
|
165
|
+
</View>
|
|
166
|
+
}
|
|
167
|
+
</View>
|
|
168
|
+
}
|
|
166
169
|
</View>
|
|
167
170
|
)
|
|
168
171
|
})
|
package/event/step.tsx
CHANGED
|
@@ -19,7 +19,7 @@ export default function m(props: EventStepProps): any {
|
|
|
19
19
|
return (
|
|
20
20
|
<VIEW
|
|
21
21
|
onPress={() => { if (urls && urls.length > 0) Linking.openURL(urls[0]) }}
|
|
22
|
-
style={{ flexDirection: 'row', marginLeft:
|
|
22
|
+
style={{ flexDirection: 'row', marginLeft: 15, paddingRight: 25, paddingBottom: 10 }}>
|
|
23
23
|
<View style={{ marginRight: 15, marginTop: 3, borderRadius: 15, width: 14, height: 14, backgroundColor: "#f5e71e", borderStyle: "solid", borderWidth: 2, borderColor: "#70472b" }} />
|
|
24
24
|
<View style={{ flex: 1 }} >
|
|
25
25
|
<RenderHtml contentWidth={LibStyle.width} source={{ html: props?.text?.trim?.() }} />
|