esoftplay-event 0.0.0-a → 0.0.0-c

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 (179) hide show
  1. package/event/additional.tsx +4 -4
  2. package/event/additional_input.tsx +15 -15
  3. package/event/alert.tsx +32 -0
  4. package/event/artist.tsx +166 -0
  5. package/event/artist_detail.tsx +521 -0
  6. package/event/artist_detail_multi.tsx +548 -0
  7. package/event/badge.tsx +22 -0
  8. package/event/button.tsx +40 -0
  9. package/event/config.ts +4 -0
  10. package/event/countdown.tsx +5 -5
  11. package/event/countdown_base.tsx +83 -0
  12. package/event/counter_cashier.tsx +13 -13
  13. package/event/counter_cashier_report.tsx +6 -6
  14. package/event/counter_cashier_sell.tsx +7 -7
  15. package/event/counter_eo.tsx +21 -21
  16. package/event/counter_history.tsx +4 -4
  17. package/event/counter_lm.tsx +18 -18
  18. package/event/counter_report.tsx +4 -4
  19. package/event/counter_report_breakdown.tsx +2 -2
  20. package/event/counter_report_detail.tsx +15 -15
  21. package/event/counter_report_detail_list.tsx +4 -4
  22. package/event/counter_request.tsx +4 -4
  23. package/event/counter_request_detail.tsx +6 -6
  24. package/event/counter_send.tsx +9 -9
  25. package/event/counter_user_list.tsx +15 -15
  26. package/event/coupon.tsx +4 -4
  27. package/event/coupon_claim.tsx +4 -4
  28. package/event/coupon_claim_detail.tsx +8 -7
  29. package/event/coupon_claim_history.tsx +9 -9
  30. package/event/coupon_claim_reimburse.tsx +7 -8
  31. package/event/coupon_claim_reimburse_history.tsx +4 -4
  32. package/event/coupon_claim_reimburse_history_detail.tsx +4 -4
  33. package/event/coupon_claim_staff.tsx +10 -10
  34. package/event/coupon_detail.tsx +3 -3
  35. package/event/coupon_event_list.tsx +4 -4
  36. package/event/coupon_generate.tsx +4 -4
  37. package/event/coupon_generate_event.tsx +4 -4
  38. package/event/coupon_generate_list.tsx +2 -2
  39. package/event/date_picker.tsx +5 -5
  40. package/event/detail.tsx +12 -15
  41. package/event/entrance.tsx +17 -17
  42. package/event/entrance_again.tsx +22 -23
  43. package/event/entrance_failed.tsx +15 -15
  44. package/event/entrance_idcard.tsx +23 -23
  45. package/event/entrance_list.tsx +24 -24
  46. package/event/entrance_list_item.tsx +6 -6
  47. package/event/entrance_log.tsx +24 -24
  48. package/event/entrance_success.tsx +8 -8
  49. package/event/entrance_warning.tsx +14 -14
  50. package/event/exchange_reward.tsx +2 -2
  51. package/event/exchange_reward_result.tsx +7 -8
  52. package/event/exchange_ticket.tsx +11 -12
  53. package/event/exchange_ticket_list.tsx +10 -12
  54. package/event/exchange_ticket_result.tsx +11 -12
  55. package/event/exit.tsx +9 -9
  56. package/event/exit_failed.tsx +12 -12
  57. package/event/exit_list.tsx +15 -15
  58. package/event/exit_log.tsx +22 -22
  59. package/event/exit_success.tsx +8 -8
  60. package/event/exit_temporary.tsx +21 -21
  61. package/event/expander.tsx +36 -0
  62. package/event/fab.tsx +24 -0
  63. package/event/firebase_socket.ts +365 -0
  64. package/event/hall_in.tsx +13 -13
  65. package/event/hall_in_failed.tsx +22 -22
  66. package/event/hall_in_list.tsx +17 -17
  67. package/event/hall_in_log.tsx +24 -24
  68. package/event/hall_in_success.tsx +8 -8
  69. package/event/hall_out.tsx +13 -13
  70. package/event/hall_out_failed.tsx +11 -11
  71. package/event/hall_out_list.tsx +17 -17
  72. package/event/hall_out_log.tsx +24 -24
  73. package/event/hall_out_success.tsx +8 -8
  74. package/event/header.tsx +119 -0
  75. package/event/header_home.tsx +108 -0
  76. package/event/index.tsx +270 -0
  77. package/event/input_rectangle.tsx +208 -0
  78. package/event/item.tsx +40 -0
  79. package/event/label_input.tsx +23 -0
  80. package/event/list.tsx +20 -21
  81. package/event/list_filter.tsx +12 -13
  82. package/event/list_item.tsx +76 -0
  83. package/event/list_item2.tsx +78 -0
  84. package/event/loading_page.tsx +248 -0
  85. package/event/log.tsx +54 -54
  86. package/event/message.tsx +32 -0
  87. package/event/notice.tsx +41 -0
  88. package/event/order.tsx +323 -0
  89. package/event/order_detail.tsx +813 -0
  90. package/event/order_detail_payment.tsx +153 -0
  91. package/event/order_detail_upgrade.tsx +164 -0
  92. package/event/order_detail_upgrade_button.tsx +60 -0
  93. package/event/order_detail_upgrade_payment.tsx +221 -0
  94. package/event/order_detail_visitor.tsx +196 -0
  95. package/event/order_detail_waiting.tsx +520 -0
  96. package/event/order_history.tsx +101 -0
  97. package/event/order_item.tsx +118 -0
  98. package/event/order_lottery.tsx +172 -0
  99. package/event/order_reschedule.tsx +439 -0
  100. package/event/order_reschedule_list.tsx +85 -0
  101. package/event/order_share_to.tsx +219 -0
  102. package/event/order_share_to_detail.tsx +181 -0
  103. package/event/order_status.tsx +66 -0
  104. package/event/order_waiting.tsx +143 -0
  105. package/event/pending_trx.tsx +50 -0
  106. package/event/qc_idcard.tsx +12 -12
  107. package/event/qc_idcard_failed.tsx +4 -4
  108. package/event/qc_idcard_success.tsx +4 -4
  109. package/event/qr_bg.tsx +22 -0
  110. package/event/queue_out.tsx +3 -3
  111. package/event/queue_pricing.tsx +2 -3
  112. package/event/rating.tsx +49 -0
  113. package/event/rating_mini.tsx +35 -0
  114. package/event/refresh_button.tsx +40 -0
  115. package/event/review.tsx +3 -3
  116. package/event/review_add.tsx +8 -8
  117. package/event/review_detail.tsx +4 -4
  118. package/event/review_item.tsx +4 -4
  119. package/event/scan_item.tsx +2 -2
  120. package/event/schedule.tsx +8 -9
  121. package/event/seat.tsx +16 -18
  122. package/event/seat_autopick.tsx +4 -4
  123. package/event/seat_map.tsx +4 -4
  124. package/event/seat_map_test.tsx +2 -2
  125. package/event/section.tsx +35 -0
  126. package/event/section_menu.tsx +40 -0
  127. package/event/sheet.tsx +73 -0
  128. package/event/slider.tsx +46 -0
  129. package/event/step.tsx +29 -0
  130. package/event/ticket_list.tsx +15 -16
  131. package/event/ticket_list2.tsx +16 -17
  132. package/event/tms.tsx +4 -4
  133. package/event/tms_add.tsx +7 -8
  134. package/event/tms_add_result.tsx +4 -4
  135. package/event/tms_check_code.tsx +160 -0
  136. package/event/tms_check_ticket.tsx +72 -0
  137. package/event/tms_check_ticket_result.tsx +384 -0
  138. package/event/tms_dashboard.tsx +7 -7
  139. package/event/tms_event_list.tsx +46 -43
  140. package/event/tms_gate.tsx +96 -0
  141. package/event/tms_home.tsx +639 -0
  142. package/event/tms_idcard.tsx +203 -0
  143. package/event/tms_in.tsx +215 -0
  144. package/event/tms_in_again.tsx +199 -0
  145. package/event/tms_in_failed.tsx +190 -0
  146. package/event/tms_in_hall.tsx +148 -0
  147. package/event/tms_in_hall_failed.tsx +270 -0
  148. package/event/tms_in_hall_list.tsx +222 -0
  149. package/event/tms_in_hall_log.tsx +134 -0
  150. package/event/tms_in_hall_success.tsx +132 -0
  151. package/event/tms_in_list.tsx +264 -0
  152. package/event/tms_in_log.tsx +130 -0
  153. package/event/tms_in_success.tsx +155 -0
  154. package/event/tms_in_warning.tsx +91 -0
  155. package/event/tms_list_item.tsx +88 -0
  156. package/event/tms_log.tsx +435 -0
  157. package/event/tms_out.tsx +91 -0
  158. package/event/tms_out_failed.tsx +135 -0
  159. package/event/tms_out_hall.tsx +143 -0
  160. package/event/tms_out_hall_failed.tsx +133 -0
  161. package/event/tms_out_hall_list.tsx +215 -0
  162. package/event/tms_out_hall_log.tsx +133 -0
  163. package/event/tms_out_hall_success.tsx +130 -0
  164. package/event/tms_out_list.tsx +118 -0
  165. package/event/tms_out_log.tsx +131 -0
  166. package/event/tms_out_success.tsx +143 -0
  167. package/event/tms_out_temporary.tsx +226 -0
  168. package/event/toggle.tsx +30 -0
  169. package/event/transaction.ts +34 -0
  170. package/event/turnstile_event_gate.tsx +2 -2
  171. package/event/turnstile_event_list.tsx +4 -4
  172. package/event/turnstile_event_ticket.tsx +4 -4
  173. package/event/turnstile_settings.tsx +11 -11
  174. package/event/turnstile_settings_otp.tsx +4 -4
  175. package/event/turnstile_settings_status.tsx +2 -2
  176. package/event/voucher.tsx +9 -10
  177. package/event/voucher_multi.tsx +4 -5
  178. package/id.json +644 -0
  179. package/package.json +1 -1
