esoftplay-event 0.0.1 → 0.0.2

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 (83) hide show
  1. package/event/artist.tsx +11 -7
  2. package/event/artist_detail.tsx +3 -5
  3. package/event/artist_detailv2.tsx +386 -0
  4. package/event/artistv2.tsx +162 -0
  5. package/event/button_order_detail.tsx +43 -0
  6. package/event/countdown_base.tsx +16 -3
  7. package/event/countdown_event.tsx +47 -0
  8. package/event/detail.tsx +30 -37
  9. package/event/detail2.tsx +354 -0
  10. package/event/exchange_ticket.tsx +1 -1
  11. package/event/exchange_ticket_list.tsx +2 -3
  12. package/event/exchange_ticket_result.tsx +1 -1
  13. package/event/firebase_socket.ts +8 -0
  14. package/event/loading_page.tsx +4 -2
  15. package/event/order.tsx +23 -36
  16. package/event/order_detail.tsx +119 -41
  17. package/event/order_detail_upgrade.tsx +8 -5
  18. package/event/order_detail_upgrade_payment.tsx +17 -11
  19. package/event/order_detail_visitor.tsx +33 -33
  20. package/event/order_detail_waiting.tsx +45 -20
  21. package/event/order_item.tsx +1 -1
  22. package/event/order_lottery.tsx +48 -36
  23. package/event/order_reschedule.tsx +50 -52
  24. package/event/order_share_to.tsx +11 -24
  25. package/event/order_share_to_detail.tsx +8 -3
  26. package/event/order_waiting.tsx +1 -1
  27. package/event/queue_pricing.tsx +16 -3
  28. package/event/refresh_button.tsx +3 -5
  29. package/event/scan_item.tsx +2 -2
  30. package/event/seat.tsx +19 -11
  31. package/event/seat_map_new.tsx +313 -0
  32. package/event/secure_page.debug.tsx +34 -0
  33. package/event/secure_page.live.tsx +35 -0
  34. package/event/secure_page.tsx +6 -5
  35. package/event/test.tsx +240 -155
  36. package/event/ticket_list.tsx +49 -21
  37. package/event/ticket_list2.tsx +83 -34
  38. package/event/tms_check_code.tsx +6 -0
  39. package/event/tms_check_ticket_result.tsx +36 -7
  40. package/event/tms_dashboard.tsx +85 -3
  41. package/event/tms_gate.tsx +6 -0
  42. package/event/tms_home.tsx +1 -4
  43. package/event/tms_in_failed.tsx +1 -1
  44. package/event/tms_in_log.tsx +2 -0
  45. package/event/tms_in_success.tsx +1 -1
  46. package/event/tms_log.tsx +10 -25
  47. package/event/tms_out.tsx +1 -1
  48. package/event/tms_out_failed.tsx +1 -1
  49. package/event/visitor_input.tsx +23 -5
  50. package/event/visitor_inputv2.tsx +397 -0
  51. package/event/voucher.tsx +2 -0
  52. package/event/voucher2.tsx +14 -6
  53. package/id.json +25 -9
  54. package/package.json +1 -1
  55. package/event/entrance.tsx +0 -215
  56. package/event/entrance_again.tsx +0 -199
  57. package/event/entrance_failed.tsx +0 -190
  58. package/event/entrance_idcard.tsx +0 -199
  59. package/event/entrance_list.tsx +0 -264
  60. package/event/entrance_list_item.tsx +0 -88
  61. package/event/entrance_log.tsx +0 -130
  62. package/event/entrance_success.tsx +0 -153
  63. package/event/entrance_warning.tsx +0 -91
  64. package/event/exit.tsx +0 -91
  65. package/event/exit_failed.tsx +0 -135
  66. package/event/exit_list.tsx +0 -118
  67. package/event/exit_log.tsx +0 -130
  68. package/event/exit_success.tsx +0 -143
  69. package/event/exit_temporary.tsx +0 -226
  70. package/event/firebase_socket.debug.ts +0 -260
  71. package/event/firebase_socket.live.ts +0 -335
  72. package/event/hall_in.tsx +0 -148
  73. package/event/hall_in_failed.tsx +0 -270
  74. package/event/hall_in_list.tsx +0 -222
  75. package/event/hall_in_log.tsx +0 -134
  76. package/event/hall_in_success.tsx +0 -132
  77. package/event/hall_out.tsx +0 -143
  78. package/event/hall_out_failed.tsx +0 -133
  79. package/event/hall_out_list.tsx +0 -215
  80. package/event/hall_out_log.tsx +0 -133
  81. package/event/hall_out_success.tsx +0 -130
  82. package/event/log.tsx +0 -433
  83. package/event/seat_map_test.tsx +0 -401
