esoftplay-event 0.0.1 → 0.0.2

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.
Files changed (83) hide show
  1. package/event/artist.tsx +11 -7
  2. package/event/artist_detail.tsx +3 -5
  3. package/event/artist_detailv2.tsx +386 -0
  4. package/event/artistv2.tsx +162 -0
  5. package/event/button_order_detail.tsx +43 -0
  6. package/event/countdown_base.tsx +16 -3
  7. package/event/countdown_event.tsx +47 -0
  8. package/event/detail.tsx +30 -37
  9. package/event/detail2.tsx +354 -0
  10. package/event/exchange_ticket.tsx +1 -1
  11. package/event/exchange_ticket_list.tsx +2 -3
  12. package/event/exchange_ticket_result.tsx +1 -1
  13. package/event/firebase_socket.ts +8 -0
  14. package/event/loading_page.tsx +4 -2
  15. package/event/order.tsx +23 -36
  16. package/event/order_detail.tsx +119 -41
  17. package/event/order_detail_upgrade.tsx +8 -5
  18. package/event/order_detail_upgrade_payment.tsx +17 -11
  19. package/event/order_detail_visitor.tsx +33 -33
  20. package/event/order_detail_waiting.tsx +45 -20
  21. package/event/order_item.tsx +1 -1
  22. package/event/order_lottery.tsx +48 -36
  23. package/event/order_reschedule.tsx +50 -52
  24. package/event/order_share_to.tsx +11 -24
  25. package/event/order_share_to_detail.tsx +8 -3
  26. package/event/order_waiting.tsx +1 -1
  27. package/event/queue_pricing.tsx +16 -3
  28. package/event/refresh_button.tsx +3 -5
  29. package/event/scan_item.tsx +2 -2
  30. package/event/seat.tsx +19 -11
  31. package/event/seat_map_new.tsx +313 -0
  32. package/event/secure_page.debug.tsx +34 -0
  33. package/event/secure_page.live.tsx +35 -0
  34. package/event/secure_page.tsx +6 -5
  35. package/event/test.tsx +240 -155
  36. package/event/ticket_list.tsx +49 -21
  37. package/event/ticket_list2.tsx +83 -34
  38. package/event/tms_check_code.tsx +6 -0
  39. package/event/tms_check_ticket_result.tsx +36 -7
  40. package/event/tms_dashboard.tsx +85 -3
  41. package/event/tms_gate.tsx +6 -0
  42. package/event/tms_home.tsx +1 -4
  43. package/event/tms_in_failed.tsx +1 -1
  44. package/event/tms_in_log.tsx +2 -0
  45. package/event/tms_in_success.tsx +1 -1
  46. package/event/tms_log.tsx +10 -25
  47. package/event/tms_out.tsx +1 -1
  48. package/event/tms_out_failed.tsx +1 -1
  49. package/event/visitor_input.tsx +23 -5
  50. package/event/visitor_inputv2.tsx +397 -0
  51. package/event/voucher.tsx +2 -0
  52. package/event/voucher2.tsx +14 -6
  53. package/id.json +25 -9
  54. package/package.json +1 -1
  55. package/event/entrance.tsx +0 -215
  56. package/event/entrance_again.tsx +0 -199
  57. package/event/entrance_failed.tsx +0 -190
  58. package/event/entrance_idcard.tsx +0 -199
  59. package/event/entrance_list.tsx +0 -264
  60. package/event/entrance_list_item.tsx +0 -88
  61. package/event/entrance_log.tsx +0 -130
  62. package/event/entrance_success.tsx +0 -153
  63. package/event/entrance_warning.tsx +0 -91
  64. package/event/exit.tsx +0 -91
  65. package/event/exit_failed.tsx +0 -135
  66. package/event/exit_list.tsx +0 -118
  67. package/event/exit_log.tsx +0 -130
  68. package/event/exit_success.tsx +0 -143
  69. package/event/exit_temporary.tsx +0 -226
  70. package/event/firebase_socket.debug.ts +0 -260
  71. package/event/firebase_socket.live.ts +0 -335
  72. package/event/hall_in.tsx +0 -148
  73. package/event/hall_in_failed.tsx +0 -270
  74. package/event/hall_in_list.tsx +0 -222
  75. package/event/hall_in_log.tsx +0 -134
  76. package/event/hall_in_success.tsx +0 -132
  77. package/event/hall_out.tsx +0 -143
  78. package/event/hall_out_failed.tsx +0 -133
  79. package/event/hall_out_list.tsx +0 -215
  80. package/event/hall_out_log.tsx +0 -133
  81. package/event/hall_out_success.tsx +0 -130
  82. package/event/log.tsx +0 -433
  83. package/event/seat_map_test.tsx +0 -401
