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
@@ -0,0 +1,312 @@
1
+ // withHooks
2
+ import { useRef } from 'react';
3
+
4
+ import { Canvas, Group, Path, Skia } from '@shopify/react-native-skia';
5
+ import { applyStyle } from 'esoftplay';
6
+ import { EventButton } from 'esoftplay/cache/event/button/import';
7
+ import { EventCheckout } from 'esoftplay/cache/event/checkout/import';
8
+ import { EventTicket } from 'esoftplay/cache/event/ticket/import';
9
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
10
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
11
+ import { LibLoading } from 'esoftplay/cache/lib/loading/import';
12
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
13
+ import { LibProgress } from 'esoftplay/cache/lib/progress/import';
14
+ import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
15
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
16
+ import { UseCondition } from 'esoftplay/cache/use/condition/import';
17
+ import esp from 'esoftplay/esp';
18
+ import useLazyState from 'esoftplay/lazy';
19
+ import moment from 'esoftplay/moment';
20
+ import useSafeState from 'esoftplay/state';
21
+ import { useTimeout } from 'esoftplay/timeout';
22
+ import React, { useEffect, useMemo } from 'react';
23
+ import { Dimensions, Pressable, ScrollView, Text, TouchableOpacity, View } from 'react-native';
24
+ import { Gesture, GestureDetector } from 'react-native-gesture-handler';
25
+
26
+ const { width: SCREEN_WIDTH, height } = Dimensions.get('window');
27
+
28
+ export interface EventLayoutArgs {
29
+
30
+ }
31
+ export interface EventLayoutProps {
32
+ result: any,
33
+ is_multiprice: boolean,
34
+ priceTypes: any,
35
+ }
36
+
37
+ interface PassType {
38
+ id: string,
39
+ price_ids: string[],
40
+ title: string,
41
+ description: string
42
+ date: string,
43
+ disabled: boolean
44
+ }
45
+
46
+ export default function m(props: EventLayoutProps): any {
47
+ const { result, priceTypes } = props
48
+ const sliding = useRef<LibSlidingup>(null)
49
+ const showTicket = useRef<LibSlidingup>(null)
50
+ const [data, setData, getData] = useSafeState<any>()
51
+ const [selectedId, setSelectedId] = useLazyState<string | null>(null);
52
+ // const filterData: PassType[] = result?.passes
53
+ const [selectedFilter, setSelectedFilter, getSelectedFilter] = useLazyState<string>()
54
+ const [ondate, setOndate, getOndate] = useLazyState<any>(null)
55
+ const [idsArray, setIdsArray, getIdsArray] = useLazyState<string[]>()
56
+
57
+ const [filterData, setFilterData, getFilterData] = useLazyState<PassType[]>()
58
+
59
+ const timeout = useTimeout()
60
+
61
+ const [expanded, setExpanded] = useSafeState<boolean>(false);
62
+ const LIMIT = 4
63
+
64
+ useEffect(() => {
65
+ loadFilter()
66
+ timeout(() => {
67
+ sliding.current?.show?.()
68
+ }, 300);
69
+ }, [])
70
+
71
+
72
+ function buildUrl(url: string): string {
73
+ url += url.includes('?') ? '&' : '?'
74
+ url += 'ondate=' + moment().format('YYYY-MM-DD')
75
+ return url
76
+ }
77
+
78
+ function loadFilter() {
79
+ const url = buildUrl("v3/event_seat_filter?event_id=" + result?.id)
80
+ new LibCurl(url, null,
81
+ (result) => {
82
+ setFilterData(result)()
83
+ },
84
+ (error) => {
85
+
86
+ })
87
+ }
88
+
89
+ function loadOutline() {
90
+ const url = buildUrl("v3/event_seat_outline?event_id=" + result?.id)
91
+ new LibCurl(url, null,
92
+ (result) => {
93
+ setData(result)
94
+ },
95
+ (error) => { }, 1)
96
+ }
97
+
98
+ // 1. Calculations (Keep your existing path logic)
99
+ const { globalBBox, processedItems, scale } = useMemo(() => {
100
+ let minX = Infinity; let minY = Infinity;
101
+ let maxX = -Infinity; let maxY = -Infinity;
102
+
103
+ const items = getData() && getData()?.map?.((item: any) => {
104
+ const path = Skia.Path.Make();
105
+ item.outline.forEach((poly: any) => {
106
+ if (poly.length < 4) return;
107
+ path.moveTo(poly[0] + item.bbox.x1, poly[1] + item.bbox.y1);
108
+ for (let i = 2; i < poly.length; i += 2) {
109
+ path.lineTo(poly[i] + item.bbox.x1, poly[i + 1] + item.bbox.y1);
110
+ }
111
+ path.close();
112
+ });
113
+ const bounds = path.getBounds();
114
+ minX = Math.min(minX, bounds.x);
115
+ minY = Math.min(minY, bounds.y);
116
+ maxX = Math.max(maxX, bounds.x + bounds.width);
117
+ maxY = Math.max(maxY, bounds.y + bounds.height);
118
+ return { id: item.price_ids.join(), path, color: item.color, price: item.price, ondate: item?.ondate };
119
+ });
120
+
121
+ const currentScale = (SCREEN_WIDTH - 30) / (maxX - minX || 1); //30 buat padding
122
+ return { globalBBox: { minX, minY }, processedItems: items, scale: currentScale };
123
+ }, [data]);
124
+
125
+ // 2. Define the Tap Gesture
126
+ const tapGesture = Gesture.Tap()
127
+ .runOnJS(true) // Required to trigger State/Alerts
128
+ .onStart((e) => {
129
+ const { x, y } = e;
130
+
131
+ // Map screen touch to path coordinates
132
+ const localX = (x / scale) + globalBBox.minX;
133
+ const localY = (y / scale) + globalBBox.minY;
134
+
135
+
136
+ let foundId = null;
137
+ const ondate = getOndate()?.split("|")[2].split(",")
138
+ for (let i = processedItems.length - 1; i >= 0; i--) {
139
+ const proc = processedItems[i].id.split(",")
140
+ if (processedItems[i].path.contains(localX, localY) && proc.every((v: string) => ondate.includes(v))) {
141
+ foundId = processedItems[i].id;
142
+ const item = processedItems[i];
143
+
144
+ setIdsArray(item.id.split(","))()
145
+ showTicket.current?.show?.()
146
+
147
+ break;
148
+ }
149
+ }
150
+ setSelectedId(foundId)()
151
+ });
152
+
153
+ const filterD = filterData && filterData.length > 0 && filterData || []
154
+ const displayedData = expanded ? filterD : filterD?.slice(0, LIMIT)
155
+
156
+ return (
157
+ <View style={{ flex: 1 }}>
158
+ <View style={{ flexDirection: "row", padding: 15, justifyContent: 'flex-end' }}>
159
+ <Pressable onPress={() => {
160
+ sliding.current?.show?.()
161
+ }} style={{ flexDirection: "row", borderRadius: 10, paddingVertical: 5, paddingHorizontal: 10, backgroundColor: '#eee', alignItems: 'center' }}>
162
+ <Text allowFontScaling={false} style={{ color: "#4a4a4a" }}>{ondate ? ondate.split("|")[1] == "null" ? moment(ondate.split("|")[0]).format("DD MMM YYYY") : ondate.split("|")[1] : "Pilih Tanggal"}</Text>
163
+ <LibIcon name='chevron-down' size={20} color='#4a4a4a' />
164
+ </Pressable>
165
+ </View>
166
+
167
+ <UseCondition if={!!ondate} fallback={
168
+ <View style={{ flex: 1, alignItems: "center", marginTop: 40 }}>
169
+ <Text allowFontScaling={false} style={{ color: "#4a4a4a" }}>{"Silahkan pilih tanggal terlebih dahulu"}</Text>
170
+ </View>
171
+ } >
172
+ <View style={{ flex: 1, padding: 15 }}>
173
+ {
174
+ !data ? <LibLoading /> :
175
+ <GestureDetector gesture={tapGesture}>
176
+ {/* Ensure the Canvas has a background or flex to fill the detector */}
177
+ <Canvas style={{ flex: 1 }}>
178
+ <Group transform={[
179
+ { translateX: -globalBBox.minX * scale },
180
+ { translateY: -globalBBox.minY * scale },
181
+ { scale }
182
+ ]}>
183
+ {processedItems && processedItems?.length > 0 && processedItems?.map?.(({ id, path, color, }: any) => {
184
+ const fixedId = id?.split(",")
185
+ const fixedOndate = getOndate()?.split("|")[2].split(",")
186
+ const isSelected = selectedId === id;
187
+ const baseOpacity = selectedId === null || isSelected ? 1 : 0.3;
188
+ const shapeColor = fixedId.every((v: string) => fixedOndate.includes(v)) ? color : "#e6e6e6"
189
+ const borderColor = isSelected ? "white" : shapeColor
190
+
191
+ return (
192
+ <Group key={id}>
193
+ <Path
194
+ path={path}
195
+ color={shapeColor}
196
+ style="fill"
197
+ opacity={baseOpacity}
198
+ antiAlias={true}
199
+ />
200
+
201
+ <Path
202
+ path={path}
203
+ color={borderColor}
204
+ style="stroke"
205
+ strokeWidth={1 / scale}
206
+ opacity={baseOpacity * 0.8}
207
+ antiAlias={true}
208
+ />
209
+ </Group>
210
+ );
211
+ })}
212
+ </Group>
213
+ </Canvas>
214
+ </GestureDetector>
215
+ }
216
+ </View>
217
+ </UseCondition>
218
+
219
+
220
+ <LibSlidingup ref={sliding}>
221
+ <View style={{ borderTopRightRadius: 20, borderTopLeftRadius: 20, padding: 15, backgroundColor: '#fff', maxHeight: height - (height * 0.333) }}>
222
+ <ScrollView>
223
+ {
224
+ filterData && filterData?.length > 0 && displayedData.map?.((item, i) => {
225
+ const key = `${item?.id}|${item?.title}|${item?.price_ids}`
226
+ return (
227
+ <Pressable key={i} onPress={() => {
228
+ if (!item.disabled) {
229
+ setSelectedFilter(key)()
230
+ }
231
+ }} style={{ padding: 10, borderRadius: 10, borderWidth: selectedFilter == key ? 1.5 : 1, borderColor: selectedFilter == key ? LibStyle.colorGreen : "#e6e6e6", marginBottom: 8, backgroundColor: item?.disabled ? "#f5f5f5" : "white" }}>
232
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, color: "#4a4a4a" }}>{item?.title || moment(item?.id).format("DD MMMM YYYY")}</Text>
233
+ {
234
+ !!item?.description && item?.description != "" &&
235
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, color: "#999", marginTop: 5 }}>{item?.description}</Text>
236
+ }
237
+ </Pressable>
238
+ )
239
+ })
240
+ }
241
+ {
242
+ filterData?.length > LIMIT &&
243
+ <TouchableOpacity onPress={() => {
244
+ setExpanded(x => !x)
245
+ }} style={{ borderTopColor: LibStyle.colorGrey, borderTopWidth: 0.8, flex: 1, padding: 8, flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
246
+ <Text allowFontScaling={false} style={{ marginRight: 5, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: LibStyle.colorBlue }}>{expanded ? esp.lang("event/ticket_list", "see_less") : esp.lang("event/ticket_list", "see_more")}</Text>
247
+ <LibIcon name={expanded ? 'chevron-up-circle-outline' : 'chevron-down-circle-outline'} color={LibStyle.colorBlue} size={18} />
248
+ </TouchableOpacity>
249
+ }
250
+ </ScrollView>
251
+ <EventButton
252
+ label='Pilih Tipe Tiket'
253
+ backgroundColor={selectedFilter ? LibStyle.colorGreen : "#ccc"}
254
+ onPress={() => {
255
+ if (getSelectedFilter()) {
256
+ setIdsArray([])
257
+ setSelectedId(null)
258
+ setOndate(getSelectedFilter())()
259
+ loadOutline()
260
+ sliding.current?.hide?.()
261
+ }
262
+ }}
263
+ />
264
+ </View>
265
+ </LibSlidingup>
266
+
267
+ <LibSlidingup ref={showTicket}>
268
+ <View style={applyStyle({ backgroundColor: 'white', borderTopRightRadius: 30, borderTopLeftRadius: 30, paddingTop: 15, maxHeight: LibStyle.height - (LibStyle.height / 3) })}>
269
+ {
270
+ idsArray && priceTypes && priceTypes?.length > 0 &&
271
+ <EventTicket
272
+ multiprice={props?.is_multiprice}
273
+ priceList={priceTypes?.filter?.((x: any) => idsArray.includes(x.price_id))}
274
+ onSelectTickets={(datas) => {
275
+ showTicket.current?.hide()
276
+
277
+ const tiket = datas[0]
278
+ if (datas?.length == 0) {
279
+ esp.modProp("lib/toast").show(esp.lang("event/ticket_list", "ticket_not_select"), 3000)
280
+ return
281
+ }
282
+ if (tiket?.use_code == 1) {
283
+ function checkInvBlock() {
284
+ LibProgress.show(esp.lang("event/ticket_list", "wait"))
285
+ new LibCurl('voucher_check_validate', null, (res, msg) => {
286
+ LibProgress.hide()
287
+ if (res?.status == 1) {
288
+ LibNavigation.navigate('event/block_invitation', {
289
+ dataCheck: res,
290
+ })
291
+ } else {
292
+ EventCheckout().doPayment(result, tiket, tiket.qty, undefined)
293
+ }
294
+ }, (err) => {
295
+ LibProgress.hide()
296
+ })
297
+ }
298
+ checkInvBlock()
299
+ }
300
+ else {
301
+ EventCheckout().doPayment(result, tiket, tiket.qty, undefined)
302
+ }
303
+
304
+ }}
305
+ />
306
+ }
307
+ </View>
308
+ </LibSlidingup>
309
+
310
+ </View>
311
+ )
312
+ }
@@ -1,7 +1,9 @@
1
1
  // withHooks