@@ -0,0 +1,439 @@
1
+ // withHooks
2
+ import { applyStyle } from 'esoftplay';
3
+ import { EventButton } from 'esoftplay/cache/event/button/import';
4
+ import { EventHeader } from 'esoftplay/cache/event/header/import';
5
+ import { EventMessage } from 'esoftplay/cache/event/message/import';
6
+ import { LibCarrousel } from 'esoftplay/cache/lib/carrousel/import';
7
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
8
+ import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
9
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
10
+ import { LibLoading } from 'esoftplay/cache/lib/loading/import';
11
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
12
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
13
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
14
+ import { LibProgress } from 'esoftplay/cache/lib/progress/import';
15
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
16
+ import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
17
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
18
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
19
+ import { EventOrder_detailProperty } from 'esoftplay/cache/event/order_detail/import';
20
+ import esp from 'esoftplay/esp';
21
+ import moment from 'esoftplay/moment';
22
+ import useSafeState from 'esoftplay/state';
23
+
24
+ import React, { useEffect } from 'react';
25
+ import { Pressable, ScrollView, Text, TouchableOpacity, View } from 'react-native';
26
+
27
+
28
+ export interface EventOrder_rescheduleArgs {
29
+
30
+ }
31
+ export interface EventOrder_rescheduleProps {
32
+
33
+ }
34
+ export default function m(props: EventOrder_rescheduleProps): any {
35
+ let { url } = LibNavigation.getArgsAll(props)
36
+ const [result, setResult] = useSafeState<any>()
37
+
38
+ const imgWidth = LibStyle.width - 30
39
+ const imgHeight = imgWidth / 1080 * 647
40
+
41
+ let defaultTabs = [
42
+ {
43
+ id: 1,
44
+ title: /*reschedule*/esp.lang("event/order_reschedule", "reschedule")
45
+ },
46
+ {
47
+ id: 2,
48
+ title: /*refund*/esp.lang("event/order_reschedule", "refund")
49
+ },
50
+ ]
51
+ const [activeTab, setActiveTab] = useSafeState<any>(1)
52
+
53
+
54
+ useEffect(() => {
55
+ loadData()
56
+ }, [])
57
+
58
+ function loadData() {
59
+ new LibCurl(url, null, (res, msg) => {
60
+ setResult(res)
61
+ }, (error) => {
62
+ LibDialog.warning(esp.lang("event/order_reschedule", "load_err"), error?.message)
63
+ }, 1)
64
+ }
65
+
66
+ function rescheduleTicket() {
67
+ let a = result.booking_list?.map?.((item: any) => item.price_type?.filter?.((item1: any) => item1.check == 1))
68
+ let _booking_ids = result.booking_list?.map?.((item: any) => {
69
+ if (item.price_type?.some((x: any) => x.check == 1)) {
70
+ return item.id
71
+ }
72
+ })
73
+
74
+ let _date_ids = []
75
+ for (let i = 0; i < a.length; i++) {
76
+ const element = a[i];
77
+ if (element)
78
+ for (let j = 0; j < element.length; j++) {
79
+ const element1 = element[j];
80
+ _date_ids.push(element1.date_id)
81
+ }
82
+ }
83
+
84
+ let filter_booking_ids = _booking_ids.filter((item: any) => item != null)
85
+
86
+ let post = {
87
+ booking_ids: JSON.stringify(filter_booking_ids),
88
+ date_ids: JSON.stringify(_date_ids)
89
+ }
90
+
91
+ if (_date_ids.length == 0) {
92
+ LibToastProperty.show(esp.lang("event/order_reschedule", "msg_error_choose_date_ticket"))
93
+ return
94
+ }
95
+
96
+ LibDialog.warningConfirm(esp.lang("event/order_reschedule", "title_alert_reschedule"), esp.lang("event/order_reschedule", "msg_confirm_want_change_date_ticket"), esp.lang("event/order_reschedule", "btn_yes_alert_reschedule"), () => {
97
+ LibProgress.show(esp.lang("event/order_reschedule", "msg_wait"))
98
+ new LibCurl('event_booking_reschedule_process', post, (res, msg) => {
99
+ LibProgress.hide()
100
+ LibNavigation.backToRoot()
101
+ LibNavigation.navigate('event/order')
102
+ LibNavigation.navigate('event/order_detail', { url: res.url })
103
+ }, (error) => {
104
+ LibProgress.hide()
105
+ LibDialog.warning(esp.lang("event/order_reschedule", "process_er"), error?.message)
106
+ }, 1)
107
+ }, esp.lang("event/order_reschedule", "btn_cancel_alert_reschedule"), () => {
108
+
109
+ })
110
+ }
111
+
112
+ function rescheduleSeat(booking_id: any, row_id: any, column_id: any, qty: any, ondate: string) {
113
+ let ondates = new Array(Number(qty)).fill(ondate).join('|')
114
+
115
+ let post = {
116
+ booking_id: booking_id,
117
+ row_id: row_id,
118
+ column_id: column_id,
119
+ ondate: ondates
120
+ }
121
+ LibProgress.show(esp.lang("event/order_reschedule", "msg_wait"))
122
+ new LibCurl("event_booking_reschedule_seat", post, (res, msg) => {
123
+ LibProgress.hide()
124
+ // setMsgReseat(res)
125
+ EventOrder_detailProperty.subscribe().trigger()
126
+ LibDialog.info(esp.lang("event/order_reschedule", "title_success_reschedule_seat"), res)
127
+ }, (error) => {
128
+ LibDialog.warning(esp.lang("event/order_reschedule", "seat_err"), error?.message)
129
+ LibProgress.hide()
130
+ }, 1)
131
+ }
132
+
133
+ function refundTicket() {
134
+ let a = result.booking_list?.filter?.((item: any) => item.check == 1)
135
+ let _booking_ids: any[] = []
136
+
137
+ for (let i = 0; i < a.length; i++) {
138
+ const element = a[i];
139
+ _booking_ids.push(element.id)
140
+ }
141
+
142
+ if (_booking_ids.length == 0) {
143
+ LibToastProperty.show(esp.lang("event/order_reschedule", "msg_error_choose_ticket"))
144
+ return
145
+ }
146
+
147
+
148
+ let post = {
149
+ booking_ids: JSON.stringify(_booking_ids),
150
+ }
151
+
152
+ LibDialog.warningConfirm(esp.lang("event/order_reschedule", "warning"), esp.lang("event/order_reschedule", "refund_ticket_purchased"), esp.lang("event/order_reschedule", "btn_yes_refund_ticket"), () => {
153
+ LibProgress.show(esp.lang("event/order_reschedule", "msg_wait"))
154
+ new LibCurl('event_booking_reschedule_refund', post, (res, msg) => {
155
+ LibProgress.hide()
156
+ LibDialog.confirm(esp.lang("event/order_reschedule", "title_success_msg"), res, esp.lang("event/order_reschedule", "ok"), () => {
157
+ LibNavigation.backToRoot()
158
+ }, "", () => { })
159
+ }, (error) => {
160
+ LibProgress.hide()
161
+ LibDialog.warning(esp.lang("event/order_reschedule", "refunc_err"), error?.message)
162
+ }, 1)
163
+ }, esp.lang("event/order_reschedule", "no"), () => {
164
+
165
+ })
166
+ }
167
+
168
+ if (!result) {
169
+ return <LibLoading />
170
+ }
171
+
172
+ if (!result?.booking_list?.length) {
173
+ return (
174
+ <View style={{ flex: 1, backgroundColor: '#fff' }}>
175
+ <EventHeader title={esp.lang("event/order_reschedule", "reschedule_or_refund_ticket")} />
176
+ <EventMessage message={esp.lang("event/order_reschedule", "no_ticket_need_reschedule_or_refund")} />
177
+ </View>
178
+ )
179
+ }
180
+
181
+ function updateResult(item: any, i: number, item1: any, i1: number) {
182
+ setResult(
183
+ LibObject.update(result, (data) => {
184
+ for (let j = 0; j < data.price_type.length; j++) {
185
+ data.price_type[j].check = i1 == j ? data.price_type[j].hasOwnProperty("check") && data.price_type[j].check == 1 ? 0 : 1 : 0
186
+ }
187
+ return { ...data }
188
+ })('booking_list', i)
189
+ )
190
+
191
+
192
+ if (item.reseat == 1) {
193
+ let data = {
194
+ event_id: result.id,
195
+ qty: item.qty,
196
+ // kenapa seperti ini, biar objeknya sama dengan di event/ticket_list
197
+ selected_ticket: {
198
+ list: {
199
+ price_id: item.price_id,
200
+ on_date: item.on_date
201
+ }
202
+ }
203
+ }
204
+
205
+ LibNavigation.navigateForResult('event/seat', {
206
+ url: 'event_seat',
207
+ dataTicket: data,
208
+ }).then((value) => {
209
+ rescheduleSeat(item.id, value.row_id, value.column_id, item.qty, item1.ondate)
210
+ })
211
+ }
212
+ }
213
+
214
+ function renderRescheduleList(item: any, i: number) {
215
+ return (
216
+ <View key={i}>
217
+ <View style={applyStyle({ backgroundColor: '#f1f2f3', padding: 14, borderTopWidth: 3, borderTopColor: '#999', marginTop: 20 })}>
218
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }} >
219
+ <Text style={applyStyle({ fontFamily: "Arial", fontSize: 12, lineHeight: 20, fontStyle: "normal", letterSpacing: 0 })} >{(item.price_name) + " (" + item.qty + " " + esp.lang("event/order_reschedule", "ticket_text")}<Text style={{ color: "orange" }} >{item.qty_shared > 0 ? esp.lang("event/order_reschedule", "shared", item?.qty_shared) : ""}</Text>{")"}</Text>
220
+
221
+ <Text style={applyStyle({ fontFamily: "Arial", fontSize: 12, lineHeight: 20, fontStyle: "normal", fontWeight: 'bold', letterSpacing: 0 })} >{LibUtils.money(item.price)}</Text>
222
+ </View>
223
+ {
224
+ item.ondate != "0000-00-00" &&
225
+ <Text style={applyStyle({ fontFamily: "Arial", fontSize: 12, lineHeight: 20, fontStyle: "normal", fontWeight: 'bold', letterSpacing: 0 })} >{esp.lang("event/order_reschedule", "date", moment(item.ondate).format("DD MMMM YYYY"))}</Text>
226
+ }
227
+ <Text style={applyStyle({ fontFamily: "Arial", fontSize: 12, lineHeight: 20, fontStyle: "normal", fontWeight: 'bold', letterSpacing: 0 })} >{esp.lang("event/order_reschedule", "select_new_date")}</Text>
228
+ </View>
229
+
230
+ {
231
+ item?.price_type?.length > 0 && item.price_type.map((item1: any, i1: number) => {
232
+ // let _selectTicket = selectedTicket == item1.date_id
233
+ let _selectTicket = item1.hasOwnProperty('check') && item1.check == 1
234
+ let bgDatePassed = item1.is_passed == 1 ? LibStyle.colorLightGrey : _selectTicket ? "#f6f6f6" : '#fff'
235
+ let opacityPassed = item1.is_passed == 1 ? 0.5 : 1
236
+
237
+ if (item1.date_id == "") {
238
+ return (
239
+ <TouchableOpacity onPress={() => {
240
+ if (item1.is_passed == 0) {
241
+ updateResult(item, i, item1, i1)
242
+ }
243
+ }} key={i1} style={applyStyle({ overflow: 'hidden', flex: 1, backgroundColor: bgDatePassed, flexDirection: 'row', justifyContent: 'space-between', padding: 10 })}>
244
+ <View style={applyStyle({ flex: 1 })}>
245
+ <Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0.23, color: _selectTicket ? "#3ea4dc" : '#999' })}>{item1.title}</Text>
246
+ <Text allowFontScaling={false} style={applyStyle({ marginTop: 4, fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : '#999' })}>{item1.subtitle}</Text>
247
+ </View>
248
+ <TouchableOpacity onPress={() => {
249
+ if (item1.is_passed == 0) {
250
+ updateResult(item, i, item1, i1)
251
+ }
252
+ }} style={applyStyle({ padding: 8, opacity: 1 })} >
253
+ <LibIcon name={_selectTicket ? "checkbox-marked-circle" : "radiobox-blank"} size={22} style={{ opacity: opacityPassed }} color={_selectTicket ? "#3ea4dc" : "#434343"} />
254
+ </TouchableOpacity>
255
+ </TouchableOpacity>
256
+ )
257
+ } else {
258
+ let ticketLeft: any = Number(item1.quota) - Number(item1.quota_used)
259
+ return (
260
+ <TouchableOpacity key={i1} onPress={() => {
261
+ if (item1.is_passed == 0) {
262
+ updateResult(item, i, item1, i1)
263
+ }
264
+ }} >
265
+ <View style={applyStyle({ overflow: 'hidden', opacity: 1, flex: 1, flexDirection: 'row', paddingLeft: 0, padding: 10, alignItems: 'center', backgroundColor: bgDatePassed })}>
266
+ <View style={applyStyle({ marginLeft: 14, marginHorizontal: 20, width: 42, height: 42, borderRadius: 5, backgroundColor: bgDatePassed, borderStyle: "solid", borderWidth: 1, borderColor: _selectTicket ? "#3ea4dc" : '#999', alignContent: 'center', alignItems: 'center', justifyContent: 'center' })}>
267
+ <Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 20, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0.23, textAlign: "center", color: _selectTicket ? "#3ea4dc" : '#999', opacity: opacityPassed })}>{LibUtils.moment(item1.ondate).format('DD')}</Text>
268
+ </View>
269
+ <View style={applyStyle({ flexDirection: 'column', flex: 1 })}>
270
+ {
271
+ item.quota > 0 && ticketLeft <= 10 &&
272
+ <Text allowFontScaling={false} style={{ opacity: item.is_refundable == 1 ? 1 : 0.5, fontFamily: "Arial", fontSize: 10, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0.23, color: LibStyle.colorRed }}>{esp.lang("event/order_reschedule", "qty_left", ticketLeft)}</Text>
273
+ }
274
+ <Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : '#999', opacity: opacityPassed })}>{LibUtils.moment(item1.ondate).format('dddd')}</Text>
275
+ <View style={applyStyle({ flexDirection: 'row' })}>
276
+ <Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : '#999', opacity: opacityPassed })}>{LibUtils.moment(item1.ondate).format('MMMM')}</Text>
277
+ <Text allowFontScaling={false} style={applyStyle({ marginLeft: 7, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : '#999', opacity: opacityPassed })}>{LibUtils.moment(item1.ondate).format('YYYY')}</Text>
278
+ </View>
279
+ </View>
280
+ <View style={applyStyle({ marginLeft: 10, flexDirection: 'column', marginRight: 6 })} >
281
+ <Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "right", color: _selectTicket ? "#3ea4dc" : '#999', opacity: opacityPassed })} >{LibUtils.money(item1.price)}</Text>
282
+ </View>
283
+
284
+ <TouchableOpacity onPress={() => {
285
+ if (item1.is_passed == 0) {
286
+ updateResult(item, i, item1, i1)
287
+ }
288
+ }} style={applyStyle({ padding: 8, opacity: 1 })} >
289
+ <LibIcon name={_selectTicket ? "checkbox-marked-circle" : "radiobox-blank"} size={22} style={{ opacity: opacityPassed }} color={_selectTicket ? "#3ea4dc" : "#434343"} />
290
+ </TouchableOpacity>
291
+
292
+ </View>
293
+ </TouchableOpacity>
294
+ )
295
+ }
296
+ })
297
+ }
298
+
299
+ </View>
300
+ )
301
+ }
302
+
303
+ function renderRefundList(item: any, i: number) {
304
+ let _selectTicket = item.hasOwnProperty('check') && item.check == 1
305
+ const styleID_12nkjf: any = { marginLeft: 10, textDecorationLine: 'line-through', textDecorationStyle: 'solid', opacity: item.is_refundable == 1 ? 1 : 0.5, marginTop: 4, fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : '#999' }
306
+ return (
307
+ <View key={i}>
308
+ <TouchableOpacity onPress={() => {
309
+ if (item.is_refundable == 1) {
310
+ setResult(
311
+ LibObject.set(result, item.hasOwnProperty('check') && item.check == 1 ? 0 : 1)('booking_list', i, "check")
312
+ )
313
+ }
314
+ }} style={{ flex: 1, backgroundColor: item.is_refundable == 1 ? '#fff' : LibStyle.colorLightGrey, flexDirection: 'row', justifyContent: 'space-between', padding: 10 }}>
315
+ <View style={applyStyle({ flex: 1 })}>
316
+ <Text style={applyStyle({ fontFamily: "Arial", fontSize: 12, lineHeight: 20, fontStyle: "normal", fontWeight: 'bold', letterSpacing: 0 })} >{esp.lang("event/order_reschedule", "ticket_date", moment(item.ondate).format("DD MMMM YYYY"))}</Text>
317
+ {item.qty_shared > 0 &&
318
+ <LibTextstyle textStyle='caption1' text={esp.lang("event/order_reschedule", "chared", item.qty_shared)} style={{ color: 'orange' }} />
319
+ }
320
+ <Text allowFontScaling={false} style={{ opacity: item.is_refundable == 1 ? 1 : 0.5, fontFamily: "Arial", fontSize: 10, marginBottom: 4, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0.23, color: LibStyle.colorRed }}>{item.refund == "0.00" ? esp.lang("event/order_reschedule", "cant_refund") : esp.lang("event/order_reschedule", "refundable", LibUtils.numberAbsolute(item.refund).toString())}</Text>
321
+ <Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : '#999' })}>{esp.lang("ticket/refund", "ticket")} {item.price_name + " (" + item.qty + " " + esp.lang("ticket/refund", "ticket") + ") "}</Text>
322
+ <View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
323
+ <Text allowFontScaling={false} style={applyStyle({ marginTop: 4, fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : '#999' })}>{LibUtils.money(item.refund == "0.00" ? item.price : item.price_cancellable)}</Text>
324
+ {
325
+ item.refund != "0.00" && item.refund != "100.00" &&
326
+ <Text allowFontScaling={false} style={styleID_12nkjf}>{LibUtils.money(item.price)}</Text>
327
+ }
328
+ </View>
329
+ </View>
330
+ <TouchableOpacity onPress={() => {
331
+ if (item.is_refundable == 1) {
332
+ setResult(
333
+ LibObject.set(result, item.hasOwnProperty('check') && item.check == 1 ? 0 : 1)('booking_list', i, "check")
334
+ )
335
+ }
336
+ }} style={applyStyle({ padding: 8, opacity: 1 })} >
337
+ <LibIcon name={_selectTicket ? "checkbox-marked-circle" : "radiobox-blank"} size={22} style={{ opacity: item.is_refundable == 1 ? 1 : 0.5 }} color={_selectTicket ? "#3ea4dc" : "#434343"} />
338
+ </TouchableOpacity>
339
+ </TouchableOpacity>
340
+ </View>
341
+ )
342
+ }
343
+
344
+ function renderImageCarousel(item1: any, i: number) {
345
+ return (
346
+ <LibPicture key={i} source={{ uri: item1.image }} style={applyStyle({ borderTopLeftRadius: 0, borderTopRightRadius: 0, height: imgHeight, width: imgWidth, resizeMode: 'cover' })} />
347
+ )
348
+ }
349
+
350
+
351
+ const dateRange = LibUtils.getDateRange(result?.start_date, result?.end_date, " - ")
352
+
353
+ return (
354
+ <View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
355
+ <EventHeader title={result?.global_refundable == 1 ? esp.lang("event/order_reschedule", "refund_rescedule") : esp.lang("event/order_reschedule", "rescedule")} />
356
+ {
357
+ result?.global_refundable == 1 &&
358
+ <View style={{ margin: 15, marginBottom: 0, flexDirection: 'row' }}>
359
+ {
360
+ defaultTabs.map((item: any, i: number) => {
361
+ return (
362
+ <Pressable onPress={() => {
363
+ setActiveTab(item.id)
364
+ }} key={i} style={{ flex: 1, padding: 10, borderTopLeftRadius: 10, borderTopRightRadius: 10, backgroundColor: item.id == activeTab ? "#fff" : LibStyle.colorBgGrey }}>
365
+ <Text allowFontScaling={false} style={{ opacity: item.id == activeTab ? 1 : 0.7, alignSelf: 'center', textAlign: 'center', fontFamily: "Arial", fontWeight: item.id == activeTab ? "bold" : "normal", fontStyle: "normal", letterSpacing: 0, color: item.id == activeTab ? "#000" : "#aab0b7" }} >{item.title}</Text>
366
+ </Pressable>
367
+ )
368
+ })
369
+ }
370
+ </View>
371
+ }
372
+
373
+ <ScrollView>
374
+ <View style={{ marginTop: result?.global_refundable == 1 ? 0 : 10, margin: 15, borderTopLeftRadius: 0, borderTopRightRadius: 0, borderRadius: 10, backgroundColor: '#fff', paddingBottom: activeTab == 2 ? 10 : 0 }}>
375
+ <LibCarrousel
376
+ delay={4000}
377
+ style={{ borderTopLeftRadius: 0, borderTopRightRadius: 0, height: imgHeight, width: imgWidth }}
378
+ autoplay
379
+ bullets
380
+ bulletStyle={{ width: 7, height: 7, backgroundColor: "#7e7e7e", borderRadius: 3.5, borderWidth: 0, marginHorizontal: 2 }}
381
+ chosenBulletStyle={{ width: 7, height: 7, backgroundColor: "white", borderRadius: 3.5, borderWidth: 0, marginHorizontal: 2 }}
382
+ bulletsContainerStyle={{ marginBottom: -15 }} >
383
+ {
384
+ result?.images.map(renderImageCarousel)
385
+ }
386
+ </LibCarrousel>
387
+ <View style={{ flexDirection: 'row', margin: 14, marginTop: 4, justifyContent: 'space-between' }}>
388
+ <Text allowFontScaling={false} style={{ marginTop: 14, fontFamily: "Arial", fontSize: 20, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{result?.title}</Text>
389
+ </View>
390
+
391
+ <View style={{ margin: 14, marginTop: 0, flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
392
+ <LibIcon name="calendar-blank-outline" size={20} />
393
+ <Text allowFontScaling={false} style={{ marginLeft: 6, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{dateRange}</Text>
394
+ </View>
395
+
396
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }} >
397
+ <View style={{ width: 19, height: 19, borderRadius: 9.5, backgroundColor: LibStyle.colorBgGrey, marginLeft: -9.5 }} />
398
+ <Text style={{ marginTop: 5, alignSelf: 'center', fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "center", color: "#f39c12" }} ></Text>
399
+ <View style={{ width: 19, height: 19, borderRadius: 9.5, backgroundColor: LibStyle.colorBgGrey, marginRight: -9.5 }} />
400
+ </View>
401
+
402
+ {/* <Text style={{ margin: 14, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0 }} >{esp.lang("event/order_reschedule", "schedule_ticket_new")}</Text> */}
403
+
404
+ {
405
+ activeTab == 2 &&
406
+ <View style={{ padding: 14, backgroundColor: '#f1f2f3' }}>
407
+ <Text style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0 }} >{esp.lang("event/order_reschedule", "ready_ticket")}</Text>
408
+ </View>
409
+ }
410
+
411
+ {
412
+ result?.booking_list?.length > 0 && result?.booking_list.map(activeTab == 1 ? renderRescheduleList : renderRefundList)
413
+ }
414
+ </View>
415
+ </ScrollView>
416
+
417
+ {
418
+ result?.is_reschedule == "1" &&
419
+ <View style={{ padding: 10, flexDirection: 'row', justifyContent: 'center' }}>
420
+ {
421
+ activeTab == 1 ?
422
+ <View style={{ width: LibStyle.width - 15 }}>
423
+ <EventButton label={esp.lang("event/order_reschedule", "reschedule_ticket")} onPress={() => {
424
+ rescheduleTicket()
425
+ }} backgroundColor="#e67e22" fontColor="#fff" />
426
+ </View>
427
+ :
428
+ <View style={{ width: LibStyle.width - 15 }}>
429
+ <EventButton label={esp.lang("event/order_reschedule", "refund_ticket")} onPress={() => {
430
+ refundTicket()
431
+ }} backgroundColor={LibStyle.colorRed} fontColor="#fff" />
432
+ </View>
433
+ }
434
+ </View>
435
+ }
436
+
437
+ </View >
438
+ )
439
+ }
@@ -0,0 +1,85 @@
1
+ // withHooks
2
+ import { applyStyle } from 'esoftplay';
3
+ import { EventButton } from 'esoftplay/cache/event/button/import';
4
+ import { EventHeader } from 'esoftplay/cache/event/header/import';
5
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
6
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
7
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
8
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
9
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
10
+ import esp from 'esoftplay/esp';
11
+ import useSafeState from 'esoftplay/state';
12
+
13
+ import React, { useEffect } from 'react';
14
+ import { Pressable, ScrollView, Text, View } from 'react-native';
15
+
16
+
17
+ export interface EventOrder_reschedule_listArgs {
18
+
19
+ }
20
+ export interface EventOrder_reschedule_listProps {
21
+
22
+ }
23
+ export default function m(props: EventOrder_reschedule_listProps): any {
24
+ let { data } = LibNavigation.getArgsAll(props)
25
+
26
+
27
+ const [selectedTicket, setSelectedTicket] = useSafeState<any>()
28
+
29
+ useEffect(() => {
30
+ return () => LibNavigation.cancelBackResult(LibNavigation.getResultKey(props))
31
+ }, [])
32
+
33
+ function renderItem(item: any, i: number) {
34
+ let _selectTicket = item.date_id == selectedTicket?.date_id
35
+ let bgDatePassed = item.is_passed == 1 ? LibStyle.colorLightGrey : _selectTicket ? "#f6f6f6" : '#fff'
36
+ let opacityPassed = item.is_passed == 1 ? 0.5 : 1
37
+
38
+
39
+
40
+ return (
41
+ <Pressable onPress={() => {
42
+ let a = {
43
+ ...item,
44
+ check: 1,
45
+ index: i
46
+ }
47
+ setSelectedTicket(a)
48
+ }} key={i} style={applyStyle({ borderRadius: 10, margin: 10, marginBottom: 0, borderWidth: 1.5, borderColor: LibStyle.colorGrey, overflow: 'hidden', backgroundColor: bgDatePassed, flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', alignContent: 'center', padding: 10 })}>
49
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
50
+ <View style={applyStyle({ marginLeft: 10, marginHorizontal: 20, width: 42, height: 42, borderRadius: 5, backgroundColor: bgDatePassed, borderStyle: "solid", borderWidth: opacityPassed, borderColor: _selectTicket ? "#3ea4dc" : '#999', alignContent: 'center', alignItems: 'center', justifyContent: 'center' })}>
51
+ <Text allowFontScaling={false} style={applyStyle({ opacity: opacityPassed, fontFamily: "Arial", fontSize: 20, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0.23, textAlign: "center", color: _selectTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(item.ondate).format('DD')}</Text>
52
+ </View>
53
+ <View style={{ flexDirection: 'column' }}>
54
+ <Text allowFontScaling={false} style={applyStyle({ opacity: opacityPassed, fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(item.ondate).format('dddd')}</Text>
55
+ <View style={applyStyle({ flexDirection: 'row' })}>
56
+ <Text allowFontScaling={false} style={applyStyle({ opacity: opacityPassed, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(item.ondate).format('MMMM')}</Text>
57
+ <Text allowFontScaling={false} style={applyStyle({ opacity: opacityPassed, marginLeft: 7, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : '#999' })}>{LibUtils.moment(item.ondate).format('YYYY')}</Text>
58
+ </View>
59
+ </View>
60
+ </View>
61
+ <LibIcon name={_selectTicket ? "checkbox-marked-circle" : "radiobox-blank"} size={22} style={{ opacity: opacityPassed }} color={_selectTicket ? "#3ea4dc" : "#434343"} />
62
+ </Pressable>
63
+ )
64
+ }
65
+
66
+ return (
67
+ <View style={{ flex: 1, backgroundColor: "#fff" }}>
68
+ <EventHeader title={esp.lang("event/order_reschedule_list", "header")} />
69
+ <ScrollView>
70
+ {
71
+ data?.price_type?.length > 0 && data?.price_type?.map(renderItem)
72
+ }
73
+ </ScrollView>
74
+
75
+ <EventButton label={esp.lang("event/order_reschedule_list", "btn")} onPress={() => {
76
+ if (!selectedTicket) {
77
+ LibToastProperty.show(esp.lang("event/order_reschedule_list", "select_date"))
78
+ } else {
79
+ LibNavigation.sendBackResult(selectedTicket)
80
+ }
81
+ }} style={{ margin: 15 }} backgroundColor={selectedTicket ? LibStyle.colorPrimary : LibStyle.colorBgGrey} fontColor="#fff" />
82
+
83
+ </View>
84
+ )
85
+ }