esoftplay-event 0.0.1-u → 0.0.1-v
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/countdown_animated.tsx +194 -0
- package/event/countdown_base.tsx +13 -0
- package/event/countdown_event.tsx +47 -0
- package/event/detail.tsx +8 -10
- package/event/exchange_ticket_result.tsx +1 -1
- package/event/order_detail.tsx +2 -2
- package/event/order_lottery.tsx +5 -2
- package/event/ticket_list.tsx +28 -6
- package/event/ticket_list2.tsx +4 -3
- package/id.json +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
import esp from 'esoftplay/esp';
|
|
3
|
+
import moment from 'esoftplay/moment';
|
|
4
|
+
import useSafeState from 'esoftplay/state';
|
|
5
|
+
import React, { useEffect, useRef } from 'react';
|
|
6
|
+
import { Text, View } from 'react-native';
|
|
7
|
+
import Animated, { Easing, runOnJS, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export interface EventCountdown_animatedProps {
|
|
11
|
+
expired: string,
|
|
12
|
+
expiredText?: string,
|
|
13
|
+
style?: any,
|
|
14
|
+
containerStyle?: any,
|
|
15
|
+
onlyDay?: boolean,
|
|
16
|
+
onExpired?: () => void,
|
|
17
|
+
hideTimeUnit?: boolean
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const fixSingleNumber = (number: number) => number < 10 ? '0' + number : number;
|
|
21
|
+
|
|
22
|
+
type AnimatedDigitProps = {
|
|
23
|
+
value: number;
|
|
24
|
+
fontSize?: number;
|
|
25
|
+
hideIfZero?: boolean;
|
|
26
|
+
t?: number;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export function AnimatedDigit({
|
|
30
|
+
value,
|
|
31
|
+
fontSize = 32,
|
|
32
|
+
hideIfZero = false,
|
|
33
|
+
t = 400, // slightly longer for smoother motion
|
|
34
|
+
}: AnimatedDigitProps) {
|
|
35
|
+
const translateY = useSharedValue(0);
|
|
36
|
+
const opacity = useSharedValue(1);
|
|
37
|
+
const animating = useSharedValue(false);
|
|
38
|
+
|
|
39
|
+
const [currentValue, setCurrentValue] = useSafeState(value);
|
|
40
|
+
const [nextValue, setNextValue] = useSafeState<number | null>(null);
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (animating.value || value === currentValue) return;
|
|
44
|
+
|
|
45
|
+
animating.value = true;
|
|
46
|
+
runOnJS(setNextValue)(value);
|
|
47
|
+
|
|
48
|
+
// Prepare for transition
|
|
49
|
+
translateY.value = 0;
|
|
50
|
+
opacity.value = 1;
|
|
51
|
+
|
|
52
|
+
// Animate upward + fade blend for smooth rolling effect
|
|
53
|
+
translateY.value = withTiming(-fontSize, {
|
|
54
|
+
duration: t,
|
|
55
|
+
easing: Easing.out(Easing.cubic),
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
opacity.value = withTiming(0.3, {
|
|
59
|
+
duration: t * 0.8,
|
|
60
|
+
easing: Easing.out(Easing.quad),
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
// After animation completes
|
|
64
|
+
setTimeout(() => {
|
|
65
|
+
runOnJS(setCurrentValue)(value);
|
|
66
|
+
runOnJS(setNextValue)(null);
|
|
67
|
+
|
|
68
|
+
// Reset instantly below and fade back in smoothly
|
|
69
|
+
translateY.value = fontSize;
|
|
70
|
+
translateY.value = withTiming(0, {
|
|
71
|
+
duration: t * 0.8,
|
|
72
|
+
easing: Easing.out(Easing.cubic),
|
|
73
|
+
});
|
|
74
|
+
opacity.value = withTiming(1, {
|
|
75
|
+
duration: t * 0.9,
|
|
76
|
+
easing: Easing.out(Easing.cubic),
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
animating.value = false;
|
|
80
|
+
}, t);
|
|
81
|
+
}, [value]);
|
|
82
|
+
|
|
83
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
84
|
+
transform: [{ translateY: translateY.value }],
|
|
85
|
+
opacity: opacity.value,
|
|
86
|
+
}));
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<View style={{ height: fontSize + 8, overflow: "hidden", justifyContent: "center" }} >
|
|
90
|
+
<Animated.View style={animatedStyle}>
|
|
91
|
+
{/* Current number */}
|
|
92
|
+
<Text allowFontScaling={false} style={{ fontSize, fontWeight: "bold", textAlign: "center" }}>{currentValue}</Text>
|
|
93
|
+
{/* Next number rolling from bottom */}
|
|
94
|
+
{nextValue !== null && (
|
|
95
|
+
<Text allowFontScaling={false} style={{ fontSize, fontWeight: "bold", textAlign: "center" }}>{nextValue}</Text>
|
|
96
|
+
)}
|
|
97
|
+
</Animated.View>
|
|
98
|
+
</View>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export default function m(props: EventCountdown_animatedProps): any {
|
|
103
|
+
const [timeLeft, setTimeLeft] = useSafeState<any>(null);
|
|
104
|
+
const timerRef = useRef<NodeJS.Timeout | null>(null);
|
|
105
|
+
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
startCountdown();
|
|
108
|
+
return () => {
|
|
109
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
110
|
+
};
|
|
111
|
+
}, []);
|
|
112
|
+
|
|
113
|
+
function startCountdown() {
|
|
114
|
+
const loop = () => {
|
|
115
|
+
const diff = moment(props.expired).duration(moment().toDate());
|
|
116
|
+
|
|
117
|
+
if (diff <= 0) {
|
|
118
|
+
setTimeLeft(null);
|
|
119
|
+
props.onExpired?.();
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const duration = diff;
|
|
124
|
+
const newTime = {
|
|
125
|
+
days: Math.floor(duration.asDays().toString()),
|
|
126
|
+
hours: parseInt(duration.hours().toString()),
|
|
127
|
+
minutes: parseInt(duration.minutes().toString()),
|
|
128
|
+
seconds: parseInt(duration.seconds().toString())
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
setTimeLeft(newTime);
|
|
132
|
+
timerRef.current = setTimeout(loop, 1000);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
loop();
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (!timeLeft) {
|
|
139
|
+
return (
|
|
140
|
+
<Text allowFontScaling={false} style={[props.style]}>
|
|
141
|
+
{props.expiredText || esp.lang("market/countdown", "expired")}
|
|
142
|
+
</Text>
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const fontSize = props.style?.fontSize || 18;
|
|
147
|
+
|
|
148
|
+
const timeKeys = [
|
|
149
|
+
esp.lang("market/countdown", "day"),
|
|
150
|
+
esp.lang("market/countdown", "hour"),
|
|
151
|
+
esp.lang("market/countdown", "minutes"),
|
|
152
|
+
esp.lang("market/countdown", "second")
|
|
153
|
+
];
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
const values: any = Object.values(timeLeft)
|
|
157
|
+
|
|
158
|
+
const renderNumber = (num: number, timeUnit: string, index?: number) => {
|
|
159
|
+
const str: string = String(fixSingleNumber(num));
|
|
160
|
+
const hide = index == 0 || index == 1
|
|
161
|
+
|
|
162
|
+
return (
|
|
163
|
+
<View style={{ flexDirection: 'row' }}>
|
|
164
|
+
{
|
|
165
|
+
str.length > 0 && [...str].map((d, i) => (
|
|
166
|
+
<AnimatedDigit key={i} value={Number(d)} fontSize={fontSize} hideIfZero={hide} style={props.style} />
|
|
167
|
+
))
|
|
168
|
+
}
|
|
169
|
+
{
|
|
170
|
+
!props.hideTimeUnit && timeUnit && <Text allowFontScaling={false} style={[{ fontSize }, props.style]}> {timeUnit}</Text>
|
|
171
|
+
}
|
|
172
|
+
</View>
|
|
173
|
+
);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
return (
|
|
177
|
+
<View style={[{ flexDirection: 'row', alignItems: 'center' }, props.containerStyle]}>
|
|
178
|
+
{props.onlyDay ? (
|
|
179
|
+
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
180
|
+
{renderNumber(timeLeft.days, timeKeys[0])}
|
|
181
|
+
</View>
|
|
182
|
+
) : (
|
|
183
|
+
<View style={{ flexDirection: 'row' }}>
|
|
184
|
+
{timeKeys.map((key, i) => (
|
|
185
|
+
<React.Fragment key={key}>
|
|
186
|
+
{renderNumber(values[i], timeKeys[i].charAt(0) + (i < 3 ? ' : ' : ''), i)}
|
|
187
|
+
</React.Fragment>
|
|
188
|
+
))}
|
|
189
|
+
</View>
|
|
190
|
+
)}
|
|
191
|
+
</View>
|
|
192
|
+
);
|
|
193
|
+
|
|
194
|
+
}
|
package/event/countdown_base.tsx
CHANGED
|
@@ -17,6 +17,7 @@ export interface EventCountdown_baseProps {
|
|
|
17
17
|
onlyDay?: boolean
|
|
18
18
|
onExpired?: () => void
|
|
19
19
|
hideTimeUnit?: boolean
|
|
20
|
+
showDayUnit?: boolean
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
const fixSingleNumber = (number: number) => number < 10 ? '0' + number : number
|
|
@@ -63,6 +64,18 @@ export default function m(props: EventCountdown_baseProps): any {
|
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
66
|
ref?.current?.setNativeProps({ text: text.filter((x, i) => !isNaN(Number(x))).map((d, id) => d + (props?.hideTimeUnit ? '' : ' ' + t[id])).join(" : ") })
|
|
67
|
+
} else if (props?.showDayUnit && props?.hideTimeUnit) {
|
|
68
|
+
const data = text
|
|
69
|
+
.filter((x, i) => !isNaN(Number(x)))
|
|
70
|
+
.map((d, id) => {
|
|
71
|
+
return (d + (id == 0 ? " " + t[0] + " " : ""))
|
|
72
|
+
})
|
|
73
|
+
const firstData = data[0]
|
|
74
|
+
data.splice(0, 1)
|
|
75
|
+
|
|
76
|
+
ref?.current?.setNativeProps({
|
|
77
|
+
text: firstData + " " + data.join(" : ")
|
|
78
|
+
})
|
|
66
79
|
} else {
|
|
67
80
|
ref?.current?.setNativeProps({ text: text.filter((x, i) => !isNaN(Number(x))).map((d, id) => d + (props?.hideTimeUnit ? '' : ' ' + t[id])).join(" : ") })
|
|
68
81
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
// noPage
|
|
3
|
+
|
|
4
|
+
import { EventCountdown_base } from 'esoftplay/cache/event/countdown_base/import';
|
|
5
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
6
|
+
import React, { useEffect } from 'react';
|
|
7
|
+
import { StyleProp, Text, TextStyle, View, ViewStyle } from 'react-native';
|
|
8
|
+
import Animated, { useAnimatedStyle, useSharedValue, withRepeat, withTiming } from 'react-native-reanimated';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
export interface EventCountdown_eventArgs {
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
export interface EventCountdown_eventProps {
|
|
15
|
+
date: string,
|
|
16
|
+
containerStyle?: StyleProp<ViewStyle>
|
|
17
|
+
bulletStyle?: StyleProp<ViewStyle>,
|
|
18
|
+
style?: StyleProp<TextStyle>
|
|
19
|
+
}
|
|
20
|
+
export default function m(props: EventCountdown_eventProps): any {
|
|
21
|
+
const opacity = useSharedValue(1)
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
opacity.value = withRepeat(
|
|
25
|
+
withTiming(0.2, { duration: 500 }),
|
|
26
|
+
-1,
|
|
27
|
+
true
|
|
28
|
+
)
|
|
29
|
+
}, [])
|
|
30
|
+
|
|
31
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
32
|
+
opacity: opacity.value
|
|
33
|
+
}))
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<View style={[{ flexDirection: 'row', alignItems: 'center' }, props?.containerStyle]}>
|
|
37
|
+
<Animated.View style={[{ marginRight: 5, width: 8, height: 8, borderRadius: 5, backgroundColor: LibStyle.colorGreen }, animatedStyle, props?.bulletStyle]} />
|
|
38
|
+
<Text allowFontScaling={false} style={[{ fontFamily: "Arial", fontSize: 11, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }, props?.style]}>{esp.lang("event/countdown_event", "ends")}</Text>
|
|
39
|
+
<EventCountdown_base
|
|
40
|
+
expired={props.date}
|
|
41
|
+
showDayUnit
|
|
42
|
+
hideTimeUnit
|
|
43
|
+
style={[{ fontFamily: "Arial", fontSize: 11, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }, props?.style]}
|
|
44
|
+
/>
|
|
45
|
+
</View>
|
|
46
|
+
)
|
|
47
|
+
}
|
package/event/detail.tsx
CHANGED
|
@@ -11,7 +11,7 @@ import { LibVideoProperty } from 'esoftplay/cache/lib/video/import';
|
|
|
11
11
|
import { LibWebview } from 'esoftplay/cache/lib/webview/import';
|
|
12
12
|
|
|
13
13
|
import { applyStyle } from 'esoftplay';
|
|
14
|
-
import {
|
|
14
|
+
import { EventCountdown_event } from 'esoftplay/cache/event/countdown_event/import';
|
|
15
15
|
import { EventFirebase_socket, EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
|
|
16
16
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
17
17
|
import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
|
|
@@ -139,15 +139,13 @@ export default function m(props: EventDetailProps): any {
|
|
|
139
139
|
<Text allowFontScaling={false} style={{ marginLeft: 10, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#f39c12" }} >{result.status == 4 ? esp.lang("event/detail", "evn_pending") : LibUtils.getDateRange(result.start_date, result.end_date, esp.lang("event/detail", "until"))}</Text>
|
|
140
140
|
</View>
|
|
141
141
|
{
|
|
142
|
-
esp.isDebug("
|
|
143
|
-
<
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
/>
|
|
150
|
-
</View>
|
|
142
|
+
esp.isDebug("show_countdown") && result?.countdown_booking == 1 && result?.start_date != "0000-00-00" && result.end_date != '0000-00-00' &&
|
|
143
|
+
<EventCountdown_event
|
|
144
|
+
date={(result?.end_date + " " + result?.end_time)}
|
|
145
|
+
style={{ fontSize: 12 }}
|
|
146
|
+
bulletStyle={{ width: 14, height: 14, borderRadius: 7, marginRight: 10 }}
|
|
147
|
+
containerStyle={{ marginHorizontal: 20, marginBottom: 10 }}
|
|
148
|
+
/>
|
|
151
149
|
}
|
|
152
150
|
<View style={{ flexDirection: 'row', marginBottom: 10, alignItems: 'center', marginHorizontal: 20 }} >
|
|
153
151
|
<LibPicture source={esp.assets('icons/ic_tickets_grey.png')} style={{ width: 14, height: 14 }} />
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// withHooks
|
|
2
2
|
import { EventExchange_ticketProperty } from 'esoftplay/cache/event/exchange_ticket/import';
|
|
3
3
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
4
|
+
import { EventOrder_itemProperty } from 'esoftplay/cache/event/order_item/import';
|
|
4
5
|
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
5
6
|
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
6
7
|
import { LibLoading } from 'esoftplay/cache/lib/loading/import';
|
|
@@ -9,7 +10,6 @@ import { LibObject } from 'esoftplay/cache/lib/object/import';
|
|
|
9
10
|
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
10
11
|
import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
|
|
11
12
|
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
12
|
-
import { EventOrder_itemProperty } from 'esoftplay/cache/event/order_item/import';
|
|
13
13
|
import esp from 'esoftplay/esp';
|
|
14
14
|
import useGlobalState, { useGlobalReturn } from 'esoftplay/global';
|
|
15
15
|
import useSafeState from 'esoftplay/state';
|
package/event/order_detail.tsx
CHANGED
|
@@ -529,8 +529,8 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
529
529
|
})
|
|
530
530
|
}}
|
|
531
531
|
icon={'dice-multiple'}
|
|
532
|
-
title={esp.lang("event/order_detail", "join_lucky_draw")}
|
|
533
|
-
info={esp.lang("event/order_detail", "subtitle_lucky_draw")}
|
|
532
|
+
title={result?.config_luckydraw != null ? result?.config_luckydraw?.title : esp.lang("event/order_detail", "join_lucky_draw")}
|
|
533
|
+
info={result?.config_luckydraw != null ? result?.config_luckydraw?.subtitle : esp.lang("event/order_detail", "subtitle_lucky_draw")}
|
|
534
534
|
/>
|
|
535
535
|
</UseCondition>
|
|
536
536
|
|
package/event/order_lottery.tsx
CHANGED
|
@@ -44,10 +44,12 @@ export default function m(props: EventOrder_lotteryProps): any {
|
|
|
44
44
|
})
|
|
45
45
|
})
|
|
46
46
|
let b = {
|
|
47
|
+
...res,
|
|
47
48
|
coupon: res?.coupon,
|
|
48
49
|
list: a
|
|
49
50
|
}
|
|
50
51
|
setResult(b)
|
|
52
|
+
// esp.log(res);
|
|
51
53
|
}, (error: any) => {
|
|
52
54
|
esp.log(error);
|
|
53
55
|
LibDialog.warning("Oops", error?.message)
|
|
@@ -143,7 +145,8 @@ export default function m(props: EventOrder_lotteryProps): any {
|
|
|
143
145
|
|
|
144
146
|
return (
|
|
145
147
|
<View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey /* "#FFC523" */ }}>
|
|
146
|
-
<EventHeader title={esp.lang("event/order_lottery", "follow_lucky_draw")}
|
|
148
|
+
<EventHeader title={result?.config != null ? result?.config?.title : esp.lang("event/order_lottery", "follow_lucky_draw")}
|
|
149
|
+
subtitle={result?.config != null ? result?.config?.subtitle : ""} />
|
|
147
150
|
|
|
148
151
|
<ScrollView>
|
|
149
152
|
{
|
|
@@ -152,7 +155,7 @@ export default function m(props: EventOrder_lotteryProps): any {
|
|
|
152
155
|
|
|
153
156
|
</ScrollView>
|
|
154
157
|
<View style={{ backgroundColor: '#fff' }}>
|
|
155
|
-
<Text style={{ margin: 10, marginBottom: 0 }} >{esp.lang("event/order_lottery", "
|
|
158
|
+
<Text style={{ margin: 10, marginBottom: 0 }} >{esp.lang("event/order_lottery", "you_have") + result?.coupon + esp.lang("event/order_lottery", "chance_for_exchange")}</Text>
|
|
156
159
|
|
|
157
160
|
<EventButton
|
|
158
161
|
label={esp.lang("event/order_lottery", "submit")}
|
package/event/ticket_list.tsx
CHANGED
|
@@ -20,6 +20,7 @@ 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
22
|
import { EventCountdown_base } from 'esoftplay/cache/event/countdown_base/import';
|
|
23
|
+
import { EventCountdown_event } from 'esoftplay/cache/event/countdown_event/import';
|
|
23
24
|
import { EventFirebase_socket, EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
|
|
24
25
|
import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
|
|
25
26
|
import { EventLoading_pageProperty } from 'esoftplay/cache/event/loading_page/import';
|
|
@@ -55,6 +56,7 @@ export type Result = {
|
|
|
55
56
|
"status": string,
|
|
56
57
|
"quota_checkout": string,
|
|
57
58
|
"show_price": string,
|
|
59
|
+
"countdown_booking": string,
|
|
58
60
|
"config_queue": {
|
|
59
61
|
"limit": number,
|
|
60
62
|
"time": number,
|
|
@@ -346,6 +348,11 @@ export default function m(props: EventTicket_listProps): any {
|
|
|
346
348
|
let colorBackground = item.status != 1 ? LibStyle.colorLightGrey : itemT.status != 1 ? LibStyle.colorLightGrey : colorDefault
|
|
347
349
|
let textOpacity = /* item.status == 1 ? 1 : */itemT?.status == 1 ? 1 : 0.3
|
|
348
350
|
|
|
351
|
+
let showCountDown = esp.isDebug("show_countdown") && itemT.status != 0 && item?.date_start != "0000-00-00 00:00:00" && item?.date_end != "0000-00-00 00:00:00"
|
|
352
|
+
let dateShowed = item?.price_date == 1 ?
|
|
353
|
+
moment(item?.date_end).format("YYYY-MM-DD HH:mm:ss") > moment(itemT?.ondate).format("YYYY-MM-DD HH:mm:ss") ? moment(itemT?.ondate).add(1, "days").format("YYYY-MM-DD HH:mm:ss") : item?.date_end
|
|
354
|
+
: item?.date_end
|
|
355
|
+
|
|
349
356
|
return (
|
|
350
357
|
<TouchableOpacity key={iT} onPress={() => {
|
|
351
358
|
let itemTicket = {
|
|
@@ -396,11 +403,22 @@ export default function m(props: EventTicket_listProps): any {
|
|
|
396
403
|
</View>
|
|
397
404
|
</View>
|
|
398
405
|
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
406
|
+
{
|
|
407
|
+
showCountDown ?
|
|
408
|
+
<Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('dddd, MMMM YYYY')}</Text>
|
|
409
|
+
:
|
|
410
|
+
<>
|
|
411
|
+
<Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('dddd')}</Text>
|
|
412
|
+
<View style={applyStyle({ flexDirection: 'row', alignItems: "center" })}>
|
|
413
|
+
<Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('MMMM')}</Text>
|
|
414
|
+
<Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, marginLeft: 5, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('YYYY')}</Text>
|
|
415
|
+
</View>
|
|
416
|
+
</>
|
|
417
|
+
}
|
|
418
|
+
{
|
|
419
|
+
showCountDown &&
|
|
420
|
+
<EventCountdown_event date={dateShowed} containerStyle={{ marginVertical: -5 }} />
|
|
421
|
+
}
|
|
404
422
|
</View>
|
|
405
423
|
</View>
|
|
406
424
|
:
|
|
@@ -419,7 +437,7 @@ export default function m(props: EventTicket_listProps): any {
|
|
|
419
437
|
{/* <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' }}>{item.type}</Text> */}
|
|
420
438
|
{
|
|
421
439
|
item.info != "" &&
|
|
422
|
-
<
|
|
440
|
+
<EventHtmltext allowFontScaling={false} style={{ flexWrap: 'wrap', fontFamily: "Arial", fontSize: 11, fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' }}>{item.info}</EventHtmltext>
|
|
423
441
|
}
|
|
424
442
|
</View>
|
|
425
443
|
</View>
|
|
@@ -610,6 +628,10 @@ export default function m(props: EventTicket_listProps): any {
|
|
|
610
628
|
<Text style={{ color: LibStyle.colorRed, fontSize: 10, fontWeight: 'normal' }}> {"(" + esp.lang("event/ticket_list", "min_order") + LibUtils.number(item.qty_min) + ")"}</Text>
|
|
611
629
|
}
|
|
612
630
|
</EventHtmltext>
|
|
631
|
+
{
|
|
632
|
+
availableResult?.countdown_booking == "1" && displayedData?.length == 1 && item?.date_start != "0000-00-00 00:00:00" && item?.date_end != "0000-00-00 00:00:00" &&
|
|
633
|
+
<EventCountdown_event date={item?.date_end} containerStyle={{ marginVertical: -5 }} />
|
|
634
|
+
}
|
|
613
635
|
{
|
|
614
636
|
deeplinkParams?.type == 'event-voucher' && deeplinkParams?.price_id == item.price_id ?
|
|
615
637
|
<Text allowFontScaling={false} style={{ color: "coral", fontSize: 12, fontWeight: 'bold' }}>{esp.lang("event/ticket_list", "applied_code", deeplinkParams?.code)}</Text>
|
package/event/ticket_list2.tsx
CHANGED
|
@@ -23,6 +23,7 @@ import { EventConfigProperty } from 'esoftplay/cache/event/config/import';
|
|
|
23
23
|
import { EventCountdownProperty } from 'esoftplay/cache/event/countdown/import';
|
|
24
24
|
import { EventCountdown_base } from 'esoftplay/cache/event/countdown_base/import';
|
|
25
25
|
import { EventFirebase_socket, EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
|
|
26
|
+
import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
|
|
26
27
|
import { EventLoading_pageProperty } from 'esoftplay/cache/event/loading_page/import';
|
|
27
28
|
import { EventQueue_pricingProperty } from 'esoftplay/cache/event/queue_pricing/import';
|
|
28
29
|
import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
|
|
@@ -485,7 +486,7 @@ export default function m(props: EventTicket_list2Props): any {
|
|
|
485
486
|
{<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' }}>{item.type}</Text>}
|
|
486
487
|
{
|
|
487
488
|
item.info != "" &&
|
|
488
|
-
<
|
|
489
|
+
<EventHtmltext allowFontScaling={false} style={{ flexWrap: 'wrap', fontFamily: "Arial", fontSize: 11, fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' }}>{item.info}</EventHtmltext>
|
|
489
490
|
}
|
|
490
491
|
</View>
|
|
491
492
|
</View>
|
|
@@ -640,12 +641,12 @@ export default function m(props: EventTicket_list2Props): any {
|
|
|
640
641
|
<View style={{ padding: 10, backgroundColor: '#f1f2f3', borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
|
|
641
642
|
<View style={{ alignContent: 'center', alignItems: 'center', flexDirection: 'row', justifyContent: 'space-between', }}>
|
|
642
643
|
<View>
|
|
643
|
-
<
|
|
644
|
+
<EventHtmltext allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.type}
|
|
644
645
|
{
|
|
645
646
|
item.qty_min > 1 &&
|
|
646
647
|
<Text style={{ color: LibStyle.colorRed, fontSize: 10, fontWeight: 'normal' }}> {"(" + esp.lang("event/ticket_list", "min_order") + LibUtils.number(item.qty_min) + ")"}</Text>
|
|
647
648
|
}
|
|
648
|
-
</
|
|
649
|
+
</EventHtmltext>
|
|
649
650
|
{
|
|
650
651
|
deeplinkParams?.type == 'event-voucher' && deeplinkParams?.price_id == item.price_id ?
|
|
651
652
|
<Text allowFontScaling={false} style={{ color: "coral", fontSize: 12, fontWeight: 'bold' }}>{esp.lang("event/ticket_list", "applied_code", deeplinkParams?.code)}</Text>
|
package/id.json
CHANGED
|
@@ -65,6 +65,9 @@
|
|
|
65
65
|
"visitor_email": "Email Pengunjung",
|
|
66
66
|
"visitor_email_pl": "Email Pengujung"
|
|
67
67
|
},
|
|
68
|
+
"event/countdown_event": {
|
|
69
|
+
"ends": "Berakhir dalam"
|
|
70
|
+
},
|
|
68
71
|
"event/counter_cashier": {
|
|
69
72
|
"add_cancel": "Tidak",
|
|
70
73
|
"add_confirm": "Ya",
|
|
@@ -1074,6 +1077,7 @@
|
|
|
1074
1077
|
"used_once": "Bisa digunakan sekali selama acara berlangsung"
|
|
1075
1078
|
},
|
|
1076
1079
|
"event/order_lottery": {
|
|
1080
|
+
"chance_for_exchange": " kesempatan untuk ditukarkan",
|
|
1077
1081
|
"confirm": "Konfirmasi",
|
|
1078
1082
|
"confirm_point": "Apakah kupon yang anda masukkan sudah benar?",
|
|
1079
1083
|
"follow_lucky_draw": "Ikuti Lucky Draw",
|
|
@@ -1085,6 +1089,7 @@
|
|
|
1085
1089
|
"token_for_luckydraw": " kupon untuk mengikuti undian Lucky Draw",
|
|
1086
1090
|
"u_have": "Anda mempunyai ",
|
|
1087
1091
|
"yes": "Ya",
|
|
1092
|
+
"you_have": "Kamu punya ",
|
|
1088
1093
|
"your_maks_token_is": "Maksimal kupon anda adalah "
|
|
1089
1094
|
},
|
|
1090
1095
|
"event/order_reschedule": {
|