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
@@ -2,7 +2,6 @@
2
2
  import { EventButton } from 'esoftplay/cache/event/button/import';
3
3
  import { EventHeader } from 'esoftplay/cache/event/header/import';
4
4
  import { EventOrder_itemProperty } from 'esoftplay/cache/event/order_item/import';
5
- import { EventReviewProperty } from 'esoftplay/cache/event/review/import';
6
5
  import { EventReview_addProperty } from 'esoftplay/cache/event/review_add/import';
7
6
  import { LibCarrousel_snap } from 'esoftplay/cache/lib/carrousel_snap/import';
8
7
  import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
@@ -16,7 +15,6 @@ import { LibStyle } from 'esoftplay/cache/lib/style/import';
16
15
  import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
17
16
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
18
17
  import { LibUtils } from 'esoftplay/cache/lib/utils/import';
19
- import { UserClass } from 'esoftplay/cache/user/class/import';
20
18
 
21
19
  import { applyStyle } from 'esoftplay';
22
20
  import { EventAlert } from 'esoftplay/cache/event/alert/import';
@@ -24,11 +22,17 @@ import { EventButton_order_detail } from 'esoftplay/cache/event/button_order_det
24
22
  import { EventConfigProperty } from 'esoftplay/cache/event/config/import';
25
23
  import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
26
24
  import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
27
- import { EventPopup } from 'esoftplay/cache/event/popup/import';
25
+ import { EventOrder_detail_addons } from 'esoftplay/cache/event/order_detail_addons/import';
26
+ import { EventOrder_detail_addons_booked } from 'esoftplay/cache/event/order_detail_addons_booked/import';
27
+ import { EventOrder_detail_coupon } from 'esoftplay/cache/event/order_detail_coupon/import';
28
+ import { EventOrder_detail_instruction } from 'esoftplay/cache/event/order_detail_instruction/import';
29
+ import { EventOrder_detail_reschedule } from 'esoftplay/cache/event/order_detail_reschedule/import';
30
+ import { EventOrder_detail_review } from 'esoftplay/cache/event/order_detail_review/import';
31
+ import { EventOrder_detail_tnc } from 'esoftplay/cache/event/order_detail_tnc/import';
28
32
  import { EventQr_bg } from 'esoftplay/cache/event/qr_bg/import';
29
- import { EventRating } from 'esoftplay/cache/event/rating/import';
30
33
  import { EventSecure_page } from 'esoftplay/cache/event/secure_page/import';
31
- import { EventStep } from 'esoftplay/cache/event/step/import';
34
+ import { LibCollaps } from 'esoftplay/cache/lib/collaps/import';
35
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
32
36
  import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
33
37
  import { UseCondition } from 'esoftplay/cache/use/condition/import';
34
38
  import esp from 'esoftplay/esp';
@@ -36,7 +40,8 @@ import moment from 'esoftplay/moment';
36
40
  import useSafeState from 'esoftplay/state';
37
41
  import useGlobalSubscriber, { useGlobalSubscriberReturn } from 'esoftplay/subscribe';
38
42
  import React, { useEffect, useRef } from 'react';
39
- import { Linking, Pressable, Text, TouchableOpacity, View } from 'react-native';
43
+ import { Text, TouchableOpacity, View } from 'react-native';
44
+ import { ScrollView } from 'react-native-gesture-handler';
40
45
  import QRCode from 'react-native-qrcode-svg';
41
46
 
42
47
 
@@ -44,86 +49,34 @@ export interface EventOrder_detailProps {
44
49
  navigation: any
45
50
  }
46
51
 
47
-
48
- function renderTermItem(item: any, i: number) {
49
- return (
50
- <View key={i}>
51
- <EventStep text={item} />
52
- </View>
53
- )
54
- }
55
-
56
-
57
- let urlsInstruction: any[] = []
58
-
59
52
  const subs = useGlobalSubscriber()
60
53
  export function subscribe(): useGlobalSubscriberReturn {
61
54
  return subs
62
55
  }
63
56
 
