esoftplay-event 0.0.1-c → 0.0.1-e

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 (44) hide show
  1. package/config.json +1 -1
  2. package/event/artist.tsx +3 -6
  3. package/event/detail.tsx +0 -44
  4. package/event/order.tsx +2 -1
  5. package/event/order_detail.tsx +2 -4
  6. package/event/order_detail_upgrade_payment.tsx +13 -7
  7. package/event/order_detail_waiting.tsx +21 -9
  8. package/event/order_share_to.tsx +2 -2
  9. package/event/scan_item.tsx +2 -2
  10. package/event/seat_map_new.tsx +313 -0
  11. package/event/test.tsx +240 -155
  12. package/event/ticket_list.tsx +8 -5
  13. package/event/ticket_list2.tsx +1 -1
  14. package/event/tms_check_ticket_result.tsx +5 -5
  15. package/event/tms_in_failed.tsx +1 -1
  16. package/id.json +5 -4
  17. package/package.json +1 -1
  18. package/event/entrance.tsx +0 -215
  19. package/event/entrance_again.tsx +0 -199
  20. package/event/entrance_failed.tsx +0 -190
  21. package/event/entrance_idcard.tsx +0 -199
  22. package/event/entrance_list.tsx +0 -264
  23. package/event/entrance_list_item.tsx +0 -88
  24. package/event/entrance_log.tsx +0 -130
  25. package/event/entrance_success.tsx +0 -153
  26. package/event/entrance_warning.tsx +0 -91
  27. package/event/exit.tsx +0 -91
  28. package/event/exit_failed.tsx +0 -135
  29. package/event/exit_list.tsx +0 -118
  30. package/event/exit_log.tsx +0 -130
  31. package/event/exit_success.tsx +0 -143
  32. package/event/exit_temporary.tsx +0 -226
  33. package/event/hall_in.tsx +0 -148
  34. package/event/hall_in_failed.tsx +0 -270
  35. package/event/hall_in_list.tsx +0 -222
  36. package/event/hall_in_log.tsx +0 -134
  37. package/event/hall_in_success.tsx +0 -132
  38. package/event/hall_out.tsx +0 -143
  39. package/event/hall_out_failed.tsx +0 -133
  40. package/event/hall_out_list.tsx +0 -215
  41. package/event/hall_out_log.tsx +0 -133
  42. package/event/hall_out_success.tsx +0 -130
  43. package/event/log.tsx +0 -433
  44. package/event/seat_map_test.tsx +0 -401
