esoftplay-event 0.0.2-h → 0.0.2-j
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/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 +100 -33
- package/event/order_detail_visitor.tsx +16 -13
- package/event/scan_item.tsx +1 -1
- package/event/step.tsx +1 -1
- package/event/ticket_list.tsx +81 -42
- package/event/ticket_list2.tsx +103 -27
- package/event/tms_add_result.tsx +10 -5
- package/event/tms_gate.tsx +11 -0
- package/event/tms_home.tsx +23 -13
- package/event/tms_in.tsx +0 -2
- package/event/tms_in_hall_failed.tsx +1 -1
- package/event/visitor_index.tsx +1 -1
- package/id.json +4 -1
- package/package.json +1 -1
package/event/ticket_list.tsx
CHANGED
|
@@ -32,7 +32,7 @@ import esp from 'esoftplay/esp';
|
|
|
32
32
|
import useLazyState from 'esoftplay/lazy';
|
|
33
33
|
import useSafeState from 'esoftplay/state';
|
|
34
34
|
import React, { useEffect, useRef } from 'react';
|
|
35
|
-
import { Pressable, RefreshControl, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
35
|
+
import { ActivityIndicator, Pressable, RefreshControl, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
export interface EventTicket_listArgs {
|
|
@@ -127,6 +127,7 @@ export type Result = {
|
|
|
127
127
|
"more_url": string,
|
|
128
128
|
},
|
|
129
129
|
"url_share": string,
|
|
130
|
+
"url_price_config": string
|
|
130
131
|
}
|
|
131
132
|
|
|
132
133
|
export default function m(props: EventTicket_listProps): any {
|
|
@@ -152,6 +153,8 @@ export default function m(props: EventTicket_listProps): any {
|
|
|
152
153
|
const [isPass, setIsPass] = useSafeState(true)
|
|
153
154
|
const [showAll, setShowAll] = useSafeState<any>({});
|
|
154
155
|
|
|
156
|
+
const [loading, setLoading] = useSafeState<boolean>(false)
|
|
157
|
+
|
|
155
158
|
useEffect(() => {
|
|
156
159
|
EventConfigProperty.curlConfig('v2/config_order_type')
|
|
157
160
|
const { event_id } = EventQueue_pricingProperty.state().get()
|
|
@@ -220,10 +223,27 @@ export default function m(props: EventTicket_listProps): any {
|
|
|
220
223
|
}
|
|
221
224
|
|
|
222
225
|
function min(): void {
|
|
223
|
-
|
|
224
|
-
|
|
226
|
+
const currentQty = getQty()
|
|
227
|
+
const selectedTicket = getSelectedTicket()
|
|
228
|
+
|
|
229
|
+
// kalau qty - 1 <= 0 → set qty 0 dan unselect tiket
|
|
230
|
+
if (currentQty - 1 <= 0) {
|
|
231
|
+
setQty(0)
|
|
232
|
+
setSelectedTicket(null) // atau undefined sesuai project
|
|
233
|
+
return
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// ambil qty_min dengan cara manual
|
|
237
|
+
let qtyMin = 1 // default
|
|
238
|
+
if (selectedTicket && selectedTicket.qty_min) {
|
|
239
|
+
qtyMin = selectedTicket.qty_min
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// kurangi qty tapi tetap patuhi qty_min
|
|
243
|
+
if (currentQty <= qtyMin) {
|
|
244
|
+
setQty(qtyMin)
|
|
225
245
|
} else {
|
|
226
|
-
setQty(
|
|
246
|
+
setQty(currentQty - 1)
|
|
227
247
|
}
|
|
228
248
|
}
|
|
229
249
|
|
|
@@ -264,32 +284,42 @@ export default function m(props: EventTicket_listProps): any {
|
|
|
264
284
|
qty: getQty(),
|
|
265
285
|
}
|
|
266
286
|
|
|
267
|
-
function checkAddition(newDataPost: any) {
|
|
287
|
+
async function checkAddition(newDataPost: any) {
|
|
268
288
|
if ((selectedTicket?.hasOwnProperty("has_addition") && selectedTicket?.has_addition == 1)) {
|
|
269
|
-
LibNavigation.navigateForResult('event/additional', { type_ticket: selectedTicket?.type, ondate: selectedTicket?.list?.ondate, event_id: availableResult?.id, qty: getQty(), price_id: selectedTicket?.price_id }, 321)
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
tax: selectedTicket?.tax == null ? 0 : selectedTicket?.tax,
|
|
276
|
-
fee_platform: fee_platform,
|
|
277
|
-
dataBookingEvent: { ...newDataPost, qty: getQty() },
|
|
278
|
-
subscribed: subscribed,
|
|
279
|
-
url_payment: urlPayment,
|
|
280
|
-
show_fee_percentage
|
|
281
|
-
})
|
|
282
|
-
})
|
|
283
|
-
} else {
|
|
289
|
+
const additions = await LibNavigation.navigateForResult('event/additional', { type_ticket: selectedTicket?.type, ondate: selectedTicket?.list?.ondate, event_id: availableResult?.id, qty: getQty(), price_id: selectedTicket?.price_id }, 321)
|
|
290
|
+
if (additions != "") {
|
|
291
|
+
newDataPost.addition = additions
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
curlPriceConfig(getSelectedTicket()?.price_id, (config) => {
|
|
284
295
|
LibNavigation.navigate('payment/ticket', {
|
|
285
296
|
order_type: eventConfig?.order_type?.ticket,
|
|
286
|
-
tax:
|
|
287
|
-
fee_platform:
|
|
297
|
+
tax: config?.tax || selectedTicket?.tax || 0,
|
|
298
|
+
fee_platform: Boolean(config?.fee_platform_amount) ? {
|
|
299
|
+
fee_platform_amount: config?.fee_platform_amount || 0,
|
|
300
|
+
fee_platform_type: config?.fee_platform_type || "NONE"
|
|
301
|
+
} : fee_platform,
|
|
288
302
|
dataBookingEvent: { ...newDataPost, qty: getQty() },
|
|
289
303
|
subscribed: subscribed,
|
|
290
304
|
url_payment: urlPayment,
|
|
291
305
|
show_fee_percentage
|
|
292
306
|
})
|
|
307
|
+
})
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function curlPriceConfig(price_id: string, onDone: (data: any) => void) {
|
|
311
|
+
setLoading(true)
|
|
312
|
+
if (getAvailableResult()?.url_price_config) {
|
|
313
|
+
new LibCurl(getAvailableResult()?.url_price_config, null, (res, msg) => {
|
|
314
|
+
setLoading(false)
|
|
315
|
+
onDone(res?.[price_id])
|
|
316
|
+
}, (err) => {
|
|
317
|
+
setLoading(false)
|
|
318
|
+
LibToastProperty.show(err?.message)
|
|
319
|
+
})
|
|
320
|
+
} else {
|
|
321
|
+
setLoading(false)
|
|
322
|
+
onDone({})
|
|
293
323
|
}
|
|
294
324
|
}
|
|
295
325
|
|
|
@@ -459,7 +489,7 @@ export default function m(props: EventTicket_listProps): any {
|
|
|
459
489
|
(ticketWithDate || ticketSpecial) && item.price_id == selectedTicket?.price_id && itemT.date_id == selectedTicket?.list?.date_id &&
|
|
460
490
|
<View style={applyStyle({ marginTop: 4, flexDirection: 'row', marginLeft: 8, alignContent: 'center', alignItems: 'center' })}>
|
|
461
491
|
<Pressable hitSlop={{ top: 15, left: 15, right: 15, bottom: 15 }} testID='minus_btn' onPress={() => { min() }}>
|
|
462
|
-
<View style={applyStyle({ padding: 1, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
|
|
492
|
+
<View style={applyStyle({ padding: 1, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center', justifyContent: 'center' })}>
|
|
463
493
|
<LibIcon name="minus" color="#e74c3c" />
|
|
464
494
|
</View>
|
|
465
495
|
</Pressable>
|
|
@@ -468,7 +498,7 @@ export default function m(props: EventTicket_listProps): any {
|
|
|
468
498
|
<Pressable hitSlop={{ top: 15, left: 15, right: 15, bottom: 15 }} testID='plus_btn' onPress={() => {
|
|
469
499
|
add(itemT.quota, itemT.quota_used)
|
|
470
500
|
}}>
|
|
471
|
-
<View style={applyStyle({ padding: 1, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
|
|
501
|
+
<View style={applyStyle({ padding: 1, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center', justifyContent: 'center' })}>
|
|
472
502
|
<LibIcon name="plus" color="#16a085" />
|
|
473
503
|
</View>
|
|
474
504
|
</Pressable>
|
|
@@ -624,7 +654,7 @@ export default function m(props: EventTicket_listProps): any {
|
|
|
624
654
|
}
|
|
625
655
|
|
|
626
656
|
<View style={{ alignContent: 'center', alignItems: 'center', flexDirection: 'row', justifyContent: 'space-between', }}>
|
|
627
|
-
<View>
|
|
657
|
+
<View style={{ flex: 2 }}>
|
|
628
658
|
<EventHtmltext allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.type}
|
|
629
659
|
{
|
|
630
660
|
item.qty_min > 1 &&
|
|
@@ -643,7 +673,7 @@ export default function m(props: EventTicket_listProps): any {
|
|
|
643
673
|
</View>
|
|
644
674
|
{
|
|
645
675
|
item?.status != 1 &&
|
|
646
|
-
<View style={applyStyle({ flexDirection: 'row' })}>
|
|
676
|
+
<View style={applyStyle({ flex: 1, justifyContent: 'flex-end', flexDirection: 'row' })}>
|
|
647
677
|
<View style={applyStyle({ alignContent: 'center', alignItems: 'center', justifyContent: 'center', borderWidth: 1, backgroundColor: item.status == 0 ? LibStyle.colorRed : "#4cd964", borderColor: item.status == 0 ? LibStyle.colorRed : "#4cd964", borderRadius: 5, padding: 3, opacity: 0.8 })}>
|
|
648
678
|
<Text allowFontScaling={false} style={applyStyle({ fontSize: 10, fontStyle: "normal", letterSpacing: 0, color: /* item.status == 2 ? "#000" : */ "#fff", fontWeight: 'bold' })}>{item.status == 0 ? esp.lang("event/ticket_list", "sold_out") : esp.lang("event/ticket_list", "coming_soon")}</Text>
|
|
649
679
|
</View>
|
|
@@ -729,22 +759,31 @@ export default function m(props: EventTicket_listProps): any {
|
|
|
729
759
|
availableResult?.price_type_info != "" &&
|
|
730
760
|
<Text allowFontScaling={false} style={applyStyle({ marginBottom: 10, fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: LibStyle.colorBlue })} >{availableResult && availableResult?.hasOwnProperty("price_type_info") && availableResult?.price_type_info}</Text>
|
|
731
761
|
}
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
762
|
+
{
|
|
763
|
+
loading ?
|
|
764
|
+
<View style={{ minWidth: '100%', alignSelf: 'center' }} >
|
|
765
|
+
<View style={{ borderWidth: 1, borderColor: 'rgba(0, 0, 0, 0)', height: 40, borderRadius: 16, backgroundColor: "#e6e6e6", alignItems: 'center', justifyContent: 'center', paddingHorizontal: 9 }} >
|
|
766
|
+
<ActivityIndicator size={"small"} color={LibStyle.colorPrimary} />
|
|
767
|
+
</View>
|
|
768
|
+
</View>
|
|
769
|
+
:
|
|
770
|
+
<EventButton testID={"next_btn"} label={esp.lang("event/ticket_list", "next")} onPress={() => {
|
|
771
|
+
if (!selectedTicket) {
|
|
772
|
+
LibToastProperty.show(esp.lang("event/ticket_list", "ticket_not_select"), 3000)
|
|
773
|
+
return
|
|
774
|
+
}
|
|
775
|
+
if (selectedTicket?.use_code == 1) {
|
|
776
|
+
checkInvBlock()
|
|
777
|
+
}
|
|
778
|
+
// else if (selectedTicket?.config?.seat_autopick == 1 && getQty() > 1) {
|
|
779
|
+
// chooseBestSeat()
|
|
780
|
+
// }
|
|
781
|
+
else {
|
|
782
|
+
nextStep();
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
}} style={applyStyle({ backgroundColor: selectedTicket ? LibStyle.colorPrimary : "#f1f2f3" })} />
|
|
786
|
+
}
|
|
748
787
|
</View>
|
|
749
788
|
</>
|
|
750
789
|
}
|
package/event/ticket_list2.tsx
CHANGED
|
@@ -26,13 +26,14 @@ import { EventCountdown_timestamp } from 'esoftplay/cache/event/countdown_timest
|
|
|
26
26
|
import { EventFirebase_socket, EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
|
|
27
27
|
import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
|
|
28
28
|
import { EventLoading_pageProperty } from 'esoftplay/cache/event/loading_page/import';
|
|
29
|
+
import { EventOrder_itemProperty } from 'esoftplay/cache/event/order_item/import';
|
|
29
30
|
import { EventQueue_pricingProperty } from 'esoftplay/cache/event/queue_pricing/import';
|
|
30
31
|
import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
|
|
31
32
|
import { UseCondition } from 'esoftplay/cache/use/condition/import';
|
|
32
33
|
import { UseTasks } from 'esoftplay/cache/use/tasks/import';
|
|
33
34
|
import moment from 'esoftplay/moment';
|
|
34
35
|
import React from 'react';
|
|
35
|
-
import { Pressable, RefreshControl, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
36
|
+
import { ActivityIndicator, Pressable, RefreshControl, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
36
37
|
|
|
37
38
|
|
|
38
39
|
export interface EventTicket_list2Args {
|
|
@@ -127,6 +128,7 @@ type Result = {
|
|
|
127
128
|
"more_url": string,
|
|
128
129
|
},
|
|
129
130
|
"url_share": string,
|
|
131
|
+
"url_price_config": string
|
|
130
132
|
}
|
|
131
133
|
|
|
132
134
|
const taskSeat = UseTasks()
|
|
@@ -151,6 +153,7 @@ export default function m(props: EventTicket_list2Props): any {
|
|
|
151
153
|
const [isPass, setIsPass] = useSafeState(true)
|
|
152
154
|
const [showAll, setShowAll] = useSafeState<any>({});
|
|
153
155
|
const [urlPayment, setUrlPayment] = useLazyState<any>()
|
|
156
|
+
const [loading, setLoading] = useSafeState<boolean>(false)
|
|
154
157
|
|
|
155
158
|
let dataEvent: any = {
|
|
156
159
|
event_id: availableResult?.id,
|
|
@@ -256,17 +259,52 @@ export default function m(props: EventTicket_list2Props): any {
|
|
|
256
259
|
dataEvent.addition = dataAddition
|
|
257
260
|
}
|
|
258
261
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
262
|
+
const selectedPriceIds = getDataPostBooking().filter((x: any) => x.selected == 1).map((x: any) => x.price_id)
|
|
263
|
+
curlPriceConfig(selectedPriceIds, (filteredFee) => {
|
|
264
|
+
const editedDataTicket = getDataPostBooking().map((item: any) => {
|
|
265
|
+
const priceId = item.price_id;
|
|
266
|
+
if (filteredFee?.[priceId]) {
|
|
267
|
+
return {
|
|
268
|
+
...item,
|
|
269
|
+
...filteredFee?.[priceId]
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
return item;
|
|
273
|
+
})
|
|
274
|
+
LibNavigation.navigate('payment/ticket_multi', {
|
|
275
|
+
order_type: EventConfigProperty?.state()?.get()?.order_type?.ticket,
|
|
276
|
+
dataEvent: dataEvent,
|
|
277
|
+
dataTicket: editedDataTicket,
|
|
278
|
+
subscribed: subscribed,
|
|
279
|
+
url_payment: urlPayment,
|
|
280
|
+
show_fee_percentage
|
|
281
|
+
})
|
|
267
282
|
})
|
|
283
|
+
|
|
268
284
|
})
|
|
269
285
|
|
|
286
|
+
function curlPriceConfig(price_ids: string[], onDone: (data: any) => void) {
|
|
287
|
+
setLoading(true)
|
|
288
|
+
if (getAvailableResult()?.url_price_config) {
|
|
289
|
+
new LibCurl(getAvailableResult()?.url_price_config, null, (res, msg) => {
|
|
290
|
+
setLoading(false)
|
|
291
|
+
let filteredFee: any = {}
|
|
292
|
+
if (res) {
|
|
293
|
+
filteredFee = Object.fromEntries(
|
|
294
|
+
price_ids.flatMap(k => res[k] ? [[k, res[k]]] : [])
|
|
295
|
+
)
|
|
296
|
+
}
|
|
297
|
+
onDone(filteredFee)
|
|
298
|
+
}, (err) => {
|
|
299
|
+
setLoading(false)
|
|
300
|
+
LibToastProperty.show(err?.message)
|
|
301
|
+
})
|
|
302
|
+
} else {
|
|
303
|
+
setLoading(false)
|
|
304
|
+
onDone({})
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
270
308
|
useEffect(() => {
|
|
271
309
|
EventConfigProperty.curlConfig('v2/config_order_type')
|
|
272
310
|
const { event_id } = EventQueue_pricingProperty.state().get()
|
|
@@ -347,6 +385,8 @@ export default function m(props: EventTicket_list2Props): any {
|
|
|
347
385
|
image_map: priceType?.image_map,
|
|
348
386
|
use_seat: priceType?.use_seat,
|
|
349
387
|
adjacent_seats: priceType?.config?.seat_autopick,
|
|
388
|
+
fee_amount: priceType?.fee_amount,
|
|
389
|
+
fee_type: priceType?.fee_type,
|
|
350
390
|
}))
|
|
351
391
|
|
|
352
392
|
newResult = newResult.concat(filteredList);
|
|
@@ -522,18 +562,45 @@ export default function m(props: EventTicket_list2Props): any {
|
|
|
522
562
|
(ticketWithDate || ticketSpecial) && itemC.selected == 1 &&
|
|
523
563
|
<View style={applyStyle({ marginTop: 4, flexDirection: 'row', marginLeft: 8, alignContent: 'center', alignItems: 'center' })}>
|
|
524
564
|
<Pressable hitSlop={{ top: 15, left: 15, right: 15, bottom: 15 }} testID='minus_btn' onPress={() => {
|
|
525
|
-
|
|
565
|
+
|
|
526
566
|
let qty = 1
|
|
527
|
-
|
|
528
|
-
|
|
567
|
+
|
|
568
|
+
if (Number(itemC.qty) - 1 <= 0) {
|
|
569
|
+
// set 0 & unselect tiket
|
|
570
|
+
qty = 0
|
|
571
|
+
|
|
572
|
+
const data = new LibObject(getAvailableResult())
|
|
573
|
+
.update((itemList) => {
|
|
574
|
+
itemList.selected = 0 // langsung unselect
|
|
575
|
+
itemList.qty = 0
|
|
576
|
+
itemList.adjacent_seats = item.config?.seat_autopick
|
|
577
|
+
itemList.use_seat = item.use_seat
|
|
578
|
+
return itemList
|
|
579
|
+
})('price_type', i, 'list', iC)
|
|
580
|
+
.update((priceTypeItem) => {
|
|
581
|
+
return ({
|
|
582
|
+
...priceTypeItem,
|
|
583
|
+
selected: priceTypeItem.list.some((item: any) => item.selected == 1) ? 1 : 0
|
|
584
|
+
})
|
|
585
|
+
})('price_type', i)
|
|
586
|
+
.value()
|
|
587
|
+
|
|
588
|
+
setAvailableResult(data)
|
|
589
|
+
|
|
529
590
|
} else {
|
|
530
|
-
|
|
531
|
-
|
|
591
|
+
// patuhi qty_min
|
|
592
|
+
if (itemC.qty <= item.qty_min) {
|
|
593
|
+
qty = Number(item.qty_min)
|
|
594
|
+
} else {
|
|
595
|
+
qty = Number(itemC.qty) - 1
|
|
596
|
+
}
|
|
532
597
|
|
|
533
|
-
|
|
598
|
+
// set qty baru
|
|
599
|
+
setAvailableResult(LibObject.set(getAvailableResult(), qty)('price_type', i, 'list', iC, 'qty'))
|
|
600
|
+
}
|
|
534
601
|
|
|
535
602
|
}}>
|
|
536
|
-
<View style={applyStyle({ padding: 1, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
|
|
603
|
+
<View style={applyStyle({ padding: 1, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center', justifyContent: 'center' })}>
|
|
537
604
|
<LibIcon name="minus" color="#e74c3c" />
|
|
538
605
|
</View>
|
|
539
606
|
</Pressable>
|
|
@@ -550,7 +617,7 @@ export default function m(props: EventTicket_list2Props): any {
|
|
|
550
617
|
}
|
|
551
618
|
setAvailableResult(LibObject.set(getAvailableResult(), qty)('price_type', i, 'list', iC, 'qty'))
|
|
552
619
|
}}>
|
|
553
|
-
<View style={applyStyle({ padding: 1, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
|
|
620
|
+
<View style={applyStyle({ padding: 1, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center', justifyContent: 'center' })}>
|
|
554
621
|
<LibIcon name="plus" color="#16a085" />
|
|
555
622
|
</View>
|
|
556
623
|
</Pressable>
|
|
@@ -708,7 +775,7 @@ export default function m(props: EventTicket_list2Props): any {
|
|
|
708
775
|
</View>
|
|
709
776
|
}
|
|
710
777
|
<View style={{ alignContent: 'center', alignItems: 'center', flexDirection: 'row', justifyContent: 'space-between', }}>
|
|
711
|
-
<View>
|
|
778
|
+
<View style={{ flex: 2 }}>
|
|
712
779
|
<EventHtmltext allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.type}
|
|
713
780
|
{
|
|
714
781
|
item.qty_min > 1 &&
|
|
@@ -729,7 +796,7 @@ export default function m(props: EventTicket_list2Props): any {
|
|
|
729
796
|
|
|
730
797
|
{
|
|
731
798
|
item?.status != 1 &&
|
|
732
|
-
<View style={applyStyle({ flexDirection: 'row' })}>
|
|
799
|
+
<View style={applyStyle({ flex: 1, justifyContent: 'flex-end', flexDirection: 'row' })}>
|
|
733
800
|
<View style={applyStyle({ alignContent: 'center', alignItems: 'center', justifyContent: 'center', borderWidth: 1, backgroundColor: item.status == 0 ? LibStyle.colorRed : "#4cd964", borderColor: item.status == 0 ? LibStyle.colorRed : "#4cd964", borderRadius: 5, padding: 3, opacity: 0.8 })}>
|
|
734
801
|
<Text allowFontScaling={false} style={applyStyle({ fontSize: 10, fontStyle: "normal", letterSpacing: 0, color: item.status == 2 ? "#000" : "#fff", fontWeight: 'bold' })}>{item.status == 0 ? esp.lang("event/ticket_list", "sold_out") : esp.lang("event/ticket_list", "coming_soon")}</Text>
|
|
735
802
|
</View>
|
|
@@ -810,15 +877,24 @@ export default function m(props: EventTicket_list2Props): any {
|
|
|
810
877
|
availableResult?.price_type_info != "" &&
|
|
811
878
|
<Text allowFontScaling={false} style={applyStyle({ marginBottom: 10, fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: LibStyle.colorBlue })} >{availableResult && availableResult?.hasOwnProperty("price_type_info") && availableResult?.price_type_info}</Text>
|
|
812
879
|
}
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
880
|
+
{
|
|
881
|
+
loading ?
|
|
882
|
+
<View style={{ minWidth: '100%', alignSelf: 'center' }} >
|
|
883
|
+
<View style={{ borderWidth: 1, borderColor: 'rgba(0, 0, 0, 0)', height: 40, borderRadius: 16, backgroundColor: "#e6e6e6", alignItems: 'center', justifyContent: 'center', paddingHorizontal: 9 }} >
|
|
884
|
+
<ActivityIndicator size={"small"} color={LibStyle.colorPrimary} />
|
|
885
|
+
</View>
|
|
886
|
+
</View>
|
|
887
|
+
:
|
|
888
|
+
<EventButton testID={"next_btn"} label={esp.lang("event/ticket_list", "next")} onPress={() => {
|
|
889
|
+
if (availableResult?.price_type.some((item: any) => item.selected == 1)) {
|
|
890
|
+
checkSeatMap();
|
|
891
|
+
} else {
|
|
892
|
+
LibToastProperty.show(esp.lang("event/ticket_list", "ticket_not_select"), 3000)
|
|
893
|
+
return
|
|
894
|
+
}
|
|
820
895
|
|
|
821
|
-
|
|
896
|
+
}} style={applyStyle({ backgroundColor: LibStyle.colorPrimary })} />
|
|
897
|
+
}
|
|
822
898
|
</View>
|
|
823
899
|
</>
|
|
824
900
|
}
|
package/event/tms_add_result.tsx
CHANGED
|
@@ -73,11 +73,16 @@ export default function m(props: EventTms_add_resultProps): any {
|
|
|
73
73
|
|
|
74
74
|
new LibCurl('event_tms_access' + LibUtils.objectToUrlParam(post), null, (res, msg) => {
|
|
75
75
|
if (is_add) {
|
|
76
|
-
const updatedPrice = res.price
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
const updatedPrice = [...res.price]
|
|
77
|
+
.map((item: any) => {
|
|
78
|
+
return { ...item, is_selected: "1" }
|
|
79
|
+
})
|
|
80
|
+
.sort((a: any, b: any) =>
|
|
81
|
+
a.name.localeCompare(b.name, 'id', { sensitivity: 'base' })
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
const updatedData = { ...res, price: updatedPrice }
|
|
79
85
|
|
|
80
|
-
const updatedData = { ...res, price: updatedPrice }; // Menggabungkan kembali data dengan price yang telah diperbarui
|
|
81
86
|
setTicketTypes(updatedData)
|
|
82
87
|
|
|
83
88
|
} else {
|
|
@@ -139,7 +144,7 @@ export default function m(props: EventTms_add_resultProps): any {
|
|
|
139
144
|
|
|
140
145
|
{
|
|
141
146
|
ticketTypes &&
|
|
142
|
-
<View style={{ marginTop: 10 }}>
|
|
147
|
+
<View style={{ marginTop: 10, marginBottom: 10 }}>
|
|
143
148
|
<LibTextstyle textStyle='m_overline' text={esp.lang("event/tms_add_result", "ticket_type")} style={{ fontSize: 12, marginTop: 15, marginBottom: 15 }} />
|
|
144
149
|
{
|
|
145
150
|
ticketTypes?.price?.map((item: any, i: number) => {
|
package/event/tms_gate.tsx
CHANGED
|
@@ -11,6 +11,7 @@ import useSafeState from 'esoftplay/state';
|
|
|
11
11
|
|
|
12
12
|
import { EventTms_dashboardProperty } from 'esoftplay/cache/event/tms_dashboard/import';
|
|
13
13
|
import { LibObject } from 'esoftplay/cache/lib/object/import';
|
|
14
|
+
import useGlobalState, { useGlobalReturn } from 'esoftplay/global';
|
|
14
15
|
import React, { useEffect } from 'react';
|
|
15
16
|
import { Pressable, ScrollView, Text, View } from 'react-native';
|
|
16
17
|
|
|
@@ -21,6 +22,13 @@ export interface EventTms_gateArgs {
|
|
|
21
22
|
export interface EventTms_gateProps {
|
|
22
23
|
|
|
23
24
|
}
|
|
25
|
+
|
|
26
|
+
const stateGate = useGlobalState({})
|
|
27
|
+
|
|
28
|
+
export function stateSelectedGate(): useGlobalReturn<any> {
|
|
29
|
+
return stateGate
|
|
30
|
+
}
|
|
31
|
+
|
|
24
32
|
export default function m(props: EventTms_gateProps): any {
|
|
25
33
|
const { is_scanner, typeScanner } = LibNavigation.getArgsAll(props)
|
|
26
34
|
|
|
@@ -46,6 +54,7 @@ export default function m(props: EventTms_gateProps): any {
|
|
|
46
54
|
EventTms_dashboardProperty.closingDataState().set(a)
|
|
47
55
|
LibNavigation.back()
|
|
48
56
|
LibNavigation.navigate('event/tms_home', { is_scanner: is_scanner, selectedGate: res[0], typeScanner: typeScanner })
|
|
57
|
+
stateSelectedGate().set(res?.[0])
|
|
49
58
|
}
|
|
50
59
|
}, (error) => {
|
|
51
60
|
LibDialog.warning(esp.lang("event/tms_gate", "warning_load"), error?.message)
|
|
@@ -62,6 +71,7 @@ export default function m(props: EventTms_gateProps): any {
|
|
|
62
71
|
if (res.length == 1) {
|
|
63
72
|
LibNavigation.back()
|
|
64
73
|
LibNavigation.navigate('event/tms_home', { is_scanner: is_scanner, selectedGate: res[0], typeScanner: typeScanner })
|
|
74
|
+
stateSelectedGate().set(res?.[0])
|
|
65
75
|
}
|
|
66
76
|
}, (error) => {
|
|
67
77
|
LibDialog.warning(esp.lang("event/tms_gate", "warning_loadhall"), error?.message)
|
|
@@ -74,6 +84,7 @@ export default function m(props: EventTms_gateProps): any {
|
|
|
74
84
|
return (
|
|
75
85
|
<Pressable key={i} onPress={() => {
|
|
76
86
|
setSelectGate(item)
|
|
87
|
+
stateSelectedGate().set(item)
|
|
77
88
|
let a = LibObject.set(EventTms_dashboardProperty.closingDataState().get(), item?.id)('gate_id')
|
|
78
89
|
EventTms_dashboardProperty.closingDataState().set(a)
|
|
79
90
|
LibNavigation.navigate('event/tms_home', { is_scanner: is_scanner, selectedGate: item, typeScanner: typeScanner })
|
package/event/tms_home.tsx
CHANGED
|
@@ -36,6 +36,12 @@ export interface EventTms_homeProps {
|
|
|
36
36
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
const statePriority = useGlobalState({})
|
|
40
|
+
|
|
41
|
+
export function stateConfigPriority(): useGlobalReturn<any> {
|
|
42
|
+
return statePriority
|
|
43
|
+
}
|
|
44
|
+
|
|
39
45
|
const stateIsDirect = useGlobalState<boolean>(true)
|
|
40
46
|
|
|
41
47
|
export function state(): useGlobalReturn<any> {
|
|
@@ -373,6 +379,7 @@ export default function m(props: EventTms_homeProps): any {
|
|
|
373
379
|
loadData()
|
|
374
380
|
loadDataTypeTicket()
|
|
375
381
|
loadDataConfigPriority()
|
|
382
|
+
|
|
376
383
|
}, [])
|
|
377
384
|
|
|
378
385
|
function loadDataTypeTicket() {
|
|
@@ -401,6 +408,7 @@ export default function m(props: EventTms_homeProps): any {
|
|
|
401
408
|
function loadDataConfigPriority() {
|
|
402
409
|
new LibCurl('event_tms_access_price?event_id=' + is_scanner?.id, null, (res, msg) => {
|
|
403
410
|
setResultConfigPriority(res)
|
|
411
|
+
stateConfigPriority().set(res)
|
|
404
412
|
setRefreshing(false)
|
|
405
413
|
}, (error) => {
|
|
406
414
|
setRefreshing(false)
|
|
@@ -574,19 +582,21 @@ export default function m(props: EventTms_homeProps): any {
|
|
|
574
582
|
</TouchableOpacity>
|
|
575
583
|
|
|
576
584
|
<TouchableOpacity onPress={() => {
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
585
|
+
if (esp.isDebug("") && UserClass?.state().get().email == "bagus@fisip.net") {
|
|
586
|
+
LibNavigation.navigateForResult('component/scanner').then((value) => {
|
|
587
|
+
LibNavigation.replace('tms/tms_in', { qr_code: value })
|
|
588
|
+
})
|
|
589
|
+
} else {
|
|
590
|
+
LibNavigation.navigate('component/scanner', {
|
|
591
|
+
fromPage: 'event/tms_home',
|
|
592
|
+
scan_type: typeScanner == "tms" ? 'entrance' : 'hall_in',
|
|
593
|
+
gate_type: 1, // ini kalo 1 itu in
|
|
594
|
+
price_type: resultTypeTicket,
|
|
595
|
+
url_ticket_detail: result?.url_ticket_detail,
|
|
596
|
+
url_ticket_update: result?.url_ticket_update,
|
|
597
|
+
...args
|
|
598
|
+
})
|
|
599
|
+
}
|
|
590
600
|
}} style={applyStyle({ width: (LibStyle.width - 40) * 0.5, borderWidth: 1, borderColor: 'rgba(0, 0, 0, 0)', height: 40, borderRadius: 16, backgroundColor: LibStyle.colorGreen, flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center', paddingHorizontal: 9 })} >
|
|
591
601
|
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: '#fff', marginRight: 15 })} >{esp.lang("event/tms_home", "entrance")}</Text>
|
|
592
602
|
<LibIcon size={18} color="#fff" name="login" />
|
package/event/tms_in.tsx
CHANGED
|
@@ -109,7 +109,6 @@ export default function m(props: EventTms_inProps): any {
|
|
|
109
109
|
let tikets: any[] = []
|
|
110
110
|
EventTms_homeProperty.addCounterEntranceScan(1, "0")
|
|
111
111
|
get(mainPath(encodeURIComponent(encodeURIComponent(qr_code))), selectGate?.id, (res) => {
|
|
112
|
-
esp.log({ res });
|
|
113
112
|
if (!res) {
|
|
114
113
|
LibNavigation.replace('event/tms_in_failed', {
|
|
115
114
|
text: esp.lang("event/tms_in", "ticket_empty_today"),
|
|
@@ -152,7 +151,6 @@ export default function m(props: EventTms_inProps): any {
|
|
|
152
151
|
tikets.push(a)
|
|
153
152
|
}
|
|
154
153
|
})
|
|
155
|
-
|
|
156
154
|
if (tikets.length > 0) {
|
|
157
155
|
if (tikets.length == 1) {
|
|
158
156
|
const tiket = tikets[0];
|
|
@@ -183,7 +183,7 @@ export default function m(props: EventTms_in_hall_failedProps): any {
|
|
|
183
183
|
<View key={i} style={{ marginHorizontal: 10, marginBottom: 5, backgroundColor: "#fff", borderRadius: 10, overflow: 'hidden' }}>
|
|
184
184
|
{
|
|
185
185
|
item.hasOwnProperty("status_label") && item?.status_label != "" &&
|
|
186
|
-
<View style={{ backgroundColor: '#37c2d0', padding: 10, }} >
|
|
186
|
+
<View style={{ backgroundColor: item?.status_scanned == 1 ? '#37c2d0' : '#ffcb3dff', padding: 10, }} >
|
|
187
187
|
<Text allowFontScaling={false} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", letterSpacing: 1.5, color: item?.status == 1 ? item?.status_background : "#fff" }}>{(item?.status_label)?.toUpperCase()}</Text>
|
|
188
188
|
</View>
|
|
189
189
|
}
|
package/event/visitor_index.tsx
CHANGED
|
@@ -80,7 +80,7 @@ export default function m(props: EventVisitor_indexProps): any {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
var post = {
|
|
83
|
-
access_code: argsCode ? argsCode : inputAccessCode?.current?.getText().toUpperCase()
|
|
83
|
+
access_code: argsCode ? argsCode : inputAccessCode?.current?.getText().toUpperCase().trim()
|
|
84
84
|
}
|
|
85
85
|
LibProgress.show(esp.lang("event/visitor_index", "waiting_msg"))
|
|
86
86
|
new LibCurl('event_exhibitor_code', post, (res, msg) => {
|
package/id.json
CHANGED
|
@@ -930,8 +930,10 @@
|
|
|
930
930
|
"event/order_detail": {
|
|
931
931
|
"Checked_within_10_minutes_after_payment_is_made": "Dicek dalam 10 menit setelah pembayaran dilakukan",
|
|
932
932
|
"This_Event_Has_Changed_the_Event_Date_Please_Reschedule_or_Refund": "Event ini Mengalami Perubahan Tanggal Event, Silahkan Reschedule atau Melakukan Refund",
|
|
933
|
+
"addons": "Addons",
|
|
933
934
|
"already_follow": "Sudah memilih ",
|
|
934
935
|
"already_join_lucky_draw": "Pilihan sudah dibuat",
|
|
936
|
+
"back": "Kembali",
|
|
935
937
|
"back_err": "Oops",
|
|
936
938
|
"back_to_homepage": "Kembali ke Halaman Utama",
|
|
937
939
|
"birtdate": "Tanggal Lahir",
|
|
@@ -998,6 +1000,7 @@
|
|
|
998
1000
|
"used": "digunakan",
|
|
999
1001
|
"used_today": "digunakan hari ini, akan direset kembali besok pukul 05:00 WIB",
|
|
1000
1002
|
"virtual_account_number": "No.Virtual Account",
|
|
1003
|
+
"voucher_or_coupon": "Voucher / Kupon",
|
|
1001
1004
|
"wait": "Mohon tunggu",
|
|
1002
1005
|
"warning": "Peringatan"
|
|
1003
1006
|
},
|
|
@@ -1814,7 +1817,7 @@
|
|
|
1814
1817
|
"btn_save": "Simpan",
|
|
1815
1818
|
"button_cancel": "Batal",
|
|
1816
1819
|
"button_ok": "Ok",
|
|
1817
|
-
"entry_full_data_to_continue": "Lengkapi Data anda untuk melanjutkan",
|
|
1820
|
+
"entry_full_data_to_continue": "Lengkapi Data anda untuk melanjutkan.Gunakan foto anda dengan jelas",
|
|
1818
1821
|
"err": "Oops!!",
|
|
1819
1822
|
"label_input_name": "Nama Anda",
|
|
1820
1823
|
"msg_error_no_photo": "Silahkan Masukkan Foto terlebih dahulu",
|