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
package/config.json
CHANGED
package/event/artist_detail.tsx
CHANGED
|
@@ -7,6 +7,7 @@ import { EventCountdownProperty } from 'esoftplay/cache/event/countdown/import';
|
|
|
7
7
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
8
8
|
import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
|
|
9
9
|
import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
|
|
10
|
+
import { EventOrder_itemProperty } from 'esoftplay/cache/event/order_item/import';
|
|
10
11
|
import { EventShare } from 'esoftplay/cache/event/share/import';
|
|
11
12
|
import { LibCarrousel } from 'esoftplay/cache/lib/carrousel/import';
|
|
12
13
|
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
@@ -25,7 +26,7 @@ import esp from 'esoftplay/esp';
|
|
|
25
26
|
import moment from 'esoftplay/moment';
|
|
26
27
|
import useSafeState from 'esoftplay/state';
|
|
27
28
|
import React, { useEffect } from 'react';
|
|
28
|
-
import { Pressable, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
29
|
+
import { ActivityIndicator, Pressable, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
export interface EventArtist_detailProps {
|
|
@@ -44,6 +45,7 @@ export default function m(props: EventArtist_detailProps): any {
|
|
|
44
45
|
const [selectedTicket, setSelectedTicket, getSelectedTicket] = useSafeState<any>()
|
|
45
46
|
const [priceList, setPriceList] = useSafeState<any>()
|
|
46
47
|
const [showAll, setShowAll] = useSafeState<any>({});
|
|
48
|
+
const [loading, setLoading] = useSafeState<boolean>(false)
|
|
47
49
|
|
|
48
50
|
useEffect(() => {
|
|
49
51
|
loadDataPrice()
|
|
@@ -101,7 +103,7 @@ export default function m(props: EventArtist_detailProps): any {
|
|
|
101
103
|
})
|
|
102
104
|
}
|
|
103
105
|
|
|
104
|
-
function proceedToPayment() {
|
|
106
|
+
async function proceedToPayment() {
|
|
105
107
|
if (!selectedTicket) {
|
|
106
108
|
if (priceList?.every((v: any) => v?.status == 0)) {
|
|
107
109
|
LibToastProperty.show(esp.lang("event/artist_detail", "ticket_not_available"))
|
|
@@ -126,81 +128,88 @@ export default function m(props: EventArtist_detailProps): any {
|
|
|
126
128
|
dataPost.adjacent_seats = 1
|
|
127
129
|
}
|
|
128
130
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
dataBookingEvent: { ...dataPost, qty: qty },
|
|
135
|
-
subscribed: subscribed
|
|
136
|
-
})
|
|
137
|
-
} else {
|
|
138
|
-
LibNavigation.navigateForResult('event/seat_map_new', {
|
|
131
|
+
let finalDataPost = { ...dataPost }
|
|
132
|
+
|
|
133
|
+
if (getSelectedTicket()?.use_seat === 1) {
|
|
134
|
+
if (getSelectedTicket()?.config?.seat_autopick !== 1) {
|
|
135
|
+
const seat = await LibNavigation.navigateForResult('event/seat_map_new', {
|
|
139
136
|
url: 'event_seat',
|
|
140
|
-
dataTicket:
|
|
141
|
-
}).then((value) => {
|
|
142
|
-
dataPost.seat_label = value.seat_label
|
|
143
|
-
|
|
144
|
-
if (data?.has_addition && data?.has_addition == 1) {
|
|
145
|
-
LibNavigation.navigateForResult('event/additional', { type_ticket: selectedTicket?.type, ondate: selectedTicket?.list?.ondate, event_id: data?.event_id, qty: qty, data: dataPost }, 221).then((additions) => {
|
|
146
|
-
if (additions != "") {
|
|
147
|
-
dataPost.addition = additions
|
|
148
|
-
}
|
|
149
|
-
LibNavigation.navigate('payment/ticket', {
|
|
150
|
-
order_type: eventConfig?.order_type?.ticket,
|
|
151
|
-
tax: getSelectedTicket()?.tax || data?.tax,
|
|
152
|
-
dataBookingEvent: dataPost,
|
|
153
|
-
fee_platform: {
|
|
154
|
-
fee_platform_amount: data?.fee_platform_amount,
|
|
155
|
-
fee_platform_type: data?.fee_platform_type,
|
|
156
|
-
},
|
|
157
|
-
subscribed: subscribed
|
|
158
|
-
})
|
|
159
|
-
})
|
|
160
|
-
} else {
|
|
161
|
-
LibNavigation.navigate('payment/ticket', {
|
|
162
|
-
order_type: eventConfig?.order_type?.ticket,
|
|
163
|
-
tax: getSelectedTicket()?.tax || data?.tax,
|
|
164
|
-
dataBookingEvent: dataPost,
|
|
165
|
-
fee_platform: {
|
|
166
|
-
fee_platform_amount: data?.fee_platform_amount,
|
|
167
|
-
fee_platform_type: data?.fee_platform_type,
|
|
168
|
-
},
|
|
169
|
-
subscribed: subscribed
|
|
170
|
-
})
|
|
171
|
-
}
|
|
172
|
-
})
|
|
173
|
-
}
|
|
174
|
-
} else {
|
|
175
|
-
if (selectedTicket?.hasOwnProperty("has_addition") && selectedTicket?.has_addition == 1) {
|
|
176
|
-
LibNavigation.navigateForResult('event/additional', { type_ticket: selectedTicket?.type, ondate: selectedTicket?.list?.ondate, event_id: data?.event_id, qty: qty, data: dataPost, price_id: selectedTicket?.price_id }, 221).then((additions) => {
|
|
177
|
-
if (additions != "") {
|
|
178
|
-
dataPost.addition = additions
|
|
179
|
-
}
|
|
180
|
-
LibNavigation.navigate('payment/ticket', {
|
|
181
|
-
order_type: eventConfig?.order_type?.ticket,
|
|
182
|
-
tax: getSelectedTicket()?.tax || data?.tax,
|
|
183
|
-
dataBookingEvent: dataPost,
|
|
184
|
-
fee_platform: {
|
|
185
|
-
fee_platform_amount: data?.fee_platform_amount,
|
|
186
|
-
fee_platform_type: data?.fee_platform_type,
|
|
187
|
-
},
|
|
188
|
-
subscribed: subscribed
|
|
189
|
-
})
|
|
190
|
-
})
|
|
191
|
-
} else {
|
|
192
|
-
LibNavigation.navigate('payment/ticket', {
|
|
193
|
-
order_type: eventConfig?.order_type?.ticket,
|
|
194
|
-
tax: getSelectedTicket()?.tax || data?.tax,
|
|
195
|
-
dataBookingEvent: dataPost,
|
|
196
|
-
fee_platform: {
|
|
197
|
-
fee_platform_amount: data?.fee_platform_amount,
|
|
198
|
-
fee_platform_type: data?.fee_platform_type,
|
|
199
|
-
},
|
|
200
|
-
subscribed: subscribed
|
|
137
|
+
dataTicket: finalDataPost,
|
|
201
138
|
})
|
|
139
|
+
|
|
140
|
+
finalDataPost = {
|
|
141
|
+
...finalDataPost,
|
|
142
|
+
seat_label: seat?.seat_label
|
|
143
|
+
}
|
|
202
144
|
}
|
|
203
145
|
}
|
|
146
|
+
|
|
147
|
+
finalDataPost = await handleAdditionIfNeeded(finalDataPost, qty)
|
|
148
|
+
const args = await buildPaymentArgs(finalDataPost, qty)
|
|
149
|
+
LibNavigation.navigate('payment/ticket', args)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
async function buildPaymentArgs(dataPost: any, qty: number) {
|
|
153
|
+
setLoading(true)
|
|
154
|
+
const conf = await curlPriceConfig(getSelectedTicket()?.price_id)
|
|
155
|
+
setLoading(false)
|
|
156
|
+
|
|
157
|
+
return {
|
|
158
|
+
order_type: eventConfig?.order_type?.ticket,
|
|
159
|
+
tax: conf?.tax ?? getSelectedTicket()?.tax ?? data?.tax ?? 0,
|
|
160
|
+
dataBookingEvent: { ...dataPost, qty },
|
|
161
|
+
subscribed,
|
|
162
|
+
fee_platform: conf?.fee_platform_amount != null
|
|
163
|
+
? {
|
|
164
|
+
fee_platform_amount: conf.fee_platform_amount || 0,
|
|
165
|
+
fee_platform_type: conf.fee_platform_type || "NONE",
|
|
166
|
+
}
|
|
167
|
+
: {
|
|
168
|
+
fee_platform_amount: data?.fee_platform_amount || 0,
|
|
169
|
+
fee_platform_type: data?.fee_platform_type || "NONE",
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
async function handleAdditionIfNeeded(dataPost: any, qty: number) {
|
|
175
|
+
if (getSelectedTicket()?.has_addition !== 1) return dataPost
|
|
176
|
+
|
|
177
|
+
const additions = await LibNavigation.navigateForResult(
|
|
178
|
+
'event/additional',
|
|
179
|
+
{
|
|
180
|
+
type_ticket: selectedTicket?.type,
|
|
181
|
+
ondate: selectedTicket?.list?.ondate,
|
|
182
|
+
event_id: data?.event_id,
|
|
183
|
+
qty,
|
|
184
|
+
data: dataPost,
|
|
185
|
+
price_id: selectedTicket?.price_id
|
|
186
|
+
},
|
|
187
|
+
221
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
return additions ? { ...dataPost, addition: additions } : dataPost
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
function curlPriceConfig(price_id: string): Promise<any> {
|
|
195
|
+
return new Promise((resolve) => {
|
|
196
|
+
if (!data?.url_price_config) {
|
|
197
|
+
resolve({})
|
|
198
|
+
return
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
new LibCurl(
|
|
202
|
+
data.url_price_config,
|
|
203
|
+
null,
|
|
204
|
+
(res) => {
|
|
205
|
+
resolve(res?.[price_id] || {})
|
|
206
|
+
},
|
|
207
|
+
(err) => {
|
|
208
|
+
LibToastProperty.show(err?.message)
|
|
209
|
+
resolve({})
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
})
|
|
204
213
|
}
|
|
205
214
|
|
|
206
215
|
function add(): void {
|
|
@@ -212,10 +221,27 @@ export default function m(props: EventArtist_detailProps): any {
|
|
|
212
221
|
}
|
|
213
222
|
|
|
214
223
|
function min(): void {
|
|
215
|
-
|
|
216
|
-
|
|
224
|
+
const currentQty = qty
|
|
225
|
+
const selectedTicket = getSelectedTicket()
|
|
226
|
+
|
|
227
|
+
// kalau qty - 1 <= 0 → set qty 0 dan unselect tiket
|
|
228
|
+
if (currentQty - 1 <= 0) {
|
|
229
|
+
setQty(0)
|
|
230
|
+
setSelectedTicket(null) // atau undefined sesuai project
|
|
231
|
+
return
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// ambil qty_min dengan cara manual
|
|
235
|
+
let qtyMin = 1 // default
|
|
236
|
+
if (selectedTicket && selectedTicket.qty_min) {
|
|
237
|
+
qtyMin = selectedTicket.qty_min
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// kurangi qty tapi tetap patuhi qty_min
|
|
241
|
+
if (currentQty <= qtyMin) {
|
|
242
|
+
setQty(qtyMin)
|
|
217
243
|
} else {
|
|
218
|
-
setQty(
|
|
244
|
+
setQty(currentQty - 1)
|
|
219
245
|
}
|
|
220
246
|
}
|
|
221
247
|
|
|
@@ -342,13 +368,13 @@ export default function m(props: EventArtist_detailProps): any {
|
|
|
342
368
|
item?.status == 1 && (ticketWithDate || ticketSpecial) && _selectedTicket &&
|
|
343
369
|
<View style={applyStyle({ marginTop: 4, flexDirection: 'row', marginLeft: 8, alignContent: 'center', alignItems: 'center' })}>
|
|
344
370
|
<TouchableOpacity onPress={() => { min() }}>
|
|
345
|
-
<View style={applyStyle({ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
|
|
371
|
+
<View style={applyStyle({ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", justifyContent: 'center', alignContent: 'center', alignItems: 'center' })}>
|
|
346
372
|
<LibIcon name="minus" color="#e74c3c" />
|
|
347
373
|
</View>
|
|
348
374
|
</TouchableOpacity>
|
|
349
375
|
<Text style={applyStyle({ fontFamily: "Arial", fontSize: 20, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#9b9b9b", marginLeft: 13, marginRight: 13 })}>{qty}</Text>
|
|
350
376
|
<TouchableOpacity onPress={() => { add() }}>
|
|
351
|
-
<View style={applyStyle({ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
|
|
377
|
+
<View style={applyStyle({ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", justifyContent: 'center', alignContent: 'center', alignItems: 'center' })}>
|
|
352
378
|
<LibIcon name="plus" color="#16a085" />
|
|
353
379
|
</View>
|
|
354
380
|
</TouchableOpacity>
|
|
@@ -528,11 +554,22 @@ export default function m(props: EventArtist_detailProps): any {
|
|
|
528
554
|
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 12, textAlign: "center", textAlignVertical: 'center', color: 'black', marginHorizontal: 10 })} >{esp.lang("event/artist_detail", "booking_end")}</Text>
|
|
529
555
|
</View>
|
|
530
556
|
:
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
557
|
+
<>
|
|
558
|
+
{
|
|
559
|
+
loading ?
|
|
560
|
+
<View style={{ minWidth: '100%', alignSelf: 'center' }} >
|
|
561
|
+
<View style={{ borderWidth: 1, borderColor: 'rgba(0, 0, 0, 0)', height: 40, borderRadius: 16, backgroundColor: "#e6e6e6", alignItems: 'center', justifyContent: 'center', paddingHorizontal: 9 }} >
|
|
562
|
+
<ActivityIndicator size={"small"} color={LibStyle.colorPrimary} />
|
|
563
|
+
</View>
|
|
564
|
+
</View>
|
|
565
|
+
:
|
|
566
|
+
<EventButton label={esp.lang("event/artist_detail", "buy_ticket")} onPress={() => {
|
|
567
|
+
EventIndexProperty.isLogin(() => {
|
|
568
|
+
proceedToPayment()
|
|
569
|
+
})
|
|
570
|
+
}} style={{ backgroundColor: LibStyle.colorGreen, marginTop: 2, marginHorizontal: 15 }} />
|
|
571
|
+
}
|
|
572
|
+
</>
|
|
536
573
|
}
|
|
537
574
|
</>
|
|
538
575
|
:
|
|
@@ -27,7 +27,7 @@ import useLazyState from 'esoftplay/lazy';
|
|
|
27
27
|
import moment from 'esoftplay/moment';
|
|
28
28
|
import useSafeState from 'esoftplay/state';
|
|
29
29
|
import React, { useEffect } from 'react';
|
|
30
|
-
import { Pressable, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
30
|
+
import { ActivityIndicator, Pressable, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
export interface EventArtist_detail_multiProps {
|
|
@@ -84,6 +84,7 @@ export default function m(props: EventArtist_detail_multiProps): any {
|
|
|
84
84
|
const [, setDataPostBooking, getDataPostBooking] = useLazyState<any>([])
|
|
85
85
|
const [dataAddition, setDataAddition] = useSafeState<any>([])
|
|
86
86
|
const [showAll, setShowAll] = useSafeState<any>({});
|
|
87
|
+
const [loading, setLoading] = useSafeState<boolean>(false)
|
|
87
88
|
|
|
88
89
|
|
|
89
90
|
useEffect(() => {
|
|
@@ -178,7 +179,7 @@ export default function m(props: EventArtist_detail_multiProps): any {
|
|
|
178
179
|
if (dataAddition?.length > 0) {
|
|
179
180
|
dataEvent.addition = dataAddition
|
|
180
181
|
}
|
|
181
|
-
|
|
182
|
+
let args: any = {
|
|
182
183
|
order_type: EventConfigProperty?.state()?.get()?.order_type?.ticket,
|
|
183
184
|
fee_platform: {
|
|
184
185
|
fee_platform_amount: data?.fee_platform_amount,
|
|
@@ -187,9 +188,39 @@ export default function m(props: EventArtist_detail_multiProps): any {
|
|
|
187
188
|
subscribed: subscribed,
|
|
188
189
|
dataEvent: dataEvent,
|
|
189
190
|
dataTicket: getDataPostBooking(),
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const selectedPriceIds = getDataPostBooking().filter((x: any) => x.selected == 1).map((x: any) => x.price_id)
|
|
194
|
+
curlPriceConfig(selectedPriceIds, (filteredFee) => {
|
|
195
|
+
const editedDataTicket = getDataPostBooking().map((item: any) => {
|
|
196
|
+
const priceId = item.price_id;
|
|
197
|
+
if (filteredFee?.[priceId]) {
|
|
198
|
+
return {
|
|
199
|
+
...item,
|
|
200
|
+
...filteredFee?.[priceId]
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
return item;
|
|
204
|
+
})
|
|
205
|
+
args["fee_platform"] = undefined
|
|
206
|
+
args["dataTicket"] = editedDataTicket
|
|
207
|
+
LibNavigation.navigate('payment/ticket_multi', args)
|
|
190
208
|
})
|
|
191
209
|
})
|
|
192
210
|
|
|
211
|
+
function curlPriceConfig(price_id: string, onDone: (data: any) => void) {
|
|
212
|
+
setLoading(true)
|
|
213
|
+
if (data?.url_price_config) {
|
|
214
|
+
new LibCurl(data?.url_price_config, null, (res, msg) => {
|
|
215
|
+
setLoading(false)
|
|
216
|
+
onDone(res?.[price_id])
|
|
217
|
+
}, (err) => {
|
|
218
|
+
setLoading(false)
|
|
219
|
+
LibToastProperty.show(err?.message)
|
|
220
|
+
})
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
193
224
|
function loadDataPrice() {
|
|
194
225
|
new LibCurl(data?.price_list_url, null, (res, msg) => {
|
|
195
226
|
|
|
@@ -334,18 +365,43 @@ export default function m(props: EventArtist_detail_multiProps): any {
|
|
|
334
365
|
item?.status == 1 && (ticketWithDate || ticketSpecial) && itemC.selected == 1 &&
|
|
335
366
|
<View style={applyStyle({ marginTop: 4, flexDirection: 'row', marginLeft: 8, alignContent: 'center', alignItems: 'center' })}>
|
|
336
367
|
<TouchableOpacity onPress={() => {
|
|
337
|
-
// min()
|
|
338
368
|
let qty = 1
|
|
339
|
-
if (itemC.qty <=
|
|
340
|
-
|
|
369
|
+
if (Number(itemC.qty) - 1 <= 0) {
|
|
370
|
+
// set 0 & unselect tiket
|
|
371
|
+
qty = 0
|
|
372
|
+
|
|
373
|
+
const data = new LibObject(priceList)
|
|
374
|
+
.update((itemList) => {
|
|
375
|
+
itemList.selected = 0
|
|
376
|
+
itemList.qty = 0
|
|
377
|
+
itemList.seat_autopick = item.config?.seat_autopick
|
|
378
|
+
itemList.use_seat = item.use_seat
|
|
379
|
+
return itemList
|
|
380
|
+
})(i, 'list', iC)
|
|
381
|
+
.update((priceTypeItem) => {
|
|
382
|
+
return ({
|
|
383
|
+
...priceTypeItem,
|
|
384
|
+
selected: priceTypeItem.list.some((item: any) => item.selected == 1) ? 1 : 0
|
|
385
|
+
})
|
|
386
|
+
})(i)
|
|
387
|
+
.value()
|
|
388
|
+
|
|
389
|
+
setPriceList(data)
|
|
390
|
+
|
|
341
391
|
} else {
|
|
342
|
-
|
|
343
|
-
|
|
392
|
+
// patuhi qty_min
|
|
393
|
+
if (itemC.qty <= item.qty_min) {
|
|
394
|
+
qty = Number(item.qty_min)
|
|
395
|
+
} else {
|
|
396
|
+
qty = Number(itemC.qty) - 1
|
|
397
|
+
}
|
|
344
398
|
|
|
345
|
-
|
|
399
|
+
// set qty baru
|
|
400
|
+
setPriceList(LibObject.set(getPriceList(), qty)(i, 'list', iC, 'qty'))
|
|
401
|
+
}
|
|
346
402
|
|
|
347
403
|
}}>
|
|
348
|
-
<View style={applyStyle({ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
|
|
404
|
+
<View style={applyStyle({ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", justifyContent: 'center', alignContent: 'center', alignItems: 'center' })}>
|
|
349
405
|
<LibIcon name="minus" color="#e74c3c" />
|
|
350
406
|
</View>
|
|
351
407
|
</TouchableOpacity>
|
|
@@ -363,7 +419,7 @@ export default function m(props: EventArtist_detail_multiProps): any {
|
|
|
363
419
|
setPriceList(LibObject.set(getPriceList(), qty)(i, 'list', iC, 'qty'))
|
|
364
420
|
|
|
365
421
|
}}>
|
|
366
|
-
<View style={applyStyle({ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
|
|
422
|
+
<View style={applyStyle({ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", justifyContent: 'center', alignContent: 'center', alignItems: 'center' })}>
|
|
367
423
|
<LibIcon name="plus" color="#16a085" />
|
|
368
424
|
</View>
|
|
369
425
|
</TouchableOpacity>
|
|
@@ -536,11 +592,21 @@ export default function m(props: EventArtist_detail_multiProps): any {
|
|
|
536
592
|
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 12, textAlign: "center", textAlignVertical: 'center', color: 'black', marginHorizontal: 10 })} >{esp.lang("event/artist_detail", "booking_end")}</Text>
|
|
537
593
|
</View>
|
|
538
594
|
:
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
595
|
+
<>
|
|
596
|
+
{
|
|
597
|
+
loading ?
|
|
598
|
+
<View style={{ minWidth: '100%', alignSelf: 'center' }} >
|
|
599
|
+
<View style={{ borderWidth: 1, borderColor: 'rgba(0, 0, 0, 0)', height: 40, borderRadius: 16, backgroundColor: "#e6e6e6", alignItems: 'center', justifyContent: 'center', paddingHorizontal: 9 }} >
|
|
600
|
+
<ActivityIndicator size={"small"} color={LibStyle.colorPrimary} />
|
|
601
|
+
</View>
|
|
602
|
+
</View> :
|
|
603
|
+
<EventButton label={esp.lang("event/artist_detail", "buy_ticket")} onPress={() => {
|
|
604
|
+
EventIndexProperty.isLogin(() => {
|
|
605
|
+
proceedToPayment()
|
|
606
|
+
})
|
|
607
|
+
}} style={{ backgroundColor: LibStyle.colorGreen, marginTop: 2, marginHorizontal: 15 }} />
|
|
608
|
+
}
|
|
609
|
+
</>
|
|
544
610
|
}
|
|
545
611
|
</>
|
|
546
612
|
:
|
|
@@ -14,6 +14,7 @@ import { LibProgress } from 'esoftplay/cache/lib/progress/import';
|
|
|
14
14
|
import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
|
|
15
15
|
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
16
16
|
import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
|
|
17
|
+
import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
|
|
17
18
|
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
18
19
|
import { UseCondition } from 'esoftplay/cache/use/condition/import';
|
|
19
20
|
import { UserClass } from 'esoftplay/cache/user/class/import';
|
|
@@ -55,6 +56,10 @@ export default function m(props: EventExchange_ticket_listProps): any {
|
|
|
55
56
|
return 0
|
|
56
57
|
}
|
|
57
58
|
|
|
59
|
+
function isEmptyObject(obj: any) {
|
|
60
|
+
return JSON.stringify(obj) === "{}";
|
|
61
|
+
}
|
|
62
|
+
|
|
58
63
|
return (
|
|
59
64
|
<View style={{ flex: 1, }}>
|
|
60
65
|
<EventHeader title={esp.lang("event/exchange_ticket", "exchange_history")} />
|
|
@@ -156,20 +161,24 @@ export default function m(props: EventExchange_ticket_listProps): any {
|
|
|
156
161
|
<EventButton
|
|
157
162
|
style={{ margin: 10 }}
|
|
158
163
|
label={esp.lang("event/tms_log", "btn_close")} onPress={() => {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
164
|
+
if (isEmptyObject(log)) {
|
|
165
|
+
LibToastProperty.show(esp.lang("event/tms_log", "empty_data"))
|
|
166
|
+
} else {
|
|
167
|
+
LibDialog.confirm(esp.lang("event/tms_log", "send_title"), "Kirim laporan scan exchange tiket ke admin?", esp.lang("event/tms_log", "send_ok"), () => {
|
|
168
|
+
LibProgress.show("Loading..")
|
|
169
|
+
sendTm("#closing_exchange\n" + JSON.stringify({
|
|
170
|
+
domain: esp.config('domain'),
|
|
171
|
+
tms_name: UserClass.state().get('name'),
|
|
172
|
+
email: UserClass.state().get('email'),
|
|
173
|
+
event_name: EventTms_dashboardProperty.closingDataState()?.get()?.event_name,
|
|
174
|
+
data: EventExchange_ticketProperty.stateExchangeLog.get()
|
|
175
|
+
}, undefined, 2), '-1001737180019', undefined, () => {
|
|
176
|
+
EventExchange_ticketProperty.stateExchangeLog.reset()
|
|
177
|
+
LibProgress.hide()
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
}, esp.lang("event/tms_log", "send_no"), () => { })
|
|
181
|
+
}
|
|
173
182
|
|
|
174
183
|
}} />
|
|
175
184
|
|