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
@@ -11,7 +11,6 @@ import { LibCarrousel } from 'esoftplay/cache/lib/carrousel/import';
11
11
  import { LibCurl } from 'esoftplay/cache/lib/curl/import';
12
12
  import { LibIcon } from 'esoftplay/cache/lib/icon/import';
13
13
  import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
14
- import { LibObject } from 'esoftplay/cache/lib/object/import';
15
14
  import { LibPicture } from 'esoftplay/cache/lib/picture/import';
16
15
  import { LibProgress } from 'esoftplay/cache/lib/progress/import';
17
16
  import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
@@ -38,7 +37,7 @@ export default function m(props: EventArtist_detailv2Props): any {
38
37
  const [detailArtist, setDetailArtist] = useSafeState<any>()
39
38
 
40
39
  let showSchedule = React.useRef<LibSlidingup>(null)
41
- const [selectedTicket, setSelectedTicket, getSelectedTicket] = useSafeState<any>()
40
+ const [, setSelectedTicket, getSelectedTicket] = useSafeState<any[]>([])
42
41
  const [showAll, setShowAll] = useSafeState<any>({});
43
42
  const [qty, setQty] = useSafeState<any>(1)
44
43
  const [refreshing, setRefreshing] = useSafeState<boolean>(false);
@@ -47,10 +46,11 @@ export default function m(props: EventArtist_detailv2Props): any {
47
46
  loadDataArtist()
48
47
  }, [])
49
48
 
50
- esp.log({ priceList, detailArtist });
49
+ // esp.log({ priceList, detailArtist });
51
50
 