@@ -63,10 +63,13 @@ export default function m(props: EventOrder_waitingProps): any {
63
63
  function loadData() {
64
64
  EventOrderProperty.subscribe().trigger()
65
65
  new LibCurl(url + ((url.includes("?") ? "&" : "?") + 't=' + new Date().getTime()), null, (res) => {
66
- // esp.log(res);
66
+ esp.log(res);
67
67
  setResult(res)
68
+ if (res?.status != 0) {
69
+ LibAutoreload.clear()
70
+ }
71
+
68
72
  if (res?.status == 1) {
69
- // LibAutoreload.clear()
70
73
  LibNavigation.backToRoot()
71
74
  LibNavigation.navigate('user/profile')
72
75
  LibNavigation.navigate('event/order')
@@ -145,16 +148,29 @@ export default function m(props: EventOrder_waitingProps): any {
145
148
  send_image: result?.image,
146
149
  }, 123).then((value) => {
147
150
 
148
- let module = ['event/order', 'payment/cc_web']
151
+ // let module = ['event/order', 'payment/cc_web']
149
152
 
150
153
  LibNavigation.backToRoot()
151
- module?.map((item: any) => LibNavigation.push(item,
152
- {
153
- ...value,
154
- url: value.url,
155
- title: esp.lang("bigbang/loading_page", "success")
154
+ LibNavigation.navigateForResult('payment/cc_web', {
155
+ ...value,
156
+ statusSuccess: [1]
157
+ }).then((res) => {
158
+ LibNavigation.backToRoot()
159
+ LibNavigation.push('user/profile')
160
+ if (res?.hasOwnProperty('params_error') || res?.hasOwnProperty('failed')) {
161
+ LibNavigation.push('event/order_waiting')
162
+ LibNavigation.push('event/order_detail_waiting', { url: res?.url })
163
+ } else {
164
+ LibNavigation.push('event/order')
156
165
  }
157
- ))
166
+ })
167
+ // module?.map((item: any) => LibNavigation.push(item,
168
+ // {
169
+ // ...value,
170
+ // url: value.url,
171
+ // title: esp.lang("bigbang/loading_page", "success")
172
+ // }
173
+ // ))
158
174
  })
159
175
 
160
176
  // cancel booking ini
@@ -287,7 +303,7 @@ export default function m(props: EventOrder_waitingProps): any {
287
303
  <Text allowFontScaling={false} style={{ flex: 1, alignContent: 'center', alignItems: 'center', fontSize: 14, fontStyle: "normal", letterSpacing: 0, textAlign: "right", color: "#9b9b9b" }}>{LibUtils.money(result?.total, result?.currency)}</Text>
288
304
  </View>
289
305
  {
290
- result?.status == 0 && LibUtils.moment(result?.exp_payment).serverFormat('YYYY-MM-DD HH:mm:ss') >= dateNow &&
306
+ result?.status == 0 && LibUtils.moment(result?.exp_payment).serverFormat('YYYY-MM-DD HH:mm:ss', result?.timezone) >= dateNow &&
291
307
  <View style={{ alignContent: 'center', alignItems: 'center', justifyContent: 'space-between', flexDirection: 'row', marginTop: 5 }}>
292
308
  <Text allowFontScaling={false} style={{ flex: 1, fontWeight: 'bold', fontSize: 14, fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }}>{esp.lang("event/order_detail_waiting", "booking_code")}</Text>
293
309
  <Text allowFontScaling={false} style={{ flex: 1, alignContent: 'center', alignItems: 'center', fontSize: 14, fontStyle: "normal", letterSpacing: 0, textAlign: "right", color: LibStyle.colorRed }}>{result?.booking_code}</Text>
@@ -297,7 +313,7 @@ export default function m(props: EventOrder_waitingProps): any {
297
313
  result?.status == 0 &&
298
314
  <View style={{ alignItems: 'center', justifyContent: 'space-between', flexDirection: 'row', marginTop: 5 }}>
299
315
  <Text allowFontScaling={false} style={{ fontWeight: 'bold', flex: 1, flexWrap: 'wrap', fontSize: 14, fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }}>{esp.lang("event/order_detail_waiting", "expired_payment")}</Text>
300
- <EventCountdown_base expired={moment(result?.exp_payment).serverFormat("YYYY-MM-DD HH:mm:ss")} style={{ flex: 1, marginLeft: 15, fontSize: 14, color: LibStyle.colorRed, fontFamily: "ArialBold" }} />
316
+ <EventCountdown_base expired={moment(result?.exp_payment).serverFormat("YYYY-MM-DD HH:mm:ss", result?.timezone)} style={{ flex: 1, marginLeft: 15, fontSize: 14, color: LibStyle.colorRed, fontFamily: "ArialBold" }} />
301
317
  </View>
302
318
  }
303
319
 
@@ -365,7 +381,7 @@ export default function m(props: EventOrder_waitingProps): any {
365
381
  <QRCode ecl="H" size={250} value={result?.params?.qr} />
366
382
  </View>
367
383
 
368
- <Text allowFontScaling={false} style={{ fontSize: 14, textAlign: 'center', marginVertical: 10 }}>{esp.lang("event/order_detail_waiting", "expired_on") + moment(result?.exp_payment).serverFormat("DD MMM YYYY, HH:mm:ss")}</Text>
384
+ <Text allowFontScaling={false} style={{ fontSize: 14, textAlign: 'center', marginVertical: 10 }}>{esp.lang("event/order_detail_waiting", "expired_on") + moment(result?.exp_payment).serverFormat("DD MMM YYYY, HH:mm:ss", result?.timezone)}</Text>
369
385
 
370
386
  </View>
371
387
  <TouchableOpacity onPress={() => EventCapture.capture(qrView, result?.event_name + "-" + result?.price_name)} style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'center', height: 30, marginTop: 10, borderTopColor: LibStyle.colorBlue, borderBottomColor: LibStyle.colorBlue, borderTopWidth: 0.5, borderBottomWidth: 0.5 }}>
@@ -381,7 +397,7 @@ export default function m(props: EventOrder_waitingProps): any {
381
397
  }
382
398
 
383
399
  {
384
- result?.payment?.payment_type != 3 && result?.payment?.payment_type != 4 && result?.payment?.payment_type != 11 && result?.payment?.payment_type != 13 && result?.payment?.payment_type != 14 &&
400
+ result?.status == 0 && result?.payment?.payment_type != 3 && result?.payment?.payment_type != 4 && result?.payment?.payment_type != 11 && result?.payment?.payment_type != 13 && result?.payment?.payment_type != 14 &&
385
401
  <>
386
402
  <View style={{ height: 3, backgroundColor: "#f6f6f6" }} />
387
403
 
@@ -425,18 +441,24 @@ export default function m(props: EventOrder_waitingProps): any {
425
441
  result?.payment?.payment_type == 13 &&
426
442
  <>
427
443
  <View style={{ height: 3, backgroundColor: "#f6f6f6" }} />
428
-
429
444
  <TouchableOpacity
430
445
  onPress={() => {
431
- Linking.openURL(result?.params?.url_mobile)
446
+ if (result?.params?.url_mobile != null) {
447
+ Linking.openURL(result?.params?.url_mobile)
448
+ } else if (result?.params?.url_web != null) {
449
+ Linking.openURL(result?.params?.url_web)
450
+ }
432
451
  }}
433
452
  style={{ marginTop: 15, borderRadius: 10, borderWidth: 2, overflow: 'hidden', borderColor: "#f6f6f6" }}>
434
453
  <View style={{ padding: 15, backgroundColor: '#000', justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
435
454
  <Text allowFontScaling={false} style={{ flex: 1, alignContent: 'center', alignItems: 'center', fontWeight: 'bold', fontSize: 16, fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{esp.lang("event/order_detail_waiting", "scan_or_tap")}</Text>
436
455
  </View>
437
- <View style={{ margin: 15, alignSelf: 'center' }}>
438
- <QRCode ecl="H" size={250} value={result?.params?.qr} />
439
- </View>
456
+ {
457
+ result?.params?.qr != null &&
458
+ <View style={{ margin: 15, alignSelf: 'center' }}>
459
+ <QRCode ecl="H" size={250} value={result?.params?.qr} />
460
+ </View>
461
+ }
440
462
 
441
463
  </TouchableOpacity>
442
464
 
@@ -444,7 +466,10 @@ export default function m(props: EventOrder_waitingProps): any {
444
466
  }
445
467
 
446
468
  <View style={{ height: 3, backgroundColor: "#f6f6f6" }} />
447
- <Text allowFontScaling={false} style={{ fontSize: 10, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#9b9b9b", marginTop: 14 }}>{esp.lang("event/order_detail", "Checked_within_10_minutes_after_payment_is_made")}</Text>
469
+ {
470
+ result?.status == 0 &&
471
+ <Text allowFontScaling={false} style={{ fontSize: 10, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#9b9b9b", marginTop: 14 }}>{esp.lang("event/order_detail", "Checked_within_10_minutes_after_payment_is_made")}</Text>
472
+ }
448
473
  {
449
474
  result?.payment?.description != null &&
450
475
  <TouchableOpacity onPress={() => {
@@ -459,7 +484,7 @@ export default function m(props: EventOrder_waitingProps): any {
459
484
  </View>
460
485
  </LibScroll>
461
486
  {
462
- result?.status == 0 && LibUtils.moment(result?.exp_payment).serverFormat('YYYY-MM-DD HH:mm:ss') >= dateNow &&
487
+ result?.status == 0 && LibUtils.moment(result?.exp_payment).serverFormat('YYYY-MM-DD HH:mm:ss', result?.timezone) >= dateNow &&
463
488
  <View style={{ padding: 15, paddingTop: 10, paddingBottom: 10 }}>
464
489
  {
465
490
  (result?.payment?.payment_type == 3 || result?.payment?.payment_type == 14) && //khusus cc & FPX
@@ -97,7 +97,7 @@ export default function m(props: EventOrder_itemProps): any {
97
97
  item?.status == 0 ?
98
98
  <View style={applyStyle({ flex: 1, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', alignContent: 'center', paddingHorizontal: 15 })}>
99
99
  <View style={{ flex: 1 }}>
100
- <EventCountdown_base expired={LibUtils.moment(item?.exp_payment).serverFormat('YYYY-MM-DD HH:mm:ss')} style={applyStyle({ fontSize: 12, color: LibStyle.colorRed, fontFamily: "ArialBold", fontWeight: "normal", fontStyle: "normal" })} />
100
+ <EventCountdown_base expired={LibUtils.moment(item?.exp_payment).serverFormat('YYYY-MM-DD HH:mm:ss', item?.timezone)} style={applyStyle({ fontSize: 12, color: LibStyle.colorRed, fontFamily: "ArialBold", fontWeight: "normal", fontStyle: "normal" })} />
101
101
  </View>
102
102
  {
103
103
  !!item?.booking_code &&
@@ -15,6 +15,7 @@ import esp from 'esoftplay/esp';
15
15
  import useSafeState from 'esoftplay/state';
16
16
  import { useEffect } from 'react';
17
17
 
18
+ import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
18
19
  import { LibProgress } from 'esoftplay/cache/lib/progress/import';
19
20
  import React from 'react';
20
21
  import { Pressable, ScrollView, Text, TouchableOpacity, View } from 'react-native';
@@ -44,10 +45,12 @@ export default function m(props: EventOrder_lotteryProps): any {
44
45
  })
45
46
  })
46
47
  let b = {
48
+ ...res,
47
49
  coupon: res?.coupon,
48
50
  list: a
49
51
  }
50
52
  setResult(b)
53
+ // esp.log(res);
51
54
  }, (error: any) => {
52
55
  esp.log(error);
53
56
  LibDialog.warning("Oops", error?.message)
@@ -94,45 +97,51 @@ export default function m(props: EventOrder_lotteryProps): any {
94
97
  <View key={i} style={{ flexDirection: 'row', margin: 15 }}>
95
98
  <Pressable onPress={() => { }} style={{ flex: 1, flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'center', paddingLeft: 50, marginLeft: 35, borderRadius: 5, padding: 10, backgroundColor: '#fff' }}>
96
99
  <View style={{ flex: 1, marginRight: 5, }}>
97
- <Text allowFontScaling={false} numberOfLines={1} ellipsizeMode='tail' style={{ fontWeight: 'bold', fontSize: 16 }} >{item.title}</Text>
98
- <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode='tail' style={{ fontSize: 12, color: 'grey' }}>{item.description}</Text>
99
-
100
- <View style={applyStyle({ marginTop: 10, alignSelf: 'flex-end', flexDirection: 'row', alignContent: 'center', alignItems: 'center' })}>
101
- <TouchableOpacity onPressIn={() => {
102
- if (item.qty > 0) {
103
- let updatedList = LibObject.set(result, item.qty - 1)('list', i, 'qty');
104
- setResult(updatedList);
105
- }
106
- }} hitSlop={{ top: 15, left: 15, right: 15, bottom: 15 }} testID='minus_btn' onPress={() => { }}>
107
- <View style={applyStyle({ padding: 1, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
108
- <LibIcon name="minus" color="#e74c3c" />
109
- </View>
110
- </TouchableOpacity>
111
- <Text style={applyStyle({ fontFamily: "Arial", fontSize: 20, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#9b9b9b", marginLeft: 13, marginRight: 13 })}>{item.qty}</Text>
112
- <TouchableOpacity onPressIn={() => {
113
- const currentTotalQty = getTotalQty();
114
- if (currentTotalQty < result.coupon) {
115
- let updatedQty = item.qty + 1;
116
- if (currentTotalQty + 1 > result.coupon) {
117
- updatedQty = item.qty + (result.coupon - currentTotalQty);
100
+ <View style={{ flexDirection: 'row' }}>
101
+ <View style={{ flex: 1.5, }}>
102
+ <Text allowFontScaling={false} numberOfLines={1} ellipsizeMode='tail' style={{ fontWeight: 'bold', fontSize: 16 }} >{item.title}</Text>
103
+ <EventHtmltext allowFontScaling={false} style={{ fontSize: 12, color: 'grey' }}>{item.description}</EventHtmltext>
104
+ </View>
105
+ <View style={applyStyle({ flex: 1, justifyContent: 'flex-end', flexDirection: 'row', alignContent: 'center', alignItems: 'center' })}>
106
+ <TouchableOpacity onPressIn={() => {
107
+ if (item.qty > 0) {
108
+ let updatedList = LibObject.set(result, item.qty - 1)('list', i, 'qty');
109
+ setResult(updatedList);
118
110
  }
119
- let updatedList = LibObject.set(result, updatedQty)('list', i, 'qty');
120
- setResult(updatedList);
121
- } else {
122
- LibToastProperty.show(esp.lang("event/order_lottery", "your_maks_token_is") + result?.coupon)
123
- }
124
- }} hitSlop={{ top: 15, left: 15, right: 15, bottom: 15 }} testID='plus_btn' onPress={() => { }}>
125
- <View style={applyStyle({ padding: 1, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
126
- <LibIcon name="plus" color="#16a085" />
127
- </View>
128
- </TouchableOpacity>
111
+ }} hitSlop={{ top: 15, left: 15, right: 15, bottom: 15 }} testID='minus_btn' onPress={() => { }}>
112
+ <View style={applyStyle({ padding: 1, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
113
+ <LibIcon name="minus" color="#e74c3c" />
114
+ </View>
115
+ </TouchableOpacity>
116
+ <Text style={applyStyle({ fontFamily: "Arial", fontSize: 20, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#9b9b9b", marginLeft: 13, marginRight: 13 })}>{item.qty}</Text>
117
+ <TouchableOpacity onPressIn={() => {
118
+ const currentTotalQty = getTotalQty();
119
+ if (currentTotalQty < result.coupon) {
120
+ let updatedQty = item.qty + 1;
121
+ if (currentTotalQty + 1 > result.coupon) {
122
+ updatedQty = item.qty + (result.coupon - currentTotalQty);
123
+ }
124
+ let updatedList = LibObject.set(result, updatedQty)('list', i, 'qty');
125
+ setResult(updatedList);
126
+ } else {
127
+ LibToastProperty.show(esp.lang("event/order_lottery", "your_maks_token_is") + result?.coupon)
128
+ }
129
+ }} hitSlop={{ top: 15, left: 15, right: 15, bottom: 15 }} testID='plus_btn' onPress={() => { }}>
130
+ <View style={applyStyle({ padding: 1, borderRadius: 6, backgroundColor: "#ecf0f1", alignContent: 'center', alignItems: 'center' })}>
131
+ <LibIcon name="plus" color="#16a085" />
132
+ </View>
133
+ </TouchableOpacity>
134
+ </View>
129
135
  </View>
130
136
 
137
+
131
138
  </View>
132
139
  </Pressable>
133
- <View style={{ position: 'absolute', top: 15, height: 80, width: 80, borderRadius: 40, alignContent: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: '#fff' }}>
134
- <LibPicture style={{ height: 70, width: 70, borderRadius: 35, backgroundColor: '#000' }} resizeMode='cover' source={{ uri: item.image }} />
135
- </View>
140
+ <TouchableOpacity onPress={() => {
141
+ LibNavigation.navigate('lib/gallery', { image: item.image })
142
+ }} style={{ position: 'absolute', top: 10, height: 70, width: 70, borderRadius: 35, alignContent: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: '#fff' }}>
143
+ <LibPicture style={{ height: 60, width: 60, borderRadius: 30, backgroundColor: '#000' }} resizeMode='cover' source={{ uri: item.image }} />
144
+ </TouchableOpacity>
136
145
  </View>
137
146
  )
138
147
  }
@@ -143,7 +152,10 @@ export default function m(props: EventOrder_lotteryProps): any {
143
152
 
144
153
  return (
145
154
  <View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey /* "#FFC523" */ }}>
146
- <EventHeader title={esp.lang("event/order_lottery", "follow_lucky_draw")} />
155
+ <EventHeader
156
+ title={result?.config != null ? result?.config?.title : esp.lang("event/order_lottery", "follow_lucky_draw")}
157
+ // subtitle={result?.config != null ? result?.config?.subtitle : ""}
158
+ />
147
159
 
148
160
  <ScrollView>
149
161
  {
@@ -152,7 +164,7 @@ export default function m(props: EventOrder_lotteryProps): any {
152
164
 
153
165
  </ScrollView>
154
166
  <View style={{ backgroundColor: '#fff' }}>
155
- <Text style={{ margin: 10, marginBottom: 0 }} >{esp.lang("event/order_lottery", "u_have") + result?.coupon + esp.lang("event/order_lottery", "token_for_luckydraw")}</Text>
167
+ <Text style={{ margin: 10, marginBottom: 0 }} >{esp.lang("event/order_lottery", "you_have") + result?.coupon + esp.lang("event/order_lottery", "chance_for_exchange")}</Text>
156
168
 
157
169
  <EventButton
158
170
  label={esp.lang("event/order_lottery", "submit")}
@@ -3,7 +3,7 @@ import { applyStyle } from 'esoftplay';
3
3
  import { EventButton } from 'esoftplay/cache/event/button/import';
4
4
  import { EventHeader } from 'esoftplay/cache/event/header/import';
5
5
  import { EventMessage } from 'esoftplay/cache/event/message/import';
6
- import { LibCarrousel } from 'esoftplay/cache/lib/carrousel/import';
6
+ import { EventOrder_detailProperty } from 'esoftplay/cache/event/order_detail/import';
7
7
  import { LibCurl } from 'esoftplay/cache/lib/curl/import';
8
8
  import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
9
9
  import { LibIcon } from 'esoftplay/cache/lib/icon/import';
@@ -16,13 +16,13 @@ import { LibStyle } from 'esoftplay/cache/lib/style/import';
16
16
  import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
17
17
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
18
18
  import { LibUtils } from 'esoftplay/cache/lib/utils/import';
19
- import { EventOrder_detailProperty } from 'esoftplay/cache/event/order_detail/import';
20
19
  import esp from 'esoftplay/esp';
20
+ import useLazyState from 'esoftplay/lazy';
21
21
  import moment from 'esoftplay/moment';
22
22
  import useSafeState from 'esoftplay/state';
23
23
 
24
24
  import React, { useEffect } from 'react';
25
- import { Pressable, ScrollView, Text, TouchableOpacity, View } from 'react-native';
25
+ import { Pressable, RefreshControl, ScrollView, Text, TouchableOpacity, View } from 'react-native';
26
26
 
27
27
 
28
28
  export interface EventOrder_rescheduleArgs {
@@ -31,12 +31,14 @@ export interface EventOrder_rescheduleArgs {
31
31
  export interface EventOrder_rescheduleProps {
32
32
 
33
33
  }
34
+
34
35
  export default function m(props: EventOrder_rescheduleProps): any {
35
36
  let { url } = LibNavigation.getArgsAll(props)
36
- const [result, setResult] = useSafeState<any>()
37
37
 
38
+ const [result, setResult, getResult] = useLazyState<any>()
38
39
  const imgWidth = LibStyle.width - 30
39
40
  const imgHeight = imgWidth / 1080 * 647
41
+ const [refreshing, setRefreshing] = useSafeState<boolean>(false);
40
42
 
41
43
  let defaultTabs = [
42
44
  {
@@ -48,7 +50,7 @@ export default function m(props: EventOrder_rescheduleProps): any {
48
50
  title: /*refund*/esp.lang("event/order_reschedule", "refund")
49
51
  },
50
52
  ]
51
- const [activeTab, setActiveTab] = useSafeState<any>(1)
53
+ const [activeTab, setActiveTab] = useLazyState<any>(1)
52
54
 
53
55
 
54
56
  useEffect(() => {
@@ -57,15 +59,22 @@ export default function m(props: EventOrder_rescheduleProps): any {
57
59
 
58
60
  function loadData() {
59
61
  new LibCurl(url, null, (res, msg) => {
60
- setResult(res)
62
+ setResult(res)()
63
+ setRefreshing(false)
61
64
  }, (error) => {
65
+ setRefreshing(false)
62
66
  LibDialog.warning(esp.lang("event/order_reschedule", "load_err"), error?.message)
63
67
  }, 1)
64
68
  }
65
69
 
70
+ function onRefresh() {
71
+ setRefreshing(true)
72
+ loadData()
73
+ }
74
+
66
75
  function rescheduleTicket() {
67
- let a = result.booking_list?.map?.((item: any) => item.price_type?.filter?.((item1: any) => item1.check == 1))
68
- let _booking_ids = result.booking_list?.map?.((item: any) => {
76
+ let a = getResult().booking_list?.map?.((item: any) => item.price_type?.filter?.((item1: any) => item1.check == 1))
77
+ let _booking_ids = getResult().booking_list?.map?.((item: any) => {
69
78
  if (item.price_type?.some((x: any) => x.check == 1)) {
70
79
  return item.id
71
80
  }
@@ -131,7 +140,7 @@ export default function m(props: EventOrder_rescheduleProps): any {
131
140
  }
132
141
 
133
142
  function refundTicket() {
134
- let a = result.booking_list?.filter?.((item: any) => item.check == 1)
143
+ let a = getResult().booking_list?.filter?.((item: any) => item.check == 1)
135
144
  let _booking_ids: any[] = []
136
145
 
137
146
  for (let i = 0; i < a.length; i++) {
@@ -179,19 +188,19 @@ export default function m(props: EventOrder_rescheduleProps): any {
179
188
  }
180
189
 
181
190
  function updateResult(item: any, i: number, item1: any, i1: number) {
182
- setResult(
183
- LibObject.update(result, (data) => {
184
- for (let j = 0; j < data.price_type.length; j++) {
185
- data.price_type[j].check = i1 == j ? data.price_type[j].hasOwnProperty("check") && data.price_type[j].check == 1 ? 0 : 1 : 0
186
- }
187
- return { ...data }
188
- })('booking_list', i)
189
- )
191
+ let a = LibObject.update(getResult(), (data) => {
192
+ for (let j = 0; j < data.price_type.length; j++) {
193
+ data.price_type[j].check = i1 == j ? data.price_type[j].hasOwnProperty("check") && data.price_type[j].check == 1 ? 0 : 1 : 0
194
+ }
195
+ return { ...data }
196
+ })('booking_list', i)
197
+
198
+ setResult(a)()
190
199
 
191
200
 
192
201
  if (item.reseat == 1) {
193
202
  let data = {
194
- event_id: result.id,
203
+ event_id: getResult().id,
195
204
  qty: item.qty,
196
205
  // kenapa seperti ini, biar objeknya sama dengan di event/ticket_list
197
206
  selected_ticket: {
@@ -214,11 +223,15 @@ export default function m(props: EventOrder_rescheduleProps): any {
214
223
  function renderRescheduleList(item: any, i: number) {
215
224
  return (
216
225
  <View key={i}>
217
- <View style={applyStyle({ backgroundColor: '#f1f2f3', padding: 14, borderTopWidth: 3, borderTopColor: '#999', marginTop: 20 })}>
226
+ <View style={applyStyle({ backgroundColor: '#f1f2f3', padding: 14, borderTopWidth: 3, borderTopColor: '#999', marginTop: 10 })}>
218
227
  <View style={{ flexDirection: 'row', justifyContent: 'space-between' }} >
219
- <Text style={applyStyle({ fontFamily: "Arial", fontSize: 12, lineHeight: 20, fontStyle: "normal", letterSpacing: 0 })} >{(item.price_name) + " (" + item.qty + " " + esp.lang("event/order_reschedule", "ticket_text")}<Text style={{ color: "orange" }} >{item.qty_shared > 0 ? esp.lang("event/order_reschedule", "shared", item?.qty_shared) : ""}</Text>{")"}</Text>
228
+ <View style={{ flex: 2 }}>
229
+ <Text style={applyStyle({ fontFamily: "Arial", fontSize: 12, lineHeight: 20, fontStyle: "normal", letterSpacing: 0 })} >{(item.price_name) + " (" + item.qty + " " + esp.lang("event/order_reschedule", "ticket_text")}<Text style={{ color: "orange" }} >{item.qty_shared > 0 ? esp.lang("event/order_reschedule", "shared", item?.qty_shared) : ""}</Text>{")"}</Text>
230
+ </View>
220
231
 
221
- <Text style={applyStyle({ fontFamily: "Arial", fontSize: 12, lineHeight: 20, fontStyle: "normal", fontWeight: 'bold', letterSpacing: 0 })} >{LibUtils.money(item.price)}</Text>
232
+ <View style={{ flex: 1, alignContent: 'flex-end', alignItems: 'flex-end' }}>
233
+ <Text style={applyStyle({ fontFamily: "Arial", fontSize: 12, lineHeight: 20, fontStyle: "normal", fontWeight: 'bold', letterSpacing: 0 })} >{LibUtils.money(item.price)}</Text>
234
+ </View>
222
235
  </View>
223
236
  {
224
237
  item.ondate != "0000-00-00" &&
@@ -278,7 +291,7 @@ export default function m(props: EventOrder_rescheduleProps): any {
278
291
  </View>
279
292
  </View>
280
293
  <View style={applyStyle({ marginLeft: 10, flexDirection: 'column', marginRight: 6 })} >
281
- <Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "right", color: _selectTicket ? "#3ea4dc" : '#999', opacity: opacityPassed })} >{LibUtils.money(item1.price)}</Text>
294
+ <Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "right", color: _selectTicket ? "#3ea4dc" : '#999', opacity: opacityPassed })} >{LibUtils.money(item1.price, item1.currency)}</Text>
282
295
  </View>
283
296
 
284
297
  <TouchableOpacity onPress={() => {
@@ -300,6 +313,7 @@ export default function m(props: EventOrder_rescheduleProps): any {
300
313
  )
301
314
  }
302
315
 
316
+ esp.log(result);
303
317
  function renderRefundList(item: any, i: number) {
304
318
  let _selectTicket = item.hasOwnProperty('check') && item.check == 1
305
319
  const styleID_12nkjf: any = { marginLeft: 10, textDecorationLine: 'line-through', textDecorationStyle: 'solid', opacity: item.is_refundable == 1 ? 1 : 0.5, marginTop: 4, fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : '#999' }
@@ -307,20 +321,21 @@ export default function m(props: EventOrder_rescheduleProps): any {
307
321
  <View key={i}>
308
322
  <TouchableOpacity onPress={() => {
309
323
  if (item.is_refundable == 1) {
310
- setResult(
311
- LibObject.set(result, item.hasOwnProperty('check') && item.check == 1 ? 0 : 1)('booking_list', i, "check")
312
- )
324
+ setResult(() => LibObject.set(getResult(), item.hasOwnProperty('check') && item.check == 1 ? 0 : 1)('booking_list', i, "check"))()
313
325
  }
314
326
  }} style={{ flex: 1, backgroundColor: item.is_refundable == 1 ? '#fff' : LibStyle.colorLightGrey, flexDirection: 'row', justifyContent: 'space-between', padding: 10 }}>
315
327
  <View style={applyStyle({ flex: 1 })}>
316
- <Text style={applyStyle({ fontFamily: "Arial", fontSize: 12, lineHeight: 20, fontStyle: "normal", fontWeight: 'bold', letterSpacing: 0 })} >{esp.lang("event/order_reschedule", "ticket_date", moment(item.ondate).format("DD MMMM YYYY"))}</Text>
328
+ {
329
+ item.ondate != "0000-00-00" &&
330
+ <Text style={applyStyle({ fontFamily: "Arial", fontSize: 12, lineHeight: 20, fontStyle: "normal", fontWeight: 'bold', letterSpacing: 0 })} >{esp.lang("event/order_reschedule", "ticket_date", moment(item.ondate).format("DD MMMM YYYY"))}</Text>
331
+ }
317
332
  {item.qty_shared > 0 &&
318
333
  <LibTextstyle textStyle='caption1' text={esp.lang("event/order_reschedule", "chared", item.qty_shared)} style={{ color: 'orange' }} />
319
334
  }
320
335
  <Text allowFontScaling={false} style={{ opacity: item.is_refundable == 1 ? 1 : 0.5, fontFamily: "Arial", fontSize: 10, marginBottom: 4, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0.23, color: LibStyle.colorRed }}>{item.refund == "0.00" ? esp.lang("event/order_reschedule", "cant_refund") : esp.lang("event/order_reschedule", "refundable", LibUtils.numberAbsolute(item.refund).toString())}</Text>
321
336
  <Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : '#999' })}>{esp.lang("ticket/refund", "ticket")} {item.price_name + " (" + item.qty + " " + esp.lang("ticket/refund", "ticket") + ") "}</Text>
322
337
  <View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
323
- <Text allowFontScaling={false} style={applyStyle({ marginTop: 4, fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : '#999' })}>{LibUtils.money(item.refund == "0.00" ? item.price : item.price_cancellable)}</Text>
338
+ <Text allowFontScaling={false} style={applyStyle({ marginTop: 4, fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : '#999' })}>{LibUtils.money(item.price_cancellable, item.currency)}</Text>
324
339
  {
325
340
  item.refund != "0.00" && item.refund != "100.00" &&
326
341
  <Text allowFontScaling={false} style={styleID_12nkjf}>{LibUtils.money(item.price)}</Text>
@@ -329,9 +344,7 @@ export default function m(props: EventOrder_rescheduleProps): any {
329
344
  </View>
330
345
  <TouchableOpacity onPress={() => {
331
346
  if (item.is_refundable == 1) {
332
- setResult(
333
- LibObject.set(result, item.hasOwnProperty('check') && item.check == 1 ? 0 : 1)('booking_list', i, "check")
334
- )
347
+ setResult(() => LibObject.set(getResult(), item.hasOwnProperty('check') && item.check == 1 ? 0 : 1)('booking_list', i, "check"))()
335
348
  }
336
349
  }} style={applyStyle({ padding: 8, opacity: 1 })} >
337
350
  <LibIcon name={_selectTicket ? "checkbox-marked-circle" : "radiobox-blank"} size={22} style={{ opacity: item.is_refundable == 1 ? 1 : 0.5 }} color={_selectTicket ? "#3ea4dc" : "#434343"} />
@@ -341,12 +354,6 @@ export default function m(props: EventOrder_rescheduleProps): any {
341
354
  )
342
355
  }
343
356
 
344
- function renderImageCarousel(item1: any, i: number) {
345
- return (
346
- <LibPicture key={i} source={{ uri: item1.image }} style={applyStyle({ borderTopLeftRadius: 0, borderTopRightRadius: 0, height: imgHeight, width: imgWidth, resizeMode: 'cover' })} />
347
- )
348
- }
349
-
350
357
 
351
358
  const dateRange = LibUtils.getDateRange(result?.start_date, result?.end_date, " - ")
352
359
 
@@ -360,7 +367,8 @@ export default function m(props: EventOrder_rescheduleProps): any {
360
367
  defaultTabs.map((item: any, i: number) => {
361
368
  return (
362
369
  <Pressable onPress={() => {
363
- setActiveTab(item.id)
370
+ loadData()
371
+ setActiveTab(item.id)()
364
372
  }} key={i} style={{ flex: 1, padding: 10, borderTopLeftRadius: 10, borderTopRightRadius: 10, backgroundColor: item.id == activeTab ? "#fff" : LibStyle.colorBgGrey }}>
365
373
  <Text allowFontScaling={false} style={{ opacity: item.id == activeTab ? 1 : 0.7, alignSelf: 'center', textAlign: 'center', fontFamily: "Arial", fontWeight: item.id == activeTab ? "bold" : "normal", fontStyle: "normal", letterSpacing: 0, color: item.id == activeTab ? "#000" : "#aab0b7" }} >{item.title}</Text>
366
374
  </Pressable>
@@ -370,20 +378,12 @@ export default function m(props: EventOrder_rescheduleProps): any {
370
378
  </View>
371
379
  }
372
380
 
373
- <ScrollView>
381
+ <ScrollView refreshControl={
382
+ <RefreshControl refreshing={refreshing} onRefresh={onRefresh} />
383
+ }>
374
384
  <View style={{ marginTop: result?.global_refundable == 1 ? 0 : 10, margin: 15, borderTopLeftRadius: 0, borderTopRightRadius: 0, borderRadius: 10, backgroundColor: '#fff', paddingBottom: activeTab == 2 ? 10 : 0 }}>
375
- <LibCarrousel
376
- delay={4000}
377
- style={{ borderTopLeftRadius: 0, borderTopRightRadius: 0, height: imgHeight, width: imgWidth }}
378
- autoplay
379
- bullets
380
- bulletStyle={{ width: 7, height: 7, backgroundColor: "#7e7e7e", borderRadius: 3.5, borderWidth: 0, marginHorizontal: 2 }}
381
- chosenBulletStyle={{ width: 7, height: 7, backgroundColor: "white", borderRadius: 3.5, borderWidth: 0, marginHorizontal: 2 }}
382
- bulletsContainerStyle={{ marginBottom: -15 }} >
383
- {
384
- result?.images.map(renderImageCarousel)
385
- }
386
- </LibCarrousel>
385
+ <LibPicture source={{ uri: result?.image }} style={applyStyle({ borderTopLeftRadius: 0, borderTopRightRadius: 0, height: imgHeight, width: imgWidth, resizeMode: 'cover' })} />
386
+
387
387
  <View style={{ flexDirection: 'row', margin: 14, marginTop: 4, justifyContent: 'space-between' }}>
388
388
  <Text allowFontScaling={false} style={{ marginTop: 14, fontFamily: "Arial", fontSize: 20, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{result?.title}</Text>
389
389
  </View>
@@ -399,8 +399,6 @@ export default function m(props: EventOrder_rescheduleProps): any {
399
399
  <View style={{ width: 19, height: 19, borderRadius: 9.5, backgroundColor: LibStyle.colorBgGrey, marginRight: -9.5 }} />
400
400
  </View>
401
401
 
402
- {/* <Text style={{ margin: 14, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0 }} >{esp.lang("event/order_reschedule", "schedule_ticket_new")}</Text> */}
403
-
404
402
  {
405
403
  activeTab == 2 &&
406
404
  <View style={{ padding: 14, backgroundColor: '#f1f2f3' }}>
@@ -64,13 +64,14 @@ export default function m(props: EventOrder_share_toProps): any {
64
64
  setQty(qty == 1 ? 1 : qty - 1)
65
65
  }
66
66
 
67
- function shareTicket() {
67
+ function shareTicket(p: any) {
68
68
  LibDialog.warningConfirm(esp.lang("event/order_share_to", "title_alert_share_ticket"), esp.lang("event/order_share_to", "msg_alert_share_ticket"), esp.lang("event/order_share_to", "btn_yes_alert_share_ticket"), () => {
69
69
  let post = {
70
70
  receiver_email: email,
71
71
  booking_id: result?.booking_id,
72
72
  qty_shared: qty,
73
- trx_id: trxId
73
+ trx_id: trxId,
74
+ pin: p
74
75
  }
75
76
  LibProgress.show(esp.lang("event/order_share_to", "msg_wait"))
76
77
  new LibCurl('event_booking_shared?id=' + result?.event_id, post, (res, msg) => {
@@ -98,7 +99,7 @@ export default function m(props: EventOrder_share_toProps): any {
98
99
 
99
100
  return (
100
101
  <LibKeyboard_avoid style={{ flex: 1, backgroundColor: '#fff' }}>
101
- <EventHeader title={esp.lang("event/order_share_to", "title_share_ticket_to")} />
102
+ <EventHeader title={esp.lang("event/order_share_to", "title_share_ticket_to", esp.appjson().expo.name)} />
102
103
  <ScrollView showsVerticalScrollIndicator={false} >
103
104
  <TouchableOpacity onPress={() => {
104
105
  LibNavigation.navigate('component/scanner', {
@@ -112,7 +113,7 @@ export default function m(props: EventOrder_share_toProps): any {
112
113
  <LibPicture source={esp.assets('icons/ic_barcode_white.png')} style={{ height: 250, width: 250 }} />
113
114
  <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "center", marginTop: 10, color: '#fff' }}>{esp.lang("event/order_share_to", "click_here")}</Text>
114
115
  <Text allowFontScaling={false} style={{ color: '#fff', fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "center", marginTop: 6 }}>{esp.lang("event/order_share_to", "scan_qrcode")}</Text>
115
- <Text allowFontScaling={false} style={{ color: '#fff', fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, textAlign: "center", marginTop: 5 }}>{esp.lang("event/order_share_to", "in_member_bbo_page")}</Text>
116
+ <Text allowFontScaling={false} style={{ color: '#fff', fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, textAlign: "center", marginTop: 5 }}>{esp.lang("event/order_share_to", "in_member_bbo_page", esp.appjson().expo.name)}</Text>
116
117
  </View>
117
118
  </TouchableOpacity>
118
119
  <Text allowFontScaling={false} style={{ opacity: 0.6, fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, textAlign: "center", marginTop: 17 }}>{esp.lang("event/order_share_to", "or")}</Text>
@@ -124,24 +125,6 @@ export default function m(props: EventOrder_share_toProps): any {
124
125
  onChangeText={(t) => {
125
126
  setEmail(t)
126
127
  }}
127
- onSubmitEditing={() => {
128
- if (inputEmail.current?.getText() == '') {
129
- LibToastProperty.show(esp.lang("event/order_share_to", "msg_error_input_email"))
130
- inputEmail.current?.blur()
131
- return
132
- } else if (email === user.email) {
133
- LibDialog.warningConfirm(esp.lang("event/order_share_to", "title_alert_fault"), esp.lang("event/order_share_to", "msg_alert_cant_share_ticket_to_myself"), esp.lang("event/order_share_to", "btn_yes_alert_cant_share_ticket_to_myself"), () => {
134
- setEmail("")
135
- inputEmail.current?.setText("")
136
- inputEmail.current?.focus()
137
- }, "", () => {
138
-
139
- })
140
- return
141
- } else {
142
- dialogUser.current?.show()
143
- }
144
- }}
145
128
  style={{ marginLeft: 25, marginRight: 25, marginTop: 18, borderRadius: 5 }} />
146
129
  <TouchableOpacity onPress={() => {
147
130
  if (inputEmail.current?.getText() == '') {
@@ -178,7 +161,7 @@ export default function m(props: EventOrder_share_toProps): any {
178
161
  selected_ticket: {
179
162
  list: {
180
163
  price_id: result?.price_id,
181
- on_date: result?.ondate,
164
+ ondate: result?.ondate,
182
165
  }
183
166
  }
184
167
  }
@@ -190,7 +173,11 @@ export default function m(props: EventOrder_share_toProps): any {
190
173
  receiver_email: email,
191
174
  })
192
175
  } else {
193
- shareTicket()
176
+ LibNavigation.navigateForResult("bigbang/payment_pin", undefined, 1132).then((p) => {
177
+ if (p) {
178
+ shareTicket(p)
179
+ }
180
+ })
194
181
  }
195
182
  dialogUser.current?.hide()
196
183
  }} cancel={() => {