esoftplay-event 0.0.1-h → 0.0.1-j
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/artist_detailv2.tsx +44 -0
- package/event/artistv2.tsx +63 -103
- package/event/button_order_detail.tsx +42 -0
- package/event/order_detail.tsx +23 -29
- package/package.json +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
5
|
+
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
6
|
+
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
7
|
+
import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
|
|
8
|
+
import esp from 'esoftplay/esp';
|
|
9
|
+
import useSafeState from 'esoftplay/state';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { View } from 'react-native';
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
export interface EventArtist_detailv2Args {
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
export interface EventArtist_detailv2Props {
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
export default function m(props: EventArtist_detailv2Props): any {
|
|
21
|
+
const { url_price } = LibNavigation.getArgsAll(props)
|
|
22
|
+
const [priceList, setPriceList] = useSafeState<any>()
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
loadData()
|
|
26
|
+
}, [])
|
|
27
|
+
|
|
28
|
+
function loadData() {
|
|
29
|
+
new LibCurl(url_price, null, (res, msg) => {
|
|
30
|
+
esp.log(res);
|
|
31
|
+
setPriceList(res)
|
|
32
|
+
}, (err) => {
|
|
33
|
+
LibToastProperty.show(err?.message)
|
|
34
|
+
LibNavigation.back()
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<View style={{ flex: 1 }}>
|
|
40
|
+
<EventHeader title={esp.lang("event/artist_detail", "title")} /* subtitle={data?.title} */ />
|
|
41
|
+
|
|
42
|
+
</View>
|
|
43
|
+
)
|
|
44
|
+
}
|
package/event/artistv2.tsx
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
// withHooks
|
|
2
2
|
|
|
3
|
-
import { EventCountdownProperty } from 'esoftplay/cache/event/countdown/import';
|
|
4
3
|
import { EventFirebase_socket, EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
|
|
5
4
|
import { EventHeader } from 'esoftplay/cache/event/header/import';
|
|
6
5
|
import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
|
|
7
6
|
import { EventMessage } from 'esoftplay/cache/event/message/import';
|
|
8
|
-
import { LibCarrousel } from 'esoftplay/cache/lib/carrousel/import';
|
|
9
7
|
import { LibCurl } from 'esoftplay/cache/lib/curl/import';
|
|
10
8
|
import { LibList } from 'esoftplay/cache/lib/list/import';
|
|
11
9
|
import { LibLoading } from 'esoftplay/cache/lib/loading/import';
|
|
@@ -18,7 +16,7 @@ import esp from 'esoftplay/esp';
|
|
|
18
16
|
import moment from 'esoftplay/moment';
|
|
19
17
|
import useSafeState from 'esoftplay/state';
|
|
20
18
|
import React, { useEffect } from 'react';
|
|
21
|
-
import {
|
|
19
|
+
import { TouchableOpacity, View } from 'react-native';
|
|
22
20
|
|
|
23
21
|
|
|
24
22
|
moment().locale('id')
|
|
@@ -80,107 +78,64 @@ export default function m(props: EventArtistv2Props): any {
|
|
|
80
78
|
const width = LibStyle?.width
|
|
81
79
|
const sliderHeight = 0.50 * width
|
|
82
80
|
|
|
83
|
-
|
|
84
|
-
function renderItem(item: any, index: number) {
|
|
81
|
+
function renderIt(item: any, i: number) {
|
|
85
82
|
const styleId_Z2g4Hs7: any = { backgroundColor: '#FFC523', width: itemWidth, height: itemHeight, margin: 0.5, justifyContent: 'center', alignItems: 'center' }
|
|
86
83
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
{
|
|
96
|
-
item?.images?.map((item1: any, ii: number) => {
|
|
97
|
-
return (
|
|
98
|
-
<TouchableOpacity key={ii} onPress={() => {
|
|
99
|
-
esp.log("start");
|
|
100
|
-
EventIndexProperty.isLogin(async () => {
|
|
101
|
-
esp.log("1");
|
|
102
|
-
if (item.status == 1) {
|
|
103
|
-
esp.log("2");
|
|
104
|
-
if (isInPricingQueueConfig(item.event_id)) {
|
|
105
|
-
esp.log("3");
|
|
106
|
-
LibNavigation.navigateForResult('event/queue_pricing', { event_id: item?.event_id, autoPass: false })
|
|
107
|
-
}
|
|
108
|
-
esp.log("4");
|
|
109
|
-
EventCountdownProperty.countdownTime.set(moment().add(EventFirebase_socketProperty.eventQueueConfig.get(item?.event_id).time, 'seconds').localeFormat('YYYY-MM-DD HH:mm:ss'))
|
|
110
|
-
esp.log("5");
|
|
111
|
-
LibNavigation.navigate(item?.config?.hasOwnProperty('multiprice') && item?.config?.multiprice == 1 ?
|
|
112
|
-
'event/artist_detail_multi' :
|
|
113
|
-
'event/artist_detail', { url_price: item.url })
|
|
114
|
-
} else {
|
|
115
|
-
esp.log("6");
|
|
116
|
-
LibToastProperty.show(esp.lang("event/artist", "ticket_not_available"))
|
|
117
|
-
}
|
|
118
|
-
})
|
|
119
|
-
}} >
|
|
120
|
-
<LibPicture key={ii} source={{ uri: item1 }} style={{ height: sliderHeight, width: width, resizeMode: 'cover', backgroundColor: "#f1f2f3" }} />
|
|
121
|
-
</TouchableOpacity>
|
|
122
|
-
)
|
|
123
|
-
})
|
|
84
|
+
const handlePress = () => {
|
|
85
|
+
EventIndexProperty.isLogin(async () => {
|
|
86
|
+
if (item.status == 1) {
|
|
87
|
+
if (isInPricingQueueConfig(item.event_id)) {
|
|
88
|
+
LibNavigation.navigateForResult('event/queue_pricing', {
|
|
89
|
+
event_id: item?.event_id,
|
|
90
|
+
autoPass: false,
|
|
91
|
+
});
|
|
124
92
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
'event/artist_detail', { url_price: item.url })
|
|
172
|
-
} else {
|
|
173
|
-
esp.log("6");
|
|
174
|
-
LibToastProperty.show(esp.lang("event/artist", "ticket_not_available"))
|
|
175
|
-
}
|
|
176
|
-
})
|
|
177
|
-
}} style={styleId_Z2g4Hs7}>
|
|
178
|
-
<Text numberOfLines={2} style={styleId_2cYE4h}>{item.title}</Text>
|
|
179
|
-
|
|
180
|
-
</TouchableOpacity>
|
|
181
|
-
)
|
|
182
|
-
}
|
|
183
|
-
|
|
93
|
+
// EventCountdownProperty.countdownTime.set(moment().add(EventFirebase_socketProperty.eventQueueConfig.get(item?.event_id).time, 'seconds').localeFormat('YYYY-MM-DD HH:mm:ss'));
|
|
94
|
+
LibNavigation.navigate(
|
|
95
|
+
// item?.config?.multiprice == 1
|
|
96
|
+
// ? 'event/artist_detail_multi'
|
|
97
|
+
// :
|
|
98
|
+
'event/artist_detailv2',
|
|
99
|
+
{ url_price: item.url }
|
|
100
|
+
);
|
|
101
|
+
} else {
|
|
102
|
+
LibToastProperty.show(esp.lang("event/artist", "ticket_not_available"));
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
// if (item?.images?.length > 0) {
|
|
108
|
+
// return (
|
|
109
|
+
// <LibCarrousel
|
|
110
|
+
// key={i}
|
|
111
|
+
// delay={4000}
|
|
112
|
+
// style={{ height: sliderHeight, width: width }}
|
|
113
|
+
// autoplay
|
|
114
|
+
// >
|
|
115
|
+
// {
|
|
116
|
+
// item?.images?.map((item1: any, ii: number) => {
|
|
117
|
+
// return (
|
|
118
|
+
// <TouchableOpacity key={ii} onPress={handlePress} >
|
|
119
|
+
// <LibPicture key={ii} source={{ uri: item1 }} style={{ height: sliderHeight, width: width, resizeMode: 'cover', backgroundColor: "#f1f2f3" }} />
|
|
120
|
+
// </TouchableOpacity>
|
|
121
|
+
// )
|
|
122
|
+
// })
|
|
123
|
+
// }
|
|
124
|
+
// </LibCarrousel>
|
|
125
|
+
// )
|
|
126
|
+
// } else if (item?.images?.length == 1) {
|
|
127
|
+
return (
|
|
128
|
+
<TouchableOpacity key={i} onPress={handlePress} >
|
|
129
|
+
<LibPicture style={{ height: sliderHeight, width: width, resizeMode: 'cover', backgroundColor: "#f1f2f3" }} source={{ uri: item.images[0] }} />
|
|
130
|
+
</TouchableOpacity>
|
|
131
|
+
)
|
|
132
|
+
// } else {
|
|
133
|
+
// return (
|
|
134
|
+
// <TouchableOpacity key={i} onPress={handlePress} style={styleId_Z2g4Hs7}>
|
|
135
|
+
// <Text allowFontScaling={false} numberOfLines={2} style={styleId_2cYE4h}>{item.title}</Text>
|
|
136
|
+
// </TouchableOpacity>
|
|
137
|
+
// )
|
|
138
|
+
// }
|
|
184
139
|
}
|
|
185
140
|
|
|
186
141
|
return (
|
|
@@ -191,12 +146,17 @@ export default function m(props: EventArtistv2Props): any {
|
|
|
191
146
|
}} />
|
|
192
147
|
{
|
|
193
148
|
!result && !error ? <LibLoading /> :
|
|
149
|
+
// <ScrollView>
|
|
150
|
+
// {
|
|
151
|
+
// result?.map(renderIt)
|
|
152
|
+
// }
|
|
153
|
+
// </ScrollView>
|
|
194
154
|
<LibList
|
|
195
155
|
data={result}
|
|
196
|
-
keyExtractor={(item) => item.id}
|
|
156
|
+
// keyExtractor={(item) => item.id}
|
|
197
157
|
onRefresh={loadData}
|
|
198
158
|
staticHeight={itemHeight + 1}
|
|
199
|
-
renderItem={
|
|
159
|
+
renderItem={renderIt}
|
|
200
160
|
ListEmptyComponent={
|
|
201
161
|
<EventMessage message={error} />
|
|
202
162
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// withHooks
|
|
2
|
+
|
|
3
|
+
import { EventOrder_itemProperty } from 'esoftplay/cache/event/order_item/import';
|
|
4
|
+
import { LibGradient } from 'esoftplay/cache/lib/gradient/import';
|
|
5
|
+
import { LibIcon } from 'esoftplay/cache/lib/icon/import';
|
|
6
|
+
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { Text, TouchableOpacity, View } from 'react-native';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
export interface EventButton_order_detailArgs {
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
export interface EventButton_order_detailProps {
|
|
15
|
+
onPress: () => void
|
|
16
|
+
title: string
|
|
17
|
+
info?: string
|
|
18
|
+
color: any,
|
|
19
|
+
icon: any
|
|
20
|
+
}
|
|
21
|
+
export default function m(props: EventButton_order_detailProps): any {
|
|
22
|
+
return (
|
|
23
|
+
<TouchableOpacity onPress={props.onPress}>
|
|
24
|
+
<View style={{ borderWidth: 1, borderColor: '#ccc', margin: 15, borderRadius: 7, marginBottom: 0, overflow: 'hidden', flexDirection: 'row' }}>
|
|
25
|
+
<LibGradient
|
|
26
|
+
colors={[props.color, props.color, "#f1f2f3",]}
|
|
27
|
+
direction='left-to-right'
|
|
28
|
+
style={{ margin: 3, borderRadius: 5, padding: 7, flex: 4, alignContent: 'center', justifyContent: 'center' }}
|
|
29
|
+
>
|
|
30
|
+
<Text allowFontScaling={false} numberOfLines={2} ellipsizeMode='tail' style={{ color: EventOrder_itemProperty.textColor(props?.color), fontSize: 16, fontWeight: 'bold' }}>{props.title}</Text>
|
|
31
|
+
{
|
|
32
|
+
props.info != "" &&
|
|
33
|
+
<Text allowFontScaling={false} numberOfLines={2} ellipsizeMode='tail' style={{ color: EventOrder_itemProperty.textColor(props?.color), fontSize: 12, fontWeight: 'normal' }}>{props?.info}</Text>
|
|
34
|
+
}
|
|
35
|
+
</LibGradient>
|
|
36
|
+
<View style={{ flex: 1, margin: 3, borderRadius: 5, ...LibStyle.elevation(2), backgroundColor: props.color, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
|
|
37
|
+
<LibIcon name={props.icon} size={40} color={EventOrder_itemProperty.textColor(props.color)} style={{ opacity: 1 }} />
|
|
38
|
+
</View>
|
|
39
|
+
</View>
|
|
40
|
+
</TouchableOpacity>
|
|
41
|
+
)
|
|
42
|
+
}
|
package/event/order_detail.tsx
CHANGED
|
@@ -20,16 +20,15 @@ import { UserClass } from 'esoftplay/cache/user/class/import';
|
|
|
20
20
|
|
|
21
21
|
import { applyStyle } from 'esoftplay';
|
|
22
22
|
import { EventAlert } from 'esoftplay/cache/event/alert/import';
|
|
23
|
+
import { EventButton_order_detail } from 'esoftplay/cache/event/button_order_detail/import';
|
|
23
24
|
import { EventConfigProperty } from 'esoftplay/cache/event/config/import';
|
|
24
25
|
import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
|
|
25
26
|
import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
|
|
26
|
-
import { EventOrder_detail_upgrade_button } from 'esoftplay/cache/event/order_detail_upgrade_button/import';
|
|
27
27
|
import { EventPopup } from 'esoftplay/cache/event/popup/import';
|
|
28
28
|
import { EventQr_bg } from 'esoftplay/cache/event/qr_bg/import';
|
|
29
29
|
import { EventRating } from 'esoftplay/cache/event/rating/import';
|
|
30
30
|
import { EventSecure_page } from 'esoftplay/cache/event/secure_page/import';
|
|
31
31
|
import { EventStep } from 'esoftplay/cache/event/step/import';
|
|
32
|
-
import { LibGradient } from 'esoftplay/cache/lib/gradient/import';
|
|
33
32
|
import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
|
|
34
33
|
import { UseCondition } from 'esoftplay/cache/use/condition/import';
|
|
35
34
|
import esp from 'esoftplay/esp';
|
|
@@ -527,40 +526,35 @@ export default function m(props: EventOrder_detailProps): any {
|
|
|
527
526
|
</UseCondition>
|
|
528
527
|
|
|
529
528
|
<UseCondition if={result?.is_upgradable == 1} >
|
|
530
|
-
<
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
529
|
+
<EventButton_order_detail
|
|
530
|
+
color={LibStyle.colorPrimary}
|
|
531
|
+
onPress={() => {
|
|
532
|
+
LibNavigation.navigate('event/order_detail_upgrade', {
|
|
533
|
+
url: result?.url_upgrade,
|
|
534
|
+
dataTicket: result,
|
|
535
|
+
})
|
|
536
|
+
}}
|
|
537
|
+
icon={'chevron-up-circle'}
|
|
538
|
+
title={esp.lang("event/order_detail_upgrade_button", "upgrade")}
|
|
539
|
+
info={esp.lang("event/order_detail_upgrade_button", "eays")}
|
|
540
|
+
/>
|
|
536
541
|
</UseCondition>
|
|
537
542
|
|
|
538
543
|
|
|
539
|
-
{/* tombol add on */}
|
|
540
544
|
|
|
545
|
+
{/* tombol add on */}
|
|
541
546
|
{
|
|
542
547
|
result?.addons?.length > 0 && result?.addons?.map((item: any, i: number) => {
|
|
543
548
|
return (
|
|
544
|
-
<
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
<LibIcon name='plus-circle' size={40} color='#fff' style={{ opacity: 1 }} />
|
|
554
|
-
</View>
|
|
555
|
-
<View style={{ flex: 1, backgroundColor: '#fff', borderTopRightRadius: 7, borderBottomRightRadius: 7, borderTopLeftRadius: 50, borderBottomLeftRadius: 50, alignContent: 'center', justifyContent: 'center', paddingLeft: 30 }}>
|
|
556
|
-
<Text allowFontScaling={false} style={{ fontSize: 16, fontWeight: 'bold' }}>{item.title}</Text>
|
|
557
|
-
{
|
|
558
|
-
item.hasOwnProperty('subtitle') && item?.subtitle != "" &&
|
|
559
|
-
<Text allowFontScaling={false} numberOfLines={2} ellipsizeMode='tail' style={{ fontSize: 12, fontWeight: 'normal' }}>{item?.subtitle}</Text>
|
|
560
|
-
}
|
|
561
|
-
</View>
|
|
562
|
-
</LibGradient>
|
|
563
|
-
</TouchableOpacity>
|
|
549
|
+
<EventButton_order_detail
|
|
550
|
+
color={result?.color}
|
|
551
|
+
onPress={() => {
|
|
552
|
+
loadDataAddons(item?.addons_id, item?.url)
|
|
553
|
+
}}
|
|
554
|
+
icon={'plus-circle'}
|
|
555
|
+
title={item.title}
|
|
556
|
+
info={item.info}
|
|
557
|
+
/>
|
|
564
558
|
)
|
|
565
559
|
})
|
|
566
560
|
}
|