esoftplay-event 0.0.1 → 0.0.2-a

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 (86) hide show
  1. package/config.json +1 -1
  2. package/event/artist.tsx +11 -7
  3. package/event/artist_detail.tsx +3 -5
  4. package/event/artist_detailv2.tsx +386 -0
  5. package/event/artistv2.tsx +162 -0
  6. package/event/button_order_detail.tsx +43 -0
  7. package/event/countdown_base.tsx +16 -3
  8. package/event/countdown_event.tsx +48 -0
  9. package/event/detail.tsx +30 -37
  10. package/event/detail2.tsx +354 -0
  11. package/event/exchange_ticket.tsx +1 -1
  12. package/event/exchange_ticket_list.tsx +2 -3
  13. package/event/exchange_ticket_result.tsx +1 -1
  14. package/event/firebase_socket.ts +8 -0
  15. package/event/loading_page.tsx +4 -2
  16. package/event/order.tsx +23 -36
  17. package/event/order_detail.tsx +204 -61
  18. package/event/order_detail_upgrade.tsx +8 -5
  19. package/event/order_detail_upgrade_payment.tsx +17 -11
  20. package/event/order_detail_visitor.tsx +33 -33
  21. package/event/order_detail_waiting.tsx +45 -20
  22. package/event/order_item.tsx +1 -1
  23. package/event/order_lottery.tsx +49 -37
  24. package/event/order_reschedule.tsx +50 -52
  25. package/event/order_share_to.tsx +11 -24
  26. package/event/order_share_to_detail.tsx +8 -3
  27. package/event/order_waiting.tsx +1 -1
  28. package/event/queue_pricing.tsx +16 -3
  29. package/event/refresh_button.tsx +3 -5
  30. package/event/scan_item.tsx +2 -2
  31. package/event/seat.tsx +34 -13
  32. package/event/seat_map_new.tsx +316 -0
  33. package/event/secure_page.debug.tsx +34 -0
  34. package/event/secure_page.live.tsx +35 -0
  35. package/event/secure_page.tsx +6 -5
  36. package/event/test.tsx +240 -155
  37. package/event/ticket_list.tsx +48 -20
  38. package/event/ticket_list2.tsx +112 -39
  39. package/event/tms_check_code.tsx +6 -0
  40. package/event/tms_check_ticket_result.tsx +51 -13
  41. package/event/tms_dashboard.tsx +85 -3
  42. package/event/tms_gate.tsx +6 -0
  43. package/event/tms_home.tsx +1 -4
  44. package/event/tms_in_failed.tsx +1 -1
  45. package/event/tms_in_hall.tsx +4 -1
  46. package/event/tms_in_hall_failed.tsx +8 -10
  47. package/event/tms_in_log.tsx +2 -0
  48. package/event/tms_in_success.tsx +1 -1
  49. package/event/tms_log.tsx +10 -25
  50. package/event/tms_out.tsx +1 -1
  51. package/event/tms_out_failed.tsx +1 -1
  52. package/event/visitor_input.tsx +22 -5
  53. package/event/visitor_inputv2.tsx +453 -0
  54. package/event/voucher.tsx +2 -0
  55. package/event/voucher2.tsx +14 -6
  56. package/id.json +43 -9
  57. package/package.json +1 -1
  58. package/event/entrance.tsx +0 -215
  59. package/event/entrance_again.tsx +0 -199
  60. package/event/entrance_failed.tsx +0 -190
  61. package/event/entrance_idcard.tsx +0 -199
  62. package/event/entrance_list.tsx +0 -264
  63. package/event/entrance_list_item.tsx +0 -88
  64. package/event/entrance_log.tsx +0 -130
  65. package/event/entrance_success.tsx +0 -153
  66. package/event/entrance_warning.tsx +0 -91
  67. package/event/exit.tsx +0 -91
  68. package/event/exit_failed.tsx +0 -135
  69. package/event/exit_list.tsx +0 -118
  70. package/event/exit_log.tsx +0 -130
  71. package/event/exit_success.tsx +0 -143
  72. package/event/exit_temporary.tsx +0 -226
  73. package/event/firebase_socket.debug.ts +0 -260
  74. package/event/firebase_socket.live.ts +0 -335
  75. package/event/hall_in.tsx +0 -148
  76. package/event/hall_in_failed.tsx +0 -270
  77. package/event/hall_in_list.tsx +0 -222
  78. package/event/hall_in_log.tsx +0 -134
  79. package/event/hall_in_success.tsx +0 -132
  80. package/event/hall_out.tsx +0 -143
  81. package/event/hall_out_failed.tsx +0 -133
  82. package/event/hall_out_list.tsx +0 -215
  83. package/event/hall_out_log.tsx +0 -133
  84. package/event/hall_out_success.tsx +0 -130
  85. package/event/log.tsx +0 -433
  86. package/event/seat_map_test.tsx +0 -401
