esoftplay-event 0.0.2 → 0.0.3

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 (100) hide show
  1. package/event/additional.tsx +1 -1
  2. package/event/additional_input.tsx +15 -0
  3. package/event/additional_new.tsx +565 -0
  4. package/event/artist.tsx +14 -34
  5. package/event/artist_detail.tsx +336 -239
  6. package/event/artist_detail_multi.tsx +266 -157
  7. package/event/artist_detailv2.tsx +129 -69
  8. package/event/artistv2.tsx +5 -13
  9. package/event/button.tsx +2 -2
  10. package/event/button_order_detail.tsx +20 -8
  11. package/event/capture.tsx +2 -0
  12. package/event/checkout.ts +135 -0
  13. package/event/countdown.tsx +13 -9
  14. package/event/countdown_base.tsx +88 -48
  15. package/event/countdown_event.tsx +3 -0
  16. package/event/countdown_timestamp.tsx +106 -0
  17. package/event/coupon.tsx +1 -1
  18. package/event/coupon_generate.tsx +35 -22
  19. package/event/detail.tsx +9 -15
  20. package/event/detail2.tsx +63 -61
  21. package/event/dialog_custom.tsx +67 -0
  22. package/event/exchange_ticket_list.tsx +23 -14
  23. package/event/exchange_ticket_result.tsx +1 -1
  24. package/event/firebase_socket.ts +14 -12
  25. package/event/htmltext.tsx +40 -28
  26. package/event/index.tsx +8 -2
  27. package/event/label_input.tsx +2 -2
  28. package/event/layout.tsx +312 -0
  29. package/event/loading_page.tsx +62 -82
  30. package/event/message.tsx +2 -2
  31. package/event/order_detail.tsx +408 -477
  32. package/event/order_detail_addons.tsx +60 -0
  33. package/event/order_detail_addons_booked.tsx +61 -0
  34. package/event/order_detail_coupon.tsx +66 -0
  35. package/event/order_detail_instruction.tsx +96 -0
  36. package/event/order_detail_payment.tsx +1 -1
  37. package/event/order_detail_reschedule.tsx +109 -0
  38. package/event/order_detail_return.tsx +231 -0
  39. package/event/order_detail_review.tsx +174 -0
  40. package/event/order_detail_share.tsx +304 -0
  41. package/event/order_detail_tnc.tsx +76 -0
  42. package/event/order_detail_upgrade.tsx +140 -90
  43. package/event/order_detail_upgrade_payment.tsx +120 -38
  44. package/event/order_detail_visitor.tsx +21 -10
  45. package/event/order_detail_waiting.tsx +3 -3
  46. package/event/order_history.tsx +1 -1
  47. package/event/order_item.tsx +1 -1
  48. package/event/order_lottery.tsx +1 -1
  49. package/event/order_reschedule.tsx +29 -16
  50. package/event/order_share_to.tsx +14 -0
  51. package/event/order_waiting.tsx +1 -1
  52. package/event/payment_subscribe.tsx +18 -0
  53. package/event/point_events.tsx +35 -0
  54. package/event/point_redemption.tsx +101 -0
  55. package/event/point_redemption_exchange.tsx +60 -0
  56. package/event/point_redemption_input.tsx +56 -0
  57. package/event/point_redemption_success.tsx +50 -0
  58. package/event/point_summary.tsx +48 -0
  59. package/event/popup.tsx +4 -4
  60. package/event/queue.tsx +111 -0
  61. package/event/queue_pricing.tsx +17 -6
  62. package/event/review_add.tsx +2 -2
  63. package/event/scan_item.tsx +1 -1
  64. package/event/schedule.tsx +33 -30
  65. package/event/schedule2.tsx +86 -0
  66. package/event/seat.tsx +135 -374
  67. package/event/seat_map.tsx +8 -8
  68. package/event/seat_map_new.tsx +211 -38
  69. package/event/step.tsx +1 -1
  70. package/event/test.tsx +8 -8
  71. package/event/ticket.tsx +326 -0
  72. package/event/ticket_list.tsx +316 -258
  73. package/event/ticket_list2.tsx +349 -224
  74. package/event/ticket_list_item.tsx +61 -0
  75. package/event/ticket_list_new.tsx +710 -0
  76. package/event/tms_add_result.tsx +10 -5
  77. package/event/tms_check_ticket_result.tsx +16 -7
  78. package/event/tms_dashboard.tsx +87 -12
  79. package/event/tms_gate.tsx +32 -15
  80. package/event/tms_home.tsx +178 -92
  81. package/event/tms_idcard.tsx +43 -26
  82. package/event/tms_in.tsx +2 -3
  83. package/event/tms_in_failed.tsx +1 -1
  84. package/event/tms_in_hall.tsx +4 -1
  85. package/event/tms_in_hall_failed.tsx +36 -16
  86. package/event/tms_in_log.tsx +9 -11
  87. package/event/tms_in_success.tsx +13 -8
  88. package/event/tms_log.tsx +16 -17
  89. package/event/tms_out_hall_failed.tsx +1 -1
  90. package/event/tms_out_temporary.tsx +3 -4
  91. package/event/token_order.tsx +103 -0
  92. package/event/token_payment.tsx +79 -0
  93. package/event/visitor_index.tsx +60 -49
  94. package/event/visitor_input.tsx +336 -54
  95. package/event/visitor_inputv2.tsx +173 -88
  96. package/event/voucher.tsx +1 -1
  97. package/id.json +76 -4
  98. package/package.json +1 -1
  99. package/event/secure_page.debug.tsx +0 -34
  100. package/event/secure_page.live.tsx +0 -35
