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
@@ -73,11 +73,16 @@ export default function m(props: EventTms_add_resultProps): any {
73
73
 
74
74
  new LibCurl('event_tms_access' + LibUtils.objectToUrlParam(post), null, (res, msg) => {
75
75
  if (is_add) {
76
- const updatedPrice = res.price.map((item: any) => {
77
- return { ...item, is_selected: "1" };
78
- });
76
+ const updatedPrice = [...res.price]
77
+ .map((item: any) => {
78
+ return { ...item, is_selected: "1" }
79
+ })
80
+ .sort((a: any, b: any) =>
81
+ a.name.localeCompare(b.name, 'id', { sensitivity: 'base' })
82
+ )
83
+
84
+ const updatedData = { ...res, price: updatedPrice }
79
85
 
80
- const updatedData = { ...res, price: updatedPrice }; // Menggabungkan kembali data dengan price yang telah diperbarui
81
86
  setTicketTypes(updatedData)
82
87
 
83
88
  } else {
@@ -139,7 +144,7 @@ export default function m(props: EventTms_add_resultProps): any {
139
144
 
140
145
  {
141
146
  ticketTypes &&
142
- <View style={{ marginTop: 10 }}>
147
+ <View style={{ marginTop: 10, marginBottom: 10 }}>
143
148
  <LibTextstyle textStyle='m_overline' text={esp.lang("event/tms_add_result", "ticket_type")} style={{ fontSize: 12, marginTop: 15, marginBottom: 15 }} />
144
149
  {
145
150
  ticketTypes?.price?.map((item: any, i: number) => {
@@ -248,16 +248,25 @@ export default function m(props: EventTms_check_ticket_resultProps): any {
248
248
  <Text allowFontScaling={false} style={{ fontSize: 14 }}>{LibUtils.moment(item?.ondate).localeFormat('DD MMMM YYYY')}</Text>
249
249
  }
250
250
  </View>
251
- <View style={{ marginBottom: 10, flexDirection: 'row', flexWrap: 'wrap', marginLeft: -10 }}>
251
+ <View style={{ marginBottom: 10, flexDirection: 'row', flexWrap: 'wrap' }}>
252
252
  {
253
253
  item?.tickets?.map((x: any, i: number) => {
254
+ const [front, end] = x?.seat_label?.split("#") || ["", ""];
254
255
  if (x.seat_label != "") {
255
- return (
256
- <View key={i} style={{ marginLeft: 10, paddingVertical: 5, marginBottom: 7, paddingHorizontal: 7, borderWidth: 1, borderColor: '#000', backgroundColor: '#fff', borderRadius: 5 }}>
257
- <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 20, color: '#000' }}>{x.seat_label}</Text>
258
- </View>
259
-
260
- )
256
+ if (x?.seat_label?.includes("#")) {
257
+ return (
258
+ <View key={i} style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: 5, marginBottom: 7, paddingHorizontal: 5, backgroundColor: '#fff', borderRadius: 5, marginRight: 7, ...LibStyle.elevation(5), }}>
259
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 16, color: "#000" }}> {front} </Text>
260
+ <Text allowFontScaling={false} style={{ marginLeft: 3, fontWeight: 'bold', fontSize: 16, color: '#000', }}> {end} </Text>
261
+ </View>
262
+ )
263
+ } else {
264
+ return (
265
+ <View key={i} style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: 5, marginBottom: 7, paddingHorizontal: 5, backgroundColor: '#fff', borderRadius: 5, marginRight: 7, ...LibStyle.elevation(5), }}>
266
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 16, color: "#000" }}>{x?.seat_label}</Text>
267
+ </View>
268
+ )
269
+ }
261
270
  } else {
262
271
  return null
263
272
  }
@@ -11,6 +11,11 @@ import esp from 'esoftplay/esp';
11
11
  import useGlobalState, { useGlobalReturn } from 'esoftplay/global';
12
12
  import { useRef } from 'react';
13
13
 
14
+ import { EventTms_dashboardProperty } from 'esoftplay/cache/event/tms_dashboard/import';
15
+ import { EventTms_gateProperty } from 'esoftplay/cache/event/tms_gate/import';
16
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
17
+ import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
18
+ import { LibProgress } from 'esoftplay/cache/lib/progress/import';
14
19
  import React from 'react';
15
20
  import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
16
21
 
@@ -36,9 +41,57 @@ export function closingDataState(): useGlobalReturn<any> {
36
41
  return stateClosingData
37
42
  }
38
43
 
44
+ const stateEvent = useGlobalState({})
45
+
46
+ export function stateSelectedEvent(): useGlobalReturn<any> {
47
+ return stateEvent
48
+ }
49
+
39
50
  export default function m(props: EventTms_dashboardProps): any {
40
51
  const [user] = UserClass.state().useState()
41
52
  const dialogClosing = useRef<LibSlidingup>(null)
53
+ let dataEvent = user?.is_tms[0]
54
+
55
+
56
+ function loadGate(event_id: any, is_v2: boolean) {
57
+ let post = {
58
+ event_id: event_id
59
+ }
60
+ LibProgress?.show(esp.lang("event/tms_dashboard", "please_wait_loading_data_gate"))
61
+ new LibCurl('event_gate', post, (res, msg) => {
62
+ LibProgress.hide()
63
+ if (res.length == 1) {
64
+ let a = LibObject.set(EventTms_dashboardProperty.closingDataState().get(), res[0].id)('gate_id')
65
+ EventTms_dashboardProperty.closingDataState().set(a)
66
+ LibNavigation.navigate(is_v2 ? 'tms/tms_home' : 'event/tms_home', { selectedGate: res[0], typeScanner: "tms" })
67
+ EventTms_gateProperty?.stateSelectedGate()?.set(res?.[0])
68
+ } else {
69
+ LibNavigation.navigate('event/tms_gate', { typeScanner: 'tms', is_v2: is_v2 })
70
+ }
71
+ }, (error) => {
72
+ LibProgress.hide()
73
+ LibDialog.warning(esp.lang("event/tms_gate", "warning_load"), error?.message)
74
+ }, 1)
75
+ }
76
+
77
+ function loadHall(event_id: any, is_v2: boolean) {
78
+ let post = {
79
+ event_id: event_id
80
+ }
81
+ LibProgress?.show(esp.lang("event/tms_dashboard", "please_wait_loading_data_hall"))
82
+ new LibCurl('event_hall', post, (res, msg) => {
83
+ LibProgress.hide()
84
+ if (res.length == 1) {
85
+ LibNavigation.navigate(is_v2 ? 'tms/tms_home' : 'event/tms_home', { selectedGate: res[0], typeScanner: "hall" })
86
+ EventTms_gateProperty.stateSelectedHall().set(res?.[0])
87
+ } else {
88
+ LibNavigation.navigate('event/tms_gate', { typeScanner: 'hall', is_v2: is_v2 })
89
+ }
90
+ }, (error) => {
91
+ LibProgress.hide()
92
+ LibDialog.warning(esp.lang("event/tms_gate", "warning_loadhall"), error?.message)
93
+ }, 1)
94
+ }
42
95
 
43
96
  let menus = [
44
97
  {
@@ -48,12 +101,11 @@ export default function m(props: EventTms_dashboardProps): any {
48
101
  active: 1,
49
102
  color_accent: '#FFC523',
50
103
  onPress: () => {
51
- LibNavigation.navigateForResult('event/tms_event_list', { data: user?.is_tms }).then((value) => {
52
- let a = LibObject.set(stateClosingData?.get(), value?.id)('event_id')
53
- let b = LibObject.set(a, value?.name)('event_name')
54
- stateClosingData?.set(b)
55
- LibNavigation.navigate('event/tms_gate', { is_scanner: value, typeScanner: 'tms' })
56
- })
104
+ let a = LibObject.set(stateClosingData?.get(), dataEvent?.id)('event_id')
105
+ let b = LibObject.set(a, dataEvent?.name)('event_name')
106
+ stateClosingData?.set(b)
107
+ stateSelectedEvent()?.set(dataEvent)
108
+ loadGate(dataEvent?.id, false)
57
109
  }
58
110
  },
59
111
  {
@@ -63,9 +115,8 @@ export default function m(props: EventTms_dashboardProps): any {
63
115
  active: 1,
64
116
  color_accent: '#01D0FB',
65
117
  onPress: () => {
66
- LibNavigation.navigateForResult('event/tms_event_list', { data: user?.is_tms }).then((value) => {
67
- LibNavigation.navigate('event/tms_gate', { is_scanner: value, typeScanner: 'hall' })
68
- })
118
+ stateSelectedEvent()?.set(dataEvent)
119
+ loadHall(dataEvent?.id, false)
69
120
  }
70
121
  },
71
122
  {
@@ -75,9 +126,7 @@ export default function m(props: EventTms_dashboardProps): any {
75
126
  active: 1,
76
127
  color_accent: '#800020',
77
128
  onPress: () => {
78
- LibNavigation.navigateForResult('event/tms_event_list', { data: user?.is_tms }).then((value) => {
79
- LibNavigation.navigate('event/exchange_ticket', { dataEvent: value })
80
- })
129
+ LibNavigation.navigate('event/exchange_ticket', { dataEvent: dataEvent })
81
130
  }
82
131
  },
83
132
  {
@@ -90,6 +139,31 @@ export default function m(props: EventTms_dashboardProps): any {
90
139
  dialogClosing.current?.show()
91
140
  }
92
141
  },
142
+ {
143
+ id: 5,
144
+ title: esp.lang("user/profile", "tms_scanner") + " (Testing)",
145
+ icon: 'menu/ic_turnstile.png',
146
+ active: esp.isDebug("") ? 1 : 0,
147
+ color_accent: '#FFC523',
148
+ onPress: () => {
149
+ let a = LibObject.set(stateClosingData?.get(), dataEvent?.id)('event_id')
150
+ let b = LibObject.set(a, dataEvent?.name)('event_name')
151
+ stateClosingData?.set(b)
152
+ stateSelectedEvent()?.set(dataEvent)
153
+ loadGate(dataEvent?.id, true)
154
+ }
155
+ },
156
+ {
157
+ id: 6,
158
+ title: esp.lang("user/profile", "hall_scanner") + " (Testing)",
159
+ icon: 'menu/ic_hall.png',
160
+ active: esp.isDebug("") ? 1 : 0,
161
+ color_accent: '#01D0FB',
162
+ onPress: () => {
163
+ stateSelectedEvent()?.set(dataEvent)
164
+ loadHall(dataEvent?.id, true)
165
+ }
166
+ },
93
167
  ]
94
168
 
95
169
  const options = [
@@ -106,6 +180,7 @@ export default function m(props: EventTms_dashboardProps): any {
106
180
  title: esp.lang("event/tms_dashboard", "log_exchange"),
107
181
  onPress: () => {
108
182
  dialogClosing.current?.show()
183
+ LibNavigation.navigate('event/exchange_ticket_list')
109
184
  }
110
185
  },
111
186
  ]
@@ -11,6 +11,7 @@ import useSafeState from 'esoftplay/state';
11
11
 
12
12
  import { EventTms_dashboardProperty } from 'esoftplay/cache/event/tms_dashboard/import';
13
13
  import { LibObject } from 'esoftplay/cache/lib/object/import';
14
+ import useGlobalState, { useGlobalReturn } from 'esoftplay/global';
14
15
  import React, { useEffect } from 'react';
15
16
  import { Pressable, ScrollView, Text, View } from 'react-native';
16
17
 
@@ -21,8 +22,21 @@ export interface EventTms_gateArgs {
21
22
  export interface EventTms_gateProps {
22
23
 
23
24
  }
25
+
26
+ const stateGate = useGlobalState({})
27
+
28
+ export function stateSelectedGate(): useGlobalReturn<any> {
29
+ return stateGate
30
+ }
31
+
32
+ const stateHall = useGlobalState({})
33
+
34
+ export function stateSelectedHall(): useGlobalReturn<any> {
35
+ return stateHall
36
+ }
37
+
24
38
  export default function m(props: EventTms_gateProps): any {
25
- const { is_scanner, typeScanner } = LibNavigation.getArgsAll(props)
39
+ const { is_v2, typeScanner } = LibNavigation.getArgsAll(props)
26
40
 
27
41
  const [selectGate, setSelectGate] = useSafeState<any>()
28
42
  const [gates, setGates] = useSafeState<any>()
@@ -33,20 +47,15 @@ export default function m(props: EventTms_gateProps): any {
33
47
  } else {
34
48
  loadDataHall()
35
49
  }
50
+ return () => LibNavigation.cancelBackResult(LibNavigation.getResultKey(props))
36
51
  }, [])
37
52
 
38
53
  function loadDataGates() {
39
54
  let post = {
40
- event_id: is_scanner?.id
55
+ event_id: EventTms_dashboardProperty.stateSelectedEvent()?.get()?.id
41
56
  }
42
57
  new LibCurl('event_gate', post, (res, msg) => {
43
58
  setGates(res)
44
- if (res.length == 1) {
45
- let a = LibObject.set(EventTms_dashboardProperty.closingDataState().get(), res[0].id)('gate_id')
46
- EventTms_dashboardProperty.closingDataState().set(a)
47
- LibNavigation.back()
48
- LibNavigation.navigate('event/tms_home', { is_scanner: is_scanner, selectedGate: res[0], typeScanner: typeScanner })
49
- }
50
59
  }, (error) => {
51
60
  LibDialog.warning(esp.lang("event/tms_gate", "warning_load"), error?.message)
52
61
  LibNavigation.back()
@@ -55,14 +64,10 @@ export default function m(props: EventTms_gateProps): any {
55
64
 
56
65
  function loadDataHall() {
57
66
  let post = {
58
- event_id: is_scanner?.id
67
+ event_id: EventTms_dashboardProperty.stateSelectedEvent()?.get()?.id
59
68
  }
60
69
  new LibCurl('event_hall', post, (res, msg) => {
61
70
  setGates(res)
62
- if (res.length == 1) {
63
- LibNavigation.back()
64
- LibNavigation.navigate('event/tms_home', { is_scanner: is_scanner, selectedGate: res[0], typeScanner: typeScanner })
65
- }
66
71
  }, (error) => {
67
72
  LibDialog.warning(esp.lang("event/tms_gate", "warning_loadhall"), error?.message)
68
73
  LibNavigation.back()
@@ -73,10 +78,17 @@ export default function m(props: EventTms_gateProps): any {
73
78
  let _selectGate = item.id == selectGate?.id
74
79
  return (
75
80
  <Pressable key={i} onPress={() => {
81
+ if (typeScanner == "tms") {
82
+ stateSelectedGate().set(item)
83
+ } else {
84
+ stateSelectedHall()?.set(item)
85
+ }
86
+
76
87
  setSelectGate(item)
77
88
  let a = LibObject.set(EventTms_dashboardProperty.closingDataState().get(), item?.id)('gate_id')
78
89
  EventTms_dashboardProperty.closingDataState().set(a)
79
- LibNavigation.navigate('event/tms_home', { is_scanner: is_scanner, selectedGate: item, typeScanner: typeScanner })
90
+ LibNavigation.back()
91
+ LibNavigation.navigate(is_v2 ? 'tms/tms_home' : 'event/tms_home', { selectedGate: item, typeScanner: typeScanner })
80
92
  }} style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center', backgroundColor: _selectGate ? LibStyle.colorGrey : '#fff', ...LibStyle.elevation(2), padding: 16, marginBottom: 10, marginHorizontal: 15, borderRadius: 5, flex: 1 }}>
81
93
  <LibIcon name={_selectGate ? "radiobox-marked" : "radiobox-blank"} size={18} color={_selectGate ? "#3ea4dc" : "#434343"} />
82
94
  <Text allowFontScaling={false} style={{ marginLeft: 10, fontSize: 17, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, textAlign: "center", color: '#9e9e9e', paddingLeft: 3, paddingRight: 3 }}>{item.name}</Text>
@@ -85,7 +97,12 @@ export default function m(props: EventTms_gateProps): any {
85
97
  }
86
98
 
87
99
  if (!gates) {
88
- return <LibLoading />
100
+ return (
101
+ <View style={{ flex: 1 }}>
102
+ <EventHeader title={typeScanner == "tms" ? esp.lang("event/tms_gate", "header_title1") : esp.lang("event/tms_gate", "header_title2")} subtitle={esp.lang("event/tms_gate", "gate_sub")} />
103
+ <LibLoading />
104
+ </View>
105
+ )
89
106
  }
90
107
 
91
108
  return (