esoftplay-event 0.0.0-b → 0.0.0-c
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_input.tsx +4 -4
- package/event/artist_detail.tsx +1 -0
- package/event/counter_cashier.tsx +2 -2
- package/event/counter_eo.tsx +2 -2
- package/event/counter_lm.tsx +2 -2
- package/event/counter_report_detail.tsx +3 -3
- package/event/counter_send.tsx +3 -3
- package/event/counter_user_list.tsx +2 -2
- package/event/header_home.tsx +108 -0
- package/event/index.tsx +270 -0
- package/event/input_rectangle.tsx +208 -0
- package/event/item.tsx +40 -0
- package/event/notice.tsx +41 -0
- package/event/qc_idcard.tsx +2 -2
- package/event/refresh_button.tsx +40 -0
- package/event/section.tsx +35 -0
- package/package.json +1 -1
|
@@ -3,10 +3,10 @@ import { useEffect, useRef } from 'react';
|
|
|
3
3
|
|
|
4
4
|
import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
5
5
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
6
|
+
import { EventInput_rectangle } from 'esoftplay/cache/event/input_rectangle/import';
|
|
6
7
|
import { LibCollaps } from 'esoftplay/cache/lib/collaps/import';
|
|
7
8
|
import { LibDatepicker } from 'esoftplay/cache/lib/datepicker/import';
|
|
8
9
|
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
9
|
-
import { LibInput_rectangle } from 'esoftplay/cache/lib/input_rectangle/import';
|
|
10
10
|
import { LibKeyboard_avoid } from 'esoftplay/cache/lib/keyboard_avoid/import';
|
|
11
11
|
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
12
12
|
import { LibObject } from 'esoftplay/cache/lib/object/import';
|
|
@@ -108,7 +108,7 @@ export default function m(props: EventAdditional_inputProps): any {
|
|
|
108
108
|
<View style={{ marginHorizontal: 10 }}>
|
|
109
109
|
{
|
|
110
110
|
item.type == 1 && // text field
|
|
111
|
-
<
|
|
111
|
+
<EventInput_rectangle
|
|
112
112
|
placeholder={item.question}
|
|
113
113
|
placeholderTextColor='#c9c9c9'
|
|
114
114
|
style={{ borderRadius: 5, borderColor: '#c9c9c9' }}
|
|
@@ -124,7 +124,7 @@ export default function m(props: EventAdditional_inputProps): any {
|
|
|
124
124
|
|
|
125
125
|
{
|
|
126
126
|
item.type == 2 && // textarea
|
|
127
|
-
<
|
|
127
|
+
<EventInput_rectangle
|
|
128
128
|
multiline={true}
|
|
129
129
|
placeholder={item.question}
|
|
130
130
|
placeholderTextColor='#c9c9c9'
|
|
@@ -223,7 +223,7 @@ export default function m(props: EventAdditional_inputProps): any {
|
|
|
223
223
|
|
|
224
224
|
{
|
|
225
225
|
item.is_content == 1 &&
|
|
226
|
-
<
|
|
226
|
+
<EventInput_rectangle
|
|
227
227
|
placeholder={esp.lang("event/additional_input", "other")}
|
|
228
228
|
placeholderTextColor='#c9c9c9'
|
|
229
229
|
style={{ borderRadius: 5, borderColor: '#c9c9c9' }}
|
package/event/artist_detail.tsx
CHANGED
|
@@ -281,6 +281,7 @@ export default function m(props: EventArtist_detailProps): any {
|
|
|
281
281
|
// kondisi untuk tipe tiket yang ada tanggalnya
|
|
282
282
|
if (item?.status == 1 && itemT?.status == 1) {
|
|
283
283
|
setSelectedTicket(replaceList)
|
|
284
|
+
setQty(item.qty_min)
|
|
284
285
|
} else if (item?.status == 0) {
|
|
285
286
|
LibToastProperty.show(msg)
|
|
286
287
|
} else if (item?.status == 2) {
|
|
@@ -7,7 +7,6 @@ import { EventCounter_section } from 'esoftplay/cache/event/counter_section/impo
|
|
|
7
7
|
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
8
8
|
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
9
9
|
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
10
|
-
import { LibInput_rectangle } from 'esoftplay/cache/lib/input_rectangle/import';
|
|
11
10
|
import { LibLoading } from 'esoftplay/cache/lib/loading/import';
|
|
12
11
|
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
13
12
|
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
@@ -17,6 +16,7 @@ import useSafeState from 'esoftplay/state';
|
|
|
17
16
|
|
|
18
17
|
import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
19
18
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
19
|
+
import { EventInput_rectangle } from 'esoftplay/cache/event/input_rectangle/import';
|
|
20
20
|
import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
|
|
21
21
|
import React, { useEffect, useRef } from 'react';
|
|
22
22
|
import { Pressable, RefreshControl, ScrollView, Text, View } from 'react-native';
|
|
@@ -140,7 +140,7 @@ export default function m(props: EventCounter_cashierProps): any {
|
|
|
140
140
|
<View style={{ backgroundColor: '#fff', borderTopLeftRadius: 20, borderTopRightRadius: 20 }}>
|
|
141
141
|
<View style={{ height: 4, width: 32, borderRadius: 2, backgroundColor: "#C6C6C6", marginTop: 10, marginBottom: 10, alignSelf: 'center' }} />
|
|
142
142
|
<View style={{ margin: 15 }}>
|
|
143
|
-
<
|
|
143
|
+
<EventInput_rectangle
|
|
144
144
|
autoCapitalize="none"
|
|
145
145
|
onChangeText={setEmail}
|
|
146
146
|
style={{ borderColor: '#c4c4c4', height: 35, marginTop: 8, borderRadius: 15, }}
|
package/event/counter_eo.tsx
CHANGED
|
@@ -8,7 +8,6 @@ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
|
8
8
|
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
9
9
|
import { LibFocus } from 'esoftplay/cache/lib/focus/import';
|
|
10
10
|
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
11
|
-
import { LibInput_rectangle } from 'esoftplay/cache/lib/input_rectangle/import';
|
|
12
11
|
import { LibLoading } from 'esoftplay/cache/lib/loading/import';
|
|
13
12
|
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
14
13
|
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
@@ -21,6 +20,7 @@ import useSafeState from 'esoftplay/state';
|
|
|
21
20
|
import { BboConfigProperty } from 'esoftplay/cache/bbo/config/import';
|
|
22
21
|
import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
23
22
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
23
|
+
import { EventInput_rectangle } from 'esoftplay/cache/event/input_rectangle/import';
|
|
24
24
|
import { EventLabel_input } from 'esoftplay/cache/event/label_input/import';
|
|
25
25
|
import { EventMessage } from 'esoftplay/cache/event/message/import';
|
|
26
26
|
import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
|
|
@@ -331,7 +331,7 @@ export default function m(props: EventCounter_eoProps): any {
|
|
|
331
331
|
|
|
332
332
|
<EventLabel_input label={esp.lang("event/counter_eo", "label_email")} />
|
|
333
333
|
|
|
334
|
-
<
|
|
334
|
+
<EventInput_rectangle
|
|
335
335
|
autoCapitalize="none"
|
|
336
336
|
onChangeText={(t) => {
|
|
337
337
|
LibUtils.debounce(() => {
|
package/event/counter_lm.tsx
CHANGED
|
@@ -9,7 +9,6 @@ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
|
9
9
|
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
10
10
|
import { LibFocus } from 'esoftplay/cache/lib/focus/import';
|
|
11
11
|
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
12
|
-
import { LibInput_rectangle } from 'esoftplay/cache/lib/input_rectangle/import';
|
|
13
12
|
import { LibLoading } from 'esoftplay/cache/lib/loading/import';
|
|
14
13
|
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
15
14
|
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
@@ -22,6 +21,7 @@ import useSafeState from 'esoftplay/state';
|
|
|
22
21
|
import { BboConfigProperty } from 'esoftplay/cache/bbo/config/import';
|
|
23
22
|
import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
24
23
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
24
|
+
import { EventInput_rectangle } from 'esoftplay/cache/event/input_rectangle/import';
|
|
25
25
|
import { EventLabel_input } from 'esoftplay/cache/event/label_input/import';
|
|
26
26
|
import { EventMessage } from 'esoftplay/cache/event/message/import';
|
|
27
27
|
import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
|
|
@@ -211,7 +211,7 @@ export default function m(props: EventCounter_lmProps): any {
|
|
|
211
211
|
<View style={{ margin: 15 }}>
|
|
212
212
|
<EventLabel_input label={esp.lang("event/counter_eo", "label_email")} />
|
|
213
213
|
|
|
214
|
-
<
|
|
214
|
+
<EventInput_rectangle
|
|
215
215
|
autoCapitalize="none"
|
|
216
216
|
onChangeText={(t) => {
|
|
217
217
|
LibUtils.debounce(() => {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
3
3
|
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
4
4
|
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
5
|
-
import { LibInput_rectangle2 } from 'esoftplay/cache/lib/input_rectangle2/import';
|
|
6
5
|
import { LibLoading } from 'esoftplay/cache/lib/loading/import';
|
|
7
6
|
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
8
7
|
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
@@ -14,6 +13,7 @@ import useSafeState from 'esoftplay/state';
|
|
|
14
13
|
|
|
15
14
|
import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
16
15
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
16
|
+
import { EventInput_rectangle } from 'esoftplay/cache/event/input_rectangle/import';
|
|
17
17
|
import { EventMessage } from 'esoftplay/cache/event/message/import';
|
|
18
18
|
import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
|
|
19
19
|
import React, { useEffect, useRef } from 'react';
|
|
@@ -94,7 +94,7 @@ export default function m(props: EventCounter_report_detailProps): any {
|
|
|
94
94
|
const [result, setResult] = useSafeState<any>()
|
|
95
95
|
const [error, setError] = useSafeState<any>()
|
|
96
96
|
const dialogNotes = useRef<LibSlidingup>(null)
|
|
97
|
-
const inputNotes = useRef<
|
|
97
|
+
const inputNotes = useRef<EventInput_rectangle>(null)
|
|
98
98
|
|
|
99
99
|
useEffect(() => {
|
|
100
100
|
loadData()
|
|
@@ -214,7 +214,7 @@ export default function m(props: EventCounter_report_detailProps): any {
|
|
|
214
214
|
<View style={{ backgroundColor: '#f6f6f6', borderTopRightRadius: 20, borderTopLeftRadius: 20, paddingHorizontal: 19, }}>
|
|
215
215
|
<Text allowFontScaling={false} style={{ marginTop: 26, marginBottom: 23, fontFamily: "Arial", fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, textAlign: "center", color: "#34495e" }}>{esp.lang("event/counter_report_detail", "notes")}</Text>
|
|
216
216
|
|
|
217
|
-
<
|
|
217
|
+
<EventInput_rectangle
|
|
218
218
|
ref={inputNotes}
|
|
219
219
|
keyboardType="default"
|
|
220
220
|
returnKeyType="go"
|
package/event/counter_send.tsx
CHANGED
|
@@ -4,7 +4,6 @@ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
|
4
4
|
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
5
5
|
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
6
6
|
import { LibInput } from 'esoftplay/cache/lib/input/import';
|
|
7
|
-
import { LibInput_rectangle2 } from 'esoftplay/cache/lib/input_rectangle2/import';
|
|
8
7
|
import { LibLoading } from 'esoftplay/cache/lib/loading/import';
|
|
9
8
|
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
10
9
|
import { LibProgress } from 'esoftplay/cache/lib/progress/import';
|
|
@@ -17,6 +16,7 @@ import useSafeState from 'esoftplay/state';
|
|
|
17
16
|
|
|
18
17
|
import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
19
18
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
19
|
+
import { EventInput_rectangle } from 'esoftplay/cache/event/input_rectangle/import';
|
|
20
20
|
import { EventMessage } from 'esoftplay/cache/event/message/import';
|
|
21
21
|
import React, { useEffect, useRef } from 'react';
|
|
22
22
|
import { KeyboardAvoidingView, Pressable, Text, TouchableOpacity, View } from 'react-native';
|
|
@@ -39,7 +39,7 @@ export default function m(props: EventCounter_sendProps): any {
|
|
|
39
39
|
const [showLoading, setShowLoading] = useSafeState<boolean>(false)
|
|
40
40
|
|
|
41
41
|
let inputAmount = useRef<LibInput>(null)
|
|
42
|
-
const inputNotes = useRef<
|
|
42
|
+
const inputNotes = useRef<EventInput_rectangle>(null)
|
|
43
43
|
|
|
44
44
|
let ticketUrl = status_user == 1 ? "event_eo_ticket?event_id=" + event_id : status_user == 2 ? "event_manager_ticket?event_id=" + event_id : "event_seller_ticket?event_id=" + event_id
|
|
45
45
|
let moneyUrl = status_user == 1 ? "event_eo_money?event_id=" + event_id : status_user == 2 ? "event_manager_money?event_id=" + event_id : "event_seller_money?event_id=" + event_id
|
|
@@ -220,7 +220,7 @@ export default function m(props: EventCounter_sendProps): any {
|
|
|
220
220
|
style={{ marginTop: -15, letterSpacing: 0, fontSize: 30, textAlign: 'center' }}
|
|
221
221
|
/>
|
|
222
222
|
|
|
223
|
-
<
|
|
223
|
+
<EventInput_rectangle
|
|
224
224
|
ref={inputNotes}
|
|
225
225
|
keyboardType="default"
|
|
226
226
|
placeholder={esp.lang("cashier/invoice", "label_note")}
|
|
@@ -6,7 +6,6 @@ import { LibCollaps } from 'esoftplay/cache/lib/collaps/import';
|
|
|
6
6
|
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
7
7
|
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
8
8
|
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
9
|
-
import { LibInput_rectangle } from 'esoftplay/cache/lib/input_rectangle/import';
|
|
10
9
|
import { LibList } from 'esoftplay/cache/lib/list/import';
|
|
11
10
|
import { LibLoading } from 'esoftplay/cache/lib/loading/import';
|
|
12
11
|
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
@@ -18,6 +17,7 @@ import useSafeState from 'esoftplay/state';
|
|
|
18
17
|
|
|
19
18
|
import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
20
19
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
20
|
+
import { EventInput_rectangle } from 'esoftplay/cache/event/input_rectangle/import';
|
|
21
21
|
import { EventMessage } from 'esoftplay/cache/event/message/import';
|
|
22
22
|
import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
|
|
23
23
|
import React, { useEffect, useRef } from 'react';
|
|
@@ -162,7 +162,7 @@ export default function m(props: EventCounter_user_listProps): any {
|
|
|
162
162
|
<View style={{ backgroundColor: '#fff', borderTopLeftRadius: 20, borderTopRightRadius: 20 }}>
|
|
163
163
|
<View style={{ height: 4, width: 32, borderRadius: 2, backgroundColor: "#C6C6C6", marginTop: 10, marginBottom: 10, alignSelf: 'center' }} />
|
|
164
164
|
<View style={{ margin: 15 }}>
|
|
165
|
-
<
|
|
165
|
+
<EventInput_rectangle
|
|
166
166
|
autoCapitalize="none"
|
|
167
167
|
onChangeText={(t) => {
|
|
168
168
|
LibUtils.debounce(() => {
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
// noPage
|
|
3
|
+
import { ChatIndexProperty } from 'esoftplay/cache/chat/index/import';
|
|
4
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
5
|
+
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
6
|
+
import { LibStatusbar } from 'esoftplay/cache/lib/statusbar/import';
|
|
7
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
8
|
+
import { UserNotification } from 'esoftplay/cache/user/notification/import';
|
|
9
|
+
import { UserProfileProperty } from 'esoftplay/cache/user/profile/import';
|
|
10
|
+
import esp from 'esoftplay/esp';
|
|
11
|
+
|
|
12
|
+
import { EventBadge } from 'esoftplay/cache/event/badge/import';
|
|
13
|
+
import { LibCurl_view } from 'esoftplay/cache/lib/curl_view/import';
|
|
14
|
+
import React, { useEffect } from 'react';
|
|
15
|
+
import { Pressable, Text, TouchableOpacity, View } from 'react-native';
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export interface EventHeader_homeProps {
|
|
19
|
+
title?: string,
|
|
20
|
+
subtitle?: string,
|
|
21
|
+
cart?: boolean,
|
|
22
|
+
// card?:
|
|
23
|
+
// onPress?: () => void
|
|
24
|
+
onPress: () => void
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default function m(props: EventHeader_homeProps): any {
|
|
29
|
+
// const chatHistory = ChattingHistory?.()
|
|
30
|
+
// const data = chatHistory?.data
|
|
31
|
+
const [unRead, setUnread] = ChatIndexProperty?.unreadState?.()?.useState?.()
|
|
32
|
+
const counter = UserNotification?.state?.()?.useSelector?.(s => s.unread)
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
// setUnread(data && data?.filter?.((v: any) => v.read == 0 && user && user?.id !== v.user_id).length || 0)
|
|
36
|
+
}, [])
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<View>
|
|
40
|
+
<View style={{ marginTop: LibStyle.STATUSBAR_HEIGHT }} />
|
|
41
|
+
<LibStatusbar style="dark" />
|
|
42
|
+
<View style={{ flexDirection: 'row', padding: 13, alignItems: 'center', height: 60, }} >
|
|
43
|
+
<Pressable testID='profile' hitSlop={{ top: 7, left: 7, right: 7, bottom: 7 }} onPress={() => {
|
|
44
|
+
UserProfileProperty.isLogin(() => {
|
|
45
|
+
LibNavigation.navigate('user/profile')
|
|
46
|
+
})
|
|
47
|
+
}} style={{ height: 35, width: 35, borderRadius: 17.5, overflow: 'hidden' }} >
|
|
48
|
+
<LibCurl_view
|
|
49
|
+
url='v2/user_image'
|
|
50
|
+
cache
|
|
51
|
+
isUserData
|
|
52
|
+
onSuccess={(res, msg) => {
|
|
53
|
+
return (
|
|
54
|
+
<LibPicture style={{ height: 35, width: 35, borderRadius: 17.5, backgroundColor: '#fff' }} source={res} />
|
|
55
|
+
)
|
|
56
|
+
}}
|
|
57
|
+
onError={(err) => {
|
|
58
|
+
return (
|
|
59
|
+
<LibPicture style={{ height: 35, width: 35, borderRadius: 17.5, backgroundColor: '#fff' }} source={esp.assets('icons/ic_btm_nav_active_profile.png')} />
|
|
60
|
+
)
|
|
61
|
+
}}
|
|
62
|
+
onLoading={<View />}
|
|
63
|
+
/>
|
|
64
|
+
</Pressable>
|
|
65
|
+
{
|
|
66
|
+
props.title ?
|
|
67
|
+
<View style={{ marginHorizontal: 11, flex: 1 }} >
|
|
68
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#70472b" }} >{props.title || esp.lang("component/header_home", "profile")}</Text>
|
|
69
|
+
{props.subtitle && <Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, letterSpacing: 0, color: "#e5e5e5", marginTop: 3 }} >{props.subtitle}</Text>}
|
|
70
|
+
</View>
|
|
71
|
+
:
|
|
72
|
+
<TouchableOpacity testID='search-bar' onPress={() => props.onPress()} style={{ flex: 1 }} >
|
|
73
|
+
<View style={{ marginLeft: 15, height: 20, borderRadius: 20, backgroundColor: 'white', flexDirection: "row", alignItems: 'center', flex: 1, marginHorizontal: 12 }} >
|
|
74
|
+
<LibPicture style={{ height: 15, width: 15, marginLeft: 6, marginRight: 6 }} source={esp.assets('icons/ic_search.png')} />
|
|
75
|
+
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, color: "#e5e5e5" }} >{esp.lang("component/header_home", "search")}</Text>
|
|
76
|
+
</View>
|
|
77
|
+
</TouchableOpacity>
|
|
78
|
+
}
|
|
79
|
+
<Pressable hitSlop={{ top: 7, left: 7, right: 7, bottom: 7 }} onPress={() => {
|
|
80
|
+
UserProfileProperty.isLogin(() => {
|
|
81
|
+
LibNavigation.navigate('notification/index')
|
|
82
|
+
})
|
|
83
|
+
}}>
|
|
84
|
+
<View style={{ marginRight: 5, padding: 4 }}>
|
|
85
|
+
<LibPicture style={{ height: 22, width: 27, resizeMode: 'contain' }} source={esp.assets('icons/home/notification.png')} />
|
|
86
|
+
<LibCurl_view
|
|
87
|
+
url='v2/notification_count'
|
|
88
|
+
cache
|
|
89
|
+
isUserData
|
|
90
|
+
onSuccess={(res, msg) => {
|
|
91
|
+
return (
|
|
92
|
+
<EventBadge counter={res} />
|
|
93
|
+
)
|
|
94
|
+
}}
|
|
95
|
+
onError={(err) => {
|
|
96
|
+
return (
|
|
97
|
+
<View />
|
|
98
|
+
)
|
|
99
|
+
}}
|
|
100
|
+
onLoading={<View />}
|
|
101
|
+
/>
|
|
102
|
+
</View>
|
|
103
|
+
</Pressable>
|
|
104
|
+
|
|
105
|
+
</View>
|
|
106
|
+
</View>
|
|
107
|
+
)
|
|
108
|
+
}
|
package/event/index.tsx
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
|
|
3
|
+
import { useIsFocused } from '@react-navigation/native';
|
|
4
|
+
import { LibBlock } from 'esoftplay/cache/lib/block/import';
|
|
5
|
+
import { LibCarrousel } from 'esoftplay/cache/lib/carrousel/import';
|
|
6
|
+
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
7
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
8
|
+
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
9
|
+
import { LibScroll } from 'esoftplay/cache/lib/scroll/import';
|
|
10
|
+
import { LibSkeleton } from 'esoftplay/cache/lib/skeleton/import';
|
|
11
|
+
import { LibStatusbar } from 'esoftplay/cache/lib/statusbar/import';
|
|
12
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
13
|
+
import { UserClass } from 'esoftplay/cache/user/class/import';
|
|
14
|
+
import { UserProfileProperty } from 'esoftplay/cache/user/profile/import';
|
|
15
|
+
import esp from 'esoftplay/esp';
|
|
16
|
+
import useGlobalState from 'esoftplay/global';
|
|
17
|
+
import useSafeState from 'esoftplay/state';
|
|
18
|
+
|
|
19
|
+
import { EventHeader_home } from 'esoftplay/cache/event/header_home/import';
|
|
20
|
+
import { EventItem } from 'esoftplay/cache/event/item/import';
|
|
21
|
+
import { EventMessage } from 'esoftplay/cache/event/message/import';
|
|
22
|
+
import { EventNotice } from 'esoftplay/cache/event/notice/import';
|
|
23
|
+
import { EventSection } from 'esoftplay/cache/event/section/import';
|
|
24
|
+
import React, { useEffect } from 'react';
|
|
25
|
+
import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
26
|
+
|
|
27
|
+
export interface EventIndexArgs {
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
export interface EventIndexProps {
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const sliderHeight = 0.50 * LibStyle.width
|
|
35
|
+
|
|
36
|
+
function Blocktitle(props: any) {
|
|
37
|
+
if (props.block.show_title == 1)
|
|
38
|
+
// return null
|
|
39
|
+
return (
|
|
40
|
+
<EventSection
|
|
41
|
+
text={props?.block?.title}
|
|
42
|
+
textColor={props.color}
|
|
43
|
+
icon={(props?.block?.params?.more_module == '' || props?.block?.show_more != 1) ? undefined : 'icons/ic_btn_more_rounded.png'}
|
|
44
|
+
moreAction={() => props?.block?.params?.more_module == '' || props?.block?.show_more != 1 ? {} : LibNavigation.navigate(props?.block?.params?.more_module, { url: props?.block?.params?.more_url, title: props?.block?.title })}
|
|
45
|
+
/>
|
|
46
|
+
)
|
|
47
|
+
else
|
|
48
|
+
return null
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const state = useGlobalState<any>(undefined, { persistKey: 'bigbang/event', inFile: true })
|
|
52
|
+
|
|
53
|
+
export default function m(props: EventIndexProps): any {
|
|
54
|
+
const [data, setData] = state?.useState?.()
|
|
55
|
+
const [error, setError] = useSafeState<any>()
|
|
56
|
+
const isFocus = useIsFocused()
|
|
57
|
+
const user = UserClass.state().useSelector(s => s)
|
|
58
|
+
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
loadData()
|
|
61
|
+
if (user) {
|
|
62
|
+
UserProfileProperty?.update()
|
|
63
|
+
}
|
|
64
|
+
}, [isFocus])
|
|
65
|
+
|
|
66
|
+
function loadData() {
|
|
67
|
+
new LibCurl(esp.isDebug("") ? "https://storage.googleapis.com/bbo-images/images/modules/api/home_event.json" : "https://storage.googleapis.com/bbo-images/bbo.co.id/images/modules/api/home_event.json", null, (res) => {
|
|
68
|
+
setData(res)
|
|
69
|
+
}, msg => setError(msg))
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function renderImageSlider(item1: any, i: number) {
|
|
73
|
+
if (item1.url != "") {
|
|
74
|
+
return (
|
|
75
|
+
<TouchableOpacity key={i.toString()} onPress={() => {
|
|
76
|
+
{
|
|
77
|
+
item1.url !== '' &&
|
|
78
|
+
LibNavigation.navigate(item1.module, { url: item1.url, title: item1.title })
|
|
79
|
+
}
|
|
80
|
+
}}>
|
|
81
|
+
<LibPicture source={{ uri: item1.image }} style={styleId_Z2fNAzg} />
|
|
82
|
+
</TouchableOpacity>
|
|
83
|
+
)
|
|
84
|
+
} else {
|
|
85
|
+
return (
|
|
86
|
+
<LibPicture key={i} source={{ uri: item1.image }} style={styleId_Z2fNAzg} />
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function renderBlockSlider(_block: any) {
|
|
92
|
+
return (
|
|
93
|
+
<LibCarrousel
|
|
94
|
+
// key={block.list_url}
|
|
95
|
+
delay={4000}
|
|
96
|
+
style={styleId_2r0hN4}
|
|
97
|
+
autoplay
|
|
98
|
+
bullets
|
|
99
|
+
bulletStyle={styleId_Z1RmiUb}
|
|
100
|
+
chosenBulletStyle={styleId_xFf64}
|
|
101
|
+
bulletsContainerStyle={styleId_Zoes0y} >
|
|
102
|
+
{
|
|
103
|
+
_block.map(renderImageSlider)
|
|
104
|
+
}
|
|
105
|
+
</LibCarrousel>
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
function renderBlockGridItem(item: any, i: number) {
|
|
111
|
+
return (
|
|
112
|
+
<EventItem
|
|
113
|
+
key={i.toString()}
|
|
114
|
+
{...item}
|
|
115
|
+
text={item.title}
|
|
116
|
+
onPress={() => {
|
|
117
|
+
{
|
|
118
|
+
item.url !== '' &&
|
|
119
|
+
LibNavigation.navigate(item.module, { url: item.url, title: item.title })
|
|
120
|
+
}
|
|
121
|
+
}} />
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function renderBlockGrid(block: any) {
|
|
126
|
+
return (
|
|
127
|
+
<View style={styleId_zwbK3} >
|
|
128
|
+
{
|
|
129
|
+
block.map(renderBlockGridItem)
|
|
130
|
+
}
|
|
131
|
+
</View>
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function renderBlock(block: any, i: number) {
|
|
136
|
+
if (block.type == 'slider') {
|
|
137
|
+
// return null
|
|
138
|
+
return (
|
|
139
|
+
<View key={i.toString()} >
|
|
140
|
+
<Blocktitle block={block} color={LibStyle.colorRed} />
|
|
141
|
+
<View style={styleId_2r0hN4} >
|
|
142
|
+
<LibBlock
|
|
143
|
+
// cache
|
|
144
|
+
url={block.list_url}
|
|
145
|
+
render={renderBlockSlider} />
|
|
146
|
+
</View>
|
|
147
|
+
</View>
|
|
148
|
+
)
|
|
149
|
+
} else if (block.type == 'grid') {
|
|
150
|
+
// return null
|
|
151
|
+
return (
|
|
152
|
+
<View key={i.toString()}>
|
|
153
|
+
<View style={{ margin: 10, marginBottom: 0, }}>
|
|
154
|
+
<Blocktitle block={block} color={LibStyle.colorRed} />
|
|
155
|
+
</View>
|
|
156
|
+
<LibBlock
|
|
157
|
+
cache
|
|
158
|
+
url={block.list_url}
|
|
159
|
+
render={renderBlockGrid}
|
|
160
|
+
/>
|
|
161
|
+
</View>
|
|
162
|
+
)
|
|
163
|
+
} else if (block.type == 'event_cat') {
|
|
164
|
+
return (
|
|
165
|
+
<View key={i}>
|
|
166
|
+
<View style={{ marginTop: 5, marginBottom: 10 }}>
|
|
167
|
+
<Blocktitle block={block} color={LibStyle.colorRed} />
|
|
168
|
+
</View>
|
|
169
|
+
<View style={{ marginBottom: 5 }}>
|
|
170
|
+
<ScrollView horizontal >
|
|
171
|
+
<View style={{ flexDirection: 'row', height: 80 }}>
|
|
172
|
+
<LibBlock
|
|
173
|
+
cache
|
|
174
|
+
url={block.list_url}
|
|
175
|
+
render={(block: any) => {
|
|
176
|
+
return (
|
|
177
|
+
block.map((item1: any, i: number) => {
|
|
178
|
+
return (
|
|
179
|
+
<TouchableOpacity key={i} onPress={() => {
|
|
180
|
+
LibNavigation.navigate(item1.module, { cat_id: item1.id, url: item1.url })
|
|
181
|
+
}}>
|
|
182
|
+
<View style={[{ height: 75, width: 75, marginTop: 3, marginRight: 1, marginLeft: 15, borderRadius: 10, backgroundColor: '#fff', alignContent: 'center', alignItems: 'center', justifyContent: 'center' }, LibStyle.elevation(2)]}>
|
|
183
|
+
<LibPicture source={{ uri: item1?.image }} style={{ width: 45, height: 45, resizeMode: 'contain' }} />
|
|
184
|
+
<Text allowFontScaling={false} ellipsizeMode={"tail"} numberOfLines={2} style={{ marginBottom: 7, marginTop: 4, fontFamily: "Arial", fontSize: 10, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, textAlign: "center", color: '#9e9e9e', paddingLeft: 3, paddingRight: 3 }}>{(item1?.title)}</Text>
|
|
185
|
+
</View>
|
|
186
|
+
</TouchableOpacity>
|
|
187
|
+
)
|
|
188
|
+
})
|
|
189
|
+
)
|
|
190
|
+
}} />
|
|
191
|
+
</View>
|
|
192
|
+
</ScrollView>
|
|
193
|
+
</View>
|
|
194
|
+
</View>
|
|
195
|
+
)
|
|
196
|
+
}
|
|
197
|
+
else if (block.type == 'info') {
|
|
198
|
+
return (
|
|
199
|
+
<View key={i.toString()}>
|
|
200
|
+
<EventNotice mode="info" text={block?.title} canPress={block?.task != '' && block.task_module != ''} onPress={() => LibNavigation.navigate(block?.task_module, { url: block?.task, title: block?.title })} containerStyle={{ marginVertical: 0, marginHorizontal: 0, borderRadius: 0 }} />
|
|
201
|
+
</View>
|
|
202
|
+
)
|
|
203
|
+
} else {
|
|
204
|
+
return null
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (!data) {
|
|
209
|
+
return (
|
|
210
|
+
<View style={{ flex: 1 }}>
|
|
211
|
+
<LibStatusbar style="dark" />
|
|
212
|
+
<LibSkeleton>
|
|
213
|
+
<View style={{ marginTop: LibStyle.STATUSBAR_HEIGHT }} />
|
|
214
|
+
<View style={{ flexDirection: 'row' }}>
|
|
215
|
+
<LibSkeleton.Circle size={33} />
|
|
216
|
+
<LibSkeleton.BoxFlex size={33} />
|
|
217
|
+
<LibSkeleton.Box size={33} />
|
|
218
|
+
<LibSkeleton.Box size={33} />
|
|
219
|
+
<LibSkeleton.Box size={33} />
|
|
220
|
+
</View>
|
|
221
|
+
<LibSkeleton.BoxFull size={sliderHeight} />
|
|
222
|
+
<LibSkeleton.BoxHalf size={20} />
|
|
223
|
+
<View style={{ flexDirection: 'row' }} >
|
|
224
|
+
<LibSkeleton.BoxFlex size={100} />
|
|
225
|
+
<LibSkeleton.BoxFlex size={100} />
|
|
226
|
+
</View>
|
|
227
|
+
<LibSkeleton.BoxHalf size={20} />
|
|
228
|
+
<View style={{ flexDirection: 'row' }} >
|
|
229
|
+
<LibSkeleton.BoxFlex size={100} />
|
|
230
|
+
<LibSkeleton.BoxFlex size={100} />
|
|
231
|
+
</View>
|
|
232
|
+
<LibSkeleton.BoxHalf size={20} />
|
|
233
|
+
<View style={{ flexDirection: 'row' }} >
|
|
234
|
+
<LibSkeleton.BoxFlex size={100} />
|
|
235
|
+
<LibSkeleton.BoxFlex size={100} />
|
|
236
|
+
</View>
|
|
237
|
+
</LibSkeleton>
|
|
238
|
+
</View>
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
return (
|
|
243
|
+
<View style={styleId_ZcMJmd} >
|
|
244
|
+
<View style={styleId_ZiB8gU} >
|
|
245
|
+
<EventHeader_home onPress={() => { LibNavigation.navigate('search/index') }} cart />
|
|
246
|
+
</View>
|
|
247
|
+
{
|
|
248
|
+
error ?
|
|
249
|
+
<EventMessage message={error?.message} />
|
|
250
|
+
:
|
|
251
|
+
<LibScroll
|
|
252
|
+
onRefresh={loadData}
|
|
253
|
+
style={styleId_ZcMJmd}>
|
|
254
|
+
{
|
|
255
|
+
data?.blocks?.map?.(renderBlock)
|
|
256
|
+
}
|
|
257
|
+
</LibScroll>
|
|
258
|
+
}
|
|
259
|
+
{/* <LibUpdater show={esp.isDebug()} /> */}
|
|
260
|
+
</View>
|
|
261
|
+
)
|
|
262
|
+
}
|
|
263
|
+
const styleId_Z2fNAzg: any = { height: sliderHeight, width: LibStyle.width, resizeMode: 'cover', backgroundColor: "#f1f2f3" }
|
|
264
|
+
const styleId_2r0hN4: any = { height: sliderHeight, width: LibStyle.width }
|
|
265
|
+
const styleId_Z1RmiUb: any = { width: 7, height: 7, backgroundColor: "#7e7e7e", borderRadius: 3.5, borderWidth: 0, marginHorizontal: 2 }
|
|
266
|
+
const styleId_xFf64: any = { width: 7, height: 7, backgroundColor: "white", borderRadius: 3.5, borderWidth: 0, marginHorizontal: 2 }
|
|
267
|
+
const styleId_Zoes0y: any = { marginBottom: -15 }
|
|
268
|
+
const styleId_ZcMJmd: any = { flex: 1 }
|
|
269
|
+
const styleId_zwbK3: any = { flexDirection: 'row', flexWrap: 'wrap', padding: 10 }
|
|
270
|
+
const styleId_ZiB8gU: any = { backgroundColor: '#FFC523' }
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
|
|
3
|
+
import { LibComponent } from 'esoftplay/cache/lib/component/import';
|
|
4
|
+
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
5
|
+
import { createTimeout } from 'esoftplay/timeout';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { TextInput, View } from 'react-native';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export interface EventInput_rectangleArgs {
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
export interface EventInput_rectangleProps {
|
|
14
|
+
icon?: string,
|
|
15
|
+
label?: string,
|
|
16
|
+
placeholder?: string,
|
|
17
|
+
mask?: string,
|
|
18
|
+
maskFrom?: 'start' | 'end',
|
|
19
|
+
suffix?: string,
|
|
20
|
+
onPress?: () => void,
|
|
21
|
+
helper?: string
|
|
22
|
+
allowFontScaling?: boolean,
|
|
23
|
+
autoCapitalize?: "none" | "sentences" | "words" | "characters",
|
|
24
|
+
autoCorrect?: boolean,
|
|
25
|
+
autoFocus?: boolean,
|
|
26
|
+
blurOnSubmit?: boolean,
|
|
27
|
+
caretHidden?: boolean,
|
|
28
|
+
contextMenuHidden?: boolean,
|
|
29
|
+
defaultValue?: string,
|
|
30
|
+
editable?: boolean,
|
|
31
|
+
inactive?: boolean,
|
|
32
|
+
keyboardType?: "default" | "email-address" | "numeric" | "phone-pad",
|
|
33
|
+
maxLength?: number,
|
|
34
|
+
multiline?: boolean,
|
|
35
|
+
onSubmitEditing?: () => void,
|
|
36
|
+
onChangeText?: (text: string) => void,
|
|
37
|
+
placeholderTextColor?: string,
|
|
38
|
+
returnKeyType?: "done" | "go" | "next" | "search" | "send",
|
|
39
|
+
secureTextEntry?: boolean,
|
|
40
|
+
selectTextOnFocus?: boolean,
|
|
41
|
+
selectionColor?: string,
|
|
42
|
+
style?: any,
|
|
43
|
+
inputStyle?: any,
|
|
44
|
+
value?: string,
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface EventInputState {
|
|
48
|
+
hasFocus: boolean,
|
|
49
|
+
error?: string,
|
|
50
|
+
helper?: string
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
export interface LibInputState {
|
|
55
|
+
hasFocus: boolean,
|
|
56
|
+
error?: string,
|
|
57
|
+
helper?: string
|
|
58
|
+
}
|
|
59
|
+
export default class m extends LibComponent<EventInput_rectangleProps, LibInputState> {
|
|
60
|
+
text: string
|
|
61
|
+
ref: any
|
|
62
|
+
constructor(props: EventInput_rectangleProps) {
|
|
63
|
+
super(props);
|
|
64
|
+
this.state = { hasFocus: false }
|
|
65
|
+
this.text = ''
|
|
66
|
+
this.ref = React.createRef()
|
|
67
|
+
this.getText = this.getText.bind(this);
|
|
68
|
+
this.mask = this.mask.bind(this);
|
|
69
|
+
this.unmask = this.unmask.bind(this);
|
|
70
|
+
this.setError = this.setError.bind(this);
|
|
71
|
+
this.clearError = this.clearError.bind(this);
|
|
72
|
+
this.setHelper = this.setHelper.bind(this);
|
|
73
|
+
this.clearHelper = this.clearHelper.bind(this);
|
|
74
|
+
this.getTextMasked = this.getTextMasked.bind(this);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
getText(): string {
|
|
78
|
+
return this.unmask(this.text)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
getTextMasked(): string {
|
|
82
|
+
return this.text
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
focus(): void {
|
|
86
|
+
this.ref.focus()
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
blur(): void {
|
|
90
|
+
this.ref.blur()
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
setHelper(msg: string): void {
|
|
94
|
+
this.setState({ helper: msg })
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
clearHelper(): void {
|
|
98
|
+
this.setState({ helper: undefined })
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
setError(msg: string): void {
|
|
102
|
+
this.setState({ error: msg })
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
clearError(): void {
|
|
106
|
+
this.setState({ error: undefined })
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
mask(text: string): string {
|
|
110
|
+
let _text = text
|
|
111
|
+
let { mask, maskFrom } = this.props
|
|
112
|
+
if (mask) {
|
|
113
|
+
if (!maskFrom) maskFrom = 'start'
|
|
114
|
+
let rMask = mask.split("")
|
|
115
|
+
let rText = this.unmask(_text).split("")
|
|
116
|
+
if (maskFrom == 'end') {
|
|
117
|
+
rMask = [...rMask.reverse()]
|
|
118
|
+
rText = [...rText.reverse()]
|
|
119
|
+
}
|
|
120
|
+
let maskedText = ''
|
|
121
|
+
var _addRange = 0
|
|
122
|
+
var _addMaskChar = ''
|
|
123
|
+
for (let i = 0; i < rMask.length; i++) {
|
|
124
|
+
const iMask = rMask[i];
|
|
125
|
+
if (iMask == '#') {
|
|
126
|
+
if (rText[i - _addRange] != undefined) {
|
|
127
|
+
maskedText += _addMaskChar + rText[i - _addRange]
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
break
|
|
131
|
+
}
|
|
132
|
+
_addMaskChar = ''
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
_addMaskChar += iMask
|
|
136
|
+
_addRange++
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (maskFrom == 'end') {
|
|
140
|
+
maskedText = maskedText.split('').reverse().join('')
|
|
141
|
+
}
|
|
142
|
+
this.ref.setNativeProps({ text: maskedText })
|
|
143
|
+
return maskedText
|
|
144
|
+
}
|
|
145
|
+
return _text
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
unmask(text: string): string {
|
|
149
|
+
let _text = text
|
|
150
|
+
let { mask } = this.props
|
|
151
|
+
if (mask) {
|
|
152
|
+
let masks = mask.match(/((?!\#).)/g)
|
|
153
|
+
if (masks) {
|
|
154
|
+
for (let i = 0; i < masks.length; i++) {
|
|
155
|
+
_text = _text.replace(new RegExp(LibUtils.escapeRegExp(masks[i]), 'g'), '')
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return _text
|
|
159
|
+
}
|
|
160
|
+
return _text
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
setText(text: string): void {
|
|
164
|
+
if (this.ref) {
|
|
165
|
+
this.ref.setNativeProps({ text: this.mask(text) })
|
|
166
|
+
this.text = this.mask(text)
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
componentDidUpdate(prevProps: EventInput_rectangleProps, prevState: EventInputState): void {
|
|
171
|
+
if (this.ref) {
|
|
172
|
+
this.ref.setNativeProps({ text: this.mask(this.text) })
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
componentDidMount(): void {
|
|
177
|
+
super.componentDidMount()
|
|
178
|
+
const timeout = createTimeout()
|
|
179
|
+
timeout.set(() => {
|
|
180
|
+
if (this.props.defaultValue) {
|
|
181
|
+
this.setText(this.props.defaultValue)
|
|
182
|
+
}
|
|
183
|
+
timeout.clear()
|
|
184
|
+
}, 300);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
render(): any {
|
|
188
|
+
const { error } = this.state
|
|
189
|
+
return (
|
|
190
|
+
<View pointerEvents={this.props.editable == false ? "none" : "auto"} style={[{ height: 40, borderRadius: 1, marginTop: 12, backgroundColor: "#ffffff", borderWidth: 1, borderColor: "#c5c5c5", flexDirection: 'row', alignItems: 'center', paddingHorizontal: 9 }, this.props.style]} >
|
|
191
|
+
<TextInput
|
|
192
|
+
ref={(r) => this.ref = r}
|
|
193
|
+
placeholder={this.props.placeholder}
|
|
194
|
+
placeholderTextColor='#e5e5e5'
|
|
195
|
+
maxLength={this.props.mask ? this.props.mask.length : undefined}
|
|
196
|
+
{...this.props}
|
|
197
|
+
onChangeText={(e) => {
|
|
198
|
+
this.text = this.mask(e)
|
|
199
|
+
if (error != undefined)
|
|
200
|
+
this.clearError()
|
|
201
|
+
if (this.props.onChangeText) this.props.onChangeText(e)
|
|
202
|
+
}}
|
|
203
|
+
style={[{ flex: 1, fontFamily: "SFProText", fontSize: 12, color: "#000", marginRight: 15 }, this.props.inputStyle]}
|
|
204
|
+
/>
|
|
205
|
+
</View>
|
|
206
|
+
)
|
|
207
|
+
}
|
|
208
|
+
}
|
package/event/item.tsx
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
|
|
3
|
+
import { ComponentTouchable } from 'esoftplay/cache/component/touchable/import';
|
|
4
|
+
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
5
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { View } from 'react-native';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export interface EventItemArgs {
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
export interface EventItemProps {
|
|
14
|
+
created?: string,
|
|
15
|
+
currency?: string,
|
|
16
|
+
description?: string,
|
|
17
|
+
discount?: string,
|
|
18
|
+
hits?: string,
|
|
19
|
+
id?: string,
|
|
20
|
+
image: string,
|
|
21
|
+
images?: any,
|
|
22
|
+
price?: string,
|
|
23
|
+
sale?: string,
|
|
24
|
+
title?: string,
|
|
25
|
+
url?: string,
|
|
26
|
+
test_ID?: string,
|
|
27
|
+
onPress: () => void
|
|
28
|
+
}
|
|
29
|
+
export default function m(props: EventItemProps): any {
|
|
30
|
+
const itemWidth = (LibStyle.width - 36.5) * 0.5
|
|
31
|
+
const itemHeigth = itemWidth / 1366 * 768
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<ComponentTouchable testID={props?.test_ID} onPress={props.onPress} >
|
|
35
|
+
<View style={[{ width: itemWidth, borderRadius: 5, backgroundColor: 'white', margin: 4, alignItems: "center", overflow: 'hidden' }, LibStyle.elevation(2)]} >
|
|
36
|
+
<LibPicture source={{ uri: props.image }} style={{ height: itemHeigth, width: itemWidth, resizeMode: 'cover', backgroundColor: "#f1f2f3" }} />
|
|
37
|
+
</View>
|
|
38
|
+
</ComponentTouchable>
|
|
39
|
+
)
|
|
40
|
+
}
|
package/event/notice.tsx
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
|
|
3
|
+
import { applyStyle } from 'esoftplay';
|
|
4
|
+
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
5
|
+
import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
|
|
6
|
+
import { LibIconStyle } from 'esoftplay/modules/lib/icon';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { TouchableOpacity, View } from 'react-native';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
export interface EventNoticeArgs {
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
export interface EventNoticeProps {
|
|
15
|
+
text: string
|
|
16
|
+
mode: "info" | "success" | "danger" | "warning"
|
|
17
|
+
onPress?: () => void,
|
|
18
|
+
canPress?: boolean
|
|
19
|
+
textStyle?: any
|
|
20
|
+
containerStyle?: any
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const icon: LibIconStyle[] = ["information-outline", "check-circle-outline", "close-circle-outline", "alert-circle-outline"]
|
|
24
|
+
const mode = ["info", "success", "danger", "warning"]
|
|
25
|
+
const color = ["blue", "lightgreen", "red", "orange"]
|
|
26
|
+
const bgColor = ["#cce5ff", "#d4edda", "#f8d7da", "#fff3cd"]
|
|
27
|
+
|
|
28
|
+
export default function m(props: EventNoticeProps): any {
|
|
29
|
+
return (
|
|
30
|
+
<TouchableOpacity onPress={props.onPress} >
|
|
31
|
+
<View style={applyStyle({ marginVertical: 5, marginHorizontal: 17, paddingVertical: 8, paddingHorizontal: 10, borderRadius: 6, flexDirection: 'row', alignItems: 'center', backgroundColor: bgColor[mode.indexOf(props.mode)], ...props.containerStyle })} >
|
|
32
|
+
<LibIcon name={icon[mode.indexOf(props.mode)]} color={color[mode.indexOf(props.mode)]} size={17} />
|
|
33
|
+
<LibTextstyle textStyle="caption2" numberOfLines={2} ellipsizeMode='tail' text={props.text} style={applyStyle({ marginHorizontal: 10, flex: 1, ...props?.textStyle })} />
|
|
34
|
+
{
|
|
35
|
+
props.canPress &&
|
|
36
|
+
<LibIcon name={'chevron-right'} size={17} />
|
|
37
|
+
}
|
|
38
|
+
</View>
|
|
39
|
+
</TouchableOpacity>
|
|
40
|
+
)
|
|
41
|
+
}
|
package/event/qc_idcard.tsx
CHANGED
|
@@ -3,10 +3,10 @@ import { useEffect, useRef } from 'react';
|
|
|
3
3
|
|
|
4
4
|
import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
5
5
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
6
|
+
import { EventInput_rectangle } from 'esoftplay/cache/event/input_rectangle/import';
|
|
6
7
|
import { EventMessage } from 'esoftplay/cache/event/message/import';
|
|
7
8
|
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
8
9
|
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
9
|
-
import { LibInput_rectangle2 } from 'esoftplay/cache/lib/input_rectangle2/import';
|
|
10
10
|
import { LibLoading } from 'esoftplay/cache/lib/loading/import';
|
|
11
11
|
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
12
12
|
import { LibProgress } from 'esoftplay/cache/lib/progress/import';
|
|
@@ -126,7 +126,7 @@ export default function m(props: EventQc_idcardProps): any {
|
|
|
126
126
|
{/* <Image source={{ uri: 'https://static.vecteezy.com/system/resources/previews/005/594/108/non_2x/mobile-application-for-scanning-qr-code-hand-holding-smartphone-scan-qr-code-icon-phone-app-barcode-scanner-vector.jpg' }} style={{ flex: 1, opacity: 0.3, resizeMode: 'cover' }} /> */}
|
|
127
127
|
<View style={{ backgroundColor: '#fff', padding: 16, paddingBottom: 10, }} >
|
|
128
128
|
<View style={{ flexDirection: 'row' }}>
|
|
129
|
-
<
|
|
129
|
+
<EventInput_rectangle
|
|
130
130
|
style={{ marginTop: 0, borderRadius: 5, flex: 1, height: 38 }}
|
|
131
131
|
placeholder={esp.lang("event/qc_idcard", "search_exhibitor")}
|
|
132
132
|
onChangeText={(e) => {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
|
|
3
|
+
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
4
|
+
import useSafeState from 'esoftplay/state';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { Animated, TouchableOpacity } from 'react-native';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export interface EventRefresh_buttonArgs {
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
export interface EventRefresh_buttonProps {
|
|
13
|
+
onPress: () => void,
|
|
14
|
+
size?: number
|
|
15
|
+
}
|
|
16
|
+
export default function m(props: EventRefresh_buttonProps): any {
|
|
17
|
+
const [anim, setAnim] = useSafeState(new Animated.Value(0))
|
|
18
|
+
const size = props.size || 18
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
function rotate() {
|
|
22
|
+
Animated.timing(anim, {
|
|
23
|
+
toValue: 1, duration: 500, useNativeDriver: true
|
|
24
|
+
}).start(() => { setAnim(new Animated.Value(0)) })
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const rotateAnim = anim.interpolate({
|
|
28
|
+
inputRange: [0, 1],
|
|
29
|
+
outputRange: ['0deg', '360deg'],
|
|
30
|
+
extrapolate: 'clamp'
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<TouchableOpacity onPress={() => { rotate(); props.onPress(); }} style={{ height: 30, width: 30, alignItems: 'center', justifyContent: 'center' }} >
|
|
35
|
+
<Animated.View style={{ height: size + 8, width: size + 8, transform: [{ rotate: rotateAnim }], alignItems: 'center', justifyContent: 'center' }} >
|
|
36
|
+
<LibIcon name="refresh" size={size} color="#999" />
|
|
37
|
+
</Animated.View>
|
|
38
|
+
</TouchableOpacity>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
|
|
3
|
+
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
4
|
+
import esp from 'esoftplay/esp';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { Text, TouchableOpacity, View } from 'react-native';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export interface EventSectionArgs {
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
export interface EventSectionProps {
|
|
13
|
+
text: string,
|
|
14
|
+
textColor: string,
|
|
15
|
+
caption?: string,
|
|
16
|
+
icon?: string,
|
|
17
|
+
moreAction?: () => void
|
|
18
|
+
}
|
|
19
|
+
export default function m(props: EventSectionProps): any {
|
|
20
|
+
return (
|
|
21
|
+
<View style={{ marginLeft: 4, marginVertical: 5, flexDirection: 'row', alignItems: 'center' }} >
|
|
22
|
+
<View style={{ width: 8, height: 28, borderRadius: 10, backgroundColor: "#ededed" }} />
|
|
23
|
+
<View style={{ marginLeft: 12, flex: 1 }} >
|
|
24
|
+
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 15, lineHeight: 22, color: props.textColor }} >{props.text}</Text>
|
|
25
|
+
{props.caption && <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 10, color: "#b8b8b8" }} >{props.caption}</Text>}
|
|
26
|
+
</View>
|
|
27
|
+
{
|
|
28
|
+
props.icon &&
|
|
29
|
+
<TouchableOpacity onPress={() => props.moreAction ? props.moreAction() : {}} >
|
|
30
|
+
<LibPicture style={{ height: 25, width: 25, resizeMode: 'contain' }} source={esp.assets(props.icon)} />
|
|
31
|
+
</TouchableOpacity>
|
|
32
|
+
}
|
|
33
|
+
</View>
|
|
34
|
+
)
|
|
35
|
+
}
|