esoftplay-event 0.0.2-f → 0.0.2-g
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.tsx +3 -1
- package/event/artistv2.tsx +3 -2
- package/event/button_order_detail.tsx +9 -4
- package/event/countdown.tsx +3 -3
- package/event/countdown_timestamp.tsx +106 -0
- package/event/order_detail.tsx +63 -17
- package/event/order_detail_upgrade.tsx +4 -3
- package/event/ticket_list.tsx +7 -5
- package/event/ticket_list2.tsx +7 -5
- package/package.json +1 -1
package/event/artist.tsx
CHANGED
|
@@ -100,7 +100,9 @@ export default function m(props: BigbangArtistProps): any {
|
|
|
100
100
|
if (item.book_available == 1) {
|
|
101
101
|
if (isInPricingQueueConfig(item.event_id)) {
|
|
102
102
|
LibNavigation.navigateForResult('event/queue_pricing', { event_id: item?.event_id, autoPass: false }).then((v) => {
|
|
103
|
-
|
|
103
|
+
const expTimestamp = Date.now() + (Number(EventFirebase_socketProperty.eventQueueConfig.get(item?.event_id).time) * 1000);
|
|
104
|
+
EventCountdownProperty.countdownTime.set(expTimestamp)
|
|
105
|
+
|
|
104
106
|
if (item?.config?.hasOwnProperty('multiprice') && item?.config?.multiprice == 1) {
|
|
105
107
|
LibNavigation.navigate('event/artist_detail_multi', {
|
|
106
108
|
data: newItem,
|
package/event/artistv2.tsx
CHANGED
|
@@ -86,7 +86,8 @@ export default function m(props: EventArtistv2Props): any {
|
|
|
86
86
|
// autoPass: false,
|
|
87
87
|
// });
|
|
88
88
|
// }
|
|
89
|
-
//
|
|
89
|
+
// const expTimestamp = Date.now() + (Number(EventFirebase_socketProperty.eventQueueConfig.get(item?.event_id).time) * 1000);
|
|
90
|
+
// EventCountdownProperty.countdownTime.set(expTimestamp)
|
|
90
91
|
LibNavigation.navigate(
|
|
91
92
|
item?.config?.multiprice == 1
|
|
92
93
|
? 'event/artist_detail_multi'
|
|
@@ -120,7 +121,7 @@ export default function m(props: EventArtistv2Props): any {
|
|
|
120
121
|
} else if (item?.images?.length == 1) {
|
|
121
122
|
return (
|
|
122
123
|
<TouchableOpacity key={i} onPress={handlePress} >
|
|
123
|
-
<LibPicture style={{opacity: isNotAvailable ? 0.3 : 1, height: sliderHeight, width: width, resizeMode: 'cover', backgroundColor: "#f1f2f3" }} source={{ uri: item.images[0] }} />
|
|
124
|
+
<LibPicture style={{ opacity: isNotAvailable ? 0.3 : 1, height: sliderHeight, width: width, resizeMode: 'cover', backgroundColor: "#f1f2f3" }} source={{ uri: item.images[0] }} />
|
|
124
125
|
</TouchableOpacity>
|
|
125
126
|
)
|
|
126
127
|
} else {
|
|
@@ -18,25 +18,30 @@ export interface EventButton_order_detailProps {
|
|
|
18
18
|
color: any,
|
|
19
19
|
icon: any,
|
|
20
20
|
disable?: boolean
|
|
21
|
+
status_message?: string
|
|
21
22
|
}
|
|
22
23
|
export default function m(props: EventButton_order_detailProps): any {
|
|
23
24
|
return (
|
|
24
|
-
<TouchableOpacity onPress={props.onPress}>
|
|
25
|
+
<TouchableOpacity onPress={props.onPress} activeOpacity={props.disable == true ? 1 : 0}>
|
|
25
26
|
<View style={{ borderWidth: 1, borderColor: '#ccc', margin: 15, borderRadius: 7, marginBottom: 0, overflow: 'hidden', flexDirection: 'row' }}>
|
|
26
27
|
<LibGradient
|
|
27
28
|
colors={props.disable ? [LibStyle.colorBgGrey, LibStyle.colorBgGrey, "#f1f2f3"] : [props.color, props.color, "#f1f2f3",]}
|
|
28
29
|
direction='left-to-right'
|
|
29
30
|
style={{ margin: 3, borderRadius: 5, padding: 7, flex: 4, alignContent: 'center', justifyContent: 'center' }}
|
|
30
31
|
>
|
|
31
|
-
<Text allowFontScaling={false} numberOfLines={2} ellipsizeMode='tail' style={{ color: EventOrder_itemProperty.textColor(props?.color), fontSize: 16, fontWeight: 'bold' }}>{props.title}</Text>
|
|
32
|
+
<Text allowFontScaling={false} numberOfLines={2} ellipsizeMode='tail' style={{ color: props?.disable ? "#adb5bd" : EventOrder_itemProperty.textColor(props?.color), fontSize: 16, fontWeight: 'bold' }}>{props.title}</Text>
|
|
32
33
|
{
|
|
33
34
|
props.info != "" &&
|
|
34
|
-
<Text allowFontScaling={false}
|
|
35
|
+
<Text allowFontScaling={false} ellipsizeMode='tail' style={{ color: props?.disable ? "#adb5bd" : EventOrder_itemProperty.textColor(props?.color), fontSize: 12, fontWeight: 'normal' }}>{props?.info}</Text>
|
|
36
|
+
}
|
|
37
|
+
{
|
|
38
|
+
props.status_message && props.status_message != "" &&
|
|
39
|
+
<Text allowFontScaling={false} ellipsizeMode='tail' style={{ color: LibStyle.colorRed, fontSize: 12, fontWeight: 'normal' }}>{props?.status_message}</Text>
|
|
35
40
|
}
|
|
36
41
|
</LibGradient>
|
|
37
42
|
<View style={{ flex: 1, margin: 3, borderRadius: 5, ...LibStyle.elevation(2), backgroundColor: props.disable ? LibStyle.colorBgGrey : props.color, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
|
|
38
43
|
{/* <LibIcon name={"dice-multiple"} size={40} color={EventOrder_itemProperty.textColor(props.color)} style={{ opacity: 1 }} /> */}
|
|
39
|
-
<LibIcon name={props.icon} size={35} color={EventOrder_itemProperty.textColor(props
|
|
44
|
+
<LibIcon name={props.icon} size={35} color={props?.disable ? "#adb5bd" : EventOrder_itemProperty.textColor(props?.color)} style={{ opacity: 1 }} />
|
|
40
45
|
</View>
|
|
41
46
|
</View>
|
|
42
47
|
</TouchableOpacity>
|
package/event/countdown.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// withHooks
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { EventCountdown_timestamp } from 'esoftplay/cache/event/countdown_timestamp/import';
|
|
4
4
|
import { EventFirebase_socket } from 'esoftplay/cache/event/firebase_socket/import';
|
|
5
5
|
import { EventQueue_pricingProperty } from 'esoftplay/cache/event/queue_pricing/import';
|
|
6
6
|
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
@@ -54,7 +54,7 @@ export default function m(props: EventCountdownProps): any {
|
|
|
54
54
|
else
|
|
55
55
|
return (
|
|
56
56
|
<Animated.View pointerEvents='none' style={[{ position: 'absolute', alignItems: 'center', justifyContent: 'center', top: LibStyle.STATUSBAR_HEIGHT + 61, padding: 1, backgroundColor: LibUtils.hexToRgba(LibStyle.colorGreen, 1), width: '100%' }, animated]} >
|
|
57
|
-
<
|
|
57
|
+
<EventCountdown_timestamp
|
|
58
58
|
onExpired={() => {
|
|
59
59
|
const routeNames = UserRoutes.state()?.get()?.routes?.map?.((x: any) => x.name)
|
|
60
60
|
if (routeNames.includes("event/artist"))
|
|
@@ -65,7 +65,7 @@ export default function m(props: EventCountdownProps): any {
|
|
|
65
65
|
LibNavigation.backToRoot()
|
|
66
66
|
countdownTime.reset()
|
|
67
67
|
}}
|
|
68
|
-
|
|
68
|
+
expiredTimestamp={timer}
|
|
69
69
|
style={{ color: "#fff" }} />
|
|
70
70
|
</Animated.View>
|
|
71
71
|
)
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
// noPage
|
|
3
|
+
|
|
4
|
+
import esp from 'esoftplay/esp';
|
|
5
|
+
import React, { useEffect, useRef } from 'react';
|
|
6
|
+
import { TextInput, View } from 'react-native';
|
|
7
|
+
|
|
8
|
+
export interface EventCountdown_timestampProps {
|
|
9
|
+
expiredTimestamp: number;
|
|
10
|
+
expiredText?: string;
|
|
11
|
+
style?: any;
|
|
12
|
+
containerStyle?: any;
|
|
13
|
+
onlyDay?: boolean;
|
|
14
|
+
onExpired?: () => void;
|
|
15
|
+
hideTimeUnit?: boolean;
|
|
16
|
+
showDayUnit?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const fixSingleNumber = (n: number) => (n < 10 ? "0" + n : n);
|
|
20
|
+
|
|
21
|
+
export default function CountdownTimestamp(props: EventCountdown_timestampProps) {
|
|
22
|
+
const ref = useRef<TextInput>(null)
|
|
23
|
+
let timmerRef = useRef<any>(undefined)
|
|
24
|
+
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
countDown()
|
|
27
|
+
return () => {
|
|
28
|
+
clearTimeout(timmerRef.current)
|
|
29
|
+
timmerRef.current = undefined
|
|
30
|
+
}
|
|
31
|
+
}, [])
|
|
32
|
+
|
|
33
|
+
function countDown(): any {
|
|
34
|
+
let expired = false
|
|
35
|
+
function loop() {
|
|
36
|
+
const labels = [esp.lang("market/countdown", "day"), esp.lang("market/countdown", "hour"), esp.lang("market/countdown", "minutes"), esp.lang("market/countdown", "second")]
|
|
37
|
+
|
|
38
|
+
const expiredTimestamp = props.expiredTimestamp
|
|
39
|
+
const now = Date.now();
|
|
40
|
+
const diffMs = expiredTimestamp - now;
|
|
41
|
+
|
|
42
|
+
if (diffMs <= 0) {
|
|
43
|
+
expired = true;
|
|
44
|
+
props.onExpired?.();
|
|
45
|
+
ref.current?.setNativeProps({
|
|
46
|
+
text: props.expiredText || esp.lang('market/countdown', 'expired'),
|
|
47
|
+
});
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const totalSeconds = Math.floor(diffMs / 1000);
|
|
52
|
+
const days = Math.floor(totalSeconds / 86400);
|
|
53
|
+
const hours = Math.floor((totalSeconds % 86400) / 3600);
|
|
54
|
+
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
|
55
|
+
const seconds = totalSeconds % 60;
|
|
56
|
+
|
|
57
|
+
const parts = [
|
|
58
|
+
days,
|
|
59
|
+
fixSingleNumber(hours),
|
|
60
|
+
fixSingleNumber(minutes),
|
|
61
|
+
fixSingleNumber(seconds),
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
if (parts[0] != 0 && props.onlyDay) {
|
|
65
|
+
ref.current?.setNativeProps({
|
|
66
|
+
text: parts[0] + esp.lang('market/countdown', 'days'),
|
|
67
|
+
});
|
|
68
|
+
} else if (parts[0] == 0) {
|
|
69
|
+
const filteredParts = [...parts];
|
|
70
|
+
while (filteredParts.length > 1 && (filteredParts[0] === 0 || filteredParts[0] === "00")) {
|
|
71
|
+
filteredParts.splice(0, 1);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const filtered = filteredParts.map((d, i) =>
|
|
75
|
+
`${d}${props?.hideTimeUnit ? '' : ' ' + labels[parts.length - filteredParts.length + i]}`
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
ref.current?.setNativeProps({ text: filtered.join(' : ') });
|
|
79
|
+
} else if (props?.showDayUnit && props?.hideTimeUnit) {
|
|
80
|
+
const data = parts.map(
|
|
81
|
+
(d, i) => d + (i === 0 ? ' ' + labels[0] + ' ' : '')
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
const first = data[0];
|
|
85
|
+
ref.current?.setNativeProps({
|
|
86
|
+
text: first + ' ' + data.slice(1).join(' : '),
|
|
87
|
+
});
|
|
88
|
+
} else {
|
|
89
|
+
const filtered = parts.map(
|
|
90
|
+
(d, i) => `${d}${props?.hideTimeUnit ? '' : ' ' + labels[i]}`
|
|
91
|
+
);
|
|
92
|
+
ref.current?.setNativeProps({ text: filtered.join(' : ') });
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (!expired) timmerRef.current = setTimeout(loop, 1000);
|
|
96
|
+
|
|
97
|
+
};
|
|
98
|
+
loop()
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<View style={props.containerStyle} >
|
|
103
|
+
<TextInput ref={ref} editable={false} allowFontScaling={false} style={props.style} />
|
|
104
|
+
</View>
|
|
105
|
+
)
|
|
106
|
+
}
|
package/event/order_detail.tsx
CHANGED
|
@@ -106,6 +106,7 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
106
106
|
const url = LibNavigation.getArgs(props, 'url')
|
|
107
107
|
const [result, setResult] = useSafeState<any>(EventIndexProperty?.stateTicketCache()?.get()?.filter?.((x: any) => x.url?.replace?.('?id=', '/') == url?.replace?.('?id=', '/'))?.[0]?.detail)
|
|
108
108
|
const [tickets, setTickets] = useSafeState(result?.detail_ticket?.tickets ?? [])
|
|
109
|
+
const [dataAddons, setDataAddons] = useSafeState()
|
|
109
110
|
const useIndividualQr = result?.config?.use_individual_qr_ticket
|
|
110
111
|
|
|
111
112
|
const dataTickets = tickets?.filter?.((x: ItemTiket) => x?.email == user?.email && x?.ticket_code != '')
|
|
@@ -165,6 +166,17 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
165
166
|
}
|
|
166
167
|
)
|
|
167
168
|
|
|
169
|
+
// addons list
|
|
170
|
+
if (res?.hasOwnProperty('url_addons') && res?.url_addons != "") {
|
|
171
|
+
new LibCurl(res?.url_addons, null,
|
|
172
|
+
(resss: any, msg: string) => {
|
|
173
|
+
setDataAddons(resss)
|
|
174
|
+
}, (err: any) => {
|
|
175
|
+
esp.log(err, "res url_addons");
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
}
|
|
179
|
+
|
|
168
180
|
}, (error: any) => {
|
|
169
181
|
const transformedUrl = url?.includes("?id=") ? url?.replace(/\?id=/, '/') : url
|
|
170
182
|
const urlArr = transformedUrl?.split("/")
|
|
@@ -259,7 +271,7 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
259
271
|
currency: res?.currency,
|
|
260
272
|
}
|
|
261
273
|
},
|
|
262
|
-
qty:
|
|
274
|
+
qty: res?.qty
|
|
263
275
|
}
|
|
264
276
|
let fee_platform = {
|
|
265
277
|
fee_platform_amount: res?.fee_platform?.fee_platform_amount,
|
|
@@ -270,15 +282,34 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
270
282
|
let order_type = EventConfigProperty.state().get()?.order_type?.ticket
|
|
271
283
|
let addons_id = id
|
|
272
284
|
let booking_id_ref = result?.id
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
285
|
+
|
|
286
|
+
if (res?.hasOwnProperty('alert') && res?.alert != "") {
|
|
287
|
+
LibDialog.warningConfirm("Informasi", res?.alert, "Lanjutkan", () => {
|
|
288
|
+
LibNavigation.navigate('payment/ticket', {
|
|
289
|
+
order_type: order_type,
|
|
290
|
+
tax: tax,
|
|
291
|
+
fee_platform: fee_platform,
|
|
292
|
+
dataBookingEvent: dataBookingEvent,
|
|
293
|
+
show_fee_percentage,
|
|
294
|
+
addons_id,
|
|
295
|
+
booking_id_ref
|
|
296
|
+
})
|
|
297
|
+
}, "Kembali", () => {
|
|
298
|
+
|
|
299
|
+
})
|
|
300
|
+
} else {
|
|
301
|
+
LibNavigation.navigate('payment/ticket', {
|
|
302
|
+
order_type: order_type,
|
|
303
|
+
tax: tax,
|
|
304
|
+
fee_platform: fee_platform,
|
|
305
|
+
dataBookingEvent: dataBookingEvent,
|
|
306
|
+
show_fee_percentage,
|
|
307
|
+
addons_id,
|
|
308
|
+
booking_id_ref
|
|
309
|
+
})
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
|
|
282
313
|
}, (err: any) => {
|
|
283
314
|
LibProgress.hide()
|
|
284
315
|
LibDialog.warning("Oops", err?.message)
|
|
@@ -579,10 +610,12 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
579
610
|
|
|
580
611
|
{/* tombol add on */}
|
|
581
612
|
{
|
|
582
|
-
|
|
613
|
+
dataAddons?.length > 0 && dataAddons?.map((item: any, i: number) => {
|
|
583
614
|
if (item?.hasOwnProperty("group_id")) {
|
|
584
615
|
return (
|
|
585
616
|
<EventButton_order_detail
|
|
617
|
+
disable={item?.hasOwnProperty('status') && item.status == 0 ? true : false}
|
|
618
|
+
status_message={item?.status_message}
|
|
586
619
|
key={i}
|
|
587
620
|
color={result?.color}
|
|
588
621
|
onPress={() => {
|
|
@@ -594,12 +627,14 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
594
627
|
}}
|
|
595
628
|
icon={'chevron-down'}
|
|
596
629
|
title={item.group_title}
|
|
597
|
-
info={
|
|
630
|
+
info={item.info}
|
|
598
631
|
/>
|
|
599
632
|
)
|
|
600
633
|
} else if (item?.hasOwnProperty('list')) {
|
|
601
634
|
return (
|
|
602
635
|
<EventButton_order_detail
|
|
636
|
+
disable={item?.hasOwnProperty('status') && item.status == 0 ? true : false}
|
|
637
|
+
status_message={item?.status_message}
|
|
603
638
|
key={i}
|
|
604
639
|
color={result?.color}
|
|
605
640
|
onPress={() => {
|
|
@@ -611,16 +646,20 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
611
646
|
}}
|
|
612
647
|
icon={'chevron-down'}
|
|
613
648
|
title={item.title}
|
|
614
|
-
info={
|
|
649
|
+
info={item.info}
|
|
615
650
|
/>
|
|
616
651
|
)
|
|
617
652
|
} else {
|
|
618
653
|
return (
|
|
619
654
|
<EventButton_order_detail
|
|
655
|
+
disable={item?.hasOwnProperty('status') && item.status == 0 ? true : false}
|
|
656
|
+
status_message={item?.status_message}
|
|
620
657
|
key={i}
|
|
621
658
|
color={result?.color}
|
|
622
659
|
onPress={() => {
|
|
623
|
-
|
|
660
|
+
if (item?.hasOwnProperty('status') && item?.status == 1) {
|
|
661
|
+
loadDataAddons(item?.addons_id, item?.url)
|
|
662
|
+
}
|
|
624
663
|
}}
|
|
625
664
|
icon={'plus-circle-outline'}
|
|
626
665
|
title={item.title}
|
|
@@ -907,11 +946,14 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
907
946
|
getGroupAddon()?.list?.length > 0 && getGroupAddon()?.list?.map((item: any, i: number) => {
|
|
908
947
|
return (
|
|
909
948
|
<EventButton_order_detail
|
|
910
|
-
|
|
949
|
+
disable={item?.hasOwnProperty('status') && item.status == 0 ? true : false}
|
|
950
|
+
status_message={item?.status_message}
|
|
911
951
|
key={i}
|
|
912
952
|
color={result?.color}
|
|
913
953
|
onPress={() => {
|
|
914
|
-
|
|
954
|
+
if (item?.hasOwnProperty('status') && item?.status == 1) {
|
|
955
|
+
loadDataAddons(getGroupAddon()?.addons_id, item?.url)
|
|
956
|
+
}
|
|
915
957
|
}}
|
|
916
958
|
icon={'plus-circle-outline'}
|
|
917
959
|
title={getGroupAddon()?.title + " " + LibUtils.moment(item.ondate).format("DD MMM YYYY")}
|
|
@@ -925,10 +967,14 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
925
967
|
getGroupAddon()?.addons?.length > 0 && getGroupAddon()?.addons?.map((item: any, i: number) => {
|
|
926
968
|
return (
|
|
927
969
|
<EventButton_order_detail
|
|
970
|
+
disable={item?.hasOwnProperty('status') && item.status == 0 ? true : false}
|
|
971
|
+
status_message={item?.status_message}
|
|
928
972
|
key={i}
|
|
929
973
|
color={result?.color}
|
|
930
974
|
onPress={() => {
|
|
931
|
-
|
|
975
|
+
if (item?.hasOwnProperty('status') && item?.status == 1) {
|
|
976
|
+
loadDataAddons(item?.addons_id, item?.url)
|
|
977
|
+
}
|
|
932
978
|
}}
|
|
933
979
|
icon={'plus-circle-outline'}
|
|
934
980
|
title={item.title}
|
|
@@ -122,10 +122,11 @@ export default function m(props: EventOrder_detail_upgradeProps): any {
|
|
|
122
122
|
}
|
|
123
123
|
}} key={i} style={{
|
|
124
124
|
...LibStyle.elevation(2), marginHorizontal: 15, marginTop: 2.5, marginBottom: 10, borderRadius: 10,
|
|
125
|
-
backgroundColor: item.status
|
|
125
|
+
backgroundColor: item.status != 1 ? LibStyle.colorBgGrey : selectedTicket?.selected_ticket?.id == item.id ? LibStyle.colorGreen : "#fff", padding: 10, alignContent: 'center', alignItems: 'center', justifyContent: 'center'
|
|
126
126
|
}}>
|
|
127
|
-
<
|
|
128
|
-
<
|
|
127
|
+
{/* <Text allowFontScaling={false} style={{ color: LibStyle.colorRed }} >{item?.message_error}</Text> */}
|
|
128
|
+
<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>
|
|
129
|
+
<Text allowFontScaling={false} style={{ 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>
|
|
129
130
|
|
|
130
131
|
{
|
|
131
132
|
item.info &&
|
package/event/ticket_list.tsx
CHANGED
|
@@ -19,8 +19,8 @@ import moment from 'esoftplay/moment';
|
|
|
19
19
|
import { applyStyle } from 'esoftplay';
|
|
20
20
|
import { EventConfigProperty } from 'esoftplay/cache/event/config/import';
|
|
21
21
|
import { EventCountdownProperty } from 'esoftplay/cache/event/countdown/import';
|
|
22
|
-
import { EventCountdown_base } from 'esoftplay/cache/event/countdown_base/import';
|
|
23
22
|
import { EventCountdown_event } from 'esoftplay/cache/event/countdown_event/import';
|
|
23
|
+
import { EventCountdown_timestamp } from 'esoftplay/cache/event/countdown_timestamp/import';
|
|
24
24
|
import { EventFirebase_socket, EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
|
|
25
25
|
import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
|
|
26
26
|
import { EventLoading_pageProperty } from 'esoftplay/cache/event/loading_page/import';
|
|
@@ -155,8 +155,10 @@ export default function m(props: EventTicket_listProps): any {
|
|
|
155
155
|
useEffect(() => {
|
|
156
156
|
EventConfigProperty.curlConfig('v2/config_order_type')
|
|
157
157
|
const { event_id } = EventQueue_pricingProperty.state().get()
|
|
158
|
-
if (isInPricingQueueConfig(event_id))
|
|
159
|
-
|
|
158
|
+
if (isInPricingQueueConfig(event_id)) {
|
|
159
|
+
const expTimestamp = Date.now() + (Number(EventFirebase_socketProperty.eventQueueConfig.get(event_id).time) * 1000);
|
|
160
|
+
EventCountdownProperty.countdownTime.set(expTimestamp)
|
|
161
|
+
}
|
|
160
162
|
// loadData()
|
|
161
163
|
getCheckCounter()
|
|
162
164
|
return () => {
|
|
@@ -577,11 +579,11 @@ export default function m(props: EventTicket_listProps): any {
|
|
|
577
579
|
<LibEffect deps={[]}>
|
|
578
580
|
<View style={{ backgroundColor: LibStyle.colorGreen, margin: 16, borderRadius: 5, padding: 10, ...LibStyle.elevation(2) }} >
|
|
579
581
|
<LibTextstyle text={esp.lang("event/ticket_list", "select_ticket")} textStyle='caption1' style={{ color: 'white' }} />
|
|
580
|
-
<
|
|
582
|
+
<EventCountdown_timestamp
|
|
581
583
|
onExpired={() => {
|
|
582
584
|
LibNavigation.navigate("event/detail")
|
|
583
585
|
}}
|
|
584
|
-
|
|
586
|
+
expiredTimestamp={timer}
|
|
585
587
|
style={{ color: "#fff", fontWeight: 'bold' }} />
|
|
586
588
|
</View>
|
|
587
589
|
</LibEffect>
|
package/event/ticket_list2.tsx
CHANGED
|
@@ -21,8 +21,8 @@ import { useEffect, useRef } from 'react';
|
|
|
21
21
|
import { EventAlert } from 'esoftplay/cache/event/alert/import';
|
|
22
22
|
import { EventConfigProperty } from 'esoftplay/cache/event/config/import';
|
|
23
23
|
import { EventCountdownProperty } from 'esoftplay/cache/event/countdown/import';
|
|
24
|
-
import { EventCountdown_base } from 'esoftplay/cache/event/countdown_base/import';
|
|
25
24
|
import { EventCountdown_event } from 'esoftplay/cache/event/countdown_event/import';
|
|
25
|
+
import { EventCountdown_timestamp } from 'esoftplay/cache/event/countdown_timestamp/import';
|
|
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';
|
|
@@ -271,8 +271,10 @@ export default function m(props: EventTicket_list2Props): any {
|
|
|
271
271
|
EventConfigProperty.curlConfig('v2/config_order_type')
|
|
272
272
|
const { event_id } = EventQueue_pricingProperty.state().get()
|
|
273
273
|
loadData()
|
|
274
|
-
if (isInPricingQueueConfig(event_id))
|
|
275
|
-
|
|
274
|
+
if (isInPricingQueueConfig(event_id)) {
|
|
275
|
+
const expTimestamp = Date.now() + (Number(EventFirebase_socketProperty.eventQueueConfig.get(event_id).time) * 1000);
|
|
276
|
+
EventCountdownProperty.countdownTime.set(expTimestamp)
|
|
277
|
+
}
|
|
276
278
|
getCheckCounter()
|
|
277
279
|
return () => {
|
|
278
280
|
clearTimeout(refTimeout.current)
|
|
@@ -656,11 +658,11 @@ export default function m(props: EventTicket_list2Props): any {
|
|
|
656
658
|
isInPricingQueueConfig(availableResult?.id) && isPass ?
|
|
657
659
|
<View style={{ backgroundColor: LibStyle.colorGreen, margin: 16, borderRadius: 5, padding: 10, ...LibStyle.elevation(2) }} >
|
|
658
660
|
<LibTextstyle text={esp.lang("event/ticket_list", "select_ticket")} textStyle='caption1' style={{ color: 'white' }} />
|
|
659
|
-
<
|
|
661
|
+
<EventCountdown_timestamp
|
|
660
662
|
onExpired={() => {
|
|
661
663
|
LibNavigation.back(1)
|
|
662
664
|
}}
|
|
663
|
-
|
|
665
|
+
expiredTimestamp={timer}
|
|
664
666
|
style={{ color: "#fff", fontWeight: 'bold' }} />
|
|
665
667
|
</View>
|
|
666
668
|
: null
|