esoftplay-event 0.0.2-l → 0.0.2-m

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/artist.tsx CHANGED
@@ -1,8 +1,6 @@
1
1
  // withHooks
2
2
 
3
3
  import { applyStyle } from 'esoftplay';
4
- import { EventCountdownProperty } from 'esoftplay/cache/event/countdown/import';
5
- import { EventFirebase_socket, EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
6
4
  import { EventHeader } from 'esoftplay/cache/event/header/import';
7
5
  import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
8
6
  import { EventMessage } from 'esoftplay/cache/event/message/import';
@@ -14,7 +12,6 @@ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
14
12
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
15
13
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
16
14
  import { LibUtils } from 'esoftplay/cache/lib/utils/import';
17
- import { UserClass } from 'esoftplay/cache/user/class/import';
18
15
  import esp from 'esoftplay/esp';
19
16
  import moment from 'esoftplay/moment';
20
17
  import useSafeState from 'esoftplay/state';
@@ -33,7 +30,6 @@ export default function m(props: BigbangArtistProps): any {
33
30
  const [result, setResult] = useSafeState<any>()
34
31
  const [resultEvent, setResultEvent] = useSafeState<any>()
35
32
  const [error, setError] = useSafeState<any>('')
36
- const { isInPricingQueueConfig } = EventFirebase_socket()
37
33
 
38
34
  const { title, has_addition } = LibNavigation.getArgsAll(props)
39
35
  const url = LibNavigation.getArgs(props, 'url', 'event_artist')
@@ -46,9 +42,6 @@ export default function m(props: BigbangArtistProps): any {
46
42
  esp.log({ res });
47
43
  new LibCurl(res?.[0]?.url_event || `event_detail/${res?.[0]?.event_id}`, null, (res) => {
48
44
  setResultEvent(res)
49
- if (res?.id) {
50
- EventFirebase_socketProperty.eventIdQueue.set(res?.id)
51
- }
52
45
  if (res.allotment) {
53
46
  esp.modProp("event/firebase_socket").userIdKeyReplacer.set({
54
47
  t: Number(res.allotment.t),
@@ -66,11 +59,11 @@ export default function m(props: BigbangArtistProps): any {
66
59
  }
67
60
 
68
61
  useEffect(() => {
69
- if (esp.isDebug("") && UserClass?.state()?.get()?.email == "bagus@fisip.net") {
70
- LibNavigation.replace('event/artistv2')
71
- } else {
72
- loadData?.()
73
- }
62
+ // if (esp.isDebug("") && UserClass?.state()?.get()?.email == "bagus@fisip.net") {
63
+ // LibNavigation.replace('event/artistv2')
64
+ // } else {
65
+ loadData?.()
66
+ // }
74
67
  }, [])
75
68
 
76
69
  const itemWidth = (LibStyle.width - 2)
@@ -90,7 +83,7 @@ export default function m(props: BigbangArtistProps): any {
90
83
  return (
91
84
  <TouchableOpacity key={index} onPress={() => {
92
85
  if (isNotAvailable) {
93
- LibToastProperty.show(esp.lang("event/artist", "ticket_not_available"))
86
+ LibToastProperty.show(item?.price_list?.[0]?.message)
94
87
  } else {
95
88
  EventIndexProperty.isLogin(() => {
96
89
  let newItem = {
@@ -98,36 +91,20 @@ export default function m(props: BigbangArtistProps): any {
98
91
  ...item,
99
92
  }
100
93
  if (item.book_available == 1) {
101
- if (isInPricingQueueConfig(item.event_id)) {
102
- LibNavigation.navigateForResult('event/queue_pricing', { event_id: item?.event_id, autoPass: false }).then((v) => {
103
- const expTimestamp = Date.now() + (Number(EventFirebase_socketProperty.eventQueueConfig.get(item?.event_id).time) * 1000);
104
- EventCountdownProperty.countdownTime.set(expTimestamp)
105
-
106
- if (item?.config?.hasOwnProperty('multiprice') && item?.config?.multiprice == 1) {
107
- LibNavigation.navigate('event/artist_detail_multi', {
108
- data: newItem,
109
- subscribed: subs
110
- })
111
- } else {
112
- LibNavigation.navigate('event/artist_detail', {
113
- data: newItem,
114
- subscribed: subs
115
- })
116
- }
94
+ if (item?.config?.hasOwnProperty('multiprice') && item?.config?.multiprice == 1) {
95
+ LibNavigation.navigate('event/artist_detail_multi', {
96
+ data: newItem,
97
+ subscribed: subs,
98
+ url: item?.url_detail
117
99
  })
118
100
  } else {
119
- if (item?.config?.hasOwnProperty('multiprice') && item?.config?.multiprice == 1) {
120
- LibNavigation.navigate('event/artist_detail_multi', {
121
- data: newItem,
122
- subscribed: subs
123
- })
124
- } else {
125
- LibNavigation.navigate('event/artist_detail', {
126
- data: newItem,
127
- subscribed: subs
128
- })
129
- }
101
+ LibNavigation.navigate('event/artist_detail', {
102
+ data: newItem,
103
+ subscribed: subs,
104
+ url: item?.url_detail
105
+ })
130
106
  }
107
+ // }
131
108
  } else {
132
109
  LibToastProperty.show(esp.lang("event/artist_detail", "book_available", moment(item?.start_booking).serverFormat("DD MMMM YYYY HH:mm:ss")))
133
110
  }
@@ -8,6 +8,7 @@ import { EventHeader } from 'esoftplay/cache/event/header/import';
8
8
  import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
9
9
  import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
10
10
  import { EventOrder_itemProperty } from 'esoftplay/cache/event/order_item/import';
11
+ import { EventQueue } from 'esoftplay/cache/event/queue/import';
11
12
  import { EventShare } from 'esoftplay/cache/event/share/import';
12
13
  import { LibCarrousel } from 'esoftplay/cache/lib/carrousel/import';
13
14
  import { LibCurl } from 'esoftplay/cache/lib/curl/import';
@@ -16,6 +17,7 @@ import { LibLoading } from 'esoftplay/cache/lib/loading/import';
16
17
  import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
17
18
  import { LibObject } from 'esoftplay/cache/lib/object/import';
18
19
  import { LibPicture } from 'esoftplay/cache/lib/picture/import';
20
+ import { LibScroll } from 'esoftplay/cache/lib/scroll/import';
19
21
  import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
20
22
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
21
23
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
@@ -23,6 +25,7 @@ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
23
25
  import { LibVideoProperty } from 'esoftplay/cache/lib/video/import';
24
26
  import { LibWebview } from 'esoftplay/cache/lib/webview/import';
25
27
  import esp from 'esoftplay/esp';
28
+ 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';
@@ -37,8 +40,7 @@ export default function m(props: EventArtist_detailProps): any {
37
40
  moment().locale('id')
38
41
  let showSchedule = React.useRef<LibSlidingup>(null)
39
42
  const [qty, setQty] = useSafeState<any>(1)
40
- const { data, subscribed } = LibNavigation.getArgsAll(props)
41
- const startBooking = moment(data?.start_booking).serverFormat('YYYY-MM-DD HH:mm:ss')
43
+ const { data, subscribed, url } = LibNavigation.getArgsAll(props)
42
44
  const date = moment().localeFormat('YYYY-MM-DD HH:mm:ss')
43
45
  const [eventConfig] = EventConfigProperty.state().useState()
44
46
 
@@ -47,12 +49,31 @@ export default function m(props: EventArtist_detailProps): any {
47
49
  const [showAll, setShowAll] = useSafeState<any>({});
48
50
  const [loading, setLoading] = useSafeState<boolean>(false)
49
51
 
52
+ const [result, setResult, getResult] = useLazyState<any>(data)
53
+ const [startBooking, setStartBooking] = useLazyState<any>(moment(getResult()?.start_booking).serverFormat('YYYY-MM-DD HH:mm:ss'))
54
+
50
55
  useEffect(() => {
51
- loadDataPrice()
56
+ loadResult()
52
57
  EventConfigProperty.curlConfig('v2/config_order_type')
53
58
  return () => { EventCountdownProperty.releaseQueue.trigger() }
54
59
  }, [])
55
60
 
61
+ function loadResult() {
62
+ if (!url) {
63
+ loadDataPrice(getResult()?.price_list_url)
64
+ } else {
65
+ new LibCurl(url, null, (res, msg) => {
66
+ loadDataPrice(res?.price_list_url)
67
+ setStartBooking(moment(res?.start_booking).serverFormat('YYYY-MM-DD HH:mm:ss'))
68
+ setResult(res)()
69
+ }, (err) => {
70
+ console.log(err)
71
+ LibToastProperty.show(err?.message)
72
+ LibNavigation.back()
73
+ })
74
+ }
75
+ }
76
+
56
77
  function sortByStatus(data: any) {
57
78
  // Fungsi sorting untuk memastikan status 1 di atas, lainnya di bawah
58
79
  const statusSorter = (a: any, b: any) => {
@@ -71,8 +92,8 @@ export default function m(props: EventArtist_detailProps): any {
71
92
  }
72
93
 
73
94
 
74
- function loadDataPrice() {
75
- new LibCurl(data?.price_list_url, null, (res, msg) => {
95
+ function loadDataPrice(price_list_url: string) {
96
+ new LibCurl(price_list_url, null, (res, msg) => {
76
97
 
77
98
  let stop = false
78
99
  let arr = sortByStatus(res)
@@ -116,10 +137,10 @@ export default function m(props: EventArtist_detailProps): any {
116
137
  showSchedule.current?.hide()
117
138
 
118
139
  let dataPost: any = {
119
- event_id: data?.event_id,
120
- event_title: data?.event_title,
121
- charge_payment: data?.charge_payment,
122
- charge_payment_type: data?.charge_payment_type,
140
+ event_id: getResult()?.event_id,
141
+ event_title: getResult()?.event_title,
142
+ charge_payment: getResult()?.charge_payment,
143
+ charge_payment_type: getResult()?.charge_payment_type,
123
144
  selected_ticket: selectedTicket,
124
145
  qty: qty,
125
146
  }
@@ -156,7 +177,7 @@ export default function m(props: EventArtist_detailProps): any {
156
177
 
157
178
  return {
158
179
  order_type: eventConfig?.order_type?.ticket,
159
- tax: conf?.tax ?? getSelectedTicket()?.tax ?? data?.tax ?? 0,
180
+ tax: conf?.tax ?? getSelectedTicket()?.tax ?? getResult()?.tax ?? 0,
160
181
  dataBookingEvent: { ...dataPost, qty },
161
182
  subscribed,
162
183
  fee_platform: conf?.fee_platform_amount != null
@@ -165,8 +186,8 @@ export default function m(props: EventArtist_detailProps): any {
165
186
  fee_platform_type: conf.fee_platform_type || "NONE",
166
187
  }
167
188
  : {
168
- fee_platform_amount: data?.fee_platform_amount || 0,
169
- fee_platform_type: data?.fee_platform_type || "NONE",
189
+ fee_platform_amount: getResult()?.fee_platform_amount || 0,
190
+ fee_platform_type: getResult()?.fee_platform_type || "NONE",
170
191
  },
171
192
  fee_custom: {
172
193
  fee_custom_label: conf?.fee_custom_label || "Custom Fee",
@@ -184,7 +205,7 @@ export default function m(props: EventArtist_detailProps): any {
184
205
  {
185
206
  type_ticket: selectedTicket?.type,
186
207
  ondate: selectedTicket?.list?.ondate,
187
- event_id: data?.event_id,
208
+ event_id: getResult()?.event_id,
188
209
  qty,
189
210
  data: dataPost,
190
211
  price_id: selectedTicket?.price_id
@@ -198,13 +219,13 @@ export default function m(props: EventArtist_detailProps): any {
198
219
 
199
220
  function curlPriceConfig(price_id: string): Promise<any> {
200
221
  return new Promise((resolve) => {
201
- if (!data?.url_price_config) {
222
+ if (!getResult()?.url_price_config) {
202
223
  resolve({})
203
224
  return
204
225
  }
205
226
 
206
227
  new LibCurl(
207
- data.url_price_config,
228
+ getResult().url_price_config,
208
229
  null,
209
230
  (res) => {
210
231
  resolve(res?.[price_id] || {})
@@ -255,23 +276,23 @@ export default function m(props: EventArtist_detailProps): any {
255
276
  {
256
277
  icon: 'icons/ic_facebook.png',
257
278
  title: 'Facebook',
258
- onPress: () => { EventShare.facebook(data?.url) }
279
+ onPress: () => { EventShare.facebook(getResult()?.url) }
259
280
  },
260
281
  {
261
282
  icon: 'icons/ic_whatsapp.png',
262
283
  title: 'Whatsapp',
263
- onPress: () => { EventShare.whatsapp(data?.url) }
284
+ onPress: () => { EventShare.whatsapp(getResult()?.url) }
264
285
  },
265
286
  {
266
287
  icon: 'icons/ic_twitter.png',
267
288
  title: 'Twitter',
268
- onPress: () => { EventShare.twitter(data?.url) }
289
+ onPress: () => { EventShare.twitter(getResult()?.url) }
269
290
  },
270
291
  {
271
292
  icon: 'icons/ic_copy.png',
272
293
  title: esp.lang("event/artist_detail", "copy"),
273
294
  onPress: () => {
274
- LibUtils.copyToClipboard(data?.url).then((v) => {
295
+ LibUtils.copyToClipboard(getResult()?.url).then((v) => {
275
296
  LibToastProperty.show(esp.lang("event/artist_detail", "alert"))
276
297
  })
277
298
  }
@@ -399,7 +420,7 @@ export default function m(props: EventArtist_detailProps): any {
399
420
  function renderImages(item: any, i: number) {
400
421
  const styleId_Z1ecB7O: any = { height: bgHeight, width: LibStyle.width, resizeMode: 'cover' }
401
422
  return (
402
- <TouchableOpacity key={i} onPress={() => LibNavigation.navigate('lib/gallery', { images: data?.images_artist, index: i })}>
423
+ <TouchableOpacity key={i} onPress={() => LibNavigation.navigate('lib/gallery', { images: getResult()?.images_artist, index: i })}>
403
424
  <LibPicture source={{ uri: item.image }} style={styleId_Z1ecB7O} />
404
425
  </TouchableOpacity>
405
426
  )
@@ -414,178 +435,180 @@ export default function m(props: EventArtist_detailProps): any {
414
435
  };
415
436
 
416
437
  return (
417
- <View style={{ flex: 1 }} >
418
- <EventHeader title={esp.lang("event/artist_detail", "title")} subtitle={data?.title} />
419
- <ScrollView>
420
- {
421
- data?.images_artist && data?.images_artist?.length > 0 ?
422
- <LibCarrousel
423
- delay={3000}
424
- style={{ height: bgHeight, width: LibStyle.width }}
425
- autoplay
426
- bullets
427
- bulletStyle={{ width: 7, height: 7, backgroundColor: "#fff", borderRadius: 3.5, borderWidth: 0, marginHorizontal: 2 }}
428
- chosenBulletStyle={{ width: 7, height: 7, backgroundColor: "#f4e31b", borderRadius: 3.5, borderWidth: 0, marginHorizontal: 2 }}
429
- bulletsContainerStyle={{ marginBottom: -10 }}>
430
- {
431
- data?.images_artist && data?.images_artist?.map(renderImages)
432
- }
433
- </LibCarrousel>
434
- :
435
- <Pressable onPress={() => LibNavigation.navigate('lib/gallery', { image: data?.image_artist })} >
436
- <LibPicture
437
- style={applyStyle({ height: LibStyle.width * 9 / 16, width: LibStyle.width, backgroundColor: '#f2f3f4' })}
438
- source={{ uri: data?.image_artist }} />
439
- </Pressable>
440
- }
441
- <View style={applyStyle({ marginTop: 10, marginLeft: 17, flexDirection: 'row' })}>
438
+ <EventQueue event_id={result?.event_id}>
439
+ <View style={{ flex: 1 }} >
440
+ <EventHeader title={esp.lang("event/artist_detail", "title")} subtitle={result?.title} />
441
+ <LibScroll onRefresh={loadResult}>
442
442
  {
443
- share.map(renderShare)
443
+ result && result?.images_artist && result?.images_artist?.length > 0 ?
444
+ <LibCarrousel
445
+ delay={3000}
446
+ style={{ height: bgHeight, width: LibStyle.width }}
447
+ autoplay
448
+ bullets
449
+ bulletStyle={{ width: 7, height: 7, backgroundColor: "#fff", borderRadius: 3.5, borderWidth: 0, marginHorizontal: 2 }}
450
+ chosenBulletStyle={{ width: 7, height: 7, backgroundColor: "#f4e31b", borderRadius: 3.5, borderWidth: 0, marginHorizontal: 2 }}
451
+ bulletsContainerStyle={{ marginBottom: -10 }}>
452
+ {
453
+ result?.images_artist && result?.images_artist?.map(renderImages)
454
+ }
455
+ </LibCarrousel>
456
+ :
457
+ <Pressable onPress={() => LibNavigation.navigate('lib/gallery', { image: result?.image_artist })} >
458
+ <LibPicture
459
+ style={applyStyle({ height: LibStyle.width * 9 / 16, width: LibStyle.width, backgroundColor: '#f2f3f4' })}
460
+ source={{ uri: result?.image_artist }} />
461
+ </Pressable>
444
462
  }
445
- </View>
446
- <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>
447
- {/* {
463
+ <View style={applyStyle({ marginTop: 10, marginLeft: 17, flexDirection: 'row' })}>
464
+ {
465
+ share.map(renderShare)
466
+ }
467
+ </View>
468
+ <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>
469
+ {/* {
448
470
  data && priceList?.map?.(renderPrieList)
449
471
  } */}
450
- {
451
- data?.description != "" &&
452
- <ScrollView>
453
- <LibWebview onFinishLoad={() => { }} source={{ html: data?.description }} />
454
- </ScrollView>
455
- }
456
- {
457
- data && data?.youtube != "" &&
458
- <>
459
- <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>
460
- <TouchableOpacity onPress={() => LibNavigation.navigate('lib/video', { code: data?.youtube })} >
461
- <LibPicture source={{ uri: LibVideoProperty.getUrlThumbnail(data?.youtube) }} style={applyStyle({ height: LibStyle.width * 9 / 16, width: LibStyle.width - 40, marginHorizontal: 20, resizeMode: 'cover' })} />
462
- </TouchableOpacity>
463
- </>
464
- }
465
- </ScrollView>
466
- <View style={applyStyle({ flexDirection: 'row', padding: 10, backgroundColor: 'white' })} >
472
+ {
473
+ result?.description != "" &&
474
+ <ScrollView>
475
+ <LibWebview onFinishLoad={() => { }} source={{ html: getResult()?.description }} />
476
+ </ScrollView>
477
+ }
478
+ {
479
+ result && result?.youtube != "" &&
480
+ <>
481
+ <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>
482
+ <TouchableOpacity onPress={() => LibNavigation.navigate('lib/video', { code: getResult()?.youtube })} >
483
+ <LibPicture source={{ uri: LibVideoProperty.getUrlThumbnail(getResult()?.youtube) }} style={applyStyle({ height: LibStyle.width * 9 / 16, width: LibStyle.width - 40, marginHorizontal: 20, resizeMode: 'cover' })} />
484
+ </TouchableOpacity>
485
+ </>
486
+ }
487
+ </LibScroll>
488
+ <View style={applyStyle({ flexDirection: 'row', padding: 10, backgroundColor: 'white' })} >
467
489
 
468
- {
469
- data?.book_available == 1 ?
470
- <EventButton label={esp.lang("event/artist_detail", "buy_ticket")} onPress={() => {
471
- EventIndexProperty.isLogin(() => {
472
- showSchedule.current?.show()
473
- })
474
- }} style={applyStyle({ backgroundColor: LibStyle.colorGreen })} />
475
- :
476
- <View style={applyStyle({ flex: 1, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 })} >
477
- <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>
478
- </View>
479
- }
480
- </View>
490
+ {
491
+ result?.book_available == 1 ?
492
+ <EventButton label={esp.lang("event/artist_detail", "buy_ticket")} onPress={() => {
493
+ EventIndexProperty.isLogin(() => {
494
+ showSchedule.current?.show()
495
+ })
496
+ }} style={applyStyle({ backgroundColor: LibStyle.colorGreen })} />
497
+ :
498
+ <View style={applyStyle({ flex: 1, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 })} >
499
+ <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>
500
+ </View>
501
+ }
502
+ </View>
481
503
 
482
- <LibSlidingup ref={showSchedule}>
483
- <View style={applyStyle({ backgroundColor: 'white', borderTopRightRadius: 30, borderTopLeftRadius: 30, paddingTop: 15, maxHeight: LibStyle.height - (LibStyle.height / 3) })}>
484
- <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>
485
- <ScrollView showsVerticalScrollIndicator={false} >
486
- {
487
- priceList?.length > 0 && sortByStatus(priceList)?.map((item: any, i: number) => {
488
- let filterFullData = priceList?.filter((it: any) => it.status != 0)
489
- const displayedData = showAll[item.price_id] ? item?.list : item?.list.slice(0, maxDisplay);
490
-
491
- let textOpacity = item?.status == 1 ? 1 : 0.3
492
- let selTic = item.price_id == selectedTicket?.price_id
493
- let ticketWithDate = item.price_date == 1 && item.use_code == 0
494
- return (
495
- <Pressable onPress={() => {
496
-
497
- }} key={i} style={{ overflow: 'hidden', margin: 15, marginBottom: 5, backgroundColor: '#fff', borderRadius: 10, ...LibStyle.elevation(2), borderWidth: 1, borderColor: selTic ? LibStyle.colorBlue : LibStyle.colorBgGrey }}>
498
- <View style={{ padding: 10, backgroundColor: '#f1f2f3', borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
499
- {
500
- item?.hasOwnProperty('label') && (item?.label != "" && item?.label != null) &&
501
- <View style={applyStyle({ flexDirection: 'row' })}>
502
- <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 })}>
503
- <Text allowFontScaling={false} style={{ fontSize: 10, fontStyle: "normal", letterSpacing: 0.5, color: EventOrder_itemProperty.textColor(item?.label_color), fontWeight: 'bold' }}>{item?.label}</Text>
504
- </View>
505
- </View>
506
- }
507
- <View style={{ alignContent: 'center', alignItems: 'center', flexDirection: 'row', justifyContent: 'space-between', }}>
508
- <EventHtmltext allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.type}</EventHtmltext>
509
- {
510
- item.qty_min > 1 &&
511
- <Text style={{ color: LibStyle.colorRed, fontSize: 10, fontWeight: 'normal' }}> {"(" + esp.lang("event/ticket_list", "min_order") + LibUtils.number(item.qty_min) + ")"}</Text>
512
- }
504
+ <LibSlidingup ref={showSchedule}>
505
+ <View style={applyStyle({ backgroundColor: 'white', borderTopRightRadius: 30, borderTopLeftRadius: 30, paddingTop: 15, maxHeight: LibStyle.height - (LibStyle.height / 3) })}>
506
+ <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>
507
+ <ScrollView showsVerticalScrollIndicator={false} >
508
+ {
509
+ priceList?.length > 0 && sortByStatus(priceList)?.map((item: any, i: number) => {
510
+ let filterFullData = priceList?.filter((it: any) => it.status != 0)
511
+ const displayedData = showAll[item.price_id] ? item?.list : item?.list.slice(0, maxDisplay);
512
+
513
+ let textOpacity = item?.status == 1 ? 1 : 0.3
514
+ let selTic = item.price_id == selectedTicket?.price_id
515
+ let ticketWithDate = item.price_date == 1 && item.use_code == 0
516
+ return (
517
+ <Pressable onPress={() => {
518
+
519
+ }} key={i} style={{ overflow: 'hidden', margin: 15, marginBottom: 5, backgroundColor: '#fff', borderRadius: 10, ...LibStyle.elevation(2), borderWidth: 1, borderColor: selTic ? LibStyle.colorBlue : LibStyle.colorBgGrey }}>
520
+ <View style={{ padding: 10, backgroundColor: '#f1f2f3', borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
513
521
  {
514
- item?.status != 1 &&
522
+ item?.hasOwnProperty('label') && (item?.label != "" && item?.label != null) &&
515
523
  <View style={applyStyle({ flexDirection: 'row' })}>
516
- <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 })}>
517
- <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>
524
+ <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 })}>
525
+ <Text allowFontScaling={false} style={{ fontSize: 10, fontStyle: "normal", letterSpacing: 0.5, color: EventOrder_itemProperty.textColor(item?.label_color), fontWeight: 'bold' }}>{item?.label}</Text>
526
+ </View>
527
+ </View>
528
+ }
529
+ <View style={{ alignContent: 'center', alignItems: 'center', flexDirection: 'row', justifyContent: 'space-between', }}>
530
+ <EventHtmltext allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.type}</EventHtmltext>
531
+ {
532
+ item.qty_min > 1 &&
533
+ <Text style={{ color: LibStyle.colorRed, fontSize: 10, fontWeight: 'normal' }}> {"(" + esp.lang("event/ticket_list", "min_order") + LibUtils.number(item.qty_min) + ")"}</Text>
534
+ }
535
+ {
536
+ item?.status != 1 &&
537
+ <View style={applyStyle({ flexDirection: 'row' })}>
538
+ <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 })}>
539
+ <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>
540
+ </View>
518
541
  </View>
542
+ }
543
+ </View>
544
+ {
545
+ item.info != "" && ticketWithDate &&
546
+ <View style={{ marginTop: 3, alignContent: 'center', alignItems: 'center', flexDirection: 'row', marginRight: 5 }}>
547
+ <Text allowFontScaling={false} style={{ fontSize: 12, color: LibStyle.colorBlue }}>{item.info}</Text>
519
548
  </View>
520
549
  }
521
550
  </View>
522
551
  {
523
- item.info != "" && ticketWithDate &&
524
- <View style={{ marginTop: 3, alignContent: 'center', alignItems: 'center', flexDirection: 'row', marginRight: 5 }}>
525
- <Text allowFontScaling={false} style={{ fontSize: 12, color: LibStyle.colorBlue }}>{item.info}</Text>
526
- </View>
552
+ displayedData?.map((itemT: any, iT: number) => renderItem(item, itemT, iT))
527
553
  }
528
- </View>
529
- {
530
- displayedData?.map((itemT: any, iT: number) => renderItem(item, itemT, iT))
531
- }
532
554
 
533
- {
534
- filterFullData?.[i]?.list?.length > 3 &&
535
- <TouchableOpacity onPress={() => {
536
- handleShowAll(item.price_id)
537
- }} style={{ borderTopColor: LibStyle.colorGrey, borderTopWidth: 0.8, flex: 1, padding: 8, flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
538
- <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>
539
- <LibIcon name={showAll[item.price_id] ? 'chevron-up-circle-outline' : 'chevron-down-circle-outline'} color={LibStyle.colorBlue} size={18} />
540
- </TouchableOpacity>
541
- }
555
+ {
556
+ filterFullData?.[i]?.list?.length > 3 &&
557
+ <TouchableOpacity onPress={() => {
558
+ handleShowAll(item.price_id)
559
+ }} style={{ borderTopColor: LibStyle.colorGrey, borderTopWidth: 0.8, flex: 1, padding: 8, flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
560
+ <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>
561
+ <LibIcon name={showAll[item.price_id] ? 'chevron-up-circle-outline' : 'chevron-down-circle-outline'} color={LibStyle.colorBlue} size={18} />
562
+ </TouchableOpacity>
563
+ }
542
564
 
543
- </Pressable>
544
- )
545
- })
546
- }
547
- </ScrollView>
548
- <View style={applyStyle({ paddingVertical: 10 })} >
549
- {
550
- data?.price_type_info != "" &&
551
- <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>
552
- }
553
- {
554
- data?.book_available == 1 ?
555
- <>
556
- {
557
- data?.book_available == 0 && data.end_booking <= date && data.end_booking != '0000-00-00 00:00:00' ?
558
- <View style={applyStyle({ flex: 1, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 })} >
559
- <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>
560
- </View>
561
- :
562
- <>
563
- {
564
- loading ?
565
- <View style={{ minWidth: '100%', alignSelf: 'center' }} >
566
- <View style={{ borderWidth: 1, borderColor: 'rgba(0, 0, 0, 0)', height: 40, borderRadius: 16, backgroundColor: "#e6e6e6", alignItems: 'center', justifyContent: 'center', paddingHorizontal: 9 }} >
567
- <ActivityIndicator size={"small"} color={LibStyle.colorPrimary} />
565
+ </Pressable>
566
+ )
567
+ })
568
+ }
569
+ </ScrollView>
570
+ <View style={applyStyle({ paddingVertical: 10 })} >
571
+ {
572
+ result?.price_type_info != "" &&
573
+ <Text allowFontScaling={false} style={applyStyle({ marginLeft: 15, marginBottom: 10, fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: LibStyle.colorBlue })} >{result?.hasOwnProperty("price_type_info") && result?.price_type_info}</Text>
574
+ }
575
+ {
576
+ result?.book_available == 1 ?
577
+ <>
578
+ {
579
+ result?.book_available == 0 && result.end_booking <= date && result.end_booking != '0000-00-00 00:00:00' ?
580
+ <View style={applyStyle({ flex: 1, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 })} >
581
+ <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>
582
+ </View>
583
+ :
584
+ <>
585
+ {
586
+ loading ?
587
+ <View style={{ minWidth: '100%', alignSelf: 'center' }} >
588
+ <View style={{ borderWidth: 1, borderColor: 'rgba(0, 0, 0, 0)', height: 40, borderRadius: 16, backgroundColor: "#e6e6e6", alignItems: 'center', justifyContent: 'center', paddingHorizontal: 9 }} >
589
+ <ActivityIndicator size={"small"} color={LibStyle.colorPrimary} />
590
+ </View>
568
591
  </View>
569
- </View>
570
- :
571
- <EventButton label={esp.lang("event/artist_detail", "buy_ticket")} onPress={() => {
572
- EventIndexProperty.isLogin(() => {
573
- proceedToPayment()
574
- })
575
- }} style={{ backgroundColor: LibStyle.colorGreen, marginTop: 2, marginHorizontal: 15 }} />
576
- }
577
- </>
578
- }
579
- </>
580
- :
581
- <View style={applyStyle({ flex: 1, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 })} >
582
- <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>
583
- </View>
584
- }
592
+ :
593
+ <EventButton label={esp.lang("event/artist_detail", "buy_ticket")} onPress={() => {
594
+ EventIndexProperty.isLogin(() => {
595
+ proceedToPayment()
596
+ })
597
+ }} style={{ backgroundColor: LibStyle.colorGreen, marginTop: 2, marginHorizontal: 15 }} />
598
+ }
599
+ </>
600
+ }
601
+ </>
602
+ :
603
+ <View style={applyStyle({ flex: 1, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 })} >
604
+ <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>
605
+ </View>
606
+ }
607
+ </View>
585
608
  </View>
586
- </View>
587
- </LibSlidingup>
609
+ </LibSlidingup>
588
610
 
589
- </View>
611
+ </View>
612
+ </EventQueue>
590
613
  )
591
614
  }