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
|
@@ -0,0 +1,521 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
|
|
3
|
+
import { applyStyle } from 'esoftplay';
|
|
4
|
+
import { BboConfigProperty } from 'esoftplay/cache/bbo/config/import';
|
|
5
|
+
import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
6
|
+
import { EventCountdownProperty } from 'esoftplay/cache/event/countdown/import';
|
|
7
|
+
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
8
|
+
import { LibCarrousel } from 'esoftplay/cache/lib/carrousel/import';
|
|
9
|
+
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
10
|
+
import { LibHtmltext } from 'esoftplay/cache/lib/htmltext/import';
|
|
11
|
+
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
12
|
+
import { LibLoading } from 'esoftplay/cache/lib/loading/import';
|
|
13
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
14
|
+
import { LibObject } from 'esoftplay/cache/lib/object/import';
|
|
15
|
+
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
16
|
+
import { LibShare } from 'esoftplay/cache/lib/share/import';
|
|
17
|
+
import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
|
|
18
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
19
|
+
import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
|
|
20
|
+
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
21
|
+
import { LibVideoProperty } from 'esoftplay/cache/lib/video/import';
|
|
22
|
+
import { LibWebview } from 'esoftplay/cache/lib/webview/import';
|
|
23
|
+
import { UserProfileProperty } from 'esoftplay/cache/user/profile/import';
|
|
24
|
+
import esp from 'esoftplay/esp';
|
|
25
|
+
import moment from 'esoftplay/moment';
|
|
26
|
+
import useSafeState from 'esoftplay/state';
|
|
27
|
+
import React, { useEffect } from 'react';
|
|
28
|
+
import { Pressable, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
export interface EventArtist_detailProps {
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default function m(props: EventArtist_detailProps): any {
|
|
36
|
+
moment().locale('id')
|
|
37
|
+
let showSchedule = React.useRef<LibSlidingup>(null)
|
|
38
|
+
const [qty, setQty] = useSafeState<any>(1)
|
|
39
|
+
const { data, subscribed } = LibNavigation.getArgsAll(props)
|
|
40
|
+
const startBooking = moment(data?.start_booking).serverFormat('YYYY-MM-DD HH:mm:ss')
|
|
41
|
+
const date = moment().localeFormat('YYYY-MM-DD HH:mm:ss')
|
|
42
|
+
const [bboConfig] = BboConfigProperty.state().useState()
|
|
43
|
+
|
|
44
|
+
const [selectedTicket, setSelectedTicket, getSelectedTicket] = useSafeState<any>()
|
|
45
|
+
const [priceList, setPriceList] = useSafeState<any>()
|
|
46
|
+
const [showAll, setShowAll] = useSafeState<any>({});
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
loadDataPrice()
|
|
50
|
+
BboConfigProperty.curlConfig('v2/config_order_type')
|
|
51
|
+
return () => { EventCountdownProperty.releaseQueue.trigger() }
|
|
52
|
+
}, [])
|
|
53
|
+
|
|
54
|
+
function sortByStatus(data: any) {
|
|
55
|
+
// Fungsi sorting untuk memastikan status 1 di atas, lainnya di bawah
|
|
56
|
+
const statusSorter = (a: any, b: any) => {
|
|
57
|
+
if (a.status == 1 && b.status != 1) return -1; // a = 1, b bukan 1 -> a di atas
|
|
58
|
+
if (a.status != 1 && b.status == 1) return 1; // a bukan 1, b = 1 -> b di atas
|
|
59
|
+
return a.status - b.status; // Urutkan status selain 1 secara alami
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
return data
|
|
63
|
+
.map((item: any) => {
|
|
64
|
+
// Sorting array 'list' di dalam setiap item
|
|
65
|
+
const sortedList = item?.list?.sort(statusSorter);
|
|
66
|
+
return { ...item, list: sortedList };
|
|
67
|
+
})
|
|
68
|
+
.sort(statusSorter); // Sorting array utama
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
function loadDataPrice() {
|
|
73
|
+
new LibCurl(data?.price_list_url, null, (res, msg) => {
|
|
74
|
+
|
|
75
|
+
let stop = false
|
|
76
|
+
let arr = sortByStatus(res)
|
|
77
|
+
|
|
78
|
+
for (let i = 0; i < arr.length; i++) {
|
|
79
|
+
const item = arr[i];
|
|
80
|
+
if (item?.status == 1) {
|
|
81
|
+
for (let it = 0; it < item?.list.length; it++) {
|
|
82
|
+
const element = item?.list[it];
|
|
83
|
+
if (element?.status == 1) {
|
|
84
|
+
let replaceList = LibObject.set(item, element)('list')
|
|
85
|
+
setQty(item?.qty_min)
|
|
86
|
+
setSelectedTicket(replaceList)
|
|
87
|
+
stop = true
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (stop) {
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
setPriceList(res)
|
|
98
|
+
}, (err) => {
|
|
99
|
+
LibToastProperty.show(err?.message)
|
|
100
|
+
LibNavigation.back()
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function proceedToPayment() {
|
|
105
|
+
if (!selectedTicket) {
|
|
106
|
+
if (priceList?.every((v: any) => v?.status == 0)) {
|
|
107
|
+
LibToastProperty.show(esp.lang("event/artist_detail", "ticket_not_available"))
|
|
108
|
+
return
|
|
109
|
+
}
|
|
110
|
+
LibToastProperty.show(esp.lang("event/artist_detail", "select_tiket_first"))
|
|
111
|
+
return
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
showSchedule.current?.hide()
|
|
115
|
+
|
|
116
|
+
let dataPost: any = {
|
|
117
|
+
event_id: data?.event_id,
|
|
118
|
+
event_title: data?.event_title,
|
|
119
|
+
charge_payment: data?.charge_payment,
|
|
120
|
+
charge_payment_type: data?.charge_payment_type,
|
|
121
|
+
selected_ticket: selectedTicket,
|
|
122
|
+
qty: qty,
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (selectedTicket?.config?.seat_autopick == 1 && qty > 1) {
|
|
126
|
+
dataPost.adjacent_seats = 1
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (selectedTicket?.use_seat == 1) {
|
|
130
|
+
if (selectedTicket?.config && selectedTicket?.config?.seat_autopick == 1) {
|
|
131
|
+
LibNavigation.navigate('payment/ticket', {
|
|
132
|
+
order_type: bboConfig?.order_type?.ticket,
|
|
133
|
+
tax: getSelectedTicket()?.tax || data?.tax,
|
|
134
|
+
dataBookingEvent: { ...dataPost, qty: qty },
|
|
135
|
+
subscribed: subscribed
|
|
136
|
+
})
|
|
137
|
+
} else {
|
|
138
|
+
LibNavigation.navigateForResult('event/seat', {
|
|
139
|
+
url: 'event_seat',
|
|
140
|
+
dataTicket: dataPost,
|
|
141
|
+
}).then((value) => {
|
|
142
|
+
dataPost.row_id = value.row_id
|
|
143
|
+
dataPost.column_id = value.column_id
|
|
144
|
+
dataPost.seat_name = value.seat_name
|
|
145
|
+
|
|
146
|
+
if (data?.has_addition && data?.has_addition == 1) {
|
|
147
|
+
LibNavigation.navigateForResult('event/additional', { type_ticket: selectedTicket?.type, ondate: selectedTicket?.list?.ondate, event_id: data?.event_id, qty: qty, data: dataPost }, 221).then((additions) => {
|
|
148
|
+
if (additions != "") {
|
|
149
|
+
dataPost.addition = additions
|
|
150
|
+
}
|
|
151
|
+
LibNavigation.navigate('payment/ticket', {
|
|
152
|
+
order_type: bboConfig?.order_type?.ticket,
|
|
153
|
+
tax: getSelectedTicket()?.tax || data?.tax,
|
|
154
|
+
dataBookingEvent: dataPost,
|
|
155
|
+
fee_platform: {
|
|
156
|
+
fee_platform_amount: data?.fee_platform_amount,
|
|
157
|
+
fee_platform_type: data?.fee_platform_type,
|
|
158
|
+
},
|
|
159
|
+
subscribed: subscribed
|
|
160
|
+
})
|
|
161
|
+
})
|
|
162
|
+
} else {
|
|
163
|
+
LibNavigation.navigate('payment/ticket', {
|
|
164
|
+
order_type: bboConfig?.order_type?.ticket,
|
|
165
|
+
tax: getSelectedTicket()?.tax || data?.tax,
|
|
166
|
+
dataBookingEvent: dataPost,
|
|
167
|
+
fee_platform: {
|
|
168
|
+
fee_platform_amount: data?.fee_platform_amount,
|
|
169
|
+
fee_platform_type: data?.fee_platform_type,
|
|
170
|
+
},
|
|
171
|
+
subscribed: subscribed
|
|
172
|
+
})
|
|
173
|
+
}
|
|
174
|
+
})
|
|
175
|
+
}
|
|
176
|
+
} else {
|
|
177
|
+
if (data?.has_addition && data?.has_addition == 1 || selectedTicket?.hasOwnProperty("has_addition") && selectedTicket?.has_addition == 1) {
|
|
178
|
+
LibNavigation.navigateForResult('event/additional', { ondate: selectedTicket?.list?.ondate, event_id: data?.event_id, qty: qty, data: dataPost, price_id: selectedTicket?.price_id }, 221).then((additions) => {
|
|
179
|
+
if (additions != "") {
|
|
180
|
+
dataPost.addition = additions
|
|
181
|
+
}
|
|
182
|
+
LibNavigation.navigate('payment/ticket', {
|
|
183
|
+
order_type: bboConfig?.order_type?.ticket,
|
|
184
|
+
tax: getSelectedTicket()?.tax || data?.tax,
|
|
185
|
+
dataBookingEvent: dataPost,
|
|
186
|
+
fee_platform: {
|
|
187
|
+
fee_platform_amount: data?.fee_platform_amount,
|
|
188
|
+
fee_platform_type: data?.fee_platform_type,
|
|
189
|
+
},
|
|
190
|
+
subscribed: subscribed
|
|
191
|
+
})
|
|
192
|
+
})
|
|
193
|
+
} else {
|
|
194
|
+
LibNavigation.navigate('payment/ticket', {
|
|
195
|
+
order_type: bboConfig?.order_type?.ticket,
|
|
196
|
+
tax: getSelectedTicket()?.tax || data?.tax,
|
|
197
|
+
dataBookingEvent: dataPost,
|
|
198
|
+
fee_platform: {
|
|
199
|
+
fee_platform_amount: data?.fee_platform_amount,
|
|
200
|
+
fee_platform_type: data?.fee_platform_type,
|
|
201
|
+
},
|
|
202
|
+
subscribed: subscribed
|
|
203
|
+
})
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function add(): void {
|
|
209
|
+
let hasQuota = getSelectedTicket().quota > 0
|
|
210
|
+
const min = hasQuota ? Number(getSelectedTicket()?.quota) - Number(getSelectedTicket()?.quota_used) : Number(getSelectedTicket()?.qty_max)
|
|
211
|
+
if (qty < Math.min(min, Number(getSelectedTicket()?.qty_max))) {
|
|
212
|
+
setQty(Number(qty) + 1)
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function min(): void {
|
|
217
|
+
if (qty <= getSelectedTicket()?.qty_min) {
|
|
218
|
+
setQty(Number(getSelectedTicket()?.qty_min))
|
|
219
|
+
} else {
|
|
220
|
+
setQty(qty == 1 ? 1 : qty - 1)
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
let share = [
|
|
226
|
+
{
|
|
227
|
+
icon: 'icons/ic_facebook.png',
|
|
228
|
+
title: 'Facebook',
|
|
229
|
+
onPress: () => { LibShare.facebook(data?.url) }
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
icon: 'icons/ic_whatsapp.png',
|
|
233
|
+
title: 'Whatsapp',
|
|
234
|
+
onPress: () => { LibShare.whatsapp(data?.url) }
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
icon: 'icons/ic_twitter.png',
|
|
238
|
+
title: 'Twitter',
|
|
239
|
+
onPress: () => { LibShare.twitter(data?.url) }
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
icon: 'icons/ic_copy.png',
|
|
243
|
+
title: esp.lang("event/artist_detail", "copy"),
|
|
244
|
+
onPress: () => {
|
|
245
|
+
LibUtils.copyToClipboard(data?.url).then((v) => {
|
|
246
|
+
LibToastProperty.show(esp.lang("event/artist_detail", "alert"))
|
|
247
|
+
})
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
]
|
|
251
|
+
|
|
252
|
+
function renderShare(item: any, i: number) {
|
|
253
|
+
return (
|
|
254
|
+
<View key={i} style={applyStyle({ marginRight: 10 })}>
|
|
255
|
+
<TouchableOpacity onPress={item.onPress} >
|
|
256
|
+
<LibPicture style={applyStyle({ resizeMode: 'contain', height: 25, width: 25, borderRadius: 12.5, backgroundColor: 'white' })} source={esp.assets(item.icon)} />
|
|
257
|
+
</TouchableOpacity>
|
|
258
|
+
</View>
|
|
259
|
+
)
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function renderItem(item: any, itemT: any, iT: number) {
|
|
263
|
+
let ticketWithDate = item.price_date == 1 && item.use_code == 0
|
|
264
|
+
let ticketSpecial = item.price_date == 0 && item.use_code == 0
|
|
265
|
+
|
|
266
|
+
let _selectedTicket = item.price_id == selectedTicket?.price_id && itemT.date_id == selectedTicket?.list?.date_id
|
|
267
|
+
|
|
268
|
+
let colorDefault = _selectedTicket ? "#FFE9AD" : '#fff'
|
|
269
|
+
let colorBackground = item?.status != 1 ? LibStyle.colorLightGrey : itemT?.status != 1 ? LibStyle.colorLightGrey : colorDefault
|
|
270
|
+
let textOpacity = /* item?.status == 1 ? 1 : */ itemT?.status == 1 ? 1 : 0.3
|
|
271
|
+
|
|
272
|
+
return (
|
|
273
|
+
<TouchableOpacity
|
|
274
|
+
onPress={() => {
|
|
275
|
+
let itemTicket = {
|
|
276
|
+
...item
|
|
277
|
+
}
|
|
278
|
+
let replaceList = LibObject.set(itemTicket, itemT)('list')
|
|
279
|
+
let msg = itemT?.status == 0 ? esp.lang("event/artist_detail", "sold_out") : esp.lang("event/artist_detail", "coming_soon")
|
|
280
|
+
|
|
281
|
+
// kondisi untuk tipe tiket yang ada tanggalnya
|
|
282
|
+
if (item?.status == 1 && itemT?.status == 1) {
|
|
283
|
+
setSelectedTicket(replaceList)
|
|
284
|
+
setQty(item.qty_min)
|
|
285
|
+
} else if (item?.status == 0) {
|
|
286
|
+
LibToastProperty.show(msg)
|
|
287
|
+
} else if (item?.status == 2) {
|
|
288
|
+
LibToastProperty.show(msg)
|
|
289
|
+
}
|
|
290
|
+
}} activeOpacity={itemT?.status == 1 ? 0 : 1} key={iT} style={{ flex: 1, flexDirection: 'row', backgroundColor: colorBackground, justifyContent: 'space-between', padding: 10, alignItems: 'center' }}>
|
|
291
|
+
{
|
|
292
|
+
itemT.ondate == "0000-00-00" ?
|
|
293
|
+
<LibPicture source={esp.assets('icons/ic_special2.png')} style={{ height: 42, width: 42 }} />
|
|
294
|
+
:
|
|
295
|
+
<>
|
|
296
|
+
<View style={applyStyle({ marginLeft: 10, marginHorizontal: 20, width: 42, height: 42, borderRadius: 5, backgroundColor: "#fff", borderStyle: "solid", borderWidth: 1, borderColor: _selectedTicket ? "#3ea4dc" : '#999', alignContent: 'center', alignItems: 'center', justifyContent: 'center' })}>
|
|
297
|
+
<Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 20, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0.23, textAlign: "center", color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('DD')}</Text>
|
|
298
|
+
</View>
|
|
299
|
+
<View style={applyStyle({ flexDirection: 'column', flex: 1 })}>
|
|
300
|
+
{
|
|
301
|
+
item?.status == 1 && itemT?.status != 1 &&
|
|
302
|
+
<View style={applyStyle({ flexDirection: 'row', marginBottom: 5 })}>
|
|
303
|
+
<View style={applyStyle({ alignContent: 'center', alignItems: 'center', justifyContent: 'center', marginTop: 5, borderWidth: 1, backgroundColor: itemT?.status == 0 ? LibStyle.colorRed : "#4cd964", borderColor: itemT?.status == 0 ? LibStyle.colorRed : "#4cd964", borderRadius: 5, padding: 3, opacity: 0.8 })}>
|
|
304
|
+
<Text allowFontScaling={false} style={applyStyle({ fontSize: 10, fontStyle: "normal", letterSpacing: 0, color:/* itemT?.status == 2 ? "#000" : */"#fff", fontWeight: 'bold' })}>{itemT?.status == 0 ? esp.lang("event/artist_detail", "sold_out") : esp.lang("event/artist_detail", "coming_soon")}</Text>
|
|
305
|
+
</View>
|
|
306
|
+
</View>
|
|
307
|
+
}
|
|
308
|
+
<Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('dddd')}</Text>
|
|
309
|
+
<View style={applyStyle({ flexDirection: 'row' })}>
|
|
310
|
+
<Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('MMMM')}</Text>
|
|
311
|
+
<Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, marginLeft: 7, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('YYYY')}</Text>
|
|
312
|
+
</View>
|
|
313
|
+
</View>
|
|
314
|
+
</>
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
<View style={applyStyle({ marginRight: 5, marginLeft: 5, flexDirection: 'column' })} >
|
|
318
|
+
{
|
|
319
|
+
(itemT?.status == 1 || itemT?.status == 0) &&
|
|
320
|
+
<Text allowFontScaling={false} style={applyStyle({ opacity: ticketWithDate ? textOpacity : 1, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "right", color: _selectedTicket ? "#3ea4dc" : (itemT.price == 0 ? LibStyle.colorGreen : '#999') })} >{itemT.price == 0 ? esp.lang("event/ticket_list", "free") : LibUtils.money(itemT.price, item.currency)}</Text>
|
|
321
|
+
}
|
|
322
|
+
{
|
|
323
|
+
item?.status == 1 && (ticketWithDate || ticketSpecial) && _selectedTicket &&
|
|
324
|
+
<View style={applyStyle({ marginTop: 4, flexDirection: 'row', marginLeft: 8, alignContent: 'center', alignItems: 'center' })}>
|
|
325
|
+
<TouchableOpacity onPress={() => { min() }}>
|
|
326
|
+
<View style={applyStyle({ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
|
|
327
|
+
<LibIcon name="minus" color="#e74c3c" />
|
|
328
|
+
</View>
|
|
329
|
+
</TouchableOpacity>
|
|
330
|
+
<Text style={applyStyle({ fontFamily: "Arial", fontSize: 20, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#9b9b9b", marginLeft: 13, marginRight: 13 })}>{qty}</Text>
|
|
331
|
+
<TouchableOpacity onPress={() => { add() }}>
|
|
332
|
+
<View style={applyStyle({ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
|
|
333
|
+
<LibIcon name="plus" color="#16a085" />
|
|
334
|
+
</View>
|
|
335
|
+
</TouchableOpacity>
|
|
336
|
+
</View>
|
|
337
|
+
}
|
|
338
|
+
</View>
|
|
339
|
+
</TouchableOpacity>
|
|
340
|
+
)
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
if (!priceList) {
|
|
344
|
+
return <LibLoading />
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
const bgHeight = LibStyle.width * 9 / 16
|
|
348
|
+
|
|
349
|
+
function renderImages(item: any, i: number) {
|
|
350
|
+
const styleId_Z1ecB7O: any = { height: bgHeight, width: LibStyle.width, resizeMode: 'cover' }
|
|
351
|
+
return (
|
|
352
|
+
<TouchableOpacity key={i} onPress={() => LibNavigation.navigate('lib/gallery', { images: data?.images_artist, index: i })}>
|
|
353
|
+
<LibPicture source={{ uri: item.image }} style={styleId_Z1ecB7O} />
|
|
354
|
+
</TouchableOpacity>
|
|
355
|
+
)
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
const maxDisplay = 3;
|
|
359
|
+
const handleShowAll = (price_id: any) => {
|
|
360
|
+
setShowAll((prevShowAll: any) => ({
|
|
361
|
+
...prevShowAll,
|
|
362
|
+
[price_id]: !prevShowAll[price_id],
|
|
363
|
+
}));
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
return (
|
|
367
|
+
<View style={{ flex: 1 }} >
|
|
368
|
+
<EventHeader title={esp.lang("event/artist_detail", "title")} subtitle={data?.title} />
|
|
369
|
+
<ScrollView>
|
|
370
|
+
{
|
|
371
|
+
data?.images_artist && data?.images_artist?.length > 0 ?
|
|
372
|
+
<LibCarrousel
|
|
373
|
+
delay={3000}
|
|
374
|
+
style={{ height: bgHeight, width: LibStyle.width }}
|
|
375
|
+
autoplay
|
|
376
|
+
bullets
|
|
377
|
+
bulletStyle={{ width: 7, height: 7, backgroundColor: "#fff", borderRadius: 3.5, borderWidth: 0, marginHorizontal: 2 }}
|
|
378
|
+
chosenBulletStyle={{ width: 7, height: 7, backgroundColor: "#f4e31b", borderRadius: 3.5, borderWidth: 0, marginHorizontal: 2 }}
|
|
379
|
+
bulletsContainerStyle={{ marginBottom: -10 }}>
|
|
380
|
+
{
|
|
381
|
+
data?.images_artist && data?.images_artist?.map(renderImages)
|
|
382
|
+
}
|
|
383
|
+
</LibCarrousel>
|
|
384
|
+
:
|
|
385
|
+
<Pressable onPress={() => LibNavigation.navigate('lib/gallery', { image: data?.image_artist })} >
|
|
386
|
+
<LibPicture
|
|
387
|
+
style={applyStyle({ height: LibStyle.width * 9 / 16, width: LibStyle.width, backgroundColor: '#f2f3f4' })}
|
|
388
|
+
source={{ uri: data?.image_artist }} />
|
|
389
|
+
</Pressable>
|
|
390
|
+
}
|
|
391
|
+
<View style={applyStyle({ marginTop: 10, marginLeft: 17, flexDirection: 'row' })}>
|
|
392
|
+
{
|
|
393
|
+
share.map(renderShare)
|
|
394
|
+
}
|
|
395
|
+
</View>
|
|
396
|
+
<Text allowFontScaling={false} style={applyStyle({ marginBottom: 12, marginLeft: 17, fontFamily: "Arial", marginTop: 20, fontSize: 26, fontWeight: "bold", fontStyle: "normal", lineHeight: 30, letterSpacing: 0, color: "#000" })}>{data?.title}</Text>
|
|
397
|
+
{/* {
|
|
398
|
+
data && priceList?.map?.(renderPrieList)
|
|
399
|
+
} */}
|
|
400
|
+
{
|
|
401
|
+
data?.description != "" &&
|
|
402
|
+
<ScrollView>
|
|
403
|
+
<LibWebview onFinishLoad={() => { }} source={{ html: data?.description }} />
|
|
404
|
+
</ScrollView>
|
|
405
|
+
}
|
|
406
|
+
{
|
|
407
|
+
data && data?.youtube != "" &&
|
|
408
|
+
<>
|
|
409
|
+
<Text allowFontScaling={false} style={applyStyle({ marginHorizontal: 20, marginTop: 10, fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a" })} >{esp.lang("event/artist_detail", "video")}</Text>
|
|
410
|
+
<TouchableOpacity onPress={() => LibNavigation.navigate('lib/video', { code: data?.youtube })} >
|
|
411
|
+
<LibPicture source={{ uri: LibVideoProperty.getUrlThumbnail(data?.youtube) }} style={applyStyle({ height: LibStyle.width * 9 / 16, width: LibStyle.width - 40, marginHorizontal: 20, resizeMode: 'cover' })} />
|
|
412
|
+
</TouchableOpacity>
|
|
413
|
+
</>
|
|
414
|
+
}
|
|
415
|
+
</ScrollView>
|
|
416
|
+
<View style={applyStyle({ flexDirection: 'row', padding: 10, backgroundColor: 'white' })} >
|
|
417
|
+
|
|
418
|
+
{
|
|
419
|
+
data?.book_available == 1 ?
|
|
420
|
+
<EventButton label={esp.lang("event/artist_detail", "buy_ticket")} onPress={() => {
|
|
421
|
+
UserProfileProperty.isLogin(() => {
|
|
422
|
+
showSchedule.current?.show()
|
|
423
|
+
})
|
|
424
|
+
}} style={applyStyle({ backgroundColor: LibStyle.colorGreen })} />
|
|
425
|
+
:
|
|
426
|
+
<View style={applyStyle({ flex: 1, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 })} >
|
|
427
|
+
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 12, textAlign: "center", textAlignVertical: 'center', color: 'black', marginRight: 10, marginLeft: 10 })} >{esp.lang("event/artist_detail", "book_available", moment(startBooking).serverFormat("DD MMMM YYYY HH:mm:ss"))}</Text>
|
|
428
|
+
</View>
|
|
429
|
+
}
|
|
430
|
+
</View>
|
|
431
|
+
|
|
432
|
+
<LibSlidingup ref={showSchedule}>
|
|
433
|
+
<View style={applyStyle({ backgroundColor: 'white', borderTopRightRadius: 30, borderTopLeftRadius: 30, paddingTop: 15, maxHeight: LibStyle.height - (LibStyle.height / 3) })}>
|
|
434
|
+
<Text allowFontScaling={false} style={applyStyle({ marginBottom: 15, fontFamily: "Arial", fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, textAlign: "center", color: "#34495e" })}>{esp.lang("event/artist_detail", "select_date")}</Text>
|
|
435
|
+
<ScrollView showsVerticalScrollIndicator={false} >
|
|
436
|
+
{
|
|
437
|
+
priceList?.length > 0 && sortByStatus(priceList)?.map((item: any, i: number) => {
|
|
438
|
+
let filterFullData = priceList?.filter((it: any) => it.status != 0)
|
|
439
|
+
const displayedData = showAll[item.price_id] ? item?.list : item?.list.slice(0, maxDisplay);
|
|
440
|
+
|
|
441
|
+
let textOpacity = item?.status == 1 ? 1 : 0.3
|
|
442
|
+
let selTic = item.price_id == selectedTicket?.price_id
|
|
443
|
+
return (
|
|
444
|
+
<Pressable onPress={() => {
|
|
445
|
+
|
|
446
|
+
}} key={i} style={{ overflow: 'hidden', margin: 15, marginBottom: 5, backgroundColor: '#fff', borderRadius: 10, ...LibStyle.elevation(2), borderWidth: 1, borderColor: selTic ? LibStyle.colorBlue : LibStyle.colorBgGrey }}>
|
|
447
|
+
<View style={{ padding: 10, backgroundColor: '#f1f2f3', borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
|
|
448
|
+
<View style={{ alignContent: 'center', alignItems: 'center', flexDirection: 'row', justifyContent: 'space-between', }}>
|
|
449
|
+
<LibHtmltext allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.type}</LibHtmltext>
|
|
450
|
+
{
|
|
451
|
+
item.qty_min > 1 &&
|
|
452
|
+
<Text style={{ color: LibStyle.colorRed, fontSize: 10, fontWeight: 'normal' }}> {"(" + esp.lang("event/ticket_list", "min_order") + LibUtils.number(item.qty_min) + ")"}</Text>
|
|
453
|
+
}
|
|
454
|
+
{
|
|
455
|
+
item?.status != 1 &&
|
|
456
|
+
<View style={applyStyle({ flexDirection: 'row' })}>
|
|
457
|
+
<View style={applyStyle({ alignContent: 'center', alignItems: 'center', justifyContent: 'center', borderWidth: 1, backgroundColor: item?.status == 0 ? LibStyle.colorRed : "#4cd964", borderColor: item?.status == 0 ? LibStyle.colorRed : "#4cd964", borderRadius: 5, padding: 3, opacity: 0.8 })}>
|
|
458
|
+
<Text allowFontScaling={false} style={applyStyle({ fontSize: 10, fontStyle: "normal", letterSpacing: 0, color: /* item?.status == 2 ? "#000" : */ "#fff", fontWeight: 'bold' })}>{item?.status == 0 ? esp.lang("event/artist_detail", "sold_out") : esp.lang("event/artist_detail", "coming_soon")}</Text>
|
|
459
|
+
</View>
|
|
460
|
+
</View>
|
|
461
|
+
}
|
|
462
|
+
</View>
|
|
463
|
+
{
|
|
464
|
+
item.info != "" &&
|
|
465
|
+
<View style={{ marginTop: 3, alignContent: 'center', alignItems: 'center', flexDirection: 'row', marginRight: 5 }}>
|
|
466
|
+
<Text allowFontScaling={false} style={{ fontSize: 12, color: LibStyle.colorBlue }}>{item.info}</Text>
|
|
467
|
+
</View>
|
|
468
|
+
}
|
|
469
|
+
</View>
|
|
470
|
+
{
|
|
471
|
+
displayedData?.map((itemT: any, iT: number) => renderItem(item, itemT, iT))
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
{
|
|
475
|
+
filterFullData?.[i]?.list?.length > 3 &&
|
|
476
|
+
<TouchableOpacity onPress={() => {
|
|
477
|
+
handleShowAll(item.price_id)
|
|
478
|
+
}} style={{ borderTopColor: LibStyle.colorGrey, borderTopWidth: 0.8, flex: 1, padding: 8, flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
|
|
479
|
+
<Text allowFontScaling={false} style={{ marginRight: 5, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: LibStyle.colorBlue }}>{showAll[item.price_id] ? esp.lang("event/ticket_list", "see_less") : esp.lang("event/ticket_list", "see_more")}</Text>
|
|
480
|
+
<LibIcon name={showAll[item.price_id] ? 'chevron-up-circle-outline' : 'chevron-down-circle-outline'} color={LibStyle.colorBlue} size={18} />
|
|
481
|
+
</TouchableOpacity>
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
</Pressable>
|
|
485
|
+
)
|
|
486
|
+
})
|
|
487
|
+
}
|
|
488
|
+
</ScrollView>
|
|
489
|
+
<View style={applyStyle({ paddingVertical: 10 })} >
|
|
490
|
+
{
|
|
491
|
+
data?.price_type_info != "" &&
|
|
492
|
+
<Text allowFontScaling={false} style={applyStyle({ marginLeft: 15, marginBottom: 10, fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: LibStyle.colorBlue })} >{data?.hasOwnProperty("price_type_info") && data?.price_type_info}</Text>
|
|
493
|
+
}
|
|
494
|
+
{
|
|
495
|
+
data?.book_available == 1 ?
|
|
496
|
+
<>
|
|
497
|
+
{
|
|
498
|
+
data?.book_available == 0 && data.end_booking <= date && data.end_booking != '0000-00-00 00:00:00' ?
|
|
499
|
+
<View style={applyStyle({ flex: 1, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 })} >
|
|
500
|
+
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 12, textAlign: "center", textAlignVertical: 'center', color: 'black', marginHorizontal: 10 })} >{esp.lang("event/artist_detail", "booking_end")}</Text>
|
|
501
|
+
</View>
|
|
502
|
+
:
|
|
503
|
+
<EventButton label={esp.lang("event/artist_detail", "buy_ticket")} onPress={() => {
|
|
504
|
+
UserProfileProperty.isLogin(() => {
|
|
505
|
+
proceedToPayment()
|
|
506
|
+
})
|
|
507
|
+
}} style={{ backgroundColor: LibStyle.colorGreen, marginTop: 2, marginHorizontal: 15 }} />
|
|
508
|
+
}
|
|
509
|
+
</>
|
|
510
|
+
:
|
|
511
|
+
<View style={applyStyle({ flex: 1, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 })} >
|
|
512
|
+
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 12, textAlign: "center", textAlignVertical: 'center', color: 'black', marginHorizontal: 10 })} >{esp.lang("event/artist_detail", "booking_on", moment(data?.start_booking).serverFormat('DD MMMM YYYY HH:mm '))}</Text>
|
|
513
|
+
</View>
|
|
514
|
+
}
|
|
515
|
+
</View>
|
|
516
|
+
</View>
|
|
517
|
+
</LibSlidingup>
|
|
518
|
+
|
|
519
|
+
</View>
|
|
520
|
+
)
|
|
521
|
+
}
|