esoftplay-event 0.0.0-b → 0.0.0-d

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 (61) hide show
  1. package/event/additional_input.tsx +4 -4
  2. package/event/artist.tsx +4 -5
  3. package/event/artist_detail.tsx +18 -17
  4. package/event/artist_detail_multi.tsx +10 -10
  5. package/event/block.tsx +56 -0
  6. package/event/capture.tsx +39 -0
  7. package/event/config.ts +24 -3
  8. package/event/countdown.tsx +2 -2
  9. package/event/counter_cashier.tsx +4 -4
  10. package/event/counter_eo.tsx +8 -8
  11. package/event/counter_lm.tsx +8 -8
  12. package/event/counter_report_detail.tsx +3 -3
  13. package/event/counter_send.tsx +3 -3
  14. package/event/counter_user_list.tsx +4 -4
  15. package/event/coupon_claim_reimburse_history.tsx +1 -2
  16. package/event/coupon_detail.tsx +2 -2
  17. package/event/detail.tsx +6 -5
  18. package/event/distribution_lock.ts +18 -0
  19. package/event/entrance.tsx +2 -2
  20. package/event/exchange_ticket.tsx +3 -3
  21. package/event/exit_log.tsx +2 -3
  22. package/event/header.tsx +2 -2
  23. package/event/header_home.tsx +104 -0
  24. package/event/htmltext.tsx +61 -0
  25. package/event/index.tsx +302 -0
  26. package/event/input_rectangle.tsx +208 -0
  27. package/event/item.tsx +39 -0
  28. package/event/loading_page.tsx +7 -7
  29. package/event/log.tsx +7 -9
  30. package/event/notice.tsx +41 -0
  31. package/event/order_detail.tsx +9 -9
  32. package/event/order_detail_payment.tsx +6 -6
  33. package/event/order_detail_upgrade.tsx +1 -2
  34. package/event/order_detail_upgrade_button.tsx +1 -2
  35. package/event/order_detail_waiting.tsx +10 -8
  36. package/event/order_item.tsx +2 -2
  37. package/event/order_share_to.tsx +9 -9
  38. package/event/order_waiting.tsx +1 -2
  39. package/event/popup.tsx +82 -0
  40. package/event/qc_idcard.tsx +2 -2
  41. package/event/queue_pricing.tsx +2 -3
  42. package/event/refresh_button.tsx +40 -0
  43. package/event/seat.tsx +4 -3
  44. package/event/seat_map.tsx +20 -20
  45. package/event/seat_map_test.tsx +3 -3
  46. package/event/section.tsx +35 -0
  47. package/event/secure_page.tsx +33 -0
  48. package/event/share.ts +20 -0
  49. package/event/slidingup.tsx +37 -0
  50. package/event/tap.tsx +30 -0
  51. package/event/ticket_list.tsx +10 -10
  52. package/event/ticket_list2.tsx +5 -6
  53. package/event/tms_add.tsx +3 -3
  54. package/event/tms_check_code.tsx +3 -3
  55. package/event/tms_check_ticket.tsx +3 -3
  56. package/event/tms_in.tsx +2 -2
  57. package/event/tms_log.tsx +7 -8
  58. package/event/tms_out_log.tsx +2 -3
  59. package/id.json +13 -0
  60. package/package.json +1 -1
  61. package/publisher.js +1 -1
@@ -3,10 +3,10 @@ import { useEffect, useRef } from 'react';
3
3
 
4
4
  import { EventButton } from 'esoftplay/cache/event/button/import';
5
5
  import { EventHeader } from 'esoftplay/cache/event/header/import';
6
+ import { EventInput_rectangle } from 'esoftplay/cache/event/input_rectangle/import';
6
7
  import { LibCollaps } from 'esoftplay/cache/lib/collaps/import';
7
8
  import { LibDatepicker } from 'esoftplay/cache/lib/datepicker/import';
8
9
  import { LibIcon } from 'esoftplay/cache/lib/icon/import';
9
- import { LibInput_rectangle } from 'esoftplay/cache/lib/input_rectangle/import';
10
10
  import { LibKeyboard_avoid } from 'esoftplay/cache/lib/keyboard_avoid/import';
11
11
  import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
12
12
  import { LibObject } from 'esoftplay/cache/lib/object/import';