2
2
 
3
+ import { EventDialog_custom } from 'esoftplay/cache/event/dialog_custom/import';
3
4
  import { EventDistribution_lock } from 'esoftplay/cache/event/distribution_lock/import';
4
5
  import { EventHeader } from 'esoftplay/cache/event/header/import';
6
+ import { EventPayment_subscribeProperty } from 'esoftplay/cache/event/payment_subscribe/import';
5
7
  import { EventRandomseat } from 'esoftplay/cache/event/randomseat/import';
6
8
  import { LibCurl } from 'esoftplay/cache/lib/curl/import';
7
9
  import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
@@ -80,6 +82,64 @@ export default function m(props: EventLoading_pageProps): any {
80
82
  return () => LibNavigation.cancelBackResult(LibNavigation.getResultKey(props))
81
83
  }, [])
82
84
 
85
+ function handleError(error: any) {
86
+ LibProgress.hide()
87
+ LibNavigation.back()
88
+ loadingState.set(LibObject.unset(loadingState.get(), post.trx_id)())
89
+ const ticketNotAvailableCodes = ['EV034', 'EV036', 'EV038', 'EV039', 'EV040']
90
+ if (ticketNotAvailableCodes.includes(error.status_code)) {
91
+ LibNavigation.back()
92
+ // LibNavigation.navigate(post?.is_multi == 1 ? 'event/ticket_list2' : 'event/ticket_list')
93
+ }
94
+ if (error.status_code == 'EV033') {
95
+ LibDialog.custom(
96
+ <EventRandomseat
97
+ onPressOk={() => {
98
+ LibDialog.hide()
99
+ PaymentTicketProperty.stateRandomSeat.set("2")
100
+ EventPayment_subscribeProperty.reBooking.trigger()
101
+ }}
102
+ onPressNo={() => LibDialog.hide()}
103
+ />
104
+ )
105
+ } else if (error?.status_code == "EV045") {
106
+ EventDistribution_lock(() => {
107
+ EventPayment_subscribeProperty.reTryBooking.trigger(post)
108
+ })
109
+ // LibDialog.custom(
110
+ // <ComponentDialog_custom
111
+ // icon={"close-circle"}
112
+ // color={LibStyle.colorRed}
113
+ // msg={error?.message || esp.lang("bigbang/loading_page", "booking_not_complete")}
114
+ // onPressOK={() => {
115
+ // LibDialog.hide()
116
+ // PaymentTicketProperty.reTryBooking.trigger(post)
117
+ // }}
118
+ // onPressCancel={() => { LibDialog.hide() }}
119
+ // />
120
+ // )
121
+ } else if (error?.status_code == "PY0254") {
122
+ LibDialog.custom(
123
+ <EventDialog_custom
124
+ showCountdown
125
+ icon={"close-circle"}
126
+ color={LibStyle.colorRed}
127
+ msg={error?.message || esp.lang("bigbang/loading_page", "booking_not_complete")}
128
+ onPressOK={() => {
129
+ LibDialog.hide()
130
+ EventPayment_subscribeProperty.reTryBooking.trigger(post)
131
+ }}
132
+ onPressCancel={() => { LibDialog.hide() }}
133
+ />
134
+ )
135
+ } else {
136
+ if (error?.status_code != "GE043")
137
+ LibDialog.warningConfirm(esp.lang("event/loading_page", "oops"), error?.message, esp.lang("event/loading_page", "back"), () => {
138
+
139
+ }, "", () => { })
140
+ }
141
+ }
142
+
83
143
  function doAction() {
84
144
 
85
145
  if (isSecure && isSecure == 1) {
@@ -95,47 +155,7 @@ export default function m(props: EventLoading_pageProps): any {
95
155
  sendBackResult(dataSB)
96
156
 
97
157
  }, (error) => {
98
- LibProgress.hide()
99
- LibNavigation.back()
100
- loadingState.set(LibObject.unset(loadingState.get(), post.trx_id)())
101
- const ticketNotAvailableCodes = ['EV034', 'EV036', 'EV038', 'EV039', 'EV040']
102
- if (ticketNotAvailableCodes.includes(error.status_code)) {
103
- LibNavigation.back()
104
- // LibNavigation.navigate(post?.is_multi == 1 ? 'event/ticket_list2' : 'event/ticket_list')
105
- }
106
- if (error.status_code == 'EV033') {
107
- LibDialog.custom(
108
- <EventRandomseat
109
- onPressOk={() => {
110
- LibDialog.hide()
111
- PaymentTicketProperty.stateRandomSeat.set("2")
112
- PaymentTicketProperty.reBooking.trigger()
113
- }}
114
- onPressNo={() => LibDialog.hide()}
115
- />
116
- )
117
- } else if (error?.status_code == "EV045") {
118
- EventDistribution_lock(() => {
119
- PaymentTicketProperty.reTryBooking.trigger(post)
120
- })
121
- // LibDialog.custom(
122
- // <ComponentDialog_custom
123
- // icon={"close-circle"}
124
- // color={LibStyle.colorRed}
125
- // msg={error?.message || esp.lang("bigbang/loading_page", "booking_not_complete")}
126
- // onPressOK={() => {
127
- // LibDialog.hide()
128
- // PaymentTicketProperty.reTryBooking.trigger(post)
129
- // }}
130
- // onPressCancel={() => { LibDialog.hide() }}
131
- // />
132
- // )
133
- } else {
134
- if (error?.status_code != "GE043")
135
- LibDialog.warningConfirm(esp.lang("event/loading_page", "oops"), error?.message, esp.lang("event/loading_page", "back"), () => {
136
-
137
- }, "", () => { })
138
- }
158
+ handleError(error)
139
159
  }, 1)
140
160
  } else {
141
161
  new LibCurl(url, post ? post : null, (result, msg) => {
@@ -149,47 +169,7 @@ export default function m(props: EventLoading_pageProps): any {
149
169
 
150
170
  sendBackResult(dataSB)
151
171
  }, (error) => {
152
- LibProgress.hide()
153
- LibNavigation.back()
154
- loadingState.set(LibObject.unset(loadingState.get(), post.trx_id)())
155
- const ticketNotAvailableCodes = ['EV034', 'EV036', 'EV038', 'EV039', 'EV040']
156
- if (ticketNotAvailableCodes.includes(error.status_code)) {
157
- LibNavigation.back()
158
- // LibNavigation.navigate(post?.is_multi == 1 ? 'event/ticket_list2' : 'event/ticket_list')
159
- }
160
- if (error.status_code == 'EV033') {
161
- LibDialog.custom(
162
- <EventRandomseat
163
- onPressOk={() => {
164
- LibDialog.hide()
165
- PaymentTicketProperty.stateRandomSeat.set("2")
166
- PaymentTicketProperty.reBooking.trigger()
167
- }}
168
- onPressNo={() => LibDialog.hide()}
169
- />
170
- )
171
- } else if (error?.status_code == "EV045") {
172
- EventDistribution_lock(() => {
173
- PaymentTicketProperty.reTryBooking.trigger(post)
174
- })
175
- // LibDialog.custom(
176
- // <ComponentDialog_custom
177
- // icon={"close-circle"}
178
- // color={LibStyle.colorRed}
179
- // msg={error?.message || esp.lang("bigbang/loading_page", "booking_not_complete")}
180
- // onPressOK={() => {
181
- // LibDialog.hide()
182
- // PaymentTicketProperty.reTryBooking.trigger(post)
183
- // }}
184
- // onPressCancel={() => { LibDialog.hide() }}
185
- // />
186
- // )
187
- } else {
188
- if (error?.status_code != "GE043")
189
- LibDialog.warningConfirm(esp.lang("event/loading_page", "oops"), error?.message, esp.lang("event/loading_page", "back"), () => {
190
-
191
- }, "", () => { })
192
- }
172
+ handleError(error)
193
173
  }, 1)
194
174
  }
195
175
  }
