esoftplay-event 0.0.0-a
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/config.json +11 -0
- package/event/additional.tsx +188 -0
- package/event/additional_input.tsx +316 -0
- package/event/block_invitation.tsx +48 -0
- package/event/countdown.tsx +72 -0
- package/event/counter_cashier.tsx +180 -0
- package/event/counter_cashier_report.tsx +114 -0
- package/event/counter_cashier_sell.tsx +135 -0
- package/event/counter_eo.tsx +451 -0
- package/event/counter_history.tsx +74 -0
- package/event/counter_history_item.tsx +48 -0
- package/event/counter_info.tsx +96 -0
- package/event/counter_lm.tsx +273 -0
- package/event/counter_menu.tsx +85 -0
- package/event/counter_report.tsx +105 -0
- package/event/counter_report_breakdown.tsx +93 -0
- package/event/counter_report_detail.tsx +238 -0
- package/event/counter_report_detail_list.tsx +56 -0
- package/event/counter_request.tsx +136 -0
- package/event/counter_request_detail.tsx +211 -0
- package/event/counter_section.tsx +32 -0
- package/event/counter_send.tsx +277 -0
- package/event/counter_status.tsx +32 -0
- package/event/counter_type.tsx +23 -0
- package/event/counter_user_list.tsx +197 -0
- package/event/counter_user_list_item.tsx +143 -0
- package/event/coupon.tsx +124 -0
- package/event/coupon_claim.tsx +198 -0
- package/event/coupon_claim_detail.tsx +175 -0
- package/event/coupon_claim_history.tsx +279 -0
- package/event/coupon_claim_reimburse.tsx +111 -0
- package/event/coupon_claim_reimburse_history.tsx +72 -0
- package/event/coupon_claim_reimburse_history_detail.tsx +117 -0
- package/event/coupon_claim_staff.tsx +256 -0
- package/event/coupon_detail.tsx +98 -0
- package/event/coupon_event_list.tsx +77 -0
- package/event/coupon_generate.tsx +258 -0
- package/event/coupon_generate_event.tsx +79 -0
- package/event/coupon_generate_list.tsx +56 -0
- package/event/date_picker.tsx +152 -0
- package/event/detail.tsx +352 -0
- package/event/entrance.tsx +215 -0
- package/event/entrance_again.tsx +200 -0
- package/event/entrance_failed.tsx +190 -0
- package/event/entrance_idcard.tsx +203 -0
- package/event/entrance_list.tsx +264 -0
- package/event/entrance_list_item.tsx +88 -0
- package/event/entrance_log.tsx +130 -0
- package/event/entrance_success.tsx +155 -0
- package/event/entrance_warning.tsx +91 -0
- package/event/exchange_reward.tsx +31 -0
- package/event/exchange_reward_result.tsx +137 -0
- package/event/exchange_ticket.tsx +234 -0
- package/event/exchange_ticket_list.tsx +191 -0
- package/event/exchange_ticket_result.tsx +211 -0
- package/event/exit.tsx +91 -0
- package/event/exit_failed.tsx +135 -0
- package/event/exit_list.tsx +118 -0
- package/event/exit_log.tsx +131 -0
- package/event/exit_success.tsx +143 -0
- package/event/exit_temporary.tsx +226 -0
- package/event/hall_in.tsx +148 -0
- package/event/hall_in_failed.tsx +270 -0
- package/event/hall_in_list.tsx +222 -0
- package/event/hall_in_log.tsx +134 -0
- package/event/hall_in_success.tsx +132 -0
- package/event/hall_out.tsx +143 -0
- package/event/hall_out_failed.tsx +133 -0
- package/event/hall_out_list.tsx +215 -0
- package/event/hall_out_log.tsx +133 -0
- package/event/hall_out_success.tsx +130 -0
- package/event/list.tsx +219 -0
- package/event/list_filter.tsx +124 -0
- package/event/log.tsx +435 -0
- package/event/qc_idcard.tsx +209 -0
- package/event/qc_idcard_failed.tsx +78 -0
- package/event/qc_idcard_success.tsx +68 -0
- package/event/queue_out.tsx +186 -0
- package/event/queue_pricing.tsx +152 -0
- package/event/randomseat.tsx +33 -0
- package/event/review.tsx +117 -0
- package/event/review_add.tsx +342 -0
- package/event/review_detail.tsx +67 -0
- package/event/review_item.tsx +76 -0
- package/event/scan_item.tsx +66 -0
- package/event/schedule.tsx +135 -0
- package/event/seat.tsx +628 -0
- package/event/seat_autopick.tsx +120 -0
- package/event/seat_map.tsx +408 -0
- package/event/seat_map_matrix.tsx +94 -0
- package/event/seat_map_test.tsx +401 -0
- package/event/ticket_list.tsx +722 -0
- package/event/ticket_list2.tsx +680 -0
- package/event/timer.tsx +58 -0
- package/event/tms.tsx +103 -0
- package/event/tms_add.tsx +94 -0
- package/event/tms_add_result.tsx +175 -0
- package/event/tms_dashboard.tsx +89 -0
- package/event/tms_event_list.tsx +66 -0
- package/event/turnstile_event_gate.tsx +74 -0
- package/event/turnstile_event_item.tsx +41 -0
- package/event/turnstile_event_list.tsx +69 -0
- package/event/turnstile_event_ticket.tsx +95 -0
- package/event/turnstile_settings.tsx +327 -0
- package/event/turnstile_settings_otp.tsx +58 -0
- package/event/turnstile_settings_status.tsx +50 -0
- package/event/voucher.tsx +149 -0
- package/event/voucher_multi.tsx +181 -0
- package/fonts/Arial.ttf +0 -0
- package/fonts/ArialBold.ttf +0 -0
- package/fonts/DecoNumbers.ttf +0 -0
- package/fonts/MonoSpace.ttf +0 -0
- package/fonts/SFProText.ttf +0 -0
- package/fonts/digital.ttf +0 -0
- package/fonts/mono.ttf +0 -0
- package/id.json +1113 -0
- package/index.js +2 -0
- package/libs.json +1 -0
- package/mover.js +0 -0
- package/package.json +16 -0
- package/publisher.js +84 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
|
|
3
|
+
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
4
|
+
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
5
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
6
|
+
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { Text, TouchableOpacity, View } from 'react-native';
|
|
10
|
+
|
|
11
|
+
export interface EventTurnstile_event_itemArgs {
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
export interface EventTurnstile_event_itemProps {
|
|
15
|
+
image: string,
|
|
16
|
+
title: string,
|
|
17
|
+
start_date: string,
|
|
18
|
+
end_date: string,
|
|
19
|
+
onPress: () => void
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default function m(props: EventTurnstile_event_itemProps): any {
|
|
23
|
+
let itemWidth = (LibStyle.width - 20)
|
|
24
|
+
const styleId_bwKGY: any = { margin: 10, backgroundColor: '#fff', width: itemWidth, borderRadius: 10, overflow: 'hidden', ...LibStyle.elevation(2) }
|
|
25
|
+
const styleId_Z16usbs: any = { borderRadius: 10, width: itemWidth, height: itemWidth / 3 }
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<TouchableOpacity onPress={props.onPress} style={styleId_bwKGY} >
|
|
29
|
+
<LibPicture source={{ uri: props.image }} style={styleId_Z16usbs} resizeMode='cover' />
|
|
30
|
+
<Text allowFontScaling={false} style={styleId_Z9MfLY}>{props.title}</Text>
|
|
31
|
+
<View style={styleId_2oI6AB}>
|
|
32
|
+
<LibIcon name='calendar-today' color="#9b9b9b" size={15} />
|
|
33
|
+
<Text allowFontScaling={false} style={styleId_TCgQl}>{LibUtils.getDateRange(props.start_date, props.end_date, " - ")}</Text>
|
|
34
|
+
</View>
|
|
35
|
+
</TouchableOpacity>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const styleId_Z9MfLY: any = { fontFamily: "ArialBold", fontSize: 12, color: "#000", margin: 10 }
|
|
40
|
+
const styleId_2oI6AB: any = { flexDirection: 'row', alignContent: 'center', alignItems: 'center', margin: 10, marginTop: -5 }
|
|
41
|
+
const styleId_TCgQl: any = { marginLeft: 5, fontFamily: "Arial", fontSize: 10, color: "#9b9b9b" }
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
import { ComponentHeader } from 'esoftplay/cache/component/header/import';
|
|
3
|
+
import { ComponentMessage } from 'esoftplay/cache/component/message/import';
|
|
4
|
+
import { EventTurnstile_event_item } from 'esoftplay/cache/event/turnstile_event_item/import';
|
|
5
|
+
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
6
|
+
import { LibList } from 'esoftplay/cache/lib/list/import';
|
|
7
|
+
import { LibLoading } from 'esoftplay/cache/lib/loading/import';
|
|
8
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
9
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
10
|
+
import esp from 'esoftplay/esp';
|
|
11
|
+
import useSafeState from 'esoftplay/state';
|
|
12
|
+
|
|
13
|
+
import React, { useEffect } from 'react';
|
|
14
|
+
import { View } from 'react-native';
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
export interface EventTurnstile_event_listArgs {
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
export interface EventTurnstile_event_listProps {
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
export default function m(props: EventTurnstile_event_listProps): any {
|
|
24
|
+
const [result, setResult] = useSafeState<any>(undefined)
|
|
25
|
+
const [error, setError] = useSafeState<any>()
|
|
26
|
+
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
return () => LibNavigation.cancelBackResult(LibNavigation.getResultKey(props))
|
|
29
|
+
}, [])
|
|
30
|
+
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
loadDataEvent()
|
|
33
|
+
}, [])
|
|
34
|
+
|
|
35
|
+
function loadDataEvent() {
|
|
36
|
+
new LibCurl("gate_turnstile_event", null, (res, msg) => {
|
|
37
|
+
setResult(res)
|
|
38
|
+
}, (err) => {
|
|
39
|
+
setError(err)
|
|
40
|
+
}, 1)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function renderItem(item: any) {
|
|
44
|
+
return (
|
|
45
|
+
<EventTurnstile_event_item onPress={() => {
|
|
46
|
+
LibNavigation.sendBackResult(item)
|
|
47
|
+
}} image={item.event_image} title={item.event_name} start_date={item.event_start_date} end_date={item.event_end_date} />
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
|
|
53
|
+
<ComponentHeader title={esp.lang("event/turnstile_event_list", "header_title")} />
|
|
54
|
+
{
|
|
55
|
+
!result && !error ? <LibLoading /> :
|
|
56
|
+
<LibList
|
|
57
|
+
data={result}
|
|
58
|
+
onRefresh={loadDataEvent}
|
|
59
|
+
ListEmptyComponent={
|
|
60
|
+
<ComponentMessage message={error?.message} />
|
|
61
|
+
}
|
|
62
|
+
renderItem={renderItem}
|
|
63
|
+
|
|
64
|
+
/>
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
</View >
|
|
68
|
+
)
|
|
69
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
import { applyStyle } from 'esoftplay';
|
|
3
|
+
import { ComponentButton } from 'esoftplay/cache/component/button/import';
|
|
4
|
+
import { ComponentHeader } from 'esoftplay/cache/component/header/import';
|
|
5
|
+
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
6
|
+
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
7
|
+
import { LibList } from 'esoftplay/cache/lib/list/import';
|
|
8
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
9
|
+
import { LibObject } from 'esoftplay/cache/lib/object/import';
|
|
10
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
11
|
+
import esp from 'esoftplay/esp';
|
|
12
|
+
import useSafeState from 'esoftplay/state';
|
|
13
|
+
|
|
14
|
+
import React, { useEffect } from 'react';
|
|
15
|
+
import { Text, TouchableOpacity, View } from 'react-native';
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export interface EventTurnstile_event_ticketArgs {
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
export interface EventTurnstile_event_ticketProps {
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
export default function m(props: EventTurnstile_event_ticketProps): any {
|
|
25
|
+
const { event_id } = LibNavigation.getArgsAll(props)
|
|
26
|
+
const [result, setResult, getResult] = useSafeState<any>(undefined)
|
|
27
|
+
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
return () => LibNavigation.cancelBackResult(LibNavigation.getResultKey(props))
|
|
30
|
+
}, [])
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
loadDataGate()
|
|
34
|
+
}, [])
|
|
35
|
+
|
|
36
|
+
function loadDataGate() {
|
|
37
|
+
new LibCurl("gate_turnstile_event_ticket?event_id=" + event_id, null, (res, msg) => {
|
|
38
|
+
res?.push({
|
|
39
|
+
id: 0,
|
|
40
|
+
type: esp.lang("event/turnstile_event_ticket", "id")
|
|
41
|
+
})
|
|
42
|
+
const a = res.length > 0 && res.map((item: any, i: number) => {
|
|
43
|
+
return ({
|
|
44
|
+
...item,
|
|
45
|
+
checked: 1
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
setResult(a)
|
|
50
|
+
}, (err) => {
|
|
51
|
+
// setError(err)
|
|
52
|
+
}, 1)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function renderItem(item: any, i: number) {
|
|
56
|
+
let _selectTypeTicket = item.checked == 1
|
|
57
|
+
return (
|
|
58
|
+
<TouchableOpacity activeOpacity={item.id == 0 ? 1 : 0} onPress={() => {
|
|
59
|
+
if (item.id != 0) {
|
|
60
|
+
setResult(LibObject.set(getResult(), item.checked == 0 ? 1 : 0)(i, "checked"))
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
}} style={applyStyle({ borderBottomWidth: 1, borderBottomColor: LibStyle.colorBgGrey })} >
|
|
64
|
+
<View style={applyStyle({ margin: 15, width: LibStyle.width, flex: 1, flexDirection: 'row', alignContent: 'center', alignItems: 'center' })} >
|
|
65
|
+
<LibIcon name={_selectTypeTicket ? "checkbox-marked" : "checkbox-blank-outline"} style={{ /* opacity: textOpacity */ }} size={18} color={item.id == 0 ? "#c9c9c9" : _selectTypeTicket ? "#3ea4dc" : "#434343"} />
|
|
66
|
+
<Text allowFontScaling={false} style={applyStyle({ marginLeft: 10, fontFamily: "Arial", fontSize: 13, /* opacity: textOpacity */fontWeight: "bold", fontStyle: "normal", letterSpacing: 0/* , color: LibStyle.colorBlue */ })} >{item.type}</Text>
|
|
67
|
+
</View>
|
|
68
|
+
</TouchableOpacity>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function sendDataBack() {
|
|
73
|
+
let _ids = result.filter((item: any) => item.checked == 1).map((it: any) => it.id)
|
|
74
|
+
let data = {
|
|
75
|
+
ids: _ids,
|
|
76
|
+
title: esp.lang("event/turnstile_event_ticket", "ticket_type", _ids.length)
|
|
77
|
+
}
|
|
78
|
+
LibNavigation.sendBackResult(data)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<View style={{ flex: 1, backgroundColor: "#fff" }}>
|
|
83
|
+
<ComponentHeader title={esp.lang("event/turnstile_event_ticket", "header_title")} />
|
|
84
|
+
<LibList
|
|
85
|
+
data={result}
|
|
86
|
+
onRefresh={loadDataGate}
|
|
87
|
+
renderItem={renderItem}
|
|
88
|
+
/>
|
|
89
|
+
|
|
90
|
+
<ComponentButton label={esp.lang("event/turnstile_event_ticket", "label_next")} onPress={() => {
|
|
91
|
+
sendDataBack()
|
|
92
|
+
}} style={{ margin: 10 }} backgroundColor={LibStyle.colorPrimary} fontColor='#000' />
|
|
93
|
+
</View>
|
|
94
|
+
)
|
|
95
|
+
}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
import { ComponentButton } from 'esoftplay/cache/component/button/import';
|
|
3
|
+
import { ComponentHeader } from 'esoftplay/cache/component/header/import';
|
|
4
|
+
import { ComponentSlidingup } from 'esoftplay/cache/component/slidingup/import';
|
|
5
|
+
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
6
|
+
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
7
|
+
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
8
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
9
|
+
import { LibProgress } from 'esoftplay/cache/lib/progress/import';
|
|
10
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
11
|
+
import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
|
|
12
|
+
import { MarketToggle } from 'esoftplay/cache/market/toggle/import';
|
|
13
|
+
import esp from 'esoftplay/esp';
|
|
14
|
+
import useSafeState from 'esoftplay/state';
|
|
15
|
+
|
|
16
|
+
import React, { useEffect, useRef } from 'react';
|
|
17
|
+
import { Pressable, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export interface EventTurnstile_settingsArgs {
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
export interface EventTurnstile_settingsProps {
|
|
24
|
+
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface Turnstile_settingsItem2 extends EventTurnstile_settingsProps {
|
|
28
|
+
title: string
|
|
29
|
+
value: string
|
|
30
|
+
iconLeft: string
|
|
31
|
+
isTouchable: boolean
|
|
32
|
+
isDisable?: boolean
|
|
33
|
+
onPress: () => void,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function Item(props: Turnstile_settingsItem2) {
|
|
37
|
+
return (
|
|
38
|
+
<Pressable onPress={props.onPress} style={{ backgroundColor: props.isDisable ? "#f1f2f3" : "transparent", flex: 1, flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center', borderBottomWidth: 1, borderBottomColor: LibStyle.colorBgGrey, paddingBottom: 7, paddingTop: 7, paddingHorizontal: 10, paddingRight: 5 }}>
|
|
39
|
+
<View style={{ flex: 1, flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
|
|
40
|
+
<LibIcon name={props.iconLeft} style={{ opacity: props.isDisable ? 0.2 : 1 }} />
|
|
41
|
+
<View style={{ marginLeft: 8, flex: 2, flexDirection: 'row', opacity: props.isDisable ? 0.2 : 1 }}>
|
|
42
|
+
<Text allowFontScaling={false} style={{ fontFamily: 'SFProText', fontSize: 12 }}>{props.title}</Text>
|
|
43
|
+
<Text allowFontScaling={false} style={{ color: LibStyle.colorRed }}>*</Text>
|
|
44
|
+
</View>
|
|
45
|
+
</View>
|
|
46
|
+
<View style={{ marginLeft: 10, flex: 1, justifyContent: 'flex-end', flexDirection: 'row', alignContent: 'center', alignItems: 'center', }}>
|
|
47
|
+
<Text allowFontScaling={false} numberOfLines={1} ellipsizeMode='middle' style={{ opacity: props.isDisable ? 0.5 : 1, flex: 1, textAlign: 'right', marginRight: 5, fontFamily: 'SFProText', fontSize: 12, color: LibStyle.colorTextPrimary }}>{props.value}</Text>
|
|
48
|
+
{
|
|
49
|
+
props.isTouchable &&
|
|
50
|
+
<LibIcon name='chevron-right' color={LibStyle.colorTextPrimary} style={{ opacity: props.isDisable ? 0.4 : 1 }} />
|
|
51
|
+
}
|
|
52
|
+
{/* <LibIcon name='logo' color={LibStyle.colorTextPrimary} /> */}
|
|
53
|
+
</View>
|
|
54
|
+
</Pressable>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const config = esp.config();
|
|
59
|
+
|
|
60
|
+
export default function m(props: EventTurnstile_settingsProps): any {
|
|
61
|
+
const { serial_number } = LibNavigation.getArgsAll<any>(props)
|
|
62
|
+
const [userScan, setUserScan] = useSafeState<boolean>(false)
|
|
63
|
+
const [forExhibitor, setForExhibitor] = useSafeState<boolean>(false)
|
|
64
|
+
const [result, setResult] = useSafeState<any>(undefined)
|
|
65
|
+
const [selectedEvent, setSelectedEvent] = useSafeState<any>()
|
|
66
|
+
const [selectedGate, setSelectedGate] = useSafeState<any>()
|
|
67
|
+
const [selectedTypeGate, setSelectedTypeGate] = useSafeState<any>()
|
|
68
|
+
const [selectedTypeTicket, setSelectedTypeTicket] = useSafeState<any>()
|
|
69
|
+
|
|
70
|
+
const dialogTypeGate = useRef<ComponentSlidingup>(null)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
const typeGate = [
|
|
74
|
+
{
|
|
75
|
+
id: 1,
|
|
76
|
+
title: esp.lang("event/turnstile_settings", "entrance"),
|
|
77
|
+
icon: 'login'
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 0,
|
|
81
|
+
title: esp.lang("event/turnstile_settings", "exit"),
|
|
82
|
+
icon: 'logout'
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
checkStatus()
|
|
89
|
+
}, [])
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
function checkStatus() {
|
|
93
|
+
LibProgress.show(esp.lang("event/turnstile_settings", "please_wait"))
|
|
94
|
+
new LibCurl("gate_turnstile?serial_number=" + serial_number, null, (res, msg) => {
|
|
95
|
+
setResult(res)
|
|
96
|
+
LibProgress.hide()
|
|
97
|
+
// default value
|
|
98
|
+
let defaultValue = res?.turnstile_data_backup
|
|
99
|
+
let dataEvent = {
|
|
100
|
+
event_id: defaultValue.event_id,
|
|
101
|
+
event_name: defaultValue.event_name
|
|
102
|
+
}
|
|
103
|
+
setSelectedEvent(dataEvent)
|
|
104
|
+
|
|
105
|
+
let dataGate = {
|
|
106
|
+
gate_id: defaultValue.gate_id,
|
|
107
|
+
gate_name: defaultValue.gate_name
|
|
108
|
+
}
|
|
109
|
+
setSelectedGate(dataGate)
|
|
110
|
+
|
|
111
|
+
let dataTypeGate = {
|
|
112
|
+
id: defaultValue.gate_type,
|
|
113
|
+
title: defaultValue.gate_type == 1 ? esp.lang("event/turnstile_settings", "entrance") : esp.lang("event/turnstile_settings", "exit")
|
|
114
|
+
}
|
|
115
|
+
setSelectedTypeGate(dataTypeGate)
|
|
116
|
+
|
|
117
|
+
let dataTypeTicket = {
|
|
118
|
+
ids: defaultValue.ticket_types,
|
|
119
|
+
title: defaultValue.ticket_types.length + esp.lang("event/turnstile_settings", "type_ticket")
|
|
120
|
+
}
|
|
121
|
+
setSelectedTypeTicket(dataTypeTicket)
|
|
122
|
+
|
|
123
|
+
}, (error) => {
|
|
124
|
+
LibProgress.hide()
|
|
125
|
+
registerTurnstile()
|
|
126
|
+
}, 1)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function registerTurnstile() {
|
|
130
|
+
let post = {
|
|
131
|
+
serial_number: serial_number
|
|
132
|
+
}
|
|
133
|
+
LibProgress.show(esp.lang("event/turnstile_settings", "please_wait"))
|
|
134
|
+
new LibCurl("gate_turnstile", post, (res, msg) => {
|
|
135
|
+
LibProgress.hide()
|
|
136
|
+
}, (error) => {
|
|
137
|
+
LibProgress.hide()
|
|
138
|
+
}, 1)
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function loadDataGate(event_id: any) {
|
|
142
|
+
LibProgress.show(esp.lang("event/turnstile_settings", "please_wait"))
|
|
143
|
+
new LibCurl("gate_turnstile_event_ticket?event_id=" + event_id, null, (res, msg) => {
|
|
144
|
+
const a = res.length > 0 && res.map((item: any, i: number) => {
|
|
145
|
+
return ({
|
|
146
|
+
...item,
|
|
147
|
+
checked: 1
|
|
148
|
+
})
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
let _ids = a.filter((item: any) => item.checked == 1).map((it: any) => it.id)
|
|
152
|
+
let data = {
|
|
153
|
+
ids: _ids,
|
|
154
|
+
title: _ids.length + esp.lang("event/turnstile_settings", "type_ticket")
|
|
155
|
+
}
|
|
156
|
+
setSelectedTypeTicket(data)
|
|
157
|
+
LibProgress.hide()
|
|
158
|
+
}, (err) => {
|
|
159
|
+
LibProgress.hide()
|
|
160
|
+
LibDialog.warning(esp.lang("event/turnstile_settings", "err"), err?.message)
|
|
161
|
+
}, 1)
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function checkInput() {
|
|
165
|
+
if (!selectedEvent) {
|
|
166
|
+
LibToastProperty.show(esp.lang("event/turnstile_settings", "please_select_event_first"))
|
|
167
|
+
return false
|
|
168
|
+
}
|
|
169
|
+
if (!selectedGate) {
|
|
170
|
+
LibToastProperty.show(esp.lang("event/turnstile_settings", "please_select_gate_event"))
|
|
171
|
+
return false
|
|
172
|
+
}
|
|
173
|
+
if (!selectedTypeGate) {
|
|
174
|
+
LibToastProperty.show(esp.lang("event/turnstile_settings", "please_select_entrance_or_exit"))
|
|
175
|
+
return false
|
|
176
|
+
}
|
|
177
|
+
if (!selectedTypeTicket) {
|
|
178
|
+
LibToastProperty.show(esp.lang("event/turnstile_settings", "please_select_type_ticket"))
|
|
179
|
+
return false
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return true
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function settingTurnstile() {
|
|
186
|
+
LibDialog.warningConfirm(esp.lang("event/turnstile_settings", "warning"), esp.lang("event/turnstile_settings", "submit_this"), esp.lang("event/turnstile_settings", "yes"), () => {
|
|
187
|
+
let post = {
|
|
188
|
+
event_id: selectedEvent?.event_id,
|
|
189
|
+
gate_id: selectedGate?.gate_id,
|
|
190
|
+
gate_type: selectedTypeGate?.id,
|
|
191
|
+
ticket_types: forExhibitor ? "" : selectedTypeTicket?.ids.join('|'),
|
|
192
|
+
user_scan: userScan ? 1 : 0,
|
|
193
|
+
serial_number: serial_number,
|
|
194
|
+
type: forExhibitor ? 2 : 1 //"type":"1=scan tiket, 2 = scan idcard, 3 = scan tiket dan idcard "
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
LibProgress.show(esp.lang("event/turnstile_settings", "please_wait"))
|
|
198
|
+
new LibCurl("gate_turnstile_setting", post, (res, msg) => {
|
|
199
|
+
LibProgress.hide()
|
|
200
|
+
LibNavigation.back()
|
|
201
|
+
LibNavigation.navigate('event/turnstile_settings_otp', { data: res, serial_number: serial_number })
|
|
202
|
+
}, (err) => {
|
|
203
|
+
LibProgress.hide()
|
|
204
|
+
LibDialog.warning(esp.lang("event/turnstile_settings", "err1"), err?.message)
|
|
205
|
+
}, 1)
|
|
206
|
+
|
|
207
|
+
}, esp.lang("event/turnstile_settings", "no"), () => {
|
|
208
|
+
|
|
209
|
+
})
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function renderTypeGate(item: any, i: number) {
|
|
213
|
+
const styleId_Z2dCK0A: any = { backgroundColor: item.id == 1 ? LibStyle.colorGreen : LibStyle.colorRed, padding: 10, borderRadius: 5, ...LibStyle.elevation(2), justifyContent: 'center', alignContent: 'center', alignItems: 'center' }
|
|
214
|
+
return (
|
|
215
|
+
<TouchableOpacity onPress={() => {
|
|
216
|
+
setSelectedTypeGate(item)
|
|
217
|
+
dialogTypeGate.current!.hide()
|
|
218
|
+
}} key={i} style={styleId_Z2dCK0A}>
|
|
219
|
+
<LibIcon name={item.icon} color='#fff' />
|
|
220
|
+
<Text allowFontScaling={false} style={styleId_QwGnx}>{item.title}</Text>
|
|
221
|
+
</TouchableOpacity>
|
|
222
|
+
)
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
return (
|
|
226
|
+
<View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
|
|
227
|
+
<ComponentHeader title={esp.lang("event/turnstile_settings", "setting_turnstile")} />
|
|
228
|
+
<ScrollView>
|
|
229
|
+
<View style={{ backgroundColor: '#fff', borderRadius: 10, margin: 10, ...LibStyle.elevation(2) }}>
|
|
230
|
+
<Item isTouchable onPress={() => {
|
|
231
|
+
LibNavigation.navigateForResult('event/turnstile_event_list', { api_key: result?.api_key }).then((item: any) => {
|
|
232
|
+
setSelectedEvent(item)
|
|
233
|
+
setSelectedGate(undefined)
|
|
234
|
+
setSelectedTypeGate(undefined)
|
|
235
|
+
setSelectedTypeTicket(undefined)
|
|
236
|
+
|
|
237
|
+
// set Type ticket
|
|
238
|
+
loadDataGate(item.event_id)
|
|
239
|
+
})
|
|
240
|
+
}} iconLeft='calendar-today' title={esp.lang("event/turnstile_settings", "select_event")} value={selectedEvent?.event_name} />
|
|
241
|
+
<Item isTouchable iconLeft='door-open' title={esp.lang("event/turnstile_settings", "select_gate")} value={selectedGate?.gate_name} onPress={() => {
|
|
242
|
+
if (!selectedEvent) {
|
|
243
|
+
LibToastProperty.show(esp.lang("event/turnstile_settings", "please_select_event_first"))
|
|
244
|
+
} else {
|
|
245
|
+
LibNavigation.navigateForResult('event/turnstile_event_gate', { api_key: result?.api_key, event_id: selectedEvent?.event_id }).then((item: any) => {
|
|
246
|
+
setSelectedGate(item)
|
|
247
|
+
})
|
|
248
|
+
}
|
|
249
|
+
}} />
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
<Item isTouchable iconLeft='login' title={esp.lang("event/turnstile_settings", "select_type_gate")} value={selectedTypeGate?.title} onPress={() => {
|
|
253
|
+
dialogTypeGate.current!.show()
|
|
254
|
+
}} />
|
|
255
|
+
|
|
256
|
+
{/* untuk turnstile khusus exhibitor */}
|
|
257
|
+
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center', borderBottomWidth: 1, borderBottomColor: LibStyle.colorBgGrey, paddingBottom: 7, marginTop: 7, paddingHorizontal: 10, }}>
|
|
258
|
+
<View style={{ flex: 1, flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
|
|
259
|
+
<LibIcon name={"id-card"} />
|
|
260
|
+
<Text allowFontScaling={false} style={{ marginLeft: 8, fontFamily: 'SFProText', flex: 2, fontSize: 12 }}>{esp.lang("event/turnstile_settings", "id_card")}</Text>
|
|
261
|
+
</View>
|
|
262
|
+
<View style={{ marginLeft: 10, marginRight: 5, flex: 1, justifyContent: 'flex-end', flexDirection: 'row', alignContent: 'center', alignItems: 'center', }}>
|
|
263
|
+
<MarketToggle value={forExhibitor} onChangeValue={() => {
|
|
264
|
+
setForExhibitor(forExhibitor == true ? false : true)
|
|
265
|
+
if (forExhibitor) {
|
|
266
|
+
setForExhibitor(false)
|
|
267
|
+
} else {
|
|
268
|
+
let dataTypeTicket = {
|
|
269
|
+
ids: '',
|
|
270
|
+
title: ''
|
|
271
|
+
}
|
|
272
|
+
setSelectedTypeTicket(dataTypeTicket)
|
|
273
|
+
|
|
274
|
+
setForExhibitor(true)
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
}} type='success' />
|
|
278
|
+
</View>
|
|
279
|
+
</View>
|
|
280
|
+
|
|
281
|
+
<Item isDisable={forExhibitor} isTouchable iconLeft='ticket-confirmation' title={esp.lang("event/turnstile_settings", "select_type_ticket")} value={selectedTypeTicket?.title} onPress={() => {
|
|
282
|
+
if (forExhibitor == false) {
|
|
283
|
+
if (!selectedEvent) {
|
|
284
|
+
LibToastProperty.show(esp.lang("event/turnstile_settings", "please_select_event_first"))
|
|
285
|
+
} else {
|
|
286
|
+
LibNavigation.navigateForResult('event/turnstile_event_ticket', { api_key: result?.api_key, event_id: selectedEvent?.event_id }).then((item: any) => {
|
|
287
|
+
setSelectedTypeTicket(item)
|
|
288
|
+
})
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}} />
|
|
292
|
+
|
|
293
|
+
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center', borderBottomWidth: 1, borderBottomColor: LibStyle.colorBgGrey, paddingBottom: 7, marginTop: 7, paddingHorizontal: 10, }}>
|
|
294
|
+
<View style={{ flex: 1, flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
|
|
295
|
+
<LibIcon name={"magnify-scan"} />
|
|
296
|
+
<Text allowFontScaling={false} style={{ marginLeft: 8, fontFamily: 'SFProText', flex: 2, fontSize: 12 }}>{esp.lang("event/turnstile_settings", "Enable_User_Scan")}</Text>
|
|
297
|
+
</View>
|
|
298
|
+
<View style={{ marginLeft: 10, marginRight: 5, flex: 1, justifyContent: 'flex-end', flexDirection: 'row', alignContent: 'center', alignItems: 'center', }}>
|
|
299
|
+
<MarketToggle value={userScan} onChangeValue={() => { setUserScan(userScan == true ? false : true) }} type='success' />
|
|
300
|
+
</View>
|
|
301
|
+
</View>
|
|
302
|
+
</View>
|
|
303
|
+
|
|
304
|
+
</ScrollView>
|
|
305
|
+
|
|
306
|
+
<ComponentButton label={esp.lang("event/turnstile_settings", "submit")} onPress={() => {
|
|
307
|
+
if (checkInput()) {
|
|
308
|
+
settingTurnstile()
|
|
309
|
+
}
|
|
310
|
+
}} style={{ margin: 10 }} backgroundColor={LibStyle.colorPrimary} fontColor='#000' />
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
<ComponentSlidingup ref={dialogTypeGate}>
|
|
314
|
+
<View style={{ backgroundColor: '#f6f6f6', borderTopRightRadius: 10, borderTopLeftRadius: 10, paddingBottom: 25, paddingHorizontal: 19, }}>
|
|
315
|
+
<Text allowFontScaling={false} style={{ marginTop: 15, marginBottom: 23, fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, textAlign: "center", color: "#34495e" }}>{esp.lang("event/turnstile_settings", "please_select_type_gate")}</Text>
|
|
316
|
+
<View style={{ flexDirection: 'row', justifyContent: 'space-around' }}>
|
|
317
|
+
{
|
|
318
|
+
typeGate?.map(renderTypeGate)
|
|
319
|
+
}
|
|
320
|
+
</View>
|
|
321
|
+
|
|
322
|
+
</View>
|
|
323
|
+
</ComponentSlidingup>
|
|
324
|
+
</View >
|
|
325
|
+
)
|
|
326
|
+
}
|
|
327
|
+
const styleId_QwGnx: any = { marginTop: 8, fontFamily: 'SFProText', fontSize: 12, color: '#fff' }
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
import { ComponentHeader } from 'esoftplay/cache/component/header/import';
|
|
3
|
+
import { LibAutoreload } from 'esoftplay/cache/lib/autoreload/import';
|
|
4
|
+
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
5
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
6
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
7
|
+
import { MarketCountdown } from 'esoftplay/cache/market/countdown/import';
|
|
8
|
+
import esp from 'esoftplay/esp';
|
|
9
|
+
import moment from 'esoftplay/moment';
|
|
10
|
+
|
|
11
|
+
import React, { useEffect } from 'react';
|
|
12
|
+
import { Text, View } from 'react-native';
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export interface EventTurnstile_settings_otpArgs {
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
export interface EventTurnstile_settings_otpProps {
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
export default function m(props: EventTurnstile_settings_otpProps): any {
|
|
22
|
+
const { data, serial_number } = LibNavigation.getArgsAll(props)
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
loadData()
|
|
26
|
+
LibAutoreload.set(() => {
|
|
27
|
+
loadData()
|
|
28
|
+
}, 6000)
|
|
29
|
+
return () => LibAutoreload.clear()
|
|
30
|
+
}, [])
|
|
31
|
+
|
|
32
|
+
function loadData() {
|
|
33
|
+
let post = {
|
|
34
|
+
serial_number: serial_number
|
|
35
|
+
}
|
|
36
|
+
new LibCurl('gate_turnstile_setted', post, (res, msg) => {
|
|
37
|
+
LibAutoreload.clear()
|
|
38
|
+
LibNavigation.back()
|
|
39
|
+
LibNavigation.navigate('event/turnstile_settings_status', { msg: msg })
|
|
40
|
+
}, (error) => {
|
|
41
|
+
}, 1)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
|
|
46
|
+
<ComponentHeader title={esp.lang("event/turnstile_settings_otp", "header")} />
|
|
47
|
+
|
|
48
|
+
<View style={{ backgroundColor: '#fff', borderRadius: 10, margin: 10 }}>
|
|
49
|
+
<Text allowFontScaling={false} style={{ fontFamily: 'SFProText', fontSize: 12, alignSelf: 'center', margin: 10, marginBottom: 0 }}>{esp.lang("event/turnstile_settings", "verification_code")}</Text>
|
|
50
|
+
<Text allowFontScaling={false} style={{ fontFamily: 'DecoNumbers', fontSize: 60, fontWeight: 'bold', alignSelf: 'center', margin: 10, marginTop: 0 }}>{data?.otp_code}</Text>
|
|
51
|
+
<View style={{ borderTopWidth: 1, borderTopColor: LibStyle.colorBgGrey, padding: 10 }}>
|
|
52
|
+
<Text allowFontScaling={false} style={{ fontFamily: 'SFProText', fontSize: 12, color: LibStyle.colorRed }}>{esp.lang("event/turnstile_settings_otp", "insert_code")}</Text>
|
|
53
|
+
<MarketCountdown expired={moment(data?.otp_expire_time).serverFormat('YYYY-MM-DD HH:mm:ss')} style={{ fontSize: 14, color: LibStyle.colorRed, fontFamily: "ArialBold", fontWeight: "normal", fontStyle: "normal" }} />
|
|
54
|
+
</View>
|
|
55
|
+
</View>
|
|
56
|
+
</View>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
import { ComponentHeader } from 'esoftplay/cache/component/header/import';
|
|
3
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
4
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
5
|
+
import esp from 'esoftplay/esp';
|
|
6
|
+
|
|
7
|
+
import LottieView from "lottie-react-native";
|
|
8
|
+
import React, { useRef } from 'react';
|
|
9
|
+
import { Text, View } from 'react-native';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export interface EventTurnstile_settings_statusArgs {
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
export interface EventTurnstile_settings_statusProps {
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
export default function m(props: EventTurnstile_settings_statusProps): any {
|
|
19
|
+
const { msg } = LibNavigation.getArgsAll(props)
|
|
20
|
+
|
|
21
|
+
const animation = useRef<LottieView>(null)
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
|
|
25
|
+
<ComponentHeader title={esp.lang("event/turnstile_settings", "setting_turnstile")} />
|
|
26
|
+
{
|
|
27
|
+
msg &&
|
|
28
|
+
<>
|
|
29
|
+
<View style={{ alignItems: 'center', margin: 15, marginBottom: 0, padding: 10, backgroundColor: '#fff', borderRadius: 10, borderColor: LibStyle.colorGrey, borderWidth: 1 }} >
|
|
30
|
+
<LottieView
|
|
31
|
+
ref={animation}
|
|
32
|
+
loop={true}
|
|
33
|
+
autoPlay
|
|
34
|
+
style={{
|
|
35
|
+
width: LibStyle.width - 100,
|
|
36
|
+
height: LibStyle.width - 100,
|
|
37
|
+
}}
|
|
38
|
+
source={esp.assets('success.json')}
|
|
39
|
+
// OR find more Lottie files @ https://lottiefiles.com/featured
|
|
40
|
+
// Just click the one you like, place that file in the 'assets' folder to the left, and replace the above 'require' statement
|
|
41
|
+
/>
|
|
42
|
+
</View>
|
|
43
|
+
<View style={{ margin: 15, padding: 10, backgroundColor: '#fff', borderRadius: 10, borderColor: LibStyle.colorGrey, borderWidth: 1 }}>
|
|
44
|
+
<Text style={{ alignSelf: 'center', textAlign: 'center', fontFamily: 'SFProText', fontWeight: 'bold', fontSize: 30, color: '#4a4a4a' }} >{msg}</Text>
|
|
45
|
+
</View>
|
|
46
|
+
</>
|
|
47
|
+
}
|
|
48
|
+
</View>
|
|
49
|
+
)
|
|
50
|
+
}
|