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,153 @@
1
+ // withHooks
2
+ import { EventHeader } from 'esoftplay/cache/event/header/import';
3
+ import { LibCollaps } from 'esoftplay/cache/lib/collaps/import';
4
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
5
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
6
+ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
7
+ import { LibScroll } from 'esoftplay/cache/lib/scroll/import';
8
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
9
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
10
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
11
+ import esp from 'esoftplay/esp';
12
+ import { useEffect } from 'react';
13
+
14
+ import { BboConfigProperty } from 'esoftplay/cache/bbo/config/import';
15
+ import { EventStep } from 'esoftplay/cache/event/step/import';
16
+ import React from 'react';
17
+ import { Text, TouchableOpacity, View } from 'react-native';
18
+
19
+ export interface EventOrder_detail_paymentProps {
20
+ data: any
21
+ }
22
+ export default function m(props: EventOrder_detail_paymentProps): any {
23
+ let data = LibNavigation.getArgs(props, 'data', props.data)
24
+ let { from, va_no, fee_topup } = LibNavigation.getArgsAll(props)
25
+
26
+ const [bboConfig] = BboConfigProperty.state().useState()
27
+
28
+ useEffect(() => {
29
+ BboConfigProperty.curlConfig('v2/config_topup_info')
30
+ }, [])
31
+
32
+ if (from == "fromTopUp") {
33
+ return (
34
+ <View style={{ flex: 1, backgroundColor: '#FFF' }}>
35
+ <EventHeader title={esp.lang("event/order_detail_payment", "topup_payment_instruction")} />
36
+ <LibScroll>
37
+ {
38
+ fee_topup != null && fee_topup != 0 &&
39
+ <>
40
+ <View style={{ marginBottom: 10, marginHorizontal: 17, marginTop: 20, flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center' }}>
41
+ <Text allowFontScaling={false} style={{ fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }}>{esp.lang("event/order_detail_payment", "fee_topup")}</Text>
42
+ <Text allowFontScaling={false} style={{ fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#FB871C" }}>{"TopUp - " + LibUtils.money(fee_topup)}</Text>
43
+ </View>
44
+ <View style={{ height: 10, flex: 1, backgroundColor: LibStyle.colorBgGrey }} />
45
+ </>
46
+ }
47
+ <View style={{ marginHorizontal: 17, marginTop: 10, paddingBottom: 5, marginBottom: 10, }} >
48
+ <Text allowFontScaling={false} style={{ fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "left", color: "#4a4a4a" }}>{esp.lang("event/order_detail_payment", "virtual_number_account")}</Text>
49
+ <View style={{ marginTop: 10, flexDirection: "row", alignItems: "center", }}>
50
+ <View style={{ flex: 1, backgroundColor: '#f1f2f3', borderRadius: 5, marginRight: 10, padding: 5 }} >
51
+ <Text allowFontScaling={false} ellipsizeMode={"middle"} numberOfLines={1} style={{ fontSize: 30, fontStyle: "normal", letterSpacing: 0, textAlign: "left", color: LibStyle.colorPrimaryDark }}>{va_no}</Text>
52
+ </View>
53
+ <TouchableOpacity onPress={() => {
54
+ LibUtils.copyToClipboard(va_no)
55
+ LibToastProperty.show(esp.lang("event/order_detail_payment", "success_copied"))
56
+ }} >
57
+ <Text allowFontScaling={false} style={{ fontSize: 14, fontStyle: "normal", fontWeight: 'bold', letterSpacing: 0, color: LibStyle.colorPrimaryDark }} >{esp.lang("event/order_detail_payment", "copy")}</Text>
58
+ </TouchableOpacity>
59
+ </View>
60
+ </View>
61
+
62
+ {
63
+ LibUtils.checkUndefined(bboConfig, 'topup_info.0') &&
64
+ <View style={{ marginHorizontal: 15, backgroundColor: '#FDF1DE', padding: 15, borderRadius: 5, borderWidth: 1, borderColor: '#FC9722' }}>
65
+ <View style={{ flexDirection: 'row', alignItems: 'center', paddingBottom: 5 }}>
66
+ <Text allowFontScaling={false} style={{ fontSize: 14, fontWeight: 'bold', letterSpacing: 0.3, paddingRight: 5 }} >{esp.lang("event/order_detail_payment", "information")}</Text>
67
+ <LibIcon.Ionicons name="information-circle" color="#FB871C" size={16} />
68
+ </View>
69
+ {
70
+ bboConfig.topup_info.map((item: any, i: number) => {
71
+ if (bboConfig.topup_info.length > 1) {
72
+ return (
73
+ <View key={i} style={{ alignItems: "flex-start", flexDirection: "row", marginRight: 10 }} >
74
+ <View style={{ width: 10, height: 10, borderRadius: 5, backgroundColor: "#FB871C", marginRight: 5, marginTop: 6 }} />
75
+ <Text allowFontScaling={false} style={{ marginTop: 5, fontSize: 12, fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }}>{item}</Text>
76
+ </View>
77
+ )
78
+ } else {
79
+ return (
80
+ <Text key={i} allowFontScaling={false} style={{ marginTop: 5, fontSize: 12, fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }}>{item}</Text>
81
+ )
82
+ }
83
+ })
84
+ }
85
+ </View>
86
+ }
87
+ <View style={{ marginTop: 10 }} />
88
+ {
89
+ Object.keys(data).map((key: any, i: number) => {
90
+ let imgBank: any = ''
91
+ let keyT = ''
92
+ if (key == "atm") {
93
+ imgBank = 'icons/ic_atm.png'
94
+ keyT = esp.lang("event/order_detail_payment", "transfer_atm_instruction")
95
+ } else if (key == "internet") {
96
+ imgBank = 'icons/ic_ibank.png'
97
+ keyT = esp.lang("event/order_detail_payment", "transfer_ibank_instruction")
98
+ } else {
99
+ imgBank = 'icons/ic_mbank.png'
100
+ keyT = esp.lang("event/order_detail_payment", "transfer_mbanking_instruction")
101
+ }
102
+ return (
103
+ <LibCollaps key={i} show={i == 2} header={(show) =>
104
+ <View style={[{ borderRadius: 5, marginVertical: 5, marginLeft: 15, marginRight: 15, padding: 12, justifyContent: 'space-between', flexDirection: 'row', backgroundColor: '#fff' }, LibStyle.elevation(2)]}>
105
+ <View style={{ flex: 7, alignContent: 'center', alignItems: 'center', flexDirection: 'row' }}>
106
+ <LibPicture source={esp.assets(imgBank)} style={{ width: 20, height: 20 }} resizeMode="cover" />
107
+ <Text allowFontScaling={false} ellipsizeMode={"middle"} numberOfLines={1} style={{ marginLeft: 10, marginRight: 10, fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "right", color: "#4a4a4a" }}>{keyT}</Text>
108
+ </View>
109
+ <LibIcon name={show ? 'chevron-up' : 'chevron-down'} color="#4a4a4a" />
110
+ </View>}>
111
+ {
112
+ data && data.atm && data[key].length > 0 && data[key].map((item: any, i: number) => {
113
+ return (
114
+ <View key={i} style={{ marginHorizontal: 15 }} >
115
+ <EventStep text={item} />
116
+ </View>
117
+ )
118
+ })
119
+ }
120
+ </LibCollaps>
121
+ )
122
+ })
123
+ }
124
+ </LibScroll>
125
+ </View>
126
+ )
127
+ }
128
+
129
+
130
+ return (
131
+ <View style={{ flex: 1, backgroundColor: '#FFF' }}>
132
+ <EventHeader title={esp.lang("event/order_detail_payment", "payment_instruction")} />
133
+ <LibScroll>
134
+ {
135
+ Object.keys(data).map((key: any, i: number) => {
136
+ return (
137
+ <View key={i} style={{ borderWidth: 1, borderColor: '#9e9e9e', marginTop: 5, margin: 20, borderTopLeftRadius: 5, borderTopRightRadius: 5, paddingBottom: 10, marginBottom: 10 }}>
138
+ <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode={"tail"} style={{ borderBottomColor: '#9e9e9e', borderBottomWidth: 1, textAlignVertical: 'center', margin: 10, fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }}>{key.toUpperCase()}</Text>
139
+ {
140
+ data && data.atm && data[key].length > 0 && data[key].map((item: any, i: number) => {
141
+ return (
142
+ <EventStep key={i} text={item} />
143
+ )
144
+ })
145
+ }
146
+ </View>
147
+ )
148
+ })
149
+ }
150
+ </LibScroll>
151
+ </View>
152
+ )
153
+ }
@@ -0,0 +1,164 @@
1
+ // withHooks
2
+ import { EventHeader } from 'esoftplay/cache/event/header/import';
3
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
4
+ import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
5
+ import { useEffect } from 'react';
6
+
7
+ import { applyStyle } from 'esoftplay';
8
+ import { EventButton } from 'esoftplay/cache/event/button/import';
9
+ import { EventMessage } from 'esoftplay/cache/event/message/import';
10
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
11
+ import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
12
+ import { LibList } from 'esoftplay/cache/lib/list/import';
13
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
14
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
15
+ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
16
+ import esp from 'esoftplay/esp';
17
+ import useSafeState from 'esoftplay/state';
18
+ import React from 'react';
19
+ import { Text, View } from 'react-native';
20
+ import Pressable from '../lib/pressable';
21
+
22
+
23
+ export interface EventOrder_detail_upgradeArgs {
24
+
25
+ }
26
+ export interface EventOrder_detail_upgradeProps {
27
+
28
+ }
29
+ export default function m(props: EventOrder_detail_upgradeProps): any {
30
+ const { dataTicket, url }: any = esp.mod("lib/navigation").getArgsAll(props)
31
+ const [selectedTicket, setSelectedTicket] = useSafeState()
32
+ const [result, setResult] = useSafeState()
33
+ const [error, setError] = useSafeState()
34
+
35
+ function loadDataUpgradeTicket() {
36
+ new LibCurl(url, null, (res: any, msg: string) => {
37
+ // setAvailableUpgrade(res?.list)
38
+ // esp.log(res);
39
+ setResult(res)
40
+ }, (err: any) => {
41
+ setError(err)
42
+ })
43
+ }
44
+
45
+
46
+ useEffect(() => {
47
+ loadDataUpgradeTicket()
48
+ }, [])
49
+
50
+ if (!result && !error) {
51
+ const LibLoading = esp.mod("lib/loading")
52
+ return <LibLoading />
53
+ }
54
+
55
+ if (error) {
56
+ return (
57
+ <View style={{ flex: 1 }} >
58
+ <EventHeader title={esp.lang("event/order_detail_upgrade", "header_title")} subtitle={dataTicket?.event_name} />
59
+ <View style={{ flex: 1 }}>
60
+ <EventMessage message={error?.message} children={
61
+ <EventButton
62
+ label='Kembali'
63
+ style={{ margin: 15, marginHorizontal: 30 }}
64
+ onPress={() => LibNavigation.back()}
65
+ />
66
+ } />
67
+ </View>
68
+ </View>
69
+ )
70
+ }
71
+
72
+ return (
73
+ <View style={{ flex: 1 }} >
74
+ <EventHeader title={esp.lang("event/order_detail_upgrade", "header_title")} subtitle={dataTicket?.event_name} />
75
+ <View style={{ flex: 1 }}>
76
+ <LibTextstyle textStyle='m_overline' text={esp.lang("event/order_detail_upgrade", "current_ticket")} style={{ fontSize: 12, margin: 15, marginBottom: 0 }} />
77
+
78
+ <View style={{ ...LibStyle.elevation(2), margin: 15, width: LibStyle.width - 30, borderRadius: 10, backgroundColor: LibStyle.colorBgGrey, padding: 10, height: 100, alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
79
+ <LibTextstyle style={{ marginHorizontal: 5, fontSize: 20, color: "#000", textAlign: 'center', fontWeight: 'bold' }} numberOfLines={2} ellipsizeMode={'tail'} textStyle='m_button' text={dataTicket?.price_name} />
80
+ <Text allowFontScaling={false} style={{ color: "#000" }}>{LibUtils.money(dataTicket.total)}</Text>
81
+
82
+ <View style={applyStyle({ flexDirection: 'row', alignItems: 'center', justifyContent: 'center', position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 })}>
83
+ <View style={applyStyle({ width: 25, height: 25, borderRadius: 12.5, backgroundColor: "#fff", marginLeft: -12.5 })} />
84
+ <View style={applyStyle({ flex: 1 })} />
85
+ <View style={applyStyle({ width: 25, height: 25, borderRadius: 12.5, backgroundColor: "#fff", marginRight: -12.5 })} />
86
+ </View>
87
+ </View>
88
+
89
+ <LibTextstyle textStyle='m_overline' text={esp.lang("event/order_detail_upgrade", "upgrade_to")} style={{ fontSize: 12, margin: 15, marginBottom: 0 }} />
90
+
91
+ <LibList
92
+ data={result?.list}
93
+ extraData={selectedTicket}
94
+ style={{ margin: 15, justifyContent: 'space-between' }}
95
+ renderItem={(item: any, i: number) => {
96
+ return (
97
+ <Pressable onPress={() => {
98
+ if (item.status == 1) {
99
+ let a = {
100
+ event_id: dataTicket?.event_id,
101
+ selected_ticket: {
102
+ ...item,
103
+ price_id: item.price_id_to,
104
+ list: {
105
+ ondate: item.ondate
106
+ },
107
+ },
108
+ qty: dataTicket?.qty_upgrade
109
+ }
110
+ setSelectedTicket(a)
111
+ } else {
112
+ LibDialog.warning(esp.lang("event/order_detail_upgrade", "oops"), item.message_error)
113
+ }
114
+ }} key={i} style={{ ...LibStyle.elevation(2), width: LibStyle.width - 35, marginLeft: 2.5, marginTop: 2.5, marginBottom: 10, borderRadius: 10, backgroundColor: item.status == 0 ? LibStyle.colorBgGrey : selectedTicket?.selected_ticket?.id == item.id ? LibStyle.colorGreen : "#fff", padding: 10, alignContent: 'center', alignItems: 'center', justifyContent: 'center' }}>
115
+ <LibTextstyle style={{ marginHorizontal: 5, fontSize: 16, color: item.status == 0 ? "#c9c9c9" : selectedTicket?.selected_ticket?.id == item.id ? "#fff" : "#000", textAlign: 'center', fontWeight: 'bold' }} numberOfLines={2} ellipsizeMode={'tail'} textStyle='m_button' text={item?.price_name_to} />
116
+ <Text allowFontScaling={false} style={{ fontSize: 14, fontWeight: 'bold', marginTop: 5, color: item.status == 0 ? "#c9c9c9" : selectedTicket?.selected_ticket?.id == item.id ? "#fff" : "#000" }}>{"+ " + LibUtils.money(Number(dataTicket?.qty_upgrade) * Number(item?.amount))}</Text>
117
+
118
+ {
119
+ item.info &&
120
+ <Text allowFontScaling={false} style={{ marginTop: 10, fontSize: 12, color: selectedTicket?.selected_ticket?.id == item.id ? "#fff" : "#c9c9c9" }}>{item.info}</Text>
121
+ }
122
+
123
+ </Pressable>
124
+ )
125
+ }}
126
+ />
127
+
128
+ </View>
129
+ <View style={{ padding: 10 }}>
130
+ <EventButton label={esp.lang("event/order_detail_upgrade", "btn_next")} onPress={() => {
131
+ if (selectedTicket) {
132
+ if (selectedTicket?.selected_ticket?.use_seat == 1 && selectedTicket?.selected_ticket?.seat_autopick == 0) {
133
+ LibNavigation.navigateForResult('event/seat_map', {
134
+ url: 'event_seat',
135
+ dataTicket: selectedTicket
136
+ }).then((value) => {
137
+ LibNavigation.navigate('event/order_detail_upgrade_payment', {
138
+ dataTicket: dataTicket,
139
+ selectedTicket: {
140
+ ...selectedTicket,
141
+ row_id: value?.row_id,
142
+ column_id: value?.column_id,
143
+ seat_name: value?.seat_name,
144
+ }
145
+ })
146
+ })
147
+ } else {
148
+ LibNavigation.navigate('event/order_detail_upgrade_payment', {
149
+ dataTicket: dataTicket,
150
+ selectedTicket: selectedTicket
151
+ })
152
+ }
153
+ } else {
154
+ LibToastProperty.show(esp.lang("event/order_detail_upgrade", "select_ticket"))
155
+ return
156
+ }
157
+ }}
158
+ backgroundColor={selectedTicket ? LibStyle.colorGreen : LibStyle.colorGrey}
159
+ fontColor='#fff'
160
+ />
161
+ </View>
162
+ </View>
163
+ )
164
+ }
@@ -0,0 +1,60 @@
1
+ // withHooks
2
+ import { LibGradient } from 'esoftplay/cache/lib/gradient/import';
3
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
4
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
5
+ import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
6
+
7
+ import esp from 'esoftplay/esp';
8
+ import React from 'react';
9
+ import { View } from 'react-native';
10
+ import Animated, {
11
+ useAnimatedStyle,
12
+ useSharedValue,
13
+ withRepeat,
14
+ withSequence,
15
+ withTiming
16
+ } from 'react-native-reanimated';
17
+ import Pressable from '../lib/pressable';
18
+
19
+
20
+ export interface EventOrder_detail_upgrade_buttonArgs {
21
+
22
+ }
23
+ export interface EventOrder_detail_upgrade_buttonProps {
24
+ onPress: () => void
25
+ }
26
+ export default function m(props: EventOrder_detail_upgrade_buttonProps): any {
27
+ const translateY = useSharedValue(0);
28
+
29
+ translateY.value = withRepeat(
30
+ withSequence(
31
+ withTiming(-5, { duration: 400 }),
32
+ withTiming(5, { duration: 400 }),
33
+ ),
34
+ -1, // -1 means repeat indefinitel
35
+ false
36
+ );
37
+
38
+ const animatedStyle = useAnimatedStyle(() => {
39
+ return {
40
+ transform: [{ translateY: translateY.value }],
41
+ };
42
+ });
43
+
44
+ return (
45
+ <Pressable onPress={() => props.onPress()} >
46
+ <LibGradient
47
+ colors={["#f1f2f3", LibStyle.colorPrimary]}
48
+ direction='left-to-right'
49
+ style={{ margin: 15, marginBottom: 0, borderRadius: 5, padding: 12, paddingVertical: 8, flexDirection: "row", justifyContent: 'space-between', alignItems: 'center', borderWidth: 1, borderColor: '#ccc' }} >
50
+ <View>
51
+ <LibTextstyle textStyle='headline' text={esp.lang("event/order_detail_upgrade_button", "upgrade")} />
52
+ <LibTextstyle textStyle='footnote' text={esp.lang("event/order_detail_upgrade_button", "eays")} />
53
+ </View>
54
+ <Animated.View style={[animatedStyle]} >
55
+ <LibIcon.Feather name='chevrons-up' size={40} />
56
+ </Animated.View>
57
+ </LibGradient>
58
+ </Pressable>
59
+ )
60
+ }
@@ -0,0 +1,221 @@
1
+ // withHooks
2
+ import { useRef } from 'react';
3
+
4
+ import { BigbangPayment_detail, BigbangPayment_detailProperty } from 'esoftplay/cache/bigbang/payment_detail/import';
5
+ import { BigbangPayment_list } from "esoftplay/cache/bigbang/payment_list/import";
6
+ import { EventButton } from "esoftplay/cache/event/button/import";
7
+ import { EventHeader } from "esoftplay/cache/event/header/import";
8
+ import { EventTransaction } from 'esoftplay/cache/event/transaction/import';
9
+ import { LibCurl } from "esoftplay/cache/lib/curl/import";
10
+ import { LibDialog } from "esoftplay/cache/lib/dialog/import";
11
+ import { LibNavigation } from "esoftplay/cache/lib/navigation/import";
12
+ import { LibProgress } from "esoftplay/cache/lib/progress/import";
13
+ import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
14
+ import { LibStyle } from "esoftplay/cache/lib/style/import";
15
+ import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
16
+ import esp from "esoftplay/esp";
17
+ import useSafeState from "esoftplay/state";
18
+ import { ScrollView, Text, View } from "react-native";
19
+
20
+
21
+
22
+ export interface EventOrder_detail_upgrade_paymentArgs {
23
+
24
+ }
25
+ export interface EventOrder_detail_upgrade_paymentProps {
26
+
27
+ }
28
+ export default function m(props: EventOrder_detail_upgrade_paymentProps): any {
29
+ const { dataTicket, selectedTicket }: any = LibNavigation.getArgsAll(props)
30
+ const [selectedPayment, setSelectedPayment] = useSafeState<any>()
31
+ const [platformFee, setPlatformFee] = useSafeState<any>()
32
+ const [charge, setCharge] = useSafeState<any>(0)
33
+ const [chargePercent, setChargePercent] = useSafeState<any>()
34
+
35
+ const [trxId] = useSafeState(EventTransaction().getTrxId())
36
+ const scrollRef = useRef<ScrollView>(null)
37
+ const scrollYRef = useRef(0)
38
+ const dialogSeat = useRef<LibSlidingup>(null)
39
+
40
+ function doUpgrade(pin?: any) {
41
+ const LibToastProperty = esp.modProp("lib/toast")
42
+ if (!selectedPayment) {
43
+ LibToastProperty.show(esp.lang("event/order_detail_upgrade_payment", "empty_method"))
44
+ return
45
+ }
46
+
47
+ LibDialog.confirm(esp.lang("event/order_detail_upgrade_payment", "confirm_title"), esp.lang("event/order_detail_upgrade_payment", "confirm_msg", dataTicket?.price_name, selectedTicket?.selected_ticket?.price_name_to), esp.lang("event/order_detail_upgrade_payment", "confirm_ok"), () => {
48
+ let post = {
49
+ booking_id: dataTicket?.id,
50
+ price_id_to: selectedTicket?.selected_ticket?.price_id_to,
51
+ trx_id: trxId,
52
+ payment_id: selectedPayment?.payment_id,
53
+ ...selectedPayment
54
+ }
55
+
56
+ if (selectedTicket?.selected_ticket?.use_seat == 1) {
57
+ post.row_id = selectedTicket?.row_id
58
+ post.column_id = selectedTicket?.column_id
59
+ post.seat_name = selectedTicket?.seat_name
60
+ }
61
+
62
+ if (selectedTicket?.selected_ticket?.seat_autopick == 1) {
63
+ post.adjacent_seats = 1
64
+ }
65
+
66
+ if (selectedPayment?.payment_id == 2) {
67
+ post.pin = pin
68
+ }
69
+ LibProgress.show(esp.lang("event/order_detail_upgrade_payment", "confirm_wait"))
70
+ new LibCurl('event_order_detail_upgrade_checkout', post, (res, msg) => {
71
+ esp.log({ post });
72
+ LibProgress.hide()
73
+ LibNavigation.reset()
74
+ if (selectedPayment?.payment_id == 2) /* bbo pay */ {
75
+ LibToastProperty.show(msg)
76
+ LibNavigation.navigate('event/order_detail', { url: res?.url })
77
+ } else if (selectedPayment?.payment_id == 3)/* cc */ {
78
+ LibNavigation.navigateForResult('payment/cc_web', {
79
+ ...res,
80
+ statusSuccess: [1]
81
+ }).then((res) => {
82
+ LibNavigation.push('user/profile')
83
+ if (res?.hasOwnProperty('params_error') || res?.hasOwnProperty('failed')) {
84
+ LibNavigation.push('event/order_waiting')
85
+ LibNavigation.push('event/order_detail_waiting', { url: res?.url })
86
+ } else {
87
+ LibNavigation.push('event/order')
88
+ }
89
+ })
90
+ } else {
91
+ LibNavigation.navigate('event/order_detail_waiting', { url: res?.url })
92
+ }
93
+ }, (err) => {
94
+ LibProgress.hide()
95
+ LibDialog.warning(esp.lang("event/order_detail_upgrade_payment", "oops"), err?.message)
96
+ })
97
+
98
+ }, esp.lang("event/order_detail_upgrade_payment", "confirm_no"), () => { })
99
+
100
+ }
101
+
102
+
103
+ function percentageCalculator(amount: any, percent: any) {
104
+ return (percent * amount) / 100
105
+ }
106
+
107
+ let amount = Number(selectedTicket?.selected_ticket?.amount) * Number(dataTicket?.qty_upgrade)
108
+ let _tax = percentageCalculator(amount, dataTicket?.tax_event)
109
+ let subtotalWithTax = amount + _tax
110
+
111
+ let _fee_platform_type = platformFee?.fee_platform_type
112
+ let _fee_platform = _fee_platform_type == "NOMINAL" ? Number(platformFee?.fee_platform_amount || 0) : _fee_platform_type == "PERCENTAGE" ? percentageCalculator(amount, Number(platformFee?.fee_platform_amount || 0)) : 0
113
+
114
+ let subtotalWithTaxWithFeePlatform = subtotalWithTax + _fee_platform
115
+
116
+ let _charge = amount == 0 ? 0 : Number(charge)
117
+ let _charge_percent = chargePercent == 0 ? 0 : percentageCalculator(subtotalWithTaxWithFeePlatform, chargePercent)
118
+ let _charge_total = chargePercent ? _charge + _charge_percent : _charge
119
+
120
+ let _amountTotal = Number(subtotalWithTaxWithFeePlatform) + Number(_charge_total)
121
+
122
+ function renderSeatItem(item: any, i: number) {
123
+ return (
124
+ <View key={i} style={{ margin: 10, marginBottom: 0, marginRight: 5, marginLeft: 5, height: 32, width: 32, backgroundColor: LibStyle.colorBlue, borderWidth: 1, borderColor: LibStyle.colorBlue, borderRadius: 4, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
125
+ <Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{item}</Text>
126
+ </View>
127
+ )
128
+ }
129
+
130
+ return (
131
+ <View style={{ flex: 1, backgroundColor: '#fff' }}>
132
+ <EventHeader title={esp.lang("event/order_detail_upgrade_payment", "header_title")} />
133
+ <ScrollView ref={scrollRef} stickyHeaderIndices={[0]} scrollEventThrottle={16} onScroll={({ nativeEvent }) => {
134
+ const currentYPosition = nativeEvent.contentOffset.y
135
+ const oldPosition = scrollYRef.current
136
+
137
+ if (currentYPosition >= (LibStyle.height * 0.3)) {
138
+ if (oldPosition == 0) {
139
+ scrollYRef.current = nativeEvent.contentOffset.y
140
+ BigbangPayment_detailProperty.stateShow.set(false)
141
+ }
142
+ }
143
+ }}>
144
+ {/* detail */}
145
+
146
+ <View style={{ backgroundColor: 'white' }}>
147
+ <BigbangPayment_detail
148
+ ondate={dataTicket?.ondate}
149
+ // onlyBboPay={bboPay}
150
+ order_type={14}
151
+ priceTotal={amount}
152
+ charge={charge}
153
+ fee_platform_type={platformFee?.fee_platform_type}
154
+ fee_platform_amount={platformFee?.fee_platform_amount}
155
+ charge_percent={chargePercent}
156
+ // typeTicket={dataBookingEvent?.selected_ticket?.type}
157
+ currency={selectedTicket?.selected_ticket?.currency}
158
+ qty={dataTicket?.qty_upgrade}
159
+ tax={dataTicket?.tax_event}
160
+ name_seat={selectedTicket?.seat_name}
161
+ onPressSeat={() => {
162
+ dialogSeat.current?.show()
163
+ }}
164
+ title={esp.lang("event/order_detail_upgrade_payment", "upgrade_to", dataTicket?.price_name, selectedTicket?.selected_ticket?.price_name_to)}
165
+ event_name={dataTicket?.event_title} />
166
+ </View>
167
+
168
+
169
+ <BigbangPayment_list
170
+ eventId={dataTicket?.event_id}
171
+ onToggleCC={() => { scrollRef.current?.scrollToEnd({ animated: true }) }}
172
+ order_type={14} // upgrade ticekt
173
+ currency={selectedTicket?.selected_ticket?.currency}
174
+ onPressPayment={(item: any) => {
175
+ let payment = {
176
+ ...item,
177
+ payment_id: Number(item.id),
178
+ payment_type: Number(item.type),
179
+ }
180
+ setSelectedPayment(payment)
181
+ setPlatformFee({ fee_platform_type: item?.fee_platform_type || 'NONE', fee_platform_amount: item?.fee_platform_amount || 0 })
182
+ setCharge(item.charge)
183
+ setChargePercent(item.charge_percent)
184
+ }}
185
+ paymentId={selectedPayment?.payment_id}
186
+ priceTotal={Number(_amountTotal)}
187
+ chargeTotal={_charge_total}
188
+ />
189
+ </ScrollView>
190
+ <View style={{ padding: 10 }}>
191
+ <EventButton label={esp.lang("event/order_detail_upgrade_payment", "pay")} onPress={() => {
192
+ if (selectedPayment?.payment_id == 2) /* BBO PAY */ {
193
+ LibNavigation.navigateForResult("bigbang/payment_pin", undefined, 1132).then((p) => {
194
+ if (p) {
195
+ doUpgrade(p)
196
+ }
197
+ })
198
+ } else {
199
+ doUpgrade()
200
+ }
201
+ }}
202
+ fontColor='#fff'
203
+ backgroundColor={selectedPayment ? "#00b894" : LibStyle.colorBgGrey}
204
+ />
205
+ </View>
206
+ {/* ini dialog seat */}
207
+ <LibSlidingup ref={dialogSeat}>
208
+ <View style={{ backgroundColor: 'white', padding: 20 }} >
209
+ <LibTextstyle text={esp.lang("bigbang/payment", "text_seat")} textStyle="headline" />
210
+ <ScrollView >
211
+ <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
212
+ {
213
+ selectedTicket?.seat_name?.map(renderSeatItem)
214
+ }
215
+ </View>
216
+ </ScrollView>
217
+ </View>
218
+ </LibSlidingup>
219
+ </View>
220
+ )
221
+ }