52
51
  function loadDataArtist(): void {
53
52
  new LibCurl(url, null, (res) => {
53
+ esp.log({ res, url });
54
54
  setRefreshing(false)
55
55
  setDetailArtist(res)
56
56
  loadDataPrice(res?.url_price)
@@ -81,7 +81,7 @@ export default function m(props: EventArtist_detailv2Props): any {
81
81
 
82
82
  function loadDataPriceConfig(url: string) {
83
83
  let post = {
84
- price_ids: selectedTicket?.price_id,
84
+ price_ids: "1",
85
85
  event_id: 443
86
86
  }
87
87
  LibProgress.show("Mohon tunggu")
@@ -104,77 +104,136 @@ export default function m(props: EventArtist_detailv2Props): any {
104
104
  };
105
105
 
106
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
- }
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
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
- }
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
122
 
123
123
  function onRefresh() {
124
124
  setRefreshing(true)
125
125
  loadDataArtist()
126
126
  }
127
127
 
128
- function renderItem(item: any, itemT: any, iT: number) {
128
+ function selectTicket(priceTypeItem: any, ticket: any, isMultiple: number) {
129
+ const selectedData = {
130
+ ...ticket,
131
+ qty: Number(priceTypeItem.qty_min),
132
+ qty_min: Number(priceTypeItem?.qty_min),
133
+ qty_max: Number(priceTypeItem?.qty_max),
134
+ list_id: ticket.list_id,
135
+ subtotal: Number(ticket.price) * Number(priceTypeItem.qty_min),
136
+ type: priceTypeItem?.type,
137
+ tax: priceTypeItem?.tax,
138
+ term: priceTypeItem?.term,
139
+ has_addition: priceTypeItem?.has_addition,
140
+ image_map: priceTypeItem?.image_map,
141
+ use_seat: priceTypeItem?.use_seat,
142
+ adjacent_seats: priceTypeItem?.config?.seat_autopick,
143
+ fee_amount: priceTypeItem?.fee_amount,
144
+ fee_type: priceTypeItem?.fee_type,
145
+ // event_id: availableResult?.id
146
+ }
147
+
148
+ setSelectedTicket((prev: any) => {
149
+ const alreadySelected = prev.some((x: any) => x.list_id == ticket.list_id)
150
+
151
+ // SINGLE
152
+ if (isMultiple != 1) {
153
+
154
+ // klik lagi = unselect
155
+ if (alreadySelected) {
156
+ return []
157
+ }
158
+
159
+ // replace semua
160
+ return [selectedData]
161
+ }
162
+
163
+ // MULTIPLE
164
+ // remove
165
+ if (alreadySelected) {
166
+ return prev.filter((x: any) => x.list_id != ticket.list_id)
167
+ }
168
+
169
+ // add
170
+ return [...prev, selectedData]
171
+ })
172
+ }
173
+
174
+ function getTicketStatusMessage(priceTypeItem: any, ticket: any) {
175
+ const status = priceTypeItem.status != 1 ? priceTypeItem.status : ticket.status
176
+
177
+ switch (status) {
178
+ case 2:
179
+ return "Segera Hadir"
180
+
181
+ case 0:
182
+ return "Habis terjual"
183
+
184
+ default:
185
+ return ""
186
+ }
187
+ }
188
+
189
+ function renderItem(itemC: any, iC: any, item: any) {
129
190
  let ticketWithDate = item.price_date == 1 && item.use_code == 0
130
191
  let ticketSpecial = item.price_date == 0 && item.use_code == 0
131
192
 
132
- let _selectedTicket = item.price_id == selectedTicket?.price_id && itemT.index_id == selectedTicket?.list?.index_id
193
+ // let _selectedTicket = item.price_id == selectedTicket?.price_id && itemC?.index_id == selectedTicket?.list?.index_id
194
+ let _selectedTicket = getSelectedTicket()?.find((x: any) => x.list_id == itemC.list_id)
195
+ // const qty = _selectedTicket?.qty || 0
196
+ let isMultiple = 1
197
+
133
198
 
134
199
  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
200
+ let colorBackground = item?.status != 1 ? LibStyle.colorLightGrey : itemC?.status != 1 ? LibStyle.colorLightGrey : colorDefault
201
+ let textOpacity = /* item?.status == 1 ? 1 : */ itemC?.status == 1 ? 1 : 0.3
137
202
 
138
203
  return (
139
204
  <TouchableOpacity
140
205
  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)
206
+ const isAvailable = item.status == 1 && itemC.status == 1
207
+
208
+ if (!isAvailable) {
209
+ LibToastProperty.show(getTicketStatusMessage(item, itemC))
210
+ return
155
211
  }
156
- }} activeOpacity={itemT?.status == 1 ? 0 : 1} key={iT} style={{ flex: 1, flexDirection: 'row', backgroundColor: colorBackground, justifyContent: 'space-between', padding: 10, alignItems: 'center' }}>
212
+ selectTicket(item, itemC, isMultiple)
213
+
214
+
215
+ }} activeOpacity={itemC?.status == 1 ? 0 : 1} key={iC} style={{ flex: 1, flexDirection: 'row', backgroundColor: colorBackground, justifyContent: 'space-between', padding: 10, alignItems: 'center' }}>
157
216
  {
158
- itemT.ondate == "0000-00-00" ?
217
+ itemC?.ondate == "0000-00-00" ?
159
218
  <LibPicture source={esp.assets('icons/ic_special2.png')} style={{ height: 42, width: 42 }} />
160
219
  :
161
220
  <>
162
221
  <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>
222
+ <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(itemC?.ondate).localeFormat('DD')}</Text>
164
223
  </View>
165
224
  <View style={applyStyle({ flexDirection: 'column', flex: 1 })}>
166
225
  {
167
- item?.status == 1 && itemT?.status != 1 &&
226
+ item?.status == 1 && itemC?.status != 1 &&
168
227
  <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>
228
+ <View style={applyStyle({ alignContent: 'center', alignItems: 'center', justifyContent: 'center', marginTop: 5, borderWidth: 1, backgroundColor: itemC?.status == 0 ? LibStyle.colorRed : "#4cd964", borderColor: itemC?.status == 0 ? LibStyle.colorRed : "#4cd964", borderRadius: 5, padding: 3, opacity: 0.8 })}>
229
+ <Text allowFontScaling={false} style={applyStyle({ fontSize: 10, fontStyle: "normal", letterSpacing: 0, color:/* itemC?.status == 2 ? "#000" : */"#fff", fontWeight: 'bold' })}>{itemC?.status == 0 ? esp.lang("event/artist_detail", "sold_out") : esp.lang("event/artist_detail", "coming_soon")}</Text>
171
230
  </View>
172
231
  </View>
173
232
  }
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>
233
+ <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemC?.ondate).localeFormat('dddd')}</Text>
175
234
  <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>