64
- function getStringReview(data: any) {
65
- const groupedData = data.reduce((acc: any[], obj: any) => {
66
- const { survey_id, survey_question, survey_option, content } = obj;
67
-
68
- if (!acc[survey_id]) {
69
- acc[survey_id] = {
70
- survey_id,
71
- survey_question,
72
- values: []
73
- };
74
- }
75
-
76
- if (survey_option) {
77
- acc[survey_id].values.push(survey_option);
78
- }
79
- if (content) {
80
- acc[survey_id].values.push(content);
81
- }
82
-
83
- return acc;
84
- }, {});
85
-
86
- const finalResult = Object.values(groupedData).map((group: any) => {
87
- const { survey_question, values } = group;
88
- const valuesString = values.join(", ");
89
- return `\nQ: ${survey_question}\nA: ${valuesString}`;
90
- })
91
- return finalResult
92
- }
93
-
94
-
95
-
96
57
  export default function m(props: EventOrder_detailProps): any {
97
58
  const LibCurl = esp.mod("lib/curl")
98
59
 
99
60
  EventSecure_page()
100
- const [user] = UserClass.state().useState()
101
61
 
102
62
  let showQR = useRef<LibSlidingup>(null)
103
- const dialogSendBack = useRef<LibSlidingup>(null)
63
+ let dialogAddonList = useRef<LibSlidingup>(null)
64
+ let dialogQtyAddons = useRef<LibSlidingup>(null)
104
65
  const url = LibNavigation.getArgs(props, 'url')
105
66
  const [result, setResult] = useSafeState<any>(EventIndexProperty?.stateTicketCache()?.get()?.filter?.((x: any) => x.url?.replace?.('?id=', '/') == url?.replace?.('?id=', '/'))?.[0]?.detail)
106
- const [tickets, setTickets] = useSafeState(result?.detail_ticket?.tickets ?? [])
107
67
  const useIndividualQr = result?.config?.use_individual_qr_ticket
108
68
 
109
- const dataTickets = tickets?.filter?.((x: ItemTiket) => x?.email == user?.email && x?.ticket_code != '')
110
-
111
- const [coupons, setCoupons] = useSafeState<any>()
112
- const [qty, setQty] = useSafeState<number>(1)
69
+ const [, setGroupAddon, getGroupAddon] = useSafeState()
70
+ const [, setSelectedAddon, getSelectedAddon] = useSafeState()
71
+ const [addonsCacheBooked, setAddOnsCacheBooked] = EventIndexProperty?.stateBookedAddonsCache()?.useState()
72
+ const [addonsBooked, setAddOnsBooked] = useSafeState(addonsCacheBooked[result?.id])
73
+ const [errorAddonsBooked, setErrorddOnsBooked] = useSafeState()
113
74
 
114
75
  const dataOfflineReview = EventReview_addProperty.state().get()
115
76
  let availableOfflineReview = dataOfflineReview?.filter((z: any) => z?.booking_id == result?.id)
116
-
117
77
  const [dataReview, setDataReview] = useSafeState<any>(availableOfflineReview?.length == 1 ? availableOfflineReview[0] : result?.detail_review)
118
78
 
119
- urlsInstruction = []
120
- result?.instructions?.map?.((item: any) => {
121
- let matches = item.match(/(https?:\/\/[^\s]+)/g);
122
- if (matches) {
123
- urlsInstruction.push(...matches)
124
- }
125
- })
126
-
79
+ const [dataTicket, setDataTicket] = useSafeState()
127
80
 
128
81
  moment().locale?.('id')
129
82
 
@@ -134,11 +87,6 @@ export default function m(props: EventOrder_detailProps): any {
134
87
  function loadData(): void {
135
88
  new LibCurl(url + ((url.includes("?") ? "&" : "?") + 't=' + new Date().getTime()), null, (res: any) => {
136
89
  setResult(res)
137
- new LibCurl(res?.url_coupon, null, (ress: any) => {
138
- setCoupons(ress)
139
- }, (error: any) => {
140
- // setEmptyCoupons(error)
141
- })
142
90
 
143
91
  if (res?.review_status != 0) {
144
92
  loadDetailReview(res?.url_review)
@@ -149,18 +97,8 @@ export default function m(props: EventOrder_detailProps): any {
149
97
  sendReview(availableOfflineReview[0])
150
98
  }
151
99
 
152
- // // load data untuk upgrade tiket
153
- // if (res?.is_upgradable == 1) {
154
- // loadDataUpgradeTicket(res?.url_upgrade)
155
- // }
156
-
157
- new LibCurl(res?.url_ticket, null,
158
- (res: any, msg: string) => {
159
- setTickets(res.tickets)
160
- }, (err: any) => {
161
- LibToastProperty.show(err.message)
162
- }
163
- )
100
+ if (res?.url_addons_booked == "") return;
101
+ loadDataAddonsBooked(res?.url_addons_booked, res.id);
164
102
 
165
103
  }, (error: any) => {
166
104
  const transformedUrl = url?.includes("?id=") ? url?.replace(/\?id=/, '/') : url
@@ -174,6 +112,59 @@ export default function m(props: EventOrder_detailProps): any {
174
112
  })
175
113
  }
176
114
 
115
+ function syncQty() {
116
+ let post = {
117
+ booking_id: result?.id
118
+ }
119
+ LibProgress.show(esp.lang("event/order_detail", "please_wait"))
120
+ new LibCurl(result?.url_sync, post, (ress: any) => {
121
+ loadData()
122
+ LibProgress.hide()
123
+ }, (error: any) => {
124
+ LibProgress.hide()
125
+ // setEmptyCoupons(error)
126
+ })
127
+ }
128
+
129
+ function loadDetailReview(url: any) {
130
+ new LibCurl(url, null, (ress: any) => {
131
+ setDataReview(ress)
132
+ }, (error: any) => {
133
+ // setEmptyCoupons(error)
134
+ })
135
+ }
136
+
137
+ function loadDataTicket(id: any, price_id: string, ondate: string) {
138
+ let param = {
139
+ booking_id: id, price_id: price_id, ondate: ondate
140
+ }
141
+
142
+ new LibCurl("addons_item" + LibUtils.objectToUrlParam(param), null, (ress: any) => {
143
+ let data = ress?.length > 0 && ress?.map((item: any, i: number) => {
144
+ return ({
145
+ ...item,
146
+ checked: 0,
147
+ })
148
+ })
149
+ setDataTicket(data)
150
+ LibUtils.debounce(() => { dialogQtyAddons?.current?.show() }, 100)
151
+ }, (error: any) => {
152
+ // setEmptyCoupons(error)
153
+ }, 1)
154
+ }
155
+
156
+
157
+ function loadDataAddonsBooked(url: string, bookingId: any) {
158
+ new LibCurl(url, null, (ress) => {
159
+ setAddOnsCacheBooked(LibObject.set(EventIndexProperty?.stateBookedAddonsCache().get(), ress)(bookingId))
160
+ setAddOnsBooked(ress)
161
+ setErrorddOnsBooked(undefined)
162
+ }, (error) => {
163
+ setAddOnsCacheBooked(LibObject.removeKeys(EventIndexProperty?.stateBookedAddonsCache().get(), bookingId)())
164
+ setErrorddOnsBooked(error)
165
+ });
166
+ }
167
+
177
168
  useEffect(() => {
178
169
  EventConfigProperty.curlConfig('v2/config_order_type')
179
170
  loadData()
@@ -191,52 +182,14 @@ export default function m(props: EventOrder_detailProps): any {
191
182
  }, 1)
192
183
  }
193
184
 
194
- function loadDetailReview(url: any) {
195
- new LibCurl(url, null, (ress: any) => {
196
- setDataReview(ress)
197
- }, (error: any) => {
198
- // setEmptyCoupons(error)
199
- })
200
- }
201
-
202
185
  subs.useSubscribe(() => {
203
186
  loadData()
204
- setDataReview(subs.getValue())
205
187
  })
206
188
 
207
- function addReturn(): void {
208
- if (qty < Number(result.qty_returnable)) {
209
- setQty(qty + 1)
210
- }
211
- }
212
-
213
- function minReturn(): void {
214
- setQty(qty == 1 ? 1 : qty - 1)
215
- }
216
-
217
- function sendBack(p: any) {
218
- LibDialog.confirm(esp.lang("event/order_detail", "warning"), esp.lang("event/order_detail", "return_this_ticket"), esp.lang("event/order_detail", "btn_yes"), () => {
219
- LibProgress.show(esp.lang("event/order_detail", "please_wait"))
220
- let post = {
221
- pin: p
222
- }
223
- new LibCurl('event_booking_shared_return?booking_id=' + result?.id + '&qty_shared=' + qty, post, (res: any, msg: any) => {
224
- // LibNotify(res)
225
- LibProgress.hide()
226
- LibDialog.info(esp.lang("event/order_detail", "information"), msg)
227
- LibNavigation.back()
228
- }, (error: any) => {
229
- LibProgress.hide()
230
- LibDialog.warning(esp.lang("event/order_detail", "back_err"), error?.message);
231
- LibNavigation.back()
232
- }, 1)
233
- }, esp.lang("event/order_detail", "btn_cancel"), () => { })
234
- }
235
-
236
189
  function loadDataAddons(id: any, url: string) {
237
190
  LibProgress.show(esp.lang("event/order_detail", "wait"))
238
191
  new LibCurl(url, null, (res: any, msg: any) => {
239
- esp.log({ res });
192
+ let _bookingMemberId = dataTicket?.filter((item: any) => item.checked == 1).map((it: any) => it.id)
240
193
  LibProgress.hide()
241
194
  let dataBookingEvent = {
242
195
  event_id: res?.event_id,
@@ -256,7 +209,8 @@ export default function m(props: EventOrder_detailProps): any {
256
209
  currency: res?.currency,
257
210
  }
258
211
  },
259
- qty: result?.qty
212
+ qty: dataTicket?.filter((item: any) => item.checked == 1).length,
213
+ booking_member_ids: JSON.stringify(_bookingMemberId)
260
214
  }
261
215
  let fee_platform = {
262
216
  fee_platform_amount: res?.fee_platform?.fee_platform_amount,
@@ -267,22 +221,65 @@ export default function m(props: EventOrder_detailProps): any {
267
221
  let order_type = EventConfigProperty.state().get()?.order_type?.ticket
268
222
  let addons_id = id
269
223
  let booking_id_ref = result?.id
270
- LibNavigation.navigate('payment/ticket', {
271
- order_type: order_type,
272
- tax: tax,
273
- fee_platform: fee_platform,
274
- dataBookingEvent: dataBookingEvent,
275
- show_fee_percentage,
276
- addons_id,
277
- booking_id_ref
278
- })
224
+
225
+ function goToPayment() {
226
+ let args: any = {
227
+ order_type: order_type,
228
+ tax: tax,
229
+ fee_platform: fee_platform,
230
+ dataBookingEvent: dataBookingEvent,
231
+ show_fee_percentage,
232
+ addons_id,
233
+ booking_id_ref
234
+ }
235
+ curlPriceConfig(res?.url_price_config, res?.price_id, (conf) => {
236
+ args['tax'] = conf?.tax
237
+ args['fee_platform'] = conf.hasOwnProperty('fee_platform_amount') ? {
238
+ fee_platform_amount: conf?.fee_platform_amount || 0,
239
+ fee_platform_type: conf?.fee_platform_type || "NONE"
240
+ } : fee_platform
241
+ args['fee_custom'] = {
242
+ fee_custom_label: conf?.fee_custom_label || "Custom Fee",
243
+ fee_custom_amount: conf?.fee_custom_amount || 0,
244
+ fee_custom_type: conf?.fee_custom_type || "NONE"
245
+ }
246
+
247
+ esp.log(conf, res?.price_id, args);
248
+ LibNavigation.navigate('payment/ticket', args)
249
+ })
250
+ }
251
+
252
+ if (res?.hasOwnProperty('alert') && res?.alert != "") {
253
+ LibDialog.warningConfirm("Informasi", res?.alert, "Lanjutkan", () => {
254
+ goToPayment()
255
+ }, esp.lang("event/order_detail", "back"), () => {
256
+
257
+ })
258
+ } else {
259
+ goToPayment()
260
+ }
261
+
262
+
279
263
  }, (err: any) => {
280
264
  LibProgress.hide()
281
- esp.log({ err });
265
+ LibDialog.warning("Oops", err?.message)
282
266
  }, 1)
283
267
  }
284
268
 
285
- if (result == undefined && !coupons) {
269
+ function curlPriceConfig(url_price_config: string, price_id: string, onDone: (data: any) => void) {
270
+ LibProgress.show("Mohon tunggu..")
271
+ if (url_price_config) {
272
+ new LibCurl(url_price_config, null, (res, msg) => {
273
+ onDone(res?.[price_id])
274
+ LibProgress.hide()
275
+ }, (err) => {
276
+ LibProgress.hide()
277
+ LibToastProperty.show(err?.message)
278
+ })
279
+ }
280
+ }
281
+
282
+ if (result == undefined) {
286
283
  return (
287
284
  <View style={{ flex: 1, backgroundColor: '#f6f6f6' }}>
288
285
  <EventHeader title={esp.lang("event/order_detail", "order_detail")} />
@@ -302,85 +299,12 @@ export default function m(props: EventOrder_detailProps): any {
302
299
  let isInvitationDate = result?.ondate == "0000-00-00" && result?.kind_detail?.use_code == 1
303
300
  let isOnlineWithoutDate = result?.ondate == "0000-00-00" && result?.kind_detail?.everyday_pass == 0
304
301
 
305
- if ((result?.status == 1 || (result?.qty == 0 && result?.qty_shared > 0)) && result?.is_reschedule == 1) {
306
- return (
307
- <View style={{ flex: 1, backgroundColor: '#f6f6f6' }}>
308
- <EventHeader title={esp.lang("event/order_detail", "order_detail")} />
309
- <View style={[{ margin: 18, borderTopLeftRadius: 7, borderTopRightRadius: 7, backgroundColor: '#fff', paddingBottom: 10 }, LibStyle.elevation(3)]}>
310
-
311
- <TouchableOpacity onPress={() => {
312
- LibNavigation.navigate('lib/gallery', { image: result?.image })
313
- }}>
314
- <LibPicture source={{ uri: result?.image }} style={{ borderTopLeftRadius: 7, borderTopRightRadius: 7, height: imgHeight, width: imgWidth }} resizeMode="cover" />
315
- </TouchableOpacity>
316
- <View style={{ flexDirection: 'row', margin: 14, marginTop: 4, justifyContent: 'space-between' }}>
317
- <View style={{ marginTop: 14 }}>
318
- <EventHtmltext allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{esp.lang("event/order_detail", "ticket")}{result?.price_name}</EventHtmltext>
319
- <View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
320
- <LibIcon name="ticket-outline" size={20} />
321
- <Text allowFontScaling={false} style={{ marginLeft: 6, fontFamily: "Arial", fontSize: 30, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{result?.qty}</Text>
322
- <Text allowFontScaling={false} style={{ marginLeft: 4, fontFamily: "Arial", fontSize: 16, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{esp.lang("event/order_detail", "ticket")}</Text>
323
- </View>
324
- <UseCondition if={result?.show_ticket_status == 1 && result?.status == 1 || result?.status == 3 || result?.status == 6}>
325
- <Text allowFontScaling={false} style={{ fontSize: 12, fontWeight: "normal", fontStyle: "normal", flexWrap: 'wrap', letterSpacing: 0, marginBottom: 12, color: "#484848" }}>
326
- {
327
- result?.qty_used == 0 ? esp.lang("event/order", "have_not_been_used")
328
- :
329
- result.kind_detail?.everyday_pass == 1 ?
330
- "(" + result?.qty_used_today + " " + esp.lang("event/order_detail", "used_today") + ")"
331
- :
332
- "(" + result?.qty_used + " " + esp.lang("event/order_detail", "used") + ")"
333
- }
334
- </Text>
335
- </UseCondition>
336
- <View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
337
- <LibIcon name="calendar-blank-outline" size={20} />
338
- <Text allowFontScaling={false} style={{ marginLeft: 6, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{result?.ondate != "0000-00-00" ? moment(result?.ondate).localeFormat("DD MMMM YYYY") : ((isInvitationDate || isOnlineWithoutDate) ? esp.lang("event/order_item", "used_once") : dateRange)}</Text>
339
- </View>
340
- </View>
341
- {
342
- result?.status == "1" &&
343
- <View style={{ marginTop: 14, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
344
- {
345
- result?.qr != "" &&
346
- <TouchableOpacity onPress={() => {
347
- result?.status == "1" && showQR?.current?.show()
348
- }}>
349
- <EventQr_bg>
350
- <QRCode ecl="H" size={80} value={result?.qr} />
351
- </EventQr_bg>
352
- </TouchableOpacity>
353
- }
354
- </View>
355
- }
356
- </View>
357
-
358
- <View style={{ flexDirection: 'row', justifyContent: 'space-between' }} >
359
- <View style={{ width: 19, height: 19, borderRadius: 9.5, backgroundColor: "#f6f6f6", marginLeft: -9.5 }} />
360
- {/* <Text style={{ marginTop: 5, alignSelf: 'center', fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "center", color: "#f39c12" }} ></Text> */}
361
- <View style={{ width: 19, height: 19, borderRadius: 9.5, backgroundColor: "#f6f6f6", marginRight: -9.5 }} />
362
- </View>
363
302
 
364
- <View style={{ margin: 14, flexDirection: 'row' }}>
365
- <Text style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: LibStyle.colorRed }} >{result?.reschedule_notes}</Text>
366
- </View>
367
- {
368
- result?.par_id > 0 ?
369
- null
370
- :
371
- <EventButton onPress={() => {
372
- LibNavigation.navigate('event/order_reschedule', { url: result?.url_reschedule })
373
- }} label={result?.is_refundable == 1 ? esp.lang("event/order_detail", "refund_rescedule") : esp.lang("event/order_detail", "rescedule")} backgroundColor={LibStyle.colorGreen} style={{ marginLeft: 20, marginRight: 20, marginBottom: 10 }} />
374
- }
375
- </View>
376
- </View>
377
- )
303
+ if ((result?.status == 1 || (result?.qty == 0 && result?.qty_shared > 0)) && result?.is_reschedule == 1) {
304
+ return <EventOrder_detail_reschedule dataTicket={result} onPressQr={() => { showQR?.current?.show() }} />
378
305
  }
379
306
 
380
- let startEvent = result?.start_date + " " + result?.start_time
381
- let dateNow = LibUtils.moment().localeFormat("YYYY-MM-DD HH:mm")
382
-
383
- const termData = result?.term ? Object.values(result?.term) : []
307
+ let valid = dataTicket?.some((item: any) => item.status == 1 && item.checked == 1);
384
308
 
385
309
  return (
386
310
  <View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
@@ -418,22 +342,45 @@ export default function m(props: EventOrder_detailProps): any {
418
342
 
419
343
  <View style={{ flexDirection: 'row', margin: 16, justifyContent: 'space-between', marginTop: 0 }}>
420
344
  <View style={{ flex: 1 }}>
345
+ {/* <View style={{ flexDirection: 'row' }}> */}
421
346
  <View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
422
347
  <LibIcon name="ticket-outline" size={20} />
423
348
  <Text allowFontScaling={false} style={{ marginLeft: 6, fontFamily: "Arial", fontSize: 30, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{result?.qty}</Text>
424
349
  <Text allowFontScaling={false} style={{ marginLeft: 4, fontFamily: "Arial", fontSize: 16, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{esp.lang("event/order_detail", "ticket")}</Text>
425
350
  </View>
351
+
352
+ <View style={{ position: 'absolute', right: 0, justifyContent: 'flex-end', alignContent: 'center', alignItems: 'flex-end' }}>
353
+ {
354
+ result?.qr != "" && useIndividualQr == 0 &&
355
+ <TouchableOpacity onPress={() => {
356
+ showQR?.current?.show()
357
+ }}>
358
+ <EventQr_bg>
359
+ <QRCode ecl="H" size={80} value={result?.qr} />
360
+ </EventQr_bg>
361
+ </TouchableOpacity>
362
+ }
363
+ {
364
+ result?.qr == "" && result?.hasOwnProperty("url_sync") && result?.url_sync != "" &&
365
+ <TouchableOpacity onPress={syncQty} style={{ marginTop: 20, padding: 5, paddingHorizontal: 10, backgroundColor: LibStyle.colorGreen, borderRadius: 7, ...LibStyle.elevation(2) }}>
366
+ <Text allowFontScaling={false} style={{ color: '#fff', fontWeight: 'bold' }}>{esp.lang("event/order_detail", "show_qr")}</Text>
367
+ </TouchableOpacity>
368
+ }
369
+ </View>
370
+ {/* </View> */}
426
371
  <UseCondition if={result?.show_ticket_status == 1 && result?.status == 1 || result?.status == 3 || result?.status == 6}>
427
- <Text allowFontScaling={false} style={{ fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, marginBottom: 12, color: "#484848" }}>
428
- {
429
- result?.qty_used == 0 ? esp.lang("event/order", "have_not_been_used")
430
- :
431
- result.kind_detail?.everyday_pass == 1 ?
432
- "(" + result?.qty_used_today + " " + esp.lang("event/order_detail", "used_today") + ")"
372
+ <View style={{ flex: 1, marginRight: LibStyle.width / 4 }}>
373
+ <Text allowFontScaling={false} style={{ fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, marginBottom: 12, color: "#484848" }}>
374
+ {
375
+ result?.qty_used == 0 ? esp.lang("event/order", "have_not_been_used")
433
376
  :
434
- "(" + result?.qty_used + " " + esp.lang("event/order_detail", "used") + ")"
435
- }
436
- </Text>
377
+ result.kind_detail?.everyday_pass == 1 ?
378
+ "(" + result?.qty_used_today + " " + esp.lang("event/order_detail", "used_today") + ")"
379
+ :
380
+ "(" + result?.qty_used + " " + esp.lang("event/order_detail", "used") + ")"
381
+ }
382
+ </Text>
383
+ </View>
437
384
  </UseCondition>
438
385
  {
439
386
  result?.qty_shared > 0 &&
@@ -446,7 +393,7 @@ export default function m(props: EventOrder_detailProps): any {
446
393
 
447
394
  {
448
395
  result?.ondate == "0000-00-00" &&
449
- <View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
396
+ <View style={{ marginRight: 85, flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
450
397
  <LibIcon name="calendar-blank-outline" size={20} />
451
398
  <Text allowFontScaling={false} style={{ flex: 1, marginRight: 10, marginLeft: 6, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{((isInvitationDate || isOnlineWithoutDate) ? esp.lang("event/order_item", "used_once") : dateRange)}</Text>
452
399
  </View>
@@ -456,55 +403,56 @@ export default function m(props: EventOrder_detailProps): any {
456
403
  <View style={{ marginTop: 15, marginRight: 10 }}>
457
404
  <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, marginBottom: 5, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }}>{esp.lang("event/order_detail", "seat_number")}</Text>
458
405
  <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
459
- {
460
- tickets?.map((item: any, i: number) => {
406
+ {result?.seat_names?.map((item: any, i: number) => {
407
+ const [front, end] = item?.split("#") || ["", ""];
408
+ if (item?.includes("#")) {
461
409
  return (
462
- <View key={i} style={{ paddingVertical: 5, marginBottom: 7, paddingHorizontal: 7, borderWidth: 1, borderColor: '#000', backgroundColor: '#fff', borderRadius: 5, marginRight: 7 }}>
463
- <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 20, color: '#000' }}>{item.seat_name}</Text>
410
+ <View key={i} style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: 5, marginBottom: 7, paddingHorizontal: 5, backgroundColor: '#fff', borderRadius: 5, marginRight: 7, ...LibStyle.elevation(5), }}>
411
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 16, color: "#000" }}> {front} </Text>
412
+ <Text allowFontScaling={false} style={{ marginLeft: 3, fontWeight: 'bold', fontSize: 16, color: '#000', }}> {end} </Text>
413
+ </View>
414
+ );
415
+ } else {
416
+ return (
417
+ <View key={i} style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: 5, marginBottom: 7, paddingHorizontal: 5, backgroundColor: '#fff', borderRadius: 5, marginRight: 7, ...LibStyle.elevation(5), }}>
418
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 20, color: "#000" }}>{item}</Text>
464
419
  </View>
465
420
  )
466
- })
467
- }
421
+ }
422
+ })}
468
423
  </View>
469
424
  </View>
470
425
  }
471
426
 
472
- </View>
473
- <View style={{ marginTop: 14, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
474
- {
475
- result?.qr != "" && useIndividualQr == 0 &&
476
- <TouchableOpacity onPress={() => {
477
- showQR?.current?.show()
478
- }}>
479
- <EventQr_bg>
480
- <QRCode ecl="H" size={80} value={result?.qr} />
481
- </EventQr_bg>
482
- </TouchableOpacity>
483
- }
427
+
484
428
  </View>
485
429
  </View>
486
-
430
+ {
431
+ result?.hasOwnProperty('url_addons_booked') && result?.url_addons_booked != "" &&
432
+ <EventOrder_detail_addons_booked addonsBooked={addonsBooked} errorAddonsBooked={errorAddonsBooked} onPress={loadData} />
433
+ }
487
434
  </View>
435
+
488
436
  }
489
437
  {
490
- useIndividualQr > 0 && dataTickets.length > 0 ?
438
+ useIndividualQr > 0 && result?.ticket_codes.length > 0 ?
491
439
  <LibCarrousel_snap
492
- data={dataTickets}
440
+ data={result?.ticket_codes}
493
441
  style={{ marginVertical: 10, marginBottom: 0, }}
494
442
  itemMarginHorizontal={3}
495
443
  itemWidth={LibStyle.width - 46}
496
444
  maxWidth={LibStyle.width}
497
445
  align={"center"}
498
- renderItem={(item: ItemTiket, id: any) => {
446
+ renderItem={(item: any, id: any) => {
499
447
  return (
500
448
  <View pointerEvents='none' style={{ width: LibStyle.width - 52, flexDirection: 'row', padding: 10, backgroundColor: 'white', borderWidth: 2, borderColor: LibStyle.colorPrimary, borderRadius: 5, overflow: 'hidden', alignItems: 'center' }} >
501
449
  <LibTextstyle textStyle='m_h2' style={{ textAlignVertical: 'center', marginHorizontal: 10 }} text={(id + 1).toString()} />
502
450
  <View style={{ marginLeft: 10, marginVertical: 10, flex: 1, justifyContent: 'flex-start' }} >
503
- <LibTextstyle textStyle='headline' numberOfLines={1} text={item.name} ellipsizeMode='tail' />
504
- <LibTextstyle textStyle='caption1' text={item.email} ellipsizeMode='tail' />
451
+ <LibTextstyle textStyle='headline' numberOfLines={1} text={result?.params?.buyer?.buyer_name} ellipsizeMode='tail' />
452
+ <LibTextstyle textStyle='caption1' text={result?.params?.buyer?.buyer_email} ellipsizeMode='tail' />
505
453
  </View>
506
454
  <EventQr_bg>
507
- <QRCode value={item.ticket_code} size={70} />
455
+ <QRCode value={item} size={70} />
508
456
  </EventQr_bg>
509
457
  </View>
510
458
  )
@@ -514,7 +462,7 @@ export default function m(props: EventOrder_detailProps): any {
514
462
  }
515
463
 
516
464
  <EventAlert
517
- color="#FFC523"
465
+ color={LibStyle.colorRed}
518
466
  msg={esp.lang("event/order_detail", "not_allowed_ss", esp.appjson().expo.name)}
519
467
  useIcon
520
468
  style={{ marginBottom: 0, margin: 15 }}
@@ -555,144 +503,97 @@ export default function m(props: EventOrder_detailProps): any {
555
503
  />
556
504
  </UseCondition>
557
505
 
558
-
559
-
560
506
  {/* tombol add on */}
561
507
  {
562
- result?.addons?.length > 0 && result?.addons?.map((item: any, i: number) => {
563
- return (
564
- <EventButton_order_detail
565
- color={result?.color}
566
- onPress={() => {
567
- loadDataAddons(item?.addons_id, item?.url)
568
- }}
569
- icon={'plus-circle'}
570
- title={item.title}
571
- info={item.info}
572
- />
573
- )
574
- })
575
- }
576
-
577
- {
578
- // jika mau edit view dibawah ini, tekan ctrl + f terus paste prefik dibawah ini
579
- // view_reviewed
580
- dataReview?.status == 1 ?
581
- <View style={{ margin: 15, marginBottom: 0, borderRadius: 7, backgroundColor: 'white', padding: 10 }}>
582
- <View style={{ flexDirection: 'row', alignItems: 'flex-start', marginTop: 10 }}>
583
- <LibPicture source={{ uri: user?.image }} style={{ height: 50, width: 50, borderRadius: 25 }} />
584
- <View style={{ marginLeft: 10, flex: 1 }}>
585
- <Text allowFontScaling={false} numberOfLines={1} ellipsizeMode='tail' style={{ fontSize: 16, fontWeight: 'bold' }}>{user?.name}</Text>
586
- <Text allowFontScaling={false} style={{ fontSize: 12, color: '#c9c9c9' }}>{LibUtils.moment(dataReview?.review?.created).localeFormat("D MMM YYYY")}</Text>
587
- <View style={{ marginTop: 5 }}>
588
- <EventRating disabled onChangeRating={() => { }} defaultValue={dataReview?.review?.rating} size={18} containerStyle={{ padding: 0, justifyContent: 'flex-start' }} />
589
- {
590
- dataReview?.review?.content != "" &&
591
- <Text allowFontScaling={false} style={{ marginTop: 10, fontSize: 12, color: '#000' }}>{dataReview?.review?.content.replace(/\\n/g, '\n')}</Text>
592
- }
593
- {
594
- dataReview?.surveys?.length > 0 &&
595
- getStringReview(dataReview?.surveys).map((sur) => (
596
- <Text allowFontScaling={false} style={{ fontSize: 12, color: '#000' }}>{sur}</Text>
597
- ))
598
- }
508
+ result?.hasOwnProperty('url_addons') && result?.url_addons != "" &&
509
+ <LibCollaps
510
+ header={(show) => {
511
+ return (
512
+ <View style={{ margin: 15, alignContent: 'center', alignItems: 'center', paddingHorizontal: 15, marginBottom: 0, borderRadius: 7, backgroundColor: '#fff', paddingBottom: 10, paddingTop: 10, flexDirection: 'row' }}>
513
+ <View style={{ flex: 1 }}>
514
+ <Text style={{ fontWeight: 'bold', fontSize: 14, color: "#495057" }}>{esp.lang("event/order_detail", "addons")}</Text>
599
515
  </View>
516
+ <LibIcon name={!show ? "chevron-down" : "chevron-up"} />
600
517
  </View>
601
- </View>
602
- {
603
- dataReview?.status == 2 &&
604
- <View style={applyStyle({ borderColor: '#FC9722', backgroundColor: '#FDF1DE', borderWidth: 1, borderStyle: 'dashed', borderRadius: 5, padding: 5, marginTop: 15, marginBottom: 0 })} >
605
- <Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 12, fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" })}>{esp.lang("event/order_detail", "thanks")}</Text>
606
- </View>
607
- }
608
-
609
- </View>
610
- :
611
- dateNow > startEvent ?
612
- <View style={{ margin: 15, marginBottom: 0, borderRadius: 7, backgroundColor: '#000', padding: 10 }}>
613
- {
614
- dataReview?.review == null ?
615
- <Pressable>
616
- <EventRating onChangeRating={(rate) => {
617
- let type = EventReviewProperty.calculateProb(result?.config?.review)
618
- let urlForm = "event_order_detail_review_form?id=" + result?.id + "&type=" + type?.type
619
- let args = {
620
- url_form: urlForm,
621
- type: type?.type,
622
- booking_id: result?.id,
623
- rate: rate
624
- }
625
- if (result?.review_status != 1) {
626
- LibNavigation.navigate('event/review_add', args)
627
- }
628
- }} defaultValue={5} size={50} containerStyle={{ padding: 0, backgroundColor: 'transparent' }} />
629
- <Text allowFontScaling={false} style={{ alignSelf: 'center', marginTop: 15, fontSize: 18, fontWeight: 'bold', color: '#fff' }}>{esp.lang("event/order_detail", "leave_review")}</Text>
630
- <Text allowFontScaling={false} style={{ alignSelf: 'center', marginTop: 7, fontSize: 14, color: '#fff' }}>{esp.lang("event/order_detail", "review_info")}</Text>
631
-
632
- </Pressable>
633
- :
634
- // view_reviewed
635
- <View style={{ margin: -10, backgroundColor: '#fff', padding: 10, borderRadius: 7 }}>
636
- <View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
637
- <LibPicture source={{ uri: user?.image }} style={{ height: 50, width: 50, borderRadius: 25 }} />
638
- <View style={{ marginLeft: 10 }}>
639
- <Text allowFontScaling={false} numberOfLines={1} ellipsizeMode='tail' style={{ fontSize: 16, fontWeight: 'bold' }}>{user?.name}</Text>
640
- <Text allowFontScaling={false} style={{ fontSize: 12, color: '#c9c9c9' }}>{LibUtils.moment(dataReview?.review?.created).localeFormat("D MMM YYYY")}</Text>
641
- <View style={{ marginTop: 5 }}>
642
- <EventRating disabled onChangeRating={() => { }} defaultValue={dataReview?.review?.rating} size={18} containerStyle={{ padding: 0, backgroundColor: 'transparent' }} />
643
- </View>
644
- </View>
645
- </View>
646
-
647
- <Text allowFontScaling={false} numberOfLines={5} ellipsizeMode='tail' style={{ marginTop: 10, fontSize: 12, color: '#000' }}>{dataReview?.review?.content}</Text>
648
- {
649
- dataReview?.status == 2 &&
650
- <View style={applyStyle({ borderColor: '#FC9722', backgroundColor: '#FDF1DE', borderWidth: 1, borderStyle: 'dashed', borderRadius: 5, padding: 5, marginTop: 15, marginBottom: 0 })} >
651
- <Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 12, fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" })}>{esp.lang("event/order_detail", "thanks")}</Text>
652
- </View>
653
- }
654
- </View>
518
+ )
519
+ }} >
520
+ <EventOrder_detail_addons
521
+ dataTicket={result}
522
+ onPress={(item: any) => {
523
+ const isMultiple = item?.list?.length > 1
524
+ if (isMultiple) {
525
+ setGroupAddon(item)
526
+ LibUtils.debounce(() => {
527
+ dialogAddonList?.current?.show()
528
+ }, 100)
529
+ } else {
530
+ if (item?.status == 1) {
531
+ const addon = item?.list?.[0]
532
+ setGroupAddon(item)
533
+ setSelectedAddon(addon)
534
+ loadDataTicket(result?.id, addon?.price_id, addon?.ondate)
535
+ }
655
536
  }
656
- </View>
657
- : null
537
+
538
+ }}
539
+ />
540
+ </LibCollaps>
658
541
  }
659
542
 
543
+ {/* review */}
544
+ <EventOrder_detail_review dataReview={dataReview} dataTicket={result} />
545
+
660
546
  {/* view for coupon */}
661
547
  {
662
- result?.status != "2" && coupons &&
663
- <View style={{ margin: 15, marginBottom: 0, borderRadius: 7, backgroundColor: '#fff', paddingBottom: 10, paddingTop: 10 }}>
664
- <View style={{ marginHorizontal: 20 }}>
665
- <Text style={{ fontWeight: 'bold', fontSize: 14, color: "#495057" }}>{coupons.title || ''}</Text>
666
- </View>
667
-
668
- {
669
- coupons?.list?.map((item: any, i: number) => {
670
- return (
671
- <TouchableOpacity key={i} onPress={() => {
672
- esp.modProp("event/coupon").getCouponDetail(item?.url_detail_coupon)
673
- }} style={[{ marginBottom: 4, margin: 15, borderRadius: 15, backgroundColor: '#fff' }, LibStyle.elevation(2)]}>
674
- <LibPicture source={{ uri: item.image }} resizeMode="cover" style={{ height: (LibStyle.width - 60) * 0.43, width: LibStyle.width - 60, borderRadius: 5 }} />
675
- <View style={{ position: 'absolute', top: (((LibStyle.width - 60) * 0.43) / 2) - 10, marginBottom: 15, flexDirection: 'row', justifyContent: 'space-between' }} >
676
- <View style={{ width: 23, height: 23, borderRadius: 11.5, backgroundColor: "white", marginLeft: -9.5 }} />
677
- <View style={{ flex: 1 }} />
678
- <View style={{ width: 23, height: 23, borderRadius: 11.5, backgroundColor: "white", marginRight: -9.5 }} />
679
- </View>
680
- </TouchableOpacity>
681
- )
682
- })
548
+ result?.url_coupon != "" &&
549
+ <LibCollaps
550
+ show={Number(result?.show_voucher) == 0 ? false : true}
551
+ header={(show) =>
552
+ <View style={{ margin: 15, alignContent: 'center', alignItems: 'center', paddingHorizontal: 15, marginBottom: 0, borderRadius: 7, backgroundColor: '#fff', paddingBottom: 10, paddingTop: 10, flexDirection: 'row' }}>
553
+ <View style={{ flex: 1 }}>
554
+ <Text style={{ fontWeight: 'bold', fontSize: 14, color: "#495057" }}>{esp.lang("event/order_detail", "voucher_or_coupon")}</Text>
555
+ </View>
556
+ <LibIcon name={!show ? "chevron-down" : "chevron-up"} />
557
+ </View>
683
558
  }
559
+ >
560
+ <EventOrder_detail_coupon dataTicket={result} />
561
+ </LibCollaps>
562
+ }
684
563
 
685
- {
686
- coupons?.pages > 1 &&
687
- <TouchableOpacity onPress={() => {
688
- LibNavigation.navigate("event/coupon")
689
- }}>
690
- <View style={{ marginTop: 10, alignContent: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: LibStyle.colorPrimary, height: 50 }}>
691
- <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 16, fontWeight: "bold", textAlign: 'center', fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{esp.lang("event/order_detail", "see_all_coupon")}</Text>
564
+ {/* how to use ticket */}
565
+ {
566
+ result?.status == 1 && result?.url_instructions != "" &&
567
+ <LibCollaps
568
+ header={(show) => {
569
+ return (
570
+ <View style={{ margin: 15, alignContent: 'center', alignItems: 'center', paddingHorizontal: 15, marginBottom: 0, borderRadius: 7, backgroundColor: '#fff', paddingBottom: 10, paddingTop: 10, flexDirection: 'row' }}>
571
+ <View style={{ flex: 1 }}>
572
+ <Text style={{ fontWeight: 'bold', fontSize: 14, color: "#495057" }}>{esp.lang("event/order_detail", "how_to_use")}</Text>
573
+ </View>
574
+ <LibIcon name={!show ? "chevron-down" : "chevron-up"} />
692
575
  </View>
693
- </TouchableOpacity>
576
+ )
577
+ }}>
578
+ <EventOrder_detail_instruction dataTicket={result} />
579
+ </LibCollaps>
580
+ }
581
+
582
+ {/* term n condition */}
583
+ {
584
+ result?.url_term != "" &&
585
+ <LibCollaps
586
+ header={(show) =>
587
+ <View style={{ margin: 15, alignContent: 'center', alignItems: 'center', paddingHorizontal: 15, marginBottom: 0, borderRadius: 7, backgroundColor: '#fff', paddingBottom: 10, paddingTop: 10, flexDirection: 'row' }}>
588
+ <View style={{ flex: 1 }}>
589
+ <Text style={{ fontWeight: 'bold', fontSize: 14, color: "#495057" }}>{esp.lang("event/order_detail", "tos")}</Text>
590
+ </View>
591
+ <LibIcon name={!show ? "chevron-down" : "chevron-up"} />
592
+ </View>
694
593
  }
695
- </View>
594
+ >
595
+ <EventOrder_detail_tnc dataTicket={result} />
596
+ </LibCollaps>
696
597
  }
697
598
 
698
599
  <View style={{ margin: 15, marginBottom: 0, padding: 16, borderRadius: 5, backgroundColor: '#fff' }}>
@@ -711,80 +612,26 @@ export default function m(props: EventOrder_detailProps): any {
711
612
  <Text allowFontScaling={false} style={{ alignContent: 'center', alignItems: 'center', fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "right", color: "#9b9b9b" }}>{result?.payment_title}</Text>
712
613
  </View>
713
614
  }
714
- </View>
715
615
 
716
- {
717
- result?.status == 1 && result?.instructions?.length > 0 &&
718
- <View style={{ margin: 15, marginBottom: 5, padding: 16, borderRadius: 5, backgroundColor: '#fff' }}>
719
- <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }}>{esp.lang("event/order_detail", "how_to_use")}</Text>
720
- {
721
- result?.instructions.map((item: any, i: number) => {
722
- const urls = item.match(/(https?:\/\/[^\s]+)/g)
723
- const text = item.replace(urls?.[0], '~:::~')
724
- const texts = text.split('~:::~')
725
- return (
726
- <TouchableOpacity key={i + 1} onPress={() => {
727
- if (item.match(/(https?:\/\/[^\s]+)/g)) {
728
- Linking.openURL(urls[0])
729
- }
730
- }}>
731
- <Text allowFontScaling={false} style={{ flexWrap: 'wrap', marginBottom: 5, fontSize: 14, fontWeight: "normal", fontStyle: "normal", lineHeight: 18, color: "#4a4a4a", marginTop: 4 }}>
732
- {texts?.[0]}
733
- {urls && <Text allowFontScaling={false} style={{ flexWrap: 'wrap', marginBottom: 5, fontSize: 14, fontWeight: "normal", fontStyle: "normal", lineHeight: 18, color: LibStyle.colorBlue, marginTop: 4 }}>{urls[0]}</Text>}
734
- {texts?.[1]}
735
- </Text>
736
- </TouchableOpacity>
737
- )
738
- })
739
- }
740
-
741
- {
742
- urlsInstruction.length > 0 && urlsInstruction.map((item: any, i: number) => {
743
- return (
744
- <View key={i + 1} style={{ padding: 10, marginTop: 10, flexDirection: 'row-reverse' }}>
745
- <TouchableOpacity onPress={() => {
746
- LibUtils.share(item)
747
- }} style={{ ...LibStyle.elevation(5), alignContent: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: LibStyle.colorPrimary, height: 40, width: 40, borderRadius: 20, marginHorizontal: 10 }}>
748
- <LibIcon color="#fff" name="share" />
749
- </TouchableOpacity>
750
- <TouchableOpacity onPress={() => {
751
- LibUtils.copyToClipboard(item)
752
- LibToastProperty.show(esp.lang("event/order_detail", "copied"))
753
- }} style={{ ...LibStyle.elevation(5), alignContent: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: LibStyle.colorPrimary, height: 40, width: 40, borderRadius: 20, marginHorizontal: 10 }}>
754
- <LibIcon color="#fff" name="content-copy" />
755
- </TouchableOpacity>
756
- <TouchableOpacity onPress={() => {
757
- Linking.openURL(item)
758
- }} style={{ ...LibStyle.elevation(5), alignContent: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: LibStyle.colorPrimary, height: 40, width: 40, borderRadius: 20, marginHorizontal: 10 }}>
759
- <LibIcon.MaterialIcons color="#fff" name="open-in-browser" />
760
- </TouchableOpacity>
761
- </View>
762
- )
763
- })
764
- }
616
+ {
617
+ result?.url_ticket != "" &&
618
+ <TouchableOpacity
619
+ onPress={() => {
620
+ LibNavigation.navigate('event/order_detail_visitor', { url: result?.url_ticket, url_addition: result?.url_addition })
621
+ }}
622
+ style={{ ...LibStyle.elevation(2), marginTop: 15, alignContent: 'center', alignItems: 'center', borderWidth: 1, borderColor: LibStyle.colorBgGrey, padding: 10, backgroundColor: '#fff', borderRadius: 5, flexDirection: 'row' }}>
623
+ <View style={{ flex: 1 }}>
624
+ <Text style={{ fontWeight: 'bold', fontSize: 14, color: "#495057" }}>{esp.lang("event/order_detail", "buyer_detail")}</Text>
625
+ </View>
626
+ <LibIcon name={"chevron-right"} />
627
+ </TouchableOpacity>
628
+ }
629
+ </View>
765
630
 
766
- </View>
767
- }
768
- {
769
- termData?.length > 0 &&
770
- <View style={{ margin: 16, borderRadius: 5, padding: 10, backgroundColor: 'white' }} >
771
- <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }}>{esp.lang("event/order_detail", "tos")}</Text>
772
- {termData?.map(renderTermItem)}
773
- </View>
774
- }
775
- {
776
- result?.url_ticket != "" &&
777
- <TouchableOpacity onPress={() => {
778
- LibNavigation.navigate('event/order_detail_visitor', { url: result?.url_ticket, url_addition: result?.url_addition })
779
- }} style={{ ...LibStyle.elevation(3), margin: 15, padding: 16, borderRadius: 5, backgroundColor: '#fff', flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' }}>
780
- <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 16, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }}>{esp.lang("event/order_detail", "buyer_detail")}</Text>
781
- <LibIcon name='chevron-right-circle-outline' size={30} color={LibStyle.colorBlue} />
782
- </TouchableOpacity>
783
- }
784
631
 
785
632
  {
786
633
  esp.isDebug("") &&
787
- <View style={{ padding: 5 }}>
634
+ <View style={{ padding: 5, marginTop: 15 }}>
788
635
  <EventButton label={esp.lang("event/order_detail", "send_to_email")} onPress={() => {
789
636
  LibToastProperty.show("Coming Soon")
790
637
  }} backgroundColor={"#FFF"} borderColor={LibStyle.colorGreen} fontColor={LibStyle.colorGreen} />
@@ -800,7 +647,7 @@ export default function m(props: EventOrder_detailProps): any {
800
647
  <EventButton label={Number(result.is_shareable) ? /*share_ticket*/esp.lang("event/order_detail", "share_ticket") : esp.lang("event/order_detail", "shared")} onPress={() => {
801
648
  if (Number(result.is_shareable)) {
802
649
  LibDialog.confirm(esp.lang("event/order_detail", "share_title"), esp.lang("event/order_detail", "share_msg", esp.appjson().expo.name), esp.lang("event/order_detail", "share_ok"), () => {
803
- LibNavigation.navigate('event/order_share_to', { url: url })
650
+ LibNavigation.navigate('event/order_detail_share', { url: url })
804
651
  }, esp.lang("event/order_detail", "share_no"), () => {
805
652
 
806
653
  })
@@ -814,7 +661,7 @@ export default function m(props: EventOrder_detailProps): any {
814
661
  result?.par_id != 0 && result?.status == 1 && result?.qty_returnable > 0 &&
815
662
  <View style={{ padding: 5 }}>
816
663
  <EventButton label={esp.lang("event/order_detail", "return_ticket")} onPress={() => {
817
- dialogSendBack?.current?.show()
664
+ LibNavigation.navigate('event/order_detail_return', { url: url })
818
665
  }} backgroundColor={LibStyle.colorGreen} />
819
666
  </View>
820
667
  }
@@ -833,46 +680,130 @@ export default function m(props: EventOrder_detailProps): any {
833
680
  </View>
834
681
  </LibSlidingup>
835
682
 
836
- <LibSlidingup ref={dialogSendBack} >
837
- <View style={{ backgroundColor: 'white', borderTopLeftRadius: 20, borderTopRightRadius: 20, padding: 20 }} >
838
- <EventPopup email={result?.sharer_email?.trim?.()} redirect={() => {
839
- if (result?.use_seat == 1) {
840
- let data = {
841
- qty: qty
842
- }
843
- LibNavigation.navigate('event/seat', {
844
- url: result?.url_ticket,
845
- dataTicket: data,
846
- returnTicket: true,
847
- })
848
- } else {
849
- LibNavigation.navigateForResult("bigbang/payment_pin", undefined, 1132).then((p) => {
850
- if (p) {
851
- sendBack(p)
852
- }
683
+ <LibSlidingup ref={dialogQtyAddons}>
684
+ <View style={{ backgroundColor: 'white', maxHeight: LibStyle.height - (LibStyle.height / 3), borderTopRightRadius: 20, borderTopLeftRadius: 20, padding: 20 }}>
685
+ <Text style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", color: "#b7b7b7" }} >{esp.lang("event/order_detail", "addons")}</Text>
686
+ <Text style={{ fontFamily: "Arial", fontSize: 16, fontWeight: "bold", color: "#4a4a4a" }} >{getSelectedAddon()?.title}</Text>
687
+ {
688
+ getSelectedAddon()?.info != "" &&
689
+ <EventHtmltext style={{ fontFamily: "Arial", marginBottom: 10, fontSize: 12, marginLeft: 10, color: "#b7b7b7" }} >{getSelectedAddon()?.info}</EventHtmltext>
690
+ }
691
+
692
+ <ScrollView>
693
+ <Text allowFontScaling={false} style={{ marginVertical: 10, fontFamily: "Arial", fontSize: 16, fontWeight: "bold", fontStyle: "normal", letterSpacing: 1.5, color: "#000" }}>{esp.lang("event/order_detail_share", "chose_ticket")}</Text>
694
+ {
695
+ dataTicket?.length > 0 && dataTicket?.map((item: any, i: number) => {
696
+ const [front, end] = item?.seat_name?.split("#") || ["", ""];
697
+ let colorDisable = item?.status == 0 ? LibStyle.colorBgGrey : "#f1f1f1"
698
+ let colorAccent = item?.checked == 1 ? LibStyle?.colorGreen : colorDisable
699
+ return (
700
+ <TouchableOpacity key={i} onPress={() => {
701
+ if (item?.status == 1) {
702
+ let a = LibObject.set(dataTicket, item.checked == 1 ? 0 : 1)(i, 'checked')
703
+ setDataTicket(a)
704
+ }
705
+
706
+ }} style={{ padding: 10, marginBottom: 10, borderRadius: 4, backgroundColor: item?.status == 1 ? "#fff" : LibStyle.colorBgGrey, borderColor: colorAccent, borderWidth: 1, flexDirection: 'row' }}>
707
+ <View style={{ flex: 5 }}>
708
+ <Text allowFontScaling={false} style={{ fontSize: 14, fontStyle: "normal", color: "#000", fontWeight: "bold", }}>{result?.price_name}</Text>
709
+ {/* seat */}
710
+ {
711
+ item?.seat_name != "" &&
712
+ <View style={{ marginVertical: 10 }}>
713
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, marginBottom: 5, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#b7b7b7" }}>{esp.lang("event/order_detail", "seat_number")}</Text>
714
+
715
+ <View style={{ marginLeft: 7, flexDirection: 'row' }}>
716
+ <View style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: 5, paddingHorizontal: 5, backgroundColor: '#f1f1f1', borderRadius: 5, marginRight: 7 }}>
717
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 16, color: "#000" }}> {front}</Text>
718
+ <Text allowFontScaling={false} style={{ marginLeft: 3, fontWeight: 'bold', fontSize: 16, color: '#000', }}>{end}</Text>
719
+ </View>
720
+ </View>
721
+ </View>
722
+ }
723
+ {/* add ons */}
724
+ {
725
+ item?.addons?.length > 0 &&
726
+ <View style={{ marginTop: 5 }}>
727
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#b7b7b7" }}>{esp.lang("event/order_detail", "addons")}</Text>
728
+ </View>
729
+ }
730
+ {
731
+ item?.addons?.length > 0 && item?.addons?.map((x: any, ii: number) => {
732
+ return (
733
+ <View key={ii} style={{ marginLeft: 7, flexDirection: 'row' }}>
734
+ <View style={{}}>
735
+ <Text allowFontScaling={false} style={{ color: '#484848', fontSize: 12, fontWeight: 'bold', fontFamily: "Arial" }}>- {
736
+ x?.list?.map((y: any) => y).join(', ')
737
+ }</Text>
738
+ {
739
+ x?.ondate != "0000-00-00" &&
740
+ <Text allowFontScaling={false} style={{ marginLeft: 7, marginBottom: 3, marginTop: 3, fontFamily: "Arial", fontSize: 12, fontStyle: "normal", letterSpacing: 0, color: '#484848' }}>{
741
+ LibUtils.moment(x?.ondate).localeFormat('DD MMM YYYY')}</Text>
742
+ }
743
+ </View>
744
+ </View>
745
+ )
746
+ })
747
+ }
748
+
749
+
750
+ </View>
751
+ <View style={{ flex: 1, alignContent: 'flex-end', alignItems: 'flex-end' }}>
752
+ <LibIcon name={item?.checked == 1 ? 'check-circle' : 'radiobox-blank'} color={colorAccent} />
753
+ </View>
754
+ </TouchableOpacity>
755
+ )
853
756
  })
854
757
  }
855
- dialogSendBack.current!.hide()
856
- }} cancel={() => {
857
- dialogSendBack.current!.hide()
858
- }}
859
- view={
860
- <View style={{ flexDirection: 'row', marginTop: 20, marginBottom: 8, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
861
- <TouchableOpacity onPress={() => { minReturn() }}>
862
- <View style={{ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' }}>
863
- <LibIcon name="minus" color="#e74c3c" />
864
- </View>
865
- </TouchableOpacity>
866
- <Text style={{ fontFamily: "Arial", fontSize: 20, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#9b9b9b", marginLeft: 13, marginRight: 13 }}>{qty}</Text>
867
- <TouchableOpacity onPress={() => { addReturn() }}>
868
- <View style={{ width: 28, height: 28, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' }}>
869
- <LibIcon name="plus" color="#16a085" />
870
- </View>
871
- </TouchableOpacity>
872
- </View>
758
+ </ScrollView>
759
+
760
+ <EventButton label={esp.lang("event/order_detail", "next")} onPress={() => {
761
+ if (valid) {
762
+ dialogQtyAddons?.current?.hide()
763
+ loadDataAddons(getSelectedAddon()?.addons_id, getSelectedAddon()?.url)
873
764
  }
765
+ }}
766
+ backgroundColor={!valid ? LibStyle.colorGrey : LibStyle.colorGreen}
874
767
  />
768
+ </View>
769
+ </LibSlidingup>
875
770
 
771
+ {/* add on list */}
772
+ <LibSlidingup ref={dialogAddonList}>
773
+ <View style={{ backgroundColor: 'white', borderTopRightRadius: 20, maxHeight: LibStyle.height / 2, borderTopLeftRadius: 20, paddingBottom: 20 }}>
774
+ <View style={{ margin: 15, flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' }}>
775
+ <Text allowFontScaling={false} style={{ flex: 1, fontSize: 16, fontWeight: 'bold' }}>{getGroupAddon()?.hasOwnProperty("list") ? getGroupAddon()?.title : getGroupAddon()?.group_title}</Text>
776
+ <TouchableOpacity style={{ flex: 1, alignItems: 'flex-end' }} onPress={() => dialogAddonList?.current?.hide()}>
777
+ <LibIcon name='close' />
778
+ </TouchableOpacity>
779
+ </View>
780
+ <ScrollView>
781
+ {/* ini list untuk yang ondate */}
782
+ {
783
+ getGroupAddon()?.list?.length > 0 && getGroupAddon()?.list?.map((item: any, i: number) => {
784
+ return (
785
+ <EventButton_order_detail
786
+ disable={item?.hasOwnProperty('status') && item.status == 0 ? true : false}
787
+ status_message={item?.status_message}
788
+ key={i}
789
+ color={result?.color}
790
+ onPress={() => {
791
+ if (item?.hasOwnProperty('status') && item?.status == 1) {
792
+ setSelectedAddon(item)
793
+ dialogAddonList?.current?.hide()
794
+ loadDataTicket(result?.id, item?.price_id, item?.ondate)
795
+ // loadDataAddons(getGroupAddon()?.addons_id, item?.url)
796
+ }
797
+ }}
798
+ icon={'plus-circle-outline'}
799
+ title={item?.title}
800
+ subtitle={item?.ondate != "0000-00-00" ? LibUtils.moment(item.ondate).format("DD MMM YYYY") : ''}
801
+ info={item?.info}
802
+ />
803
+ )
804
+ })
805
+ }
806
+ </ScrollView>
876
807
  </View>
877
808
  </LibSlidingup>
878
809