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
package/config.json
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
import { ComponentButton } from 'esoftplay/cache/component/button/import';
|
|
5
|
+
import { ComponentHeader } from 'esoftplay/cache/component/header/import';
|
|
6
|
+
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
7
|
+
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
8
|
+
import { LibLoading } from 'esoftplay/cache/lib/loading/import';
|
|
9
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
10
|
+
import { LibObject } from 'esoftplay/cache/lib/object/import';
|
|
11
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
12
|
+
import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
|
|
13
|
+
import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
|
|
14
|
+
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
15
|
+
import { UserClass } from 'esoftplay/cache/user/class/import';
|
|
16
|
+
import esp from 'esoftplay/esp';
|
|
17
|
+
import useSafeState from 'esoftplay/state';
|
|
18
|
+
import React from 'react';
|
|
19
|
+
import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export interface EventAdditionalArgs {
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
export interface EventAdditionalProps {
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default function m(props: EventAdditionalProps): any {
|
|
30
|
+
|
|
31
|
+
const { event_id, qty, ondate, price_id, type_ticket }: any = LibNavigation.getArgsAll(props)
|
|
32
|
+
const [result, setResult] = useSafeState()
|
|
33
|
+
const [dataAddPost, setDataAddPost] = useSafeState<any[]>([])
|
|
34
|
+
const user = UserClass.state().get()
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
loadData()
|
|
39
|
+
return () => LibNavigation.cancelBackResult(LibNavigation.getResultKey(props))
|
|
40
|
+
}, [])
|
|
41
|
+
|
|
42
|
+
function loadData() {
|
|
43
|
+
let url = 'event_booking_addition_form?event_id=' + event_id + "&price_id=" + price_id
|
|
44
|
+
new LibCurl(url, null, (res, msg) => {
|
|
45
|
+
const a = res?.additions?.length > 0 && res?.additions?.map?.((item: any, i: number) => {
|
|
46
|
+
return ({
|
|
47
|
+
...item,
|
|
48
|
+
value: [],
|
|
49
|
+
})
|
|
50
|
+
})
|
|
51
|
+
const b = {
|
|
52
|
+
...res,
|
|
53
|
+
additions: a
|
|
54
|
+
}
|
|
55
|
+
setResult(b)
|
|
56
|
+
|
|
57
|
+
let is_each = res?.each == 0 ? 1 : qty
|
|
58
|
+
setDataAddPost(new Array(is_each).fill({}))
|
|
59
|
+
|
|
60
|
+
}, (err) => {
|
|
61
|
+
LibToastProperty.show(err.message)
|
|
62
|
+
LibNavigation.back()
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function renderItem(item: any, i: number) {
|
|
67
|
+
let isEmptyObj = Object.keys(item).length > 0
|
|
68
|
+
return (
|
|
69
|
+
<View key={i} >
|
|
70
|
+
<View style={{ margin: 15, padding: 10, marginBottom: 5, marginTop: 10, backgroundColor: '#fff', borderRadius: 5 }}>
|
|
71
|
+
<TouchableOpacity onPress={() => {
|
|
72
|
+
LibNavigation.navigateForResult('event/additional_input', { data: result, itemAddition: item }, 190).then((value) => {
|
|
73
|
+
setDataAddPost(LibObject.set(dataAddPost, value)(i))
|
|
74
|
+
})
|
|
75
|
+
}} style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'space-between' }}>
|
|
76
|
+
<Text allowFontScaling={false} style={{ color: LibStyle.colorPrimary, fontWeight: 'bold' }}>{esp.lang("event/additional", "complete_info", String(Number(i + 1)))}</Text>
|
|
77
|
+
<LibIcon name='pencil-outline' size={20} color={LibStyle.colorPrimary} />
|
|
78
|
+
</TouchableOpacity>
|
|
79
|
+
</View>
|
|
80
|
+
{
|
|
81
|
+
isEmptyObj &&
|
|
82
|
+
<View style={{ margin: 18, padding: 10, marginBottom: 5, marginTop: -3, backgroundColor: '#fff', borderBottomLeftRadius: 5, borderBottomRightRadius: 5 }}>
|
|
83
|
+
{
|
|
84
|
+
item.additions?.map((it: any, ii: number) => {
|
|
85
|
+
return (
|
|
86
|
+
<View key={ii} style={{ paddingHorizontal: 10, paddingVertical: 5, borderRadius: 5, marginBottom: 10, backgroundColor: LibStyle.colorBgGrey }}>
|
|
87
|
+
<Text allowFontScaling={false} numberOfLines={2} ellipsizeMode='tail' style={{ fontSize: 14, color: "#009688", fontWeight: 'bold', letterSpacing: 0.5, marginBottom: 5 }}>{it.question}</Text>
|
|
88
|
+
{
|
|
89
|
+
it.display_value?.map((x: any, z: number) => {
|
|
90
|
+
return (
|
|
91
|
+
<Text allowFontScaling={false} style={{ fontSize: 12, color: '#000', marginRight: 6 }}>{x}</Text>
|
|
92
|
+
)
|
|
93
|
+
})
|
|
94
|
+
}
|
|
95
|
+
{
|
|
96
|
+
it.value?.length == 0 &&
|
|
97
|
+
<Text allowFontScaling={false} style={{ fontSize: 12, color: '#000', marginRight: 6 }}>-</Text>
|
|
98
|
+
}
|
|
99
|
+
{
|
|
100
|
+
it.subvalue &&
|
|
101
|
+
<Text allowFontScaling={false} style={{ marginTop: 5, fontSize: 12, color: '#000' }}>{it.subvalue}</Text>
|
|
102
|
+
}
|
|
103
|
+
</View>
|
|
104
|
+
)
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
</View>
|
|
108
|
+
}
|
|
109
|
+
</View>
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function isObjectEmpty(obj: any) {
|
|
114
|
+
return Object.keys(obj).length === 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (!result) {
|
|
118
|
+
return <LibLoading />
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
|
|
124
|
+
<ComponentHeader title={esp.lang("event/additional", "header_title")} subtitle={ondate && ondate != "0000-00-00" ? type_ticket + " " + LibUtils.moment(ondate).format("DD MMM YYYY") : type_ticket} />
|
|
125
|
+
<ScrollView>
|
|
126
|
+
<View style={{ margin: 15, marginBottom: 5, marginTop: 10, padding: 10, borderWidth: 1, borderColor: '#fff', borderRadius: 5, backgroundColor: '#fff', ...LibStyle.elevation(2) }}>
|
|
127
|
+
<LibTextstyle textStyle='m_overline' text={esp.lang("event/additional", "buyer_info")} style={{ color: "#aaa", fontSize: 12, marginBottom: 5 }} />
|
|
128
|
+
<Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 16, letterSpacing: 1 }}>{user?.name}</Text>
|
|
129
|
+
<Text allowFontScaling={false} style={{ fontSize: 14, letterSpacing: 1 }}>{user?.email}</Text>
|
|
130
|
+
<Text allowFontScaling={false} style={{ fontSize: 12, letterSpacing: 1 }}>{user?.phone}</Text>
|
|
131
|
+
</View>
|
|
132
|
+
|
|
133
|
+
{
|
|
134
|
+
result?.title != "" &&
|
|
135
|
+
<LibTextstyle textStyle='m_overline' text={result?.title} style={{ lineHeight: 20, color: '#000', fontSize: 14, margin: 15, fontWeight: 'bold', marginBottom: 0 }} />
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
{
|
|
139
|
+
dataAddPost?.map(renderItem)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
</ScrollView>
|
|
143
|
+
<View style={{ padding: 10 }}>
|
|
144
|
+
<ComponentButton
|
|
145
|
+
label={esp.lang("event/additional", "btn_next")}
|
|
146
|
+
backgroundColor={LibStyle.colorPrimary}
|
|
147
|
+
onPress={() => {
|
|
148
|
+
let isRequire = result?.additions?.length > 0 && result?.additions?.filter((item: any) => item.is_required == 1)
|
|
149
|
+
let obj2: any[] = []
|
|
150
|
+
dataAddPost.map((item: any) => {
|
|
151
|
+
let obj1: any[] = []
|
|
152
|
+
item.additions?.map((it: any) => {
|
|
153
|
+
let a = [
|
|
154
|
+
it.id,
|
|
155
|
+
it.value,
|
|
156
|
+
]
|
|
157
|
+
if (it.hasOwnProperty("subvalue")) {
|
|
158
|
+
a.push(it.subvalue)
|
|
159
|
+
}
|
|
160
|
+
if (it.type == 1 || it.type == 2 || it.type == 3) {
|
|
161
|
+
a.push(it.value[0])
|
|
162
|
+
a[1] = []
|
|
163
|
+
}
|
|
164
|
+
obj1.push(a)
|
|
165
|
+
})
|
|
166
|
+
obj2.push(obj1)
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
if (isRequire.length > 0) {
|
|
170
|
+
const emptyObject = dataAddPost.some(item => isObjectEmpty(item));
|
|
171
|
+
|
|
172
|
+
if (emptyObject) {
|
|
173
|
+
LibToastProperty.show(esp.lang("event/additional", "toast_empty"))
|
|
174
|
+
} else {
|
|
175
|
+
|
|
176
|
+
let addition = JSON.stringify(obj2)
|
|
177
|
+
LibNavigation.sendBackResult(addition, LibNavigation.getResultKey(props))
|
|
178
|
+
}
|
|
179
|
+
} else {
|
|
180
|
+
let addition = JSON.stringify(obj2)
|
|
181
|
+
LibNavigation.sendBackResult(addition == "[[]]" ? "" : addition, LibNavigation.getResultKey(props))
|
|
182
|
+
}
|
|
183
|
+
}}
|
|
184
|
+
/>
|
|
185
|
+
</View>
|
|
186
|
+
</View>
|
|
187
|
+
)
|
|
188
|
+
}
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
|
|
4
|
+
import { ComponentButton } from 'esoftplay/cache/component/button/import';
|
|
5
|
+
import { ComponentHeader } from 'esoftplay/cache/component/header/import';
|
|
6
|
+
import { ComponentSlidingup } from 'esoftplay/cache/component/slidingup/import';
|
|
7
|
+
import { LibCollaps } from 'esoftplay/cache/lib/collaps/import';
|
|
8
|
+
import { LibDatepicker } from 'esoftplay/cache/lib/datepicker/import';
|
|
9
|
+
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
10
|
+
import { LibInput_rectangle } from 'esoftplay/cache/lib/input_rectangle/import';
|
|
11
|
+
import { LibKeyboard_avoid } from 'esoftplay/cache/lib/keyboard_avoid/import';
|
|
12
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
13
|
+
import { LibObject } from 'esoftplay/cache/lib/object/import';
|
|
14
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
15
|
+
import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
|
|
16
|
+
import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
|
|
17
|
+
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
18
|
+
import esp from 'esoftplay/esp';
|
|
19
|
+
import useGlobalState, { useGlobalReturn } from 'esoftplay/global';
|
|
20
|
+
import useLazyState from 'esoftplay/lazy';
|
|
21
|
+
import useSafeState from 'esoftplay/state';
|
|
22
|
+
import React from 'react';
|
|
23
|
+
import { Pressable, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
export interface EventAdditional_inputArgs {
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
export interface EventAdditional_inputProps {
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// export type ItemAddition = {
|
|
34
|
+
// "each": string,
|
|
35
|
+
// "title": string,
|
|
36
|
+
// "additions": Array<{
|
|
37
|
+
// "id": string,
|
|
38
|
+
// "question": string,
|
|
39
|
+
// "type": string,
|
|
40
|
+
// "is_option": string,
|
|
41
|
+
// "is_content": string,
|
|
42
|
+
// "is_required": string,
|
|
43
|
+
// "options": Array<{
|
|
44
|
+
// "id": string,
|
|
45
|
+
// "content": string,
|
|
46
|
+
// }>,
|
|
47
|
+
// "value": Array<string>,
|
|
48
|
+
// "display_value": Array<string>,
|
|
49
|
+
// "subvalue"?: string,
|
|
50
|
+
// }>,
|
|
51
|
+
// }
|
|
52
|
+
|
|
53
|
+
const additionalState = useGlobalState<any>(undefined, { persistKey: 'event/additional_input' })
|
|
54
|
+
|
|
55
|
+
export function state(): useGlobalReturn<any> {
|
|
56
|
+
return additionalState
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export default function m(props: EventAdditional_inputProps): any {
|
|
60
|
+
const { data, itemAddition } = LibNavigation.getArgsAll(props)
|
|
61
|
+
const dialogDatePicker = useRef<ComponentSlidingup>(null)
|
|
62
|
+
const dialogDropdown = useRef<ComponentSlidingup>(null)
|
|
63
|
+
const [dropdownData, setDropdownData] = useSafeState()
|
|
64
|
+
|
|
65
|
+
const [newData, setNewData] = useSafeState()
|
|
66
|
+
const [, setIdx, getIdx] = useLazyState<number>()
|
|
67
|
+
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (Object.keys(itemAddition).length > 0) {
|
|
70
|
+
setNewData(itemAddition)
|
|
71
|
+
} else {
|
|
72
|
+
setNewData(data)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return () => LibNavigation.cancelBackResult(LibNavigation.getResultKey(props))
|
|
76
|
+
}, [])
|
|
77
|
+
|
|
78
|
+
function save() {
|
|
79
|
+
let stillEmpty1 = newData?.additions?.filter((item: any) => item.is_required == 1).filter((it: any) => (it.value?.length == 0 && !it.subvalue)).length > 0
|
|
80
|
+
if (stillEmpty1) {
|
|
81
|
+
LibToastProperty.show(esp.lang("event/additional_input", "complete_info"))
|
|
82
|
+
return
|
|
83
|
+
} else {
|
|
84
|
+
LibNavigation.sendBackResult(newData, 190)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function renderCatNew(item: any, i: number) {
|
|
89
|
+
let values = newData?.additions?.[i]?.value
|
|
90
|
+
let display_values = newData?.additions?.[i]?.display_value
|
|
91
|
+
|
|
92
|
+
let show = true /* Object.keys(itemAddition).length > 0 ? true : false */
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<View key={i} style={{ backgroundColor: '#fff', borderRadius: 5, margin: 15, marginBottom: 5, marginTop: 10 }}>
|
|
96
|
+
<LibCollaps key={i} show={show} header={(show) =>
|
|
97
|
+
<View style={{ padding: 7, borderBottomColor: '#c9c9c9', borderBottomWidth: 0.5, justifyContent: 'space-between', flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
|
|
98
|
+
<View style={{ flex: 6, flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
|
|
99
|
+
<Text allowFontScaling={false} style={{ flexWrap: 'wrap', fontSize: 14, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#000", }}>{item.question}</Text>
|
|
100
|
+
{
|
|
101
|
+
item.is_required == 1 &&
|
|
102
|
+
<Text allowFontScaling={false} style={{ fontSize: 14, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#d0021b" }}> *</Text>
|
|
103
|
+
}
|
|
104
|
+
</View>
|
|
105
|
+
<LibIcon name={show ? 'chevron-up' : 'chevron-down'} color="#4a4a4a" />
|
|
106
|
+
</View>}>
|
|
107
|
+
{/* type: 1: text field, 2: textarea, 3: date picker, 4: choice, 5: multichoice, 6: dropdown */}
|
|
108
|
+
<View style={{ marginHorizontal: 10 }}>
|
|
109
|
+
{
|
|
110
|
+
item.type == 1 && // text field
|
|
111
|
+
<LibInput_rectangle
|
|
112
|
+
placeholder={item.question}
|
|
113
|
+
placeholderTextColor='#c9c9c9'
|
|
114
|
+
style={{ borderRadius: 5, borderColor: '#c9c9c9' }}
|
|
115
|
+
defaultValue={newData?.additions?.[i]?.value?.[0]}
|
|
116
|
+
inputStyle={{ marginLeft: 0 }}
|
|
117
|
+
onChangeText={(text) => {
|
|
118
|
+
let t = text?.length == 0 ? [] : [text]
|
|
119
|
+
let updateValue = LibObject.set(newData, t)('additions', i, 'value')
|
|
120
|
+
let updateDisplayValue = LibObject.set(updateValue, t)('additions', i, 'display_value')
|
|
121
|
+
setNewData(updateDisplayValue)
|
|
122
|
+
}} />
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
{
|
|
126
|
+
item.type == 2 && // textarea
|
|
127
|
+
<LibInput_rectangle
|
|
128
|
+
multiline={true}
|
|
129
|
+
placeholder={item.question}
|
|
130
|
+
placeholderTextColor='#c9c9c9'
|
|
131
|
+
style={{ borderRadius: 5, borderColor: '#c9c9c9', height: 100, justifyContent: 'flex-start' }}
|
|
132
|
+
defaultValue={newData?.additions?.[i]?.value?.[0]}
|
|
133
|
+
inputStyle={{ textAlignVertical: 'top', paddingTop: 10, paddingBottom: 10, marginLeft: 0, height: 100 }}
|
|
134
|
+
onChangeText={(text) => {
|
|
135
|
+
let t = text?.length == 0 ? [] : [text]
|
|
136
|
+
let updateValue = LibObject.set(newData, t)('additions', i, 'value')
|
|
137
|
+
let updateDisplayValue = LibObject.set(updateValue, t)('additions', i, 'display_value')
|
|
138
|
+
setNewData(updateDisplayValue)
|
|
139
|
+
}} />
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
{
|
|
143
|
+
item.type == 3 && // datepicker
|
|
144
|
+
<TouchableOpacity onPress={() => {
|
|
145
|
+
setIdx(i)()
|
|
146
|
+
dialogDatePicker.current?.show()
|
|
147
|
+
}} style={{ height: 40, borderRadius: 5, marginTop: 12, backgroundColor: "#ffffff", borderWidth: 1, borderColor: "#c5c5c5", flexDirection: 'row', alignContent: 'center', justifyContent: 'space-between', alignItems: 'center', paddingHorizontal: 9 }}>
|
|
148
|
+
<Text allowFontScaling={false} style={{ fontSize: 12, color: values?.length > 0 ? "#000" : "#e5e5e5", marginRight: 15, }}>{values?.length > 0 ? display_values[0] : item.question}</Text>
|
|
149
|
+
{
|
|
150
|
+
values?.length == 0 &&
|
|
151
|
+
<LibIcon name='chevron-down' />
|
|
152
|
+
}
|
|
153
|
+
</TouchableOpacity>
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
{
|
|
157
|
+
item.type == 4 && // choice
|
|
158
|
+
<View style={{ marginTop: 8 }}>
|
|
159
|
+
{
|
|
160
|
+
item?.options?.length > 0 && item?.options?.map((it: any, ii: number) => {
|
|
161
|
+
let values = newData?.additions?.[i]?.value?.[0] == it.id
|
|
162
|
+
return (
|
|
163
|
+
<Pressable
|
|
164
|
+
key={ii}
|
|
165
|
+
hitSlop={{ top: 10, right: 10 }}
|
|
166
|
+
onPress={() => {
|
|
167
|
+
let updateValue = LibObject.set(newData, [it.id])('additions', i, 'value')
|
|
168
|
+
let updateDisplayValue = LibObject.set(updateValue, [it.content])('additions', i, 'display_value')
|
|
169
|
+
let deleteSubvalue = LibObject.set(updateDisplayValue, "")('additions', i, 'subvalue')
|
|
170
|
+
setNewData(deleteSubvalue)
|
|
171
|
+
|
|
172
|
+
}}
|
|
173
|
+
style={{ flexDirection: 'row', marginBottom: 5, alignContent: 'center', alignItems: 'center' }}>
|
|
174
|
+
<LibIcon name={values ? 'circle' : 'circle-outline'} size={20} color={values ? LibStyle.colorPrimary : '#9b9b9b'} />
|
|
175
|
+
<Text allowFontScaling={false} style={{ marginLeft: 7, marginRight: 15, color: values ? "#000" : "#9b9b9b" }}>{it.content}</Text>
|
|
176
|
+
</Pressable>
|
|
177
|
+
)
|
|
178
|
+
})
|
|
179
|
+
}
|
|
180
|
+
</View>
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
{
|
|
184
|
+
item.type == 5 && // multichoice
|
|
185
|
+
<View style={{ marginTop: 8 }}>
|
|
186
|
+
{
|
|
187
|
+
item?.options?.length > 0 && item?.options?.map((it: any, ii: number) => {
|
|
188
|
+
return (
|
|
189
|
+
<Pressable
|
|
190
|
+
key={ii}
|
|
191
|
+
hitSlop={{ top: 10, right: 10 }}
|
|
192
|
+
onPress={() => {
|
|
193
|
+
const out = values.includes(it.id) ? values.filter((id: any) => it.id != id) : [...values, it.id]
|
|
194
|
+
const out_content = item?.options?.filter((item: any) => out.includes(item.id)).map((x: any) => x.content)
|
|
195
|
+
|
|
196
|
+
let updateValue = LibObject.set(newData, out)('additions', i, 'value')
|
|
197
|
+
let updateDisplayValue = LibObject.set(updateValue, out_content)('additions', i, 'display_value')
|
|
198
|
+
setNewData(updateDisplayValue)
|
|
199
|
+
}}
|
|
200
|
+
style={{ padding: 3, marginBottom: 8, paddingHorizontal: 15, marginRight: 4, borderWidth: 1, borderRadius: 3, borderColor: values?.includes?.(it.id) ? "#fff" : "#9b9b9b", backgroundColor: values?.includes?.(it.id) ? LibStyle.colorPrimary : "#fff", justifyContent: 'center' }} >
|
|
201
|
+
<LibTextstyle textStyle='body' text={it.content} style={{ color: values?.includes?.(it.id) ? (esp.isDebug("") ? "#fff" : "#000") : "#9b9b9b" }} />
|
|
202
|
+
</Pressable>
|
|
203
|
+
)
|
|
204
|
+
})
|
|
205
|
+
}
|
|
206
|
+
</View>
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
{
|
|
210
|
+
item.type == 6 && // dropdown
|
|
211
|
+
<TouchableOpacity onPress={() => {
|
|
212
|
+
dialogDropdown.current?.show()
|
|
213
|
+
setDropdownData(item)
|
|
214
|
+
setIdx(i)
|
|
215
|
+
}} style={{ height: 40, borderRadius: 5, marginTop: 12, backgroundColor: "#ffffff", borderWidth: 1, borderColor: "#c5c5c5", flexDirection: 'row', alignContent: 'center', justifyContent: 'space-between', alignItems: 'center', paddingHorizontal: 9 }}>
|
|
216
|
+
<Text allowFontScaling={false} style={{ fontSize: 12, color: values?.length > 0 ? "#000" : "#e5e5e5", marginRight: 15, }}>{values?.length > 0 ? display_values[0] : item.question}</Text>
|
|
217
|
+
{
|
|
218
|
+
values?.length == 0 &&
|
|
219
|
+
<LibIcon name='chevron-down' />
|
|
220
|
+
}
|
|
221
|
+
</TouchableOpacity>
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
{
|
|
225
|
+
item.is_content == 1 &&
|
|
226
|
+
<LibInput_rectangle
|
|
227
|
+
placeholder={esp.lang("event/additional_input", "other")}
|
|
228
|
+
placeholderTextColor='#c9c9c9'
|
|
229
|
+
style={{ borderRadius: 5, borderColor: '#c9c9c9' }}
|
|
230
|
+
defaultValue={newData?.additions?.[i]?.subvalue}
|
|
231
|
+
// value={newData?.additions?.[i]?.subvalue}
|
|
232
|
+
inputStyle={{ marginLeft: 0 }}
|
|
233
|
+
|
|
234
|
+
onChangeText={(text) => {
|
|
235
|
+
let fillSubValue = LibObject.set(newData, text)('additions', i, 'subvalue')
|
|
236
|
+
if (item.type == 4) {
|
|
237
|
+
let emptyValue = LibObject.set(fillSubValue, [])('additions', i, 'value')
|
|
238
|
+
let emptyDisplayValue = LibObject.set(emptyValue, [])('additions', i, 'display_value')
|
|
239
|
+
setNewData(emptyDisplayValue)
|
|
240
|
+
} else {
|
|
241
|
+
setNewData(fillSubValue)
|
|
242
|
+
}
|
|
243
|
+
}} />
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
</View>
|
|
247
|
+
</LibCollaps>
|
|
248
|
+
</View>
|
|
249
|
+
)
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
return (
|
|
253
|
+
<View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
|
|
254
|
+
<ComponentHeader title={esp.lang("event/additional_input", "header_title")} />
|
|
255
|
+
<LibKeyboard_avoid>
|
|
256
|
+
<ScrollView>
|
|
257
|
+
{data?.additions?.length > 0 && data?.additions?.map(renderCatNew)}
|
|
258
|
+
|
|
259
|
+
</ScrollView>
|
|
260
|
+
<View style={{ padding: 10 }} >
|
|
261
|
+
<ComponentButton
|
|
262
|
+
label={esp.lang("event/additional_input", "btn_save")}
|
|
263
|
+
backgroundColor={LibStyle.colorPrimary}
|
|
264
|
+
onPress={save}
|
|
265
|
+
/>
|
|
266
|
+
</View>
|
|
267
|
+
|
|
268
|
+
<ComponentSlidingup ref={dialogDatePicker}>
|
|
269
|
+
<View style={{ backgroundColor: 'white', paddingBottom: 25, height: 230 }}>
|
|
270
|
+
<LibDatepicker
|
|
271
|
+
minDate={LibUtils.moment().add(-90, 'years').localeFormat('YYYY-MM-DD')}
|
|
272
|
+
maxDate={LibUtils.moment().localeFormat('YYYY-MM-DD')}
|
|
273
|
+
onDateChange={(dt) => {
|
|
274
|
+
let updateValue = LibObject.set(newData, [dt])('additions', getIdx(), 'value')
|
|
275
|
+
let updateDisplayValue = LibObject.set(updateValue, [LibUtils.moment(dt).localeFormat("DD MMMM YYYY")])('additions', getIdx(), 'display_value')
|
|
276
|
+
setNewData(updateDisplayValue)
|
|
277
|
+
dialogDatePicker.current?.hide()
|
|
278
|
+
}}
|
|
279
|
+
selectedDate={newData?.additions?.[getIdx()]?.value?.[0] || LibUtils.moment().localeFormat('YYYY-MM-DD')}
|
|
280
|
+
/>
|
|
281
|
+
</View>
|
|
282
|
+
</ComponentSlidingup>
|
|
283
|
+
|
|
284
|
+
<ComponentSlidingup ref={dialogDropdown} >
|
|
285
|
+
<View style={{ width: 40, height: 3, borderRadius: 5, backgroundColor: "#fff", alignSelf: 'center', marginBottom: 10 }} />
|
|
286
|
+
<View style={{ maxHeight: LibStyle.height - (LibStyle.height / 5), backgroundColor: 'white', borderTopLeftRadius: 15, paddingHorizontal: 25, borderTopRightRadius: 15, padding: 10 }} >
|
|
287
|
+
<Pressable style={{ marginTop: 10, alignSelf: 'flex-end' }} onPress={() => dialogDropdown.current?.hide()}>
|
|
288
|
+
<LibIcon name='close' color={"#c9c9c9"} />
|
|
289
|
+
</Pressable>
|
|
290
|
+
<Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 16, marginBottom: 15 }}>{dropdownData?.question}</Text>
|
|
291
|
+
|
|
292
|
+
<ScrollView>
|
|
293
|
+
{
|
|
294
|
+
dropdownData?.options?.map((item: any, i: number) => {
|
|
295
|
+
return (
|
|
296
|
+
<Pressable onPress={() => {
|
|
297
|
+
let updateValue = LibObject.set(newData, [item.id])('additions', getIdx(), 'value')
|
|
298
|
+
let updateDisplayValue = LibObject.set(updateValue, [item.content])('additions', getIdx(), 'display_value')
|
|
299
|
+
setNewData(updateDisplayValue)
|
|
300
|
+
|
|
301
|
+
dialogDropdown.current?.hide()
|
|
302
|
+
}} key={i} style={{ borderBottomWidth: 1, borderColor: '#c5c5c5', padding: 10, flexDirection: 'row', alignItems: "center" }}>
|
|
303
|
+
<Text allowFontScaling={false} style={{ flex: 1, fontFamily: 'InterMedium', fontSize: 16, color: '#2C2B2D' }}>{item?.content}</Text>
|
|
304
|
+
</Pressable>
|
|
305
|
+
)
|
|
306
|
+
})
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
</ScrollView>
|
|
310
|
+
|
|
311
|
+
</View>
|
|
312
|
+
</ComponentSlidingup>
|
|
313
|
+
</LibKeyboard_avoid>
|
|
314
|
+
</View>
|
|
315
|
+
)
|
|
316
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
|
|
3
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
4
|
+
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
5
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
6
|
+
import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
|
|
7
|
+
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
8
|
+
import esp from 'esoftplay/esp';
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { ScrollView, TouchableOpacity, View } from 'react-native';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export interface EventBlock_invitationArgs {
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
export interface EventBlock_invitationProps {
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
export default function m(props: EventBlock_invitationProps): any {
|
|
20
|
+
const { dataCheck } = LibNavigation.getArgsAll(props)
|
|
21
|
+
return (
|
|
22
|
+
<View style={{ flex: 1 }}>
|
|
23
|
+
<View style={{ flex: 1 }}>
|
|
24
|
+
<LibPicture source={esp.assets('failed.png')} style={{ flex: 1, height: LibStyle.height, width: LibStyle.width }} /* resizeMode={"stretch"} */ />
|
|
25
|
+
</View>
|
|
26
|
+
<View style={{ position: 'absolute', top: LibStyle.STATUSBAR_HEIGHT + 17, left: 0, right: 0, bottom: 0 }} >
|
|
27
|
+
<View style={{ flexDirection: 'row', padding: 15, marginBottom: 15 }}>
|
|
28
|
+
<TouchableOpacity hitSlop={{ top: 4, bottom: 4, left: 4, right: 4 }} onPress={() => LibNavigation.back()} >
|
|
29
|
+
<LibPicture style={{ height: 35, width: 35 }} source={esp.assets('icons/ic_header_back.png')} />
|
|
30
|
+
</TouchableOpacity>
|
|
31
|
+
</View>
|
|
32
|
+
<ScrollView >
|
|
33
|
+
<View style={{ marginBottom: 20, alignSelf: 'center', borderRadius: LibStyle.width / 3, padding: 10, backgroundColor: '#fff' }}>
|
|
34
|
+
<LibPicture
|
|
35
|
+
source={esp.assets('failed_icon.png')}
|
|
36
|
+
style={{ width: LibStyle.width / 3, height: LibStyle.width / 3 }}
|
|
37
|
+
/>
|
|
38
|
+
</View>
|
|
39
|
+
<LibTextstyle textStyle='m_overline' text={esp.lang("event/block_invitation", "cannot_claim_code")} style={{ lineHeight: 20, color: '#fff', fontSize: 16, margin: 15, fontWeight: 'bold', marginBottom: 0, textAlign: 'center' }} />
|
|
40
|
+
<LibTextstyle textStyle='m_overline' text={esp.lang("event/block_invitation", "try_again_later") + LibUtils.moment(dataCheck?.lock_end).serverFormat("DD MMM YYYY HH:mm:ss")} style={{ lineHeight: 20, color: '#fff', fontSize: 16, margin: 15, fontWeight: 'bold', marginBottom: 0, textAlign: 'center' }} />
|
|
41
|
+
|
|
42
|
+
</ScrollView>
|
|
43
|
+
|
|
44
|
+
</View>
|
|
45
|
+
|
|
46
|
+
</View>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
|
|
3
|
+
import { EventQueue_pricingProperty } from 'esoftplay/cache/event/queue_pricing/import';
|
|
4
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
5
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
6
|
+
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
7
|
+
import { MarketCountdown } from 'esoftplay/cache/market/countdown/import';
|
|
8
|
+
import { UserRoutes } from 'esoftplay/cache/user/routes/import';
|
|
9
|
+
import useGlobalState from 'esoftplay/global';
|
|
10
|
+
import useGlobalSubscriber from 'esoftplay/subscribe';
|
|
11
|
+
import React, { useEffect } from 'react';
|
|
12
|
+
import Animated, { useAnimatedStyle, useSharedValue, withRepeat, withTiming } from 'react-native-reanimated';
|
|
13
|
+
import useFirebaseSocket from '../lib/firebase_socket';
|
|
14
|
+
|
|
15
|
+
export interface EventCountdownArgs {
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface EventCountdownProps {
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
export const countdownTime = useGlobalState('0')
|
|
23
|
+
|
|
24
|
+
export const releaseQueue = useGlobalSubscriber()
|
|
25
|
+
|
|
26
|
+
export default function m(props: EventCountdownProps): any {
|
|
27
|
+
const [timer] = countdownTime.useState()
|
|
28
|
+
const routes = UserRoutes.state().useSelector((x) => x?.routes)
|
|
29
|
+
const { doneQueue, isInPricingQueueConfig } = useFirebaseSocket();
|
|
30
|
+
|
|
31
|
+
const animatedValue = useSharedValue(0)
|
|
32
|
+
|
|
33
|
+
releaseQueue.useSubscribe(() => {
|
|
34
|
+
const { pathQueue, event_id, key } = EventQueue_pricingProperty.state().get()
|
|
35
|
+
if (event_id && isInPricingQueueConfig(event_id)) {
|
|
36
|
+
doneQueue(pathQueue, event_id, key, () => { })
|
|
37
|
+
EventQueue_pricingProperty.state().reset()
|
|
38
|
+
countdownTime.reset()
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
animatedValue.value = withRepeat(withTiming(animatedValue.value == 0 ? 1 : 0.3, { duration: 1500 }), -1, true)
|
|
44
|
+
}, [])
|
|
45
|
+
|
|
46
|
+
const animated = useAnimatedStyle(() => ({
|
|
47
|
+
opacity: animatedValue.value
|
|
48
|
+
}))
|
|
49
|
+
|
|
50
|
+
if (timer == '0')
|
|
51
|
+
return null
|
|
52
|
+
else if (routes?.[routes?.length - 1]?.name == 'event/ticket_list')
|
|
53
|
+
return null
|
|
54
|
+
else
|
|
55
|
+
return (
|
|
56
|
+
<Animated.View pointerEvents='none' style={[{ position: 'absolute', alignItems: 'center', justifyContent: 'center', top: LibStyle.STATUSBAR_HEIGHT + 61, padding: 1, backgroundColor: LibUtils.hexToRgba(LibStyle.colorGreen, 1), width: '100%' }, animated]} >
|
|
57
|
+
<MarketCountdown
|
|
58
|
+
onExpired={() => {
|
|
59
|
+
const routeNames = UserRoutes.state()?.get()?.routes?.map?.((x: any) => x.name)
|
|
60
|
+
if (routeNames.includes("artist/list"))
|
|
61
|
+
LibNavigation.navigate("artist/list")
|
|
62
|
+
else if (routeNames.includes("event/detail"))
|
|
63
|
+
LibNavigation.navigate("event/detail")
|
|
64
|
+
else
|
|
65
|
+
LibNavigation.backToRoot()
|
|
66
|
+
countdownTime.reset()
|
|
67
|
+
}}
|
|
68
|
+
expired={timer}
|
|
69
|
+
style={{ color: "#fff" }} />
|
|
70
|
+
</Animated.View>
|
|
71
|
+
)
|
|
72
|
+
}
|