235
+ <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemC?.ondate).localeFormat('MMMM')}</Text>
236
+ <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(itemC?.ondate).localeFormat('YYYY')}</Text>
178
237
  </View>
179
238
  </View>
180
239
  </>
@@ -182,19 +241,19 @@ export default function m(props: EventArtist_detailv2Props): any {
182
241
 
183
242
  <View style={applyStyle({ marginRight: 5, marginLeft: 5, flexDirection: 'column' })} >
184
243
  {
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>
244
+ (itemC?.status == 1 || itemC?.status == 0) &&
245
+ <Text allowFontScaling={false} style={applyStyle({ opacity: ticketWithDate ? textOpacity : 1, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "right", color: _selectedTicket ? "#3ea4dc" : (itemC?.price == 0 ? LibStyle.colorGreen : '#999') })} >{itemC?.price == 0 ? esp.lang("event/ticket_list", "free") : LibUtils.money(itemC?.price, item.currency)}</Text>
187
246
  }
188
247
  {
189
248
  item?.status == 1 && (ticketWithDate || ticketSpecial) && _selectedTicket &&
190
249
  <View style={applyStyle({ marginTop: 4, flexDirection: 'row', marginLeft: 8, alignContent: 'center', alignItems: 'center' })}>
191
- <TouchableOpacity onPress={() => { min() }}>
250
+ <TouchableOpacity onPress={() => { /* min() */ }}>
192
251
  <View style={applyStyle({ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
193
252
  <LibIcon name="minus" color="#e74c3c" />
194
253
  </View>
195
254
  </TouchableOpacity>
196
255
  <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() }}>
256
+ <TouchableOpacity onPress={() => { /* add() */ }}>
198
257
  <View style={applyStyle({ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
199
258
  <LibIcon name="plus" color="#16a085" />
200
259
  </View>
@@ -319,47 +378,48 @@ export default function m(props: EventArtist_detailv2Props): any {
319
378
  <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
379
  <ScrollView showsVerticalScrollIndicator={false} >
321
380
  {
322
- priceList?.map((item: any, i: number) => {
381
+ priceList?.map((priceType: any, i: number) => {
323
382
  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
383
+ const displayedData = showAll[priceType.price_id] ? priceType?.list : priceType?.list.slice(0, maxDisplay);
384
+ let textOpacity = priceType?.status == 1 ? 1 : 0.3
385
+ let _selectedTicket = getSelectedTicket()?.some((x: any) => x.price_id == priceType.price_id)
386
+
327
387
  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 }}>
388
+ <View key={i} style={{ overflow: 'hidden', margin: 15, marginBottom: 5, backgroundColor: '#fff', borderRadius: 10, ...LibStyle.elevation(2), borderWidth: 1, borderColor: _selectedTicket ? LibStyle.colorBlue : LibStyle.colorBgGrey }}>
329
389
  <View style={{ padding: 10, backgroundColor: '#f1f2f3', borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
330
390
  <View style={{ alignContent: 'center', alignItems: 'center', flexDirection: 'row', justifyContent: 'space-between', }}>
331
- <EventHtmltext allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.name}</EventHtmltext>
391
+ <EventHtmltext allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{priceType.name}</EventHtmltext>
332
392
  {
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>
393
+ priceType.qty_min > 1 &&
394
+ <Text style={{ color: LibStyle.colorRed, fontSize: 10, fontWeight: 'normal' }}> {"(" + esp.lang("event/ticket_list", "min_order") + LibUtils.number(priceType.qty_min) + ")"}</Text>
335
395
  }
336
396
  {
337
- item?.status != 1 &&
397
+ priceType?.status != 1 &&
338
398
  <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>
399
+ <View style={applyStyle({ alignContent: 'center', alignItems: 'center', justifyContent: 'center', borderWidth: 1, backgroundColor: priceType?.status == 0 ? LibStyle.colorRed : "#4cd964", borderColor: priceType?.status == 0 ? LibStyle.colorRed : "#4cd964", borderRadius: 5, padding: 3, opacity: 0.8 })}>
400
+ <Text allowFontScaling={false} style={applyStyle({ fontSize: 10, fontStyle: "normal", letterSpacing: 0, color: /* priceType?.status == 2 ? "#000" : */ "#fff", fontWeight: 'bold' })}>{priceType?.status == 0 ? esp.lang("event/artist_detail", "sold_out") : esp.lang("event/artist_detail", "coming_soon")}</Text>
341
401
  </View>
342
402
  </View>
343
403
  }
344
404
  </View>
345
405
  {
346
- item.hasOwnProperty("price_type_info") && item.price_type_info != "" &&
406
+ priceType.hasOwnProperty("price_type_info") && priceType.price_type_info != "" &&
347
407
  <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>
408
+ <Text allowFontScaling={false} style={{ fontSize: 12, color: LibStyle.colorBlue }}>{priceType.price_type_info}</Text>
349
409
  </View>
350
410
  }
351
411
  </View>
352
412
 
353
413
  {
354
- displayedData?.map((itemT: any, iT: number) => renderItem(item, itemT, iT))
414
+ displayedData?.map((itemC: any, iC: number) => renderItem(itemC, iC, priceType))
355
415
  }
356
416
  {
357
417
  filterFullData?.[i]?.list?.length > 3 &&
358
418
  <TouchableOpacity onPress={() => {
359
- handleShowAll(item.price_id)
419
+ handleShowAll(priceType.price_id)
360
420
  }} 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} />
421
+ <Text allowFontScaling={false} style={{ marginRight: 5, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: LibStyle.colorBlue }}>{showAll[priceType.price_id] ? esp.lang("event/ticket_list", "see_less") : esp.lang("event/ticket_list", "see_more")}</Text>
422
+ <LibIcon name={showAll[priceType.price_id] ? 'chevron-up-circle-outline' : 'chevron-down-circle-outline'} color={LibStyle.colorBlue} size={18} />
363
423
  </TouchableOpacity>
364
424
  }
365
425
 
@@ -371,9 +431,9 @@ export default function m(props: EventArtist_detailv2Props): any {
371
431
  <View style={applyStyle({ paddingVertical: 10 })} >
372
432
  <EventButton label={esp.lang("event/artist_detail", "buy_ticket")} onPress={() => {
373
433
  EventIndexProperty.isLogin(() => {
374
- if (selectedTicket) {
375
- loadDataPriceConfig(selectedTicket?.url_config)
376
- }
434
+ // if (selectedTicket) {
435
+ // loadDataPriceConfig(selectedTicket?.url_config)
436
+ // }
377
437
  // proceedToPayment()
378
438
  })
379
439
  }} style={{ backgroundColor: LibStyle.colorGreen, marginTop: 2, marginHorizontal: 15 }} />
@@ -39,19 +39,10 @@ export default function m(props: EventArtistv2Props): any {
39
39
  /* get detail event untuk dapat config antrian */
40
40
 
41
41
  // new LibCurl(url, null,
42
- new LibCurl('v2/event_artist&event_id=443', null,
42
+ new LibCurl('v2/event_artist&event_id=523', null,
43
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
44
  setResult(res)
45
+ esp.log(res);
55
46
  }, (err) => {
56
47
  setError(err?.message)
57
48
  }, 1)
@@ -86,7 +77,8 @@ export default function m(props: EventArtistv2Props): any {
86
77
  // autoPass: false,
87
78
  // });
88
79
  // }
89
- // EventCountdownProperty.countdownTime.set(moment().add(EventFirebase_socketProperty.eventQueueConfig.get(item?.event_id).time, 'seconds').localeFormat('YYYY-MM-DD HH:mm:ss'));
80
+ // const expTimestamp = Date.now() + (Number(EventFirebase_socketProperty.eventQueueConfig.get(item?.event_id).time) * 1000);
81
+ // EventCountdownProperty.countdownTime.set(expTimestamp)
90
82
  LibNavigation.navigate(
91
83
  item?.config?.multiprice == 1
92
84
  ? 'event/artist_detail_multi'
@@ -120,7 +112,7 @@ export default function m(props: EventArtistv2Props): any {
120
112
  } else if (item?.images?.length == 1) {
121
113
  return (
122
114
  <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] }} />
115
+ <LibPicture style={{ opacity: isNotAvailable ? 0.3 : 1, height: sliderHeight, width: width, resizeMode: 'cover', backgroundColor: "#f1f2f3" }} source={{ uri: item.images[0] }} />
124
116
  </TouchableOpacity>
125
117
  )
126
118
  } else {
package/event/button.tsx CHANGED
@@ -25,12 +25,12 @@ export default function m(props: EventButtonProps): any {
25
25
  <Pressable testID={props.testID} onPress={() => props.onPress()} style={{ minWidth: '100%', alignSelf: 'center' }} >
26
26
  {
27
27
  props.icon ?
28
- <View style={[{ borderWidth: 1, borderColor: props.borderColor ? props.borderColor : 'rgba(0, 0, 0, 0)', height: 40, borderRadius: 16, backgroundColor: props.backgroundColor || "#6c432c", flexDirection: 'row', alignItems: 'center', paddingHorizontal: 9 }, props.style]} >
28
+ <View style={[{ borderWidth: 1, borderColor: props.borderColor ? props.borderColor : 'rgba(0, 0, 0, 0)', height: 40, borderRadius: 5, backgroundColor: props.backgroundColor || "#6c432c", flexDirection: 'row', alignItems: 'center', paddingHorizontal: 9 }, props.style]} >
29
29
  <LibPicture source={esp.assets(props.icon)} style={{ width: 18, height: 18, resizeMode: 'contain' }} />
30
30
  <Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: 'white', flex: 1, marginRight: 30, marginLeft: 10 }} >{props.label}</Text>
31
31
  </View>
32
32
  :
33
- <View style={[{ borderWidth: 1, borderColor: props.borderColor ? props.borderColor : 'rgba(0, 0, 0, 0)', height: 40, borderRadius: 17, backgroundColor: props.backgroundColor || "#6c432c", justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 }, props.style]} >
33
+ <View style={[{ borderWidth: 1, borderColor: props.borderColor ? props.borderColor : 'rgba(0, 0, 0, 0)', height: 40, borderRadius: 5, backgroundColor: props.backgroundColor || "#6c432c", justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 }, props.style]} >
34
34
  <Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: props.fontColor ? props.fontColor : 'white', marginRight: 10, marginLeft: 10 }} >{props.label}</Text>
35
35
  </View>
36
36
  }
@@ -14,30 +14,42 @@ export interface EventButton_order_detailArgs {
14
14
  export interface EventButton_order_detailProps {
15
15
  onPress: () => void
16
16
  title: string
17
+ subtitle?: string
17
18
  info?: string
18
19
  color: any,
19
- icon: any
20
+ icon: any,
21
+ disable?: boolean
22
+ status_message?: string
20
23
  }
21
24
  export default function m(props: EventButton_order_detailProps): any {
22
25
  return (
23
- <TouchableOpacity onPress={props.onPress}>
26
+ <TouchableOpacity onPress={props.onPress} activeOpacity={props.disable == true ? 1 : 0}>
24
27
  <View style={{ borderWidth: 1, borderColor: '#ccc', margin: 15, borderRadius: 7, marginBottom: 0, overflow: 'hidden', flexDirection: 'row' }}>
25
28
  <LibGradient
26
- colors={[props.color, props.color, "#f1f2f3",]}
29
+ colors={props.disable ? [LibStyle.colorBgGrey, LibStyle.colorBgGrey, "#f1f2f3"] : [props.color, props.color, "#f1f2f3",]}
27
30
  direction='left-to-right'
28
31
  style={{ margin: 3, borderRadius: 5, padding: 7, flex: 4, alignContent: 'center', justifyContent: 'center' }}
29
32
  >
30
- <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode='tail' style={{ color: EventOrder_itemProperty.textColor(props?.color), fontSize: 16, fontWeight: 'bold' }}>{props.title}</Text>
33
+ <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode='tail' style={{ color: props?.disable ? "#adb5bd" : EventOrder_itemProperty.textColor(props?.color), fontSize: 16, fontWeight: 'bold' }}>{props.title}</Text>
34
+ {
35
+ props.subtitle && props.subtitle != "" &&
36
+ < Text allowFontScaling={false} style={{ fontSize: 11, color: props?.disable ? "#adb5bd" : EventOrder_itemProperty.textColor(props?.color), fontWeight: 'bold', textTransform: 'uppercase', letterSpacing: 1.5, }}>{props.subtitle}</Text>
37
+ }
38
+
31
39
  {
32
40
  props.info != "" &&
33
- <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode='tail' style={{ color: EventOrder_itemProperty.textColor(props?.color), fontSize: 12, fontWeight: 'normal' }}>{props?.info}</Text>
41
+ <Text allowFontScaling={false} ellipsizeMode='tail' style={{ color: props?.disable ? "#adb5bd" : EventOrder_itemProperty.textColor(props?.color), fontSize: 12, fontWeight: 'normal' }}>{props?.info}</Text>
42
+ }
43
+ {
44
+ props.status_message && props.status_message != "" &&
45
+ <Text allowFontScaling={false} ellipsizeMode='tail' style={{ color: LibStyle.colorRed, fontSize: 12, fontWeight: 'normal' }}>{props?.status_message}</Text>
34
46
  }
35
47
  </LibGradient>
36
- <View style={{ flex: 1, margin: 3, borderRadius: 5, ...LibStyle.elevation(2), backgroundColor: props.color, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
48
+ <View style={{ flex: 1, margin: 3, borderRadius: 5, ...LibStyle.elevation(2), backgroundColor: props.disable ? LibStyle.colorBgGrey : props.color, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
37
49
  {/* <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 }} />
50
+ <LibIcon name={props.icon} size={35} color={props?.disable ? "#adb5bd" : EventOrder_itemProperty.textColor(props?.color)} style={{ opacity: 1 }} />
39
51
  </View>
40
52
  </View>
41
- </TouchableOpacity>
53
+ </TouchableOpacity >
42
54
  )
43
55
  }
package/event/capture.tsx CHANGED
@@ -19,6 +19,8 @@ export default class m {
19
19
  const uriArray = images.split("/");
20
20
  const nameToChange = uriArray[uriArray.length - 1];
21
21
  const renamedURI = images.replace(nameToChange, name.replace(/\s/g, '_') + ".jpg");
22
+
23
+
22
24
  if (Platform.OS == 'ios') {
23
25
  MediaLibrary.saveToLibraryAsync(images)
24
26
  LibToastProperty.show(esp.lang("lib/capture", "saved_to_gallery"))
@@ -0,0 +1,135 @@
1
+ // useLibs
2
+ // noPage
3
+
4
+ import { EventConfigProperty } from "esoftplay/cache/event/config/import"
5
+ import { LibCurl } from "esoftplay/cache/lib/curl/import"
6
+ import { LibNavigation } from "esoftplay/cache/lib/navigation/import"
7
+ import { LibToastProperty } from "esoftplay/cache/lib/toast/import"
8
+ import esp from "esoftplay/esp"
9
+ import useGlobalState from "esoftplay/global"
10
+
11
+
12
+ export interface EventCheckout {
13
+ doPayment: (eventData: any, ticketSelected: any, qty: number, subscribed: any) => void,
14
+ curlPriceConfig: (url: string, price_id: string) => Promise<any>
15
+ }
16
+
17
+ export const loading = useGlobalState<boolean>(false)
18
+
19
+ export default function m(): EventCheckout {
20
+ async function proceedToPayment(eventData: any, ticketSelected: any, qty: number, subscribed: any) {
21
+ if (!ticketSelected) {
22
+ LibToastProperty.show(esp.lang("event/artist_detail", "select_tiket_first"))
23
+ return
24
+ }
25
+
26
+ const event_id = eventData?.event_id || eventData?.id
27
+ let dataPost: any = {
28
+ event_id: event_id,
29
+ event_title: eventData?.event_title || eventData?.title,
30
+ charge_payment: eventData?.charge_payment,
31
+ charge_payment_type: eventData?.charge_payment_type,
32
+ selected_ticket: ticketSelected,
33
+ qty: qty,
34
+ }
35
+
36
+ if (ticketSelected?.config?.seat_autopick == 1 && qty > 1) {
37
+ dataPost.adjacent_seats = 1
38
+ }
39
+
40
+ let finalDataPost = { ...dataPost }
41
+
42
+ if (ticketSelected?.use_seat == 1) {
43
+ if (ticketSelected?.config?.seat_autopick != 1) {
44
+ const seat = await LibNavigation.navigateForResult('event/seat_map_new', {
45
+ url: 'event_seat',
46
+ dataTicket: finalDataPost,
47
+ })
48
+
49
+ finalDataPost = {
50
+ ...finalDataPost,
51
+ seat_label: seat?.seat_label
52
+ }
53
+ }
54
+ }
55
+
56
+
57
+ finalDataPost = await handleAdditionIfNeeded(event_id, ticketSelected, finalDataPost, qty)
58
+ const args = await buildPaymentArgs(eventData, ticketSelected, finalDataPost, qty, subscribed)
59
+ LibNavigation.navigate('payment/ticket', args)
60
+ }
61
+
62
+ function curlPriceConfig(url: string, price_id: string): Promise<any> {
63
+ return new Promise((resolve) => {
64
+ if (!url) {
65
+ resolve({})
66
+ return
67
+ }
68
+
69
+ new LibCurl(
70
+ url,
71
+ null,
72
+ (res) => {
73
+ resolve(res?.[price_id] || {})
74
+ },
75
+ (err) => {
76
+ LibToastProperty.show(err?.message)
77
+ resolve({})
78
+ }
79
+ )
80
+ })
81
+ }
82
+
83
+ async function buildPaymentArgs(data: any, selectedTicket: any, dataPost: any, qty: number, subscribed: any) {
84
+ const eventConfig = EventConfigProperty.state().get()
85
+ loading.set(true)
86
+ const conf = await curlPriceConfig(data?.url_price_config, selectedTicket?.price_id)
87
+ loading.set(false)
88
+
89
+ return {
90
+ order_type: eventConfig?.order_type?.ticket,
91
+ tax: conf?.tax ?? selectedTicket?.tax ?? data?.tax ?? 0,
92
+ dataBookingEvent: { ...dataPost, qty },
93
+ subscribed,
94
+ fee_platform: conf?.fee_platform_amount != null
95
+ ? {
96
+ fee_platform_amount: conf.fee_platform_amount || 0,
97
+ fee_platform_type: conf.fee_platform_type || "NONE",
98
+ }
99
+ : {
100
+ fee_platform_amount: data?.fee_platform_amount || 0,
101
+ fee_platform_type: data?.fee_platform_type || "NONE",
102
+ },
103
+ fee_custom: {
104
+ fee_custom_label: conf?.fee_custom_label || "Custom Fee",
105
+ fee_custom_amount: conf?.fee_custom_amount,
106
+ fee_custom_type: conf?.fee_custom_type,
107
+ }
108
+ }
109
+ }
110
+
111
+ async function handleAdditionIfNeeded(event_id: string, selectedTicket: any, dataPost: any, qty: number) {
112
+ if (selectedTicket?.has_addition != 1) return dataPost
113
+
114
+ const additions = await LibNavigation.navigateForResult(
115
+ 'event/additional',
116
+ {
117
+ type_ticket: selectedTicket?.type,
118
+ ondate: selectedTicket?.list?.ondate,
119
+ event_id: event_id,
120
+ qty,
121
+ data: dataPost,
122
+ price_id: selectedTicket?.price_id
123
+ },
124
+ 221
125
+ )
126
+
127
+ return additions ? { ...dataPost, addition: additions } : dataPost
128
+ }
129
+
130
+ return {
131
+ doPayment: proceedToPayment,
132
+ curlPriceConfig
133
+ }
134
+
135
+ }
@@ -1,6 +1,6 @@
1
1
  // withHooks
2
2
 
3
- import { EventCountdown_base } from 'esoftplay/cache/event/countdown_base/import';
3
+ import { EventCountdown_timestamp } from 'esoftplay/cache/event/countdown_timestamp/import';
4
4
  import { EventFirebase_socket } from 'esoftplay/cache/event/firebase_socket/import';
5
5
  import { EventQueue_pricingProperty } from 'esoftplay/cache/event/queue_pricing/import';
6
6
  import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
@@ -23,6 +23,8 @@ export const countdownTime = useGlobalState<any>('0')
23
23
 
24
24
  export const releaseQueue = useGlobalSubscriber()
25
25
 
26
+ export const eventURI = useGlobalState<string>('')
27
+
26
28
  export default function m(props: EventCountdownProps): any {
27
29
  const [timer] = countdownTime.useState()
28
30
  const routes = UserRoutes.state().useSelector((x) => x?.routes)
@@ -36,6 +38,7 @@ export default function m(props: EventCountdownProps): any {
36
38
  doneQueue(pathQueue, event_id, key, () => { })
37
39
  EventQueue_pricingProperty.state().reset()
38
40
  countdownTime.reset()
41
+ eventURI.reset()
39
42
  }
40
43
  })
41
44
 
@@ -54,18 +57,19 @@ export default function m(props: EventCountdownProps): any {
54
57
  else
55
58
  return (
56
59
  <Animated.View pointerEvents='none' style={[{ position: 'absolute', alignItems: 'center', justifyContent: 'center', top: LibStyle.STATUSBAR_HEIGHT + 61, padding: 1, backgroundColor: LibUtils.hexToRgba(LibStyle.colorGreen, 1), width: '100%' }, animated]} >
57
- <EventCountdown_base
60
+ <EventCountdown_timestamp
58
61
  onExpired={() => {
59
62
  const routeNames = UserRoutes.state()?.get()?.routes?.map?.((x: any) => x.name)
60
- if (routeNames.includes("event/artist"))
61
- LibNavigation.navigate("event/artist")
62
- else if (routeNames.includes("event/detail"))
63
- LibNavigation.navigate("event/detail")
64
- else
65
- LibNavigation.backToRoot()
63
+ if (routeNames.includes("event/artist")) {
64
+ LibNavigation.navigate("event/artist", { url: eventURI.get() })
65
+ } else if (routeNames.includes("event/detail")) {
66
+ LibNavigation.navigate("event/detail", { url: eventURI.get() })
67
+ }
68
+ LibNavigation.backToRoot()
66
69
  countdownTime.reset()
70
+ eventURI.reset()
67
71
  }}
68
- expired={timer}
72
+ expiredTimestamp={timer}
69
73
  style={{ color: "#fff" }} />
70
74
  </Animated.View>
71
75
  )