package/event/test.tsx CHANGED
@@ -1,155 +1,240 @@
1
- // // withHooks
2
- // import { Canvas, Group, RoundedRect, Text, useFont } from '@shopify/react-native-skia';
3
- // import { LibCurl } from 'esoftplay/cache/lib/curl/import';
4
- // import { LibIcon } from 'esoftplay/cache/lib/icon/import';
5
- // import useSafeState from 'esoftplay/state';
6
- // import React, { useCallback, useEffect, useState } from 'react';
7
- // import { Dimensions, Pressable, ScrollView, View } from 'react-native';
8
- // import { TapGestureHandler, TapGestureHandlerStateChangeEvent } from 'react-native-gesture-handler';
9
-
10
-
11
- // export interface EventSeat_map_matrixArgs {
12
-
13
- // }
14
- // export interface EventSeat_map_matrixProps {
15
-
16
- // }
17
- // export default function m(props: any): any {
18
- // const deviceWidth = Dimensions.get('window').width;
19
- // const [selectedIdx, setSelectedIdx] = useState<number | null>(null);
20
- // const [scale, setScale] = useState(1);
21
- // const [boundingBox, setBoundingBox] = useSafeState({ "x1": 1, "x2": 2, "y1": 1, "y2": 2 })
22
- // const [data, setData] = useSafeState<[number, number, string, number][]>([])
23
- // const initialBoxSize = 30;
24
- // const contentWidth = (boundingBox.x2 - (boundingBox.x1 - 1.1)) * initialBoxSize
25
-
26
- // // Scale boxSize so that contentWidth fits deviceWidth
27
- // const scaleToFit = deviceWidth / contentWidth;
28
- // const boxSize = initialBoxSize * scaleToFit;
29
-
30
- // // Recalculate xs, ys, width, height with scaled boxSize
31
- // const xsScaled = data.map(([x]) => isNaN(x) ? 0 : (boxSize) + (x * boxSize));
32
- // const ysScaled = data.map(([_, y]) => isNaN(y) ? 0 : (boxSize) + (y * boxSize));
33
-
34
- // const width = Math.max(deviceWidth, xsScaled.length && xsScaled.every(v => !isNaN(v)) ? Math.max(...xsScaled) + boxSize : boxSize * 2);
35
- // const height = ysScaled.length && ysScaled.every(v => !isNaN(v)) ? Math.max(...ysScaled) + boxSize : boxSize * 2;
36
-
37
- // const fontSize: any = {
38
- // 1: useFont(require('../../assets/fonts/MonoSpace.ttf'), boxSize * 0.3),
39
- // 2: useFont(require('../../assets/fonts/MonoSpace.ttf'), boxSize * 0.3),
40
- // 3: useFont(require('../../assets/fonts/MonoSpace.ttf'), boxSize * 0.25),
41
- // 4: useFont(require('../../assets/fonts/MonoSpace.ttf'), boxSize * 0.2),
42
- // 5: useFont(require('../../assets/fonts/MonoSpace.ttf'), boxSize * 0.2),
43
- // 6: useFont(require('../../assets/fonts/MonoSpace.ttf'), boxSize * 0.15),
44
- // }
45
- // const handleTap = useCallback((event: TapGestureHandlerStateChangeEvent) => {
46
- // if (event.nativeEvent.state !== 5) return;
47
- // // Adjust tap coordinates for scale
48
- // const x = event.nativeEvent.x / scale;
49
- // const y = event.nativeEvent.y / scale;
50
- // for (let i = 0; i < data.length; i++) {
51
- // const [sx, sy, seatName] = data[i];
52
- // const xSize = (boxSize / 2) + (sx * boxSize);
53
- // const ySize = (boxSize / 2) + (sy * boxSize);
54
- // if (x >= xSize && x <= xSize + boxSize && y >= ySize && y <= ySize + boxSize) {
55
- // setSelectedIdx(i);
56
- // return;
57
- // }
58
- // }
59
- // setSelectedIdx(null);
60
- // }, [data, boxSize, scale]);
61
-
62
-
63
- // useEffect(() => {
64
- // new LibCurl("v3/event_seat", {
65
- // event_id: 398,
66
- // price_id: 1922,
67
- // ondate: "0000-00-00"
68
- // }, (res, msg) => {
69
- // setBoundingBox(res.metadata.bounding_box)
70
- // console.log(JSON.stringify(res, undefined, 2))
71
- // setData(res.layout.split(';').map((item) => item.split(',')).map(([x, y, seatName, status]) => [Number(x), Number(y), seatName, Number(status)]))
72
- // })
73
- // }, [])
74
-
75
- // return (
76
- // <View key={scale} style={{ flex: 1 }} >
77
- // <ScrollView horizontal style={{ flex: 1 }}>
78
- // <ScrollView style={{ flex: 1 }}>
79
- // <TapGestureHandler onHandlerStateChange={handleTap}>
80
- // <View>
81
- // <Canvas
82
- // style={{
83
- // width: width * scale,
84
- // height: height * scale,
85
- // padding: 10,
86
- // backgroundColor: "#f1f2f3",
87
- // }}>
88
- // {
89
- // data.map(([x, y, name, status], i) => {
90
- // const color = selectedIdx == i ? "lime" : getColorByStatus(status)
91
- // const xSize = (boxSize / 2) + (x * boxSize)
92
- // const ySize = (boxSize / 2) + (y * boxSize)
93
- // return (
94
- // <Group key={i}>
95
- // <RoundedRect
96
- // x={xSize - 1}
97
- // r={(boxSize + 2) * 0.34}
98
- // y={ySize - 1}
99
- // width={boxSize + 2}
100
- // transform={[{ scale }]}
101
- // height={boxSize + 2}
102
- // color={"#999"} />
103
- // <RoundedRect
104
- // x={xSize}
105
- // r={boxSize * 0.32}
106
- // y={ySize}
107
- // width={boxSize}
108
- // transform={[{ scale }]}
109
- // height={boxSize}
110
- // color={color} />
111
- // {name && fontSize[name.length] && (
112
- // <Text
113
- // x={(xSize) + boxSize * (5 - name.length) * 0.1}
114
- // y={(ySize) + boxSize * 0.60}
115
- // color="#020202"
116
- // text={name}
117
- // transform={[{ scale }]}
118
- // font={fontSize[name.length]} />
119
- // )}
120
- // </Group>
121
- // )
122
- // })
123
- // }
124
- // </Canvas>
125
- // </View>
126
- // </TapGestureHandler>
127
- // </ScrollView>
128
- // </ScrollView>
129
- // <View style={{ flexDirection: "row" }} >
130
- // <Pressable onPress={() => setScale((x) => x - 0.3)} >
131
- // <LibIcon.AntDesign name='minuscircleo' />
132
- // </Pressable>
133
- // <Pressable onPress={() => setScale((x) => x + 0.3)} >
134
- // <LibIcon.AntDesign name='pluscircleo' />
135
- // </Pressable>
136
- // </View>
137
- // </View>
138
- // )
139
- // }
140
-
141
-
142
- // function getColorByStatus(statuses: number) {
143
- // const colors: any = {
144
- // 8: 'purple',
145
- // 0: "white",
146
- // 1: "#9FA1A4",
147
- // 2: "#6B71E6",
148
- // 3: "#2EBBE8",
149
- // 4: "#FFA601",
150
- // 5: "#fff",
151
- // 6: "#FF4866",
152
- // 7: "#6C432C"
153
- // }
154
- // return colors[statuses]
155
- // }
1
+ // withHooks
2
+ import { Canvas, Group, RoundedRect, Text, useFont } from '@shopify/react-native-skia';
3
+ import { EventButton } from 'esoftplay/cache/event/button/import';
4
+ import { EventHeader } from 'esoftplay/cache/event/header/import';
5
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
6
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
7
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
8
+ import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
9
+ import { UseMap } from 'esoftplay/cache/use/map/import';
10
+ import esp from 'esoftplay/esp';
11
+ import useLazyState from 'esoftplay/lazy';
12
+ import useSafeState from 'esoftplay/state';
13
+ import React, { useCallback, useEffect, useState } from 'react';
14
+ import { Dimensions, Pressable, ScrollView, View } from 'react-native';
15
+ import { TapGestureHandler, TapGestureHandlerStateChangeEvent } from 'react-native-gesture-handler';
16
+
17
+
18
+ export interface EventSeat_map_matrixArgs {
19
+
20
+ }
21
+ export interface EventSeat_map_matrixProps {
22
+
23
+ }
24
+ export default function m(props: any): any {
25
+ const deviceWidth = Dimensions.get('window').width;
26
+ const [selectedIdx, setSelectedIdx] = useState<number | null>(null);
27
+ const [scale, setScale] = useState(1);
28
+ const [boundingBox, setBoundingBox] = useSafeState({ "x1": 1, "x2": 2, "y1": 1, "y2": 2 })
29
+ const [data, setData, getData] = useSafeState<[number, number, string, number][]>([])
30
+ const initialBoxSize = 30;
31
+ const contentWidth = (boundingBox.x2 - (boundingBox.x1 - 1.1)) * initialBoxSize
32
+ const [stage, setStage] = useLazyState('')
33
+
34
+ // Scale boxSize so that contentWidth fits deviceWidth
35
+ const scaleToFit = deviceWidth / contentWidth;
36
+ const boxSize = initialBoxSize * scaleToFit;
37
+
38
+ // Recalculate xs, ys, width, height with scaled boxSize
39
+ const xsScaled = data.map(([x]) => isNaN(x) ? 0 : (boxSize) + (x * boxSize));
40
+ const ysScaled = data.map(([_, y]) => isNaN(y) ? 0 : (boxSize) + (y * boxSize));
41
+
42
+ const width = Math.max(deviceWidth, xsScaled.length && xsScaled.every(v => !isNaN(v)) ? Math.max(...xsScaled) + boxSize : boxSize * 2);
43
+ const height = ysScaled.length && ysScaled.every(v => !isNaN(v)) ? Math.max(...ysScaled) + boxSize : boxSize * 2;
44
+
45
+ const size: any = {
46
+ 1: useFont(esp.assets('fonts/MonoSpace.ttf'), boxSize * 0.3),
47
+ 2: useFont(esp.assets('fonts/MonoSpace.ttf'), boxSize * 0.3),
48
+ 3: useFont(esp.assets('fonts/MonoSpace.ttf'), boxSize * 0.25),
49
+ 4: useFont(esp.assets('fonts/MonoSpace.ttf'), boxSize * 0.2),
50
+ 5: useFont(esp.assets('fonts/MonoSpace.ttf'), boxSize * 0.2),
51
+ 6: useFont(esp.assets('fonts/MonoSpace.ttf'), boxSize * 0.15),
52
+ }
53
+ const handleTap = useCallback((event: TapGestureHandlerStateChangeEvent) => {
54
+ if (event.nativeEvent.state !== 5) return;
55
+ // Adjust tap coordinates for scale
56
+ const x = event.nativeEvent.x / scale;
57
+ const y = event.nativeEvent.y / scale;
58
+ for (let i = 0; i < data.length; i++) {
59
+ const [sx, sy, seatName, status] = data[i];
60
+ const xSize = (boxSize / 2) + (sx * boxSize);
61
+ const ySize = (boxSize / 2) + (sy * boxSize);
62
+
63
+ if (x >= xSize && x <= xSize + boxSize && y >= ySize && y <= ySize + boxSize) {
64
+ if (status == 0) {
65
+ setSelectedIdx(i);
66
+ } /* else {
67
+ setSelectedIdx(null);
68
+ } */
69
+ return;
70
+ }
71
+
72
+ }
73
+ }, [data, boxSize, scale]);
74
+
75
+ useEffect(() => {
76
+ new LibCurl("v3/event_seat", {
77
+ event_id: 398,
78
+ price_id: 1922,
79
+ ondate: "0000-00-00"
80
+ }, (res, msg) => {
81
+ setBoundingBox(res.metadata.bounding_box)
82
+ setData(res.layout.split(';').map((item: any) => item.split(',')).map(([x, y, seatName, status]: any) => [Number(x), Number(y), seatName, Number(status)]))
83
+ })
84
+
85
+ loadDataSeatmapBooked()
86
+
87
+ }, [])
88
+
89
+ function updateIndexByRes(data: any, res: any) {
90
+ const resArr = res.split(",").map((item: any) => item.trim()); // biar aman dari spasi
91
+ return data.map((row: any) => {
92
+ if (resArr.includes(row[2])) {
93
+ return [row[0], row[1], row[2], 3];
94
+ }
95
+ return row;
96
+ });
97
+ }
98
+
99
+ function loadDataSeatmapBooked() {
100
+ new LibCurl("v3/event_seat_booked", {
101
+ event_id: 398,
102
+ price_id: 1922,
103
+ ondate: "0000-00-00"
104
+ }, (res, msg) => {
105
+ let updated = updateIndexByRes(getData(), res)
106
+ setData(updated)
107
+ // esp.log({ updated, res });
108
+ }, (err) => {
109
+ esp.log({ err });
110
+ })
111
+
112
+ }
113
+
114
+ return (
115
+ <View key={scale} style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }} >
116
+ <EventHeader title={esp.lang("event/seat_map", "header_title")} />
117
+ <View style={{ flex: 1 }}>
118
+ <View style={{ marginBottom: 5, }}>
119
+ <ScrollView style={{ padding: 10, paddingLeft: 0, }} horizontal>
120
+ <UseMap
121
+ data={getLegends()}
122
+ renderItem={(item) => (
123
+ <View style={{ flexDirection: 'row', alignItems: 'center', marginLeft: 15, marginRight: 5 }} >
124
+ <View style={{ height: 20, width: 20, borderRadius: 2, borderWidth: 0.5, backgroundColor: item[0], marginRight: 8 }} />
125
+ <LibTextstyle textStyle='caption1' text={item[1]} />
126
+ </View>
127
+ )}
128
+ />
129
+ </ScrollView>
130
+ </View>
131
+ <View style={{ height: 40, marginLeft: 20, marginRight: 20, backgroundColor: LibStyle.colorPrimary, marginBottom: 10, borderRadius: 2, justifyContent: 'center', alignItems: 'center' }} >
132
+ <LibTextstyle textStyle='body' style={{ color: 'white', fontWeight: 'bold' }} >{stage || esp.lang("event/seat_map", "front")}</LibTextstyle>
133
+ </View>
134
+
135
+ <ScrollView horizontal >
136
+ <ScrollView >
137
+ <TapGestureHandler onHandlerStateChange={handleTap}>
138
+ <View>
139
+ <Canvas
140
+ style={{
141
+ width: width * scale,
142
+ height: height * scale,
143
+ padding: 10,
144
+ backgroundColor: LibStyle.colorBgGrey,
145
+
146
+ }}>
147
+ {
148
+ data.map(([x, y, name, status], i) => {
149
+ const color = selectedIdx == i ? "#8EF67B" : getColorByStatus(status)
150
+ const xSize = (boxSize / 2) + (x * boxSize)
151
+ const ySize = (boxSize / 2) + (y * boxSize)
152
+ return (
153
+ <Group key={i}>
154
+ <RoundedRect
155
+ x={xSize - 1}
156
+ r={(boxSize + 2) * 0.1}
157
+ y={ySize - 1}
158
+ width={boxSize + 2}
159
+ transform={[{ scale }]}
160
+ height={boxSize + 2}
161
+ color={"#999"} />
162
+ <RoundedRect
163
+ x={xSize}
164
+ r={boxSize * 0.1}
165
+ y={ySize}
166
+ width={boxSize}
167
+ transform={[{ scale }]}
168
+ height={boxSize}
169
+ color={color} />
170
+ {name && size[name.length] && (
171
+ <Text
172
+ x={(xSize) + boxSize * (5 - name.length) * 0.1}
173
+ y={(ySize) + boxSize * 0.60}
174
+ color={"#020202"}
175
+ text={name}
176
+ transform={[{ scale }]}
177
+ font={size[name.length]} />
178
+ )}
179
+ </Group>
180
+ )
181
+ })
182
+ }
183
+ </Canvas>
184
+ </View>
185
+ </TapGestureHandler>
186
+ </ScrollView>
187
+ </ScrollView>
188
+ <View style={{ flexDirection: 'row', marginHorizontal: 12, height: 40, borderColor: '#060606', borderWidth: 1, borderRadius: 5, alignItems: 'center' }} >
189
+ <Pressable onPress={() => setScale((x) => x - 0.3)} style={{ height: 40, width: 40, alignItems: 'center', justifyContent: 'center' }} >
190
+ <LibIcon.SimpleLineIcons name='magnifier-remove' />
191
+ </Pressable>
192
+ <Pressable onPress={() => setScale((x) => x + 0.3)} style={{ height: 40, width: 40, alignItems: 'center', justifyContent: 'center' }} >
193
+ <LibIcon.SimpleLineIcons name='magnifier-add' />
194
+ </Pressable>
195
+ <View style={{ height: 40, width: 1, backgroundColor: '#060606', marginRight: 12 }} />
196
+ {/* <Text style={{}} >{esp.lang("event/seat_map", "selected", String(data.filter((x) => x == -1).length), qty)}</Text> */}
197
+ <LibTextstyle textStyle='callout'>{"Kursi terpilih"}</LibTextstyle>
198
+ </View>
199
+ <EventButton
200
+ backgroundColor={LibStyle.colorPrimary}
201
+ testID={"save_btn"}
202
+ style={{ margin: 7 }}
203
+ label={esp.lang("event/seat_map", "save")}
204
+ onPress={() => { }}
205
+ />
206
+ </View>
207
+ </View>
208
+ )
209
+ }
210
+
211
+ function getLegends() {
212
+ const colors: any = [
213
+ ["#fff", esp.lang("event/seat_map", "available"), 0],
214
+ ["#8EF67B", esp.lang("event/seat_map", "chosen"), "-1"],
215
+ ["#2EBBE8", esp.lang("event/seat_map", "reserved"), 3],
216
+ ["#6C432C", esp.lang("event/seat_map", "chosen_by"), 7],
217
+ ["#f1f2f3", esp.lang("event/seat_map", "way"), 5],
218
+ ["#9FA1A4", esp.lang("event/seat_map", "not_sold"), 1],
219
+ ["#6B71E6", esp.lang("event/seat_map", "seat_hold"), 2],
220
+ ["#FF4866", esp.lang("event/seat_map", "wall"), 6],
221
+ ["#FFA601", esp.lang("event/seat_map", "other_type"), 4],
222
+ ["purple", esp.lang("event/seat_map", "stage"), 8]
223
+ ]
224
+ return colors
225
+ }
226
+
227
+ function getColorByStatus(statuses: number) {
228
+ const colors: any = {
229
+ 8: 'purple',
230
+ 0: '#fff',
231
+ 1: "#9FA1A4",
232
+ 2: "#6B71E6",
233
+ 3: "#2EBBE8",
234
+ 4: "#FFA601",
235
+ 5: "#fff",
236
+ 6: "#FF4866",
237
+ 7: "#6C432C"
238
+ }
239
+ return colors[statuses]
240
+ }
@@ -20,12 +20,14 @@ import { applyStyle } from 'esoftplay';
20
20
  import { EventConfigProperty } from 'esoftplay/cache/event/config/import';
