esoftplay-event 0.0.0-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 (121) hide show
  1. package/config.json +11 -0
  2. package/event/additional.tsx +188 -0
  3. package/event/additional_input.tsx +316 -0
  4. package/event/block_invitation.tsx +48 -0
  5. package/event/countdown.tsx +72 -0
  6. package/event/counter_cashier.tsx +180 -0
  7. package/event/counter_cashier_report.tsx +114 -0
  8. package/event/counter_cashier_sell.tsx +135 -0
  9. package/event/counter_eo.tsx +451 -0
  10. package/event/counter_history.tsx +74 -0
  11. package/event/counter_history_item.tsx +48 -0
  12. package/event/counter_info.tsx +96 -0
  13. package/event/counter_lm.tsx +273 -0
  14. package/event/counter_menu.tsx +85 -0
  15. package/event/counter_report.tsx +105 -0
  16. package/event/counter_report_breakdown.tsx +93 -0
  17. package/event/counter_report_detail.tsx +238 -0
  18. package/event/counter_report_detail_list.tsx +56 -0
  19. package/event/counter_request.tsx +136 -0
  20. package/event/counter_request_detail.tsx +211 -0
  21. package/event/counter_section.tsx +32 -0
  22. package/event/counter_send.tsx +277 -0
  23. package/event/counter_status.tsx +32 -0
  24. package/event/counter_type.tsx +23 -0
  25. package/event/counter_user_list.tsx +197 -0
  26. package/event/counter_user_list_item.tsx +143 -0
  27. package/event/coupon.tsx +124 -0
  28. package/event/coupon_claim.tsx +198 -0
  29. package/event/coupon_claim_detail.tsx +175 -0
  30. package/event/coupon_claim_history.tsx +279 -0
  31. package/event/coupon_claim_reimburse.tsx +111 -0
  32. package/event/coupon_claim_reimburse_history.tsx +72 -0
  33. package/event/coupon_claim_reimburse_history_detail.tsx +117 -0
  34. package/event/coupon_claim_staff.tsx +256 -0
  35. package/event/coupon_detail.tsx +98 -0
  36. package/event/coupon_event_list.tsx +77 -0
  37. package/event/coupon_generate.tsx +258 -0
  38. package/event/coupon_generate_event.tsx +79 -0
  39. package/event/coupon_generate_list.tsx +56 -0
  40. package/event/date_picker.tsx +152 -0
  41. package/event/detail.tsx +352 -0
  42. package/event/entrance.tsx +215 -0
  43. package/event/entrance_again.tsx +200 -0
  44. package/event/entrance_failed.tsx +190 -0
  45. package/event/entrance_idcard.tsx +203 -0
  46. package/event/entrance_list.tsx +264 -0
  47. package/event/entrance_list_item.tsx +88 -0
  48. package/event/entrance_log.tsx +130 -0
  49. package/event/entrance_success.tsx +155 -0
  50. package/event/entrance_warning.tsx +91 -0
  51. package/event/exchange_reward.tsx +31 -0
  52. package/event/exchange_reward_result.tsx +137 -0
  53. package/event/exchange_ticket.tsx +234 -0
  54. package/event/exchange_ticket_list.tsx +191 -0
  55. package/event/exchange_ticket_result.tsx +211 -0
  56. package/event/exit.tsx +91 -0
  57. package/event/exit_failed.tsx +135 -0
  58. package/event/exit_list.tsx +118 -0
  59. package/event/exit_log.tsx +131 -0
  60. package/event/exit_success.tsx +143 -0
  61. package/event/exit_temporary.tsx +226 -0
  62. package/event/hall_in.tsx +148 -0
  63. package/event/hall_in_failed.tsx +270 -0
  64. package/event/hall_in_list.tsx +222 -0
  65. package/event/hall_in_log.tsx +134 -0
  66. package/event/hall_in_success.tsx +132 -0
  67. package/event/hall_out.tsx +143 -0
  68. package/event/hall_out_failed.tsx +133 -0
  69. package/event/hall_out_list.tsx +215 -0
  70. package/event/hall_out_log.tsx +133 -0
  71. package/event/hall_out_success.tsx +130 -0
  72. package/event/list.tsx +219 -0
  73. package/event/list_filter.tsx +124 -0
  74. package/event/log.tsx +435 -0
  75. package/event/qc_idcard.tsx +209 -0
  76. package/event/qc_idcard_failed.tsx +78 -0
  77. package/event/qc_idcard_success.tsx +68 -0
  78. package/event/queue_out.tsx +186 -0
  79. package/event/queue_pricing.tsx +152 -0
  80. package/event/randomseat.tsx +33 -0
  81. package/event/review.tsx +117 -0
  82. package/event/review_add.tsx +342 -0
  83. package/event/review_detail.tsx +67 -0
  84. package/event/review_item.tsx +76 -0
  85. package/event/scan_item.tsx +66 -0
  86. package/event/schedule.tsx +135 -0
  87. package/event/seat.tsx +628 -0
  88. package/event/seat_autopick.tsx +120 -0
  89. package/event/seat_map.tsx +408 -0
  90. package/event/seat_map_matrix.tsx +94 -0
  91. package/event/seat_map_test.tsx +401 -0
  92. package/event/ticket_list.tsx +722 -0
  93. package/event/ticket_list2.tsx +680 -0
  94. package/event/timer.tsx +58 -0
  95. package/event/tms.tsx +103 -0
  96. package/event/tms_add.tsx +94 -0
  97. package/event/tms_add_result.tsx +175 -0
  98. package/event/tms_dashboard.tsx +89 -0
  99. package/event/tms_event_list.tsx +66 -0
  100. package/event/turnstile_event_gate.tsx +74 -0
  101. package/event/turnstile_event_item.tsx +41 -0
  102. package/event/turnstile_event_list.tsx +69 -0
  103. package/event/turnstile_event_ticket.tsx +95 -0
  104. package/event/turnstile_settings.tsx +327 -0
  105. package/event/turnstile_settings_otp.tsx +58 -0
  106. package/event/turnstile_settings_status.tsx +50 -0
  107. package/event/voucher.tsx +149 -0
  108. package/event/voucher_multi.tsx +181 -0
  109. package/fonts/Arial.ttf +0 -0
  110. package/fonts/ArialBold.ttf +0 -0
  111. package/fonts/DecoNumbers.ttf +0 -0
  112. package/fonts/MonoSpace.ttf +0 -0
  113. package/fonts/SFProText.ttf +0 -0
  114. package/fonts/digital.ttf +0 -0
  115. package/fonts/mono.ttf +0 -0
  116. package/id.json +1113 -0
  117. package/index.js +2 -0
  118. package/libs.json +1 -0
  119. package/mover.js +0 -0
  120. package/package.json +16 -0
  121. package/publisher.js +84 -0
