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/detail2.tsx
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
// withHooks
|
|
2
2
|
import { applyStyle } from 'esoftplay';
|
|
3
|
-
import {
|
|
3
|
+
import { EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
|
|
4
4
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
5
|
-
import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
|
|
6
5
|
import { EventSlider } from 'esoftplay/cache/event/slider/import';
|
|
7
6
|
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
8
7
|
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
9
8
|
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
10
9
|
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
11
|
-
import { LibProgress } from 'esoftplay/cache/lib/progress/import';
|
|
12
10
|
import { LibScroll } from 'esoftplay/cache/lib/scroll/import';
|
|
13
11
|
import { LibSkeleton } from 'esoftplay/cache/lib/skeleton/import';
|
|
14
12
|
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
@@ -17,11 +15,12 @@ import { LibVideoProperty } from 'esoftplay/cache/lib/video/import';
|
|
|
17
15
|
import { LibWebview } from 'esoftplay/cache/lib/webview/import';
|
|
18
16
|
import { UseCondition } from 'esoftplay/cache/use/condition/import';
|
|
19
17
|
import { UseDeeplinkProperty } from 'esoftplay/cache/use/deeplink/import';
|
|
20
|
-
import { UserClass } from 'esoftplay/cache/user/class/import';
|
|
21
18
|
import esp from 'esoftplay/esp';
|
|
22
19
|
import useSafeState from 'esoftplay/state';
|
|
23
20
|
import { useEffect } from 'react';
|
|
24
21
|
|
|
22
|
+
import useGlobalState, { useGlobalReturn } from 'esoftplay/global';
|
|
23
|
+
import moment from 'esoftplay/moment';
|
|
25
24
|
import React from 'react';
|
|
26
25
|
import { Linking, Pressable, Text, TouchableOpacity, View } from 'react-native';
|
|
27
26
|
import MapView, { Marker } from 'react-native-maps';
|
|
@@ -33,53 +32,76 @@ export interface EventDetail2Args {
|
|
|
33
32
|
export interface EventDetail2Props {
|
|
34
33
|
|
|
35
34
|
}
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
|
|
36
|
+
const stateFeePlatform = useGlobalState({})
|
|
37
|
+
// {
|
|
38
|
+
// fee_platform_amount
|
|
39
|
+
// fee_platform_type
|
|
40
|
+
// show_fee_percentage
|
|
41
|
+
// }
|
|
42
|
+
export function stateSetFeePlatform(): useGlobalReturn<any> {
|
|
43
|
+
return stateFeePlatform
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const stateSubscribe = useGlobalState({})
|
|
47
|
+
// {
|
|
48
|
+
// is_subscribed
|
|
49
|
+
// is_subscribed_default
|
|
50
|
+
// is_subscribed_label
|
|
51
|
+
// }
|
|
52
|
+
export function stateSetSubscribe(): useGlobalReturn<any> {
|
|
53
|
+
return stateSubscribe
|
|
54
|
+
}
|
|
38
55
|
|
|
39
56
|
|
|
40
|
-
|
|
57
|
+
export default function m(props: EventDetail2Props): any {
|
|
58
|
+
const [result, setResult] = useSafeState<any>(undefined)
|
|
59
|
+
const url = LibNavigation.getArgs(props, 'url')
|
|
41
60
|
const [deeplinkParams] = UseDeeplinkProperty.params.useState()
|
|
42
|
-
const [result, setResult] = useSafeState()
|
|
43
61
|
const [priority, setPriority] = useSafeState(false)
|
|
44
|
-
const user = UserClass.state().get()
|
|
45
62
|
|
|
46
63
|
useEffect(() => {
|
|
47
64
|
loadData()
|
|
48
65
|
}, [])
|
|
49
66
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
setResult(res)
|
|
54
|
-
esp.log(res);
|
|
55
|
-
}, (error) => {
|
|
56
|
-
LibDialog.warning(esp.lang("event/detail", "load_failed"), error?.message)
|
|
57
|
-
LibNavigation.back()
|
|
58
|
-
})
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function loadDataConfig(url: string) {
|
|
62
|
-
LibProgress.show("Mohon tunggu")
|
|
67
|
+
moment().locale('id')
|
|
68
|
+
function loadData(): void {
|
|
69
|
+
// CacheHit.doHit(url)
|
|
63
70
|
new LibCurl(url, null, (res, msg) => {
|
|
64
|
-
esp.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
:
|
|
71
|
-
|
|
72
|
-
{
|
|
73
|
-
url: res.url_price,
|
|
74
|
-
is_multiprice: res?.multiprice == 1 ? 1 : 0,
|
|
71
|
+
esp.modProp("event/countdown").eventURI.set(url)
|
|
72
|
+
EventFirebase_socketProperty.eventIdQueue.set(res.id)
|
|
73
|
+
setResult(res)
|
|
74
|
+
if (res.allotment) {
|
|
75
|
+
esp.modProp("event/firebase_socket").userIdKeyReplacer.set({
|
|
76
|
+
t: Number(res.allotment.t),
|
|
77
|
+
s: Number(res.allotment.s),
|
|
78
|
+
priority: 1
|
|
75
79
|
})
|
|
80
|
+
setPriority(true)
|
|
81
|
+
} else {
|
|
82
|
+
setPriority(false)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
let fee_platform: any = {
|
|
86
|
+
fee_platform_amount: res?.fee_platform_amount,
|
|
87
|
+
fee_platform_type: res?.fee_platform_type,
|
|
88
|
+
show_fee_percentage: res?.config?.show_fee_percentage,
|
|
89
|
+
}
|
|
90
|
+
stateFeePlatform.set(fee_platform)
|
|
76
91
|
|
|
92
|
+
let subscribed = {
|
|
93
|
+
is_subscribed: res?.config?.is_subscribed,
|
|
94
|
+
is_subscribed_default: res?.config?.is_subscribed_default,
|
|
95
|
+
is_subscribed_label: res?.config?.is_subscribed_label
|
|
96
|
+
}
|
|
97
|
+
stateSubscribe.set(subscribed)
|
|
77
98
|
}, (error) => {
|
|
78
|
-
LibProgress.hide()
|
|
79
99
|
LibDialog.warning(esp.lang("event/detail", "load_failed"), error?.message)
|
|
100
|
+
LibNavigation.back()
|
|
80
101
|
})
|
|
81
102
|
}
|
|
82
103
|
|
|
104
|
+
|
|
83
105
|
if (!result) {
|
|
84
106
|
let itemWidth = LibStyle.width - 60
|
|
85
107
|
return (
|
|
@@ -268,7 +290,7 @@ export default function m(props: EventDetail2Props): any {
|
|
|
268
290
|
<View style={{ height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 }} >
|
|
269
291
|
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, textAlign: "center", textAlignVertical: 'center', color: 'black', marginHorizontal: 10 }} >
|
|
270
292
|
{
|
|
271
|
-
esp.lang("event/detail", "text_book_on",
|
|
293
|
+
esp.lang("event/detail", "text_book_on", moment(result.start_booking).serverFormat('DD MMMM YYYY H:mm:ss', result?.timezone), result?.timezone_locale || "")
|
|
272
294
|
}
|
|
273
295
|
</Text>
|
|
274
296
|
</View>
|
|
@@ -279,45 +301,25 @@ export default function m(props: EventDetail2Props): any {
|
|
|
279
301
|
{
|
|
280
302
|
result?.url_artist != "" &&
|
|
281
303
|
<TouchableOpacity onPress={() => {
|
|
282
|
-
// LibNavigation.navigate('event/artist', { title: result?.title, url: result?.url_artist, has_addition: result?.has_addition })
|
|
283
304
|
LibNavigation.navigate('event/artist', {
|
|
284
305
|
title: result?.title,
|
|
285
306
|
url: result?.url_artist,
|
|
286
307
|
has_addition: result?.has_addition
|
|
287
308
|
})
|
|
288
|
-
}} style={applyStyle({ width: (LibStyle.width - 30) * 0.5, borderWidth: 2, borderColor: LibStyle.colorGreen, height: 40, borderRadius:
|
|
309
|
+
}} 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 })} >
|
|
289
310
|
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: LibStyle.colorGreen })} >{esp.lang("event/detail", "line_up")}</Text>
|
|
290
311
|
</TouchableOpacity>
|
|
291
312
|
}
|
|
292
313
|
<TouchableOpacity onPress={() => {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
await LibNavigation.navigateForResult('event/queue_pricing', { event_id: result?.id })
|
|
296
|
-
}
|
|
297
|
-
loadDataConfig(result?.url_config)
|
|
298
|
-
return
|
|
299
|
-
LibNavigation.navigate(
|
|
300
|
-
user?.config?.tester == 1 ?
|
|
301
|
-
'event/ticket_list2'
|
|
302
|
-
:
|
|
303
|
-
(result?.config?.hasOwnProperty('multiprice') && result?.config?.multiprice == 1 ? 'event/ticket_list2' : 'event/ticket_list'),
|
|
314
|
+
esp.modProp("event/index").isLogin(async () => {
|
|
315
|
+
LibNavigation.navigate('event/ticket_list_new',
|
|
304
316
|
{
|
|
305
|
-
url: result
|
|
306
|
-
fee_platform: {
|
|
307
|
-
fee_platform_amount: result?.fee_platform_amount,
|
|
308
|
-
fee_platform_type: result?.fee_platform_type,
|
|
309
|
-
},
|
|
310
|
-
subscribed: {
|
|
311
|
-
is_subscribed: result?.config?.is_subscribed,
|
|
312
|
-
is_subscribed_default: result?.config?.is_subscribed_default,
|
|
313
|
-
is_subscribed_label: result?.config?.is_subscribed_label
|
|
314
|
-
},
|
|
315
|
-
show_fee_percentage: result?.config?.show_fee_percentage,
|
|
317
|
+
url: result?.url_price_v2,
|
|
316
318
|
is_multiprice: result?.config?.multiprice == 1 ? 1 : 0,
|
|
317
319
|
})
|
|
318
|
-
})
|
|
319
320
|
|
|
320
|
-
|
|
321
|
+
})
|
|
322
|
+
}} 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 })} >
|
|
321
323
|
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: "#fff" })} >{esp.lang("event/detail", "text_buy_ticket")}</Text>
|
|
322
324
|
</TouchableOpacity>
|
|
323
325
|
<UseCondition if={priority} >
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
|
|
3
|
+
import { EventCountdown_timestamp } from 'esoftplay/cache/event/countdown_timestamp/import';
|
|
4
|
+
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
5
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
6
|
+
import esp from 'esoftplay/esp';
|
|
7
|
+
import useSafeState from 'esoftplay/state';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { Pressable, Text, View } from 'react-native';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export interface EventDialog_customArgs {
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
export interface EventDialog_customProps {
|
|
16
|
+
icon: any,
|
|
17
|
+
msg: string,
|
|
18
|
+
color: any
|
|
19
|
+
showCountdown?: boolean
|
|
20
|
+
onPressCancel: () => void,
|
|
21
|
+
onPressOK: () => void
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default function m(props: EventDialog_customProps): any {
|
|
25
|
+
const expTimestamp = Date.now() + 1000 * 60
|
|
26
|
+
const [timer] = useSafeState<number>(expTimestamp)
|
|
27
|
+
const [show, setShow] = useSafeState<boolean>(props?.showCountdown || false)
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<View style={{}}>
|
|
31
|
+
<View style={{ marginTop: 16, marginHorizontal: 10 }} >
|
|
32
|
+
<View style={{ alignItems: 'center', justifyContent: 'center' }} >
|
|
33
|
+
{props.icon && <View style={{ marginBottom: 30 }} ><LibIcon name={props.icon} size={70} color={props.color} /></View>}
|
|
34
|
+
{props.msg && <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "normal", fontStyle: "normal", lineHeight: 19, letterSpacing: 0, textAlign: "center", color: "#4a4a4a" }}>{props.msg || ''}</Text>}
|
|
35
|
+
</View>
|
|
36
|
+
</View>
|
|
37
|
+
<View style={{ flexDirection: 'row', marginTop: 30, paddingHorizontal: 10 }} >
|
|
38
|
+
<Pressable onPress={props.onPressCancel} style={{ flex: 1, height: 40, alignItems: 'center', justifyContent: 'center' }} >
|
|
39
|
+
<Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 15 }}>{esp.lang("event/randomseat", "back")}</Text>
|
|
40
|
+
{/* <LibTextstyle textStyle="body" text={esp.lang("event/randomseat", "back")} /> */}
|
|
41
|
+
</Pressable>
|
|
42
|
+
<Pressable onPress={() => {
|
|
43
|
+
if (!show) {
|
|
44
|
+
props?.onPressOK?.()
|
|
45
|
+
setShow(x => !x)
|
|
46
|
+
}
|
|
47
|
+
}} style={{ flex: 1, height: 40, backgroundColor: LibStyle.colorRed, opacity: show ? 0.8 : 1, borderRadius: 25, alignItems: 'center', justifyContent: 'center', flexDirection: "row" }} >
|
|
48
|
+
<Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 15, color: '#fff' }}>{esp.lang("component/dialog_custom", "try_again")}</Text>
|
|
49
|
+
|
|
50
|
+
{
|
|
51
|
+
show &&
|
|
52
|
+
<>
|
|
53
|
+
<Text style={{ fontWeight: 'bold', fontSize: 15, color: '#fff' }}>{" ("}</Text>
|
|
54
|
+
<EventCountdown_timestamp
|
|
55
|
+
onExpired={() => {
|
|
56
|
+
setShow(x => !x)
|
|
57
|
+
}}
|
|
58
|
+
expiredTimestamp={timer}
|
|
59
|
+
style={{ color: "#fff", fontWeight: 'bold' }} />
|
|
60
|
+
<Text style={{ fontWeight: 'bold', fontSize: 15, color: '#fff' }}>{")"}</Text>
|
|
61
|
+
</>
|
|
62
|
+
}
|
|
63
|
+
</Pressable>
|
|
64
|
+
</View>
|
|
65
|
+
</View>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
@@ -14,6 +14,7 @@ import { LibProgress } from 'esoftplay/cache/lib/progress/import';
|
|
|
14
14
|
import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
|
|
15
15
|
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
16
16
|
import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
|
|
17
|
+
import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
|
|
17
18
|
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
18
19
|
import { UseCondition } from 'esoftplay/cache/use/condition/import';
|
|
19
20
|
import { UserClass } from 'esoftplay/cache/user/class/import';
|
|
@@ -55,6 +56,10 @@ export default function m(props: EventExchange_ticket_listProps): any {
|
|
|
55
56
|
return 0
|
|
56
57
|
}
|
|
57
58
|
|
|
59
|
+
function isEmptyObject(obj: any) {
|
|
60
|
+
return JSON.stringify(obj) === "{}";
|
|
61
|
+
}
|
|
62
|
+
|
|
58
63
|
return (
|
|
59
64
|
<View style={{ flex: 1, }}>
|
|
60
65
|
<EventHeader title={esp.lang("event/exchange_ticket", "exchange_history")} />
|
|
@@ -156,20 +161,24 @@ export default function m(props: EventExchange_ticket_listProps): any {
|
|
|
156
161
|
<EventButton
|
|
157
162
|
style={{ margin: 10 }}
|
|
158
163
|
label={esp.lang("event/tms_log", "btn_close")} onPress={() => {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
164
|
+
if (isEmptyObject(log)) {
|
|
165
|
+
LibToastProperty.show(esp.lang("event/tms_log", "empty_data"))
|
|
166
|
+
} else {
|
|
167
|
+
LibDialog.confirm(esp.lang("event/tms_log", "send_title"), "Kirim laporan scan exchange tiket ke admin?", esp.lang("event/tms_log", "send_ok"), () => {
|
|
168
|
+
LibProgress.show("Loading..")
|
|
169
|
+
sendTm("#closing_exchange\n" + JSON.stringify({
|
|
170
|
+
domain: esp.config('domain'),
|
|
171
|
+
tms_name: UserClass.state().get('name'),
|
|
172
|
+
email: UserClass.state().get('email'),
|
|
173
|
+
event_name: EventTms_dashboardProperty.closingDataState()?.get()?.event_name,
|
|
174
|
+
data: EventExchange_ticketProperty.stateExchangeLog.get()
|
|
175
|
+
}, undefined, 2), '-1001737180019', undefined, () => {
|
|
176
|
+
EventExchange_ticketProperty.stateExchangeLog.reset()
|
|
177
|
+
LibProgress.hide()
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
}, esp.lang("event/tms_log", "send_no"), () => { })
|
|
181
|
+
}
|
|
173
182
|
|
|
174
183
|
}} />
|
|
175
184
|
|
|
@@ -123,7 +123,7 @@ export default function m(props: EventExchange_ticket_resultProps): any {
|
|
|
123
123
|
<View style={{ flex: 1, flexDirection: 'row', alignContent: 'center', alignItems: 'center', padding: 5 }}>
|
|
124
124
|
<View style={{ flex: 1, }}>
|
|
125
125
|
<Text allowFontScaling={false} numberOfLines={2} ellipsizeMode="tail" style={{ fontSize: 16, fontWeight: 'bold', color: "#000" }}>{item?.title} </Text>
|
|
126
|
-
<Text allowFontScaling={false} style={{ fontSize: 18, marginTop: 4, letterSpacing: 1 }}>{item?.
|
|
126
|
+
<Text allowFontScaling={false} style={{ fontSize: 18, marginTop: 4, letterSpacing: 1 }}>{item?.list?.filter?.((x: any) => x?.is_exchanged == 0)?.length || 0} {esp.lang("event/exchange_ticket_result", "available")}</Text>
|
|
127
127
|
</View>
|
|
128
128
|
{
|
|
129
129
|
item?.list?.[0].is_exchanged == 0 &&
|
package/event/firebase_socket.ts
CHANGED
|
@@ -117,7 +117,7 @@ export default function useFirebaseSocket() {
|
|
|
117
117
|
return
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
if (userIdKeyReplacer.get()?.priority == 1) {
|
|
120
|
+
if (userIdKeyReplacer.get()?.priority == 1 && userIdKeyReplacer.get()?.t) {
|
|
121
121
|
const coll = collection(db, [getEventPath(), path, event_id].join('/'));
|
|
122
122
|
const q = query(coll, orderBy('t', 'asc'), where("t", "==", userIdKeyReplacer.get().t));
|
|
123
123
|
getDocs(q).then((doc) => {
|
|
@@ -168,17 +168,19 @@ export default function useFirebaseSocket() {
|
|
|
168
168
|
// get weather function
|
|
169
169
|
|
|
170
170
|
function getQueue(path: string, event_id: string, _limit: number, cb: (idx: number, key: string) => void) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
171
|
+
if (userIdKeyReplacer.get()?.s) {
|
|
172
|
+
const instance: any = esp.mod("firestore/index")().instance()
|
|
173
|
+
const db = getFirestore(instance)
|
|
174
|
+
const coll = collection(db, [getEventPath(), path, event_id].join('/'));
|
|
175
|
+
const q = query(coll, orderBy('s', 'asc'), where("s", "<", userIdKeyReplacer.get().s));
|
|
176
|
+
getCountFromServer(q).then((v) => {
|
|
177
|
+
cb(v.data().count, userIdKeyReplacer.get().id)
|
|
178
|
+
}).catch((e) => {
|
|
179
|
+
getQueue(path, event_id, _limit, cb)
|
|
180
|
+
console.log({ e })
|
|
181
|
+
})
|
|
182
|
+
}
|
|
175
183
|
|
|
176
|
-
getCountFromServer(q).then((v) => {
|
|
177
|
-
cb(v.data().count, userIdKeyReplacer.get().id)
|
|
178
|
-
}).catch((e) => {
|
|
179
|
-
getQueue(path, event_id, _limit, cb)
|
|
180
|
-
console.log({ e })
|
|
181
|
-
})
|
|
182
184
|
// /* cleanup */
|
|
183
185
|
// const cdate = getDateTimebyGmt7().getTime()
|
|
184
186
|
// if (!cdate) {
|
|
@@ -227,7 +229,7 @@ export default function useFirebaseSocket() {
|
|
|
227
229
|
}
|
|
228
230
|
}
|
|
229
231
|
|
|
230
|
-
function isInPricingQueueConfig(event_id: string) {
|
|
232
|
+
function isInPricingQueueConfig(event_id: string): boolean {
|
|
231
233
|
return eventQueueConfig.get(event_id) && eventQueueConfig.get(event_id).limit > 0
|
|
232
234
|
}
|
|
233
235
|
|
package/event/htmltext.tsx
CHANGED
|
@@ -9,15 +9,11 @@ export interface EventHtmltextProps extends TextProps {
|
|
|
9
9
|
export default function m({ style, children, ...props }: EventHtmltextProps): JSX.Element {
|
|
10
10
|
const renderChildren = (child: ReactNode) => {
|
|
11
11
|
if (typeof child === 'string') {
|
|
12
|
-
return
|
|
12
|
+
return parseRecursive(child).map((part, index) => (
|
|
13
13
|
<Text key={index} style={[style, part.style]}>
|
|
14
|
-
{part.
|
|
14
|
+
{part.children}
|
|
15
15
|
</Text>
|
|
16
16
|
));
|
|
17
|
-
} else if (React.isValidElement(child)) {
|
|
18
|
-
return React.cloneElement(child, {
|
|
19
|
-
style: [style, child.props.style], // Merge styles properly
|
|
20
|
-
});
|
|
21
17
|
} else if (Array.isArray(child)) {
|
|
22
18
|
return child.map((nestedChild, index) => (
|
|
23
19
|
<React.Fragment key={index}>{renderChildren(nestedChild)}</React.Fragment>
|
|
@@ -29,32 +25,48 @@ export default function m({ style, children, ...props }: EventHtmltextProps): JS
|
|
|
29
25
|
return <Text {...props}>{renderChildren(children)}</Text>;
|
|
30
26
|
}
|
|
31
27
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
interface ParsedPart {
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
style: TextStyle;
|
|
31
|
+
}
|
|
36
32
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
33
|
+
const parseRecursive = (htmlString: string): ParsedPart[] => {
|
|
34
|
+
const regex = /<(b|i|u|span|br)(?:\s+style=["']color:\s*(.*?)["'])?\s*>(.*?)<\/\1>|<br\s*\/?>/i;
|
|
35
|
+
const match = htmlString.match(regex);
|
|
41
36
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
parts.push({ text: '\n', style: {} });
|
|
50
|
-
}
|
|
37
|
+
if (!match) {
|
|
38
|
+
return [{ children: htmlString, style: {} }];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const parts: ParsedPart[] = [];
|
|
42
|
+
const [fullMatch, tag, color, content] = match;
|
|
43
|
+
const index = match.index!;
|
|
51
44
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
45
|
+
if (index > 0) {
|
|
46
|
+
parts.push({ children: htmlString.substring(0, index), style: {} });
|
|
47
|
+
}
|
|
48
|
+
let currentStyle: TextStyle = {};
|
|
49
|
+
switch (tag?.toLowerCase()) {
|
|
50
|
+
case 'b': currentStyle.fontWeight = 'bold'; break;
|
|
51
|
+
case 'i': currentStyle.fontStyle = 'italic'; break;
|
|
52
|
+
case 'u': currentStyle.textDecorationLine = 'underline'; break;
|
|
53
|
+
case 'span': if (color) currentStyle.color = color.trim(); break;
|
|
54
|
+
case 'br':
|
|
55
|
+
parts.push({ children: '\n', style: {} });
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (tag !== 'br' && content !== undefined) {
|
|
60
|
+
const nestedParts = parseRecursive(content).map(p => ({
|
|
61
|
+
...p,
|
|
62
|
+
style: { ...currentStyle, ...p.style }
|
|
63
|
+
}));
|
|
64
|
+
parts.push(...nestedParts);
|
|
65
|
+
}
|
|
55
66
|
|
|
56
|
-
|
|
57
|
-
|
|
67
|
+
const remaining = htmlString.substring(index + fullMatch.length);
|
|
68
|
+
if (remaining) {
|
|
69
|
+
parts.push(...parseRecursive(remaining));
|
|
58
70
|
}
|
|
59
71
|
|
|
60
72
|
return parts;
|
package/event/index.tsx
CHANGED
|
@@ -74,12 +74,18 @@ export function isLogin(isLogin: () => void, isLogout?: () => void): void {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
const ticketState = useGlobalState<any>(undefined, { persistKey: 'bigbang_card_tiket_cache1', isUserData: true, inFile: true, loadOnInit: true })
|
|
77
|
-
export const reload = useGlobalSubscriber()
|
|
78
|
-
|
|
79
77
|
export function stateTicketCache(): useGlobalReturn<any> {
|
|
80
78
|
return ticketState
|
|
81
79
|
}
|
|
82
80
|
|
|
81
|
+
const bookedAddons = useGlobalState<any>({}, { persistKey: 'event_detail_addons_booked2', isUserData: true, inFile: true, loadOnInit: true })
|
|
82
|
+
export function stateBookedAddonsCache(): useGlobalReturn<any> {
|
|
83
|
+
return bookedAddons
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export const reload = useGlobalSubscriber()
|
|
87
|
+
|
|
88
|
+
|
|
83
89
|
const state = useGlobalState<any>(undefined, { persistKey: 'bigbang/event', inFile: true })
|
|
84
90
|
|
|
85
91
|
export default function m(props: EventIndexProps): any {
|
package/event/label_input.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import { Text, View } from 'react-native';
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
export interface EventLabel_inputArgs {
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
}
|
|
10
10
|
export interface EventLabel_inputProps {
|
|
11
11
|
mandatory?: boolean,
|
|
@@ -16,7 +16,7 @@ export interface EventLabel_inputProps {
|
|
|
16
16
|
export default function m(props: EventLabel_inputProps): any {
|
|
17
17
|
return (
|
|
18
18
|
<View style={{ flexDirection: 'row', marginTop: 16 }}>
|
|
19
|
-
<Text allowFontScaling={false} style={{ fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: props.labelColor ? props.labelColor : "#9b9b9b", }}>{props.label}</Text>
|
|
19
|
+
<Text allowFontScaling={false} numberOfLines={1} style={{ fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: props.labelColor ? props.labelColor : "#9b9b9b", }}>{props.label}</Text>
|
|
20
20
|
{props.mandatory && <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: props.mandatoryColor ? props.mandatoryColor : "#d0021b" }}> *</Text>}
|
|
21
21
|
</View>
|
|
22
22
|
)
|