@@ -108,7 +108,7 @@ export default function m(props: EventAdditional_inputProps): any {
108
108
  <View style={{ marginHorizontal: 10 }}>
109
109
  {
110
110
  item.type == 1 && // text field
111
- <LibInput_rectangle
111
+ <EventInput_rectangle
112
112
  placeholder={item.question}
113
113
  placeholderTextColor='#c9c9c9'
114
114
  style={{ borderRadius: 5, borderColor: '#c9c9c9' }}
@@ -124,7 +124,7 @@ export default function m(props: EventAdditional_inputProps): any {
124
124
 
125
125
  {
126
126
  item.type == 2 && // textarea
127
- <LibInput_rectangle
127
+ <EventInput_rectangle
128
128
  multiline={true}
129
129
  placeholder={item.question}
130
130
  placeholderTextColor='#c9c9c9'
@@ -223,7 +223,7 @@ export default function m(props: EventAdditional_inputProps): any {
223
223
 
224
224
  {
225
225
  item.is_content == 1 &&
226
- <LibInput_rectangle
226
+ <EventInput_rectangle
227
227
  placeholder={esp.lang("event/additional_input", "other")}
228
228
  placeholderTextColor='#c9c9c9'
229
229
  style={{ borderRadius: 5, borderColor: '#c9c9c9' }}
package/event/artist.tsx CHANGED
@@ -2,8 +2,9 @@
2
2
 
3
3
  import { applyStyle } from 'esoftplay';
4
4
  import { EventCountdownProperty } from 'esoftplay/cache/event/countdown/import';
5
- import { EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
5
+ import { EventFirebase_socket, EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
6
6
  import { EventHeader } from 'esoftplay/cache/event/header/import';
7
+ import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
7
8
  import { EventMessage } from 'esoftplay/cache/event/message/import';
8
9
  import { LibCurl } from 'esoftplay/cache/lib/curl/import';
9
10
  import { LibList } from 'esoftplay/cache/lib/list/import';
@@ -13,13 +14,11 @@ import { LibPicture } from 'esoftplay/cache/lib/picture/import';
13
14
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
14
15
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
15
16
  import { LibUtils } from 'esoftplay/cache/lib/utils/import';
16
- import { UserProfileProperty } from 'esoftplay/cache/user/profile/import';
17
17
  import esp from 'esoftplay/esp';
18
18
  import moment from 'esoftplay/moment';
19
19
  import useSafeState from 'esoftplay/state';
20
20
  import React, { useEffect } from 'react';
21
21
  import { Text, TouchableOpacity, View } from 'react-native';
22
- import useFirebaseSocket from '../lib/firebase_socket';
23
22
 
24
23
 
25
24
  moment().locale('id')
@@ -33,7 +32,7 @@ export default function m(props: BigbangArtistProps): any {
33
32
  const [result, setResult] = useSafeState<any>()
34
33
  const [resultEvent, setResultEvent] = useSafeState<any>()
35
34
  const [error, setError] = useSafeState<any>('')
36
- const { isInPricingQueueConfig } = useFirebaseSocket()
35
+ const { isInPricingQueueConfig } = EventFirebase_socket()
37
36
 
38
37
  const { title, has_addition } = LibNavigation.getArgsAll(props)
39
38
  const url = LibNavigation.getArgs(props, 'url', 'event_artist')
@@ -89,7 +88,7 @@ export default function m(props: BigbangArtistProps): any {
89
88
  if (isNotAvailable) {
90
89
  LibToastProperty.show(esp.lang("event/artist", "ticket_not_available"))
91
90
  } else {
92
- UserProfileProperty.isLogin(() => {
91
+ EventIndexProperty.isLogin(() => {
93
92
  let newItem = {
94
93
  has_addition: has_addition,
95
94
  ...item,
@@ -1,26 +1,26 @@
1
1
  // withHooks
2
2
 
3
3
  import { applyStyle } from 'esoftplay';
4
- import { BboConfigProperty } from 'esoftplay/cache/bbo/config/import';
5
4
  import { EventButton } from 'esoftplay/cache/event/button/import';
5
+ import { EventConfigProperty } from 'esoftplay/cache/event/config/import';
6
6
  import { EventCountdownProperty } from 'esoftplay/cache/event/countdown/import';
7
7
  import { EventHeader } from 'esoftplay/cache/event/header/import';
8
+ import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
9
+ import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
10
+ import { EventShare } from 'esoftplay/cache/event/share/import';
8
11
  import { LibCarrousel } from 'esoftplay/cache/lib/carrousel/import';
9
12
  import { LibCurl } from 'esoftplay/cache/lib/curl/import';
10
- import { LibHtmltext } from 'esoftplay/cache/lib/htmltext/import';
11
13
  import { LibIcon } from 'esoftplay/cache/lib/icon/import';
12
14
  import { LibLoading } from 'esoftplay/cache/lib/loading/import';
13
15
  import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
14
16
  import { LibObject } from 'esoftplay/cache/lib/object/import';
15
17
  import { LibPicture } from 'esoftplay/cache/lib/picture/import';
16
- import { LibShare } from 'esoftplay/cache/lib/share/import';
17
18
  import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
18
19
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
19
20
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
20
21
  import { LibUtils } from 'esoftplay/cache/lib/utils/import';
21
22
  import { LibVideoProperty } from 'esoftplay/cache/lib/video/import';
22
23
  import { LibWebview } from 'esoftplay/cache/lib/webview/import';
23
- import { UserProfileProperty } from 'esoftplay/cache/user/profile/import';
24
24
  import esp from 'esoftplay/esp';
25
25
  import moment from 'esoftplay/moment';
26
26
  import useSafeState from 'esoftplay/state';
@@ -39,7 +39,7 @@ export default function m(props: EventArtist_detailProps): any {
39
39
  const { data, subscribed } = LibNavigation.getArgsAll(props)
40
40
  const startBooking = moment(data?.start_booking).serverFormat('YYYY-MM-DD HH:mm:ss')
41
41
  const date = moment().localeFormat('YYYY-MM-DD HH:mm:ss')
42
- const [bboConfig] = BboConfigProperty.state().useState()
42
+ const [eventConfig] = EventConfigProperty.state().useState()
43
43
 
44
44
  const [selectedTicket, setSelectedTicket, getSelectedTicket] = useSafeState<any>()
45
45
  const [priceList, setPriceList] = useSafeState<any>()
@@ -47,7 +47,7 @@ export default function m(props: EventArtist_detailProps): any {
47
47
 
48
48
  useEffect(() => {
49
49
  loadDataPrice()
50
- BboConfigProperty.curlConfig('v2/config_order_type')
50
+ EventConfigProperty.curlConfig('v2/config_order_type')
51
51
  return () => { EventCountdownProperty.releaseQueue.trigger() }
52
52
  }, [])
53
53
 
@@ -129,7 +129,7 @@ export default function m(props: EventArtist_detailProps): any {
129
129
  if (selectedTicket?.use_seat == 1) {
130
130
  if (selectedTicket?.config && selectedTicket?.config?.seat_autopick == 1) {
131
131
  LibNavigation.navigate('payment/ticket', {
132
- order_type: bboConfig?.order_type?.ticket,
132
+ order_type: eventConfig?.order_type?.ticket,
133
133
  tax: getSelectedTicket()?.tax || data?.tax,
134
134
  dataBookingEvent: { ...dataPost, qty: qty },
135
135
  subscribed: subscribed
@@ -149,7 +149,7 @@ export default function m(props: EventArtist_detailProps): any {
149
149
  dataPost.addition = additions
150
150
  }
151
151
  LibNavigation.navigate('payment/ticket', {
152
- order_type: bboConfig?.order_type?.ticket,
152
+ order_type: eventConfig?.order_type?.ticket,
153
153
  tax: getSelectedTicket()?.tax || data?.tax,
154
154
  dataBookingEvent: dataPost,
155
155
  fee_platform: {
@@ -161,7 +161,7 @@ export default function m(props: EventArtist_detailProps): any {
161
161
  })
162
162
  } else {
163
163
  LibNavigation.navigate('payment/ticket', {
164
- order_type: bboConfig?.order_type?.ticket,
164
+ order_type: eventConfig?.order_type?.ticket,
165
165
  tax: getSelectedTicket()?.tax || data?.tax,
166
166
  dataBookingEvent: dataPost,
167
167
  fee_platform: {
@@ -180,7 +180,7 @@ export default function m(props: EventArtist_detailProps): any {
180
180
  dataPost.addition = additions
181
181
  }
182
182
  LibNavigation.navigate('payment/ticket', {
183
- order_type: bboConfig?.order_type?.ticket,
183
+ order_type: eventConfig?.order_type?.ticket,
184
184
  tax: getSelectedTicket()?.tax || data?.tax,
185
185
  dataBookingEvent: dataPost,
186
186
  fee_platform: {
@@ -192,7 +192,7 @@ export default function m(props: EventArtist_detailProps): any {
192
192
  })
193
193
  } else {
194
194
  LibNavigation.navigate('payment/ticket', {
195
- order_type: bboConfig?.order_type?.ticket,
195
+ order_type: eventConfig?.order_type?.ticket,
196
196
  tax: getSelectedTicket()?.tax || data?.tax,
197
197
  dataBookingEvent: dataPost,
198
198
  fee_platform: {
@@ -226,17 +226,17 @@ export default function m(props: EventArtist_detailProps): any {
226
226
  {
227
227
  icon: 'icons/ic_facebook.png',
228
228
  title: 'Facebook',
229
- onPress: () => { LibShare.facebook(data?.url) }
229
+ onPress: () => { EventShare.facebook(data?.url) }
230
230
  },
231
231
  {
232
232
  icon: 'icons/ic_whatsapp.png',
233
233
  title: 'Whatsapp',
234
- onPress: () => { LibShare.whatsapp(data?.url) }
234
+ onPress: () => { EventShare.whatsapp(data?.url) }
235
235
  },
236
236
  {
237
237
  icon: 'icons/ic_twitter.png',
238
238
  title: 'Twitter',
239
- onPress: () => { LibShare.twitter(data?.url) }
239
+ onPress: () => { EventShare.twitter(data?.url) }
240
240
  },
241
241
  {
242
242
  icon: 'icons/ic_copy.png',
@@ -281,6 +281,7 @@ export default function m(props: EventArtist_detailProps): any {
281
281
  // kondisi untuk tipe tiket yang ada tanggalnya
282
282
  if (item?.status == 1 && itemT?.status == 1) {
283
283
  setSelectedTicket(replaceList)
284
+ setQty(item.qty_min)
284
285
  } else if (item?.status == 0) {
285
286
  LibToastProperty.show(msg)
286
287
  } else if (item?.status == 2) {
@@ -417,7 +418,7 @@ export default function m(props: EventArtist_detailProps): any {
417
418
  {
418
419
  data?.book_available == 1 ?
419
420
  <EventButton label={esp.lang("event/artist_detail", "buy_ticket")} onPress={() => {
420
- UserProfileProperty.isLogin(() => {
421
+ EventIndexProperty.isLogin(() => {
421
422
  showSchedule.current?.show()
422
423
  })
423
424
  }} style={applyStyle({ backgroundColor: LibStyle.colorGreen })} />
@@ -445,7 +446,7 @@ export default function m(props: EventArtist_detailProps): any {
445
446
  }} key={i} style={{ overflow: 'hidden', margin: 15, marginBottom: 5, backgroundColor: '#fff', borderRadius: 10, ...LibStyle.elevation(2), borderWidth: 1, borderColor: selTic ? LibStyle.colorBlue : LibStyle.colorBgGrey }}>
446
447
  <View style={{ padding: 10, backgroundColor: '#f1f2f3', borderTopLeftRadius: 10, borderTopRightRadius: 10 }}>
447
448
  <View style={{ alignContent: 'center', alignItems: 'center', flexDirection: 'row', justifyContent: 'space-between', }}>
448
- <LibHtmltext allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.type}</LibHtmltext>
449
+ <EventHtmltext allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.type}</EventHtmltext>
449
450
  {
450
451
  item.qty_min > 1 &&
451
452
  <Text style={{ color: LibStyle.colorRed, fontSize: 10, fontWeight: 'normal' }}> {"(" + esp.lang("event/ticket_list", "min_order") + LibUtils.number(item.qty_min) + ")"}</Text>
@@ -500,7 +501,7 @@ export default function m(props: EventArtist_detailProps): any {
500
501
  </View>
501
502
  :
502
503
  <EventButton label={esp.lang("event/artist_detail", "buy_ticket")} onPress={() => {
503
- UserProfileProperty.isLogin(() => {
504
+ EventIndexProperty.isLogin(() => {
504
505
  proceedToPayment()
505
506
  })
506
507
  }} style={{ backgroundColor: LibStyle.colorGreen, marginTop: 2, marginHorizontal: 15 }} />
@@ -1,10 +1,12 @@
1
1
  // withHooks
2
2
 
3
3
  import { applyStyle } from 'esoftplay';
4
- import { BboConfigProperty } from 'esoftplay/cache/bbo/config/import';
5
4
  import { EventButton } from 'esoftplay/cache/event/button/import';
5
+ import { EventConfigProperty } from 'esoftplay/cache/event/config/import';
6
6
  import { EventCountdownProperty } from 'esoftplay/cache/event/countdown/import';
7
7
  import { EventHeader } from 'esoftplay/cache/event/header/import';
8
+ import { EventIndexProperty } from 'esoftplay/cache/event/index/import';
9
+ import { EventShare } from 'esoftplay/cache/event/share/import';
8
10
  import { LibCarrousel } from 'esoftplay/cache/lib/carrousel/import';
9
11
  import { LibCurl } from 'esoftplay/cache/lib/curl/import';
10
12
  import { LibIcon } from 'esoftplay/cache/lib/icon/import';
@@ -12,7 +14,6 @@ import { LibLoading } from 'esoftplay/cache/lib/loading/import';
12
14
  import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
13
15
  import { LibObject } from 'esoftplay/cache/lib/object/import';
14
16
  import { LibPicture } from 'esoftplay/cache/lib/picture/import';
15
- import { LibShare } from 'esoftplay/cache/lib/share/import';
16
17
  import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
17
18
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
18
19
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
@@ -20,7 +21,6 @@ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
20
21
  import { LibVideoProperty } from 'esoftplay/cache/lib/video/import';
21
22
  import { LibWebview } from 'esoftplay/cache/lib/webview/import';
22
23
  import { UseTasks } from 'esoftplay/cache/use/tasks/import';
23
- import { UserProfileProperty } from 'esoftplay/cache/user/profile/import';
24
24
  import esp from 'esoftplay/esp';
25
25
  import useLazyState from 'esoftplay/lazy';
26
26
  import moment from 'esoftplay/moment';
@@ -86,7 +86,7 @@ export default function m(props: EventArtist_detail_multiProps): any {
86
86
 
87
87
 
88
88
  useEffect(() => {
89
- BboConfigProperty.curlConfig('v2/config_order_type')
89
+ EventConfigProperty.curlConfig('v2/config_order_type')
90
90
  loadDataPrice()
91
91
  return () => { EventCountdownProperty.releaseQueue.trigger() }
92
92
  }, [])
@@ -178,7 +178,7 @@ export default function m(props: EventArtist_detail_multiProps): any {
178
178
  dataEvent.addition = dataAddition
179
179
  }
180
180
  LibNavigation.navigate('payment/ticket_multi', {
181
- order_type: BboConfigProperty?.state()?.get()?.order_type?.ticket,
181
+ order_type: EventConfigProperty?.state()?.get()?.order_type?.ticket,
182
182
  fee_platform: {
183
183
  fee_platform_amount: data?.fee_platform_amount,
184
184
  fee_platform_type: data?.fee_platform_type,
@@ -225,17 +225,17 @@ export default function m(props: EventArtist_detail_multiProps): any {
225
225
  {
226
226
  icon: 'icons/ic_facebook.png',
227
227
  title: 'Facebook',
228
- onPress: () => { LibShare.facebook(data?.url) }
228
+ onPress: () => { EventShare.facebook(data?.url) }
229
229
  },
230
230
  {
231
231
  icon: 'icons/ic_whatsapp.png',
232
232
  title: 'Whatsapp',
233
- onPress: () => { LibShare.whatsapp(data?.url) }
233
+ onPress: () => { EventShare.whatsapp(data?.url) }
234
234
  },
235
235
  {
236
236
  icon: 'icons/ic_twitter.png',
237
237
  title: 'Twitter',
238
- onPress: () => { LibShare.twitter(data?.url) }
238
+ onPress: () => { EventShare.twitter(data?.url) }
239
239
  },
240
240
  {
241
241
  icon: 'icons/ic_copy.png',
@@ -452,7 +452,7 @@ export default function m(props: EventArtist_detail_multiProps): any {
452
452
  {
453
453
  data?.book_available == 1 ?
454
454
  <EventButton label={esp.lang("event/artist_detail", "buy_ticket")} onPress={() => {
455
- UserProfileProperty.isLogin(() => {
455
+ EventIndexProperty.isLogin(() => {
456
456
  showSchedule.current?.show()
457
457
  })
458
458
  }} style={applyStyle({ backgroundColor: LibStyle.colorGreen })} />
@@ -528,7 +528,7 @@ export default function m(props: EventArtist_detail_multiProps): any {
528
528
  </View>
529
529
  :
530
530
  <EventButton label={esp.lang("event/artist_detail", "buy_ticket")} onPress={() => {
531
- UserProfileProperty.isLogin(() => {
531
+ EventIndexProperty.isLogin(() => {
532
532
  proceedToPayment()
533
533
  })
534
534
  }} style={{ backgroundColor: LibStyle.colorGreen, marginTop: 2, marginHorizontal: 15 }} />
@@ -0,0 +1,56 @@
1
+ // noPage
2
+ // withHooks
3
+ // import Storage from '@react-native-async-storage/async-storage';
4
+
5
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
6
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
7
+ import useGlobalState from 'esoftplay/global';
8
+ import FastStorage from 'esoftplay/mmkv';
9
+ import useSafeState from 'esoftplay/state';
10
+
11
+ import React, { useEffect } from 'react';
12
+ import { View } from 'react-native';
13
+
14
+ export interface EventBlockArgs {
15
+
16
+ }
17
+ export interface EventBlockProps {
18
+ cache?: boolean,
19
+ url: string,
20
+ LoadingView?: any,
21
+ ErrorView?: (error: string) => any,
22
+ render: (data: any, setData?: (d: any) => void) => any
23
+ }
24
+
25
+ FastStorage.removeItem("event/block")
26
+ const blockState = useGlobalState({}, { persistKey: 'event/block2', inFastStorage: true, loadOnInit: true })
27
+
28
+ export default function m(props: EventBlockProps): any {
29
+ const [data, setData] = useSafeState(blockState.get('block-' + props.url))
30
+ const [error, setError] = useSafeState('')
31
+
32
+ useEffect(() => {
33
+ new LibCurl(props.url, null, (res, msg) => {
34
+ setData(res)
35
+ if (props.cache && isValidJSON(res)) {
36
+ blockState.set(LibObject.set(blockState.get(), res)('block-' + props.url))
37
+ }
38
+ }, (msg: any) => setError(msg?.message))
39
+ }, [props.url])
40
+
41
+ if (error != '') return props.ErrorView ? props.ErrorView(error) : null
42
+ if (!data) return props.LoadingView || <View style={styleId_ZyMPQq} />
43
+ return props.render(data, setData)
44
+ }
45
+
46
+
47
+ function isValidJSON(jsonObject: any) {
48
+ try {
49
+ JSON.parse(JSON.stringify(jsonObject));
50
+ return true;
51
+ } catch (e) {
52
+ return false;
53
+ }
54
+ }
55
+
56
+ const styleId_ZyMPQq: any = { margin: 4, borderRadius: 2, flex: 1, padding: 20, backgroundColor: '#f1f2f3' }
@@ -0,0 +1,39 @@
1
+ // noPage
2
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
3
+ import esp from 'esoftplay/esp';
4
+
5
+ import * as FileSystem from 'expo-file-system';
6
+ import * as MediaLibrary from 'expo-media-library';
7
+ import { Platform } from 'react-native';
8
+ import { captureRef } from "react-native-view-shot";
9
+
10
+ export default class m {
11
+ static capture(ref: any, name: string): void {
12
+ MediaLibrary.requestPermissionsAsync().then((r) => {
13
+ if (r.granted) {
14
+ captureRef(ref, {
15
+ format: "jpg",
16
+ quality: 0.8
17
+ }).then(
18
+ (images: string) => {
19
+ const uriArray = images.split("/");
20
+ const nameToChange = uriArray[uriArray.length - 1];
21
+ const renamedURI = images.replace(nameToChange, name.replace(/\s/g, '_') + ".jpg");
22
+ if (Platform.OS == 'ios') {
23
+ MediaLibrary.saveToLibraryAsync(images)
24
+ LibToastProperty.show(esp.lang("lib/capture", "saved_to_gallery"))
25
+ return
26
+ }
27
+ FileSystem.copyAsync({ from: images, to: renamedURI }).then(() => {
28
+ MediaLibrary.saveToLibraryAsync(renamedURI)
29
+ LibToastProperty.show(esp.lang("lib/capture", "saved_to_dcim"))
30
+ }).catch((r) => {
31
+
32
+ })
33
+ },
34
+ error => LibToastProperty.show(error)
35
+ )
36
+ }
37
+ })
38
+ }
39
+ }
package/event/config.ts CHANGED
@@ -1,4 +1,25 @@
1
- //noPage
2
- import { BboConfig } from "esoftplay/cache/bbo/config/import";
1
+ // useLibs
2
+ // noPage
3
+ import { LibCurl } from "esoftplay/cache/lib/curl/import"
4
+ import { LibObject } from "esoftplay/cache/lib/object/import"
5
+ import useGlobalState, { useGlobalReturn } from "esoftplay/global"
3
6
 
4
- export default BboConfig
7
+ const config = useGlobalState({}, { persistKey: 'bbo-config', loadOnInit: true, inFastStorage: true })
8
+
9
+ export function state(): useGlobalReturn<any> {
10
+ return config
11
+ }
12
+
13
+ export default config
14
+
15
+ export function addConfig(name: string, data: any) {
16
+ config.set(LibObject.set(config.get(), data)(name))
17
+ }
18
+
19
+ export function curlConfig(url: string) {
20
+ new LibCurl(url, null, (res, msg) => {
21
+ addConfig(Object.keys(res)[0], res[Object.keys(res)[0]])
22
+ }, err => {
23
+
24
+ })
25
+ }
@@ -1,6 +1,7 @@
1
1
  // withHooks
2
2
 
3
3
  import { EventCountdown_base } from 'esoftplay/cache/event/countdown_base/import';
4
+ import { EventFirebase_socket } from 'esoftplay/cache/event/firebase_socket/import';
4
5
  import { EventQueue_pricingProperty } from 'esoftplay/cache/event/queue_pricing/import';
5
6
  import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
6
7
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
@@ -10,7 +11,6 @@ import useGlobalState from 'esoftplay/global';
10
11
  import useGlobalSubscriber from 'esoftplay/subscribe';
11
12
  import React, { useEffect } from 'react';
12
13
  import Animated, { useAnimatedStyle, useSharedValue, withRepeat, withTiming } from 'react-native-reanimated';
13
- import useFirebaseSocket from '../lib/firebase_socket';
14
14
 
15
15
  export interface EventCountdownArgs {
16
16
 
@@ -26,7 +26,7 @@ export const releaseQueue = useGlobalSubscriber()
26
26
  export default function m(props: EventCountdownProps): any {
27
27
  const [timer] = countdownTime.useState()
28
28
  const routes = UserRoutes.state().useSelector((x) => x?.routes)
29
- const { doneQueue, isInPricingQueueConfig } = useFirebaseSocket();
29
+ const { doneQueue, isInPricingQueueConfig } = EventFirebase_socket();
30
30
 
31
31
  const animatedValue = useSharedValue(0)
32
32
 
@@ -7,16 +7,16 @@ import { EventCounter_section } from 'esoftplay/cache/event/counter_section/impo
7
7
  import { LibCurl } from 'esoftplay/cache/lib/curl/import';
8
8
  import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
9
9
  import { LibIcon } from 'esoftplay/cache/lib/icon/import';
10
- import { LibInput_rectangle } from 'esoftplay/cache/lib/input_rectangle/import';
11
10
  import { LibLoading } from 'esoftplay/cache/lib/loading/import';
12
11
  import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
13
12
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
14
- import { UserPopup } from 'esoftplay/cache/user/popup/import';
15
13
  import esp from 'esoftplay/esp';
16
14
  import useSafeState from 'esoftplay/state';
17
15
 
18
16
  import { EventButton } from 'esoftplay/cache/event/button/import';
19
17
  import { EventHeader } from 'esoftplay/cache/event/header/import';
18
+ import { EventInput_rectangle } from 'esoftplay/cache/event/input_rectangle/import';
19
+ import { EventPopup } from 'esoftplay/cache/event/popup/import';
20
20
  import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
21
21
  import React, { useEffect, useRef } from 'react';
22
22
  import { Pressable, RefreshControl, ScrollView, Text, View } from 'react-native';
@@ -140,7 +140,7 @@ export default function m(props: EventCounter_cashierProps): any {
140
140
  <View style={{ backgroundColor: '#fff', borderTopLeftRadius: 20, borderTopRightRadius: 20 }}>
141
141
  <View style={{ height: 4, width: 32, borderRadius: 2, backgroundColor: "#C6C6C6", marginTop: 10, marginBottom: 10, alignSelf: 'center' }} />
142
142
  <View style={{ margin: 15 }}>
143
- <LibInput_rectangle
143
+ <EventInput_rectangle
144
144
  autoCapitalize="none"
145
145
  onChangeText={setEmail}
146
146
  style={{ borderColor: '#c4c4c4', height: 35, marginTop: 8, borderRadius: 15, }}
@@ -166,7 +166,7 @@ export default function m(props: EventCounter_cashierProps): any {
166
166
  <LibSlidingup ref={dialogUser}>
167
167
  <View style={{ backgroundColor: '#fff', borderTopLeftRadius: 20, borderTopRightRadius: 20 }}>
168
168
  <View style={{ height: 4, width: 32, borderRadius: 2, backgroundColor: "#C6C6C6", marginTop: 10, marginBottom: 10, alignSelf: 'center' }} />
169
- <UserPopup email={email.trim()} redirect={() => {
169
+ <EventPopup email={email.trim()} redirect={() => {
170
170
  addLM()
171
171
  }} cancel={() => {
172
172
  dialogUser.current?.hide()
@@ -8,21 +8,21 @@ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
8
8
  import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
9
9
  import { LibFocus } from 'esoftplay/cache/lib/focus/import';
10
10
  import { LibIcon } from 'esoftplay/cache/lib/icon/import';
11
- import { LibInput_rectangle } from 'esoftplay/cache/lib/input_rectangle/import';
12
11
  import { LibLoading } from 'esoftplay/cache/lib/loading/import';
13
12
  import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
14
13
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
15
14
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
16
15
  import { LibUtils } from 'esoftplay/cache/lib/utils/import';
17
- import { UserPopup } from 'esoftplay/cache/user/popup/import';
18
16
  import esp from 'esoftplay/esp';
19
17
  import useSafeState from 'esoftplay/state';
20
18
 
21
- import { BboConfigProperty } from 'esoftplay/cache/bbo/config/import';
22
19
  import { EventButton } from 'esoftplay/cache/event/button/import';
20
+ import { EventConfigProperty } from 'esoftplay/cache/event/config/import';
23
21
  import { EventHeader } from 'esoftplay/cache/event/header/import';
22
+ import { EventInput_rectangle } from 'esoftplay/cache/event/input_rectangle/import';
24
23
  import { EventLabel_input } from 'esoftplay/cache/event/label_input/import';
25
24
  import { EventMessage } from 'esoftplay/cache/event/message/import';
25
+ import { EventPopup } from 'esoftplay/cache/event/popup/import';
26
26
  import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
27
27
  import React, { useEffect, useRef } from 'react';
28
28
  import { Pressable, RefreshControl, ScrollView, Text, TouchableOpacity, View } from 'react-native';
@@ -54,7 +54,7 @@ export default function m(props: EventCounter_eoProps): any {
54
54
  const dialogAdd = useRef<LibSlidingup>(null)
55
55
  const dialogUser = useRef<LibSlidingup>(null)
56
56
  const dialogListLM = useRef<LibSlidingup>(null)
57
- const [bboConfig] = BboConfigProperty.state().useState()
57
+ const [eventConfig] = EventConfigProperty.state().useState()
58
58
 
59
59
  const [email, setEmail] = useSafeState<string>('')
60
60
  // result
@@ -69,7 +69,7 @@ export default function m(props: EventCounter_eoProps): any {
69
69
  });
70
70
 
71
71
  useEffect(() => {
72
- BboConfigProperty.curlConfig('v2/config_event')
72
+ EventConfigProperty.curlConfig('v2/config_event')
73
73
  loadData()
74
74
  }, [])
75
75
 
@@ -331,7 +331,7 @@ export default function m(props: EventCounter_eoProps): any {
331
331
 
332
332
  <EventLabel_input label={esp.lang("event/counter_eo", "label_email")} />
333
333
 
334
- <LibInput_rectangle
334
+ <EventInput_rectangle
335
335
  autoCapitalize="none"
336
336
  onChangeText={(t) => {
337
337
  LibUtils.debounce(() => {
@@ -368,7 +368,7 @@ export default function m(props: EventCounter_eoProps): any {
368
368
  <View style={{ backgroundColor: '#fff', padding: 10, paddingLeft: 0, borderRadius: 15, marginBottom: 0, flexDirection: 'row', flexWrap: 'wrap' }}>
369
369
 
370
370
  {
371
- bboConfig?.event?.cashier_type?.map(renderTypeCashier)
371
+ eventConfig?.event?.cashier_type?.map(renderTypeCashier)
372
372
  }
373
373
 
374
374
  </View>
@@ -420,7 +420,7 @@ export default function m(props: EventCounter_eoProps): any {
420
420
  <LibSlidingup ref={dialogUser}>
421
421
  <View style={{ backgroundColor: '#fff', borderTopLeftRadius: 20, borderTopRightRadius: 20 }}>
422
422
  <View style={{ height: 4, width: 32, borderRadius: 2, backgroundColor: "#C6C6C6", marginTop: 10, marginBottom: 10, alignSelf: 'center' }} />
423
- <UserPopup email={email.trim()} redirect={() => {
423
+ <EventPopup email={email.trim()} redirect={() => {
424
424
  if (selectedTypeAdd?.id == 2) {
425
425
  addCashier()
426
426
  } else {
@@ -9,21 +9,21 @@ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
9
9
  import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
10
10
  import { LibFocus } from 'esoftplay/cache/lib/focus/import';
11
11
  import { LibIcon } from 'esoftplay/cache/lib/icon/import';
12
- import { LibInput_rectangle } from 'esoftplay/cache/lib/input_rectangle/import';
13
12
  import { LibLoading } from 'esoftplay/cache/lib/loading/import';
14
13
  import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
15
14
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
16
15
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
17
16
  import { LibUtils } from 'esoftplay/cache/lib/utils/import';
18
- import { UserPopup } from 'esoftplay/cache/user/popup/import';
19
17
  import esp from 'esoftplay/esp';
20
18
  import useSafeState from 'esoftplay/state';
21
19
 
22
- import { BboConfigProperty } from 'esoftplay/cache/bbo/config/import';
23
20
  import { EventButton } from 'esoftplay/cache/event/button/import';
21
+ import { EventConfigProperty } from 'esoftplay/cache/event/config/import';
24
22
  import { EventHeader } from 'esoftplay/cache/event/header/import';
23
+ import { EventInput_rectangle } from 'esoftplay/cache/event/input_rectangle/import';
25
24
  import { EventLabel_input } from 'esoftplay/cache/event/label_input/import';
26
25
  import { EventMessage } from 'esoftplay/cache/event/message/import';
26
+ import { EventPopup } from 'esoftplay/cache/event/popup/import';
27
27
  import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
28
28
  import React, { useEffect, useRef } from 'react';
29
29
  import { Pressable, RefreshControl, ScrollView, Text, TouchableOpacity, View } from 'react-native';
@@ -39,7 +39,7 @@ export default function m(props: EventCounter_lmProps): any {
39
39
  const { is_manager } = LibNavigation.getArgsAll(props)
40
40
  const dialogAdd = useRef<LibSlidingup>(null)
41
41
  const dialogUser = useRef<LibSlidingup>(null)
42
- const [bboConfig] = BboConfigProperty.state().useState()
42
+ const [eventConfig] = EventConfigProperty.state().useState()
43
43
 
44
44
  const [email, setEmail] = useSafeState<string>('')
45
45
 
@@ -48,7 +48,7 @@ export default function m(props: EventCounter_lmProps): any {
48
48
  const [refreshing, setRefreshing] = useSafeState<boolean>(false);
49
49
 
50
50
  useEffect(() => {
51
- BboConfigProperty.curlConfig('v2/config_event')
51
+ EventConfigProperty.curlConfig('v2/config_event')
52
52
  loadData()
53
53
  }, [])
54
54
 
@@ -211,7 +211,7 @@ export default function m(props: EventCounter_lmProps): any {
211
211
  <View style={{ margin: 15 }}>
212
212
  <EventLabel_input label={esp.lang("event/counter_eo", "label_email")} />
213
213
 
214
- <LibInput_rectangle
214
+ <EventInput_rectangle
215
215
  autoCapitalize="none"
216
216
  onChangeText={(t) => {
217
217
  LibUtils.debounce(() => {
@@ -237,7 +237,7 @@ export default function m(props: EventCounter_lmProps): any {
237
237
  <View style={{ backgroundColor: '#fff', padding: 10, paddingLeft: 0, borderRadius: 15, marginBottom: 0, flexDirection: 'row', flexWrap: 'wrap' }}>
238
238
 
239
239
  {
240
- bboConfig?.event?.cashier_type?.map(renderTypeCashier)
240
+ eventConfig?.event?.cashier_type?.map(renderTypeCashier)
241
241
  }
242
242
  </View>
243
243
 
@@ -259,7 +259,7 @@ export default function m(props: EventCounter_lmProps): any {
259
259
  <LibSlidingup ref={dialogUser}>
260
260
  <View style={{ backgroundColor: '#fff', borderTopLeftRadius: 20, borderTopRightRadius: 20 }}>
261
261
  <View style={{ height: 4, width: 32, borderRadius: 2, backgroundColor: "#C6C6C6", marginTop: 10, marginBottom: 10, alignSelf: 'center' }} />
262
- <UserPopup email={email.trim()} redirect={() => {
262
+ <EventPopup email={email.trim()} redirect={() => {
263
263
  addCashier()
264
264
  }} cancel={() => {
265
265
  dialogUser.current?.hide()