@@ -1,11 +1,13 @@
1
1
  // withHooks
2
2
 
3
3
  import { applyStyle } from 'esoftplay';
4
+ import { EventAlert } from 'esoftplay/cache/event/alert/import';
4
5
  import { EventButton } from 'esoftplay/cache/event/button/import';
5
6
  import { EventConfigProperty } from 'esoftplay/cache/event/config/import';
6
- import { EventCountdownProperty } from 'esoftplay/cache/event/countdown/import';
7
7
  import { EventHeader } from 'esoftplay/cache/event/header/import';
8
8
  import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
9
+ import { EventOrder_itemProperty } from 'esoftplay/cache/event/order_item/import';
10
+ import { EventQueue } from 'esoftplay/cache/event/queue/import';
9
11
  import { EventShare } from 'esoftplay/cache/event/share/import';
10
12
  import { LibCarrousel } from 'esoftplay/cache/lib/carrousel/import';
11
13
  import { LibCurl } from 'esoftplay/cache/lib/curl/import';
@@ -14,6 +16,7 @@ import { LibLoading } from 'esoftplay/cache/lib/loading/import';
14
16
  import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
15
17
  import { LibObject } from 'esoftplay/cache/lib/object/import';
16
18
  import { LibPicture } from 'esoftplay/cache/lib/picture/import';
19
+ import { LibScroll } from 'esoftplay/cache/lib/scroll/import';
17
20
  import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
18
21
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
19
22
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
@@ -26,7 +29,7 @@ import useLazyState from 'esoftplay/lazy';
26
29
  import moment from 'esoftplay/moment';
27
30
  import useSafeState from 'esoftplay/state';
28
31
  import React, { useEffect } from 'react';
29
- import { Pressable, ScrollView, Text, TouchableOpacity, View } from 'react-native';
32
+ import { ActivityIndicator, Pressable, ScrollView, Text, TouchableOpacity, View } from 'react-native';
30
33
 
31
34
 
