esoftplay-event 0.0.0-a → 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.tsx +4 -4
- package/event/additional_input.tsx +15 -15
- package/event/alert.tsx +32 -0
- package/event/artist.tsx +166 -0
- package/event/artist_detail.tsx +521 -0
- package/event/artist_detail_multi.tsx +548 -0
- package/event/badge.tsx +22 -0
- package/event/button.tsx +40 -0
- package/event/config.ts +4 -0
- package/event/countdown.tsx +5 -5
- package/event/countdown_base.tsx +83 -0
- package/event/counter_cashier.tsx +13 -13
- package/event/counter_cashier_report.tsx +6 -6
- package/event/counter_cashier_sell.tsx +7 -7
- package/event/counter_eo.tsx +21 -21
- package/event/counter_history.tsx +4 -4
- package/event/counter_lm.tsx +18 -18
- package/event/counter_report.tsx +4 -4
- package/event/counter_report_breakdown.tsx +2 -2
- package/event/counter_report_detail.tsx +15 -15
- package/event/counter_report_detail_list.tsx +4 -4
- package/event/counter_request.tsx +4 -4
- package/event/counter_request_detail.tsx +6 -6
- package/event/counter_send.tsx +9 -9
- package/event/counter_user_list.tsx +15 -15
- package/event/coupon.tsx +4 -4
- package/event/coupon_claim.tsx +4 -4
- package/event/coupon_claim_detail.tsx +8 -7
- package/event/coupon_claim_history.tsx +9 -9
- package/event/coupon_claim_reimburse.tsx +7 -8
- package/event/coupon_claim_reimburse_history.tsx +4 -4
- package/event/coupon_claim_reimburse_history_detail.tsx +4 -4
- package/event/coupon_claim_staff.tsx +10 -10
- package/event/coupon_detail.tsx +3 -3
- package/event/coupon_event_list.tsx +4 -4
- package/event/coupon_generate.tsx +4 -4
- package/event/coupon_generate_event.tsx +4 -4
- package/event/coupon_generate_list.tsx +2 -2
- package/event/date_picker.tsx +5 -5
- package/event/detail.tsx +12 -15
- package/event/entrance.tsx +17 -17
- package/event/entrance_again.tsx +22 -23
- package/event/entrance_failed.tsx +15 -15
- package/event/entrance_idcard.tsx +23 -23
- package/event/entrance_list.tsx +24 -24
- package/event/entrance_list_item.tsx +6 -6
- package/event/entrance_log.tsx +24 -24
- package/event/entrance_success.tsx +8 -8
- package/event/entrance_warning.tsx +14 -14
- package/event/exchange_reward.tsx +2 -2
- package/event/exchange_reward_result.tsx +7 -8
- package/event/exchange_ticket.tsx +11 -12
- package/event/exchange_ticket_list.tsx +10 -12
- package/event/exchange_ticket_result.tsx +11 -12
- package/event/exit.tsx +9 -9
- package/event/exit_failed.tsx +12 -12
- package/event/exit_list.tsx +15 -15
- package/event/exit_log.tsx +22 -22
- package/event/exit_success.tsx +8 -8
- package/event/exit_temporary.tsx +21 -21
- package/event/expander.tsx +36 -0
- package/event/fab.tsx +24 -0
- package/event/firebase_socket.ts +365 -0
- package/event/hall_in.tsx +13 -13
- package/event/hall_in_failed.tsx +22 -22
- package/event/hall_in_list.tsx +17 -17
- package/event/hall_in_log.tsx +24 -24
- package/event/hall_in_success.tsx +8 -8
- package/event/hall_out.tsx +13 -13
- package/event/hall_out_failed.tsx +11 -11
- package/event/hall_out_list.tsx +17 -17
- package/event/hall_out_log.tsx +24 -24
- package/event/hall_out_success.tsx +8 -8
- package/event/header.tsx +119 -0
- 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/label_input.tsx +23 -0
- package/event/list.tsx +20 -21
- package/event/list_filter.tsx +12 -13
- package/event/list_item.tsx +76 -0
- package/event/list_item2.tsx +78 -0
- package/event/loading_page.tsx +248 -0
- package/event/log.tsx +54 -54
- package/event/message.tsx +32 -0
- package/event/notice.tsx +41 -0
- package/event/order.tsx +323 -0
- package/event/order_detail.tsx +813 -0
- package/event/order_detail_payment.tsx +153 -0
- package/event/order_detail_upgrade.tsx +164 -0
- package/event/order_detail_upgrade_button.tsx +60 -0
- package/event/order_detail_upgrade_payment.tsx +221 -0
- package/event/order_detail_visitor.tsx +196 -0
- package/event/order_detail_waiting.tsx +520 -0
- package/event/order_history.tsx +101 -0
- package/event/order_item.tsx +118 -0
- package/event/order_lottery.tsx +172 -0
- package/event/order_reschedule.tsx +439 -0
- package/event/order_reschedule_list.tsx +85 -0
- package/event/order_share_to.tsx +219 -0
- package/event/order_share_to_detail.tsx +181 -0
- package/event/order_status.tsx +66 -0
- package/event/order_waiting.tsx +143 -0
- package/event/pending_trx.tsx +50 -0
- package/event/qc_idcard.tsx +12 -12
- package/event/qc_idcard_failed.tsx +4 -4
- package/event/qc_idcard_success.tsx +4 -4
- package/event/qr_bg.tsx +22 -0
- package/event/queue_out.tsx +3 -3
- package/event/queue_pricing.tsx +2 -3
- package/event/rating.tsx +49 -0
- package/event/rating_mini.tsx +35 -0
- package/event/refresh_button.tsx +40 -0
- package/event/review.tsx +3 -3
- package/event/review_add.tsx +8 -8
- package/event/review_detail.tsx +4 -4
- package/event/review_item.tsx +4 -4
- package/event/scan_item.tsx +2 -2
- package/event/schedule.tsx +8 -9
- package/event/seat.tsx +16 -18
- package/event/seat_autopick.tsx +4 -4
- package/event/seat_map.tsx +4 -4
- package/event/seat_map_test.tsx +2 -2
- package/event/section.tsx +35 -0
- package/event/section_menu.tsx +40 -0
- package/event/sheet.tsx +73 -0
- package/event/slider.tsx +46 -0
- package/event/step.tsx +29 -0
- package/event/ticket_list.tsx +15 -16
- package/event/ticket_list2.tsx +16 -17
- package/event/tms.tsx +4 -4
- package/event/tms_add.tsx +7 -8
- package/event/tms_add_result.tsx +4 -4
- package/event/tms_check_code.tsx +160 -0
- package/event/tms_check_ticket.tsx +72 -0
- package/event/tms_check_ticket_result.tsx +384 -0
- package/event/tms_dashboard.tsx +7 -7
- package/event/tms_event_list.tsx +46 -43
- package/event/tms_gate.tsx +96 -0
- package/event/tms_home.tsx +639 -0
- package/event/tms_idcard.tsx +203 -0
- package/event/tms_in.tsx +215 -0
- package/event/tms_in_again.tsx +199 -0
- package/event/tms_in_failed.tsx +190 -0
- package/event/tms_in_hall.tsx +148 -0
- package/event/tms_in_hall_failed.tsx +270 -0
- package/event/tms_in_hall_list.tsx +222 -0
- package/event/tms_in_hall_log.tsx +134 -0
- package/event/tms_in_hall_success.tsx +132 -0
- package/event/tms_in_list.tsx +264 -0
- package/event/tms_in_log.tsx +130 -0
- package/event/tms_in_success.tsx +155 -0
- package/event/tms_in_warning.tsx +91 -0
- package/event/tms_list_item.tsx +88 -0
- package/event/tms_log.tsx +435 -0
- package/event/tms_out.tsx +91 -0
- package/event/tms_out_failed.tsx +135 -0
- package/event/tms_out_hall.tsx +143 -0
- package/event/tms_out_hall_failed.tsx +133 -0
- package/event/tms_out_hall_list.tsx +215 -0
- package/event/tms_out_hall_log.tsx +133 -0
- package/event/tms_out_hall_success.tsx +130 -0
- package/event/tms_out_list.tsx +118 -0
- package/event/tms_out_log.tsx +131 -0
- package/event/tms_out_success.tsx +143 -0
- package/event/tms_out_temporary.tsx +226 -0
- package/event/toggle.tsx +30 -0
- package/event/transaction.ts +34 -0
- package/event/turnstile_event_gate.tsx +2 -2
- package/event/turnstile_event_list.tsx +4 -4
- package/event/turnstile_event_ticket.tsx +4 -4
- package/event/turnstile_settings.tsx +11 -11
- package/event/turnstile_settings_otp.tsx +4 -4
- package/event/turnstile_settings_status.tsx +2 -2
- package/event/voucher.tsx +9 -10
- package/event/voucher_multi.tsx +4 -5
- package/id.json +644 -0
- package/package.json +1 -1
package/event/hall_out_log.tsx
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import { useEffect } from 'react';
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
|
|
6
|
+
import { EventTms_out_hall_successProperty } from 'esoftplay/cache/event/tms_out_hall_success/import';
|
|
7
|
+
import { EventTms_logProperty } from 'esoftplay/cache/event/tms_log/import';
|
|
8
8
|
import { LibLoading } from 'esoftplay/cache/lib/loading/import';
|
|
9
9
|
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
10
10
|
import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
|
|
@@ -17,10 +17,10 @@ import React from 'react';
|
|
|
17
17
|
import { Pressable, Text, View } from 'react-native';
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
export interface
|
|
20
|
+
export interface EventTms_out_hall_logArgs {
|
|
21
21
|
|
|
22
22
|
}
|
|
23
|
-
export interface
|
|
23
|
+
export interface EventTms_out_hall_logProps {
|
|
24
24
|
onPress: (type: string, title: string) => void
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -47,21 +47,21 @@ function Item(props: HallOutLogItem) {
|
|
|
47
47
|
)
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export default function m(props:
|
|
51
|
-
const logHallOut =
|
|
52
|
-
const backupHallOut =
|
|
50
|
+
export default function m(props: EventTms_out_hall_logProps): any {
|
|
51
|
+
const logHallOut = EventTms_homeProperty.counterState().useSelector(s => s)
|
|
52
|
+
const backupHallOut = EventTms_out_hall_successProperty.syncHallOut().useSelector(s => s)
|
|
53
53
|
const [loading, setLoading] = useSafeState<boolean>(true)
|
|
54
54
|
const timeout = useTimeout()
|
|
55
55
|
|
|
56
56
|
function syncHallOutData() {
|
|
57
|
-
|
|
57
|
+
EventTms_homeProperty.subscribeSyncHallOut().trigger(EventTms_out_hall_successProperty.syncHallOut().get())
|
|
58
58
|
timeout(() => {
|
|
59
59
|
setLoading(false)
|
|
60
60
|
}, 1000)
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
function forceSyncHallOutData() {
|
|
64
|
-
|
|
64
|
+
EventTms_homeProperty.subscribeSyncHallOutReset().trigger(EventTms_out_hall_successProperty.syncHallOut().get())
|
|
65
65
|
timeout(() => {
|
|
66
66
|
setLoading(false)
|
|
67
67
|
}, 1000)
|
|
@@ -75,39 +75,39 @@ export default function m(props: EventHall_out_logProps): any {
|
|
|
75
75
|
return <LibLoading />
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
const sumValue =
|
|
78
|
+
const sumValue = EventTms_logProperty.sumValuesPerCategory(logHallOut)
|
|
79
79
|
|
|
80
80
|
return (
|
|
81
81
|
<View style={{ flex: 1, backgroundColor: '#fff', margin: 17, marginTop: 0, paddingBottom: 10, marginBottom: 0, borderBottomRightRadius: 10, borderBottomLeftRadius: 10, ...LibStyle.elevation(2) }}>
|
|
82
|
-
<Item subtitle={esp.lang("event/
|
|
82
|
+
<Item subtitle={esp.lang("event/tms_out_hall_log", "ticket_scanned_hall_out")} text={esp.lang("event/tms_out_hall_log", "scan_hall_out")} value={sumValue?.hall_out_scan} onPress={() => {
|
|
83
83
|
if (sumValue?.hall_out_scan) {
|
|
84
|
-
props.onPress("hall_out_scan", esp.lang("event/
|
|
84
|
+
props.onPress("hall_out_scan", esp.lang("event/tms_out_hall_log", "scan_hall_out"))
|
|
85
85
|
}
|
|
86
86
|
}} />
|
|
87
|
-
<Item subtitle={esp.lang("event/
|
|
87
|
+
<Item subtitle={esp.lang("event/tms_out_hall_log", "scanned_ticket_hall_put")} text={esp.lang("event/tms_out_hall_log", "qty_scan_hall_out")} value={sumValue?.hall_out_ticket} onPress={() => {
|
|
88
88
|
if (sumValue?.hall_out_ticket) {
|
|
89
|
-
props.onPress("hall_out_ticket", esp.lang("event/
|
|
89
|
+
props.onPress("hall_out_ticket", esp.lang("event/tms_out_hall_log", "qty_scan_hall_out"))
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
}} />
|
|
93
|
-
<Item subtitle={esp.lang("event/
|
|
93
|
+
<Item subtitle={esp.lang("event/tms_out_hall_log", "ticket_success_scanned_hall_out")} text={esp.lang("event/tms_out_hall_log", "opengate_hall_out")} value={sumValue?.hall_out_opengate} onPress={() => {
|
|
94
94
|
if (sumValue?.hall_out_opengate) {
|
|
95
|
-
props.onPress("hall_out_opengate", esp.lang("event/
|
|
95
|
+
props.onPress("hall_out_opengate", esp.lang("event/tms_out_hall_log", "opengate_hall_out"))
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
}} />
|
|
99
|
-
<Item subtitle={esp.lang("event/
|
|
99
|
+
<Item subtitle={esp.lang("event/tms_out_hall_log", "idcard_scanned_hall_out")} text={esp.lang("event/tms_out_hall_log", "opengate_hall_out_idcard")} value={sumValue?.hall_out_opengate_idcard} onPress={() => {
|
|
100
100
|
if (sumValue?.hall_out_opengate_idcard) {
|
|
101
|
-
props.onPress("hall_out_opengate_idcard", esp.lang("event/
|
|
101
|
+
props.onPress("hall_out_opengate_idcard", esp.lang("event/tms_out_hall_log", "opengate_hall_out_idcard"))
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
}} />
|
|
105
|
-
<Item subtitle={esp.lang("event/
|
|
105
|
+
<Item subtitle={esp.lang("event/tms_out_hall_log", "data_send_to_server")} text={esp.lang("event/tms_out_hall_log", "data_send")} value={sumValue?.hall_out_send} onPress={() => {
|
|
106
106
|
if (sumValue?.hall_out_send) {
|
|
107
|
-
props.onPress("hall_out_send", esp.lang("event/
|
|
107
|
+
props.onPress("hall_out_send", esp.lang("event/tms_out_hall_log", "data_send"))
|
|
108
108
|
}
|
|
109
109
|
}} />
|
|
110
|
-
<Item subtitle={esp.lang("event/
|
|
110
|
+
<Item subtitle={esp.lang("event/tms_out_hall_log", "data_not_send_to_server")} text={esp.lang("event/tms_out_hall_log", "data_not_send")} valuecolor={LibStyle.colorRed} value={backupHallOut.length} onPress={() => {
|
|
111
111
|
|
|
112
112
|
}} />
|
|
113
113
|
|
|
@@ -119,12 +119,12 @@ export default function m(props: EventHall_out_logProps): any {
|
|
|
119
119
|
setLoading(true)
|
|
120
120
|
forceSyncHallOutData()
|
|
121
121
|
}}>
|
|
122
|
-
<Text allowFontScaling={false} style={{ textAlign: 'center' }}>{esp.lang("event/
|
|
122
|
+
<Text allowFontScaling={false} style={{ textAlign: 'center' }}>{esp.lang("event/tms_out_hall_log", "wait")}<Text style={{ color: LibStyle.colorBlue, textDecorationStyle: 'solid', textDecorationLine: 'underline' }}>{esp.lang("event/tms_out_hall_log", "click")}</Text> {esp.lang("event/tms_out_hall_log", "retry")}</Text>
|
|
123
123
|
</Pressable>
|
|
124
124
|
} >
|
|
125
125
|
<LibTextstyle textStyle='callout'
|
|
126
126
|
style={{ textAlign: 'center', marginTop: 15 }}
|
|
127
|
-
text={esp.lang("event/
|
|
127
|
+
text={esp.lang("event/tms_out_hall_log", "all_data_send")} />
|
|
128
128
|
</UseCondition>
|
|
129
129
|
</View>
|
|
130
130
|
|
|
@@ -9,16 +9,16 @@ import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
|
9
9
|
import useGlobalState, { useGlobalReturn } from 'esoftplay/global';
|
|
10
10
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
|
|
13
13
|
import esp from 'esoftplay/esp';
|
|
14
14
|
import useSafeState from 'esoftplay/state';
|
|
15
15
|
import React from 'react';
|
|
16
16
|
import { Animated, Easing, Pressable, Text, View } from 'react-native';
|
|
17
17
|
|
|
18
|
-
export interface
|
|
18
|
+
export interface EventTms_out_hall_successArgs {
|
|
19
19
|
|
|
20
20
|
}
|
|
21
|
-
export interface
|
|
21
|
+
export interface EventTms_out_hall_successProps {
|
|
22
22
|
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -27,7 +27,7 @@ export function syncHallOut(): useGlobalReturn<any[]> {
|
|
|
27
27
|
return dataListHallOut
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export default function m(props:
|
|
30
|
+
export default function m(props: EventTms_out_hall_successProps): any {
|
|
31
31
|
const { scan_type, data, url, post, url_ticket_update, url_ticket_detail, price_type, gate_type, event_id, selectGate, typeScanner, event_title, configPriority }: any = LibNavigation.getArgsAll<any>(props)
|
|
32
32
|
|
|
33
33
|
const [isPaused, setIsPaused] = useSafeState<boolean>(false)
|
|
@@ -54,7 +54,7 @@ export default function m(props: EventHall_out_successProps): any {
|
|
|
54
54
|
// script next nya disini
|
|
55
55
|
LibNavigation.replace('component/scanner', {
|
|
56
56
|
selectGate: selectGate,
|
|
57
|
-
fromPage: '
|
|
57
|
+
fromPage: 'event/tms_home',
|
|
58
58
|
event_id: event_id,
|
|
59
59
|
event_title: event_title,
|
|
60
60
|
typeScanner: typeScanner,
|
|
@@ -79,14 +79,14 @@ export default function m(props: EventHall_out_successProps): any {
|
|
|
79
79
|
|
|
80
80
|
useEffect(() => {
|
|
81
81
|
dataListHallOut.get()
|
|
82
|
-
|
|
82
|
+
EventTms_homeProperty.addCounterHallOutOpenGate(1, "0")
|
|
83
83
|
createDataHallOut()
|
|
84
84
|
animateProgressBar()
|
|
85
85
|
}, [])
|
|
86
86
|
|
|
87
87
|
function createDataHallOut() {
|
|
88
88
|
dataListHallOut.set(LibObject.push(dataListHallOut.get(), [url, post])())
|
|
89
|
-
|
|
89
|
+
EventTms_homeProperty.subscribeSyncHallOut().trigger(dataListHallOut.get())
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
const widthInterpolate = progress.interpolate({
|
|
@@ -120,7 +120,7 @@ export default function m(props: EventHall_out_successProps): any {
|
|
|
120
120
|
colors={['rgba(255,255,255,0)', 'rgba(0,0,0,0.55)', 'rgba(0,0,0,1)', 'rgba(0,0,0,1)']}>
|
|
121
121
|
<View style={{ flex: 1, padding: 15, justifyContent: 'flex-end', paddingBottom: 100, alignContent: 'center', alignItems: 'center' }}>
|
|
122
122
|
<Text allowFontScaling={false} style={{ textAlign: 'center', flexWrap: 'wrap', fontSize: 35, letterSpacing: 2, fontWeight: '900', color: '#fff' }}>{data[0]?.price_name}</Text>
|
|
123
|
-
<Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 26, marginTop: 20, color: '#fff' }}>{esp.lang("event/
|
|
123
|
+
<Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 26, marginTop: 20, color: '#fff' }}>{esp.lang("event/tms_out_hall_success", "exit")}</Text>
|
|
124
124
|
</View>
|
|
125
125
|
|
|
126
126
|
</LinearGradient>
|
package/event/header.tsx
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
|
|
3
|
+
import { EventBadge } from 'esoftplay/cache/event/badge/import';
|
|
4
|
+
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
5
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
6
|
+
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
7
|
+
import { LibStatusbar } from 'esoftplay/cache/lib/statusbar/import';
|
|
8
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
9
|
+
import { UserNotification } from 'esoftplay/cache/user/notification/import';
|
|
10
|
+
import { UserProfileProperty } from 'esoftplay/cache/user/profile/import';
|
|
11
|
+
import esp from 'esoftplay/esp';
|
|
12
|
+
import React, { useRef } from 'react';
|
|
13
|
+
import { Text, TextInput, TouchableOpacity, View } from 'react-native';
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export interface EventHeaderArgs {
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
export interface EventHeaderProps {
|
|
20
|
+
doSearch?: (query: string) => void,
|
|
21
|
+
onChangeText?: (query: string) => void,
|
|
22
|
+
searchPlaceholder?: string,
|
|
23
|
+
title?: string,
|
|
24
|
+
titleColor?: string,
|
|
25
|
+
subtitle?: string,
|
|
26
|
+
bgSubtitle?: string,
|
|
27
|
+
cart?: boolean,
|
|
28
|
+
bgColor?: string,
|
|
29
|
+
notif?: boolean,
|
|
30
|
+
more?: boolean,
|
|
31
|
+
logout?: boolean,
|
|
32
|
+
iconShare?: boolean,
|
|
33
|
+
sort?: boolean,
|
|
34
|
+
onPressSort?: () => void,
|
|
35
|
+
onPressMore?: () => void,
|
|
36
|
+
onPressLogout?: () => void,
|
|
37
|
+
onPressShare?: () => void,
|
|
38
|
+
}
|
|
39
|
+
export default function m(props: EventHeaderProps): any {
|
|
40
|
+
const counter = UserNotification.state().useSelector(s => s.unread)
|
|
41
|
+
let inputSearch: any = useRef<TextInput>(null)
|
|
42
|
+
let query: string = ''
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<View style={{}} >
|
|
47
|
+
<LibStatusbar style="dark" />
|
|
48
|
+
<View style={{ flexDirection: 'row', backgroundColor: props.bgColor ? props.bgColor : 'white', padding: 15, paddingVertical: 10, alignItems: 'center', paddingTop: LibStyle.STATUSBAR_HEIGHT + 17, ...LibStyle.elevation(2) }} >
|
|
49
|
+
<TouchableOpacity hitSlop={{ top: 4, bottom: 4, left: 4, right: 4 }} onPress={() => LibNavigation.back()} >
|
|
50
|
+
<LibPicture style={{ height: 27, width: 27 }} source={esp.assets('icons/ic_header_back.png')} />
|
|
51
|
+
</TouchableOpacity>
|
|
52
|
+
{
|
|
53
|
+
props.doSearch || props.onChangeText ?
|
|
54
|
+
<View style={{ marginLeft: 15, borderRadius: 20, flexDirection: 'row', padding: 5, alignItems: 'center', backgroundColor: "#ffffff", borderStyle: "solid", borderWidth: 0.5, borderColor: "#c5c5c5", flex: 1, marginHorizontal: 12 }} >
|
|
55
|
+
<LibPicture style={{ height: 15, width: 15, marginLeft: 6, marginRight: 6 }} source={esp.assets('icons/ic_search.png')} />
|
|
56
|
+
<TextInput
|
|
57
|
+
autoFocus
|
|
58
|
+
ref={r => inputSearch = r}
|
|
59
|
+
style={{ fontFamily: "ArialBold", fontSize: 12, color: "#9e9e9e", flex: 1 }}
|
|
60
|
+
placeholder={props.searchPlaceholder || esp.lang("event/header", "search_product")}
|
|
61
|
+
onChangeText={(t) => props.onChangeText && props.onChangeText(query = t)}
|
|
62
|
+
returnKeyType={'search'}
|
|
63
|
+
returnKeyLabel={'Search'}
|
|
64
|
+
placeholderTextColor={'#e5e5e5'}
|
|
65
|
+
onSubmitEditing={() => props.doSearch && props.doSearch(query)}
|
|
66
|
+
/>
|
|
67
|
+
</View>
|
|
68
|
+
:
|
|
69
|
+
<View style={{ marginHorizontal: 12, flex: 1 }} >
|
|
70
|
+
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 14, fontStyle: "normal", letterSpacing: 0, color: props.titleColor ? props.titleColor : "#70472b" }} numberOfLines={1} >{props.title}</Text>
|
|
71
|
+
{props.subtitle && <Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, letterSpacing: 0, color: props.bgSubtitle ? props.bgSubtitle : "#BBBBBB", marginTop: 3 }} >{props.subtitle}</Text>}
|
|
72
|
+
</View>
|
|
73
|
+
}
|
|
74
|
+
{
|
|
75
|
+
props.iconShare &&
|
|
76
|
+
<TouchableOpacity style={{ marginRight: 7 }} onPress={() => { props.onPressShare && props.onPressShare() }}>
|
|
77
|
+
<LibIcon.MaterialIcons name="share" color="#6F442D" size={22} />
|
|
78
|
+
</TouchableOpacity>
|
|
79
|
+
}
|
|
80
|
+
{
|
|
81
|
+
props.notif ?
|
|
82
|
+
<View />
|
|
83
|
+
:
|
|
84
|
+
<TouchableOpacity onPress={() => {
|
|
85
|
+
UserProfileProperty.isLogin(() => {
|
|
86
|
+
LibNavigation.navigate('notification/index')
|
|
87
|
+
|
|
88
|
+
})
|
|
89
|
+
}}>
|
|
90
|
+
<View>
|
|
91
|
+
<View style={{ borderRadius: 25, backgroundColor: '#fff', padding: 4 }}>
|
|
92
|
+
<LibPicture style={{ height: 22, width: 27, resizeMode: 'contain' }} source={esp.assets('icons/home/notification.png')} />
|
|
93
|
+
<EventBadge counter={counter} />
|
|
94
|
+
</View>
|
|
95
|
+
</View>
|
|
96
|
+
</TouchableOpacity>
|
|
97
|
+
}
|
|
98
|
+
{
|
|
99
|
+
props.onPressMore && props.more &&
|
|
100
|
+
<TouchableOpacity style={{ marginRight: 3.5 }} onPress={() => { props.onPressMore && props.onPressMore() }}>
|
|
101
|
+
<LibIcon name="dots-vertical" color="#6F442D" />
|
|
102
|
+
</TouchableOpacity>
|
|
103
|
+
}
|
|
104
|
+
{
|
|
105
|
+
props.onPressLogout && props.logout &&
|
|
106
|
+
<TouchableOpacity style={{ marginRight: 3.5, marginLeft: 4 }} onPress={() => { props.onPressLogout && props.onPressLogout() }}>
|
|
107
|
+
<LibIcon name="logout" color="#6F442D" />
|
|
108
|
+
</TouchableOpacity>
|
|
109
|
+
}
|
|
110
|
+
{
|
|
111
|
+
props.onPressSort && props.sort &&
|
|
112
|
+
<TouchableOpacity style={{ marginRight: 3.5 }} onPress={() => { props.onPressSort && props.onPressSort() }}>
|
|
113
|
+
<LibIcon name="sort-variant" color="#6F442D" />
|
|
114
|
+
</TouchableOpacity>
|
|
115
|
+
}
|
|
116
|
+
</View>
|
|
117
|
+
</View>
|
|
118
|
+
)
|
|
119
|
+
}
|
|
@@ -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
|
+
}
|