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/event/detail.tsx
ADDED
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
import { CacheHit } from 'esoftplay/cache/cache/hit/import';
|
|
3
|
+
import { ComponentHeader } from 'esoftplay/cache/component/header/import';
|
|
4
|
+
import { ComponentSlider } from 'esoftplay/cache/component/slider/import';
|
|
5
|
+
import { ComponentTouchable } from 'esoftplay/cache/component/touchable/import';
|
|
6
|
+
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
7
|
+
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
8
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
9
|
+
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
10
|
+
import { LibScroll } from 'esoftplay/cache/lib/scroll/import';
|
|
11
|
+
import { LibSkeleton } from 'esoftplay/cache/lib/skeleton/import';
|
|
12
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
13
|
+
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
14
|
+
import { LibVideoProperty } from 'esoftplay/cache/lib/video/import';
|
|
15
|
+
import { LibWebview } from 'esoftplay/cache/lib/webview/import';
|
|
16
|
+
|
|
17
|
+
import { applyStyle } from 'esoftplay';
|
|
18
|
+
import { LibFirebase_socketProperty } from 'esoftplay/cache/lib/firebase_socket/import';
|
|
19
|
+
import { UseCondition } from 'esoftplay/cache/use/condition/import';
|
|
20
|
+
import { UseDeeplinkProperty } from 'esoftplay/cache/use/deeplink/import';
|
|
21
|
+
import { UserProfileProperty } from 'esoftplay/cache/user/profile/import';
|
|
22
|
+
import esp from 'esoftplay/esp';
|
|
23
|
+
import moment from 'esoftplay/moment';
|
|
24
|
+
import useSafeState from 'esoftplay/state';
|
|
25
|
+
import React, { useEffect } from 'react';
|
|
26
|
+
import { Linking, Pressable, Text, TouchableOpacity, View } from 'react-native';
|
|
27
|
+
import MapView, { Marker } from 'react-native-maps';
|
|
28
|
+
import useFirebaseSocket from '../lib/firebase_socket';
|
|
29
|
+
|
|
30
|
+
export interface EventDetailProps {
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default function m(props: EventDetailProps): any {
|
|
35
|
+
const { isInPricingQueueConfig } = useFirebaseSocket()
|
|
36
|
+
const [result, setResult] = useSafeState<any>(undefined)
|
|
37
|
+
const url = LibNavigation.getArgs(props, 'url')
|
|
38
|
+
const [deeplinkParams] = UseDeeplinkProperty.params.useState()
|
|
39
|
+
const [priority, setPriority] = useSafeState(false)
|
|
40
|
+
|
|
41
|
+
moment().locale('id')
|
|
42
|
+
function loadData(): void {
|
|
43
|
+
CacheHit.doHit(url)
|
|
44
|
+
new LibCurl(url, null, (res, msg) => {
|
|
45
|
+
LibFirebase_socketProperty.eventIdQueue.set(res.id)
|
|
46
|
+
setResult(res)
|
|
47
|
+
if (res.allotment) {
|
|
48
|
+
esp.modProp("lib/firebase_socket").userIdKeyReplacer.set({
|
|
49
|
+
t: Number(res.allotment.t),
|
|
50
|
+
s: Number(res.allotment.s),
|
|
51
|
+
priority: 1
|
|
52
|
+
})
|
|
53
|
+
setPriority(true)
|
|
54
|
+
} else {
|
|
55
|
+
setPriority(false)
|
|
56
|
+
}
|
|
57
|
+
}, (error) => {
|
|
58
|
+
LibDialog.warning(esp.lang("event/detail", "load_failed"), error?.message)
|
|
59
|
+
LibNavigation.back()
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
loadData()
|
|
65
|
+
// return () => LibFirebase_socketProperty.eventIdQueue.reset()
|
|
66
|
+
}, [])
|
|
67
|
+
|
|
68
|
+
if (!result) {
|
|
69
|
+
let itemWidth = LibStyle.width - 60
|
|
70
|
+
return (
|
|
71
|
+
<View style={{ flex: 1 }}>
|
|
72
|
+
<ComponentHeader title={esp.lang("event/detail", "header_empty")} />
|
|
73
|
+
<LibSkeleton>
|
|
74
|
+
<View style={{ margin: 15, height: 9 / 16 * itemWidth, width: itemWidth, borderRadius: 10, backgroundColor: '#fff', alignSelf: 'center' }} />
|
|
75
|
+
<View style={{ marginLeft: 15, backgroundColor: 'white', width: '70%', height: 20, borderRadius: 10 }} />
|
|
76
|
+
|
|
77
|
+
<View style={{ marginTop: 20, marginLeft: 15, flexDirection: 'row', borderRadius: 10, alignContent: 'center', alignItems: 'center' }}>
|
|
78
|
+
<View style={{ width: 28, height: 28, borderRadius: 5, backgroundColor: 'white' }} />
|
|
79
|
+
<View style={{ width: '40%', backgroundColor: 'white', height: 15, borderRadius: 10, marginLeft: 5 }} />
|
|
80
|
+
</View>
|
|
81
|
+
|
|
82
|
+
<View style={{ marginTop: 10, marginLeft: 15, flexDirection: 'row', borderRadius: 10, alignContent: 'center', alignItems: 'center' }}>
|
|
83
|
+
<View style={{ width: 28, height: 28, borderRadius: 5, backgroundColor: 'white' }} />
|
|
84
|
+
<View style={{ width: '30%', backgroundColor: 'white', height: 15, borderRadius: 10, marginLeft: 5 }} />
|
|
85
|
+
</View>
|
|
86
|
+
|
|
87
|
+
<View style={{ margin: 15, borderRadius: 10, height: '20%', width: '90%', backgroundColor: '#fff' }} />
|
|
88
|
+
<View style={{ marginTop: 0, margin: 15, borderRadius: 10, height: '30%', width: '80%', backgroundColor: '#fff' }} />
|
|
89
|
+
<View style={{ marginTop: 0, margin: 15, borderRadius: 10, height: '10%', width: '90%', backgroundColor: '#fff' }} />
|
|
90
|
+
</LibSkeleton>
|
|
91
|
+
</View>
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const hasLatlong = result.location_latlong !== '' && result.location_latlong.includes(',')
|
|
96
|
+
let lat = 0
|
|
97
|
+
let lng = 0
|
|
98
|
+
if (hasLatlong) {
|
|
99
|
+
lat = parseFloat(result.location_latlong?.split(',')[0])
|
|
100
|
+
lng = parseFloat(result.location_latlong?.split(',')[1])
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const curr = result?.hasOwnProperty('currency') ? result?.currency : ''
|
|
104
|
+
const isFree = (result.price_min == result.price_max) && result.price_min == 0
|
|
105
|
+
let priceRange = esp.lang("event/detail", "start_from", LibUtils.money(result.price_min, curr)) /* + " s/d " + LibUtils.money(result.price_max, curr) */
|
|
106
|
+
if (result.price_min == result.price_max) {
|
|
107
|
+
priceRange = LibUtils.money(result.price_min, curr)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
function renderTag(x: any, i: number) {
|
|
112
|
+
return (
|
|
113
|
+
<Pressable key={i} onPress={() => { LibNavigation.navigate('event/list', { url: x?.url, keywords: x?.title }) }} style={styleId_qGD26}>
|
|
114
|
+
<Text allowFontScaling={false} numberOfLines={1} style={styleId_Z2qkux5}>#{String(x?.title).toLowerCase()}</Text>
|
|
115
|
+
</Pressable>
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const date = moment().localeFormat('YYYY-MM-DD HH:mm:ss')
|
|
120
|
+
const startBooking = result?.start_booking;
|
|
121
|
+
const startDate: any = new Date(startBooking);
|
|
122
|
+
const currentDate: any = new Date();
|
|
123
|
+
|
|
124
|
+
// Hitung selisih hari antara tanggal sekarang dan startBooking
|
|
125
|
+
const diffTime = startDate - currentDate;
|
|
126
|
+
const diffDays = diffTime / (1000 * 60 * 60 * 24);
|
|
127
|
+
|
|
128
|
+
return (
|
|
129
|
+
<View style={{ flex: 1, backgroundColor: '#fff' }} >
|
|
130
|
+
<ComponentHeader
|
|
131
|
+
title={result.title}
|
|
132
|
+
iconShare={result?.url_share && result?.url_share !== ""}
|
|
133
|
+
onPressShare={() => {
|
|
134
|
+
LibUtils.share(result?.url_share)
|
|
135
|
+
}}
|
|
136
|
+
/>
|
|
137
|
+
|
|
138
|
+
<LibScroll onRefresh={loadData}>
|
|
139
|
+
<ComponentSlider images={result.images} onIndexChange={(i) => { }} />
|
|
140
|
+
<Text allowFontScaling={false} style={{ marginTop: -10, fontFamily: "Arial", fontSize: 18, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a", margin: 20 }} >{result.title}</Text>
|
|
141
|
+
<View style={{ flexDirection: 'row', marginBottom: 10, alignItems: 'center', marginHorizontal: 20 }} >
|
|
142
|
+
<LibPicture source={esp.assets('icons/ic_calendar_grey.png')} style={{ width: 14, height: 14 }} />
|
|
143
|
+
<Text allowFontScaling={false} style={{ marginLeft: 10, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#f39c12" }} >{result.status == 4 ? esp.lang("event/detail", "evn_pending") : LibUtils.getDateRange(result.start_date, result.end_date, esp.lang("event/detail", "until"))}</Text>
|
|
144
|
+
</View>
|
|
145
|
+
<View style={{ flexDirection: 'row', marginBottom: 10, alignItems: 'center', marginHorizontal: 20 }} >
|
|
146
|
+
<LibPicture source={esp.assets('icons/ic_tickets_grey.png')} style={{ width: 14, height: 14 }} />
|
|
147
|
+
<Text allowFontScaling={false} style={{ marginLeft: 10, fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#2980b9" }} >{result?.price_type == 0 ? esp.lang("event/detail", "tb_announce") : isFree ? esp.lang("event/detail", "text_free") : priceRange}</Text>
|
|
148
|
+
</View>
|
|
149
|
+
|
|
150
|
+
{
|
|
151
|
+
result?.event_tag?.length > 0 &&
|
|
152
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', flexWrap: 'wrap', marginLeft: 17, marginTop: 5 }}>
|
|
153
|
+
{
|
|
154
|
+
result?.event_tag?.map?.(renderTag)
|
|
155
|
+
}
|
|
156
|
+
</View>
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
<View style={{ marginHorizontal: 20, flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', alignContent: 'center' }}>
|
|
160
|
+
<Text allowFontScaling={false} style={{ marginTop: 10, fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a" }} >{esp.lang("event/detail", "text_about_event")}</Text>
|
|
161
|
+
{
|
|
162
|
+
result && result.files !== '' &&
|
|
163
|
+
<ComponentTouchable onPress={() => {
|
|
164
|
+
Linking.canOpenURL(result.files).then((t) => {
|
|
165
|
+
Linking.openURL(result.files)
|
|
166
|
+
})
|
|
167
|
+
}} >
|
|
168
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 10, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: LibStyle.colorRed }} >{esp.lang("event/detail", "text_show_brochure")}</Text>
|
|
169
|
+
</ComponentTouchable>
|
|
170
|
+
}
|
|
171
|
+
</View>
|
|
172
|
+
<LibWebview source={{ html: result.description }} onFinishLoad={() => { }} />
|
|
173
|
+
{
|
|
174
|
+
result && result.youtube !== "" &&
|
|
175
|
+
<>
|
|
176
|
+
<Text allowFontScaling={false} style={{ marginHorizontal: 20, marginTop: 10, fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a" }} >{esp.lang("event/detail", "text_video")}</Text>
|
|
177
|
+
<Pressable onPress={() => LibNavigation.navigate('lib/video', { code: result.youtube })} >
|
|
178
|
+
<LibPicture source={{ uri: LibVideoProperty.getUrlThumbnail(result.youtube) }} style={{ height: LibStyle.width * 9 / 16, width: LibStyle.width - 40, marginHorizontal: 20, resizeMode: 'cover' }} />
|
|
179
|
+
</Pressable>
|
|
180
|
+
</>
|
|
181
|
+
}
|
|
182
|
+
{
|
|
183
|
+
result.address != undefined && result.address != "" &&
|
|
184
|
+
<>
|
|
185
|
+
<Text allowFontScaling={false} style={{ marginHorizontal: 20, marginTop: 10, fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a" }} >{esp.lang("event/detail", "text_location")}</Text>
|
|
186
|
+
<View style={{ flexDirection: 'row', marginBottom: 10, alignItems: 'center', marginHorizontal: 20 }} >
|
|
187
|
+
<LibPicture source={esp.assets('icons/ic_pin_grey.png')} style={{ width: 14, height: 14 }} />
|
|
188
|
+
<Text allowFontScaling={false} style={{ marginLeft: 10, fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#9b9b9b", flex: 1 }} >{result.address + ' ' + result.location_name}</Text>
|
|
189
|
+
</View>
|
|
190
|
+
</>
|
|
191
|
+
}
|
|
192
|
+
{
|
|
193
|
+
result.location_latlong !== '' && hasLatlong &&
|
|
194
|
+
<Pressable onPress={() => LibUtils.mapTo(result.location_name, result.location_latlong)} >
|
|
195
|
+
<View pointerEvents="none" style={{ marginHorizontal: 20, borderRadius: 10, backgroundColor: '#999', height: 180, marginBottom: 24, overflow: 'hidden' }} >
|
|
196
|
+
<MapView
|
|
197
|
+
style={{ flex: 1 }}
|
|
198
|
+
liteMode
|
|
199
|
+
initialRegion={{ latitude: lat, longitude: lng, latitudeDelta: 0.0122, longitudeDelta: 0.0121 }}>
|
|
200
|
+
<Marker
|
|
201
|
+
onPress={() => { LibUtils.mapTo(result.location_name, result.location_latlong) }}
|
|
202
|
+
coordinate={{ latitude: lat, longitude: lng }}
|
|
203
|
+
title={result.title}
|
|
204
|
+
description={result.address}
|
|
205
|
+
/>
|
|
206
|
+
</MapView>
|
|
207
|
+
</View>
|
|
208
|
+
</Pressable>
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
{
|
|
212
|
+
result?.image_map !== "" &&
|
|
213
|
+
<>
|
|
214
|
+
<Text allowFontScaling={false} style={{ marginBottom: 10, marginHorizontal: 20, marginTop: 10, fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a" }} >{esp.lang("event/detail", "text_layout")}</Text>
|
|
215
|
+
<Pressable onPress={() => {
|
|
216
|
+
LibNavigation.navigate('lib/gallery', { image: result?.image_map })
|
|
217
|
+
}}>
|
|
218
|
+
<LibPicture source={{ uri: result?.image_map }} style={{ height: 0.50 * LibStyle.width - 30, width: LibStyle.width - 30, alignSelf: 'center' }} resizeMode="contain" />
|
|
219
|
+
</Pressable>
|
|
220
|
+
</>
|
|
221
|
+
}
|
|
222
|
+
{
|
|
223
|
+
result?.event_cat?.length > 0 &&
|
|
224
|
+
<>
|
|
225
|
+
<Text allowFontScaling={false} style={{ marginHorizontal: 20, fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a" }} >{esp.lang("event/detail", "text_event_cat")}</Text>
|
|
226
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', flexWrap: 'wrap', marginLeft: 17, marginTop: 5 }}>
|
|
227
|
+
{
|
|
228
|
+
result?.event_cat?.map?.((x: any, i: number) => (
|
|
229
|
+
<Pressable key={i} onPress={() => { LibNavigation.navigate('event/list', { url: 'event', cat_id: x?.id }) }} style={{ marginTop: 5, padding: 7, paddingHorizontal: 10, marginRight: 5, borderRadius: 3, backgroundColor: LibStyle.colorGrey }}>
|
|
230
|
+
<Text allowFontScaling={false} numberOfLines={1} style={{ fontFamily: 'Arial', fontSize: 10, letterSpacing: 2, color: '#2980b9' }}>{x?.title}</Text>
|
|
231
|
+
</Pressable>
|
|
232
|
+
))
|
|
233
|
+
}
|
|
234
|
+
</View>
|
|
235
|
+
</>
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
</LibScroll>
|
|
239
|
+
|
|
240
|
+
{/* 0=pending, 1=active, 2=done, 3=cancel (posisi tdnya pending lalu diaktifkan ketika wktunya udah lewat), 4=postpone(sudah lewat tapi jangan done) */}
|
|
241
|
+
|
|
242
|
+
{
|
|
243
|
+
result?.status == 1 ?
|
|
244
|
+
<View style={{ paddingVertical: 5, paddingHorizontal: 10 }} >
|
|
245
|
+
{
|
|
246
|
+
deeplinkParams?.type == 'event-voucher' &&
|
|
247
|
+
<Text allowFontScaling={false} style={{ color: "coral", fontSize: 12, fontWeight: 'bold', marginBottom: 5 }}>{esp.lang("event/detail", "voucher_embed") + deeplinkParams?.code}</Text>
|
|
248
|
+
}
|
|
249
|
+
{
|
|
250
|
+
result?.book_available == 0 ?
|
|
251
|
+
<>
|
|
252
|
+
{
|
|
253
|
+
result.end_booking <= date && result.end_booking != '0000-00-00 00:00:00' ?
|
|
254
|
+
<View style={{ height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 }} >
|
|
255
|
+
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, textAlign: "center", textAlignVertical: 'center', color: 'black', marginHorizontal: 10 }} >{esp.lang("event/detail", "text_booking_end")}</Text>
|
|
256
|
+
</View>
|
|
257
|
+
:
|
|
258
|
+
<View style={{ height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 }} >
|
|
259
|
+
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, textAlign: "center", textAlignVertical: 'center', color: 'black', marginHorizontal: 10 }} >
|
|
260
|
+
{
|
|
261
|
+
diffDays <= 3 ?
|
|
262
|
+
esp.lang("event/detail", "text_book_on", moment(result.start_booking).serverFormat('DD MMMM YYYY'))
|
|
263
|
+
:
|
|
264
|
+
esp.lang("event/detail", "booking_not_yet")
|
|
265
|
+
}
|
|
266
|
+
</Text>
|
|
267
|
+
</View>
|
|
268
|
+
}
|
|
269
|
+
</>
|
|
270
|
+
:
|
|
271
|
+
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
272
|
+
{
|
|
273
|
+
result?.url_artist != "" &&
|
|
274
|
+
<TouchableOpacity onPress={() => {
|
|
275
|
+
LibNavigation.navigate('artist/list', { title: result?.title, url: result?.url_artist, has_addition: result?.has_addition })
|
|
276
|
+
}} style={applyStyle({ width: (LibStyle.width - 30) * 0.5, borderWidth: 2, borderColor: LibStyle.colorGreen, height: 40, borderRadius: 16, backgroundColor: 'white', flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center', paddingHorizontal: 9 })} >
|
|
277
|
+
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: LibStyle.colorGreen })} >{esp.lang("event/detail", "line_up")}</Text>
|
|
278
|
+
</TouchableOpacity>
|
|
279
|
+
}
|
|
280
|
+
<TouchableOpacity onPress={() => {
|
|
281
|
+
UserProfileProperty.isLogin(() => {
|
|
282
|
+
|
|
283
|
+
if (isInPricingQueueConfig(result.id)) {
|
|
284
|
+
LibNavigation.navigateForResult('event/queue_pricing', { event_id: result?.id }).then((v) => {
|
|
285
|
+
LibNavigation.navigate(result?.config?.hasOwnProperty('multiprice') && result?.config?.multiprice == 1 ? 'event/ticket_list2' : 'event/ticket_list', {
|
|
286
|
+
url: result.url_price,
|
|
287
|
+
has_addition: result?.has_addition,
|
|
288
|
+
fee_platform: {
|
|
289
|
+
fee_platform_amount: result?.fee_platform_amount,
|
|
290
|
+
fee_platform_type: result?.fee_platform_type,
|
|
291
|
+
},
|
|
292
|
+
subscribed: {
|
|
293
|
+
is_subscribed: result?.config?.is_subscribed,
|
|
294
|
+
is_subscribed_default: result?.config?.is_subscribed_default,
|
|
295
|
+
is_subscribed_label: result?.config?.is_subscribed_label
|
|
296
|
+
}
|
|
297
|
+
})
|
|
298
|
+
})
|
|
299
|
+
} else {
|
|
300
|
+
LibNavigation.navigate(result?.config?.hasOwnProperty('multiprice') && result?.config?.multiprice == 1 ? 'event/ticket_list2' : 'event/ticket_list', {
|
|
301
|
+
url: result.url_price,
|
|
302
|
+
has_addition: result?.has_addition,
|
|
303
|
+
fee_platform: {
|
|
304
|
+
fee_platform_amount: result?.fee_platform_amount,
|
|
305
|
+
fee_platform_type: result?.fee_platform_type,
|
|
306
|
+
},
|
|
307
|
+
subscribed: {
|
|
308
|
+
is_subscribed: result?.config?.is_subscribed,
|
|
309
|
+
is_subscribed_default: result?.config?.is_subscribed_default,
|
|
310
|
+
is_subscribed_label: result?.config?.is_subscribed_label
|
|
311
|
+
}
|
|
312
|
+
})
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
})
|
|
316
|
+
}} style={applyStyle({ width: result?.url_artist != "" ? (LibStyle.width - 30) * 0.5 : LibStyle.width - 20, borderWidth: 2, borderColor: LibStyle.colorGreen, height: 40, borderRadius: 16, backgroundColor: LibStyle.colorGreen, flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center', paddingHorizontal: 9 })} >
|
|
317
|
+
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: "#fff" })} >{esp.lang("event/detail", "text_buy_ticket")}</Text>
|
|
318
|
+
</TouchableOpacity>
|
|
319
|
+
<UseCondition if={priority} >
|
|
320
|
+
<View pointerEvents='none' style={{ height: 20, position: "absolute", right: 0, top: 0, bottom: 0, left: 0 }} >
|
|
321
|
+
<LibSkeleton
|
|
322
|
+
colors={['#fffdb8', '#fdf68c', '#f4cd2a', '#f4cd2a', '#d28d0d', '#fffdb8', '#fdf68c', '#f4cd2a', '#f4cd2a', '#d28d0d', '#fffdb8', '#fdf68c', '#f4cd2a', '#f4cd2a', '#d28d0d']}>
|
|
323
|
+
<Text style={{ color: "white", fontWeight: "bold", fontSize: 9, alignSelf: 'center', textAlign: 'center' }} >{esp.lang("event/detail", "priority_label")}</Text>
|
|
324
|
+
</LibSkeleton>
|
|
325
|
+
</View>
|
|
326
|
+
</UseCondition>
|
|
327
|
+
</View>
|
|
328
|
+
}
|
|
329
|
+
</View>
|
|
330
|
+
:
|
|
331
|
+
result.status == 2 ? /* done */
|
|
332
|
+
<View style={{ flexDirection: 'row', paddingVertical: 5, paddingHorizontal: 10 }} >
|
|
333
|
+
<View style={{ flex: 1, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 }} >
|
|
334
|
+
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, textAlign: "center", textAlignVertical: 'center', color: 'black', marginRight: 10, marginLeft: 10 }} >{esp.lang("event/detail", "event_done")}</Text>
|
|
335
|
+
</View>
|
|
336
|
+
</View>
|
|
337
|
+
:
|
|
338
|
+
result.status == 4 ? /* postpone(sudah lewat tapi jangan done) */
|
|
339
|
+
<View style={{ flexDirection: 'row', paddingVertical: 5, paddingHorizontal: 10 }} >
|
|
340
|
+
<View style={{ flex: 1, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 }} >
|
|
341
|
+
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, textAlign: "center", textAlignVertical: 'center', color: 'black', marginRight: 10, marginLeft: 10 }} >{esp.lang("event/detail", "event_postpone")}</Text>
|
|
342
|
+
</View>
|
|
343
|
+
</View>
|
|
344
|
+
:
|
|
345
|
+
null
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
</View >
|
|
349
|
+
)
|
|
350
|
+
}
|
|
351
|
+
const styleId_qGD26: any = { marginTop: 5, padding: 7, paddingHorizontal: 10, marginRight: 5, borderRadius: 3, backgroundColor: LibStyle.colorGrey }
|
|
352
|
+
const styleId_Z2qkux5: any = { fontFamily: 'Arial', fontSize: 10, letterSpacing: 2, color: '#2980b9' }
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
import { LibLoading } from 'esoftplay/cache/lib/loading/import';
|
|
3
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
4
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
5
|
+
|
|
6
|
+
import { BigbangGate_infoProperty } from 'esoftplay/cache/bigbang/gate_info/import';
|
|
7
|
+
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
8
|
+
import esp from 'esoftplay/esp';
|
|
9
|
+
import React, { useEffect } from 'react';
|
|
10
|
+
import { View } from 'react-native';
|
|
11
|
+
import useFirebaseSocket from '../lib/firebase_socket';
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
export interface EventEntranceArgs {
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
export interface EventEntranceProps {
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export default function m(props: EventEntranceProps): any {
|
|
23
|
+
|
|
24
|
+
const { price_type,
|
|
25
|
+
gate_type,
|
|
26
|
+
qr_code,
|
|
27
|
+
event_id,
|
|
28
|
+
selectGate,
|
|
29
|
+
typeScanner,
|
|
30
|
+
event_title,
|
|
31
|
+
url_ticket_detail,
|
|
32
|
+
url_ticket_update,
|
|
33
|
+
configPriority,
|
|
34
|
+
scan_type
|
|
35
|
+
} = LibNavigation.getArgsAll<any>(props)
|
|
36
|
+
|
|
37
|
+
const { get } = useFirebaseSocket()
|
|
38
|
+
|
|
39
|
+
let whatTypeGate = gate_type == "1" ? 'in' : 'out'
|
|
40
|
+
|
|
41
|
+
/* price_id */
|
|
42
|
+
/* qty */
|
|
43
|
+
/* name */
|
|
44
|
+
/* qty_used */
|
|
45
|
+
/* image */
|
|
46
|
+
// sample: [
|
|
47
|
+
// "1121": [
|
|
48
|
+
// 2,
|
|
49
|
+
// "Muhammad Bagus Yulianto",
|
|
50
|
+
// 2,
|
|
51
|
+
// "https://api.test.bbo.co.id/images/modules/user/avatar/122674696.jpg"
|
|
52
|
+
// ],
|
|
53
|
+
// "staff": [
|
|
54
|
+
// [
|
|
55
|
+
// 1,
|
|
56
|
+
// "Muhammad Bagus Yulianto",
|
|
57
|
+
// 0,
|
|
58
|
+
// "https://api.test.bbo.co.id/images/modules/bigbang/exhibitor/1/staff/1211616174.jpg",
|
|
59
|
+
// "VIP-Expo Indonesia Jaya"
|
|
60
|
+
// ]
|
|
61
|
+
// ]
|
|
62
|
+
// ]
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
function mainPath(qr: string) {
|
|
66
|
+
let a = ['event', event_id, whatTypeGate, qr]
|
|
67
|
+
return a.join('/')
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
let args = {
|
|
71
|
+
price_type: price_type,
|
|
72
|
+
gate_type: gate_type,
|
|
73
|
+
qr_code: qr_code,
|
|
74
|
+
event_id: event_id,
|
|
75
|
+
event_title: event_title,
|
|
76
|
+
selectGate: selectGate,
|
|
77
|
+
typeScanner: typeScanner,
|
|
78
|
+
url_ticket_detail: url_ticket_detail,
|
|
79
|
+
url_ticket_update: url_ticket_update,
|
|
80
|
+
configPriority: configPriority,
|
|
81
|
+
scan_type: scan_type
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (qr_code) {
|
|
86
|
+
loadData()
|
|
87
|
+
} else {
|
|
88
|
+
LibDialog.warningConfirm("Oops", "QR Code tidak ditemukan", "Kembali", () => {
|
|
89
|
+
LibNavigation.back()
|
|
90
|
+
}, "", () => { })
|
|
91
|
+
}
|
|
92
|
+
}, [])
|
|
93
|
+
|
|
94
|
+
function direction(tikets: any, tiket: any) {
|
|
95
|
+
if (tiket.qty > 1) {
|
|
96
|
+
LibNavigation.replace('event/entrance_list', {
|
|
97
|
+
tickets: tikets,
|
|
98
|
+
...args
|
|
99
|
+
})
|
|
100
|
+
} else {
|
|
101
|
+
LibNavigation.replace('event/entrance_success', {
|
|
102
|
+
selectedTicket: tiket,
|
|
103
|
+
...args
|
|
104
|
+
})
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function loadData() {
|
|
109
|
+
let tikets: any[] = []
|
|
110
|
+
BigbangGate_infoProperty.addCounterEntranceScan(1, "0")
|
|
111
|
+
get(mainPath(encodeURIComponent(encodeURIComponent(qr_code))), selectGate?.id, (res) => {
|
|
112
|
+
esp.log({ res });
|
|
113
|
+
if (!res) {
|
|
114
|
+
LibNavigation.replace('event/entrance_failed', {
|
|
115
|
+
text: esp.lang("event/entrance", "ticket_empty_today"),
|
|
116
|
+
...args
|
|
117
|
+
})
|
|
118
|
+
return
|
|
119
|
+
} else {
|
|
120
|
+
Object.keys(res).forEach((key) => {
|
|
121
|
+
if (key == 'staff') {
|
|
122
|
+
Object.values(res[key]).map((item: any) => {
|
|
123
|
+
let x = {
|
|
124
|
+
price_id: key,
|
|
125
|
+
title: decodeURIComponent(item[4])?.split("+").join(' '),
|
|
126
|
+
color: LibStyle.colorPrimary,
|
|
127
|
+
key: item[5],
|
|
128
|
+
user_name: item[1],
|
|
129
|
+
user_image: item[3],
|
|
130
|
+
exhibitor_name: decodeURIComponent(item[4])?.split("+").join(' '),
|
|
131
|
+
qty: item[0],
|
|
132
|
+
qty_used: item[2],
|
|
133
|
+
qty_left: Number(item[0]) - (Number(item[2]) || 0),
|
|
134
|
+
text: item[6] || "",
|
|
135
|
+
}
|
|
136
|
+
tikets.push(x)
|
|
137
|
+
})
|
|
138
|
+
} else {
|
|
139
|
+
let a = {
|
|
140
|
+
price_id: key,
|
|
141
|
+
title: price_type?.filter?.((item: any) => item.id == key)[0]?.name,
|
|
142
|
+
color: price_type?.filter?.((item: any) => item.id == key)[0]?.color,
|
|
143
|
+
key: qr_code,
|
|
144
|
+
user_name: Object.values(res[key])?.[1],
|
|
145
|
+
user_image: Object.values(res[key])?.[3],
|
|
146
|
+
qty: Object.values(res[key])?.[0],
|
|
147
|
+
qty_used: Object.values(res[key])?.[2],
|
|
148
|
+
qty_left: Number(Object.values(res[key])?.[0]) - (Number(Object.values(res[key])?.[2]) || 0),
|
|
149
|
+
text: (Object.values(res[key])?.[4] == 'k' ? Object.values(res[key]) : Object.values(res[key])?.[4]) || ""
|
|
150
|
+
}
|
|
151
|
+
tikets.push(a)
|
|
152
|
+
}
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
if (tikets.length > 0) {
|
|
156
|
+
if (tikets.length == 1) {
|
|
157
|
+
const tiket = tikets[0];
|
|
158
|
+
|
|
159
|
+
if (tiket?.text == "") { // jika index ke 5 di result get nya TIDAK ADA text nya
|
|
160
|
+
if (tiket.qty_left <= 0) { // jika qty left nya 0 maka tiketnya habis
|
|
161
|
+
LibNavigation.replace('event/entrance_failed', {
|
|
162
|
+
text: esp.lang("event/entrance", "ticket_empty"),
|
|
163
|
+
ticketItem: tiket,
|
|
164
|
+
...args
|
|
165
|
+
})
|
|
166
|
+
} else { // jika masih punya tiket
|
|
167
|
+
if (tiket.hasOwnProperty("exhibitor_name")) { // jika dia punya id card
|
|
168
|
+
LibNavigation.replace('event/entrance_idcard', {
|
|
169
|
+
selectedTicket: tiket,
|
|
170
|
+
...args
|
|
171
|
+
})
|
|
172
|
+
} else { // ini data tiket user yang available
|
|
173
|
+
if (configPriority) { // ini untuk memunculkan priority
|
|
174
|
+
if (configPriority?.filter?.((item: any) => item.id == tiket.price_id).length > 0) {
|
|
175
|
+
direction(tikets, tiket)
|
|
176
|
+
} else { // ini jika di tms tidak memiliki hak scan tipe tiket tertentu
|
|
177
|
+
LibNavigation.replace('event/entrance_warning', {
|
|
178
|
+
selectedTicket: tiket,
|
|
179
|
+
...args
|
|
180
|
+
})
|
|
181
|
+
}
|
|
182
|
+
} else {
|
|
183
|
+
direction(tikets, tiket)
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
} else {// jika index ke 5 di result get nya ADA text nya
|
|
188
|
+
LibNavigation.replace('event/entrance_failed', {
|
|
189
|
+
text: tiket?.text,
|
|
190
|
+
ticketItem: tiket,
|
|
191
|
+
...args
|
|
192
|
+
})
|
|
193
|
+
}
|
|
194
|
+
} else { // ini jika tiketnya ada banyak
|
|
195
|
+
LibNavigation.replace('event/entrance_list', {
|
|
196
|
+
tickets: tikets,
|
|
197
|
+
...args
|
|
198
|
+
})
|
|
199
|
+
}
|
|
200
|
+
} else { // ini jika tiketnya tidak ada
|
|
201
|
+
LibNavigation.replace('event/entrance_failed', {
|
|
202
|
+
text: esp.lang("event/entrance", "ticket_not_found"),
|
|
203
|
+
...args
|
|
204
|
+
})
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
})
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return (
|
|
211
|
+
<View style={{ flex: 1, backgroundColor: '#fff' }}>
|
|
212
|
+
<LibLoading />
|
|
213
|
+
</View>
|
|
214
|
+
)
|
|
215
|
+
}
|