32
35
  export interface EventArtist_detail_multiProps {
@@ -75,29 +78,45 @@ const taskAdditional = UseTasks()
75
78
  export default function m(props: EventArtist_detail_multiProps): any {
76
79
  moment().locale('id')
77
80
  let showSchedule = React.useRef<LibSlidingup>(null)
78
- const { data, subscribed } = LibNavigation.getArgsAll(props)
79
- const startBooking = moment(data?.start_booking).serverFormat('YYYY-MM-DD HH:mm:ss')
81
+ const { url, data, subscribed } = LibNavigation.getArgsAll(props)
82
+ const [result, setResult, getResult] = useLazyState<any>(data)
83
+ const [startBooking, setStartBooking] = useLazyState(moment(getResult()?.start_booking).serverFormat('YYYY-MM-DD HH:mm:ss'))
80
84
  const date = moment().localeFormat('YYYY-MM-DD HH:mm:ss')
81
85
 
82
86
  const [priceList, setPriceList, getPriceList] = useSafeState<PriceList>()
83
87
  const [, setDataPostBooking, getDataPostBooking] = useLazyState<any>([])
84
88
  const [dataAddition, setDataAddition] = useSafeState<any>([])
85
89
  const [showAll, setShowAll] = useSafeState<any>({});
90
+ const [loading, setLoading] = useSafeState<boolean>(false)
86
91
 
87
92
 
88
93
  useEffect(() => {
89
94
  EventConfigProperty.curlConfig('v2/config_order_type')
90
- loadDataPrice()
91
- return () => { EventCountdownProperty.releaseQueue.trigger() }
95
+ loadResult()
92
96
  }, [])
93
97
 
98
+ function loadResult() {
99
+ if (!url) {
100
+ loadDataPrice(getResult()?.price_list_url)
101
+ } else {
102
+ new LibCurl(url, null, (res, msg) => {
103
+ loadDataPrice(res?.price_list_url)
104
+ setStartBooking(moment(res?.start_booking).serverFormat('YYYY-MM-DD HH:mm:ss'))
105
+ setResult(res)()
106
+ }, (err) => {
107
+ LibToastProperty.show(err?.message)
108
+ LibNavigation.back()
109
+ })
110
+ }
111
+ }
112
+
94
113
 
95
114
  let dataEvent: any = {
96
- event_id: data?.event_id,
97
- event_title: data?.event_title,
98
- charge_payment: data?.charge_payment,
99
- charge_payment_type: data?.charge_payment_type,
100
- images: [{ image: data?.image }],
115
+ event_id: getResult()?.event_id,
116
+ event_title: getResult()?.event_title,
117
+ charge_payment: getResult()?.charge_payment,
118
+ charge_payment_type: getResult()?.charge_payment_type,
119
+ images: [{ image: getResult()?.image }],
101
120
  }
102
121
 
103
122
  const [ticketSeat, resetTicketSeat] = taskSeat((item: any) => new Promise((next) => {
@@ -156,7 +175,7 @@ export default function m(props: EventArtist_detail_multiProps): any {
156
175
  })
157
176
 
158
177
  const [ticketAdditional, resetTicketAdditional] = taskAdditional((item: any) => new Promise((next) => {
159
- if (data?.has_addition == 1 || item.has_addition && item.has_addition == 1) {
178
+ if (getResult()?.has_addition == 1 || item.has_addition && item.has_addition == 1) {
160
179
  LibNavigation.navigateForResult('event/additional', {
161
180
  event_id: dataEvent?.event_id,
162
181
  qty: item.qty,
@@ -177,20 +196,59 @@ export default function m(props: EventArtist_detail_multiProps): any {
177
196
  if (dataAddition?.length > 0) {
178
197
  dataEvent.addition = dataAddition
179
198
  }
180
- LibNavigation.navigate('payment/ticket_multi', {
199
+ let args: any = {
181
200
  order_type: EventConfigProperty?.state()?.get()?.order_type?.ticket,
182
201
  fee_platform: {
183
- fee_platform_amount: data?.fee_platform_amount,
184
- fee_platform_type: data?.fee_platform_type,
202
+ fee_platform_amount: getResult()?.fee_platform_amount,
203
+ fee_platform_type: getResult()?.fee_platform_type,
185
204
  },
186
205
  subscribed: subscribed,
187
206
  dataEvent: dataEvent,
188
207
  dataTicket: getDataPostBooking(),
208
+ }
209
+
210
+ const selectedPriceIds = getDataPostBooking().filter((x: any) => x.selected == 1).map((x: any) => x.price_id)
211
+ curlPriceConfig(selectedPriceIds, (filteredFee) => {
212
+ const editedDataTicket = getDataPostBooking().map((item: any) => {
213
+ const priceId = item.price_id;
214
+ if (filteredFee?.[priceId]) {
215
+ return {
216
+ ...item,
217
+ ...filteredFee?.[priceId]
218
+ };
219
+ }
220
+ return item;
221
+ })
222
+ args["fee_platform"] = undefined
223
+ args["dataTicket"] = editedDataTicket
224
+ LibNavigation.navigate('payment/ticket_multi', args)
189
225
  })
190
226
  })
191
227
 
192
- function loadDataPrice() {
193
- new LibCurl(data?.price_list_url, null, (res, msg) => {
228
+ function curlPriceConfig(price_ids: string[], onDone: (data: any) => void) {
229
+ setLoading(true)
230
+ if (getResult()?.url_price_config) {
231
+ new LibCurl(getResult()?.url_price_config, null, (res, msg) => {
232
+ setLoading(false)
233
+ let filteredFee: any = {}
234
+ if (res) {
235
+ filteredFee = Object.fromEntries(
236
+ price_ids.flatMap(k => res[k] ? [[k, res[k]]] : [])
237
+ )
238
+ }
239
+ onDone(filteredFee)
240
+ }, (err) => {
241
+ setLoading(false)
242
+ LibToastProperty.show(err?.message)
243
+ })
244
+ } else {
245
+ setLoading(false)
246
+ onDone({})
247
+ }
248
+ }
249
+
250
+ function loadDataPrice(price_list_url: string) {
251
+ new LibCurl(price_list_url, null, (res, msg) => {
194
252
 
195
253
  setPriceList(res)
196
254
  }, (err) => {
@@ -225,23 +283,23 @@ export default function m(props: EventArtist_detail_multiProps): any {
225
283
  {
226
284
  icon: 'icons/ic_facebook.png',
227
285
  title: 'Facebook',
228
- onPress: () => { EventShare.facebook(data?.url) }
286
+ onPress: () => { EventShare.facebook(getResult()?.url) }
229
287
  },
230
288
  {
231
289
  icon: 'icons/ic_whatsapp.png',
232
290
  title: 'Whatsapp',
233
- onPress: () => { EventShare.whatsapp(data?.url) }
291
+ onPress: () => { EventShare.whatsapp(getResult()?.url) }
234
292
  },
235
293
  {
236
294
  icon: 'icons/ic_twitter.png',
237
295
  title: 'Twitter',
238
- onPress: () => { EventShare.twitter(data?.url) }
296
+ onPress: () => { EventShare.twitter(getResult()?.url) }
239
297
  },
240
298
  {
241
299
  icon: 'icons/ic_copy.png',
242
300
  title: esp.lang("event/artist_detail", "copy"),
243
301
  onPress: () => {
244
- LibUtils.copyToClipboard(data?.url).then((v) => {
302
+ LibUtils.copyToClipboard(getResult()?.url).then((v) => {
245
303
  LibToastProperty.show(esp.lang("event/artist_detail", "alert"))
246
304
  })
247
305
  }
@@ -333,18 +391,43 @@ export default function m(props: EventArtist_detail_multiProps): any {
333
391
  item?.status == 1 && (ticketWithDate || ticketSpecial) && itemC.selected == 1 &&
334
392
  <View style={applyStyle({ marginTop: 4, flexDirection: 'row', marginLeft: 8, alignContent: 'center', alignItems: 'center' })}>
335
393
  <TouchableOpacity onPress={() => {
336
- // min()
337
394
  let qty = 1
338
- if (itemC.qty <= item.qty_min) {
339
- qty = Number(item.qty_min)
395
+ if (Number(itemC.qty) - 1 <= 0) {
396
+ // set 0 & unselect tiket
397
+ qty = 0
398
+
399
+ const data = new LibObject(priceList)
400
+ .update((itemList) => {
401
+ itemList.selected = 0
402
+ itemList.qty = 0
403
+ itemList.seat_autopick = item.config?.seat_autopick
404
+ itemList.use_seat = item.use_seat
405
+ return itemList
406
+ })(i, 'list', iC)
407
+ .update((priceTypeItem) => {
408
+ return ({
409
+ ...priceTypeItem,
410
+ selected: priceTypeItem.list.some((item: any) => item.selected == 1) ? 1 : 0
411
+ })
412
+ })(i)
413
+ .value()
414
+
415
+ setPriceList(data)
416
+
340
417
  } else {
341
- qty = Number(itemC.qty) == 1 ? 1 : Number(itemC.qty) - 1
342
- }
418
+ // patuhi qty_min
419
+ if (itemC.qty <= item.qty_min) {
420
+ qty = Number(item.qty_min)
421
+ } else {
422
+ qty = Number(itemC.qty) - 1
423
+ }
343
424
 
344
- setPriceList(LibObject.set(getPriceList(), qty)(i, 'list', iC, 'qty'))
425
+ // set qty baru
426
+ setPriceList(LibObject.set(getPriceList(), qty)(i, 'list', iC, 'qty'))
427
+ }
345
428
 
346
429
  }}>
347
- <View style={applyStyle({ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
430
+ <View style={applyStyle({ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", justifyContent: 'center', alignContent: 'center', alignItems: 'center' })}>
348
431
  <LibIcon name="minus" color="#e74c3c" />
349
432
  </View>
350
433
  </TouchableOpacity>
@@ -362,7 +445,7 @@ export default function m(props: EventArtist_detail_multiProps): any {
362
445
  setPriceList(LibObject.set(getPriceList(), qty)(i, 'list', iC, 'qty'))
363
446
 
364
447
  }}>
365
- <View style={applyStyle({ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
448
+ <View style={applyStyle({ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", justifyContent: 'center', alignContent: 'center', alignItems: 'center' })}>
366
449
  <LibIcon name="plus" color="#16a085" />
367
450
  </View>
368
451
  </TouchableOpacity>
@@ -382,7 +465,7 @@ export default function m(props: EventArtist_detail_multiProps): any {
382
465
  function renderImages(item: any, i: number) {
383
466
  const styleId_Z1ecB7O: any = { height: bgHeight, width: LibStyle.width, resizeMode: 'cover' }
384
467
  return (
385
- <TouchableOpacity key={i} onPress={() => LibNavigation.navigate('lib/gallery', { images: data?.images_artist, index: i })}>
468
+ <TouchableOpacity key={i} onPress={() => LibNavigation.navigate('lib/gallery', { images: getResult()?.images_artist, index: i })}>
386
469
  <LibPicture source={{ uri: item.image }} style={styleId_Z1ecB7O} />
387
470
  </TouchableOpacity>
388
471
  )
@@ -397,152 +480,178 @@ export default function m(props: EventArtist_detail_multiProps): any {
397
480
  };
398
481
 
399
482
  return (
400
- <View style={{ flex: 1 }} >
401
- <EventHeader title={esp.lang("event/artist_detail", "title")} subtitle={data?.title} />
402
- <ScrollView>
403
- {
404
- data?.images_artist && data?.images_artist?.length > 0 ?
405
- <LibCarrousel
406
- delay={3000}
407
- style={{ height: bgHeight, width: LibStyle.width }}
408
- autoplay
409
- bullets
410
- bulletStyle={{ width: 7, height: 7, backgroundColor: "#fff", borderRadius: 3.5, borderWidth: 0, marginHorizontal: 2 }}
411
- chosenBulletStyle={{ width: 7, height: 7, backgroundColor: "#f4e31b", borderRadius: 3.5, borderWidth: 0, marginHorizontal: 2 }}
412
- bulletsContainerStyle={{ marginBottom: -10 }}>
413
- {
414
- data?.images_artist && data?.images_artist?.map(renderImages)
415
- }
416
- </LibCarrousel>
417
- :
418
- <Pressable onPress={() => LibNavigation.navigate('lib/gallery', { image: data?.image_artist })} >
419
- <LibPicture
420
- style={applyStyle({ height: LibStyle.width * 9 / 16, width: LibStyle.width, backgroundColor: '#f2f3f4' })}
421
- source={{ uri: data?.image_artist }} />
422
- </Pressable>
423
- }
424
-
425
- <View style={applyStyle({ marginTop: 10, marginLeft: 17, flexDirection: 'row' })}>
483
+ <EventQueue event_id={result?.event_id}>
484
+ <View style={{ flex: 1 }} >
485
+ <EventHeader title={esp.lang("event/artist_detail", "title")} subtitle={result?.title} />
486
+ <LibScroll onRefresh={loadResult}>
426
487
  {
427
- share.map(renderShare)
488
+ getResult()?.images_artist && getResult()?.images_artist?.length > 0 ?
489
+ <LibCarrousel
490
+ delay={3000}
491
+ style={{ height: bgHeight, width: LibStyle.width }}
492
+ autoplay
493
+ bullets
494
+ bulletStyle={{ width: 7, height: 7, backgroundColor: "#fff", borderRadius: 3.5, borderWidth: 0, marginHorizontal: 2 }}
495
+ chosenBulletStyle={{ width: 7, height: 7, backgroundColor: "#f4e31b", borderRadius: 3.5, borderWidth: 0, marginHorizontal: 2 }}
496
+ bulletsContainerStyle={{ marginBottom: -10 }}>
497
+ {
498
+ getResult()?.images_artist && getResult()?.images_artist?.map(renderImages)
499
+ }
500
+ </LibCarrousel>
501
+ :
502
+ <Pressable onPress={() => LibNavigation.navigate('lib/gallery', { image: result?.image_artist })} >
503
+ <LibPicture
504
+ style={applyStyle({ height: LibStyle.width * 9 / 16, width: LibStyle.width, backgroundColor: '#f2f3f4' })}
505
+ source={{ uri: result?.image_artist }} />
506
+ </Pressable>
428
507
  }
429
- </View>
430
- <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>
431
- {/* {
508
+
509
+ <View style={applyStyle({ marginTop: 10, marginLeft: 17, flexDirection: 'row' })}>
510
+ {
511
+ share.map(renderShare)
512
+ }
513
+ </View>
514
+ <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" })}>{result?.title}</Text>
515
+ {/* {
432
516
  data && priceList?.map?.(renderPrieList)
433
517
  } */}
434
- {
435
- data?.description != "" &&
436
- <ScrollView>
437
- <LibWebview onFinishLoad={() => { }} source={{ html: data?.description }} />
438
- </ScrollView>
439
- }
440
- {
441
- data && data?.youtube != "" &&
442
- <>
443
- <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>
444
- <TouchableOpacity onPress={() => LibNavigation.navigate('lib/video', { code: data?.youtube })} >
445
- <LibPicture source={{ uri: LibVideoProperty.getUrlThumbnail(data?.youtube) }} style={applyStyle({ height: LibStyle.width * 9 / 16, width: LibStyle.width - 40, marginHorizontal: 20, resizeMode: 'cover' })} />
446
- </TouchableOpacity>
447
- </>
448
- }
449
- </ScrollView>
450
- <View style={applyStyle({ flexDirection: 'row', padding: 10, backgroundColor: 'white' })} >
518
+ {
519
+ result?.description != "" &&
520
+ <ScrollView>
521
+ <LibWebview onFinishLoad={() => { }} source={{ html: result?.description }} />
522
+ </ScrollView>
523
+ }
524
+ {
525
+ result && result?.youtube != "" &&
526
+ <>
527
+ <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>
528
+ <TouchableOpacity onPress={() => LibNavigation.navigate('lib/video', { code: getResult()?.youtube })} >
529
+ <LibPicture source={{ uri: LibVideoProperty.getUrlThumbnail(getResult()?.youtube) }} style={applyStyle({ height: LibStyle.width * 9 / 16, width: LibStyle.width - 40, marginHorizontal: 20, resizeMode: 'cover' })} />
530
+ </TouchableOpacity>
531
+ </>
532
+ }
533
+ </LibScroll>
534
+ <View style={applyStyle({ flexDirection: 'row', padding: 10, backgroundColor: 'white' })} >
451
535
 
452
- {
453
- data?.book_available == 1 ?
454
- <EventButton label={esp.lang("event/artist_detail", "buy_ticket")} onPress={() => {
455
- EventIndexProperty.isLogin(() => {
456
- showSchedule.current?.show()
457
- })
458
- }} style={applyStyle({ backgroundColor: LibStyle.colorGreen })} />
459
- :
460
- <View style={applyStyle({ flex: 1, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 })} >
461
- <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>
462
- </View>
463
- }
464
- </View>
536
+ {
537
+ result?.book_available == 1 ?
538
+ <EventButton label={esp.lang("event/artist_detail", "buy_ticket")} onPress={() => {
539
+ EventIndexProperty.isLogin(() => {
540
+ showSchedule.current?.show()
541
+ })
542
+ }} style={applyStyle({ backgroundColor: LibStyle.colorGreen })} />
543
+ :
544
+ <View style={applyStyle({ flex: 1, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 })} >
545
+ <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>
546
+ </View>
547
+ }
548
+ </View>
465
549
 
466
- <LibSlidingup ref={showSchedule}>
467
- <View style={applyStyle({ backgroundColor: 'white', borderTopRightRadius: 30, borderTopLeftRadius: 30, paddingTop: 15, maxHeight: LibStyle.height - (LibStyle.height / 3) })}>
468
- <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>
469
- <ScrollView showsVerticalScrollIndicator={false} >
470
- {
471
- priceList?.length > 0 && priceList?.map((item: any, i: number) => {
472
- let filterFullData = priceList?.filter((it: any) => it.status != 0)
473
- const displayedData = showAll[item.price_id] ? item?.list : item?.list.slice(0, maxDisplay);
474
-
475
- let textOpacity = item?.status == 1 ? 1 : 0.3
476
- return (
477
- <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 }}>
478
- <View style={{ padding: 10, backgroundColor: '#f1f2f3', borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
479
- <View style={{ alignContent: 'center', alignItems: 'center', flexDirection: 'row', justifyContent: 'space-between', }}>
480
- <Text allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.type}</Text>
481
- {
482
- item.qty_min > 1 &&
483
- <Text style={{ color: LibStyle.colorRed, fontSize: 10, fontWeight: 'normal' }}> {"(" + esp.lang("event/ticket_list", "min_order") + LibUtils.number(item.qty_min) + ")"}</Text>
484
- }
550
+ <LibSlidingup ref={showSchedule}>
551
+ <View style={applyStyle({ backgroundColor: 'white', borderTopRightRadius: 30, borderTopLeftRadius: 30, paddingTop: 15, maxHeight: LibStyle.height - (LibStyle.height / 3) })}>
552
+ <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>
553
+ <ScrollView showsVerticalScrollIndicator={false} >
554
+ <EventAlert
555
+ color={LibStyle.colorPrimary}
556
+ msg={esp.lang("event/ticket_list2", "u_can_choose_multiple")}
557
+ style={{ marginHorizontal: 15, marginBottom: 0 }}
558
+ useIcon
559
+ />
560
+ {
561
+ priceList?.length > 0 && priceList?.map((item: any, i: number) => {
562
+ let filterFullData = priceList?.filter((it: any) => it.status != 0)
563
+ const displayedData = showAll[item.price_id] ? item?.list : item?.list.slice(0, maxDisplay);
564
+
565
+ let textOpacity = item?.status == 1 ? 1 : 0.3
566
+ return (
567
+ <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 }}>
568
+ <View style={{ padding: 10, backgroundColor: '#f1f2f3', borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
485
569
  {
486
- item?.status != 1 &&
570
+ item?.hasOwnProperty('label') && (item?.label != "" && item?.label != null) &&
487
571
  <View style={applyStyle({ flexDirection: 'row' })}>
488
- <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 })}>
489
- <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>
572
+ <View style={applyStyle({ alignContent: 'center', alignItems: 'center', justifyContent: 'center', borderWidth: 1, backgroundColor: item?.label_color, borderColor: item?.label_color, borderRadius: 3, padding: 2, paddingHorizontal: 5, opacity: 1 })}>
573
+ <Text allowFontScaling={false} style={{ fontSize: 10, fontStyle: "normal", letterSpacing: 0.5, color: EventOrder_itemProperty.textColor(item?.label_color), fontWeight: 'bold' }}>{item?.label}</Text>
490
574
  </View>
491
575
  </View>
492
576
  }
577
+ <View style={{ alignContent: 'center', alignItems: 'center', flexDirection: 'row', justifyContent: 'space-between', }}>
578
+ <Text allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.type}</Text>
579
+ {
580
+ item.qty_min > 1 &&
581
+ <Text style={{ color: LibStyle.colorRed, fontSize: 10, fontWeight: 'normal' }}> {"(" + esp.lang("event/ticket_list", "min_order") + LibUtils.number(item.qty_min) + ")"}</Text>
582
+ }
583
+ {
584
+ item?.status != 1 &&
585
+ <View style={applyStyle({ flexDirection: 'row' })}>
586
+ <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 })}>
587
+ <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>
588
+ </View>
589
+ </View>
590
+ }
591
+ </View>
592
+ {
593
+ item.info != "" &&
594
+ <View style={{ marginTop: 3, alignContent: 'center', alignItems: 'center', flexDirection: 'row', marginRight: 5 }}>
595
+ <Text allowFontScaling={false} style={{ fontSize: 12, color: LibStyle.colorBlue }}>{item.info}</Text>
596
+ </View>
597
+ }
493
598
  </View>
494
599
  {
495
- item.info != "" &&
496
- <View style={{ marginTop: 3, alignContent: 'center', alignItems: 'center', flexDirection: 'row', marginRight: 5 }}>
497
- <Text allowFontScaling={false} style={{ fontSize: 12, color: LibStyle.colorBlue }}>{item.info}</Text>
498
- </View>
600
+ displayedData?.map((itemC: any, iC: number) => renderItem(itemC, iC, item, i))
601
+ }
602
+
603
+ {
604
+ filterFullData[i].list?.length > 3 &&
605
+ <TouchableOpacity onPress={() => {
606
+ handleShowAll(item.price_id)
607
+ }} style={{ borderTopColor: LibStyle.colorGrey, borderTopWidth: 0.8, flex: 1, padding: 8, flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
608
+ <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>
609
+ <LibIcon name={showAll[item.price_id] ? 'chevron-up-circle-outline' : 'chevron-down-circle-outline'} color={LibStyle.colorBlue} size={18} />
610
+ </TouchableOpacity>
499
611
  }
500
- </View>
501
- {
502
- displayedData?.map((itemC: any, iC: number) => renderItem(itemC, iC, item, i))
503
- }
504
612
 
613
+ </View>
614
+ )
615
+ })
616
+ }
617
+ </ScrollView>
618
+ <View style={applyStyle({ flexDirection: 'row', paddingVertical: 10 })} >
619
+ {
620
+ result?.book_available == 1 ?
621
+ <>
505
622
  {
506
- filterFullData[i].list?.length > 3 &&
507
- <TouchableOpacity onPress={() => {
508
- handleShowAll(item.price_id)
509
- }} style={{ borderTopColor: LibStyle.colorGrey, borderTopWidth: 0.8, flex: 1, padding: 8, flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
510
- <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>
511
- <LibIcon name={showAll[item.price_id] ? 'chevron-up-circle-outline' : 'chevron-down-circle-outline'} color={LibStyle.colorBlue} size={18} />
512
- </TouchableOpacity>
623
+ result?.book_available == 0 && result.end_booking <= date && result.end_booking != '0000-00-00 00:00:00' ?
624
+ <View style={applyStyle({ flex: 1, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 })} >
625
+ <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>
626
+ </View>
627
+ :
628
+ <>
629
+ {
630
+ loading ?
631
+ <View style={{ minWidth: '100%', alignSelf: 'center' }} >
632
+ <View style={{ borderWidth: 1, borderColor: 'rgba(0, 0, 0, 0)', height: 40, borderRadius: 16, backgroundColor: "#e6e6e6", alignItems: 'center', justifyContent: 'center', paddingHorizontal: 9 }} >
633
+ <ActivityIndicator size={"small"} color={LibStyle.colorPrimary} />
634
+ </View>
635
+ </View> :
636
+ <EventButton label={esp.lang("event/artist_detail", "buy_ticket")} onPress={() => {
637
+ EventIndexProperty.isLogin(() => {
638
+ proceedToPayment()
639
+ })
640
+ }} style={{ backgroundColor: LibStyle.colorGreen, marginTop: 2, marginHorizontal: 15 }} />
641
+ }
642
+ </>
513
643
  }
514
-
644
+ </>
645
+ :
646
+ <View style={applyStyle({ flex: 1, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 })} >
647
+ <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(result?.start_booking).serverFormat('DD MMMM YYYY HH:mm '))}</Text>
515
648
  </View>
516
- )
517
- })
518
- }
519
- </ScrollView>
520
- <View style={applyStyle({ flexDirection: 'row', paddingVertical: 10 })} >
521
- {
522
- data?.book_available == 1 ?
523
- <>
524
- {
525
- data?.book_available == 0 && data.end_booking <= date && data.end_booking != '0000-00-00 00:00:00' ?
526
- <View style={applyStyle({ flex: 1, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 })} >
527
- <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>
528
- </View>
529
- :
530
- <EventButton label={esp.lang("event/artist_detail", "buy_ticket")} onPress={() => {
531
- EventIndexProperty.isLogin(() => {
532
- proceedToPayment()
533
- })
534
- }} style={{ backgroundColor: LibStyle.colorGreen, marginTop: 2, marginHorizontal: 15 }} />
535
- }
536
- </>
537
- :
538
- <View style={applyStyle({ flex: 1, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 })} >
539
- <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>
540
- </View>
541
- }
649
+ }
650
+ </View>
542
651
  </View>
543
- </View>
544
- </LibSlidingup>
652
+ </LibSlidingup>
545
653
 
546
- </View>
654
+ </View>
655
+ </EventQueue>
547
656
  )
548
657
  }