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,200 @@
1
+ // withHooks
2
+
3
+ import { ComponentHeader } from 'esoftplay/cache/component/header/import';
4
+ import { ComponentTouchable } from 'esoftplay/cache/component/touchable/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 { LibProgress } from 'esoftplay/cache/lib/progress/import';
10
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
11
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
12
+
13
+ import { applyStyle } from 'esoftplay';
14
+ import { ComponentButton } from 'esoftplay/cache/component/button/import';
15
+ import { EventScan_item } from 'esoftplay/cache/event/scan_item/import';
16
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
17
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
18
+ import esp from 'esoftplay/esp';
19
+ import moment from 'esoftplay/moment';
20
+ import useSafeState from 'esoftplay/state';
21
+ import React, { useEffect } from 'react';
22
+ import { ScrollView, Text, View } from 'react-native';
23
+ moment().locale('id')
24
+
25
+
26
+ export interface EventEntrance_againArgs {
27
+
28
+ }
29
+ export interface EventEntrance_againProps {
30
+
31
+ }
32
+ export default function m(props: EventEntrance_againProps): any {
33
+ const [result, setResult] = useSafeState<any>(undefined)
34
+
35
+ const user_qr = LibNavigation.getArgs(props, 'qr_code')
36
+ const { scan_type, event_id, event_title, selectGate, typeScanner }: any = LibNavigation.getArgsAll(props)
37
+
38
+ useEffect(() => {
39
+ loadData()
40
+ }, [])
41
+
42
+
43
+ function loadData(): void {
44
+ var post = {
45
+ // event_id: "264",
46
+ // user_qr: encodeURIComponent("BBO-H6851"),
47
+ // gate_id: "182"
48
+ event_id: event_id,
49
+ user_qr: encodeURIComponent(user_qr),
50
+ gate_id: selectGate?.id
51
+ }
52
+
53
+ new LibCurl('event_tms_out_temporary_in', post, (res) => {
54
+ let a = res?.list?.length > 0 && res.list.map((item: any, i: number) => {
55
+ return ({
56
+ ...item,
57
+ checked: 0
58
+ })
59
+ })
60
+ let b = res?.staff?.length > 0 && res.staff.map((item: any, i: number) => {
61
+ return ({
62
+ ...item,
63
+ checked: 0
64
+ })
65
+ })
66
+
67
+ let c = {
68
+ ...res,
69
+ list: res?.list?.length == 0 ? [] : a,
70
+ staff: res?.staff?.length == 0 ? [] : b
71
+ }
72
+ esp.log({ res, c });
73
+ setResult(c)
74
+ }, (error) => {
75
+ LibDialog.warningConfirm(esp.lang("event/entrance_again", "fault"), error?.message, esp.lang("event/entrance_again", "back"), () => LibNavigation.back(), "", () => { })
76
+ }, 1)
77
+ }
78
+
79
+ function entrance(): void {
80
+ let newData = [...result?.staff, ...result?.list]
81
+ let _ids = newData?.filter((item: any) => item.checked == 1).map((it: any) => it.id)
82
+ if (_ids.length == 0) {
83
+ LibToastProperty.show(esp.lang("event/entrance_again", "warning_ticket"))
84
+ return
85
+ }
86
+
87
+ if (_ids.length == 0) {
88
+ LibToastProperty.show(esp.lang("event/entrance_again", "warning_ticket"))
89
+ return
90
+ }
91
+ var post = {
92
+ event_id: event_id,
93
+ ids: JSON.stringify(_ids),
94
+ gate_id: selectGate.id
95
+ }
96
+
97
+ LibProgress.show(esp.lang("event/entrance_again", "wait"))
98
+ new LibCurl('event_tms_out_temporary_in_confirm', post, (result, msg) => {
99
+ esp.log({ result, msg, post });
100
+ LibProgress.hide()
101
+ LibDialog.confirm(esp.lang("event/entrance_again", "info"), result, esp.lang("event/entrance_again", "ok"), () => {
102
+ LibNavigation.replace('component/scanner', {
103
+ selectGate: selectGate,
104
+ fromPage: 'bigbang/gate_info',
105
+ event_id: event_id,
106
+ event_title: event_title,
107
+ typeScanner: typeScanner,
108
+ scan_type: scan_type
109
+ })
110
+ }, "", () => { })
111
+ }, (error) => {
112
+ esp.log({ error });
113
+ LibDialog.warning(esp.lang("event/entrance_again", "oops"), error?.message)
114
+ LibProgress.hide()
115
+ })
116
+ }
117
+
118
+ function renderTicket(item: any, i: number) {
119
+ return (
120
+ <EventScan_item
121
+ key={i}
122
+ item={item}
123
+ colorFont={"#fff"}
124
+ event_image={result?.event_image}
125
+ style={{ backgroundColor: "#fff" }}
126
+ event_name={result?.event_name}
127
+ event_ondate={result?.event_ondate}
128
+ label={item.status == 0 ? esp.lang("event/entrance_again", "used") : item.checked == 0 ? esp.lang("event/entrance_again", "use") : esp.lang("event/entrance_again", "cancel")}
129
+ onPress={() => {
130
+ if (item?.status == 1) {
131
+ let a = LibObject.set(result, item.checked == 1 ? 0 : 1)('list', i, 'checked')
132
+ setResult(a)
133
+ }
134
+ }}
135
+ colorBackground={item.status == 0 ? LibStyle.colorLightGrey : item.checked == 0 ? LibStyle.colorGreen : LibStyle.colorRed}
136
+ />
137
+
138
+ )
139
+ }
140
+
141
+ function renderStaff(item: any, i: number) {
142
+ return (
143
+ <View key={i}>
144
+
145
+ <View style={{ padding: 10, overflow: 'hidden', flex: 1, flexDirection: 'row', backgroundColor: '#fff', borderBottomColor: LibStyle.colorGrey, borderBottomWidth: 1.5 }}>
146
+ <LibPicture style={applyStyle({ borderRadius: 5, width: LibStyle.width / 4.5, height: LibStyle.width / 4.5, backgroundColor: LibStyle.colorBgGrey })} source={{ uri: item?.image }} />
147
+ <View style={{ marginLeft: 10, flex: 1 }}>
148
+ <Text allowFontScaling={false} ellipsizeMode={'tail'} numberOfLines={2} style={applyStyle({ color: "#000", marginBottom: 4, fontSize: 18, fontWeight: 'bold' })}>{item.name}</Text>
149
+ <Text allowFontScaling={false} ellipsizeMode={'tail'} numberOfLines={2} style={applyStyle({ color: "#000", marginBottom: 4, fontSize: 14 })}>{item.department_name}</Text>
150
+ <Text allowFontScaling={false} ellipsizeMode={'tail'} numberOfLines={2} style={applyStyle({ color: "#000", marginBottom: 4, fontSize: 16 })}>{item.exhibitor_name}</Text>
151
+ {
152
+ item.status == 1 &&
153
+ <ComponentButton 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={
154
+ item.status == 0 ?
155
+ esp.lang("event/exit_temporary", "used") :
156
+ item.hasOwnProperty("checked") && item.checked == 0 ?
157
+ esp.lang("event/exit_temporary", "use") :
158
+ esp.lang("event/exit_temporary", "cancel")
159
+ } fontColor={"#fff"} onPress={() => {
160
+ let a = LibObject.set(result, item.checked == 1 ? 0 : 1)('staff', i, 'checked')
161
+ setResult(a)
162
+ }} />
163
+ }
164
+ </View>
165
+ <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 }} >
166
+ <Text style={{ color: 'white', alignSelf: 'center', fontWeight: 'bold' }} >ID CARD</Text>
167
+ </View>
168
+ </View>
169
+ </View>
170
+ )
171
+ }
172
+
173
+ if (!result) return <LibLoading />
174
+
175
+ return (
176
+ <View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
177
+ <ComponentHeader title={esp.lang("event/entrance_again", "entrance_again")} subtitle={selectGate?.name} cart />
178
+ <ScrollView>
179
+ <View style={{ margin: 15, marginBottom: 0, borderRadius: 7, overflow: 'hidden' }}>
180
+ {
181
+ result?.staff?.length > 0 && result?.staff?.map(renderStaff)
182
+ }
183
+ </View>
184
+ <View style={{ margin: 15, marginBottom: 0, borderRadius: 7, overflow: 'hidden' }}>
185
+ {
186
+ result?.list?.length > 0 && result?.list?.map(renderTicket)
187
+ }
188
+ </View>
189
+ </ScrollView>
190
+ <ComponentTouchable onPress={() => {
191
+ entrance()
192
+ }}>
193
+ <View style={applyStyle({ margin: 10, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorGreen, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 })} >
194
+ <Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 12, textAlign: "center", textAlignVertical: 'center', color: 'white', marginRight: 13, marginLeft: 10 })} >{esp.lang("event/entrance_again", "entrance")}</Text>
195
+ </View>
196
+ </ComponentTouchable>
197
+
198
+ </View >
199
+ )
200
+ }
@@ -0,0 +1,190 @@
1
+ // withHooks
2
+ import { applyStyle } from 'esoftplay';
3
+ import { BigbangGate_infoProperty } from 'esoftplay/cache/bigbang/gate_info/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 EventEntrance_failedArgs {
20
+
21
+ }
22
+ export interface EventEntrance_failedProps {
23
+
24
+ }
25
+ export default function m(props: EventEntrance_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
+ BigbangGate_infoProperty.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: 'bigbang/gate_info',
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/entrance_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/entrance_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/entrance_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/entrance_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/entrance_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/entrance_failed", "warn_title"), esp.lang("event/entrance_failed", "warn_msg"), esp.lang("event/entrance_failed", "warn_ok"), () => {
174
+ sendTelegram()
175
+ }, esp.lang("event/entrance_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/entrance_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/entrance_failed", "back")}</Text>
182
+ </Pressable>
183
+
184
+ </View>
185
+ </View>
186
+
187
+ </View>
188
+ )
189
+
190
+ }
@@ -0,0 +1,203 @@
1
+ // withHooks
2
+
3
+ import { BigbangGate_infoProperty } from 'esoftplay/cache/bigbang/gate_info/import';
4
+ import { ComponentButton } from 'esoftplay/cache/component/button/import';
5
+ import { ComponentHeader } from 'esoftplay/cache/component/header/import';
6
+ import { EventEntrance_successProperty } from 'esoftplay/cache/event/entrance_success/import';
7
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
8
+ import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
9
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
10
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
11
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
12
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
13
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
14
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
15
+ import { MarketSheet } from 'esoftplay/cache/market/sheet/import';
16
+ import { UserClass } from 'esoftplay/cache/user/class/import';
17
+ import esp from 'esoftplay/esp';
18
+ import useSafeState from 'esoftplay/state';
19
+ import React, { useEffect, useRef } from 'react';
20
+ import { Text, View } from 'react-native';
21
+
22
+
23
+ export interface EventEntrance_idcardArgs {
24
+
25
+ }
26
+ export interface EventEntrance_idcardProps {
27
+
28
+ }
29
+ export default function m(props: EventEntrance_idcardProps): any {
30
+ const width = LibStyle.width
31
+ const height = 12 / 9 * width
32
+ const marginTop = 2.7 / 9 * width
33
+ const photoHeight = 4 / 9 * width
34
+ const photoWidth = 3 / 9 * width
35
+ const photoMarginBot = 0.46 / 9 * width
36
+
37
+ const menuRef = useRef<MarketSheet>(null)
38
+
39
+ const {
40
+ hall,
41
+ selectedTicket,
42
+ event_id,
43
+ selectGate,
44
+ url_ticket_update,
45
+ price_type,
46
+ gate_type,
47
+ event_title,
48
+ typeScanner,
49
+ url_ticket_detail,
50
+ configPriority,
51
+ scan_type
52
+ } = LibNavigation.getArgsAll(props)
53
+
54
+ const [result, setResult] = useSafeState<any>()
55
+
56
+ function loadData() {
57
+ // load data untuk ngambil background id card
58
+ new LibCurl('event_tms_visitor?event_id=' + event_id, null, (res, message) => {
59
+ setResult(res)
60
+ }, (error) => {
61
+ LibToastProperty?.show(error?.message)
62
+ LibNavigation.back()
63
+ }, 1)
64
+ }
65
+
66
+ useEffect(() => {
67
+ loadData()
68
+ if (hall && hall == "in") {
69
+ entranceHall()
70
+ } else if (hall && hall == "out") {
71
+ exitHall()
72
+ } else {
73
+ entrance()
74
+ }
75
+ }, [])
76
+
77
+ function entrance() {
78
+ let url = url_ticket_update + LibUtils.objectToUrlParam({
79
+ is_turnstile: 0,
80
+ })
81
+
82
+ let post = {
83
+ "target-url": "https://api.test.bbo.co.id/gate_checkin",
84
+ price_id: 0,
85
+ qr: encodeURIComponent(selectedTicket?.key),
86
+ trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
87
+ event_id: event_id,
88
+ gate_id: selectGate?.id,
89
+ is_tms: 1,
90
+ qty: selectedTicket?.qty,
91
+ tms_id: UserClass.state().get()?.id
92
+ }
93
+
94
+ BigbangGate_infoProperty.addCounterEntranceOpenGateIdCard(1, selectedTicket?.price_id)
95
+ EventEntrance_successProperty.syncUsedTiket().set(LibObject.push(EventEntrance_successProperty.syncUsedTiket().get(), [url, post])())
96
+ BigbangGate_infoProperty.subscribeSync().trigger(EventEntrance_successProperty.syncUsedTiket().get())
97
+ }
98
+
99
+ function entranceHall() {
100
+ let post = {
101
+ event_id: event_id,
102
+ hall_id: selectGate?.id,
103
+ staff_id: selectedTicket?.id
104
+ }
105
+ new LibCurl('event_tms_hall_confirm_staff', post, (res, message) => {
106
+ // setResult(res)
107
+ BigbangGate_infoProperty.addCounterHallInGateIdcard(1, selectedTicket?.price_id)
108
+ }, (error) => {
109
+ }, 1)
110
+ }
111
+
112
+ function exitHall() {
113
+ let post = {
114
+ event_id: event_id,
115
+ hall_id: selectGate?.id,
116
+ id: selectedTicket?.id // ini id stafff
117
+ }
118
+ new LibCurl('event_tms_hall_out_confirm_staff', post, (res, message) => {
119
+ // setResult(res)
120
+ BigbangGate_infoProperty.addCounterHallOutOpenGateIdCard(1, selectedTicket?.price_id)
121
+ }, (error) => {
122
+ }, 1)
123
+ }
124
+
125
+
126
+ return (
127
+ <View style={{ flex: 1 }}>
128
+ <ComponentHeader
129
+ title={esp.lang("event/entrance_idcard", "header")}
130
+ notif
131
+ onPressMore={() => menuRef.current?.show()}
132
+ more
133
+ />
134
+ <View style={{ backgroundColor: '#000', height: LibStyle.height, alignItems: 'center' }}>
135
+ {/* ini id_card nya */}
136
+ <LibPicture source={result?.event?.image_idcard == "" ? esp.assets('white_idcard.png') : { uri: result?.event?.image_idcard }} style={{ width: width, height: height, resizeMode: 'contain' }} />
137
+ <View style={{ position: 'absolute' }}>
138
+ <LibPicture source={{ uri: selectedTicket?.user_image != '' ? decodeURIComponent(selectedTicket?.user_image) : 'https://www.w3schools.com/howto/img_avatar.png' }} style={{ marginBottom: photoMarginBot, marginTop: marginTop, height: photoHeight, width: photoWidth, alignSelf: 'center', resizeMode: 'cover', }} />
139
+ <View style={{ padding: 10, marginTop: 5 }} >
140
+ {/* view nama */}
141
+ <View style={{ flexDirection: 'row' }} >
142
+ <Text allowFontScaling={false} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a", flex: 3 }} >{esp.lang("event/entrance_idcard", "name")}</Text>
143
+ <Text allowFontScaling={false} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a" }} > : </Text>
144
+ <Text allowFontScaling={false} numberOfLines={1} ellipsizeMode={"tail"} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a", flex: 5 }} >{selectedTicket ? decodeURIComponent((selectedTicket?.user_name))?.split("+").join(' ') : esp.lang("event/entrance_idcard", "visitor")}</Text>
145
+ </View>
146
+ {/* view company */}
147
+ <View style={{ flexDirection: 'row' }} >
148
+ <Text allowFontScaling={false} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a", flex: 3 }} >{esp.lang("event/entrance_idcard", "company")}</Text>
149
+ <Text allowFontScaling={false} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a" }} > : </Text>
150
+ <Text allowFontScaling={false} numberOfLines={1} ellipsizeMode={"tail"} style={{ fontSize: 16, fontWeight: "bold", fontStyle: "normal", lineHeight: 22, letterSpacing: 0, color: "#4a4a4a", flex: 5 }} >{selectedTicket?.exhibitor_name?.split('-')[1]}</Text>
151
+ </View>
152
+
153
+ <View style={{ width: width - 20, alignSelf: 'center', backgroundColor: '#4a4a4a', height: 4, marginVertical: 4 }} />
154
+ <Text allowFontScaling={false} style={{ marginTop: -5, fontSize: 20, fontWeight: "bold", fontStyle: "normal", lineHeight: 32, textAlign: 'center', letterSpacing: 0, color: "#4a4a4a" }} >{selectedTicket?.exhibitor_name?.split('-')[0]}</Text>
155
+ </View>
156
+
157
+ </View>
158
+ <ComponentButton
159
+ label={esp.lang("event/entrance_idcard", "btn_back")}
160
+ backgroundColor={LibStyle.colorPrimary}
161
+ onPress={() => {
162
+ // LibNavigation.back()
163
+ LibNavigation.replace('component/scanner', {
164
+ selectGate: selectGate,
165
+ fromPage: 'bigbang/gate_info',
166
+ event_id: event_id,
167
+ event_title: event_title,
168
+ typeScanner: typeScanner,
169
+ gate_type: gate_type,
170
+ price_type: price_type,
171
+ url_ticket_detail: url_ticket_detail,
172
+ url_ticket_update: url_ticket_update,
173
+ configPriority: configPriority,
174
+ scan_type: scan_type
175
+ })
176
+ }}
177
+ style={{ marginTop: 20, marginHorizontal: 15 }}
178
+ />
179
+ </View>
180
+ <MarketSheet
181
+ _ref={menuRef}
182
+ title={"ID CARD"}
183
+ options={[
184
+ {
185
+ text: "Tahan ID CARD",
186
+ textStyle: { color: "red" },
187
+ onPress: () => {
188
+ LibDialog.warningConfirm(esp.lang("event/tms_dashboard", "block_idcard_title"), esp.lang("event/tms_dashboard", "block_idcard_message"), esp.lang("event/tms_dashboard", "block_idcard_ok"), () => {
189
+ new LibCurl("event_tms_staff_hold", { qr: encodeURIComponent(selectedTicket?.key) }, (result, message) => {
190
+ LibDialog.info("Berhasil!", message)
191
+ }, (error) => {
192
+ LibDialog.warning("Oops!", error?.message)
193
+ })
194
+ }, esp.lang("event/tms_dashboard", "block_idcard_no"), () => {
195
+ LibDialog.hide()
196
+ })
197
+ }
198
+ }
199
+ ]}
200
+ />
201
+ </View>
202
+ )
203
+ }