esoftplay-event 0.0.2 → 0.0.3
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.
- package/event/additional.tsx +1 -1
- package/event/additional_input.tsx +15 -0
- package/event/additional_new.tsx +565 -0
- package/event/artist.tsx +14 -34
- package/event/artist_detail.tsx +336 -239
- package/event/artist_detail_multi.tsx +266 -157
- package/event/artist_detailv2.tsx +129 -69
- package/event/artistv2.tsx +5 -13
- package/event/button.tsx +2 -2
- package/event/button_order_detail.tsx +20 -8
- package/event/capture.tsx +2 -0
- package/event/checkout.ts +135 -0
- package/event/countdown.tsx +13 -9
- package/event/countdown_base.tsx +88 -48
- package/event/countdown_event.tsx +3 -0
- package/event/countdown_timestamp.tsx +106 -0
- package/event/coupon.tsx +1 -1
- package/event/coupon_generate.tsx +35 -22
- package/event/detail.tsx +9 -15
- package/event/detail2.tsx +63 -61
- package/event/dialog_custom.tsx +67 -0
- package/event/exchange_ticket_list.tsx +23 -14
- package/event/exchange_ticket_result.tsx +1 -1
- package/event/firebase_socket.ts +14 -12
- package/event/htmltext.tsx +40 -28
- package/event/index.tsx +8 -2
- package/event/label_input.tsx +2 -2
- package/event/layout.tsx +312 -0
- package/event/loading_page.tsx +62 -82
- package/event/message.tsx +2 -2
- package/event/order_detail.tsx +408 -477
- package/event/order_detail_addons.tsx +60 -0
- package/event/order_detail_addons_booked.tsx +61 -0
- package/event/order_detail_coupon.tsx +66 -0
- package/event/order_detail_instruction.tsx +96 -0
- package/event/order_detail_payment.tsx +1 -1
- package/event/order_detail_reschedule.tsx +109 -0
- package/event/order_detail_return.tsx +231 -0
- package/event/order_detail_review.tsx +174 -0
- package/event/order_detail_share.tsx +304 -0
- package/event/order_detail_tnc.tsx +76 -0
- package/event/order_detail_upgrade.tsx +140 -90
- package/event/order_detail_upgrade_payment.tsx +120 -38
- package/event/order_detail_visitor.tsx +21 -10
- package/event/order_detail_waiting.tsx +3 -3
- package/event/order_history.tsx +1 -1
- package/event/order_item.tsx +1 -1
- package/event/order_lottery.tsx +1 -1
- package/event/order_reschedule.tsx +29 -16
- package/event/order_share_to.tsx +14 -0
- package/event/order_waiting.tsx +1 -1
- package/event/payment_subscribe.tsx +18 -0
- package/event/point_events.tsx +35 -0
- package/event/point_redemption.tsx +101 -0
- package/event/point_redemption_exchange.tsx +60 -0
- package/event/point_redemption_input.tsx +56 -0
- package/event/point_redemption_success.tsx +50 -0
- package/event/point_summary.tsx +48 -0
- package/event/popup.tsx +4 -4
- package/event/queue.tsx +111 -0
- package/event/queue_pricing.tsx +17 -6
- package/event/review_add.tsx +2 -2
- package/event/scan_item.tsx +1 -1
- package/event/schedule.tsx +33 -30
- package/event/schedule2.tsx +86 -0
- package/event/seat.tsx +135 -374
- package/event/seat_map.tsx +8 -8
- package/event/seat_map_new.tsx +211 -38
- package/event/step.tsx +1 -1
- package/event/test.tsx +8 -8
- package/event/ticket.tsx +326 -0
- package/event/ticket_list.tsx +316 -258
- package/event/ticket_list2.tsx +349 -224
- package/event/ticket_list_item.tsx +61 -0
- package/event/ticket_list_new.tsx +710 -0
- package/event/tms_add_result.tsx +10 -5
- package/event/tms_check_ticket_result.tsx +16 -7
- package/event/tms_dashboard.tsx +87 -12
- package/event/tms_gate.tsx +32 -15
- package/event/tms_home.tsx +178 -92
- package/event/tms_idcard.tsx +43 -26
- package/event/tms_in.tsx +2 -3
- package/event/tms_in_failed.tsx +1 -1
- package/event/tms_in_hall.tsx +4 -1
- package/event/tms_in_hall_failed.tsx +36 -16
- package/event/tms_in_log.tsx +9 -11
- package/event/tms_in_success.tsx +13 -8
- package/event/tms_log.tsx +16 -17
- package/event/tms_out_hall_failed.tsx +1 -1
- package/event/tms_out_temporary.tsx +3 -4
- package/event/token_order.tsx +103 -0
- package/event/token_payment.tsx +79 -0
- package/event/visitor_index.tsx +60 -49
- package/event/visitor_input.tsx +336 -54
- package/event/visitor_inputv2.tsx +173 -88
- package/event/voucher.tsx +1 -1
- package/id.json +76 -4
- package/package.json +1 -1
- package/event/secure_page.debug.tsx +0 -34
- package/event/secure_page.live.tsx +0 -35
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
import { applyStyle } from 'esoftplay';
|
|
3
|
+
import { EventRating } from 'esoftplay/cache/event/rating/import';
|
|
4
|
+
import { EventReviewProperty } from 'esoftplay/cache/event/review/import';
|
|
5
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
6
|
+
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
7
|
+
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
8
|
+
import { UserClass } from 'esoftplay/cache/user/class/import';
|
|
9
|
+
import esp from 'esoftplay/esp';
|
|
10
|
+
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import { Pressable, Text, View } from 'react-native';
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export interface EventOrder_detail_reviewArgs {
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
export interface EventOrder_detail_reviewProps {
|
|
19
|
+
dataReview: any
|
|
20
|
+
dataTicket: any
|
|
21
|
+
}
|
|
22
|
+
export default function m(props: EventOrder_detail_reviewProps): any {
|
|
23
|
+
const [user] = UserClass.state().useState()
|
|
24
|
+
const dataReview = props.dataReview
|
|
25
|
+
const result = props.dataTicket
|
|
26
|
+
|
|
27
|
+
let startEvent = result?.start_date + " " + result?.start_time
|
|
28
|
+
let dateNow = LibUtils.moment().localeFormat("YYYY-MM-DD HH:mm")
|
|
29
|
+
|
|
30
|
+
function getStringReview(data: any) {
|
|
31
|
+
const groupedData = data.reduce((acc: any[], obj: any) => {
|
|
32
|
+
const { survey_id, survey_question, survey_option, content } = obj;
|
|
33
|
+
|
|
34
|
+
if (!acc[survey_id]) {
|
|
35
|
+
acc[survey_id] = {
|
|
36
|
+
survey_id,
|
|
37
|
+
survey_question,
|
|
38
|
+
values: []
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (survey_option) {
|
|
43
|
+
acc[survey_id].values.push(survey_option);
|
|
44
|
+
}
|
|
45
|
+
if (content) {
|
|
46
|
+
acc[survey_id].values.push(content);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return acc;
|
|
50
|
+
}, {});
|
|
51
|
+
|
|
52
|
+
const finalResult = Object.values(groupedData).map((group: any) => {
|
|
53
|
+
const { survey_question, values } = group;
|
|
54
|
+
const valuesString = values.join(", ");
|
|
55
|
+
return `\nQ: ${survey_question}\nA: ${valuesString}`;
|
|
56
|
+
})
|
|
57
|
+
return finalResult
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
const ReviewCard = ({ user, dataReview }: any) => {
|
|
62
|
+
return (
|
|
63
|
+
<View style={{ margin: 15, marginBottom: 0, borderRadius: 7, backgroundColor: 'white', padding: 10 }}>
|
|
64
|
+
<View style={{ flexDirection: 'row', alignItems: 'flex-start', marginTop: 10 }}>
|
|
65
|
+
<LibPicture source={{ uri: user?.image }} style={{ height: 50, width: 50, borderRadius: 25 }} />
|
|
66
|
+
<View style={{ marginLeft: 10, flex: 1 }}>
|
|
67
|
+
<Text allowFontScaling={false} numberOfLines={1} ellipsizeMode='tail' style={{ fontSize: 16, fontWeight: 'bold' }}>{user?.name}</Text>
|
|
68
|
+
<Text allowFontScaling={false} style={{ fontSize: 12, color: '#c9c9c9' }}>{LibUtils.moment(dataReview?.review?.created).localeFormat("D MMM YYYY")}</Text>
|
|
69
|
+
<View style={{ marginTop: 5 }}>
|
|
70
|
+
<EventRating disabled onChangeRating={() => { }} defaultValue={dataReview?.review?.rating} size={18} containerStyle={{ padding: 0, justifyContent: 'flex-start' }} />
|
|
71
|
+
{
|
|
72
|
+
dataReview?.review?.content != "" &&
|
|
73
|
+
<Text allowFontScaling={false} style={{ marginTop: 10, fontSize: 12, color: '#000' }}>{dataReview?.review?.content.replace(/\\n/g, '\n')}</Text>
|
|
74
|
+
}
|
|
75
|
+
{
|
|
76
|
+
dataReview?.surveys?.length > 0 &&
|
|
77
|
+
getStringReview(dataReview?.surveys).map((sur) => (
|
|
78
|
+
<Text allowFontScaling={false} style={{ fontSize: 12, color: '#000' }}>{sur}</Text>
|
|
79
|
+
))
|
|
80
|
+
}
|
|
81
|
+
</View>
|
|
82
|
+
</View>
|
|
83
|
+
</View>
|
|
84
|
+
{
|
|
85
|
+
dataReview?.status == 2 &&
|
|
86
|
+
<View style={applyStyle({ borderColor: '#FC9722', backgroundColor: '#FDF1DE', borderWidth: 1, borderStyle: 'dashed', borderRadius: 5, padding: 5, marginTop: 15, marginBottom: 0 })} >
|
|
87
|
+
<Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 12, fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" })}>{esp.lang("event/order_detail", "thanks")}</Text>
|
|
88
|
+
</View>
|
|
89
|
+
}
|
|
90
|
+
</View>
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const ReviewForm = ({ result, onRate }: any) => {
|
|
95
|
+
return (
|
|
96
|
+
<Pressable>
|
|
97
|
+
<EventRating
|
|
98
|
+
onChangeRating={onRate}
|
|
99
|
+
defaultValue={5}
|
|
100
|
+
size={50}
|
|
101
|
+
containerStyle={{ padding: 0, backgroundColor: 'transparent' }}
|
|
102
|
+
/>
|
|
103
|
+
<Text style={{ alignSelf: 'center', marginTop: 15, fontSize: 18, fontWeight: 'bold', color: '#fff' }}>{esp.lang("event/order_detail", "leave_review")}</Text>
|
|
104
|
+
<Text style={{ alignSelf: 'center', marginTop: 7, fontSize: 14, color: '#fff' }}>{esp.lang("event/order_detail", "review_info")}</Text>
|
|
105
|
+
</Pressable>
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const ReviewedResult = ({ user, dataReview }: any) => {
|
|
110
|
+
return (
|
|
111
|
+
<View style={{ margin: -10, backgroundColor: '#fff', padding: 10, borderRadius: 7 }}>
|
|
112
|
+
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
113
|
+
<LibPicture source={{ uri: user?.image }} style={{ height: 50, width: 50, borderRadius: 25 }} />
|
|
114
|
+
<View style={{ marginLeft: 10 }}>
|
|
115
|
+
<Text numberOfLines={1} style={{ fontSize: 16, fontWeight: 'bold' }}>{user?.name}</Text>
|
|
116
|
+
<Text style={{ fontSize: 12, color: '#c9c9c9' }}>{LibUtils.moment(dataReview?.review?.created).localeFormat("D MMM YYYY")}</Text>
|
|
117
|
+
<EventRating
|
|
118
|
+
disabled
|
|
119
|
+
defaultValue={dataReview?.review?.rating}
|
|
120
|
+
onChangeRating={() => { }}
|
|
121
|
+
size={18}
|
|
122
|
+
containerStyle={{ padding: 0 }}
|
|
123
|
+
/>
|
|
124
|
+
</View>
|
|
125
|
+
</View>
|
|
126
|
+
<Text numberOfLines={5} style={{ marginTop: 10, fontSize: 12 }}>{dataReview?.review?.content}</Text>
|
|
127
|
+
</View>
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<View>
|
|
133
|
+
{
|
|
134
|
+
dataReview?.status == 1 &&
|
|
135
|
+
<ReviewCard
|
|
136
|
+
user={user}
|
|
137
|
+
dataReview={dataReview}
|
|
138
|
+
/>
|
|
139
|
+
}
|
|
140
|
+
{
|
|
141
|
+
dataReview?.status != 1 && dateNow > startEvent && (
|
|
142
|
+
<View style={{ margin: 15, borderRadius: 7, backgroundColor: '#000', padding: 10 }}>
|
|
143
|
+
{
|
|
144
|
+
dataReview?.review == null ?
|
|
145
|
+
<ReviewForm
|
|
146
|
+
result={result}
|
|
147
|
+
onRate={(rate: any) => {
|
|
148
|
+
let type = EventReviewProperty.calculateProb(result?.config?.review)
|
|
149
|
+
let args = {
|
|
150
|
+
url_form: "event_order_detail_review_form?id=" + result?.id + "&type=" + type?.type,
|
|
151
|
+
type: type?.type,
|
|
152
|
+
booking_id: result?.id,
|
|
153
|
+
rate: rate
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (result?.review_status != 1) {
|
|
157
|
+
LibNavigation.navigate('event/review_add', args)
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
}}
|
|
161
|
+
/>
|
|
162
|
+
:
|
|
163
|
+
<ReviewedResult
|
|
164
|
+
user={user}
|
|
165
|
+
dataReview={dataReview}
|
|
166
|
+
/>
|
|
167
|
+
}
|
|
168
|
+
</View>
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
</View>
|
|
173
|
+
)
|
|
174
|
+
}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
import { EventButton } from 'esoftplay/cache/event/button/import';
|
|
3
|
+
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
4
|
+
import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
|
|
5
|
+
import { EventInput_rectangle } from 'esoftplay/cache/event/input_rectangle/import';
|
|
6
|
+
import { EventOrder_detailProperty } from 'esoftplay/cache/event/order_detail/import';
|
|
7
|
+
import { EventTransaction } from 'esoftplay/cache/event/transaction/import';
|
|
8
|
+
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
9
|
+
import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
|
|
10
|
+
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
11
|
+
import { LibKeyboard_avoid } from 'esoftplay/cache/lib/keyboard_avoid/import';
|
|
12
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
13
|
+
import { LibObject } from 'esoftplay/cache/lib/object/import';
|
|
14
|
+
import { LibPicture } from 'esoftplay/cache/lib/picture/import';
|
|
15
|
+
import { LibProgress } from 'esoftplay/cache/lib/progress/import';
|
|
16
|
+
import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
|
|
17
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
18
|
+
import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
|
|
19
|
+
import { LibUtils } from 'esoftplay/cache/lib/utils/import';
|
|
20
|
+
import { UserClass } from 'esoftplay/cache/user/class/import';
|
|
21
|
+
import esp from 'esoftplay/esp';
|
|
22
|
+
import useSafeState from 'esoftplay/state';
|
|
23
|
+
import { useEffect, useRef } from 'react';
|
|
24
|
+
|
|
25
|
+
import React from 'react';
|
|
26
|
+
import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
export interface EventOrder_detail_shareArgs {
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
export interface EventOrder_detail_shareProps {
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
export default function m(props: EventOrder_detail_shareProps): any {
|
|
36
|
+
const { url } = LibNavigation.getArgsAll(props)
|
|
37
|
+
const user = UserClass.state().get()
|
|
38
|
+
let inputEmail = React.useRef<EventInput_rectangle>(null)
|
|
39
|
+
const dialogTickets = useRef<LibSlidingup>(null)
|
|
40
|
+
const [email, setEmail] = useSafeState<string>('')
|
|
41
|
+
const [trxId] = useSafeState(EventTransaction().getTrxId())
|
|
42
|
+
|
|
43
|
+
const [result, setResult] = useSafeState<any>()
|
|
44
|
+
const [dataTicket, setDataTicket] = useSafeState()
|
|
45
|
+
const [useAll, setUseAll] = useSafeState<boolean>(false)
|
|
46
|
+
const [dataUser, setDataUser] = useSafeState<any>()
|
|
47
|
+
|
|
48
|
+
function loadData(): void {
|
|
49
|
+
new LibCurl(url, null, (res) => {
|
|
50
|
+
setResult(res)
|
|
51
|
+
if (res?.hasOwnProperty('url_share')) {
|
|
52
|
+
loadDataTicket(res?.url_share, res?.price_name)
|
|
53
|
+
}
|
|
54
|
+
}, (error) => {
|
|
55
|
+
LibDialog.warning(esp.lang("event/order_share_to", "load_error"), error?.message);
|
|
56
|
+
LibNavigation.back()
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function loadDataTicket(url: any, price_name: string) {
|
|
61
|
+
new LibCurl(url, null, (res) => {
|
|
62
|
+
let data = res?.length > 0 && res?.map((item: any, i: number) => {
|
|
63
|
+
return ({
|
|
64
|
+
...item,
|
|
65
|
+
checked: i == 0 ? 1 : 0,
|
|
66
|
+
price_name: price_name
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
// esp.log({ data });
|
|
70
|
+
setDataTicket(data)
|
|
71
|
+
}, (error) => {
|
|
72
|
+
LibDialog.warning(esp.lang("event/order_share_to", "load_error"), error?.message);
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
loadData()
|
|
79
|
+
}, [])
|
|
80
|
+
|
|
81
|
+
function loadDataUser(qr?: string) {
|
|
82
|
+
let post: any = {
|
|
83
|
+
email: email || ""
|
|
84
|
+
}
|
|
85
|
+
if (qr) {
|
|
86
|
+
post.qr = qr
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
new LibCurl("user_search", post, (res) => {
|
|
90
|
+
setDataUser(res)
|
|
91
|
+
LibUtils.debounce(() => {
|
|
92
|
+
dialogTickets?.current?.show()
|
|
93
|
+
}, 200)
|
|
94
|
+
}, (error) => {
|
|
95
|
+
LibDialog.warning(esp.lang("event/order_share_to", "load_error"), error?.message);
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function shareTicket(p: any) {
|
|
101
|
+
|
|
102
|
+
LibDialog.warningConfirm(esp.lang("event/order_share_to", "title_alert_share_ticket"), esp.lang("event/order_share_to", "msg_alert_share_ticket"), esp.lang("event/order_share_to", "btn_yes_alert_share_ticket"), () => {
|
|
103
|
+
let seatName = dataTicket?.filter((item: any) => item.checked == 1).map((it: any) => it.seat_name)
|
|
104
|
+
let hasSeat = seatName?.some((v: any) => v.trim())
|
|
105
|
+
let _bookingMemberId = dataTicket?.filter((item: any) => item.checked == 1).map((it: any) => it.id)
|
|
106
|
+
|
|
107
|
+
let post: any = {
|
|
108
|
+
receiver_email: dataUser?.email,
|
|
109
|
+
booking_id: result?.booking_id,
|
|
110
|
+
qty_shared: dataTicket?.filter((item: any) => item.checked == 1).length,
|
|
111
|
+
booking_member_id: _bookingMemberId.join('|'),
|
|
112
|
+
trx_id: trxId,
|
|
113
|
+
pin: p
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (hasSeat) {
|
|
117
|
+
post.seat_name = seatName?.join('|')
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
LibProgress.show(esp.lang("event/order_share_to", "msg_wait"))
|
|
121
|
+
new LibCurl('event_booking_shared?id=' + result?.event_id, post, (res, msg) => {
|
|
122
|
+
// LibNotify(result)
|
|
123
|
+
EventOrder_detailProperty.subscribe().trigger()
|
|
124
|
+
EventIndexProperty.reload.trigger() //reload data order
|
|
125
|
+
LibProgress.hide()
|
|
126
|
+
LibDialog.info(esp.lang("event/order_share_to", "title_curl_success"), msg)
|
|
127
|
+
LibNavigation.back()
|
|
128
|
+
}, (error) => {
|
|
129
|
+
LibProgress.hide()
|
|
130
|
+
LibDialog.warning(esp.lang("event/order_share_to", "share_error"), error?.message);
|
|
131
|
+
LibNavigation.back()
|
|
132
|
+
}, 1)
|
|
133
|
+
}, esp.lang("event/order_share_to", "btn_cancel_alert_share_ticket"), () => {
|
|
134
|
+
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
let checkNotUsed = dataTicket?.length > 0 && dataTicket?.filter((x: any) => x?.checked == 0)
|
|
139
|
+
let valid = dataTicket?.some((item: any) => item.checked == 1);
|
|
140
|
+
|
|
141
|
+
return (
|
|
142
|
+
<LibKeyboard_avoid style={{ flex: 1, backgroundColor: '#fff' }}>
|
|
143
|
+
<EventHeader title={esp.lang("event/order_share_to", "title_share_ticket_to", esp.appjson().expo.name)} />
|
|
144
|
+
<ScrollView showsVerticalScrollIndicator={false} >
|
|
145
|
+
<TouchableOpacity onPress={() => {
|
|
146
|
+
LibNavigation.navigateForResult('component/scanner').then((value: any) => {
|
|
147
|
+
loadDataUser(value)
|
|
148
|
+
// esp.log(value);
|
|
149
|
+
})
|
|
150
|
+
}}>
|
|
151
|
+
<View style={{ width: LibStyle.width, height: LibStyle.height * 0.5, backgroundColor: '#b8b7bf', justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
|
|
152
|
+
<LibPicture source={esp.assets('icons/ic_barcode_white.png')} style={{ height: 250, width: 250 }} />
|
|
153
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "center", marginTop: 10, color: '#fff' }}>{esp.lang("event/order_share_to", "click_here")}</Text>
|
|
154
|
+
<Text allowFontScaling={false} style={{ color: '#fff', fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "center", marginTop: 6 }}>{esp.lang("event/order_share_to", "scan_qrcode")}</Text>
|
|
155
|
+
<Text allowFontScaling={false} style={{ color: '#fff', fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, textAlign: "center", marginTop: 5 }}>{esp.lang("event/order_share_to", "in_member_bbo_page", esp.appjson().expo.name)}</Text>
|
|
156
|
+
</View>
|
|
157
|
+
</TouchableOpacity>
|
|
158
|
+
<Text allowFontScaling={false} style={{ opacity: 0.6, fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, textAlign: "center", marginTop: 17 }}>{esp.lang("event/order_share_to", "or")}</Text>
|
|
159
|
+
<EventInput_rectangle
|
|
160
|
+
ref={inputEmail}
|
|
161
|
+
keyboardType="email-address"
|
|
162
|
+
placeholder={esp.lang("event/order_share_to", "placeholder_input_email")}
|
|
163
|
+
autoCapitalize="none"
|
|
164
|
+
onChangeText={(t) => {
|
|
165
|
+
setEmail(t)
|
|
166
|
+
}}
|
|
167
|
+
style={{ marginLeft: 25, marginRight: 25, marginTop: 18, borderRadius: 5 }} />
|
|
168
|
+
<TouchableOpacity onPress={() => {
|
|
169
|
+
if (inputEmail.current?.getText() == '') {
|
|
170
|
+
LibToastProperty.show(esp.lang("event/order_share_to", "msg_error_input_email"))
|
|
171
|
+
inputEmail.current?.blur()
|
|
172
|
+
return
|
|
173
|
+
} else if (email === user.email) {
|
|
174
|
+
LibDialog.warningConfirm(esp.lang("event/order_share_to", "title_alert_fault"), esp.lang("event/order_share_to", "msg_alert_cant_share_ticket_to_myself"), esp.lang("event/order_share_to", "btn_yes_alert_cant_share_ticket_to_myself"), () => {
|
|
175
|
+
setEmail("")
|
|
176
|
+
inputEmail.current?.setText("")
|
|
177
|
+
inputEmail.current?.focus()
|
|
178
|
+
}, "", () => {
|
|
179
|
+
|
|
180
|
+
})
|
|
181
|
+
} else {
|
|
182
|
+
loadDataUser()
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// dialogTickets.current?.show()
|
|
186
|
+
}} >
|
|
187
|
+
<View style={{ marginBottom: 10, marginTop: 18, marginLeft: 25, marginRight: 25, height: 35, borderRadius: 5, backgroundColor: "#34a2ec", borderStyle: "solid", borderWidth: 0.5, borderColor: "#2980b9", alignItems: 'center', justifyContent: 'center' }} >
|
|
188
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 13, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "center", color: "#fff" }} >{esp.lang("event/order_share_to", "next")}</Text>
|
|
189
|
+
</View>
|
|
190
|
+
</TouchableOpacity>
|
|
191
|
+
</ScrollView>
|
|
192
|
+
<LibSlidingup ref={dialogTickets} >
|
|
193
|
+
<View style={{ backgroundColor: 'white', borderTopLeftRadius: 20, borderTopRightRadius: 20, padding: 15, paddingTop: 5, maxHeight: LibStyle.height - (LibStyle.height / 3) }} >
|
|
194
|
+
<View style={{ alignSelf: 'center', height: 3, width: 35, backgroundColor: "#c5c5c5", borderRadius: 10 }} />
|
|
195
|
+
<Text allowFontScaling={false} style={{ color: '#4a4a4a', fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, marginTop: 15 }}>{esp.lang("event/order_detail_share", "ticket_will_share_to")}</Text>
|
|
196
|
+
|
|
197
|
+
<View style={{ marginVertical: 15, flexDirection: 'row' }}>
|
|
198
|
+
<LibPicture source={{ uri: dataUser?.image }} style={{ height: 40, width: 40, borderRadius: 20 }} />
|
|
199
|
+
<View style={{ marginLeft: 10 }}>
|
|
200
|
+
<Text style={{ fontFamily: "Arial", fontSize: 16, fontWeight: "bold", color: "#4a4a4a" }} >{dataUser?.name}</Text>
|
|
201
|
+
<Text style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", color: "#b7b7b7" }} >{dataUser?.email}</Text>
|
|
202
|
+
</View>
|
|
203
|
+
</View>
|
|
204
|
+
<ScrollView>
|
|
205
|
+
<Text allowFontScaling={false} style={{ marginBottom: 10, fontFamily: "Arial", fontSize: 16, fontWeight: "bold", fontStyle: "normal", letterSpacing: 1.5, color: "#000" }}>{esp.lang("event/order_detail_share", "chose_ticket")}</Text>
|
|
206
|
+
|
|
207
|
+
{
|
|
208
|
+
dataTicket?.length > 0 && dataTicket?.map((item: any, i: number) => {
|
|
209
|
+
const [front, end] = item?.seat_name?.split("#") || ["", ""];
|
|
210
|
+
return (
|
|
211
|
+
<TouchableOpacity key={i} onPress={() => {
|
|
212
|
+
let a = LibObject.set(dataTicket, item.checked == 1 ? 0 : 1)(i, 'checked')
|
|
213
|
+
setDataTicket(a)
|
|
214
|
+
setUseAll(false)
|
|
215
|
+
|
|
216
|
+
}} style={{ padding: 10, marginBottom: 10, borderRadius: 4, borderColor: item?.checked == 1 ? LibStyle.colorGreen : '#f1f1f1', borderWidth: 1, flexDirection: 'row' }}>
|
|
217
|
+
<View style={{ flex: 5 }}>
|
|
218
|
+
<Text allowFontScaling={false} style={{ fontSize: 14, fontStyle: "normal", color: "#000", fontWeight: "bold", }}>{item?.price_name}</Text>
|
|
219
|
+
{/* seat */}
|
|
220
|
+
{
|
|
221
|
+
item?.seat_name != "" &&
|
|
222
|
+
<View style={{ marginVertical: 10 }}>
|
|
223
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, marginBottom: 5, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }}>{esp.lang("event/order_detail", "seat_number")}</Text>
|
|
224
|
+
|
|
225
|
+
<View style={{ marginLeft: 7, flexDirection: 'row' }}>
|
|
226
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: 5, paddingHorizontal: 5, backgroundColor: '#f1f1f1', borderRadius: 5, marginRight: 7 }}>
|
|
227
|
+
<Text allowFontScaling={false} style={{ fontWeight: 'bold', fontSize: 16, color: "#000" }}> {front}</Text>
|
|
228
|
+
<Text allowFontScaling={false} style={{ marginLeft: 3, fontWeight: 'bold', fontSize: 16, color: '#000', }}>{end}</Text>
|
|
229
|
+
</View>
|
|
230
|
+
</View>
|
|
231
|
+
</View>
|
|
232
|
+
}
|
|
233
|
+
{/* add ons */}
|
|
234
|
+
{
|
|
235
|
+
item?.addons?.length > 0 &&
|
|
236
|
+
<View style={{ marginBottom: 5 }}>
|
|
237
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" }}>{esp.lang("event/order_detail", "addons")}</Text>
|
|
238
|
+
</View>
|
|
239
|
+
}
|
|
240
|
+
{
|
|
241
|
+
item?.addons?.length > 0 && item?.addons?.map((x: any, ii: number) => {
|
|
242
|
+
return (
|
|
243
|
+
<View key={ii} style={{ marginLeft: 7, flexDirection: 'row' }}>
|
|
244
|
+
<View style={{}}>
|
|
245
|
+
<Text allowFontScaling={false} style={{ color: '#484848', fontSize: 12, fontWeight: 'bold', fontFamily: "Arial" }}>- {
|
|
246
|
+
x?.list?.map((y: any) => y).join(', ')
|
|
247
|
+
}</Text>
|
|
248
|
+
{
|
|
249
|
+
x?.ondate != "0000-00-00" &&
|
|
250
|
+
<Text allowFontScaling={false} style={{ marginLeft: 7, marginBottom: 3, marginTop: 3, fontFamily: "Arial", fontSize: 12, fontStyle: "normal", letterSpacing: 0, color: '#484848' }}>{
|
|
251
|
+
LibUtils.moment(x?.ondate).localeFormat('DD MMM YYYY')}</Text>
|
|
252
|
+
}
|
|
253
|
+
</View>
|
|
254
|
+
</View>
|
|
255
|
+
)
|
|
256
|
+
})
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
</View>
|
|
261
|
+
<View style={{ flex: 1, alignContent: 'flex-end', alignItems: 'flex-end' }}>
|
|
262
|
+
<LibIcon name={item?.checked == 1 ? 'check-circle' : 'radiobox-blank'} color={LibStyle.colorGreen} />
|
|
263
|
+
</View>
|
|
264
|
+
</TouchableOpacity>
|
|
265
|
+
)
|
|
266
|
+
})
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
</ScrollView>
|
|
270
|
+
|
|
271
|
+
<View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'space-between' }}>
|
|
272
|
+
<Text allowFontScaling={false} numberOfLines={2} ellipsizeMode={'tail'} style={{ fontWeight: 'bold', fontSize: 14, letterSpacing: 1 }}>{dataTicket?.filter((item: any) => item.checked == 1).length + " Tiket digunakan"}</Text>
|
|
273
|
+
<TouchableOpacity onPress={() => {
|
|
274
|
+
let a = dataTicket?.map((item: any, i: number) => {
|
|
275
|
+
return { ...item, checked: useAll ? 0 : 1 }
|
|
276
|
+
})
|
|
277
|
+
setDataTicket(a)
|
|
278
|
+
setUseAll(useAll ? false : true)
|
|
279
|
+
}} style={{ paddingHorizontal: 15, paddingRight: 10, marginTop: 10, borderWidth: 1, borderColor: 'rgba(0, 0, 0, 0)', height: 25, borderRadius: 5, backgroundColor: (useAll || checkNotUsed?.length == 0) ? LibStyle.colorRed : LibStyle.colorGreen, flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center' }} >
|
|
280
|
+
<Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: '#fff', marginRight: 15 }} >{(useAll || checkNotUsed?.length == 0) ? esp.lang("event/order_detail_share", "cancel") : esp.lang("event/order_detail_share", "select_all")}</Text>
|
|
281
|
+
<LibIcon.Ionicons size={18} color="#fff" name={(useAll || checkNotUsed?.length == 0) ? "close" : "checkmark-done"} />
|
|
282
|
+
</TouchableOpacity>
|
|
283
|
+
</View>
|
|
284
|
+
|
|
285
|
+
<EventButton
|
|
286
|
+
label={esp.lang("event/order_detail_share", "share_ticket")}
|
|
287
|
+
onPress={() => {
|
|
288
|
+
if (valid) {
|
|
289
|
+
LibNavigation.navigateForResult("bigbang/payment_pin", undefined, 1132).then((p) => {
|
|
290
|
+
if (p) {
|
|
291
|
+
shareTicket(p)
|
|
292
|
+
}
|
|
293
|
+
})
|
|
294
|
+
}
|
|
295
|
+
}}
|
|
296
|
+
backgroundColor={valid ? LibStyle.colorPrimary : LibStyle.colorBgGrey}
|
|
297
|
+
style={{ borderRadius: 5, marginTop: 10 }}
|
|
298
|
+
/>
|
|
299
|
+
</View>
|
|
300
|
+
</LibSlidingup>
|
|
301
|
+
|
|
302
|
+
</LibKeyboard_avoid>
|
|
303
|
+
)
|
|
304
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
import { EventMessage } from 'esoftplay/cache/event/message/import';
|
|
3
|
+
import { EventStep } from 'esoftplay/cache/event/step/import';
|
|
4
|
+
import { LibCollaps } from 'esoftplay/cache/lib/collaps/import';
|
|
5
|
+
import { LibCurl_view } from 'esoftplay/cache/lib/curl_view/import';
|
|
6
|
+
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
7
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { Text, View } from 'react-native';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export interface EventOrder_detail_tncArgs {
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
export interface EventOrder_detail_tncProps {
|
|
17
|
+
dataTicket: any
|
|
18
|
+
}
|
|
19
|
+
export default function m(props: EventOrder_detail_tncProps): any {
|
|
20
|
+
let result = props?.dataTicket
|
|
21
|
+
|
|
22
|
+
function renderTermItem(item: any, i: number) {
|
|
23
|
+
return (
|
|
24
|
+
<View key={i} style={{ marginTop: 10 }}>
|
|
25
|
+
<EventStep text={item} />
|
|
26
|
+
</View>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<View style={{ backgroundColor: '#fff', marginTop: 1, borderRadius: 7, overflow: 'hidden', marginHorizontal: 15, marginBottom: 0 }}>
|
|
32
|
+
<LibCurl_view
|
|
33
|
+
url={result?.url_term}
|
|
34
|
+
onSuccess={(res, msg): any => {
|
|
35
|
+
if (Array.isArray(res)) {
|
|
36
|
+
return (
|
|
37
|
+
<View>
|
|
38
|
+
{res?.map(renderTermItem)}
|
|
39
|
+
</View>
|
|
40
|
+
)
|
|
41
|
+
} else {
|
|
42
|
+
return (
|
|
43
|
+
<View>
|
|
44
|
+
{
|
|
45
|
+
Object.entries(res).map(([title, items]: any) => {
|
|
46
|
+
return (
|
|
47
|
+
<View key={title}>
|
|
48
|
+
<LibCollaps header={(show) =>
|
|
49
|
+
<View style={{ padding: 15, paddingRight: 25, paddingLeft: 20, paddingBottom: 10, borderBottomWidth: 1, borderColor: LibStyle.colorBgGrey, alignContent: 'center', alignItems: 'center', borderRadius: 7, backgroundColor: '#f9f9f9', flexDirection: 'row' }}>
|
|
50
|
+
<View style={{ flex: 1 }}>
|
|
51
|
+
<Text allowFontScaling={false} style={{ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 1.5, color: "#495057" }}>{title}</Text>
|
|
52
|
+
</View>
|
|
53
|
+
<LibIcon name={!show ? "chevron-down" : "chevron-up"} color='#495057' />
|
|
54
|
+
</View>
|
|
55
|
+
}>
|
|
56
|
+
{items.map(renderTermItem)}
|
|
57
|
+
</LibCollaps>
|
|
58
|
+
</View>
|
|
59
|
+
)
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
</View>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
}}
|
|
66
|
+
onError={(err) => {
|
|
67
|
+
return (
|
|
68
|
+
<EventMessage
|
|
69
|
+
message={err?.message}
|
|
70
|
+
/>
|
|
71
|
+
)
|
|
72
|
+
}}
|
|
73
|
+
/>
|
|
74
|
+
</View>
|
|
75
|
+
)
|
|
76
|
+
}
|