esoftplay-event 0.0.1-d → 0.0.1-f

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
@@ -36,15 +36,12 @@ export default function m(props: BigbangArtistProps): any {
36
36
 
37
37
  const { title, has_addition } = LibNavigation.getArgsAll(props)
38
38
  const url = LibNavigation.getArgs(props, 'url', 'event_artist')
39
- const regex = /(\d+)$/;
40
- const match = url.match(regex);
41
- const [event_id] = useSafeState(match?.[1])
42
39
 
43
40
  function loadData(): void {
44
41
  /* get detail event untuk dapat config antrian */
45
42
  new LibCurl(url, null,
46
43
  (res) => {
47
- new LibCurl(res?.[0]?.url_event || `event_detail/${event_id}`, null, (res) => {
44
+ new LibCurl(res?.[0]?.url_event || `event_detail/${res?.[0]?.event_id}`, null, (res) => {
48
45
  setResultEvent(res)
49
46
  if (res?.id) {
50
47
  EventFirebase_socketProperty.eventIdQueue.set(res?.id)
@@ -95,8 +92,8 @@ export default function m(props: BigbangArtistProps): any {
95
92
  }
96
93
  if (item.book_available == 1) {
97
94
  if (isInPricingQueueConfig(item.event_id)) {
98
- LibNavigation.navigateForResult('event/queue_pricing', { event_id: event_id, autoPass: false }).then((v) => {
99
- EventCountdownProperty.countdownTime.set(moment().add(EventFirebase_socketProperty.eventQueueConfig.get(event_id).time, 'seconds').localeFormat('YYYY-MM-DD HH:mm:ss'))
95
+ LibNavigation.navigateForResult('event/queue_pricing', { event_id: item?.event_id, autoPass: false }).then((v) => {
96
+ EventCountdownProperty.countdownTime.set(moment().add(EventFirebase_socketProperty.eventQueueConfig.get(item?.event_id).time, 'seconds').localeFormat('YYYY-MM-DD HH:mm:ss'))
100
97
  if (item?.config?.hasOwnProperty('multiprice') && item?.config?.multiprice == 1) {
101
98
  LibNavigation.navigate('event/artist_detail_multi', {
102
99
  data: newItem,
package/event/order.tsx CHANGED
@@ -128,7 +128,6 @@ export default function m(props: EventOrderProps): any {
128
128
  function renderItem(item: any) {
129
129
  return (
130
130
  <EventOrder_item item={item} onPress={() => {
131
- esp.log(item);
132
131
  // 7 pembayaran kadaluarsa
133
132
  LibNavigation.navigate(status == "7" ? 'event/order_detail_waiting' : 'event/order_detail', { url: item.url })
134
133
  }} />
@@ -133,8 +133,6 @@ export default function m(props: EventOrder_detailProps): any {
133
133
  function loadData(): void {
134
134
  new LibCurl(url + ((url.includes("?") ? "&" : "?") + 't=' + new Date().getTime()), null, (res: any) => {
135
135
  setResult(res)
136
- esp.log(res);
137
-
138
136
  new LibCurl(res?.url_coupon, null, (ress: any) => {
139
137
  setCoupons(ress)
140
138
  }, (error: any) => {
@@ -470,7 +468,7 @@ export default function m(props: EventOrder_detailProps): any {
470
468
 
471
469
  <EventAlert
472
470
  color="#FFC523"
473
- msg={esp.lang("event/order_detail", "not_allowed_ss")}
471
+ msg={esp.lang("event/order_detail", "not_allowed_ss", esp.appjson().expo.name)}
474
472
  useIcon
475
473
  style={{ marginBottom: 0, margin: 15 }}
476
474
  />
@@ -725,7 +723,7 @@ export default function m(props: EventOrder_detailProps): any {
725
723
  <View style={{ padding: 5, }}>
726
724
  <EventButton label={Number(result.is_shareable) ? /*share_ticket*/esp.lang("event/order_detail", "share_ticket") : esp.lang("event/order_detail", "shared")} onPress={() => {
727
725
  if (Number(result.is_shareable)) {
728
- LibDialog.confirm(esp.lang("event/order_detail", "share_title"), esp.lang("event/order_detail", "share_msg"), esp.lang("event/order_detail", "share_ok"), () => {
726
+ LibDialog.confirm(esp.lang("event/order_detail", "share_title"), esp.lang("event/order_detail", "share_msg", esp.appjson().expo.name), esp.lang("event/order_detail", "share_ok"), () => {
729
727
  LibNavigation.navigate('event/order_share_to', { url: url })
730
728
  }, esp.lang("event/order_detail", "share_no"), () => {
731
729
 
@@ -15,7 +15,7 @@ import { LibStyle } from "esoftplay/cache/lib/style/import";
15
15
  import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
16
16
  import esp from "esoftplay/esp";
17
17
  import useSafeState from "esoftplay/state";
18
- import { ScrollView, Text, View } from "react-native";
18
+ import { Linking, ScrollView, Text, View } from "react-native";
19
19
 
20
20
 
21
21
 
@@ -68,17 +68,17 @@ export default function m(props: EventOrder_detail_upgrade_paymentProps): any {
68
68
  }
69
69
  LibProgress.show(esp.lang("event/order_detail_upgrade_payment", "confirm_wait"))
70
70
  new LibCurl('event_order_detail_upgrade_checkout', post, (res, msg) => {
71
- esp.log({ post });
72
71
  LibProgress.hide()
73
72
  LibNavigation.reset()
74
- if (selectedPayment?.payment_id == 2) /* bbo pay */ {
75
- LibToastProperty.show(msg)
76
- LibNavigation.navigate('event/order_detail', { url: res?.url })
77
- } else if (selectedPayment?.payment_id == 3)/* cc */ {
73
+ if (res?.hasOwnProperty('url_mobile') && res?.url_mobile != null) {
74
+ Linking.openURL(res?.url_mobile)
75
+ LibNavigation.push('event/order_detail_waiting', { url: res?.url })
76
+ } else if (res?.hasOwnProperty('url_web') && res?.url_web != null) {
78
77
  LibNavigation.navigateForResult('payment/cc_web', {
79
78
  ...res,
80
79
  statusSuccess: [1]
81
80
  }).then((res) => {
81
+ LibNavigation.backToRoot()
82
82
  LibNavigation.push('user/profile')
83
83
  if (res?.hasOwnProperty('params_error') || res?.hasOwnProperty('failed')) {
84
84
  LibNavigation.push('event/order_waiting')
@@ -88,8 +88,14 @@ export default function m(props: EventOrder_detail_upgrade_paymentProps): any {
88
88
  }
89
89
  })
90
90
  } else {
91
- LibNavigation.navigate('event/order_detail_waiting', { url: res?.url })
91
+ if (res?.url?.includes("waiting")) {
92
+ LibNavigation.push('event/order_waiting')
93
+ }
94
+ LibNavigation.push(res?.url?.includes("waiting") ? 'event/order_detail_waiting' : 'event/order_detail', {
95
+ url: res.url,
96
+ })
92
97
  }
98
+
93
99
  }, (err) => {
94
100
  LibProgress.hide()
95
101
  LibDialog.warning(esp.lang("event/order_detail_upgrade_payment", "oops"), err?.message)
@@ -98,7 +98,7 @@ export default function m(props: EventOrder_share_toProps): any {
98
98
 
99
99
  return (
100
100
  <LibKeyboard_avoid style={{ flex: 1, backgroundColor: '#fff' }}>
101
- <EventHeader title={esp.lang("event/order_share_to", "title_share_ticket_to")} />
101
+ <EventHeader title={esp.lang("event/order_share_to", "title_share_ticket_to", esp.appjson().expo.name)} />
102
102
  <ScrollView showsVerticalScrollIndicator={false} >
103
103
  <TouchableOpacity onPress={() => {
104
104
  LibNavigation.navigate('component/scanner', {
@@ -112,7 +112,7 @@ export default function m(props: EventOrder_share_toProps): any {
112
112
  <LibPicture source={esp.assets('icons/ic_barcode_white.png')} style={{ height: 250, width: 250 }} />
113
113
  <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>
114
114
  <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>
115
- <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")}</Text>
115
+ <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>
116
116
  </View>
117
117
  </TouchableOpacity>
118
118
  <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>
@@ -49,11 +49,11 @@ export default function m(props: EventScan_itemProps): any {
49
49
  <View style={{}}>
50
50
  {
51
51
  props?.item?.hall_scanned && props?.item?.hall_scanned != "0000-00-00 00:00:00" &&
52
- <Text allowFontScaling={false} ellipsizeMode={'tail'} numberOfLines={2} style={applyStyle({ color: "#c9c9c9", marginBottom: 4, fontSize: 14, letterSpacing: 1.5 })}>{esp.lang("event/scan_item", "scan_on") + LibUtils.moment(props?.item?.hall_scanned).serverFormat("DD MMMM YYYY H:m:s")}</Text>
52
+ <Text allowFontScaling={false} ellipsizeMode={'tail'} numberOfLines={2} style={applyStyle({ color: "#c9c9c9", marginBottom: 4, fontSize: 14, letterSpacing: 1.5 })}>{esp.lang("event/scan_item", "scan_on") + LibUtils.moment(props?.item?.hall_scanned).serverFormat("DD MMMM YYYY H:m:s ", props?.item?.timezone) + props.item?.timezone_locale || ""}</Text>
53
53
  }
54
54
  {
55
55
  !Array.isArray(props?.item?.scanned_detail) && props?.item?.scanned_detail?.scanned != "" && props?.item?.scanned_detail?.scanned != "0000-00-00 00:00:00" &&
56
- <Text allowFontScaling={false} ellipsizeMode={'tail'} numberOfLines={2} style={applyStyle({ color: LibStyle.colorRed, marginBottom: 4, fontSize: 14, letterSpacing: 1.5 })}>{esp.lang("event/scan_item", "scan_on") + LibUtils.moment(props?.item?.hall_scanned).serverFormat("DD MMMM YYYY H:m:s")}</Text>
56
+ <Text allowFontScaling={false} ellipsizeMode={'tail'} numberOfLines={2} style={applyStyle({ color: LibStyle.colorRed, marginBottom: 4, fontSize: 14, letterSpacing: 1.5 })}>{esp.lang("event/scan_item", "scan_on") + LibUtils.moment(props?.item?.scanned_detail?.scanned).serverFormat("DD MMMM YYYY H:m:s ", props?.item?.timezone) + props.item?.timezone_locale || ""}</Text>
57
57
  }
58
58
  {
59
59
  props.item?.status == 1 &&
@@ -78,7 +78,7 @@ export default function m(props: EventTms_check_ticket_resultProps): any {
78
78
  item.tms_name != "" &&
79
79
  <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item.tms_name}</Text>
80
80
  }
81
- <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item?.scanned_in != "0000-00-00 00:00:00" ? LibUtils.moment(item.scanned_in).serverFormat("DD MMM HH:mm:ss ") : esp.lang("event/tms_check_ticket_result", "not_scan_in")}</Text>
81
+ <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item?.scanned_in != "0000-00-00 00:00:00" ? (LibUtils.moment(item.scanned_in).serverFormat("DD MMM HH:mm:ss ", item.timezone) + item.hasOwnProperty("timezone_locale") ? item?.timezone_locale : "") : esp.lang("event/tms_check_ticket_result", "not_scan_in")}</Text>
82
82
 
83
83
  </View>
84
84
  )
@@ -91,7 +91,7 @@ export default function m(props: EventTms_check_ticket_resultProps): any {
91
91
  item.tms_name_out != null && item.tms_name_out != "" &&
92
92
  <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item.tms_name_out}</Text>
93
93
  }
94
- <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item?.scanned_out != "0000-00-00 00:00:00" ? LibUtils.moment(item.scanned_out).serverFormat("DD MMM HH:mm:ss ") : esp.lang("event/tms_check_ticket_result", "not_scan_out")}</Text>
94
+ <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item?.scanned_out != "0000-00-00 00:00:00" ? (LibUtils.moment(item.scanned_out).serverFormat("DD MMM HH:mm:ss ", item.timezone) + item.hasOwnProperty("timezone_locale") ? item?.timezone_locale : "") : esp.lang("event/tms_check_ticket_result", "not_scan_out")}</Text>
95
95
  </View>
96
96
  )
97
97
  }
@@ -99,7 +99,7 @@ export default function m(props: EventTms_check_ticket_resultProps): any {
99
99
  function renderTempOut(item: any, i: number) {
100
100
  return (
101
101
  <View key={i} style={{ borderRadius: 5, margin: 2, padding: 5, backgroundColor: i % 2 ? '#fff' : LibStyle.colorGrey, borderBottomWidth: 1, borderBottomColor: LibStyle.colorBgGrey }}>
102
- <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item.hasOwnProperty("scanned_out_temporary") && item?.scanned_out_temporary != "0000-00-00 00:00:00" ? LibUtils.moment(item.scanned_out_temporary).serverFormat("DD MMM HH:mm:ss ") : "Belum pernah scan keluar sementara"}</Text>
102
+ <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item.hasOwnProperty("scanned_out_temporary") && item?.scanned_out_temporary != "0000-00-00 00:00:00" ? (LibUtils.moment(item.scanned_out_temporary).serverFormat("DD MMM HH:mm:ss ", item.timezone) + item.hasOwnProperty("timezone_locale") ? item?.timezone_locale : "") : esp.lang("event/tms_check_ticket_result", "notyet_scan_temp_out")}</Text>
103
103
  </View>
104
104
  )
105
105
  }
@@ -119,7 +119,7 @@ export default function m(props: EventTms_check_ticket_resultProps): any {
119
119
  item.tms_name != "" &&
120
120
  <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item.tms_name}</Text>
121
121
  }
122
- <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item?.scanned_in != "0000-00-00 00:00:00" ? LibUtils.moment(item.scanned_in).serverFormat("DD MMM HH:mm:ss ") : esp.lang("event/tms_check_ticket_result", "not_scan_in")}</Text>
122
+ <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item?.scanned_in != "0000-00-00 00:00:00" ? (LibUtils.moment(item.scanned_in).serverFormat("DD MMM HH:mm:ss ", item.timezone) + item.hasOwnProperty("timezone_locale") ? item?.timezone_locale : "") : esp.lang("event/tms_check_ticket_result", "not_scan_in")}</Text>
123
123
 
124
124
  </View>
125
125
  )
@@ -132,7 +132,7 @@ export default function m(props: EventTms_check_ticket_resultProps): any {
132
132
  item.tms_name_out != "" &&
133
133
  <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item.tms_name_out}</Text>
134
134
  }
135
- <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item?.scanned_out != "0000-00-00 00:00:00" ? LibUtils.moment(item.scanned_out).serverFormat("DD MMM HH:mm:ss ") : esp.lang("event/tms_check_ticket_result", "not_scan_out")}</Text>
135
+ <Text allowFontScaling={false} style={{ paddingHorizontal: 5, fontSize: 14 }}>{item?.scanned_out != "0000-00-00 00:00:00" ? (LibUtils.moment(item.scanned_out).serverFormat("DD MMM HH:mm:ss ", item.timezone) + item.hasOwnProperty("timezone_locale") ? item?.timezone_locale : "") : esp.lang("event/tms_check_ticket_result", "not_scan_out")}</Text>
136
136
 
137
137
  </View>
138
138
  )
@@ -145,7 +145,7 @@ export default function m(props: EventTms_in_failedProps): any {
145
145
  <View style={{ flex: 1.2, justifyContent: 'center', paddingVertical: 5 }}>
146
146
  {
147
147
  item.scanned != "0000-00-00 00:00:00" &&
148
- <Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 12 }}>{LibUtils.moment(item.scanned).localeFormat("DD MMM H:mm:ss ")}</Text>
148
+ <Text allowFontScaling={false} style={{ textAlign: 'center', fontSize: 12 }}>{LibUtils.moment(item.scanned).localeFormat("DD MMM H:mm:ss ") + item.timezone_locale != "" ? item.timezone_locale : ""}</Text>
149
149
  }
150
150
  </View>
151
151
  <View style={{ flex: 2, justifyContent: 'center', borderLeftWidth: 1, borderColor: LibStyle.colorBgGrey, paddingVertical: 5 }}>
package/id.json CHANGED
@@ -957,7 +957,7 @@
957
957
  "leave_review": "Leave a Review",
958
958
  "load_err": "Oops",
959
959
  "location_empty": "Lokasi belum dipilih",
960
- "not_allowed_ss": "Harap hindari membuat screenshot atau foto tiket. Tunjukkan tiket asli di aplikasi BBO saat masuk ke area event. Terima kasih!",
960
+ "not_allowed_ss": "Harap hindari membuat screenshot atau foto tiket. Tunjukkan tiket asli di aplikasi %s saat masuk ke area event. Terima kasih!",
961
961
  "not_now": "Nanti Saja",
962
962
  "order_detail": "Order Detail",
963
963
  "payment_instruction": "Petunjuk Pembayaran",
@@ -976,7 +976,7 @@
976
976
  "select_domicile": "Pilih Domisili",
977
977
  "select_gender": "Pilih Jenis Kelamin",
978
978
  "send_to_email": "Kirim tiket ke email",
979
- "share_msg": "Pastikan temanmu sudah mendownload dan mendaftar di BBO",
979
+ "share_msg": "Pastikan temanmu sudah mendownload dan mendaftar di %s",
980
980
  "share_no": "Batal",
981
981
  "share_ok": "Lanjutkan",
982
982
  "share_ticket": "Bagikan Tiket ke Temanmu",
@@ -1135,7 +1135,7 @@
1135
1135
  "btn_yes_alert_cant_share_ticket_to_myself": "Ok",
1136
1136
  "btn_yes_alert_share_ticket": "Ya",
1137
1137
  "click_here": "Klik disini",
1138
- "in_member_bbo_page": "Yang terdapat pada halaman member BBO",
1138
+ "in_member_bbo_page": "Yang terdapat pada halaman member %s",
1139
1139
  "load_error": "Oops!",
1140
1140
  "msg_alert_cant_share_ticket_to_myself": "Anda tidak bisa membagikan tiket ke akun Anda sendiri",
1141
1141
  "msg_alert_share_ticket": "Bagikan Tiket ini ?",
@@ -1149,7 +1149,7 @@
1149
1149
  "title_alert_fault": "Kesalahan",
1150
1150
  "title_alert_share_ticket": "Konfirmasi",
1151
1151
  "title_curl_success": "Informasi",
1152
- "title_share_ticket_to": "Bagikan Tiket ke sesama member BBO"
1152
+ "title_share_ticket_to": "Bagikan Tiket ke sesama member %s"
1153
1153
  },
1154
1154
  "event/order_share_to_detail": {
1155
1155
  "back": "Kembali",
@@ -1428,6 +1428,7 @@
1428
1428
  "message": "Apakan anda yakin ingin mereset tiket ini ?",
1429
1429
  "not_scan_in": "Belum di scan masuk",
1430
1430
  "not_scan_out": "Belum di scan keluar",
1431
+ "notyet_scan_temp_out": "Belum pernah scan keluar sementara",
1431
1432
  "qr_info": "Informasi",
1432
1433
  "qr_msg": "Kode QR belum pernah dipindai",
1433
1434
  "reset": "RESET",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay-event",
3
- "version": "0.0.1-d",
3
+ "version": "0.0.1-f",
4
4
  "description": "event module on esoftplay framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,215 +0,0 @@
1
- // withHooks
2
- import { LibLoading } from 'esoftplay/cache/lib/loading/import';
3
- import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
4
- import { LibStyle } from 'esoftplay/cache/lib/style/import';
5
-
6
- import { EventFirebase_socket } from 'esoftplay/cache/event/firebase_socket/import';
7
- import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
8
- import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
9
- import esp from 'esoftplay/esp';
10
- import React, { useEffect } from 'react';
11
- import { View } from 'react-native';
12
-
13
-
14
- export interface EventTms_inArgs {
15
-
16
- }
17
- export interface EventTms_inProps {
18
-
19
- }
20
-
21
-
22
- export default function m(props: EventTms_inProps): any {
23
-
24
- const { price_type,
25
- gate_type,
26
- qr_code,
27
- event_id,
28
- selectGate,
29
- typeScanner,
30
- event_title,
31
- url_ticket_detail,
32
- url_ticket_update,
33
- configPriority,
34
- scan_type
35
- } = LibNavigation.getArgsAll<any>(props)
36
-
37
- const { get } = EventFirebase_socket()
38
-
39
- let whatTypeGate = gate_type == "1" ? 'in' : 'out'
40
-
41
- /* price_id */
42
- /* qty */
43
- /* name */
44
- /* qty_used */
45
- /* image */
46
- // sample: [
47
- // "1121": [
48
- // 2,
49
- // "Muhammad Bagus Yulianto",
50
- // 2,
51
- // "https://api.test.bbo.co.id/images/modules/user/avatar/122674696.jpg"
52
- // ],
53
- // "staff": [
54
- // [
55
- // 1,
56
- // "Muhammad Bagus Yulianto",
57
- // 0,
58
- // "https://api.test.bbo.co.id/images/modules/bigbang/exhibitor/1/staff/1211616174.jpg",
59
- // "VIP-Expo Indonesia Jaya"
60
- // ]
61
- // ]
62
- // ]
63
-
64
-
65
- function mainPath(qr: string) {
66
- let a = ['event', event_id, whatTypeGate, qr]
67
- return a.join('/')
68
- }
69
-
70
- let args = {
71
- price_type: price_type,
72
- gate_type: gate_type,
73
- qr_code: qr_code,
74
- event_id: event_id,
75
- event_title: event_title,
76
- selectGate: selectGate,
77
- typeScanner: typeScanner,
78
- url_ticket_detail: url_ticket_detail,
79
- url_ticket_update: url_ticket_update,
80
- configPriority: configPriority,
81
- scan_type: scan_type
82
- }
83
-
84
- useEffect(() => {
85
- if (qr_code) {
86
- loadData()
87
- } else {
88
- LibDialog.warningConfirm("Oops", "QR Code tidak ditemukan", "Kembali", () => {
89
- LibNavigation.back()
90
- }, "", () => { })
91
- }
92
- }, [])
93
-
94
- function direction(tikets: any, tiket: any) {
95
- if (tiket.qty > 1) {
96
- LibNavigation.replace('event/tms_in_list', {
97
- tickets: tikets,
98
- ...args
99
- })
100
- } else {
101
- LibNavigation.replace('event/tms_in_success', {
102
- selectedTicket: tiket,
103
- ...args
104
- })
105
- }
106
- }
107
-
108
- function loadData() {
109
- let tikets: any[] = []
110
- EventTms_homeProperty.addCounterEntranceScan(1, "0")
111
- get(mainPath(encodeURIComponent(encodeURIComponent(qr_code))), selectGate?.id, (res) => {
112
- esp.log({ res });
113
- if (!res) {
114
- LibNavigation.replace('event/tms_in_failed', {
115
- text: esp.lang("event/tms_in", "ticket_empty_today"),
116
- ...args
117
- })
118
- return
119
- } else {
120
- Object.keys(res).forEach((key) => {
121
- if (key == 'staff') {
122
- Object.values(res[key]).map((item: any) => {
123
- let x = {
124
- price_id: key,
125
- title: decodeURIComponent(item[4])?.split("+").join(' '),
126
- color: LibStyle.colorPrimary,
127
- key: item[5],
128
- user_name: item[1],
129
- user_image: item[3],
130
- exhibitor_name: decodeURIComponent(item[4])?.split("+").join(' '),
131
- qty: item[0],
132
- qty_used: item[2],
133
- qty_left: Number(item[0]) - (Number(item[2]) || 0),
134
- text: item[6] || "",
135
- }
136
- tikets.push(x)
137
- })
138
- } else {
139
- let a = {
140
- price_id: key,
141
- title: price_type?.filter?.((item: any) => item.id == key)[0]?.name,
142
- color: price_type?.filter?.((item: any) => item.id == key)[0]?.color,
143
- key: qr_code,
144
- user_name: Object.values(res[key])?.[1],
145
- user_image: Object.values(res[key])?.[3],
146
- qty: Object.values(res[key])?.[0],
147
- qty_used: Object.values(res[key])?.[2],
148
- qty_left: Number(Object.values(res[key])?.[0]) - (Number(Object.values(res[key])?.[2]) || 0),
149
- text: (Object.values(res[key])?.[4] == 'k' ? Object.values(res[key]) : Object.values(res[key])?.[4]) || ""
150
- }
151
- tikets.push(a)
152
- }
153
- })
154
-
155
- if (tikets.length > 0) {
156
- if (tikets.length == 1) {
157
- const tiket = tikets[0];
158
-
159
- if (tiket?.text == "") { // jika index ke 5 di result get nya TIDAK ADA text nya
160
- if (tiket.qty_left <= 0) { // jika qty left nya 0 maka tiketnya habis
161
- LibNavigation.replace('event/tms_in_failed', {
162
- text: esp.lang("event/tms_in", "ticket_empty"),
163
- ticketItem: tiket,
164
- ...args
165
- })
166
- } else { // jika masih punya tiket
167
- if (tiket.hasOwnProperty("exhibitor_name")) { // jika dia punya id card
168
- LibNavigation.replace('event/tms_idcard', {
169
- selectedTicket: tiket,
170
- ...args
171
- })
172
- } else { // ini data tiket user yang available
173
- if (configPriority) { // ini untuk memunculkan priority
174
- if (configPriority?.filter?.((item: any) => item.id == tiket.price_id).length > 0) {
175
- direction(tikets, tiket)
176
- } else { // ini jika di tms tidak memiliki hak scan tipe tiket tertentu
177
- LibNavigation.replace('event/tms_in_warning', {
178
- selectedTicket: tiket,
179
- ...args
180
- })
181
- }
182
- } else {
183
- direction(tikets, tiket)
184
- }
185
- }
186
- }
187
- } else {// jika index ke 5 di result get nya ADA text nya
188
- LibNavigation.replace('event/tms_in_failed', {
189
- text: tiket?.text,
190
- ticketItem: tiket,
191
- ...args
192
- })
193
- }
194
- } else { // ini jika tiketnya ada banyak
195
- LibNavigation.replace('event/tms_in_list', {
196
- tickets: tikets,
197
- ...args
198
- })
199
- }
200
- } else { // ini jika tiketnya tidak ada
201
- LibNavigation.replace('event/tms_in_failed', {
202
- text: esp.lang("event/tms_in", "ticket_not_found"),
203
- ...args
204
- })
205
- }
206
- }
207
- })
208
- }
209
-
210
- return (
211
- <View style={{ flex: 1, backgroundColor: '#fff' }}>
212
- <LibLoading />
213
- </View>
214
- )
215
- }