package/event/artist.tsx CHANGED
@@ -14,6 +14,7 @@ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
14
14
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
15
15
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
16
16
  import { LibUtils } from 'esoftplay/cache/lib/utils/import';
17
+ import { UserClass } from 'esoftplay/cache/user/class/import';
17
18
  import esp from 'esoftplay/esp';
18
19
  import moment from 'esoftplay/moment';
19
20
  import useSafeState from 'esoftplay/state';
@@ -36,15 +37,14 @@ export default function m(props: BigbangArtistProps): any {
36
37
 
37
38
  const { title, has_addition } = LibNavigation.getArgsAll(props)
38
39
  const url = LibNavigation.getArgs(props, 'url', 'event_artist')
39
- const regex = /(\d+)$/;
40
- const match = url.match(regex);
41
- const [event_id] = useSafeState(match?.[1])
42
40
 
43
41
  function loadData(): void {
44
42
  /* get detail event untuk dapat config antrian */
43
+
45
44
  new LibCurl(url, null,
46
45
  (res) => {
47
- new LibCurl(res?.[0]?.url_event || `event_detail/${event_id}`, null, (res) => {
46
+ esp.log({ res });
47
+ new LibCurl(res?.[0]?.url_event || `event_detail/${res?.[0]?.event_id}`, null, (res) => {
48
48
  setResultEvent(res)
49
49
  if (res?.id) {
50
50
  EventFirebase_socketProperty.eventIdQueue.set(res?.id)
@@ -66,7 +66,11 @@ export default function m(props: BigbangArtistProps): any {
66
66
  }
67
67
 
68
68
  useEffect(() => {
69
- loadData?.()
69
+ if (esp.isDebug("") && UserClass?.state()?.get()?.email == "bagus@fisip.net") {
70
+ LibNavigation.replace('event/artistv2')
71
+ } else {
72
+ loadData?.()
73
+ }
70
74
  }, [])
71
75
 
72
76
  const itemWidth = (LibStyle.width - 2)
@@ -95,8 +99,8 @@ export default function m(props: BigbangArtistProps): any {
95
99
  }
96
100
  if (item.book_available == 1) {
97
101
  if (isInPricingQueueConfig(item.event_id)) {
98
- LibNavigation.navigateForResult('event/queue_pricing', { event_id: event_id, autoPass: false }).then((v) => {
99
- EventCountdownProperty.countdownTime.set(moment().add(EventFirebase_socketProperty.eventQueueConfig.get(event_id).time, 'seconds').localeFormat('YYYY-MM-DD HH:mm:ss'))
102
+ LibNavigation.navigateForResult('event/queue_pricing', { event_id: item?.event_id, autoPass: false }).then((v) => {
103
+ EventCountdownProperty.countdownTime.set(moment().add(EventFirebase_socketProperty.eventQueueConfig.get(item?.event_id).time, 'seconds').localeFormat('YYYY-MM-DD HH:mm:ss'))
100
104
  if (item?.config?.hasOwnProperty('multiprice') && item?.config?.multiprice == 1) {
101
105
  LibNavigation.navigate('event/artist_detail_multi', {
102
106
  data: newItem,
@@ -135,13 +135,11 @@ export default function m(props: EventArtist_detailProps): any {
135
135
  subscribed: subscribed
136
136
  })
137
137
  } else {
138
- LibNavigation.navigateForResult('event/seat', {
138
+ LibNavigation.navigateForResult('event/seat_map_new', {
139
139
  url: 'event_seat',
140
140
  dataTicket: dataPost,
141
141
  }).then((value) => {
142
- dataPost.row_id = value.row_id
143
- dataPost.column_id = value.column_id
144
- dataPost.seat_name = value.seat_name
142
+ dataPost.seat_label = value.seat_label
145
143
 
146
144
  if (data?.has_addition && data?.has_addition == 1) {
147
145
  LibNavigation.navigateForResult('event/additional', { type_ticket: selectedTicket?.type, ondate: selectedTicket?.list?.ondate, event_id: data?.event_id, qty: qty, data: dataPost }, 221).then((additions) => {
@@ -174,7 +172,7 @@ export default function m(props: EventArtist_detailProps): any {
174
172
  })
175
173
  }
176
174
  } else {
177
- if (data?.has_addition && data?.has_addition == 1 || selectedTicket?.hasOwnProperty("has_addition") && selectedTicket?.has_addition == 1) {
175
+ if (selectedTicket?.hasOwnProperty("has_addition") && selectedTicket?.has_addition == 1) {
178
176
  LibNavigation.navigateForResult('event/additional', { type_ticket: selectedTicket?.type, ondate: selectedTicket?.list?.ondate, event_id: data?.event_id, qty: qty, data: dataPost, price_id: selectedTicket?.price_id }, 221).then((additions) => {
179
177
  if (additions != "") {
180
178
  dataPost.addition = additions
@@ -0,0 +1,386 @@
1
+ // withHooks
2
+ import { useEffect } from 'react';
3
+
4
+ import { applyStyle } from 'esoftplay';
5
+ import { EventButton } from 'esoftplay/cache/event/button/import';
6
+ import { EventHeader } from 'esoftplay/cache/event/header/import';
7
+ import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
8
+ import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
9
+ import { EventShare } from 'esoftplay/cache/event/share/import';
10
+ import { LibCarrousel } from 'esoftplay/cache/lib/carrousel/import';
11
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
12
+ import { LibIcon } from 'esoftplay/cache/lib/icon/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 { LibProgress } from 'esoftplay/cache/lib/progress/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 esp from 'esoftplay/esp';
24
+ import useSafeState from 'esoftplay/state';
25
+ import React from 'react';
26
+ import { Pressable, RefreshControl, ScrollView, Text, TouchableOpacity, View } from 'react-native';
27
+
28
+
29
+ export interface EventArtist_detailv2Args {
30
+
31
+ }
32
+ export interface EventArtist_detailv2Props {
33
+
34
+ }
35
+ export default function m(props: EventArtist_detailv2Props): any {
36
+ const { url, subscribed } = LibNavigation.getArgsAll(props)
37
+ const [priceList, setPriceList] = useSafeState<any>()
38
+ const [detailArtist, setDetailArtist] = useSafeState<any>()
39
+
40
+ let showSchedule = React.useRef<LibSlidingup>(null)
41
+ const [selectedTicket, setSelectedTicket, getSelectedTicket] = useSafeState<any>()
42
+ const [showAll, setShowAll] = useSafeState<any>({});
43
+ const [qty, setQty] = useSafeState<any>(1)
44
+ const [refreshing, setRefreshing] = useSafeState<boolean>(false);
45
+
46
+ useEffect(() => {
47
+ loadDataArtist()
48
+ }, [])
49
+
50
+ esp.log({ priceList, detailArtist });
51
+
52
+ function loadDataArtist(): void {
53
+ new LibCurl(url, null, (res) => {
54
+ setRefreshing(false)
55
+ setDetailArtist(res)
56
+ loadDataPrice(res?.url_price)
57
+ }, (err) => {
58
+ setRefreshing(false)
59
+ LibToastProperty.show(err?.message)
60
+ LibNavigation.back()
61
+ }, 1)
62
+ }
63
+
64
+ function loadDataPrice(url: string) {
65
+ new LibCurl(url, null, (res, msg) => {
66
+
67
+ const updatedData = res?.map((item: any) => ({
68
+ ...item,
69
+ list: item?.list?.map((itemList: any) => ({
70
+ ...itemList,
71
+ index_id: item?.price_id + "-" + itemList?.ondate
72
+ }))
73
+ }));
74
+
75
+ setPriceList(updatedData)
76
+ }, (err) => {
77
+ LibToastProperty.show(err?.message)
78
+ LibNavigation.back()
79
+ }, 1)
80
+ }
81
+
82
+ function loadDataPriceConfig(url: string) {
83
+ let post = {
84
+ price_ids: selectedTicket?.price_id,
85
+ event_id: 443
86
+ }
87
+ LibProgress.show("Mohon tunggu")
88
+ new LibCurl(url, post, (res, msg) => {
89
+ esp.log({ res, url });
90
+ LibProgress.hide()
91
+ }, (err) => {
92
+ LibProgress.hide()
93
+ LibToastProperty.show(err?.message)
94
+
95
+ }, 1)
96
+ }
97
+
98
+ const maxDisplay = 3;
99
+ const handleShowAll = (price_id: any) => {
100
+ setShowAll((prevShowAll: any) => ({
101
+ ...prevShowAll,
102
+ [price_id]: !prevShowAll[price_id],
103
+ }));
104
+ };
105
+
106
+
107
+ function add(): void {
108
+ let hasQuota = getSelectedTicket().quota > 0
109
+ const min = hasQuota ? Number(getSelectedTicket()?.quota) - Number(getSelectedTicket()?.quota_used) : Number(getSelectedTicket()?.qty_max)
110
+ if (qty < Math.min(min, Number(getSelectedTicket()?.qty_max))) {
111
+ setQty(Number(qty) + 1)
112
+ }
113
+ }
114
+
115
+ function min(): void {
116
+ if (qty <= getSelectedTicket()?.qty_min) {
117
+ setQty(Number(getSelectedTicket()?.qty_min))
118
+ } else {
119
+ setQty(qty == 1 ? 1 : qty - 1)
120
+ }
121
+ }
122
+
123
+ function onRefresh() {
124
+ setRefreshing(true)
125
+ loadDataArtist()
126
+ }
127
+
128
+ function renderItem(item: any, itemT: any, iT: number) {
129
+ let ticketWithDate = item.price_date == 1 && item.use_code == 0
130
+ let ticketSpecial = item.price_date == 0 && item.use_code == 0
131
+
132
+ let _selectedTicket = item.price_id == selectedTicket?.price_id && itemT.index_id == selectedTicket?.list?.index_id
133
+
134
+ let colorDefault = _selectedTicket ? "#FFE9AD" : '#fff'
135
+ let colorBackground = item?.status != 1 ? LibStyle.colorLightGrey : itemT?.status != 1 ? LibStyle.colorLightGrey : colorDefault
136
+ let textOpacity = /* item?.status == 1 ? 1 : */ itemT?.status == 1 ? 1 : 0.3
137
+
138
+ return (
139
+ <TouchableOpacity
140
+ onPress={() => {
141
+ let itemTicket = {
142
+ ...item
143
+ }
144
+ let replaceList = LibObject.set(itemTicket, itemT)('list')
145
+ let msg = itemT?.status == 0 ? esp.lang("event/artist_detail", "sold_out") : esp.lang("event/artist_detail", "coming_soon")
146
+
147
+ // kondisi untuk tipe tiket yang ada tanggalnya
148
+ if (item?.status == 1 && itemT?.status == 1) {
149
+ setSelectedTicket(replaceList)
150
+ setQty(item.qty_min)
151
+ } else if (item?.status == 0) {
152
+ LibToastProperty.show(msg)
153
+ } else if (item?.status == 2) {
154
+ LibToastProperty.show(msg)
155
+ }
156
+ }} activeOpacity={itemT?.status == 1 ? 0 : 1} key={iT} style={{ flex: 1, flexDirection: 'row', backgroundColor: colorBackground, justifyContent: 'space-between', padding: 10, alignItems: 'center' }}>
157
+ {
158
+ itemT.ondate == "0000-00-00" ?
159
+ <LibPicture source={esp.assets('icons/ic_special2.png')} style={{ height: 42, width: 42 }} />
160
+ :
161
+ <>
162
+ <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' })}>
163
+ <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>
164
+ </View>
165
+ <View style={applyStyle({ flexDirection: 'column', flex: 1 })}>
166
+ {
167
+ item?.status == 1 && itemT?.status != 1 &&
168
+ <View style={applyStyle({ flexDirection: 'row', marginBottom: 5 })}>
169
+ <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 })}>
170
+ <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>
171
+ </View>
172
+ </View>
173
+ }
174
+ <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>
175
+ <View style={applyStyle({ flexDirection: 'row' })}>
176
+ <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>
177
+ <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>
178
+ </View>
179
+ </View>
180
+ </>
181
+ }
182
+
183
+ <View style={applyStyle({ marginRight: 5, marginLeft: 5, flexDirection: 'column' })} >
184
+ {
185
+ (itemT?.status == 1 || itemT?.status == 0) &&
186
+ <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>
187
+ }
188
+ {
189
+ item?.status == 1 && (ticketWithDate || ticketSpecial) && _selectedTicket &&
190
+ <View style={applyStyle({ marginTop: 4, flexDirection: 'row', marginLeft: 8, alignContent: 'center', alignItems: 'center' })}>
191
+ <TouchableOpacity onPress={() => { min() }}>
192
+ <View style={applyStyle({ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
193
+ <LibIcon name="minus" color="#e74c3c" />
194
+ </View>
195
+ </TouchableOpacity>
196
+ <Text style={applyStyle({ fontFamily: "Arial", fontSize: 20, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#9b9b9b", marginLeft: 13, marginRight: 13 })}>{qty}</Text>
197
+ <TouchableOpacity onPress={() => { add() }}>
198
+ <View style={applyStyle({ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
199
+ <LibIcon name="plus" color="#16a085" />
200
+ </View>
201
+ </TouchableOpacity>
202
+ </View>
203
+ }
204
+ </View>
205
+ </TouchableOpacity>
206
+ )
207
+ }
208
+
209
+ const bgHeight = LibStyle.width * 9 / 16
210
+
211
+ function renderImages(item: any, i: number) {
212
+ const styleId_Z1ecB7O: any = { height: bgHeight, width: LibStyle.width, resizeMode: 'cover' }
213
+ return (
214
+ <TouchableOpacity key={i} onPress={() => LibNavigation.navigate('lib/gallery', { images: detailArtist?.images, index: i })}>
215
+ <LibPicture source={{ uri: item.image }} style={styleId_Z1ecB7O} />
216
+ </TouchableOpacity>
217
+ )
218
+ }
219
+
220
+ let share = [
221
+ {
222
+ icon: 'icons/ic_facebook.png',
223
+ title: 'Facebook',
224
+ onPress: () => { EventShare.facebook(url) }
225
+ },
226
+ {
227
+ icon: 'icons/ic_whatsapp.png',
228
+ title: 'Whatsapp',
229
+ onPress: () => { EventShare.whatsapp(url) }
230
+ },
231
+ {
232
+ icon: 'icons/ic_twitter.png',
233
+ title: 'Twitter',
234
+ onPress: () => { EventShare.twitter(url) }
235
+ },
236
+ {
237
+ icon: 'icons/ic_copy.png',
238
+ title: esp.lang("event/artist_detail", "copy"),
239
+ onPress: () => {
240
+ LibUtils.copyToClipboard(url).then((v) => {
241
+ LibToastProperty.show(esp.lang("event/artist_detail", "alert"))
242
+ })
243
+ }
244
+ },
245
+ ]
246
+
247
+ function renderShare(item: any, i: number) {
248
+ return (
249
+ <View key={i} style={applyStyle({ marginRight: 10 })}>
250
+ <TouchableOpacity onPress={item.onPress} >
251
+ <LibPicture style={applyStyle({ resizeMode: 'contain', height: 25, width: 25, borderRadius: 12.5, backgroundColor: 'white' })} source={esp.assets(item.icon)} />
252
+ </TouchableOpacity>
253
+ </View>
254
+ )
255
+ }
256
+
257
+ return (
258
+ <View style={{ flex: 1 }}>
259
+ <EventHeader title={esp.lang("event/artist_detail", "title")} subtitle={detailArtist?.name} />
260
+ <ScrollView refreshControl={
261
+ <RefreshControl refreshing={refreshing} onRefresh={onRefresh} />
262
+ }>
263
+
264
+ {
265
+ detailArtist?.images && detailArtist?.images?.length > 0 ?
266
+ <LibCarrousel
267
+ delay={3000}
268
+ style={{ height: bgHeight, width: LibStyle.width }}
269
+ autoplay
270
+ bullets
271
+ bulletStyle={{ width: 7, height: 7, backgroundColor: "#fff", borderRadius: 3.5, borderWidth: 0, marginHorizontal: 2 }}
272
+ chosenBulletStyle={{ width: 7, height: 7, backgroundColor: "#f4e31b", borderRadius: 3.5, borderWidth: 0, marginHorizontal: 2 }}
273
+ bulletsContainerStyle={{ marginBottom: -10 }}>
274
+ {
275
+ detailArtist?.images && detailArtist?.images?.map(renderImages)
276
+ }
277
+ </LibCarrousel>
278
+ :
279
+ <Pressable onPress={() => LibNavigation.navigate('lib/gallery', { image: detailArtist?.image })} >
280
+ <LibPicture
281
+ style={applyStyle({ height: LibStyle.width * 9 / 16, width: LibStyle.width, backgroundColor: '#f2f3f4' })}
282
+ source={{ uri: detailArtist?.image }} />
283
+ </Pressable>
284
+ }
285
+ <View style={applyStyle({ marginTop: 10, marginLeft: 17, flexDirection: 'row' })}>
286
+ {
287
+ share.map(renderShare)
288
+ }
289
+ </View>
290
+ <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" })}>{detailArtist?.name}</Text>
291
+ {
292
+ detailArtist?.description != "" &&
293
+ <ScrollView>
294
+ <LibWebview onFinishLoad={() => { }} source={{ html: detailArtist?.description }} />
295
+ </ScrollView>
296
+ }
297
+ {
298
+ detailArtist?.video != "" &&
299
+ <>
300
+ <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>
301
+ <TouchableOpacity onPress={() => LibNavigation.navigate('lib/video', { code: detailArtist?.video })} >
302
+ <LibPicture source={{ uri: LibVideoProperty.getUrlThumbnail(detailArtist?.video) }} style={applyStyle({ height: LibStyle.width * 9 / 16, width: LibStyle.width - 40, marginHorizontal: 20, resizeMode: 'cover' })} />
303
+ </TouchableOpacity>
304
+ </>
305
+ }
306
+
307
+
308
+ </ScrollView>
309
+ <View style={{ flexDirection: 'row', padding: 10, backgroundColor: 'white' }} >
310
+ <EventButton label={esp.lang("event/artist_detail", "buy_ticket")} onPress={() => {
311
+ EventIndexProperty.isLogin(() => {
312
+ showSchedule.current?.show()
313
+ })
314
+ }} style={{ backgroundColor: LibStyle.colorGreen }} />
315
+ </View>
316
+
317
+ <LibSlidingup ref={showSchedule}>
318
+ <View style={applyStyle({ backgroundColor: 'white', borderTopRightRadius: 30, borderTopLeftRadius: 30, paddingTop: 15, maxHeight: LibStyle.height - (LibStyle.height / 3) })}>
319
+ <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>
320
+ <ScrollView showsVerticalScrollIndicator={false} >
321
+ {
322
+ priceList?.map((item: any, i: number) => {
323
+ let filterFullData = priceList?.filter((it: any) => it.status != 0)
324
+ const displayedData = showAll[item.price_id] ? item?.list : item?.list.slice(0, maxDisplay);
325
+ let textOpacity = item?.status == 1 ? 1 : 0.3
326
+ let selTic = item.price_id == selectedTicket?.price_id
327
+ return (
328
+ <View key={i} style={{ overflow: 'hidden', margin: 15, marginBottom: 5, backgroundColor: '#fff', borderRadius: 10, ...LibStyle.elevation(2), borderWidth: 1, borderColor: selTic ? LibStyle.colorBlue : LibStyle.colorBgGrey }}>
329
+ <View style={{ padding: 10, backgroundColor: '#f1f2f3', borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
330
+ <View style={{ alignContent: 'center', alignItems: 'center', flexDirection: 'row', justifyContent: 'space-between', }}>
331
+ <EventHtmltext allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.name}</EventHtmltext>
332
+ {
333
+ item.qty_min > 1 &&
334
+ <Text style={{ color: LibStyle.colorRed, fontSize: 10, fontWeight: 'normal' }}> {"(" + esp.lang("event/ticket_list", "min_order") + LibUtils.number(item.qty_min) + ")"}</Text>
335
+ }
336
+ {
337
+ item?.status != 1 &&
338
+ <View style={applyStyle({ flexDirection: 'row' })}>
339
+ <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 })}>
340
+ <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>
341
+ </View>
342
+ </View>
343
+ }
344
+ </View>
345
+ {
346
+ item.hasOwnProperty("price_type_info") && item.price_type_info != "" &&
347
+ <View style={{ marginTop: 3, alignContent: 'center', alignItems: 'center', flexDirection: 'row', marginRight: 5 }}>
348
+ <Text allowFontScaling={false} style={{ fontSize: 12, color: LibStyle.colorBlue }}>{item.price_type_info}</Text>
349
+ </View>
350
+ }
351
+ </View>
352
+
353
+ {
354
+ displayedData?.map((itemT: any, iT: number) => renderItem(item, itemT, iT))
355
+ }
356
+ {
357
+ filterFullData?.[i]?.list?.length > 3 &&
358
+ <TouchableOpacity onPress={() => {
359
+ handleShowAll(item.price_id)
360
+ }} style={{ borderTopColor: LibStyle.colorGrey, borderTopWidth: 0.8, flex: 1, padding: 8, flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
361
+ <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>
362
+ <LibIcon name={showAll[item.price_id] ? 'chevron-up-circle-outline' : 'chevron-down-circle-outline'} color={LibStyle.colorBlue} size={18} />
363
+ </TouchableOpacity>
364
+ }
365
+
366
+ </View>
367
+ )
368
+ })
369
+ }
370
+ </ScrollView>
371
+ <View style={applyStyle({ paddingVertical: 10 })} >
372
+ <EventButton label={esp.lang("event/artist_detail", "buy_ticket")} onPress={() => {
373
+ EventIndexProperty.isLogin(() => {
374
+ if (selectedTicket) {
375
+ loadDataPriceConfig(selectedTicket?.url_config)
376
+ }
377
+ // proceedToPayment()
378
+ })
379
+ }} style={{ backgroundColor: LibStyle.colorGreen, marginTop: 2, marginHorizontal: 15 }} />
380
+ </View>
381
+ </View>
382
+ </LibSlidingup>
383
+
384
+ </View>
385
+ )
386
+ }
@@ -0,0 +1,162 @@
1
+ // withHooks
2
+
3
+ import { EventFirebase_socket } from 'esoftplay/cache/event/firebase_socket/import';
4
+ import { EventHeader } from 'esoftplay/cache/event/header/import';
5
+ import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
6
+ import { EventMessage } from 'esoftplay/cache/event/message/import';
7
+ import { LibCarrousel } from 'esoftplay/cache/lib/carrousel/import';
8
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
9
+ import { LibList } from 'esoftplay/cache/lib/list/import';
10
+ import { LibLoading } from 'esoftplay/cache/lib/loading/import';
11
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
12
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
13
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
14
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
15
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
16
+ import esp from 'esoftplay/esp';
17
+ import moment from 'esoftplay/moment';
18
+ import useSafeState from 'esoftplay/state';
19
+ import React, { useEffect } from 'react';
20
+ import { Text, TouchableOpacity, View } from 'react-native';
21
+
22
+
23
+ moment().locale('id')
24
+
25
+
26
+ export interface EventArtistv2Props {
27
+
28
+ }
29
+
30
+ export default function m(props: EventArtistv2Props): any {
31
+ const [result, setResult] = useSafeState<any>()
32
+ const [error, setError] = useSafeState<any>('')
33
+ const { isInPricingQueueConfig } = EventFirebase_socket()
34
+
35
+ const { title, has_addition } = LibNavigation.getArgsAll(props)
36
+ const url = LibNavigation.getArgs(props, 'url', 'https://storage.googleapis.com/bbo-test-images/images/modules/api/event_artist/411.json')
37
+
38
+ function loadData(): void {
39
+ /* get detail event untuk dapat config antrian */
40
+
41
+ // new LibCurl(url, null,
42
+ new LibCurl('v2/event_artist&event_id=443', null,
43
+ (res) => {
44
+ esp.log({ res });
45
+ // EventFirebase_socketProperty.eventIdQueue.set(res?.[0]?.event_id)
46
+ // if (res.allotment) {
47
+ // esp.modProp("event/firebase_socket").userIdKeyReplacer.set({
48
+ // t: Number(res.allotment.t),
49
+ // s: Number(res.allotment.s),
50
+ // priority: 1
51
+ // })
52
+ // }
53
+
54
+ setResult(res)
55
+ }, (err) => {
56
+ setError(err?.message)
57
+ }, 1)
58
+ }
59
+
60
+ useEffect(() => {
61
+ loadData?.()
62
+ }, [])
63
+
64
+ const itemWidth = (LibStyle.width - 2)
65
+ const itemHeight = itemWidth * 9 / 16
66
+
67
+ let subs = {
68
+ is_subscribed: result?.config?.is_subscribed,
69
+ is_subscribed_default: result?.config?.is_subscribed_default,
70
+ is_subscribed_label: result?.config?.is_subscribed_label
71
+ }
72
+ const width = LibStyle?.width
73
+ const sliderHeight = 0.50 * width
74
+
75
+ function renderIt(item: any, i: number) {
76
+ const styleId_Z2g4Hs7: any = { backgroundColor: '#FFC523', width: itemWidth, height: itemHeight, margin: 0.5, justifyContent: 'center', alignItems: 'center' }
77
+ let isNotAvailable = item?.status_error != ""
78
+ const handlePress = () => {
79
+ if (isNotAvailable) {
80
+ LibToastProperty.show(esp.lang("event/artist", "ticket_not_available"));
81
+ } else {
82
+ EventIndexProperty.isLogin(async () => {
83
+ // if (isInPricingQueueConfig(item.event_id)) {
84
+ // LibNavigation.navigateForResult('event/queue_pricing', {
85
+ // event_id: item?.event_id,
86
+ // autoPass: false,
87
+ // });
88
+ // }
89
+ // EventCountdownProperty.countdownTime.set(moment().add(EventFirebase_socketProperty.eventQueueConfig.get(item?.event_id).time, 'seconds').localeFormat('YYYY-MM-DD HH:mm:ss'));
90
+ LibNavigation.navigate(
91
+ item?.config?.multiprice == 1
92
+ ? 'event/artist_detail_multi'
93
+ :
94
+ 'event/artist_detailv2',
95
+ { url: item.url, subscribed: subs }
96
+ );
97
+ });
98
+ }
99
+ };
100
+
101
+ if (item?.images?.length > 1) {
102
+ return (
103
+ <LibCarrousel
104
+ key={i}
105
+ delay={4000}
106
+ style={{ height: sliderHeight, width: width }}
107
+ autoplay
108
+ >
109
+ {
110
+ item?.images?.map((item1: any, ii: number) => {
111
+ return (
112
+ <TouchableOpacity key={ii} onPress={handlePress} >
113
+ <LibPicture key={ii} source={{ uri: item1 }} style={{ opacity: isNotAvailable ? 0.3 : 1, height: sliderHeight, width: width, resizeMode: 'cover', backgroundColor: "#f1f2f3" }} />
114
+ </TouchableOpacity>
115
+ )
116
+ })
117
+ }
118
+ </LibCarrousel>
119
+ )
120
+ } else if (item?.images?.length == 1) {
121
+ return (
122
+ <TouchableOpacity key={i} onPress={handlePress} >
123
+ <LibPicture style={{opacity: isNotAvailable ? 0.3 : 1, height: sliderHeight, width: width, resizeMode: 'cover', backgroundColor: "#f1f2f3" }} source={{ uri: item.images[0] }} />
124
+ </TouchableOpacity>
125
+ )
126
+ } else {
127
+ return (
128
+ <TouchableOpacity key={i} onPress={handlePress} style={styleId_Z2g4Hs7}>
129
+ <Text allowFontScaling={false} numberOfLines={2} style={styleId_2cYE4h}>{item.title}</Text>
130
+ </TouchableOpacity>
131
+ )
132
+ }
133
+ }
134
+
135
+ return (
136
+ <View style={{ flex: 1, backgroundColor: 'white' }} >
137
+ <EventHeader title={title ? title : result?.name} iconShare={result?.url_share_artist && result?.url_share_artist !== ""}
138
+ onPressShare={() => {
139
+ LibUtils.share(result?.url_share_artist)
140
+ }} />
141
+ {
142
+ !result && !error ? <LibLoading /> :
143
+ // <ScrollView>
144
+ // {
145
+ // result?.map(renderIt)
146
+ // }
147
+ // </ScrollView>
148
+ <LibList
149
+ data={result?.list}
150
+ // keyExtractor={(item) => item.id}
151
+ onRefresh={loadData}
152
+ staticHeight={itemHeight + 1}
153
+ renderItem={renderIt}
154
+ ListEmptyComponent={
155
+ <EventMessage message={error} />
156
+ }
157
+ />
158
+ }
159
+ </View>
160
+ )
161
+ }
162
+ const styleId_2cYE4h: any = { padding: 15, color: 'white', fontSize: 24 }
@@ -0,0 +1,43 @@
1
+ // withHooks
2
+
3
+ import { EventOrder_itemProperty } from 'esoftplay/cache/event/order_item/import';
4
+ import { LibGradient } from 'esoftplay/cache/lib/gradient/import';
5
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
6
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
7
+ import React from 'react';
8
+ import { Text, TouchableOpacity, View } from 'react-native';
9
+
10
+
11
+ export interface EventButton_order_detailArgs {
12
+
13
+ }
14
+ export interface EventButton_order_detailProps {
15
+ onPress: () => void
16
+ title: string
17
+ info?: string
18
+ color: any,
19
+ icon: any
20
+ }
21
+ export default function m(props: EventButton_order_detailProps): any {
22
+ return (
23
+ <TouchableOpacity onPress={props.onPress}>
24
+ <View style={{ borderWidth: 1, borderColor: '#ccc', margin: 15, borderRadius: 7, marginBottom: 0, overflow: 'hidden', flexDirection: 'row' }}>
25
+ <LibGradient
26
+ colors={[props.color, props.color, "#f1f2f3",]}
27
+ direction='left-to-right'
28
+ style={{ margin: 3, borderRadius: 5, padding: 7, flex: 4, alignContent: 'center', justifyContent: 'center' }}
29
+ >
30
+ <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode='tail' style={{ color: EventOrder_itemProperty.textColor(props?.color), fontSize: 16, fontWeight: 'bold' }}>{props.title}</Text>
31
+ {
32
+ props.info != "" &&
33
+ <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode='tail' style={{ color: EventOrder_itemProperty.textColor(props?.color), fontSize: 12, fontWeight: 'normal' }}>{props?.info}</Text>
34
+ }
35
+ </LibGradient>
36
+ <View style={{ flex: 1, margin: 3, borderRadius: 5, ...LibStyle.elevation(2), backgroundColor: props.color, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
37
+ {/* <LibIcon name={"dice-multiple"} size={40} color={EventOrder_itemProperty.textColor(props.color)} style={{ opacity: 1 }} /> */}
38
+ <LibIcon name={props.icon} size={40} color={EventOrder_itemProperty.textColor(props.color)} style={{ opacity: 1 }} />
39
+ </View>
40
+ </View>
41
+ </TouchableOpacity>
42
+ )
43
+ }