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.
- package/event/artist.tsx +11 -7
- package/event/artist_detail.tsx +3 -5
- package/event/artist_detailv2.tsx +386 -0
- package/event/artistv2.tsx +162 -0
- package/event/button_order_detail.tsx +43 -0
- package/event/countdown_base.tsx +16 -3
- package/event/countdown_event.tsx +47 -0
- package/event/detail.tsx +30 -37
- package/event/detail2.tsx +354 -0
- package/event/exchange_ticket.tsx +1 -1
- package/event/exchange_ticket_list.tsx +2 -3
- package/event/exchange_ticket_result.tsx +1 -1
- package/event/firebase_socket.ts +8 -0
- package/event/loading_page.tsx +4 -2
- package/event/order.tsx +23 -36
- package/event/order_detail.tsx +119 -41
- package/event/order_detail_upgrade.tsx +8 -5
- package/event/order_detail_upgrade_payment.tsx +17 -11
- package/event/order_detail_visitor.tsx +33 -33
- package/event/order_detail_waiting.tsx +45 -20
- package/event/order_item.tsx +1 -1
- package/event/order_lottery.tsx +48 -36
- package/event/order_reschedule.tsx +50 -52
- package/event/order_share_to.tsx +11 -24
- package/event/order_share_to_detail.tsx +8 -3
- package/event/order_waiting.tsx +1 -1
- package/event/queue_pricing.tsx +16 -3
- package/event/refresh_button.tsx +3 -5
- package/event/scan_item.tsx +2 -2
- package/event/seat.tsx +19 -11
- package/event/seat_map_new.tsx +313 -0
- package/event/secure_page.debug.tsx +34 -0
- package/event/secure_page.live.tsx +35 -0
- package/event/secure_page.tsx +6 -5
- package/event/test.tsx +240 -155
- package/event/ticket_list.tsx +49 -21
- package/event/ticket_list2.tsx +83 -34
- package/event/tms_check_code.tsx +6 -0
- package/event/tms_check_ticket_result.tsx +36 -7
- package/event/tms_dashboard.tsx +85 -3
- package/event/tms_gate.tsx +6 -0
- package/event/tms_home.tsx +1 -4
- package/event/tms_in_failed.tsx +1 -1
- package/event/tms_in_log.tsx +2 -0
- package/event/tms_in_success.tsx +1 -1
- package/event/tms_log.tsx +10 -25
- package/event/tms_out.tsx +1 -1
- package/event/tms_out_failed.tsx +1 -1
- package/event/visitor_input.tsx +23 -5
- package/event/visitor_inputv2.tsx +397 -0
- package/event/voucher.tsx +2 -0
- package/event/voucher2.tsx +14 -6
- package/id.json +25 -9
- package/package.json +1 -1
- package/event/entrance.tsx +0 -215
- package/event/entrance_again.tsx +0 -199
- package/event/entrance_failed.tsx +0 -190
- package/event/entrance_idcard.tsx +0 -199
- package/event/entrance_list.tsx +0 -264
- package/event/entrance_list_item.tsx +0 -88
- package/event/entrance_log.tsx +0 -130
- package/event/entrance_success.tsx +0 -153
- package/event/entrance_warning.tsx +0 -91
- package/event/exit.tsx +0 -91
- package/event/exit_failed.tsx +0 -135
- package/event/exit_list.tsx +0 -118
- package/event/exit_log.tsx +0 -130
- package/event/exit_success.tsx +0 -143
- package/event/exit_temporary.tsx +0 -226
- package/event/firebase_socket.debug.ts +0 -260
- package/event/firebase_socket.live.ts +0 -335
- package/event/hall_in.tsx +0 -148
- package/event/hall_in_failed.tsx +0 -270
- package/event/hall_in_list.tsx +0 -222
- package/event/hall_in_log.tsx +0 -134
- package/event/hall_in_success.tsx +0 -132
- package/event/hall_out.tsx +0 -143
- package/event/hall_out_failed.tsx +0 -133
- package/event/hall_out_list.tsx +0 -215
- package/event/hall_out_log.tsx +0 -133
- package/event/hall_out_success.tsx +0 -130
- package/event/log.tsx +0 -433
- package/event/seat_map_test.tsx +0 -401
package/event/test.tsx
CHANGED
|
@@ -1,155 +1,240 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
//
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
//
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
//
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
+
}
|
package/event/ticket_list.tsx
CHANGED
|
@@ -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,13 +137,13 @@ 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,
|
|
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()
|
|
141
144
|
|
|
142
145
|
const [unAvailableResult, setUnavailableResult] = useLazyState<any>()
|
|
143
|
-
const [availableResult, setAvailableResult
|
|
146
|
+
const [availableResult, setAvailableResult] = useSafeState<Result>()
|
|
144
147
|
const [urlPayment, setUrlPayment] = useLazyState<any>()
|
|
145
148
|
|
|
146
149
|
const [qty, setQty, getQty] = useSafeState<number>(1)
|
|
@@ -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 ((
|
|
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/
|
|
311
|
+
LibNavigation.navigateForResult('event/seat_map_new', {
|
|
307
312
|
url: 'event_seat',
|
|
308
313
|
dataTicket: dataPost,
|
|
309
314
|
}).then((value) => {
|
|
310
|
-
dataPost.
|
|
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 = esp.isDebug("show_countdown") && itemT.status != 0 && item?.date_start != "0000-00-00 00:00:00" && item?.date_end != "0000-00-00 00:00:00"
|
|
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
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
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
|
-
<
|
|
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:
|
|
594
|
-
<View style={{ padding: 10, backgroundColor: '#f1f2f3', borderTopLeftRadius:
|
|
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?.date_start != "0000-00-00 00:00:00" && item?.date_end != "0000-00-00 00:00:00" &&
|
|
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' })}>
|