package/event/message.tsx CHANGED
@@ -21,8 +21,8 @@ export default function m(props: EventMessageProps): any {
21
21
  return (
22
22
  <View style={[{ flex: 1, alignItems: 'center', justifyContent: 'center' }, props.style]}>
23
23
  <View style={{ justifyContent: 'center', alignItems: 'center', padding: 10 }}>
24
- <LibPicture source={esp.assets('img_failed_msg.png')} style={{ width: LibStyle.width * 0.8, height: 200, resizeMode: 'contain' }} />
25
- <View style={{ width: LibStyle.width - 40, justifyContent: 'center', alignItems: 'center', padding: 15, borderRadius: 10, marginTop: 20 }}>
24
+ <LibPicture source={esp.assets('img_failed_msg.png')} style={{ width: LibStyle.width * 0.8, height: 150, resizeMode: 'contain' }} />
25
+ <View style={{ width: LibStyle.width - 40, justifyContent: 'center', alignItems: 'center', padding: 10, borderRadius: 10, marginTop: 10 }}>
26
26
  <Text allowFontScaling={false} style={[{ flexWrap: 'wrap', fontSize: 14, lineHeight: 20, fontWeight: "bold", marginBottom: 5, color: "#4a4a4a", textAlign: "center" }, props.textStyle]}>{props.message}</Text>
27
27
  </View>
28
28
  </View>