@@ -0,0 +1,191 @@
1
+ // withHooks
2
+ import { useRef } from 'react';
3
+
4
+ import { ComponentButton } from 'esoftplay/cache/component/button/import';
5
+ import { ComponentHeader } from 'esoftplay/cache/component/header/import';
6
+ import { EventExchange_ticketProperty } from 'esoftplay/cache/event/exchange_ticket/import';
7
+ import { EventExchange_ticket_resultProperty } from 'esoftplay/cache/event/exchange_ticket_result/import';
8
+ import { LibCollaps } from 'esoftplay/cache/lib/collaps/import';
9
+ import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
10
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
11
+ import { LibList } from 'esoftplay/cache/lib/list/import';
12
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
13
+ import { LibProgress } from 'esoftplay/cache/lib/progress/import';
14
+ import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
15
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
16
+ import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
17
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
18
+ import { UseCondition } from 'esoftplay/cache/use/condition/import';
19
+ import { UserClass } from 'esoftplay/cache/user/class/import';
20
+ import { sendTm } from 'esoftplay/error';
21
+ import esp from 'esoftplay/esp';
22
+ import useLazyState from 'esoftplay/lazy';
23
+ import React from 'react';
24
+ import { Pressable, ScrollView, Text, View } from 'react-native';
25
+
26
+
27
+ export interface EventExchange_ticket_listArgs {
28
+
29
+ }
30
+ export interface EventExchange_ticket_listProps {
31
+
32
+ }
33
+
34
+ export default function m(props: EventExchange_ticket_listProps): any {
35
+ const { dataEvent } = LibNavigation.getArgsAll(props)
36
+ const log = EventExchange_ticketProperty.stateExchangeLog.useSelector(s => s)
37
+ const backup = EventExchange_ticket_resultProperty.stateListConfirm().useSelector(s => s)
38
+ const selectedRef = useRef<LibSlidingup>(null)
39
+ const [, setSelectedData, getSelectedData] = useLazyState<any[]>([])
40
+ const [titleSliding, setTitleSliding] = useLazyState()
41
+
42
+ function buildTypeData(type: string) {
43
+ const dataByType = log[type]
44
+ setSelectedData(Object.entries(dataByType).map(([time, count]) => ({
45
+ time: LibUtils.moment(time + ":00:00").serverFormat('DD MMM YYYY HH:mm'),
46
+ count: count
47
+ })))()
48
+ selectedRef.current?.show()
49
+ }
50
+
51
+ function getTotalAllHour(data: any) {
52
+ if (data) {
53
+ const dd: number[] = Object.values(data)
54
+ return dd.reduce((acc: number, cur: number) => (acc + cur), 0);
55
+ }
56
+ return 0
57
+ }
58
+
59
+ esp.log({ log });
60
+
61
+ return (
62
+ <View style={{ flex: 1, }}>
63
+ <ComponentHeader title={esp.lang("event/exchange_ticket", "exchange_history")} />
64
+ <ScrollView>
65
+ <LibCollaps
66
+ header={(show) => {
67
+ return (
68
+ <View style={{ ...LibStyle.elevation(2), borderTopLeftRadius: 5, borderTopRightRadius: 5, paddingHorizontal: 10, paddingVertical: 5, margin: 15, marginBottom: 5, backgroundColor: LibStyle.colorGreen, flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'space-between', borderBottomWidth: 2, borderBottomColor: "#c9c9c9" }}>
69
+ <Text allowFontScaling={false} style={{ fontSize: 16, fontWeight: 'bold', color: '#fff' }}>{"Laporan Scan Exchange Tiket"}</Text>
70
+ <LibIcon name={show ? 'chevron-up' : 'chevron-down'} color='#fff' />
71
+ </View>
72
+ )
73
+ }}
74
+ show>
75
+ <View style={{ flex: 1, backgroundColor: '#fff', margin: 17, marginTop: 0, paddingBottom: 10, marginBottom: 0, borderBottomRightRadius: 10, borderBottomLeftRadius: 10, ...LibStyle.elevation(2) }}>
76
+ <Pressable
77
+ onPress={() => {
78
+ if (log.hasOwnProperty("scan")) {
79
+ buildTypeData("scan")
80
+ setTitleSliding("Scan Tiket")
81
+ }
82
+ }} style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center', marginHorizontal: 15, paddingVertical: 6, borderBottomWidth: 1, borderBottomColor: LibStyle.colorLightGrey }}>
83
+ <LibTextstyle text={"Scan"} textStyle="subhead" />
84
+ <LibTextstyle text={LibUtils.number(getTotalAllHour(log?.scan))} textStyle="title2" />
85
+ </Pressable>
86
+ <Pressable
87
+ onPress={() => {
88
+ if (log.hasOwnProperty("scan_failed")) {
89
+ buildTypeData("scan_failed")
90
+ setTitleSliding("Scan Gagal")
91
+ }
92
+ }} style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center', marginHorizontal: 15, paddingVertical: 6, borderBottomWidth: 1, borderBottomColor: LibStyle.colorLightGrey }}>
93
+ <LibTextstyle text={"Scan Gagal"} textStyle="subhead" />
94
+ <LibTextstyle text={LibUtils.number(getTotalAllHour(log?.scan_failed))} textStyle="title2" />
95
+ </Pressable>
96
+ <Pressable
97
+ onPress={() => {
98
+ if (log.hasOwnProperty("api_ok")) {
99
+ buildTypeData("api_ok")
100
+ setTitleSliding("Data Tiket Terkirim")
101
+ }
102
+ }} style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center', marginHorizontal: 15, paddingVertical: 6, borderBottomWidth: 1, borderBottomColor: LibStyle.colorLightGrey }}>
103
+ <LibTextstyle text={"Data terkirim"} textStyle="subhead" />
104
+ <LibTextstyle text={LibUtils.number(getTotalAllHour(log?.api_ok))} textStyle="title2" />
105
+ </Pressable>
106
+ <Pressable style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center', marginHorizontal: 15, paddingVertical: 6, borderBottomWidth: 1, borderBottomColor: LibStyle.colorLightGrey }}>
107
+ <LibTextstyle text={"Data belum terkirim"} textStyle="subhead" />
108
+ <LibTextstyle text={LibUtils.number(backup.length)} style={{ color: 'red' }} textStyle="title2" />
109
+ </Pressable>
110
+ {
111
+ Object.keys(log).filter((item,) => item.startsWith('gift_')).map((key, i) => (
112
+ <Pressable
113
+ key={i}
114
+ onPress={() => {
115
+ if (log.hasOwnProperty(key)) {
116
+ buildTypeData(key)
117
+ setTitleSliding(key.toUpperCase())
118
+ }
119
+ // props.onPress("api_ok", esp.lang("event/entrance_log", "data_send_gate_in"))
120
+ }} style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center', marginHorizontal: 15, paddingVertical: 6, borderBottomWidth: 1, borderBottomColor: LibStyle.colorLightGrey }}>
121
+ <LibTextstyle text={key.replace('gift_', '')} textStyle="subhead" />
122
+ <LibTextstyle text={LibUtils.number(getTotalAllHour(log?.[key]))} textStyle="title2" />
123
+ </Pressable>
124
+ ))
125
+ }
126
+ <View style={{ marginHorizontal: 15 }} >
127
+ <UseCondition
128
+ if={backup.length == 0}
129
+ fallback={
130
+ <Pressable onPress={() => {
131
+ // setLoading(true)
132
+ // syncData()
133
+ EventExchange_ticketProperty.subscribeSync().trigger(EventExchange_ticket_resultProperty.stateListConfirm().get())
134
+ }}>
135
+ <Text allowFontScaling={false} style={{ textAlign: 'center' }}>{esp.lang("event/entrance_log", "please_wait")}<Text style={{ color: LibStyle.colorBlue, textDecorationStyle: 'solid', textDecorationLine: 'underline' }}>{esp.lang("event/entrance_log", "press_here")}</Text> {esp.lang("event/entrance_log", "press_here2")}</Text>
136
+ </Pressable>
137
+ } >
138
+ <LibTextstyle textStyle='callout'
139
+ style={{ textAlign: 'center', marginTop: 10 }}
140
+ text={esp.lang("event/exchange_ticket_list", "all_in")} />
141
+ </UseCondition>
142
+ </View>
143
+ </View >
144
+ </LibCollaps>
145
+ </ScrollView>
146
+
147
+ <ComponentButton
148
+ style={{ margin: 10 }}
149
+ label={esp.lang("event/log", "btn_close")} onPress={() => {
150
+ LibDialog.confirm(esp.lang("event/log", "send_title"), "Kirim laporan scan exchange tiket ke admin?", esp.lang("event/log", "send_ok"), () => {
151
+ LibProgress.show("Loading..")
152
+ sendTm("#closing_exchange\n" + JSON.stringify({
153
+ domain: esp.config('domain'),
154
+ tms_name: UserClass.state().get('name'),
155
+ email: UserClass.state().get('email'),
156
+ event_name: dataEvent?.name,
157
+ data: EventExchange_ticketProperty.stateExchangeLog.get()
158
+ }, undefined, 2), '-1001737180019', undefined, () => {
159
+ EventExchange_ticketProperty.stateExchangeLog.reset()
160
+ LibProgress.hide()
161
+ })
162
+
163
+ }, esp.lang("event/log", "send_no"), () => { })
164
+
165
+ }} />
166
+
167
+ <LibSlidingup ref={selectedRef} >
168
+ <View style={{ height: 500, backgroundColor: 'white', borderTopLeftRadius: 20, borderTopRightRadius: 20 }} >
169
+ <Pressable onPress={() => selectedRef.current?.hide()} style={{ height: 4, borderRadius: 2, backgroundColor: '#aaa', width: 40, margin: 16, alignSelf: 'center', }} />
170
+ <LibList
171
+ data={getSelectedData()}
172
+ ListHeaderComponent={
173
+ <View style={{ alignContent: 'center', alignItems: 'center', marginVertical: 15 }}>
174
+ <LibTextstyle textStyle="headline" text={esp.lang("event/log", "hourly_detail")} />
175
+ <LibTextstyle textStyle="headline" text={titleSliding} />
176
+ </View>
177
+ }
178
+ renderItem={(item, index) => (
179
+ <View style={{ flexDirection: 'row', backgroundColor: index % 2 == 0 ? '#f1f2f3' : 'white', paddingVertical: 8, paddingHorizontal: 16, alignItems: 'center', justifyContent: 'space-between' }} >
180
+ <LibTextstyle textStyle="callout" text={item.time} />
181
+ <LibTextstyle textStyle="callout" text={item.count} />
182
+ </View>
183
+ )}
184
+ />
185
+ </View>
186
+ </LibSlidingup >
187
+
188
+ </View>
189
+ )
190
+
191
+ }
@@ -0,0 +1,211 @@
1
+ // withHooks
2
+ import { ComponentHeader } from 'esoftplay/cache/component/header/import';
3
+ import { ComponentTouchable } from 'esoftplay/cache/component/touchable/import';
4
+ import { EventExchange_ticketProperty } from 'esoftplay/cache/event/exchange_ticket/import';
5
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
6
+ import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
7
+ import { LibLoading } from 'esoftplay/cache/lib/loading/import';
8
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
9
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
10
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
11
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
12
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
13
+ import { TicketItemProperty } from 'esoftplay/cache/ticket/item/import';
14
+ import esp from 'esoftplay/esp';
15
+ import useGlobalState, { useGlobalReturn } from 'esoftplay/global';
16
+ import useSafeState from 'esoftplay/state';
17
+ import React, { useEffect } from 'react';
18
+ import { Pressable, ScrollView, Text, View } from 'react-native';
19
+
20
+
21
+ export interface EventExchange_ticket_resultArgs {
22
+
23
+ }
24
+ export interface EventExchange_ticket_resultProps {
25
+
26
+ }
27
+
28
+
29
+ const listConfirmExchange = useGlobalState<any[]>([])
30
+
31
+ export function stateListConfirm(): useGlobalReturn<any> {
32
+ return listConfirmExchange
33
+ }
34
+
35
+ export default function m(props: EventExchange_ticket_resultProps): any {
36
+ const { qr, event_id, event_title }: any = LibNavigation.getArgsAll(props)
37
+ const [listTicket, setListTicket, getListTicket] = useSafeState<any>()
38
+
39
+ useEffect(() => {
40
+ loadData()
41
+ }, [])
42
+
43
+ function logGift(res: any) {
44
+ res.forEach((item: any) => { EventExchange_ticketProperty.addCounterGiftBy(item.title, 1) })
45
+ }
46
+
47
+ function loadData() {
48
+ let url = "event_booking_exchange" + LibUtils.objectToUrlParam({
49
+ event_id: event_id,
50
+ code: encodeURIComponent(qr),
51
+ t: new Date().getTime()
52
+ })
53
+
54
+ new LibCurl(url, null, (res, msg) => {
55
+ EventExchange_ticketProperty.addCounterScan(1)
56
+ setListTicket(res)
57
+ }, (err) => {
58
+ EventExchange_ticketProperty.addCounterScanNo(1)
59
+ LibDialog.warningConfirm(esp.lang("event/exchange_ticket_result", "warn_title"), err?.message, esp.lang("event/exchange_ticket_result", "warn_ok"), () => { LibNavigation.back() }, "", () => { })
60
+ }, 1)
61
+ }
62
+
63
+ function filterSelectedData(data: any) {
64
+ return data.reduce((acc: any, item: any) => {
65
+ if (item.selected == 1) {
66
+ const listWithTitles = item.list.map((giftItem: any) => ({
67
+ ...giftItem,
68
+ title: item.title
69
+ }));
70
+ return acc.concat(listWithTitles);
71
+ }
72
+ return acc;
73
+ }, []);
74
+ }
75
+
76
+ function exchangeTicket() {
77
+ let url = "event_booking_exchange_confirm" + LibUtils.objectToUrlParam({ event_id: event_id, })
78
+ let post = {
79
+ ids: JSON.stringify(filterSelectedData(getListTicket()?.gifts).map((it: any) => it.id)),
80
+ }
81
+
82
+ logGift(filterSelectedData(getListTicket()?.gifts))
83
+ let a = listConfirmExchange.get()
84
+ let item = {
85
+ post: post,
86
+ url: url
87
+ }
88
+
89
+
90
+ let checkSame = a.filter((z: any) => z?.post?.ids == post?.ids)
91
+ if (checkSame?.length == 0) {
92
+ listConfirmExchange?.set(LibObject.push(a, item)())
93
+ EventExchange_ticketProperty.subscribeSync().trigger(listConfirmExchange.get())
94
+ LibDialog.confirm(esp.lang("event/exchange_ticket_result", "info_title"), esp.lang("event/exchange_ticket_result", "success_exchange"), esp.lang("event/exchange_ticket_result", "scan_againn"), () => {
95
+ LibNavigation.back()
96
+ LibNavigation.navigate('component/scanner', { event_title: event_title, event_id: event_id, fromPage: "event/exchange_ticket" })
97
+ }, "", () => { })
98
+ } else {
99
+ esp.modProp("lib/toast").show(esp.lang("event/exchange_ticket_result", "ticket_claimed"))
100
+ }
101
+ }
102
+
103
+ if (!listTicket) {
104
+ return <LibLoading />
105
+ }
106
+
107
+ return (
108
+ <View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
109
+ <ComponentHeader title={qr} subtitle={event_title} />
110
+ <ScrollView>
111
+ <View style={{ margin: 10, padding: 10, backgroundColor: LibStyle.colorPrimary, borderRadius: 5, alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
112
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', color: TicketItemProperty.textColor(LibStyle.colorPrimary), fontSize: 50 }}>{LibUtils.number(listTicket?.qty_ticket)}</Text>
113
+ <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode="tail" style={{ color: TicketItemProperty.textColor(LibStyle.colorPrimary), textAlign: 'center', fontSize: 24 }}>{listTicket?.price_name}</Text>
114
+ {
115
+ listTicket?.hasOwnProperty("ondate") && listTicket?.ondate != "0000-00-00" &&
116
+ <Text allowFontScaling={false} style={{ color: TicketItemProperty.textColor(LibStyle.colorPrimary), marginTop: 5, textAlign: 'center', fontSize: 16 }}>{LibUtils.moment(listTicket?.ondate).format("DD MMM YYYY")}</Text>
117
+ }
118
+ </View>
119
+ <View style={{ padding: 10, marginTop: 0, margin: 10, borderRadius: 5, backgroundColor: '#fff' }}>
120
+ {
121
+ listTicket?.gifts?.map((item: any, i: number) => {
122
+ return (
123
+ <View key={i} style={{ padding: 5, marginBottom: 7, borderRadius: 5, backgroundColor: LibStyle.colorBgGrey }}>
124
+ <View style={{ flex: 1, flexDirection: 'row', alignContent: 'center', alignItems: 'center', padding: 5 }}>
125
+ <View style={{ flex: 1, }}>
126
+ <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode="tail" style={{ fontSize: 16, fontWeight: 'bold', color: "#000" }}>{item?.title} </Text>
127
+ <Text allowFontScaling={false} style={{ fontSize: 18, marginTop: 4, letterSpacing: 1 }}>{item?.qty} Item</Text>
128
+ </View>
129
+ {
130
+ item?.list?.[0].is_exchanged == 0 &&
131
+ <Pressable onPress={() => {
132
+ if (item?.is_exchangable == 1 && item?.list?.[0].is_exchanged == 0) {
133
+ let a = LibObject.set(listTicket, item.selected == 1 ? 0 : 1)('gifts', i, 'selected')
134
+ setListTicket(a)
135
+ } else {
136
+ LibToastProperty.show(esp.lang("event/exchange_ticket_result", "not_yet_exchange"))
137
+ }
138
+ }} style={{ marginLeft: 5, width: LibStyle.width / 5, height: 30, borderRadius: 5, ...LibStyle.elevation(2), alignContent: 'center', alignItems: 'center', justifyContent: 'center', backgroundColor: item.selected == 1 ? LibStyle.colorRed : LibStyle.colorGreen }}>
139
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', color: "#fff" }}>{item.selected == 1 ? esp.lang("event/exchange_ticket_result", "cancel") : esp.lang("event/exchange_ticket_result", "choose")}</Text>
140
+ {/* <LibIcon name={item.selected == 1 ? 'radiobox-marked' : 'radiobox-blank'} color={item.is_exchangable == 1 ? (item.selected == 1 ? LibStyle.colorGreen : "#000") : "#c9c9c9"} /> */}
141
+ </Pressable>
142
+ }
143
+
144
+ </View>
145
+
146
+ <View style={{ marginTop: 10, padding: 5, flexDirection: 'row' }}>
147
+ <View style={{ marginBottom: 5, flex: 1, padding: 5, backgroundColor: "#37c2d0", borderWidth: 1, borderColor: LibStyle.colorBgGrey, borderRadius: 5 }}>
148
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', color: '#fff', marginBottom: 5, fontSize: 14, }}>{esp.lang("event/exchange_ticket_result", "tms")}</Text>
149
+ {item?.list?.map((it: any, ii: number) => {
150
+ if (ii == 0) {
151
+ return (
152
+ <View key={ii} style={{ borderRadius: 5, margin: 2, padding: 5, backgroundColor: i % 2 ? '#fff' : LibStyle.colorGrey, borderBottomWidth: 1, borderBottomColor: LibStyle.colorBgGrey }}>
153
+ <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 13 }}>{it?.tms_name != "" ? it.tms_name : esp.lang("event/exchange_ticket_result", "not_redem")}</Text>
154
+ </View>
155
+ )
156
+ } else {
157
+ return null
158
+ }
159
+ })}
160
+ </View>
161
+ <View style={{ marginBottom: 5, flex: 1, padding: 5, backgroundColor: "#37c2d0", borderWidth: 1, borderColor: LibStyle.colorBgGrey, borderRadius: 5 }}>
162
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', color: '#fff', marginBottom: 5, fontSize: 14, }}>{esp.lang("event/exchange_ticket_result", "time_use")}</Text>
163
+ {item?.list?.map((it: any, ii: number) => {
164
+ if (ii == 0) {
165
+ return (
166
+ <View key={ii} style={{ borderRadius: 5, margin: 2, padding: 5, backgroundColor: i % 2 ? '#fff' : LibStyle.colorGrey, borderBottomWidth: 1, borderBottomColor: LibStyle.colorBgGrey }}>
167
+ <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 13 }}>{it?.exchanged_at != "" ? LibUtils.moment(it.exchanged_at).localeFormat("DD MMM HH:mm:ss ") : esp.lang("event/exchange_ticket_result", "not_redem")}</Text>
168
+ </View>
169
+ )
170
+ } else {
171
+ return null
172
+ }
173
+ })}
174
+ </View>
175
+ </View>
176
+
177
+ </View>
178
+ )
179
+ })
180
+ }
181
+ </View>
182
+ </ScrollView>
183
+ <View style={{ padding: 10, backgroundColor: '#fff' }}>
184
+ <ComponentTouchable onPress={() => {
185
+ LibNavigation.back()
186
+ LibNavigation.navigate('component/scanner', { event_title: event_title, event_id: event_id, fromPage: "event/exchange_ticket" })
187
+ }}>
188
+ <View style={{ height: 35, borderRadius: 5, borderWidth: 2, borderColor: LibStyle.colorRed, backgroundColor: "#fff", justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 }} >
189
+ <Text allowFontScaling={false} style={{ fontFamily: "ArialBold", textAlign: "center", textAlignVertical: 'center', color: LibStyle.colorRed, marginRight: 13, marginLeft: 10 }} >{esp.lang("event/exchange_ticket_result", "scan_again")}</Text>
190
+ </View>
191
+ </ComponentTouchable>
192
+
193
+ {/* {
194
+ listTicket?.list?.some((item: any) => item.exchanger_id == 0) && */}
195
+ <ComponentTouchable onPress={() => {
196
+ if (filterSelectedData(listTicket?.gifts).length > 0) {
197
+ exchangeTicket()
198
+ } else {
199
+ LibToastProperty.show(esp.lang("event/exchange_ticket_result", "please_choose_first"))
200
+ }
201
+ }}>
202
+ <View style={{ ...LibStyle.elevation(2), marginTop: 10, height: 35, borderRadius: 5, backgroundColor: filterSelectedData(listTicket?.gifts).length > 0 ? LibStyle.colorGreen : LibStyle.colorBgGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 }} >
203
+ <Text allowFontScaling={false} style={{ fontFamily: "ArialBold", textAlign: "center", textAlignVertical: 'center', color: 'white', marginRight: 13, marginLeft: 10 }} >{esp.lang("event/exchange_ticket_result", "total_ticket", listTicket?.qty_ticket)}</Text>
204
+ </View>
205
+ </ComponentTouchable>
206
+ {/* } */}
207
+ </View>
208
+
209
+ </View>
210
+ )
211
+ }
package/event/exit.tsx ADDED
@@ -0,0 +1,91 @@
1
+ // withHooks
2
+ import { BigbangGate_infoProperty } from 'esoftplay/cache/bigbang/gate_info/import';
3
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
4
+ import { LibLoading } from 'esoftplay/cache/lib/loading/import';
5
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
6
+
7
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
8
+ import { UserClass } from 'esoftplay/cache/user/class/import';
9
+ import esp from 'esoftplay/esp';
10
+ import React, { useEffect } from 'react';
11
+ import { View } from 'react-native';
12
+
13
+
14
+ export interface EventExitArgs {
15
+
16
+ }
17
+ export interface EventExitProps {
18
+
19
+ }
20
+ export default function m(props: EventExitProps): any {
21
+ const { scan_type, url_ticket_update, url_ticket_detail, price_type, gate_type, qr_code, event_id, email, selectGate, typeScanner, event_title, qty, configPriority }: any = LibNavigation.getArgsAll<any>(props)
22
+
23
+ let args = {
24
+ selectGate: selectGate,
25
+ fromPage: 'bigbang/gate_info',
26
+ event_id: event_id,
27
+ event_title: event_title,
28
+ typeScanner: typeScanner,
29
+ gate_type: gate_type,
30
+ price_type: price_type,
31
+ url_ticket_detail: url_ticket_detail,
32
+ url_ticket_update: url_ticket_update,
33
+ configPriority: configPriority,
34
+ scan_type: scan_type
35
+ }
36
+
37
+ useEffect(() => {
38
+ loadData()
39
+ }, [])
40
+
41
+ function loadData() {
42
+ BigbangGate_infoProperty.addCounterOutScan(1, "0")
43
+
44
+ let post = {
45
+ event_id: event_id,
46
+ gate_id: selectGate?.id,
47
+ user_qr: encodeURIComponent(qr_code),
48
+ email: email ? email : "",
49
+ }
50
+
51
+ new LibCurl('event_tms_out', post, (res) => {
52
+ // setResult(res)
53
+ let modifyList = res.list.length > 0 && res.list.map((item: any, i: number) => {
54
+ return ({
55
+ ...item,
56
+ checked: i == 0 ? 1 : 0
57
+ })
58
+ })
59
+ let finalData = {
60
+ ...res,
61
+ list: modifyList
62
+ }
63
+
64
+ esp.log(res);
65
+
66
+ if (modifyList.length == 1) {
67
+ let a = modifyList?.filter((item: any) => item.checked == 1).map((it: any) => it.id)
68
+ let postOut = {
69
+ event_id: event_id,
70
+ ids: JSON.stringify(a),
71
+ gate_id: selectGate?.id,
72
+ trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
73
+ price_id: modifyList?.filter((item: any) => item.checked == 1).map((it: any) => it.price_id),
74
+ scanned_out: LibUtils.moment().format('YYYY-MM-DD HH:mm:ss'),
75
+ }
76
+ let urlOut = "event_tms_out_confirm"
77
+ LibNavigation.replace('event/exit_success', { data: finalData, ...args, url: urlOut, post: postOut })
78
+ } else {
79
+ LibNavigation.replace('event/exit_list', { data: finalData, ...args })
80
+ }
81
+ }, (error) => {
82
+ LibNavigation.replace('event/exit_failed', { msgError: error, ...args, postGetData: post })
83
+ }, 1)
84
+ }
85
+
86
+ return (
87
+ <View style={{ flex: 1, backgroundColor: '#fff', alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
88
+ <LibLoading />
89
+ </View>
90
+ )
91
+ }
@@ -0,0 +1,135 @@
1
+ // withHooks
2
+
3
+
4
+ import { BigbangGate_infoProperty } from 'esoftplay/cache/bigbang/gate_info/import';
5
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
6
+ import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
7
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
8
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
9
+ import { LibStatusbar } from 'esoftplay/cache/lib/statusbar/import';
10
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
11
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
12
+ import { UserClass } from 'esoftplay/cache/user/class/import';
13
+ import esp from 'esoftplay/esp';
14
+ import React, { useEffect } from 'react';
15
+ import { Pressable, ScrollView, Text, View } from 'react-native';
16
+
17
+
18
+ export interface EventExit_failedArgs {
19
+
20
+ }
21
+ export interface EventExit_failedProps {
22
+
23
+ }
24
+ export default function m(props: EventExit_failedProps): any {
25
+ const { scan_type, msgError, postGetData, url_ticket_update, url_ticket_detail, price_type, gate_type, event_id, selectGate, typeScanner, event_title, configPriority }: any = LibNavigation.getArgsAll<any>(props)
26
+
27
+ useEffect(() => {
28
+ BigbangGate_infoProperty.addCounterOutScanFailed(1, "0")
29
+ }, [])
30
+
31
+ function getBack() {
32
+ LibNavigation.replace('component/scanner', {
33
+ selectGate: selectGate,
34
+ fromPage: 'bigbang/gate_info',
35
+ event_id: event_id,
36
+ event_title: event_title,
37
+ typeScanner: typeScanner,
38
+ gate_type: gate_type,
39
+ price_type: price_type,
40
+ url_ticket_detail: url_ticket_detail,
41
+ url_ticket_update: url_ticket_update,
42
+ configPriority: configPriority,
43
+ scan_type: scan_type
44
+ })
45
+ }
46
+
47
+ function sendTelegram() {
48
+ let data = {
49
+ '#bbotmsexit': ":",
50
+ reporter: {
51
+ email: UserClass.state().get().email,
52
+ name: UserClass.state().get().name
53
+ },
54
+ url: "event_tms_out",
55
+ post: postGetData,
56
+ error_msg: msgError,
57
+ }
58
+
59
+ let post = {
60
+ text: String(JSON.stringify(data || {}, undefined, 2)).replace(/[\[\]\{\}\"]+/g, ''),
61
+ chat_id: '-1001737180019',
62
+ disable_web_page_preview: true
63
+ }
64
+
65
+ let _url = "https://api.telegram.org/bot923808407:AAEFBlllQNKCEn8E66fwEzCj5vs9qGwVGT4/sendMessage"
66
+ new LibCurl().custom(_url, post, (res, msg) => { })
67
+ }
68
+
69
+
70
+ return (
71
+ <View style={{ flex: 1 }}>
72
+ <LibStatusbar style='light' />
73
+ <View style={{ flex: 1 }}>
74
+ <LibPicture source={esp.assets('failed.png')} style={{ flex: 1, height: LibStyle.height, width: LibStyle.width }} /* resizeMode={"stretch"} */ />
75
+ </View>
76
+ <View style={{ position: 'absolute', top: 100, left: 0, right: 0, bottom: 0, alignItems: 'center', alignContent: 'center' }} >
77
+ <ScrollView>
78
+ <View style={{ marginBottom: 20, alignSelf: 'center', borderRadius: LibStyle.width / 3, padding: 10, backgroundColor: '#fff' }}>
79
+ <LibPicture
80
+ source={esp.assets('failed_icon.png')}
81
+ style={{ width: LibStyle.width / 3, height: LibStyle.width / 3 }}
82
+ />
83
+ </View>
84
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 25, color: '#fff', marginHorizontal: 20, textAlign: 'center', letterSpacing: 1 }}>{msgError?.message}</Text>
85
+
86
+ {
87
+ msgError?.result?.length > 0 &&
88
+ <View style={{ marginTop: 15, flexDirection: 'row', justifyContent: 'space-between', backgroundColor: '#37c2d0', borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
89
+ <View style={{ flex: 1, justifyContent: 'center', borderRightWidth: 1, borderColor: LibStyle.colorBgGrey, paddingVertical: 5, padding: 5 }}>
90
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', textAlign: 'center', fontSize: 14 }}>{esp.lang("event/exit_failed", "type")}</Text>
91
+ </View>
92
+ <View style={{ flex: 1, justifyContent: 'center', paddingVertical: 5 }}>
93
+ <Text allowFontScaling={false} style={{ fontWeight: 'bold', textAlign: 'center', fontSize: 14 }}>{esp.lang("event/exit_failed", "time")}</Text>
94
+ </View>
95
+ </View>
96
+ }
97
+ {
98
+ msgError?.result?.length > 0 && msgError?.result?.map((item: any, i: number) => {
99
+ return (
100
+ <View key={i} style={{ backgroundColor: i % 2 ? '#fff' : LibStyle.colorGrey, flexDirection: 'row', justifyContent: 'space-between', borderBottomWidth: 1, borderBottomColor: LibStyle.colorBgGrey }}>
101
+ <View style={{ flex: 1, justifyContent: 'center', borderRightWidth: 1, borderColor: LibStyle.colorBgGrey, paddingVertical: 5, padding: 5 }}>
102
+ <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode="tail" style={{ letterSpacing: 1, textAlign: 'center', fontSize: 12 }}>{item?.price_name}</Text>
103
+ </View>
104
+ <View style={{ flex: 1, justifyContent: 'center', paddingVertical: 5 }}>
105
+ {
106
+ item.scanned != "0000-00-00 00:00:00" &&
107
+ <Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 12 }}>{LibUtils.moment(item.hall_scanned).localeFormat("DD MMM H:mm:ss ")}</Text>
108
+ }
109
+ </View>
110
+ </View>
111
+ )
112
+ })
113
+ }
114
+
115
+ </ScrollView>
116
+ <View style={{ flexDirection: 'row', width: LibStyle.width - 40, marginVertical: 10, justifyContent: 'space-between' }}>
117
+ <Pressable onPress={() => {
118
+
119
+ LibDialog.warningConfirm(esp.lang("event/entrance_failed", "warn_title"), esp.lang("event/entrance_failed", "warn_msg"), esp.lang("event/entrance_failed", "warn_ok"), () => {
120
+ sendTelegram()
121
+ }, esp.lang("event/entrance_failed", "warn_no"), () => { })
122
+
123
+ }} 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) }}>
124
+ <Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold', color: "#fff" }}>{esp.lang("event/exit_failed", "report_error")}</Text>
125
+ </Pressable>
126
+ <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) }}>
127
+ <Text allowFontScaling={false} style={{ fontSize: 14, fontWeight: 'bold', color: "#fff" }}>{esp.lang("event/exit_failed", "back")}</Text>
128
+ </Pressable>
129
+
130
+ </View>
131
+ </View>
132
+
133
+ </View>
134
+ )
135
+ }