@@ -1,215 +0,0 @@
1
- // withHooks
2
- import { LibLoading } from 'esoftplay/cache/lib/loading/import';
3
- import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
4
- import { LibStyle } from 'esoftplay/cache/lib/style/import';
5
-
6
- import { EventFirebase_socket } from 'esoftplay/cache/event/firebase_socket/import';
7
- import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
8
- import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
9
- import esp from 'esoftplay/esp';
10
- import React, { useEffect } from 'react';
11
- import { View } from 'react-native';
12
-
13
-
14
- export interface EventTms_inArgs {
15
-
16
- }
17
- export interface EventTms_inProps {
18
-
19
- }
20
-
21
-
22
- export default function m(props: EventTms_inProps): any {
23
-
24
- const { price_type,
25
- gate_type,
26
- qr_code,
27
- event_id,
28
- selectGate,
29
- typeScanner,
30
- event_title,
31
- url_ticket_detail,
32
- url_ticket_update,
33
- configPriority,
34
- scan_type
35
- } = LibNavigation.getArgsAll<any>(props)
36
-
37
- const { get } = EventFirebase_socket()
38
-
39
- let whatTypeGate = gate_type == "1" ? 'in' : 'out'
40
-
41
- /* price_id */
42
- /* qty */
43
- /* name */
44
- /* qty_used */
45
- /* image */
46
- // sample: [
47
- // "1121": [
48
- // 2,
49
- // "Muhammad Bagus Yulianto",
50
- // 2,
51
- // "https://api.test.bbo.co.id/images/modules/user/avatar/122674696.jpg"
52
- // ],
53
- // "staff": [
54
- // [
55
- // 1,
56
- // "Muhammad Bagus Yulianto",
57
- // 0,
58
- // "https://api.test.bbo.co.id/images/modules/bigbang/exhibitor/1/staff/1211616174.jpg",
59
- // "VIP-Expo Indonesia Jaya"
60
- // ]
61
- // ]
62
- // ]
63
-
64
-
65
- function mainPath(qr: string) {
66
- let a = ['event', event_id, whatTypeGate, qr]
67
- return a.join('/')
68
- }
69
-
70
- let args = {
71
- price_type: price_type,
72
- gate_type: gate_type,
73
- qr_code: qr_code,
74
- event_id: event_id,
75
- event_title: event_title,
76
- selectGate: selectGate,
77
- typeScanner: typeScanner,
78
- url_ticket_detail: url_ticket_detail,
79
- url_ticket_update: url_ticket_update,
80
- configPriority: configPriority,
81
- scan_type: scan_type
82
- }
83
-
84
- useEffect(() => {
85
- if (qr_code) {
86
- loadData()
87
- } else {
88
- LibDialog.warningConfirm("Oops", "QR Code tidak ditemukan", "Kembali", () => {
89
- LibNavigation.back()
90
- }, "", () => { })
91
- }
92
- }, [])
93
-
94
- function direction(tikets: any, tiket: any) {
95
- if (tiket.qty > 1) {
96
- LibNavigation.replace('event/tms_in_list', {
97
- tickets: tikets,
98
- ...args
99
- })
100
- } else {
101
- LibNavigation.replace('event/tms_in_success', {
102
- selectedTicket: tiket,
103
- ...args
104
- })
105
- }
106
- }
107
-
108
- function loadData() {
109
- let tikets: any[] = []
110
- EventTms_homeProperty.addCounterEntranceScan(1, "0")
111
- get(mainPath(encodeURIComponent(encodeURIComponent(qr_code))), selectGate?.id, (res) => {
112
- esp.log({ res });
113
- if (!res) {
114
- LibNavigation.replace('event/tms_in_failed', {
115
- text: esp.lang("event/tms_in", "ticket_empty_today"),
116
- ...args
117
- })
118
- return
119
- } else {
120
- Object.keys(res).forEach((key) => {
121
- if (key == 'staff') {
122
- Object.values(res[key]).map((item: any) => {
123
- let x = {
124
- price_id: key,
125
- title: decodeURIComponent(item[4])?.split("+").join(' '),
126
- color: LibStyle.colorPrimary,
127
- key: item[5],
128
- user_name: item[1],
129
- user_image: item[3],
130
- exhibitor_name: decodeURIComponent(item[4])?.split("+").join(' '),
131
- qty: item[0],
132
- qty_used: item[2],
133
- qty_left: Number(item[0]) - (Number(item[2]) || 0),
134
- text: item[6] || "",
135
- }
136
- tikets.push(x)
137
- })
138
- } else {
139
- let a = {
140
- price_id: key,
141
- title: price_type?.filter?.((item: any) => item.id == key)[0]?.name,
142
- color: price_type?.filter?.((item: any) => item.id == key)[0]?.color,
143
- key: qr_code,
144
- user_name: Object.values(res[key])?.[1],
145
- user_image: Object.values(res[key])?.[3],
146
- qty: Object.values(res[key])?.[0],
147
- qty_used: Object.values(res[key])?.[2],
148
- qty_left: Number(Object.values(res[key])?.[0]) - (Number(Object.values(res[key])?.[2]) || 0),
149
- text: (Object.values(res[key])?.[4] == 'k' ? Object.values(res[key]) : Object.values(res[key])?.[4]) || ""
150
- }
151
- tikets.push(a)
152
- }
153
- })
154
-
155
- if (tikets.length > 0) {
156
- if (tikets.length == 1) {
157
- const tiket = tikets[0];
158
-
159
- if (tiket?.text == "") { // jika index ke 5 di result get nya TIDAK ADA text nya
160
- if (tiket.qty_left <= 0) { // jika qty left nya 0 maka tiketnya habis
161
- LibNavigation.replace('event/tms_in_failed', {
162
- text: esp.lang("event/tms_in", "ticket_empty"),
163
- ticketItem: tiket,
164
- ...args
165
- })
166
- } else { // jika masih punya tiket
167
- if (tiket.hasOwnProperty("exhibitor_name")) { // jika dia punya id card
168
- LibNavigation.replace('event/tms_idcard', {
169
- selectedTicket: tiket,
170
- ...args
171
- })
172
- } else { // ini data tiket user yang available
173
- if (configPriority) { // ini untuk memunculkan priority
174
- if (configPriority?.filter?.((item: any) => item.id == tiket.price_id).length > 0) {
175
- direction(tikets, tiket)
176
- } else { // ini jika di tms tidak memiliki hak scan tipe tiket tertentu
177
- LibNavigation.replace('event/tms_in_warning', {
178
- selectedTicket: tiket,
179
- ...args
180
- })
181
- }
182
- } else {
183
- direction(tikets, tiket)
184
- }
185
- }
186
- }
187
- } else {// jika index ke 5 di result get nya ADA text nya
188
- LibNavigation.replace('event/tms_in_failed', {
189
- text: tiket?.text,
190
- ticketItem: tiket,
191
- ...args
192
- })
193
- }
194
- } else { // ini jika tiketnya ada banyak
195
- LibNavigation.replace('event/tms_in_list', {
196
- tickets: tikets,
197
- ...args
198
- })
199
- }
200
- } else { // ini jika tiketnya tidak ada
201
- LibNavigation.replace('event/tms_in_failed', {
202
- text: esp.lang("event/tms_in", "ticket_not_found"),
203
- ...args
204
- })
205
- }
206
- }
207
- })
208
- }
209
-
210
- return (
211
- <View style={{ flex: 1, backgroundColor: '#fff' }}>
212
- <LibLoading />
213
- </View>
214
- )
215
- }
@@ -1,199 +0,0 @@
1
- // withHooks
2
-
3
- import { LibCurl } from 'esoftplay/cache/lib/curl/import';
4
- import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
5
- import { LibLoading } from 'esoftplay/cache/lib/loading/import';
6
- import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
7
- import { LibProgress } from 'esoftplay/cache/lib/progress/import';
8
- import { LibStyle } from 'esoftplay/cache/lib/style/import';
9
- import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
10
-
11
- import { applyStyle } from 'esoftplay';
12
- import { EventButton } from 'esoftplay/cache/event/button/import';
13
- import { EventHeader } from 'esoftplay/cache/event/header/import';
14
- import { EventScan_item } from 'esoftplay/cache/event/scan_item/import';
15
- import { LibObject } from 'esoftplay/cache/lib/object/import';
16
- import { LibPicture } from 'esoftplay/cache/lib/picture/import';
17
- import esp from 'esoftplay/esp';
18
- import moment from 'esoftplay/moment';
19
- import useSafeState from 'esoftplay/state';
20
- import React, { useEffect } from 'react';
21
- import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
22
- moment().locale('id')
23
-
24
-
25
- export interface EventTms_in_againArgs {
26
-
27
- }
28
- export interface EventTms_in_againProps {
29
-
30
- }
31
- export default function m(props: EventTms_in_againProps): any {
32
- const [result, setResult] = useSafeState<any>(undefined)
33
-
34
- const user_qr = LibNavigation.getArgs(props, 'qr_code')
35
- const { scan_type, event_id, event_title, selectGate, typeScanner }: any = LibNavigation.getArgsAll(props)
36
-
37
- useEffect(() => {
38
- loadData()
39
- }, [])
40
-
41
-
42
- function loadData(): void {
43
- var post = {
44
- // event_id: "264",
45
- // user_qr: encodeURIComponent("BBO-H6851"),
46
- // gate_id: "182"
47
- event_id: event_id,
48
- user_qr: encodeURIComponent(user_qr),
49
- gate_id: selectGate?.id
50
- }
51
-
52
- new LibCurl('event_tms_out_temporary_in', post, (res) => {
53
- let a = res?.list?.length > 0 && res.list.map((item: any, i: number) => {
54
- return ({
55
- ...item,
56
- checked: 0
57
- })
58
- })
59
- let b = res?.staff?.length > 0 && res.staff.map((item: any, i: number) => {
60
- return ({
61
- ...item,
62
- checked: 0
63
- })
64
- })
65
-
66
- let c = {
67
- ...res,
68
- list: res?.list?.length == 0 ? [] : a,
69
- staff: res?.staff?.length == 0 ? [] : b
70
- }
71
- esp.log({ res, c });
72
- setResult(c)
73
- }, (error) => {
74
- LibDialog.warningConfirm(esp.lang("event/tms_in_again", "fault"), error?.message, esp.lang("event/tms_in_again", "back"), () => LibNavigation.back(), "", () => { })
75
- }, 1)
76
- }
77
-
78
- function entrance(): void {
79
- let newData = [...result?.staff, ...result?.list]
80
- let _ids = newData?.filter((item: any) => item.checked == 1).map((it: any) => it.id)
81
- if (_ids.length == 0) {
82
- LibToastProperty.show(esp.lang("event/tms_in_again", "warning_ticket"))
83
- return
84
- }
85
-
86
- if (_ids.length == 0) {
87
- LibToastProperty.show(esp.lang("event/tms_in_again", "warning_ticket"))
88
- return
89
- }
90
- var post = {
91
- event_id: event_id,
92
- ids: JSON.stringify(_ids),
93
- gate_id: selectGate.id
94
- }
95
-
96
- LibProgress.show(esp.lang("event/tms_in_again", "wait"))
97
- new LibCurl('event_tms_out_temporary_in_confirm', post, (result, msg) => {
98
- esp.log({ result, msg, post });
99
- LibProgress.hide()
100
- LibDialog.confirm(esp.lang("event/tms_in_again", "info"), result, esp.lang("event/tms_in_again", "ok"), () => {
101
- LibNavigation.replace('component/scanner', {
102
- selectGate: selectGate,
103
- fromPage: 'event/tms_home',
104
- event_id: event_id,
105
- event_title: event_title,
106
- typeScanner: typeScanner,
107
- scan_type: scan_type
108
- })
109
- }, "", () => { })
110
- }, (error) => {
111
- esp.log({ error });
112
- LibDialog.warning(esp.lang("event/tms_in_again", "oops"), error?.message)
113
- LibProgress.hide()
114
- })
115
- }
116
-
117
- function renderTicket(item: any, i: number) {
118
- return (
119
- <EventScan_item
120
- key={i}
121
- item={item}
122
- colorFont={"#fff"}
123
- event_image={result?.event_image}
124
- style={{ backgroundColor: "#fff" }}
125
- event_name={result?.event_name}
126
- event_ondate={result?.event_ondate}
127
- label={item.status == 0 ? esp.lang("event/tms_in_again", "used") : item.checked == 0 ? esp.lang("event/tms_in_again", "use") : esp.lang("event/tms_in_again", "cancel")}
128
- onPress={() => {
129
- if (item?.status == 1) {
130
- let a = LibObject.set(result, item.checked == 1 ? 0 : 1)('list', i, 'checked')
131
- setResult(a)
132
- }
133
- }}
134
- colorBackground={item.status == 0 ? LibStyle.colorLightGrey : item.checked == 0 ? LibStyle.colorGreen : LibStyle.colorRed}
135
- />
136
-
137
- )
138
- }
139
-
140
- function renderStaff(item: any, i: number) {
141
- return (
142
- <View key={i}>
143
-
144
- <View style={{ padding: 10, overflow: 'hidden', flex: 1, flexDirection: 'row', backgroundColor: '#fff', borderBottomColor: LibStyle.colorGrey, borderBottomWidth: 1.5 }}>
145
- <LibPicture style={applyStyle({ borderRadius: 5, width: LibStyle.width / 4.5, height: LibStyle.width / 4.5, backgroundColor: LibStyle.colorBgGrey })} source={{ uri: item?.image }} />
146
- <View style={{ marginLeft: 10, flex: 1 }}>
147
- <Text allowFontScaling={false} ellipsizeMode={'tail'} numberOfLines={2} style={applyStyle({ color: "#000", marginBottom: 4, fontSize: 18, fontWeight: 'bold' })}>{item.name}</Text>
148
- <Text allowFontScaling={false} ellipsizeMode={'tail'} numberOfLines={2} style={applyStyle({ color: "#000", marginBottom: 4, fontSize: 14 })}>{item.department_name}</Text>
149
- <Text allowFontScaling={false} ellipsizeMode={'tail'} numberOfLines={2} style={applyStyle({ color: "#000", marginBottom: 4, fontSize: 16 })}>{item.exhibitor_name}</Text>
150
- {
151
- item.status == 1 &&
152
- <EventButton style={applyStyle({ marginTop: 10, alignSelf: 'flex-end', width: LibStyle.width / 3, backgroundColor: (item.status == 0 || item.is_limit == 1) ? LibStyle.colorLightGrey : (item.checked == 0) ? LibStyle.colorGreen : LibStyle.colorRed })} label={
153
- item.status == 0 ?
154
- esp.lang("event/tms_out_temporary", "used") :
155
- item.hasOwnProperty("checked") && item.checked == 0 ?
156
- esp.lang("event/tms_out_temporary", "use") :
157
- esp.lang("event/tms_out_temporary", "cancel")
158
- } fontColor={"#fff"} onPress={() => {
159
- let a = LibObject.set(result, item.checked == 1 ? 0 : 1)('staff', i, 'checked')
160
- setResult(a)
161
- }} />
162
- }
163
- </View>
164
- <View pointerEvents='none' style={{ position: 'absolute', justifyContent: 'center', transform: [{ rotate: '45deg' }], margin: 1, ...LibStyle.elevation(2), height: 20, width: 170, backgroundColor: LibStyle.colorPrimary, right: -50, top: 25 }} >
165
- <Text style={{ color: 'white', alignSelf: 'center', fontWeight: 'bold' }} >ID CARD</Text>
166
- </View>
167
- </View>
168
- </View>
169
- )
170
- }
171
-
172
- if (!result) return <LibLoading />
173
-
174
- return (
175
- <View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
176
- <EventHeader title={esp.lang("event/tms_in_again", "entrance_again")} subtitle={selectGate?.name} cart />
177
- <ScrollView>
178
- <View style={{ margin: 15, marginBottom: 0, borderRadius: 7, overflow: 'hidden' }}>
179
- {
180
- result?.staff?.length > 0 && result?.staff?.map(renderStaff)
181
- }
182
- </View>
183
- <View style={{ margin: 15, marginBottom: 0, borderRadius: 7, overflow: 'hidden' }}>
184
- {
185
- result?.list?.length > 0 && result?.list?.map(renderTicket)
186
- }
187
- </View>
188
- </ScrollView>
189
- <TouchableOpacity onPress={() => {
190
- entrance()
191
- }}>
192
- <View style={applyStyle({ margin: 10, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorGreen, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 })} >
193
- <Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 12, textAlign: "center", textAlignVertical: 'center', color: 'white', marginRight: 13, marginLeft: 10 })} >{esp.lang("event/tms_in_again", "entrance")}</Text>
194
- </View>
195
- </TouchableOpacity>
196
-
197
- </View >
198
- )
199
- }
@@ -1,190 +0,0 @@
1
- // withHooks
2
- import { applyStyle } from 'esoftplay';
3
- import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
4
- import { LibCurl } from 'esoftplay/cache/lib/curl/import';
5
- import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
6
- import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
7
- import { LibPicture } from 'esoftplay/cache/lib/picture/import';
8
- import { LibStatusbar } from 'esoftplay/cache/lib/statusbar/import';
9
- import { LibStyle } from 'esoftplay/cache/lib/style/import';
10
- import { LibUtils } from 'esoftplay/cache/lib/utils/import';
11
- import { UserClass } from 'esoftplay/cache/user/class/import';
12
- import esp from 'esoftplay/esp';
13
- import useSafeState from 'esoftplay/state';
14
-
15
- import React, { useEffect } from 'react';
16
- import { Pressable, ScrollView, Text, View } from 'react-native';
17
-
18
-
19
- export interface EventTms_in_failedArgs {
20
-
21
- }
22
- export interface EventTms_in_failedProps {
23
-
24
- }
25
- export default function m(props: EventTms_in_failedProps): any {
26
- const { scan_type, ticketItem, text, url_ticket_update, url_ticket_detail, price_type, gate_type, qr_code, event_id, selectGate, typeScanner, event_title, configPriority }: any = LibNavigation.getArgsAll(props)
27
-
28
- const [result, setResult] = useSafeState<any>()
29
- const [error, setError] = useSafeState<any>()
30
-
31
- let url = url_ticket_detail + LibUtils.objectToUrlParam({
32
- is_turnstile: 0,
33
- price_id: ticketItem?.price_id == "staff" ? 0 : ticketItem?.price_id,
34
- qr: encodeURIComponent(qr_code),
35
- t: new Date().getTime()
36
- })
37
-
38
-
39
- useEffect(() => {
40
- EventTms_homeProperty.addCounterEntranceScanFailed(1, ticketItem?.price_id)
41
- if (ticketItem && url_ticket_detail) {
42
- getDetailDataTicket()
43
- }
44
- }, [])
45
-
46
- function getDetailDataTicket() {
47
- new LibCurl(url, null, (res, msg) => {
48
- setResult(res)
49
- }, (err) => {
50
- setError(err)
51
- }, 1)
52
- }
53
-
54
- function getBack() {
55
- LibNavigation.replace('component/scanner', {
56
- selectGate: selectGate,
57
- fromPage: 'event/tms_home',
58
- event_id: event_id,
59
- event_title: event_title,
60
- typeScanner: typeScanner,
61
- gate_type: gate_type,
62
- price_type: price_type,
63
- url_ticket_detail: url_ticket_detail,
64
- url_ticket_update: url_ticket_update,
65
- configPriority: configPriority,
66
- scan_type: scan_type
67
- })
68
- }
69
-
70
- function sendTelegram() {
71
- let data = {
72
- '#bbotms': ":",
73
- reporter: {
74
- email: UserClass.state().get().email,
75
- name: UserClass.state().get().name
76
- },
77
- "event/gate/type": event_id + "/" + selectGate?.id + "/" + (gate_type == 1 ? "in" : "out"),
78
- qr: qr_code,
79
- type_ticket: ticketItem?.price_id,
80
- qty: ticketItem?.qty,
81
- qty_used: ticketItem?.qty_used,
82
- qty_left: ticketItem?.qty_left,
83
- data: {
84
- res: result,
85
- url: url
86
- },
87
- error_msg: text,
88
- }
89
-
90
- let post = {
91
- text: String(JSON.stringify(data || {}, undefined, 2)).replace(/[\[\]\{\}\"]+/g, ''),
92
- chat_id: '-1001737180019',
93
- disable_web_page_preview: true
94
- }
95
-
96
- let _url = "https://api.telegram.org/bot923808407:AAEFBlllQNKCEn8E66fwEzCj5vs9qGwVGT4/sendMessage"
97
- new LibCurl().custom(_url, post, (res, msg) => { })
98
- }
99
-
100
- return (
101
- <View style={{ flex: 1 }}>
102
- <LibStatusbar style='light' />
103
- <View style={{ flex: 1 }}>
104
- <LibPicture source={esp.assets('failed.png')} style={{ flex: 1, height: LibStyle.height, width: LibStyle.width }} /* resizeMode={"stretch"} */ />
105
- </View>
106
-
107
- <View style={{ flex: 1, position: 'absolute', top: 50, left: 0, right: 0, bottom: 0, alignItems: 'center', alignContent: 'center' }} >
108
- <ScrollView>
109
- <View style={{ marginBottom: 20, alignSelf: 'center', borderRadius: LibStyle.width / 3, padding: 10, backgroundColor: '#fff' }}>
110
- <LibPicture
111
- source={esp.assets('failed_icon.png')}
112
- style={{ width: LibStyle.width / 3, height: LibStyle.width / 3 }}
113
- />
114
- </View>
115
- <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 25, color: '#fff', marginHorizontal: 20, textAlign: 'center', letterSpacing: 1 }}>{text ? text : esp.lang("event/tms_in_failed", "ticket_out")}</Text>
116
- {
117
- result &&
118
- <View style={[applyStyle({ marginTop: 10, padding: 10 }), { width: LibStyle.width }]}>
119
- {
120
- result?.length > 0 &&
121
- <>
122
- <Text allowFontScaling={false} style={{ fontSize: 20, color: '#fff', margin: 10, textAlign: 'center', letterSpacing: 1 }}>{esp.lang("event/tms_in_failed", "history")}</Text>
123
- <Text allowFontScaling={false} style={{ marginTop: 0, fontSize: 16, color: '#fff', margin: 10, textAlign: 'center', letterSpacing: 1, fontWeight: 'bold' }}>{result?.[0].price_name}</Text>
124
- <View style={{ flexDirection: 'row', justifyContent: 'space-between', backgroundColor: '#37c2d0', borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
125
- <View style={{ flex: 1.5, justifyContent: 'center', borderRightWidth: 1, borderColor: LibStyle.colorBgGrey, paddingVertical: 5, padding: 5 }}>
126
- <Text allowFontScaling={false} style={{ fontWeight: 'bold', textAlign: 'center', fontSize: 14 }}>{esp.lang("event/tms_in_failed", "code")}</Text>
127
- </View>
128
- <View style={{ flex: 1.2, justifyContent: 'center', paddingVertical: 5 }}>
129
- <Text allowFontScaling={false} style={{ fontWeight: 'bold', textAlign: 'center', fontSize: 14 }}>{esp.lang("event/tms_in_failed", "used_time")}</Text>
130
- </View>
131
- <View style={{ flex: 2, justifyContent: 'center', borderLeftWidth: 1, borderColor: LibStyle.colorBgGrey, paddingVertical: 5 }}>
132
- <Text allowFontScaling={false} style={{ fontWeight: 'bold', textAlign: 'center', fontSize: 14 }}>{esp.lang("event/tms_in_failed", "gate")}</Text>
133
- </View>
134
- </View>
135
- </>
136
- }
137
-
138
- {
139
- result && result?.map?.((item: any, i: number) => {
140
- return (
141
- <View key={i} style={{ backgroundColor: i % 2 ? '#fff' : LibStyle.colorGrey, flexDirection: 'row', justifyContent: 'space-between', borderBottomWidth: 1, borderBottomColor: LibStyle.colorBgGrey }}>
142
- <View style={{ flex: 1.5, justifyContent: 'center', borderRightWidth: 1, borderColor: LibStyle.colorBgGrey, paddingVertical: 5, padding: 5 }}>
143
- <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode="tail" style={{ letterSpacing: 1, textAlign: 'center', fontSize: 12 }}>{item?.code}</Text>
144
- </View>
145
- <View style={{ flex: 1.2, justifyContent: 'center', paddingVertical: 5 }}>
146
- {
147
- item.scanned != "0000-00-00 00:00:00" &&
148
- <Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 12 }}>{LibUtils.moment(item.scanned).localeFormat("DD MMM H:mm:ss ")}</Text>
149
- }
150
- </View>
151
- <View style={{ flex: 2, justifyContent: 'center', borderLeftWidth: 1, borderColor: LibStyle.colorBgGrey, paddingVertical: 5 }}>
152
- {
153
- item.gate_name != null &&
154
- <Text allowFontScaling={false} style={{ letterSpacing: 1, textAlign: 'center', fontSize: 12, }}>{item.tms_email + "\n" + item.gate_name + " - " + item.turnstile_id}</Text>
155
- }
156
- </View>
157
- </View>
158
- )
159
- })
160
- }
161
- </View>
162
- }
163
- {
164
- error &&
165
- <View style={{ width: LibStyle.width - 40, justifyContent: 'center', alignItems: 'center', padding: 15, borderRadius: 10, marginTop: 100 }}>
166
- <Text allowFontScaling={false} style={{ flexWrap: 'wrap', fontSize: 14, lineHeight: 20, fontWeight: "bold", marginBottom: 5, color: "#fff", textAlign: "center" }}>{error?.message}</Text>
167
- </View>
168
- }
169
- </ScrollView>
170
- <View style={{ flexDirection: 'row', width: LibStyle.width - 40, marginVertical: 10, justifyContent: 'space-between' }}>
171
- <Pressable onPress={() => {
172
-
173
- LibDialog.warningConfirm(esp.lang("event/tms_in_failed", "warn_title"), esp.lang("event/tms_in_failed", "warn_msg"), esp.lang("event/tms_in_failed", "warn_ok"), () => {
174
- sendTelegram()
175
- }, esp.lang("event/tms_in_failed", "warn_no"), () => { })
176
-
177
- }} style={{ width: (LibStyle.width - 45) * 0.5, height: 43, borderRadius: 5, backgroundColor: LibStyle.colorRed, borderWidth: 3, borderColor: "#fff", justifyContent: 'center', alignContent: 'center', alignItems: 'center', ...LibStyle.elevation(10) }}>
178
- <Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold', color: "#fff" }}>{esp.lang("event/tms_in_failed", "report")}</Text>
179
- </Pressable>
180
- <Pressable onPress={getBack} style={{ width: (LibStyle.width - 45) * 0.5, height: 43, borderRadius: 5, backgroundColor: LibStyle.colorGreen, justifyContent: 'center', alignContent: 'center', alignItems: 'center', ...LibStyle.elevation(10) }}>
181
- <Text allowFontScaling={false} style={{ fontSize: 14, fontWeight: 'bold', color: "#fff" }}>{esp.lang("event/tms_in_failed", "back")}</Text>
182
- </Pressable>
183
-
184
- </View>
185
- </View>
186
-
187
- </View>
188
- )
189
-
190
- }