21
21
  import { EventCountdownProperty } from 'esoftplay/cache/event/countdown/import';
22
22
  import { EventCountdown_base } from 'esoftplay/cache/event/countdown_base/import';
23
+ import { EventCountdown_event } from 'esoftplay/cache/event/countdown_event/import';
23
24
  import { EventFirebase_socket, EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
24
25
  import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
25
26
  import { EventLoading_pageProperty } from 'esoftplay/cache/event/loading_page/import';
26
27
  import { LibEffect } from 'esoftplay/cache/lib/effect/import';
27
28
  import { LibProgress } from 'esoftplay/cache/lib/progress/import';
28
29
  import { UseDeeplinkProperty } from 'esoftplay/cache/use/deeplink/import';
30
+ import { UserClass } from 'esoftplay/cache/user/class/import';
29
31
  import esp from 'esoftplay/esp';
30
32
  import useLazyState from 'esoftplay/lazy';
31
33
  import useSafeState from 'esoftplay/state';
@@ -54,6 +56,7 @@ export type Result = {
54
56
  "status": string,
55
57
  "quota_checkout": string,
56
58
  "show_price": string,
59
+ "countdown_booking": string,
57
60
  "config_queue": {
58
61
  "limit": number,
59
62
  "time": number,
@@ -134,7 +137,7 @@ export default function m(props: EventTicket_listProps): any {
134
137
 
135
138
  const [pendingData] = EventLoading_pageProperty.state().useState()
136
139
 
137
- const { url, fee_platform, has_addition, has_addition_global, subscribed, show_fee_percentage }: any = useRef(LibNavigation.getArgsAll(props)).current
140
+ const { url, fee_platform, subscribed, show_fee_percentage }: any = useRef(LibNavigation.getArgsAll(props)).current
138
141
 
139
142
  const [deeplinkParams] = UseDeeplinkProperty.params.useState()
140
143
  const [timer] = EventCountdownProperty.countdownTime.useState()
@@ -180,7 +183,6 @@ export default function m(props: EventTicket_listProps): any {
180
183
 
181
184
  function loadData() {
182
185
  new LibCurl(url, null, (res, msg) => {
183
-
184
186
  const availablePriceType = LibObject.update(res, (arr: any[]) => arr.filter((x) => x.status != 0))('price_type')
185
187
  const unAvailablePriceType = LibObject.update(res, (arr: any[]) => arr.filter((x) => x.status == 0))('price_type')
186
188
 
@@ -234,6 +236,9 @@ export default function m(props: EventTicket_listProps): any {
234
236
  if (value.quota != 0 && qty > value.quota) {
235
237
  qty = value.quota
236
238
  }
239
+ if (qty < 1) {
240
+ qty = 1
241
+ }
237
242
  setQty(qty)
238
243
  }
239
244
 
@@ -258,7 +263,7 @@ export default function m(props: EventTicket_listProps): any {
258
263
  }
259
264
 
260
265
  function checkAddition(newDataPost: any) {
261
- if ((has_addition == 1 || selectedTicket?.hasOwnProperty("has_addition") && selectedTicket?.has_addition == 1)) {
266
+ if ((selectedTicket?.hasOwnProperty("has_addition") && selectedTicket?.has_addition == 1)) {
262
267
  LibNavigation.navigateForResult('event/additional', { type_ticket: selectedTicket?.type, ondate: selectedTicket?.list?.ondate, event_id: availableResult?.id, qty: getQty(), price_id: selectedTicket?.price_id }, 321).then((additions) => {
263
268
  if (additions != "") {
264
269
  newDataPost.addition = additions
@@ -303,14 +308,11 @@ export default function m(props: EventTicket_listProps): any {
303
308
  if (selectedTicket?.config && selectedTicket?.config?.seat_autopick == 1) {
304
309
  checkAddition(dataPost)
305
310
  } else {
306
- LibNavigation.navigateForResult('event/seat_map', {
311
+ LibNavigation.navigateForResult('event/seat_map_new', {
307
312
  url: 'event_seat',
308
313
  dataTicket: dataPost,
309
314
  }).then((value) => {
310
- dataPost.row_id = value.row_id
311
- dataPost.column_id = value.column_id
312
- dataPost.seat_name = value.seat_name
313
-
315
+ dataPost.seat_label = value.seat_label
314
316
  checkAddition(dataPost)
315
317
  })
316
318
  }
@@ -346,6 +348,11 @@ export default function m(props: EventTicket_listProps): any {
346
348
  let colorBackground = item.status != 1 ? LibStyle.colorLightGrey : itemT.status != 1 ? LibStyle.colorLightGrey : colorDefault
347
349
  let textOpacity = /* item.status == 1 ? 1 : */itemT?.status == 1 ? 1 : 0.3
348
350
 
351
+ let showCountDown = getAvailableResult()?.countdown_booking == "1" && itemT?.status == 1 && item?.status == 1 && item?.date_start != "0000-00-00 00:00:00" && item?.date_end != "0000-00-00 00:00:00" && moment(item?.date_end).format("YYYY-MM-DD HH:mm:ss") >= moment().format("YYYY-MM-DD HH:mm:ss")
352
+ let dateShowed = item?.price_date == 1 ?
353
+ moment(item?.date_end).format("YYYY-MM-DD HH:mm:ss") > moment(itemT?.ondate).format("YYYY-MM-DD HH:mm:ss") ? moment(itemT?.ondate).add(1, "days").format("YYYY-MM-DD HH:mm:ss") : item?.date_end
354
+ : item?.date_end
355
+
349
356
  return (
350
357
  <TouchableOpacity key={iT} onPress={() => {
351
358
  let itemTicket = {
@@ -396,11 +403,22 @@ export default function m(props: EventTicket_listProps): any {
396
403
  </View>
397
404
  </View>
398
405
  }
399
- <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('dddd')}</Text>
400
- <View style={applyStyle({ flexDirection: 'row' })}>
401
- <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('MMMM')}</Text>
402
- <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, marginLeft: 7, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('YYYY')}</Text>
403
- </View>
406
+ {
407
+ showCountDown ?
408
+ <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('dddd, MMMM YYYY')}</Text>
409
+ :
410
+ <>
411
+ <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('dddd')}</Text>
412
+ <View style={applyStyle({ flexDirection: 'row', alignItems: "center" })}>
413
+ <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('MMMM')}</Text>
414
+ <Text allowFontScaling={false} style={applyStyle({ opacity: textOpacity, marginLeft: 5, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(itemT.ondate).localeFormat('YYYY')}</Text>
415
+ </View>
416
+ </>
417
+ }
418
+ {
419
+ showCountDown &&
420
+ <EventCountdown_event date={dateShowed} containerStyle={{ marginVertical: -5 }} />
421
+ }
404
422
  </View>
405
423
  </View>
406
424
  :
@@ -419,7 +437,7 @@ export default function m(props: EventTicket_listProps): any {
419
437
  {/* <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' }}>{item.type}</Text> */}
420
438
  {
421
439
  item.info != "" &&
422
- <Text allowFontScaling={false} numberOfLines={3} style={{ flexWrap: 'wrap', fontFamily: "Arial", fontSize: 11, fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' }} >{item.info}</Text>
440
+ <EventHtmltext allowFontScaling={false} style={{ flexWrap: 'wrap', fontFamily: "Arial", fontSize: 11, fontStyle: "normal", letterSpacing: 0, color: _selectedTicket ? "#3ea4dc" : '#999' }}>{item.info}</EventHtmltext>
423
441
  }
424
442
  </View>
425
443
  </View>
@@ -578,6 +596,7 @@ export default function m(props: EventTicket_listProps): any {
578
596
  </TouchableOpacity>
579
597
  }
580
598
  <View style={{ flex: 1 }}>
599
+
581
600
  {
582
601
  availableResult?.price_type?.map?.((item: any, i: number) => {
583
602
  let textOpacity = item?.status == 1 ? 1 : 0.3
@@ -590,8 +609,17 @@ export default function m(props: EventTicket_listProps): any {
590
609
  return (
591
610
  <Pressable onPress={() => {
592
611
 
593
- }} key={i} style={{ overflow: 'hidden', margin: 15, marginBottom: 5, backgroundColor: '#fff', borderRadius: 10, ...LibStyle.elevation(2), borderWidth: 1, borderColor: selTic ? LibStyle.colorBlue : LibStyle.colorBgGrey }}>
594
- <View style={{ padding: 10, backgroundColor: '#f1f2f3', borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
612
+ }} key={i} style={{ overflow: 'hidden', margin: 15, marginBottom: 5, backgroundColor: '#fff', borderRadius: 5, borderWidth: 1.5, borderColor: selTic ? LibStyle.colorBlue : LibStyle.colorBgGrey }}>
613
+ <View style={{ padding: 10, backgroundColor: '#f1f2f3', borderTopLeftRadius: 5, borderTopRightRadius: 5 }}>
614
+ {
615
+ esp.isDebug("") && UserClass.state().get()?.email == "bagus@fisip.net" &&
616
+ <View style={applyStyle({ flexDirection: 'row' })}>
617
+ <View style={applyStyle({ alignContent: 'center', alignItems: 'center', justifyContent: 'center', borderWidth: 1, backgroundColor: LibStyle.colorGreen, borderColor: "#4cd964", borderRadius: 5, padding: 2, paddingHorizontal: 5, opacity: 1 })}>
618
+ <Text allowFontScaling={false} style={{ fontSize: 10, fontStyle: "normal", letterSpacing: 0.5, color: '#fff', fontWeight: 'bold' }}>Disini kah boy</Text>
619
+ </View>
620
+ </View>
621
+ }
622
+
595
623
  <View style={{ alignContent: 'center', alignItems: 'center', flexDirection: 'row', justifyContent: 'space-between', }}>
596
624
  <View>
597
625
  <EventHtmltext allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.type}
@@ -600,16 +628,16 @@ export default function m(props: EventTicket_listProps): any {
600
628
  <Text style={{ color: LibStyle.colorRed, fontSize: 10, fontWeight: 'normal' }}> {"(" + esp.lang("event/ticket_list", "min_order") + LibUtils.number(item.qty_min) + ")"}</Text>
601
629
  }
602
630
  </EventHtmltext>
631
+ {
632
+ availableResult?.countdown_booking == "1" && displayedData?.length == 1 && item?.status == 1 && item?.date_start != "0000-00-00 00:00:00" && item?.date_end != "0000-00-00 00:00:00" && moment(item?.date_end).format("YYYY-MM-DD HH:mm:ss") >= moment().format("YYYY-MM-DD HH:mm:ss") &&
633
+ <EventCountdown_event date={item?.date_end} containerStyle={{ marginVertical: -5 }} />
634
+ }
603
635
  {
604
636
  deeplinkParams?.type == 'event-voucher' && deeplinkParams?.price_id == item.price_id ?
605
637
  <Text allowFontScaling={false} style={{ color: "coral", fontSize: 12, fontWeight: 'bold' }}>{esp.lang("event/ticket_list", "applied_code", deeplinkParams?.code)}</Text>
606
638
  : null
607
639
  }
608
640
  </View>
609
- {/* {
610
- item.use_quota == true &&
611
- <Text allowFontScaling={false} style={{ fontWeight: 'bold', color: LibStyle.colorRed, fontSize: 12 }}>{parseInt(item.quota) == item.quota_used ? esp.lang("event/ticket_list", "empty") : (esp.lang("event/ticket_list", "qty_left",LibUtils.number(parseInt(item.quota) - item.quota_used)))}</Text>
612
- } */}
613
641
  {
614
642
  item?.status != 1 &&
615
643
  <View style={applyStyle({ flexDirection: 'row' })}>