esoftplay-event 0.0.0-r → 0.0.0-s

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.tsx CHANGED
@@ -62,7 +62,7 @@ export default function m(props: BigbangArtistProps): any {
62
62
  setResult(res)
63
63
  }, (err) => {
64
64
  setError(err?.message)
65
- })
65
+ }, 1)
66
66
  }
67
67
 
68
68
  useEffect(() => {
package/event/detail.tsx CHANGED
@@ -268,7 +268,12 @@ export default function m(props: EventDetailProps): any {
268
268
  {
269
269
  result?.url_artist != "" &&
270
270
  <TouchableOpacity onPress={() => {
271
- LibNavigation.navigate('event/artist', { title: result?.title, url: result?.url_artist, has_addition: result?.has_addition })
271
+ // LibNavigation.navigate('event/artist', { title: result?.title, url: result?.url_artist, has_addition: result?.has_addition })
272
+ LibNavigation.navigate('event/artist', {
273
+ title: result?.title,
274
+ url: result?.url_artist,
275
+ has_addition: result?.has_addition
276
+ })
272
277
  }} style={applyStyle({ width: (LibStyle.width - 30) * 0.5, borderWidth: 2, borderColor: LibStyle.colorGreen, height: 40, borderRadius: 16, backgroundColor: 'white', flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center', paddingHorizontal: 9 })} >
273
278
  <Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: LibStyle.colorGreen })} >{esp.lang("event/detail", "line_up")}</Text>
274
279
  </TouchableOpacity>
package/event/order.tsx CHANGED
@@ -196,20 +196,25 @@ export default function m(props: EventOrderProps): any {
196
196
  url={buildUrl(url) + "&t=" + new Date().getTime()}
197
197
  key={buildUrl(url)}
198
198
  ListHeaderComponent={
199
- <Pressable onPress={() => {
200
- LibNavigation.navigate('event/order_waiting')
201
- }} style={{ padding: 7, margin: 15, backgroundColor: '#fff', marginBottom: 0, borderRadius: 5, borderWidth: 1, borderColor: LibStyle.colorPrimary, flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
202
- <Text allowFontScaling={false} style={{ marginLeft: 8 }}>{esp.lang("event/order", "wawit")}</Text>
203
- <View style={{ flexDirection: 'row', alignItems: 'center' }}>
204
- {
205
- badge != 0 &&
206
- <View style={{ backgroundColor: LibStyle.colorRed, height: 17, padding: 5, paddingVertical: 2, borderRadius: 10, alignContent: 'center', alignItems: 'center' }}>
207
- <Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, letterSpacing: 0, color: "#ffffff" }}>{badge > 99 ? "99+" : LibUtils.number(badge)}</Text>
199
+ <>
200
+ {
201
+ badge > 0 &&
202
+ <Pressable onPress={() => {
203
+ LibNavigation.navigate('event/order_waiting')
204
+ }} style={{ padding: 7, margin: 15, backgroundColor: '#fff', marginBottom: 0, borderRadius: 5, borderWidth: 1, borderColor: LibStyle.colorPrimary, flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
205
+ <Text allowFontScaling={false} style={{ marginLeft: 8 }}>{esp.lang("event/order", "wawit")}</Text>
206
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
207
+ {
208
+ badge != 0 &&
209
+ <View style={{ backgroundColor: LibStyle.colorRed, height: 17, padding: 5, paddingVertical: 2, borderRadius: 10, alignContent: 'center', alignItems: 'center' }}>
210
+ <Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, letterSpacing: 0, color: "#ffffff" }}>{badge > 99 ? "99+" : LibUtils.number(badge)}</Text>
211
+ </View>
212
+ }
213
+ <LibIcon name='chevron-right' />
208
214
  </View>
209
- }
210
- <LibIcon name='chevron-right' />
211
- </View>
212
- </Pressable>
215
+ </Pressable>
216
+ }
217
+ </>
213
218
  }
214
219
  errorView={(err: any) => (
215
220
  <EventMessage message={err} style={{ marginTop: 15 }} />
@@ -86,7 +86,7 @@ export default function m(props: EventOrder_detail_upgradeProps): any {
86
86
 
87
87
  <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' }}>
88
88
  <EventHtmltext allowFontScaling={false} style={{ marginHorizontal: 5, fontSize: 20, color: "#000", textAlign: 'center', fontWeight: 'bold' }} numberOfLines={2} ellipsizeMode={'tail'}>{dataTicket?.price_name}</EventHtmltext>
89
- <Text allowFontScaling={false} style={{ color: "#000", marginTop: 10 }}>{LibUtils.money(dataTicket.total)}</Text>
89
+ <Text allowFontScaling={false} style={{ color: "#000", marginTop: 10 }}>{LibUtils.money(dataTicket.total, dataTicket?.currency)}</Text>
90
90
 
91
91
  <View style={applyStyle({ flexDirection: 'row', alignItems: 'center', justifyContent: 'center', position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 })}>
92
92
  <View style={applyStyle({ width: 25, height: 25, borderRadius: 12.5, backgroundColor: "#fff", marginLeft: -12.5 })} />
@@ -122,7 +122,7 @@ export default function m(props: EventOrder_detail_upgradeProps): any {
122
122
  }
123
123
  }} key={i} style={{ ...LibStyle.elevation(2), marginHorizontal: 15, 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' }}>
124
124
  <EventHtmltext allowFontScaling={false} 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'}>{item?.price_name_to}</EventHtmltext>
125
- <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>
125
+ <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), item?.currency)}</Text>
126
126
 
127
127
  {
128
128
  item.info &&
@@ -130,7 +130,7 @@ export default function m(props: EventOrder_waitingProps): any {
130
130
  dataPost.card_expiry_month = dataCC?.expiry_month
131
131
 
132
132
  let url = 'event_booking/' + result?.event_id
133
- LibNavigation.navigateForResult('bigbang/loading_page', {
133
+ LibNavigation.navigateForResult('event/loading_page', {
134
134
  post: dataPost,
135
135
  url: url,
136
136
  title: esp.lang("bigbang/payment", "title_buy_ticket", result?.event_name),
@@ -23,7 +23,6 @@ import { EventCountdown_base } from 'esoftplay/cache/event/countdown_base/import
23
23
  import { EventFirebase_socket, EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
24
24
  import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
25
25
  import { EventLoading_pageProperty } from 'esoftplay/cache/event/loading_page/import';
26
- import { EventPending_trx } from 'esoftplay/cache/event/pending_trx/import';
27
26
  import { LibEffect } from 'esoftplay/cache/lib/effect/import';
28
27
  import { LibProgress } from 'esoftplay/cache/lib/progress/import';
29
28
  import { UseDeeplinkProperty } from 'esoftplay/cache/use/deeplink/import';
@@ -539,7 +538,7 @@ export default function m(props: EventTicket_listProps): any {
539
538
  </LibSkeleton>
540
539
  :
541
540
  <>
542
- {
541
+ {/* {
543
542
  Object.values(pendingData).filter((item: any) => item?.order_type == "ticket").length > 0 &&
544
543
  <EventPending_trx
545
544
  onPress={() => {
@@ -550,7 +549,7 @@ export default function m(props: EventTicket_listProps): any {
550
549
  order_type="ticket"
551
550
  title={esp.lang("event/ticket_list", "pending", String(Object.values(pendingData).filter((item: any) => item?.order_type == "ticket").length))}
552
551
  />
553
- }
552
+ } */}
554
553
  {
555
554
  isInPricingQueueConfig(availableResult?.id) && isPass ?
556
555
  <LibEffect deps={[]}>
@@ -24,7 +24,6 @@ import { EventCountdownProperty } from 'esoftplay/cache/event/countdown/import';
24
24
  import { EventCountdown_base } from 'esoftplay/cache/event/countdown_base/import';
25
25
  import { EventFirebase_socket, EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
26
26
  import { EventLoading_pageProperty } from 'esoftplay/cache/event/loading_page/import';
27
- import { EventPending_trx } from 'esoftplay/cache/event/pending_trx/import';
28
27
  import { EventQueue_pricingProperty } from 'esoftplay/cache/event/queue_pricing/import';
29
28
  import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
30
29
  import { UseTasks } from 'esoftplay/cache/use/tasks/import';
@@ -507,7 +506,7 @@ export default function m(props: EventTicket_list2Props): any {
507
506
  </LibSkeleton>
508
507
  :
509
508
  <>
510
- {
509
+ {/* {
511
510
  Object.values(pendingData).filter((item: any) => item?.order_type == "ticket").length > 0 &&
512
511
  <EventPending_trx
513
512
  onPress={() => {
@@ -518,7 +517,7 @@ export default function m(props: EventTicket_list2Props): any {
518
517
  order_type="ticket"
519
518
  title={esp.lang("event/ticket_list", "pending", String(Object.values(pendingData).filter((item: any) => item?.order_type == "ticket").length))}
520
519
  />
521
- }
520
+ } */}
522
521
  {
523
522
  isInPricingQueueConfig(availableResult?.id) && isPass ?
524
523
  <View style={{ backgroundColor: LibStyle.colorGreen, margin: 16, borderRadius: 5, padding: 10, ...LibStyle.elevation(2) }} >
@@ -12,11 +12,12 @@ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
12
12
  import { applyStyle } from 'esoftplay';
13
13
  import { EventButton } from 'esoftplay/cache/event/button/import';
14
14
  import { EventHeader } from 'esoftplay/cache/event/header/import';
15
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
15
16
  import { LibPicture } from 'esoftplay/cache/lib/picture/import';
16
17
  import esp from 'esoftplay/esp';
17
18
  import useSafeState from 'esoftplay/state';
18
19
  import React, { useEffect } from 'react';
19
- import { ScrollView, Text, View } from 'react-native';
20
+ import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
20
21
 
21
22
 
22
23
  export interface EventTms_out_temporaryArgs {
@@ -29,6 +30,7 @@ export default function m(props: EventTms_out_temporaryProps): any {
29
30
  const user_qr = LibNavigation.getArgs(props, 'qr_code')
30
31
  const { scan_type, event_id, selectGate, typeScanner }: any = LibNavigation.getArgsAll(props)
31
32
  const [result, setResult] = useSafeState<any>(undefined)
33
+ const [useAll, setUseAll] = useSafeState<boolean>(false)
32
34
 
33
35
  useEffect(() => {
34
36
  loadData()
@@ -61,7 +63,6 @@ export default function m(props: EventTms_out_temporaryProps): any {
61
63
  list: res?.list?.length == 0 ? [] : a,
62
64
  staff: res?.staff?.length == 0 ? [] : b
63
65
  }
64
- esp.log({ res, c });
65
66
  setResult(c)
66
67
 
67
68
  }, (error) => {
@@ -69,6 +70,23 @@ export default function m(props: EventTms_out_temporaryProps): any {
69
70
  }, 1)
70
71
  }
71
72
 
73
+ useEffect(() => {
74
+ setUseAll(result?.list?.some((x: any) => x.checked == 0) ? false : true)
75
+ }, [result])
76
+
77
+
78
+ const toggleCheckedAll = () => {
79
+ const isAllChecked = result?.list?.every((item: any) => item.checked == 1);
80
+ const newCheckedValue = isAllChecked ? 0 : 1;
81
+
82
+ const updatedList = result?.list?.map((item: any) => ({
83
+ ...item,
84
+ checked: newCheckedValue,
85
+ }));
86
+
87
+ setResult({ ...result, list: updatedList });
88
+ };
89
+
72
90
  function quitTemporary(): void {
73
91
  let list = [...result?.list, ...result.staff]
74
92
  let a = list.filter((item: any) => item.checked == 1).map((it: any) => it.id)
@@ -144,6 +162,7 @@ export default function m(props: EventTms_out_temporaryProps): any {
144
162
  )
145
163
  }
146
164
 
165
+
147
166
  let lastStatusStaff = ''
148
167
  function renderStaff(item: any, i: number) {
149
168
  const showStatusScanned = lastStatusStaff != item?.status_label
@@ -212,9 +231,21 @@ export default function m(props: EventTms_out_temporaryProps): any {
212
231
  </View>
213
232
  </ScrollView>
214
233
  <View style={{ padding: 10, backgroundColor: '#fff' }}>
234
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between', marginBottom: 10, alignContent: 'center', alignItems: 'center' }}>
235
+ <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode={'tail'} style={{ flex: 1, fontWeight: 'bold', fontSize: 14, letterSpacing: 1 }}>{esp.lang("event/tms_in_list", "total_ticket_use", result?.list?.filter((it: any) => it.checked == 1).length)}</Text>
236
+ <TouchableOpacity onPress={() => {
237
+ toggleCheckedAll()
238
+ }} style={applyStyle({ paddingHorizontal: 10, borderWidth: 1, borderColor: 'rgba(0, 0, 0, 0)', height: 35, borderRadius: 16, backgroundColor: useAll ? LibStyle.colorRed : LibStyle.colorGreen, flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center' })} >
239
+ <Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: '#fff', marginRight: 15 })} >{useAll ? esp.lang("event/tms_in_list", "cancel_use") : esp.lang("event/tms_in_list", "use_all")}</Text>
240
+ <LibIcon.Ionicons size={18} color="#fff" name={useAll ? "close" : "checkmark-done"} />
241
+ </TouchableOpacity>
242
+ </View>
243
+
215
244
  <EventButton
216
245
  label={esp.lang("event/tms_out_temporary", "btn_exit")}
217
- backgroundColor={LibStyle.colorRed}
246
+ backgroundColor={"#fff"}
247
+ borderColor={LibStyle.colorRed}
248
+ fontColor={LibStyle.colorRed}
218
249
  onPress={() => {
219
250
  quitTemporary()
220
251
  }}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay-event",
3
- "version": "0.0.0-r",
3
+ "version": "0.0.0-s",
4
4
  "description": "event module on esoftplay framework",
5
5
  "main": "index.js",
6
6
  "scripts": {