esoftplay-event 0.0.2 → 0.0.3
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/additional.tsx +1 -1
- package/event/additional_input.tsx +15 -0
- package/event/additional_new.tsx +565 -0
- package/event/artist.tsx +14 -34
- package/event/artist_detail.tsx +336 -239
- package/event/artist_detail_multi.tsx +266 -157
- package/event/artist_detailv2.tsx +129 -69
- package/event/artistv2.tsx +5 -13
- package/event/button.tsx +2 -2
- package/event/button_order_detail.tsx +20 -8
- package/event/capture.tsx +2 -0
- package/event/checkout.ts +135 -0
- package/event/countdown.tsx +13 -9
- package/event/countdown_base.tsx +88 -48
- package/event/countdown_event.tsx +3 -0
- package/event/countdown_timestamp.tsx +106 -0
- package/event/coupon.tsx +1 -1
- package/event/coupon_generate.tsx +35 -22
- package/event/detail.tsx +9 -15
- package/event/detail2.tsx +63 -61
- package/event/dialog_custom.tsx +67 -0
- package/event/exchange_ticket_list.tsx +23 -14
- package/event/exchange_ticket_result.tsx +1 -1
- package/event/firebase_socket.ts +14 -12
- package/event/htmltext.tsx +40 -28
- package/event/index.tsx +8 -2
- package/event/label_input.tsx +2 -2
- package/event/layout.tsx +312 -0
- package/event/loading_page.tsx +62 -82
- package/event/message.tsx +2 -2
- package/event/order_detail.tsx +408 -477
- package/event/order_detail_addons.tsx +60 -0
- package/event/order_detail_addons_booked.tsx +61 -0
- package/event/order_detail_coupon.tsx +66 -0
- package/event/order_detail_instruction.tsx +96 -0
- package/event/order_detail_payment.tsx +1 -1
- package/event/order_detail_reschedule.tsx +109 -0
- package/event/order_detail_return.tsx +231 -0
- package/event/order_detail_review.tsx +174 -0
- package/event/order_detail_share.tsx +304 -0
- package/event/order_detail_tnc.tsx +76 -0
- package/event/order_detail_upgrade.tsx +140 -90
- package/event/order_detail_upgrade_payment.tsx +120 -38
- package/event/order_detail_visitor.tsx +21 -10
- package/event/order_detail_waiting.tsx +3 -3
- package/event/order_history.tsx +1 -1
- package/event/order_item.tsx +1 -1
- package/event/order_lottery.tsx +1 -1
- package/event/order_reschedule.tsx +29 -16
- package/event/order_share_to.tsx +14 -0
- package/event/order_waiting.tsx +1 -1
- package/event/payment_subscribe.tsx +18 -0
- package/event/point_events.tsx +35 -0
- package/event/point_redemption.tsx +101 -0
- package/event/point_redemption_exchange.tsx +60 -0
- package/event/point_redemption_input.tsx +56 -0
- package/event/point_redemption_success.tsx +50 -0
- package/event/point_summary.tsx +48 -0
- package/event/popup.tsx +4 -4
- package/event/queue.tsx +111 -0
- package/event/queue_pricing.tsx +17 -6
- package/event/review_add.tsx +2 -2
- package/event/scan_item.tsx +1 -1
- package/event/schedule.tsx +33 -30
- package/event/schedule2.tsx +86 -0
- package/event/seat.tsx +135 -374
- package/event/seat_map.tsx +8 -8
- package/event/seat_map_new.tsx +211 -38
- package/event/step.tsx +1 -1
- package/event/test.tsx +8 -8
- package/event/ticket.tsx +326 -0
- package/event/ticket_list.tsx +316 -258
- package/event/ticket_list2.tsx +349 -224
- package/event/ticket_list_item.tsx +61 -0
- package/event/ticket_list_new.tsx +710 -0
- package/event/tms_add_result.tsx +10 -5
- package/event/tms_check_ticket_result.tsx +16 -7
- package/event/tms_dashboard.tsx +87 -12
- package/event/tms_gate.tsx +32 -15
- package/event/tms_home.tsx +178 -92
- package/event/tms_idcard.tsx +43 -26
- package/event/tms_in.tsx +2 -3
- package/event/tms_in_failed.tsx +1 -1
- package/event/tms_in_hall.tsx +4 -1
- package/event/tms_in_hall_failed.tsx +36 -16
- package/event/tms_in_log.tsx +9 -11
- package/event/tms_in_success.tsx +13 -8
- package/event/tms_log.tsx +16 -17
- package/event/tms_out_hall_failed.tsx +1 -1
- package/event/tms_out_temporary.tsx +3 -4
- package/event/token_order.tsx +103 -0
- package/event/token_payment.tsx +79 -0
- package/event/visitor_index.tsx +60 -49
- package/event/visitor_input.tsx +336 -54
- package/event/visitor_inputv2.tsx +173 -88
- package/event/voucher.tsx +1 -1
- package/id.json +76 -4
- package/package.json +1 -1
- package/event/secure_page.debug.tsx +0 -34
- package/event/secure_page.live.tsx +0 -35
package/event/countdown_base.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// withHooks
|
|
2
|
-
|
|
2
|
+
// noPage
|
|
3
3
|
import esp from 'esoftplay/esp';
|
|
4
|
-
import moment from 'esoftplay/moment';
|
|
5
4
|
import React, { useEffect, useRef } from 'react';
|
|
6
5
|
import { TextInput, View } from 'react-native';
|
|
7
6
|
|
|
@@ -11,6 +10,7 @@ export interface EventCountdown_baseArgs {
|
|
|
11
10
|
}
|
|
12
11
|
export interface EventCountdown_baseProps {
|
|
13
12
|
expired: string,
|
|
13
|
+
timezone?: string,
|
|
14
14
|
expiredText?: string,
|
|
15
15
|
style?: any,
|
|
16
16
|
containerStyle?: any,
|
|
@@ -22,68 +22,108 @@ export interface EventCountdown_baseProps {
|
|
|
22
22
|
|
|
23
23
|
const fixSingleNumber = (number: number) => number < 10 ? '0' + number : number
|
|
24
24
|
|
|
25
|
+
function parseTimezone(tz: string): string {
|
|
26
|
+
if (!tz) return '+00:00';
|
|
27
|
+
const lower = tz.toLowerCase().trim();
|
|
28
|
+
|
|
29
|
+
const match = lower.match(/gmt([+-]\d{1,2})(?::?(\d{1,2}))?(\.\d+)?/);
|
|
30
|
+
if (!match) return '+00:00';
|
|
31
|
+
|
|
32
|
+
const sign = match[1].startsWith('-') ? '-' : '+';
|
|
33
|
+
let hours = Math.abs(parseInt(match[1], 10));
|
|
34
|
+
let minutes = 0;
|
|
35
|
+
|
|
36
|
+
if (match[2]) {
|
|
37
|
+
minutes = parseInt(match[2], 10);
|
|
38
|
+
} else if (match[3]) {
|
|
39
|
+
minutes = Math.round(parseFloat(match[3]) * 60);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const hh = hours.toString().padStart(2, '0');
|
|
43
|
+
const mm = minutes.toString().padStart(2, '0');
|
|
44
|
+
return `${sign}${hh}:${mm}`;
|
|
45
|
+
}
|
|
46
|
+
|
|
25
47
|
export default function m(props: EventCountdown_baseProps): any {
|
|
26
48
|
const ref = useRef<TextInput>(null)
|
|
27
|
-
let
|
|
49
|
+
let timmerRef = useRef<any>(undefined)
|
|
28
50
|
|
|
29
51
|
useEffect(() => {
|
|
30
52
|
countDown()
|
|
31
53
|
return () => {
|
|
32
|
-
clearTimeout(
|
|
33
|
-
|
|
54
|
+
clearTimeout(timmerRef.current)
|
|
55
|
+
timmerRef.current = undefined
|
|
34
56
|
}
|
|
35
57
|
}, [])
|
|
36
58
|
|
|
37
59
|
function countDown(): any {
|
|
38
60
|
let expired = false
|
|
39
61
|
function loop() {
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
const labels = [esp.lang("market/countdown", "day"), esp.lang("market/countdown", "hour"), esp.lang("market/countdown", "minutes"), esp.lang("market/countdown", "second")]
|
|
63
|
+
|
|
64
|
+
// @ts-ignore
|
|
65
|
+
const configGMT = esp.config("forcedGMT+") ? `GMT+${esp.config("forcedGMT+")}` : "GMT+7" // set default to GMT+7 Jakarta
|
|
66
|
+
const tzOffset = parseTimezone(props?.timezone || configGMT);
|
|
67
|
+
const serverDate = new Date(props.expired.replace(' ', 'T') + tzOffset);
|
|
68
|
+
const now = new Date();
|
|
69
|
+
|
|
70
|
+
const diffMs = serverDate.getTime() - now.getTime();
|
|
71
|
+
|
|
72
|
+
if (diffMs <= 0) {
|
|
73
|
+
expired = true;
|
|
74
|
+
props.onExpired?.();
|
|
75
|
+
ref.current?.setNativeProps({
|
|
76
|
+
text: props.expiredText || esp.lang('market/countdown', 'expired'),
|
|
77
|
+
});
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const totalSeconds = Math.floor(diffMs / 1000);
|
|
82
|
+
const days = Math.floor(totalSeconds / 86400);
|
|
83
|
+
const hours = Math.floor((totalSeconds % 86400) / 3600);
|
|
84
|
+
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
|
85
|
+
const seconds = totalSeconds % 60;
|
|
86
|
+
|
|
87
|
+
const parts = [
|
|
88
|
+
days,
|
|
89
|
+
fixSingleNumber(hours),
|
|
90
|
+
fixSingleNumber(minutes),
|
|
91
|
+
fixSingleNumber(seconds),
|
|
92
|
+
];
|
|
93
|
+
|
|
94
|
+
if (parts[0] != 0 && props.onlyDay) {
|
|
95
|
+
ref.current?.setNativeProps({
|
|
96
|
+
text: parts[0] + esp.lang('market/countdown', 'days'),
|
|
97
|
+
});
|
|
98
|
+
} else if (parts[0] == 0) {
|
|
99
|
+
const filteredParts = [...parts];
|
|
100
|
+
while (filteredParts.length > 1 && (filteredParts[0] === 0 || filteredParts[0] === "00")) {
|
|
101
|
+
filteredParts.splice(0, 1);
|
|
65
102
|
}
|
|
66
|
-
|
|
103
|
+
|
|
104
|
+
const filtered = filteredParts.map((d, i) =>
|
|
105
|
+
`${d}${props?.hideTimeUnit ? '' : ' ' + labels[parts.length - filteredParts.length + i]}`
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
ref.current?.setNativeProps({ text: filtered.join(' : ') });
|
|
67
109
|
} else if (props?.showDayUnit && props?.hideTimeUnit) {
|
|
68
|
-
const data =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
ref?.current?.setNativeProps({
|
|
77
|
-
text: firstData + " " + data.join(" : ")
|
|
78
|
-
})
|
|
110
|
+
const data = parts.map(
|
|
111
|
+
(d, i) => d + (i === 0 ? ' ' + labels[0] + ' ' : '')
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
const first = data[0];
|
|
115
|
+
ref.current?.setNativeProps({
|
|
116
|
+
text: first + ' ' + data.slice(1).join(' : '),
|
|
117
|
+
});
|
|
79
118
|
} else {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
loop()
|
|
85
|
-
}, 1000);
|
|
119
|
+
const filtered = parts.map(
|
|
120
|
+
(d, i) => `${d}${props?.hideTimeUnit ? '' : ' ' + labels[i]}`
|
|
121
|
+
);
|
|
122
|
+
ref.current?.setNativeProps({ text: filtered.join(' : ') });
|
|
86
123
|
}
|
|
124
|
+
|
|
125
|
+
if (!expired) timmerRef.current = setTimeout(loop, 1000);
|
|
126
|
+
|
|
87
127
|
};
|
|
88
128
|
loop()
|
|
89
129
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import { EventCountdown_base } from 'esoftplay/cache/event/countdown_base/import';
|
|
5
5
|
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
6
|
+
import esp from 'esoftplay/esp';
|
|
6
7
|
import React, { useEffect } from 'react';
|
|
7
8
|
import { StyleProp, Text, TextStyle, View, ViewStyle } from 'react-native';
|
|
8
9
|
import Animated, { useAnimatedStyle, useSharedValue, withRepeat, withTiming } from 'react-native-reanimated';
|
|
@@ -13,6 +14,7 @@ export interface EventCountdown_eventArgs {
|
|
|
13
14
|
}
|
|
14
15
|
export interface EventCountdown_eventProps {
|
|
15
16
|
date: string,
|
|
17
|
+
timezone?: string,
|
|
16
18
|
containerStyle?: StyleProp<ViewStyle>
|
|
17
19
|
bulletStyle?: StyleProp<ViewStyle>,
|
|
18
20
|
style?: StyleProp<TextStyle>
|
|
@@ -40,6 +42,7 @@ export default function m(props: EventCountdown_eventProps): any {
|
|
|
40
42
|
expired={props.date}
|
|
41
43
|
showDayUnit
|
|
42
44
|
hideTimeUnit
|
|
45
|
+
timezone={props?.timezone}
|
|
43
46
|
style={[{ fontFamily: "Arial", fontSize: 11, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }, props?.style]}
|
|
44
47
|
/>
|
|
45
48
|
</View>
|
|
@@ -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/coupon.tsx
CHANGED
|
@@ -81,7 +81,7 @@ export default function m(props: EventCouponProps): any {
|
|
|
81
81
|
renderItem={(item, index) => (
|
|
82
82
|
<View style={{ flex: 1 }} key={index}>
|
|
83
83
|
<TouchableOpacity onPress={() => {
|
|
84
|
-
if (item?.status == 0) {
|
|
84
|
+
if (item?.status == 0 && item?.show_qr != 0) {
|
|
85
85
|
esp.mod("lib/navigation").navigate("event/coupon_detail", { ...item })
|
|
86
86
|
}
|
|
87
87
|
}} style={[{ marginBottom: 4, margin: 15, borderRadius: 10, backgroundColor: '#fff' }, LibStyle.elevation(2)]}>
|
|
@@ -9,6 +9,7 @@ import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
|
9
9
|
import { EventMessage } from 'esoftplay/cache/event/message/import';
|
|
10
10
|
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
11
11
|
import { LibInfinite } from 'esoftplay/cache/lib/infinite/import';
|
|
12
|
+
import { LibKeyboard_avoid } from 'esoftplay/cache/lib/keyboard_avoid/import';
|
|
12
13
|
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
13
14
|
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
14
15
|
import { LibScroll } from 'esoftplay/cache/lib/scroll/import';
|
|
@@ -43,7 +44,8 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
43
44
|
|
|
44
45
|
function load() {
|
|
45
46
|
const curl = esp.mod("lib/curl")
|
|
46
|
-
|
|
47
|
+
const url = "event_coupon_admin_detail?event_id=" + event_id + "&coupon_id=" + getCoupon()?.coupon_id
|
|
48
|
+
new curl(url, null, (result, message) => {
|
|
47
49
|
setData(result)()
|
|
48
50
|
}, (error) => {
|
|
49
51
|
setError(error?.message)
|
|
@@ -64,16 +66,12 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
64
66
|
esp.modProp("lib/toast").show(esp.lang("event/coupon_generate", "email_invalid"))
|
|
65
67
|
return
|
|
66
68
|
}
|
|
67
|
-
if (amount == "") {
|
|
68
|
-
esp.modProp("lib/toast").show(esp.lang("event/coupon_generate", "nominal_empty"))
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
69
|
|
|
72
70
|
let post: any = {
|
|
73
71
|
event_id,
|
|
74
72
|
coupon_id: getCoupon()?.coupon_id,
|
|
75
73
|
user_email_to: email,
|
|
76
|
-
amount: amount
|
|
74
|
+
amount: amount || 0
|
|
77
75
|
}
|
|
78
76
|
|
|
79
77
|
if (notes != "") {
|
|
@@ -104,6 +102,14 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
104
102
|
}
|
|
105
103
|
|
|
106
104
|
function buildUrl(url: string) {
|
|
105
|
+
if (event_id) {
|
|
106
|
+
url += url.includes('?') ? '&' : '?'
|
|
107
|
+
url += 'event_id=' + event_id
|
|
108
|
+
}
|
|
109
|
+
if (getCoupon()?.coupon_id) {
|
|
110
|
+
url += url.includes('?') ? '&' : '?'
|
|
111
|
+
url += 'coupon_id=' + getCoupon()?.coupon_id
|
|
112
|
+
}
|
|
107
113
|
if (t) {
|
|
108
114
|
url += url.includes('?') ? '&' : '?'
|
|
109
115
|
url += 't=' + t
|
|
@@ -114,13 +120,13 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
114
120
|
return (
|
|
115
121
|
<View style={{ flex: 1 }}>
|
|
116
122
|
<EventHeader title={esp.lang("event/coupon_generate", "header")} subtitle={event_name} />
|
|
117
|
-
{
|
|
123
|
+
<LibKeyboard_avoid style={{ flex: 1 }} >
|
|
118
124
|
<LibScroll onRefresh={() => infiniteRef.current?.loadData()}>
|
|
119
125
|
<View style={[{ backgroundColor: "white", marginHorizontal: 15, marginTop: 15, padding: 10, borderRadius: 10 }, LibStyle.elevation(3)]}>
|
|
120
126
|
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 14 }}>{event_name}</Text>
|
|
121
127
|
|
|
122
|
-
<View style={[{ marginTop: 5, borderRadius:
|
|
123
|
-
<LibPicture source={{ uri: image }} resizeMode="cover" style={{ height: imgHeight, width: imgWidth, borderRadius:
|
|
128
|
+
<View style={[{ marginTop: 5, borderRadius: 10, backgroundColor: '#fff' }, LibStyle.elevation(2)]}>
|
|
129
|
+
<LibPicture source={{ uri: image }} resizeMode="cover" style={{ height: imgHeight, width: imgWidth, borderRadius: 10, backgroundColor: "#f1f1f1" }} />
|
|
124
130
|
</View>
|
|
125
131
|
</View>
|
|
126
132
|
|
|
@@ -129,7 +135,7 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
129
135
|
{
|
|
130
136
|
coupon &&
|
|
131
137
|
<View style={[{ marginBottom: 4, borderRadius: 10, backgroundColor: '#fff' }, LibStyle.elevation(2)]}>
|
|
132
|
-
<LibPicture source={{ uri: coupon?.image }} resizeMode="cover" style={{ height: (LibStyle.width - 50) * 0.43, width: LibStyle.width - 50, borderRadius: 10 }} />
|
|
138
|
+
<LibPicture source={{ uri: coupon?.image }} resizeMode="cover" style={{ height: (LibStyle.width - 50) * 0.43, width: LibStyle.width - 50, borderRadius: 10, backgroundColor: "#f1f1f1" }} />
|
|
133
139
|
<View style={{ backgroundColor: "rgba(0, 0, 0, 0.5)", position: 'absolute', borderBottomLeftRadius: 10, borderBottomRightRadius: 10, bottom: 0, left: 0, right: 0, padding: 10 }}>
|
|
134
140
|
<Text allowFontScaling={false} style={{ flex: 1, fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{coupon?.coupon_title}</Text>
|
|
135
141
|
</View>
|
|
@@ -146,7 +152,7 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
146
152
|
setCoupon(value)()
|
|
147
153
|
load()
|
|
148
154
|
})
|
|
149
|
-
}} style={{ borderWidth: 1, borderColor: "#e6e6e6", height:
|
|
155
|
+
}} style={{ borderWidth: 1, borderColor: "#e6e6e6", height: 40, borderRadius: 10, marginTop: 10, flexDirection: "row", alignItems: "center", paddingHorizontal: 10 }}>
|
|
150
156
|
{
|
|
151
157
|
coupon ?
|
|
152
158
|
<>
|
|
@@ -154,17 +160,18 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
154
160
|
<LibIcon name='pencil' size={18} />
|
|
155
161
|
</>
|
|
156
162
|
: <>
|
|
157
|
-
<Text allowFontScaling={false} style={{ flex: 1, fontFamily: "
|
|
163
|
+
<Text allowFontScaling={false} style={{ flex: 1, fontFamily: "ArialBold", fontSize: 14, color: "#999999" }}>{esp.lang("event/coupon_generate", "select_coupon")}</Text>
|
|
158
164
|
<LibIcon name='chevron-right' />
|
|
159
165
|
</>
|
|
160
166
|
}
|
|
161
167
|
</Pressable>
|
|
162
|
-
<View style={{ borderWidth: 1, borderColor: "#e6e6e6", height:
|
|
163
|
-
<Text>Rp. </Text>
|
|
168
|
+
<View style={{ borderWidth: 1, borderColor: "#e6e6e6", height: 40, borderRadius: 10, marginTop: 10, flexDirection: "row", alignItems: "center", paddingHorizontal: 10 }}>
|
|
169
|
+
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, color: "#4b4b4b" }} >Rp. </Text>
|
|
164
170
|
<LibInput
|
|
165
171
|
ref={inputNominalRef}
|
|
166
172
|
base
|
|
167
173
|
placeholder={esp.lang("event/coupon_generate", "input_nominal")}
|
|
174
|
+
placeholderTextColor='#999999'
|
|
168
175
|
onChangeText={() => { }}
|
|
169
176
|
keyboardType='numeric'
|
|
170
177
|
mask='###.###.###.###.###.###.###.###.###.###'
|
|
@@ -176,11 +183,13 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
176
183
|
style={{ flex: 1, paddingHorizontal: 5 }}
|
|
177
184
|
/>
|
|
178
185
|
</View>
|
|
179
|
-
<View style={{ borderWidth: 1, borderColor: "#e6e6e6", height:
|
|
186
|
+
<View style={{ borderWidth: 1, borderColor: "#e6e6e6", height: 40, borderRadius: 10, marginTop: 10, flexDirection: "row", alignItems: "center", paddingHorizontal: 10 }}>
|
|
187
|
+
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, color: "#4b4b4b" }} >@ </Text>
|
|
180
188
|
<LibInput
|
|
181
189
|
ref={inputEmailRef}
|
|
182
190
|
base
|
|
183
191
|
placeholder={esp.lang("event/coupon_generate", "input_email")}
|
|
192
|
+
placeholderTextColor='#999999'
|
|
184
193
|
onChangeText={() => { }}
|
|
185
194
|
keyboardType='email-address'
|
|
186
195
|
returnKeyType='next'
|
|
@@ -195,6 +204,7 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
195
204
|
ref={inputDescRef}
|
|
196
205
|
base
|
|
197
206
|
placeholder={"notes"}
|
|
207
|
+
placeholderTextColor='#999999'
|
|
198
208
|
multiline
|
|
199
209
|
onChangeText={() => { }}
|
|
200
210
|
returnKeyType='go'
|
|
@@ -207,10 +217,10 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
207
217
|
if (getCoupon()) {
|
|
208
218
|
doSendVoucher()
|
|
209
219
|
} else {
|
|
210
|
-
esp.modProp("lib/toast").show("
|
|
220
|
+
esp.modProp("lib/toast").show(esp.lang("event/coupon_generate", "select_coupon_alert"))
|
|
211
221
|
}
|
|
212
222
|
}}
|
|
213
|
-
style={{ backgroundColor: coupon ? LibStyle.colorGreen : "#e6e6e6", height:
|
|
223
|
+
style={{ backgroundColor: coupon ? LibStyle.colorGreen : "#e6e6e6", height: 40, alignItems: "center", justifyContent: "center", paddingHorizontal: 10, borderRadius: 10 }}>
|
|
214
224
|
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, color: "white" }}>{esp.lang("event/coupon_generate", "btn_send")}</Text>
|
|
215
225
|
</Pressable>
|
|
216
226
|
{
|
|
@@ -225,19 +235,22 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
225
235
|
data && coupon &&
|
|
226
236
|
<LibInfinite
|
|
227
237
|
ref={infiniteRef}
|
|
228
|
-
key={coupon?.coupon_id + buildUrl("event_coupon_admin_claimed
|
|
229
|
-
url={buildUrl("event_coupon_admin_claimed
|
|
238
|
+
key={coupon?.coupon_id + buildUrl("event_coupon_admin_claimed")}
|
|
239
|
+
url={buildUrl("event_coupon_admin_claimed")}
|
|
230
240
|
errorView={(error: any) => (
|
|
231
241
|
<EventMessage message={error} />
|
|
232
242
|
)}
|
|
233
243
|
renderItem={(item, index) => (
|
|
234
|
-
<View style={[{ backgroundColor: "white", marginHorizontal: 15, marginTop: 10, marginBottom: 5, padding: 10, borderRadius: 10, flexDirection: "row", alignItems: "center" }, LibStyle.elevation(3)]}>
|
|
244
|
+
<View key={index} style={[{ backgroundColor: "white", marginHorizontal: 15, marginTop: 10, marginBottom: 5, padding: 10, borderRadius: 10, flexDirection: "row", alignItems: "center" }, LibStyle.elevation(3)]}>
|
|
235
245
|
<View style={{ width: 36, height: 36, borderRadius: 18, backgroundColor: "#909090", alignItems: "center", justifyContent: "center" }}>
|
|
236
246
|
<LibIcon name='send' size={20} color='#f1f1f1' />
|
|
237
247
|
</View>
|
|
238
248
|
<View style={{ flex: 1, marginLeft: 10 }}>
|
|
239
249
|
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, marginBottom: 5 }}>{item?.coupon_title}</Text>
|
|
240
|
-
|
|
250
|
+
{
|
|
251
|
+
item?.amount && item?.amount != "" && item?.amount != 0 &&
|
|
252
|
+
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 14 }}>{LibUtils.money(item?.amount)}</Text>
|
|
253
|
+
}
|
|
241
254
|
<View style={{ flexDirection: "row", marginVertical: 5 }}>
|
|
242
255
|
<Text allowFontScaling={false} style={{ flex: 1, fontFamily: "Arial", fontSize: 12 }}>{String(item?.user_email).toLowerCase()}</Text>
|
|
243
256
|
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, color: "#606060" }}>{moment(item?.claimed_time).localeFormat("DD MMM YYYY HH:mm:ss")}</Text>
|
|
@@ -252,7 +265,7 @@ export default function m(props: EventCoupon_generateProps): any {
|
|
|
252
265
|
/>
|
|
253
266
|
}
|
|
254
267
|
</LibScroll>
|
|
255
|
-
|
|
268
|
+
</LibKeyboard_avoid>
|
|
256
269
|
</View>
|
|
257
270
|
)
|
|
258
271
|
}
|
package/event/detail.tsx
CHANGED
|
@@ -12,9 +12,8 @@ import { LibWebview } from 'esoftplay/cache/lib/webview/import';
|
|
|
12
12
|
|
|
13
13
|
import { applyStyle } from 'esoftplay';
|
|
14
14
|
import { EventCountdown_event } from 'esoftplay/cache/event/countdown_event/import';
|
|
15
|
-
import {
|
|
15
|
+
import { EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
|
|
16
16
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
17
|
-
import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
|
|
18
17
|
import { EventSlider } from 'esoftplay/cache/event/slider/import';
|
|
19
18
|
import { UseCondition } from 'esoftplay/cache/use/condition/import';
|
|
20
19
|
import { UseDeeplinkProperty } from 'esoftplay/cache/use/deeplink/import';
|
|
@@ -31,17 +30,16 @@ export interface EventDetailProps {
|
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
export default function m(props: EventDetailProps): any {
|
|
34
|
-
const { isInPricingQueueConfig } = EventFirebase_socket()
|
|
35
33
|
const [result, setResult] = useSafeState<any>(undefined)
|
|
36
34
|
const url = LibNavigation.getArgs(props, 'url')
|
|
37
35
|
const [deeplinkParams] = UseDeeplinkProperty.params.useState()
|
|
38
36
|
const [priority, setPriority] = useSafeState(false)
|
|
39
|
-
const user = UserClass.state().get()
|
|
40
37
|
|
|
41
38
|
moment().locale('id')
|
|
42
39
|
function loadData(): void {
|
|
43
40
|
// CacheHit.doHit(url)
|
|
44
41
|
new LibCurl(url, null, (res, msg) => {
|
|
42
|
+
esp.modProp("event/countdown").eventURI.set(url)
|
|
45
43
|
EventFirebase_socketProperty.eventIdQueue.set(res.id)
|
|
46
44
|
setResult(res)
|
|
47
45
|
if (res.allotment) {
|
|
@@ -61,7 +59,7 @@ export default function m(props: EventDetailProps): any {
|
|
|
61
59
|
}
|
|
62
60
|
|
|
63
61
|
useEffect(() => {
|
|
64
|
-
if (esp.isDebug("") &&
|
|
62
|
+
if (esp.isDebug("") && UserClass?.state()?.get()?.email == "bagus@fisip.net") {
|
|
65
63
|
LibNavigation.replace('event/detail2', { url: url })
|
|
66
64
|
} else {
|
|
67
65
|
loadData()
|
|
@@ -142,6 +140,7 @@ export default function m(props: EventDetailProps): any {
|
|
|
142
140
|
esp.isDebug("show_countdown") && result?.countdown_booking == 1 && result?.start_date != "0000-00-00" && result.end_date != '0000-00-00' &&
|
|
143
141
|
<EventCountdown_event
|
|
144
142
|
date={(result?.end_date + " " + result?.end_time)}
|
|
143
|
+
timezone={result?.timezone}
|
|
145
144
|
style={{ fontSize: 12 }}
|
|
146
145
|
bulletStyle={{ width: 14, height: 14, borderRadius: 7, marginRight: 10 }}
|
|
147
146
|
containerStyle={{ marginHorizontal: 20, marginBottom: 10 }}
|
|
@@ -274,28 +273,23 @@ export default function m(props: EventDetailProps): any {
|
|
|
274
273
|
{
|
|
275
274
|
result?.url_artist != "" &&
|
|
276
275
|
<TouchableOpacity onPress={() => {
|
|
277
|
-
// LibNavigation.navigate('event/artist', { title: result?.title, url: result?.url_artist, has_addition: result?.has_addition })
|
|
278
276
|
LibNavigation.navigate('event/artist', {
|
|
279
277
|
title: result?.title,
|
|
280
278
|
url: result?.url_artist,
|
|
281
279
|
has_addition: result?.has_addition
|
|
282
280
|
})
|
|
283
|
-
}} style={applyStyle({ width: (LibStyle.width - 30) * 0.5, borderWidth: 2, borderColor: LibStyle.colorGreen, height: 40, borderRadius:
|
|
281
|
+
}} style={applyStyle({ width: (LibStyle.width - 30) * 0.5, borderWidth: 2, borderColor: LibStyle.colorGreen, height: 40, borderRadius: 5, backgroundColor: 'white', flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center', paddingHorizontal: 9 })} >
|
|
284
282
|
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: LibStyle.colorGreen })} >{esp.lang("event/detail", "line_up")}</Text>
|
|
285
283
|
</TouchableOpacity>
|
|
286
284
|
}
|
|
287
285
|
<TouchableOpacity onPress={() => {
|
|
288
|
-
|
|
289
|
-
if (isInPricingQueueConfig(result.id)) {
|
|
290
|
-
await LibNavigation.navigateForResult('event/queue_pricing', { event_id: result?.id })
|
|
291
|
-
}
|
|
286
|
+
esp.modProp("event/index").isLogin(async () => {
|
|
292
287
|
LibNavigation.navigate(
|
|
293
|
-
|
|
294
|
-
'event/ticket_list2'
|
|
288
|
+
(esp.isDebug("") && UserClass?.state()?.get()?.email == "bagus@fisip.net") ? 'event/ticket_list_new'
|
|
295
289
|
:
|
|
296
290
|
(result?.config?.hasOwnProperty('multiprice') && result?.config?.multiprice == 1 ? 'event/ticket_list2' : 'event/ticket_list'),
|
|
297
291
|
{
|
|
298
|
-
url: result.url_price,
|
|
292
|
+
url: esp.isDebug("") && UserClass?.state()?.get()?.email == "bagus@fisip.net" ? result?.url_price_v2 : result.url_price,
|
|
299
293
|
fee_platform: {
|
|
300
294
|
fee_platform_amount: result?.fee_platform_amount,
|
|
301
295
|
fee_platform_type: result?.fee_platform_type,
|
|
@@ -310,7 +304,7 @@ export default function m(props: EventDetailProps): any {
|
|
|
310
304
|
})
|
|
311
305
|
|
|
312
306
|
})
|
|
313
|
-
}} style={applyStyle({ width: result?.url_artist != "" ? (LibStyle.width - 30) * 0.5 : LibStyle.width - 20, borderWidth: 2, borderColor: LibStyle.colorGreen, height: 40, borderRadius:
|
|
307
|
+
}} style={applyStyle({ width: result?.url_artist != "" ? (LibStyle.width - 30) * 0.5 : LibStyle.width - 20, borderWidth: 2, borderColor: LibStyle.colorGreen, height: 40, borderRadius: 5, backgroundColor: LibStyle.colorGreen, flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center', paddingHorizontal: 9 })} >
|
|
314
308
|
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: "#fff" })} >{esp.lang("event/detail", "text_buy_ticket")}</Text>
|
|
315
309
|
</TouchableOpacity>
|
|
316
310
|
<UseCondition if={priority} >
|