esoftplay-event 0.0.0-d → 0.0.0-g

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
@@ -50,7 +50,7 @@ export default function m(props: BigbangArtistProps): any {
50
50
  EventFirebase_socketProperty.eventIdQueue.set(res?.id)
51
51
  }
52
52
  if (res.allotment) {
53
- esp.modProp("lib/firebase_socket").userIdKeyReplacer.set({
53
+ esp.modProp("event/firebase_socket").userIdKeyReplacer.set({
54
54
  t: Number(res.allotment.t),
55
55
  s: Number(res.allotment.s),
56
56
  priority: 1
@@ -175,7 +175,7 @@ export default function m(props: EventArtist_detailProps): any {
175
175
  }
176
176
  } else {
177
177
  if (data?.has_addition && data?.has_addition == 1 || selectedTicket?.hasOwnProperty("has_addition") && selectedTicket?.has_addition == 1) {
178
- LibNavigation.navigateForResult('event/additional', { ondate: selectedTicket?.list?.ondate, event_id: data?.event_id, qty: qty, data: dataPost, price_id: selectedTicket?.price_id }, 221).then((additions) => {
178
+ LibNavigation.navigateForResult('event/additional', { type_ticket: selectedTicket?.type, ondate: selectedTicket?.list?.ondate, event_id: data?.event_id, qty: qty, data: dataPost, price_id: selectedTicket?.price_id }, 221).then((additions) => {
179
179
  if (additions != "") {
180
180
  dataPost.addition = additions
181
181
  }
package/event/detail.tsx CHANGED
@@ -42,7 +42,7 @@ export default function m(props: EventDetailProps): any {
42
42
  EventFirebase_socketProperty.eventIdQueue.set(res.id)
43
43
  setResult(res)
44
44
  if (res.allotment) {
45
- esp.modProp("lib/firebase_socket").userIdKeyReplacer.set({
45
+ esp.modProp("event/firebase_socket").userIdKeyReplacer.set({
46
46
  t: Number(res.allotment.t),
47
47
  s: Number(res.allotment.s),
48
48
  priority: 1
@@ -57,8 +57,6 @@ export default function m(props: EventDetailProps): any {
57
57
  })
58
58
  }
59
59
 
60
- esp.log({ result });
61
-
62
60
  useEffect(() => {
63
61
  loadData()
64
62
  }, [])
@@ -1,10 +1,10 @@
1
1
  // withHooks
2
2
 
3
- import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
4
3
  import { EventButton } from 'esoftplay/cache/event/button/import';
5
- import { EventTms_in_successProperty } from 'esoftplay/cache/event/tms_in_success/import';
6
4
  import { EventHeader } from 'esoftplay/cache/event/header/import';
7
5
  import { EventSheet } from 'esoftplay/cache/event/sheet/import';
6
+ import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
7
+ import { EventTms_in_successProperty } from 'esoftplay/cache/event/tms_in_success/import';
8
8
  import { LibCurl } from 'esoftplay/cache/lib/curl/import';
9
9
  import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
10
10
  import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
@@ -12,7 +12,6 @@ import { LibObject } from 'esoftplay/cache/lib/object/import';
12
12
  import { LibPicture } from 'esoftplay/cache/lib/picture/import';
13
13
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
14
14
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
15
- import { LibUtils } from 'esoftplay/cache/lib/utils/import';
16
15
  import { UserClass } from 'esoftplay/cache/user/class/import';
17
16
  import esp from 'esoftplay/esp';
18
17
  import useSafeState from 'esoftplay/state';
@@ -75,12 +74,9 @@ export default function m(props: EventTms_idcardProps): any {
75
74
  }, [])
76
75
 
77
76
  function entrance() {
78
- let url = url_ticket_update + LibUtils.objectToUrlParam({
79
- is_turnstile: 0,
80
- })
81
-
77
+ let url = url_ticket_update
82
78
  let post = {
83
- "target-url": "https://api.test.bbo.co.id/gate_checkin",
79
+ "target-url": `https://api.${esp.config().domain}/gate_checkin`,
84
80
  price_id: 0,
85
81
  qr: encodeURIComponent(selectedTicket?.key),
86
82
  trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
@@ -31,7 +31,7 @@ export function syncUsedTiket(): useGlobalReturn<any[]> {
31
31
 
32
32
  export default function m(props: EventTms_in_successProps): any {
33
33
  const { scan_type, url_ticket_update, url_ticket_detail, price_type, selectedTicket, gate_type, qr_code, event_id, selectGate, typeScanner, event_title, qty, configPriority } = LibNavigation.getArgsAll<any>(props)
34
- // const { set } = useFirebaseSocket()
34
+ // const { set } = EventFirebase_socket()
35
35
  const [isPaused, setIsPaused] = useSafeState<boolean>(false)
36
36
  const progress = useRef(new Animated.Value(0)).current;
37
37
  const animation = useRef<Animated.CompositeAnimation | null>(null);
@@ -93,12 +93,10 @@ export default function m(props: EventTms_in_successProps): any {
93
93
  }
94
94
 
95
95
  function useTicket() {
96
- let url = url_ticket_update + LibUtils.objectToUrlParam({
97
- is_turnstile: 0,
98
- })
96
+ let url = url_ticket_update
99
97
 
100
98
  let post = {
101
- "target-url": "https://api.test.bbo.co.id/gate_checkin",
99
+ "target-url": `https://api.${esp.config().domain}/gate_checkin`,
102
100
  price_id: selectedTicket?.price_id,
103
101
  qr: encodeURIComponent(qr_code),
104
102
  trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
@@ -64,7 +64,7 @@ export default function m(props: EventExchange_ticket_listProps): any {
64
64
  header={(show) => {
65
65
  return (
66
66
  <View style={{ ...LibStyle.elevation(2), borderTopLeftRadius: 5, borderTopRightRadius: 5, paddingHorizontal: 10, paddingVertical: 5, margin: 15, marginBottom: 5, backgroundColor: LibStyle.colorGreen, flexDirection: 'row', alignContent: 'center', alignItems: 'center', justifyContent: 'space-between', borderBottomWidth: 2, borderBottomColor: "#c9c9c9" }}>
67
- <Text allowFontScaling={false} style={{ fontSize: 16, fontWeight: 'bold', color: '#fff' }}>{"Laporan Scan Exchange Tiket"}</Text>
67
+ <Text allowFontScaling={false} style={{ fontSize: 16, fontWeight: 'bold', color: '#fff' }}>{esp.lang("event/exchange_ticket_list", "report_scan_exchange_ticket")}</Text>
68
68
  <LibIcon name={show ? 'chevron-up' : 'chevron-down'} color='#fff' />
69
69
  </View>
70
70
  )
@@ -75,34 +75,46 @@ export default function m(props: EventExchange_ticket_listProps): any {
75
75
  onPress={() => {
76
76
  if (log.hasOwnProperty("scan")) {
77
77
  buildTypeData("scan")
78
- setTitleSliding("Scan Tiket")
78
+ setTitleSliding(esp.lang("event/exchange_ticket_list", "scan_ticket"))
79
79
  }
80
80
  }} style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center', marginHorizontal: 15, paddingVertical: 6, borderBottomWidth: 1, borderBottomColor: LibStyle.colorLightGrey }}>
81
- <LibTextstyle text={"Scan"} textStyle="subhead" />
81
+ <View>
82
+ <LibTextstyle text={esp.lang("event/exchange_ticket_list", "scanning")} textStyle="subhead" />
83
+ <Text style={{ letterSpacing: 0.5, marginTop: 3, fontSize: 12, color: LibStyle.colorBrown }}>{esp.lang("event/exchange_ticket_list", "ticket_scanned")}</Text>
84
+ </View>
82
85
  <LibTextstyle text={LibUtils.number(getTotalAllHour(log?.scan))} textStyle="title2" />
83
86
  </Pressable>
84
87
  <Pressable
85
88
  onPress={() => {
86
89
  if (log.hasOwnProperty("scan_failed")) {
87
90
  buildTypeData("scan_failed")
88
- setTitleSliding("Scan Gagal")
91
+ setTitleSliding(esp.lang("event/exchange_ticket_list", "failed_scan"))
89
92
  }
90
93
  }} style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center', marginHorizontal: 15, paddingVertical: 6, borderBottomWidth: 1, borderBottomColor: LibStyle.colorLightGrey }}>
91
- <LibTextstyle text={"Scan Gagal"} textStyle="subhead" />
94
+ <View>
95
+ <LibTextstyle text={esp.lang("event/exchange_ticket_list", "failed_scan")} textStyle="subhead" />
96
+ <Text style={{ letterSpacing: 0.5, marginTop: 3, fontSize: 12, color: LibStyle.colorBrown }}>{esp.lang("event/exchange_ticket_list", "scan_failed")}</Text>
97
+ </View>
92
98
  <LibTextstyle text={LibUtils.number(getTotalAllHour(log?.scan_failed))} textStyle="title2" />
93
99
  </Pressable>
94
100
  <Pressable
95
101
  onPress={() => {
96
102
  if (log.hasOwnProperty("api_ok")) {
97
103
  buildTypeData("api_ok")
98
- setTitleSliding("Data Tiket Terkirim")
104
+ setTitleSliding(esp.lang("event/exchange_ticket_list", "tickets_send"))
99
105
  }
100
106
  }} style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center', marginHorizontal: 15, paddingVertical: 6, borderBottomWidth: 1, borderBottomColor: LibStyle.colorLightGrey }}>
101
- <LibTextstyle text={"Data terkirim"} textStyle="subhead" />
107
+ <View>
108
+ <LibTextstyle text={esp.lang("event/exchange_ticket_list", "data_send")} textStyle="subhead" />
109
+ <Text style={{ letterSpacing: 0.5, marginTop: 3, fontSize: 12, color: LibStyle.colorBrown }}>{esp.lang("event/exchange_ticket_list", "scan_success_send_to_server")}</Text>
110
+ </View>
102
111
  <LibTextstyle text={LibUtils.number(getTotalAllHour(log?.api_ok))} textStyle="title2" />
103
112
  </Pressable>
104
113
  <Pressable style={{ flexDirection: 'row', justifyContent: 'space-between', alignContent: 'center', alignItems: 'center', marginHorizontal: 15, paddingVertical: 6, borderBottomWidth: 1, borderBottomColor: LibStyle.colorLightGrey }}>
105
- <LibTextstyle text={"Data belum terkirim"} textStyle="subhead" />
114
+ <View>
115
+ <LibTextstyle text={esp.lang("event/exchange_ticket_list", "data_not_send")} textStyle="subhead" />
116
+ <Text style={{ letterSpacing: 0.5, marginTop: 3, fontSize: 12, color: LibStyle.colorBrown }}>{esp.lang("event/exchange_ticket_list", "data_not_send_to_server")}</Text>
117
+ </View>
106
118
  <LibTextstyle text={LibUtils.number(backup.length)} style={{ color: 'red' }} textStyle="title2" />
107
119
  </Pressable>
108
120
  {
@@ -1,65 +1,18 @@
1
1
  // noPage
2
2
  // useLibs
3
3
 
4
+ import { getAuth } from '@react-native-firebase/auth';
5
+ import { get, getDatabase, onValue, ref, set } from '@react-native-firebase/database';
6
+ import { collection, getCountFromServer, getDocs, getFirestore, orderBy, query, where } from '@react-native-firebase/firestore';
4
7
  import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
5
8
  import { LibCurl } from 'esoftplay/cache/lib/curl/import';
6
9
  import { LibObject } from 'esoftplay/cache/lib/object/import';
7
10
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
8
11
  import { LibUtils } from 'esoftplay/cache/lib/utils/import';
9
- import { UserClass } from 'esoftplay/cache/user/class/import';
10
12
  import esp from 'esoftplay/esp';
11
13
  import useGlobalState from 'esoftplay/global';
12
14
  import { createTimeout, useInterval } from 'esoftplay/timeout';
13
- import { initializeApp } from 'firebase/app';
14
- import { createUserWithEmailAndPassword, getAuth, signInWithEmailAndPassword } from 'firebase/auth';
15
- import { get, getDatabase, onValue, ref, set } from 'firebase/database';
16
- import { collection, getCountFromServer, getDocs, orderBy, query, where } from 'firebase/firestore';
17
- import { useLayoutEffect, useRef } from "react";
18
15
 
19
- let firebaseConfig = () => {
20
- return esp.isDebug("") ?
21
- /* test */{
22
- apiKey: "AIzaSyD9CeY0yS2e3fZy-mp3A326HWMtqL-VbW8",
23
- authDomain: "bbo-gate.firebaseapp.com",
24
- databaseURL: "https://bbo-gate-default-rtdb.asia-southeast1.firebasedatabase.app/",
25
-
26
- // apiKey: "AIzaSyB25Sbrf3Q4ysDyx95I65ibZLw47kz3_sc",
27
- // authDomain: "bigbang-online.firebaseapp.com",
28
- // databaseURL: "https://bigbang-online.firebaseio.com/",
29
- }
30
- :
31
- /* live */{
32
- apiKey: "AIzaSyB25Sbrf3Q4ysDyx95I65ibZLw47kz3_sc",
33
- authDomain: "bigbang-online.firebaseapp.com",
34
- databaseURL: "https://bigbang-online.firebaseio.com/",
35
- };
36
- };
37
-
38
-
39
- function readDeepObj(obj: any) {
40
- return function (param?: string, ...params: string[]): any {
41
- let out: any = obj
42
- if (param) {
43
- var _params = [param, ...params]
44
- if (_params.length > 0)
45
- for (let i = 0; i < _params.length; i++) {
46
- out = out?.[_params[i]];
47
- if (out == undefined) {
48
- break;
49
- }
50
- }
51
- }
52
- return out;
53
- }
54
- }
55
-
56
-
57
-
58
- function getBackup(path: string, onDone: (res: any) => void): any {
59
- // let data = stateBackup.get();
60
- // const paths = path.split('/');
61
- // onDone(readDeepObj(data)(...paths))
62
- }
63
16
 
64
17
  var _installationID: any;
65
18
  (async () => {
@@ -82,73 +35,22 @@ export const userIdKeyReplacer = useGlobalState<any>({})
82
35
 
83
36
  export default function useFirebaseSocket() {
84
37
  const [status] = state.useState()
85
- const userEmail = UserClass.state().useSelector(t => t?.email)
86
- const userId = UserClass.state().useSelector(t => t?.id)
87
- const app = useRef(initializeApp(firebaseConfig(), "BBOGATEv")).current
88
- const db = useRef(getDatabase(app)).current
89
- const auth = useRef(getAuth(app)).current
90
38
  const isDirect = EventTms_homeProperty.state()
91
39
 
92
- function initAppCustom() {
93
- return esp.mod("firestore/index")().init("CUSTOM", {
94
- "apiKey": "AIzaSyB04JT4JJfFsArIccAjBEn1nwIlg8EVWx4",
95
- "authDomain": "bigbang-online.firebaseapp.com",
96
- "databaseURL": "https://bigbang-online.firebaseio.com/",
97
- "storageBucket": "gs://bigbang-online.appspot.com/",
98
- "projectId": "bigbang-online"
99
- })
100
- }
101
-
102
- useLayoutEffect(() => {
103
- if (state.get() == 0 && userEmail && userId) {
104
- signInAnonym()
105
- initAppCustom()
106
- }
107
- }, [userEmail, userId])
108
-
109
- function signInAnonym(cb?: () => void) {
110
- const pass = LibUtils.shorten(userEmail + "" + userId)
111
- const password = esp.mod("firestore/index")().generatePassword(pass, userEmail)
112
-
113
- if (state.get() == 1) {
114
- cb?.()
115
- return
116
- } else
117
- doSign(userEmail, password, cb)
40
+ function isInLocal(state: any[], code: string) {
41
+ const encodedCode = encodeURIComponent(code)
42
+ return state.findIndex(([url, post]) => (post.qr == encodedCode || post.user_qr == encodedCode)) == -1 ? false : true
118
43
  }
119
44
 
120
- function doSign(email: string, password: string, cb?: () => void) {
121
- signInWithEmailAndPassword(auth, email, password).then(() => {
122
- state.set(1)
123
- cb?.()
124
- }).catch((err) => {
125
- if (err.code == "auth/user-not-found") {
126
- doRegisterFirebase(email, password, cb)
127
- } else {
128
- throw "ERROR : " + err.code
129
- }
130
- })
45
+ const auth = () => {
46
+ return getAuth()
131
47
  }
48
+ const db = () => {
49
+ return getDatabase()
132
50
 
133
- function doRegisterFirebase(email: string, password: string, cb?: () => void) {
134
- createUserWithEmailAndPassword(auth, email, password)
135
- .then((userCredential) => {
136
- state.set(1)
137
- cb?.()
138
- })
139
- .catch((error) => {
140
- if (error.code == "auth/email-already-in-use") {
141
- doSign(email, password, cb)
142
- } else {
143
- throw "ERROR : " + error.code
144
- }
145
- });
146
51
  }
147
52
 
148
- function isInLocal(state: any[], code: string) {
149
- const encodedCode = encodeURIComponent(code)
150
- return state.findIndex(([url, post]) => (post.qr == encodedCode || post.user_qr == encodedCode)) == -1 ? false : true
151
- }
53
+ const signInAnonym = () => { }
152
54
 
153
55
  // ini get yang di live
154
56
  async function _get(path: string, gate_id: string, onDone: (res: any) => void) {
@@ -164,7 +66,7 @@ export default function useFirebaseSocket() {
164
66
  return
165
67
  }
166
68
 
167
- get(ref(db, path))
69
+ get(ref(getDatabase(), path))
168
70
  .then((sn) => {
169
71
  hasDone = true
170
72
  if (sn.exists()) {
@@ -187,7 +89,7 @@ export default function useFirebaseSocket() {
187
89
  }
188
90
 
189
91
  function listenChangeTime(merchant_id: string, callback: (params: any) => void): () => void {
190
- const onChildChange = onValue(ref(db, 'merchant_offline/' + merchant_id), (sn) => {
92
+ const onChildChange = onValue(ref(getDatabase(), 'merchant_offline/' + merchant_id), (sn) => {
191
93
  if (sn.exists()) {
192
94
  callback(sn.val());
193
95
  }
@@ -198,7 +100,7 @@ export default function useFirebaseSocket() {
198
100
  async function _set(path: string, data: any, onDone?: (res: any) => void) {
199
101
  const timeout = createTimeout()
200
102
  if (state.get() == 1)
201
- set(ref(db, path), data)
103
+ set(ref(getDatabase(), path), data)
202
104
  else
203
105
  timeout.set(() => {
204
106
  _set(path, data,)
@@ -211,13 +113,15 @@ export default function useFirebaseSocket() {
211
113
  }
212
114
 
213
115
  function addQueue(path: string, event_id: string, onSuccess?: () => void) {
214
- const instance = initAppCustom()
116
+ const instance: any = esp.mod("firestore/index")().instance()
117
+ const db = getFirestore(instance)
118
+
215
119
  if (userIdKeyReplacer.get()?.priority == 1) {
216
- const coll = collection(instance.db, [getEventPath(), path, event_id].join('/'));
120
+ const coll = collection(db, [getEventPath(), path, event_id].join('/'));
217
121
  const q = query(coll, orderBy('t', 'asc'), where("t", "==", userIdKeyReplacer.get().t));
218
122
  getDocs(q).then((doc) => {
219
123
  if (doc.size == 0) {
220
- LibToastProperty.show(esp.lang("lib/firebase_socket", "priority_queue_used"))
124
+ LibToastProperty.show(esp.lang("event/firebase_socket", "priority_queue_used"))
221
125
  userIdKeyReplacer.set(LibObject.set(userIdKeyReplacer.get(), 0)('priority'))
222
126
  addQueue(path, event_id, onSuccess)
223
127
  } else if (doc.size == 1) {
@@ -236,15 +140,15 @@ export default function useFirebaseSocket() {
236
140
  } else {
237
141
  // console.log("ora")
238
142
  if (userIdKeyReplacer.get()?.id)
239
- esp.mod("firestore/index")().deleteDocument?.(instance.db, [getEventPath?.(), path, event_id, userIdKeyReplacer.get()?.id], () => { }, (e) => { })
143
+ esp.mod("firestore/index")().deleteDocument?.(instance, [getEventPath?.(), path, event_id, userIdKeyReplacer.get()?.id], () => { }, (e) => { })
240
144
  const ctime = getDateTimebyGmt7().getTime()
241
145
  const time = getRandomSuffix(ctime)
242
146
  const data = { t: ctime, s: time }
243
147
  // console.log(data)
244
- esp.mod("firestore/index")().addCollection?.(instance.db, [getEventPath?.(), path, event_id], data, (dt) => {
148
+ esp.mod("firestore/index")().addCollection?.(instance, [getEventPath?.(), path, event_id], data, (dt) => {
245
149
  // console.log("KENE",)
246
150
  userIdKeyReplacer.set?.({
247
- id: dt.id,
151
+ id: dt?.id,
248
152
  ...data
249
153
  })
250
154
  if (onSuccess) onSuccess?.()
@@ -260,11 +164,12 @@ export default function useFirebaseSocket() {
260
164
  return ori
261
165
  }
262
166
 
263
- // get weather function
167
+ // get weather function
264
168
 
265
169
  function getQueue(path: string, event_id: string, _limit: number, cb: (idx: number, key: string) => void) {
266
- const instance = initAppCustom()
267
- const coll = collection(instance.db, [getEventPath(), path, event_id].join('/'));
170
+ const instance: any = esp.mod("firestore/index")().instance()
171
+ const db = getFirestore(instance)
172
+ const coll = collection(db, [getEventPath(), path, event_id].join('/'));
268
173
  const q = query(coll, orderBy('s', 'asc'), where("s", "<", userIdKeyReplacer.get().s));
269
174
 
270
175
  getCountFromServer(q).then((v) => {
@@ -287,8 +192,8 @@ export default function useFirebaseSocket() {
287
192
  // LibToastProperty.show(esp.lang("lib/firebase_socket", "something_wrong_3"))
288
193
  // return
289
194
  // }
290
- // const exp = query(collection(instance.db, [getEventPath(), path, event_id].join('/')), where("t", "<", cdate - _limit), orderBy('t', 'asc'), limit(10));
291
- // const batch = writeBatch(instance.db);
195
+ // const exp = query(collection(instance, [getEventPath(), path, event_id].join('/')), where("t", "<", cdate - _limit), orderBy('t', 'asc'), limit(10));
196
+ // const batch = writeBatch(instance);
292
197
  // getDocs(exp).then((expd) => {
293
198
  // expd.forEach((doc) => {
294
199
  // if (Number(doc.data().s) < Number(userIdKeyReplacer.get().s))
@@ -303,20 +208,20 @@ export default function useFirebaseSocket() {
303
208
  }
304
209
 
305
210
  function updateQueueExp(path: string, event_id: string) {
306
- const instance = initAppCustom()
307
- esp.mod("firestore/index")().updateDocument(instance.db, [getEventPath(), path, event_id, userIdKeyReplacer.get().id], [{ key: 't', value: getDateTimebyGmt7().getTime() }], () => { }, (e) => {
211
+ const instance: any = esp.mod("firestore/index")().instance()
212
+ esp.mod("firestore/index")().updateDocument(instance, [getEventPath(), path, event_id, userIdKeyReplacer.get().id], [{ key: 't', value: getDateTimebyGmt7().getTime() }], () => { }, (e) => {
308
213
  // updateQueueExp(path, event_id, key)
309
214
  })
310
215
  }
311
216
 
312
217
  function doneQueue(path: string, event_id: string, key: string, cb: Function) {
313
218
  if (key) {
314
- const instance = initAppCustom()
315
- esp.mod("firestore/index")().deleteDocument(instance.db, [getEventPath(), path, event_id, key], () => {
219
+ const instance: any = esp.mod("firestore/index")().instance()
220
+ esp.mod("firestore/index")().deleteDocument(instance, [getEventPath(), path, event_id, key], () => {
316
221
  cb()
317
222
  userIdKeyReplacer.reset()
318
- }, () => {
319
- console.warn()
223
+ }, (e) => {
224
+ console.warn(e)
320
225
  })
321
226
  }
322
227
  }
@@ -327,13 +232,11 @@ export default function useFirebaseSocket() {
327
232
 
328
233
  function useQueueConfigListener() {
329
234
  function action() {
330
- fetch(esp.isDebug("") ?
331
- "https://storage.googleapis.com/bbo-images/images/modules/api/event_queue.json" + "?t=" + new Date().getTime() :
332
- "https://storage.googleapis.com/bbo-images/bbo.co.id/images/modules/api/event_queue.json" + "?t=" + new Date().getTime(), { "method": "GET" })
235
+ fetch(esp.config("events", "queue") + "?t=" + new Date().getTime(), { "method": "GET" })
333
236
  .then(res => res.json())
334
237
  .then((re) => {
335
238
  eventQueueConfig.set(re)
336
- });
239
+ })
337
240
 
338
241
  }
339
242
  const timeout = useInterval()
@@ -1,8 +1,8 @@
1
1
  // withHooks
2
2
  import { useEffect } from 'react';
3
3
 
4
- import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
5
4
  import { EventButton } from 'esoftplay/cache/event/button/import';
5
+ import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
6
6
  import { LibCurl } from 'esoftplay/cache/lib/curl/import';
7
7
  import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
8
8
  import { LibIcon } from 'esoftplay/cache/lib/icon/import';
@@ -72,7 +72,7 @@ export default function m(props: EventTms_in_hall_failedProps): any {
72
72
  if (dataEntranceIn.length > 0) {
73
73
  mustBeEntrance += 1
74
74
  let post = {
75
- "target-url": "https://api.test.bbo.co.id/gate_checkin",
75
+ "target-url": `https://api.${esp.config().domain}/gate_checkin`,
76
76
  price_id: getData().ticket.price_id,
77
77
  qr: encodeURIComponent(postGetData.user_qr),
78
78
  trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
@@ -83,7 +83,7 @@ export default function m(props: EventTms_in_hall_failedProps): any {
83
83
  tms_id: UserClass.state().get()?.id,
84
84
  scanned: LibUtils.moment().format('YYYY-MM-DD HH:mm:ss'),
85
85
  }
86
- new LibCurl(url_ticket_update + "?is_turnstile=0", post,
86
+ new LibCurl(url_ticket_update, post,
87
87
  (res) => {
88
88
  doneEntrance += 1
89
89
  if (mustBeEntrance <= doneEntrance) {
package/event/index.tsx CHANGED
@@ -96,7 +96,7 @@ export default function m(props: EventIndexProps): any {
96
96
  }, [isFocus])
97
97
 
98
98
  function loadData() {
99
- new LibCurl(esp.isDebug("") ? "https://storage.googleapis.com/bbo-images/images/modules/api/home_event.json" : "https://storage.googleapis.com/bbo-images/bbo.co.id/images/modules/api/home_event.json", null, (res) => {
99
+ new LibCurl(esp.config("events", "home"), null, (res) => {
100
100
  setData(res)
101
101
  }, msg => setError(msg))
102
102
  }
@@ -364,7 +364,7 @@ export default function m(props: EventOrder_detailProps): any {
364
364
 
365
365
  <View testID='price_name' style={{ marginTop: 10, borderWidth: 5, padding: 3, borderColor: result?.color, backgroundColor: EventOrder_itemProperty.textColor(result?.color) }}>
366
366
  <View style={{ padding: 10, backgroundColor: result?.color, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
367
- <EventHtmltext allowFontScaling={false} numberOfLines={1} ellipsizeMode="tail" style={{ color: EventOrder_itemProperty.textColor(result?.color), alignSelf: 'center', textAlign: 'center', fontSize: 20, fontWeight: 'bold' }}> {result?.price_name}</EventHtmltext>
367
+ <EventHtmltext allowFontScaling={false} numberOfLines={3} ellipsizeMode="tail" style={{ color: EventOrder_itemProperty.textColor(result?.color), alignSelf: 'center', textAlign: 'center', fontSize: 20, fontWeight: 'bold' }}> {result?.price_name}</EventHtmltext>
368
368
  </View>
369
369
  </View>
370
370
 
@@ -9,6 +9,7 @@ import { EventButton } from 'esoftplay/cache/event/button/import';
9
9
  import { EventMessage } from 'esoftplay/cache/event/message/import';
10
10
  import { LibCurl } from 'esoftplay/cache/lib/curl/import';
11
11
  import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
12
+ import { LibHtmltext } from 'esoftplay/cache/lib/htmltext/import';
12
13
  import { LibList } from 'esoftplay/cache/lib/list/import';
13
14
  import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
14
15
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
@@ -30,20 +31,29 @@ export default function m(props: EventOrder_detail_upgradeProps): any {
30
31
  const [selectedTicket, setSelectedTicket] = useSafeState()
31
32
  const [result, setResult] = useSafeState()
32
33
  const [error, setError] = useSafeState()
34
+ // const [resultEvent, setResultEvent] = useSafeState()
33
35
 
34
36
  function loadDataUpgradeTicket() {
35
37
  new LibCurl(url, null, (res: any, msg: string) => {
36
38
  // setAvailableUpgrade(res?.list)
37
- // esp.log(res);
38
39
  setResult(res)
39
40
  }, (err: any) => {
40
41
  setError(err)
41
42
  })
42
43
  }
43
44
 
45
+ // function loadDataEvent() {
46
+ // new LibCurl("event_detail/" + dataTicket?.event_id, null, (res: any, msg: string) => {
47
+ // setResultEvent(res)
48
+ // }, (err: any) => {
49
+
50
+ // })
51
+ // }
52
+
44
53
 
45
54
  useEffect(() => {
46
55
  loadDataUpgradeTicket()
56
+ // loadDataEvent()
47
57
  }, [])
48
58
 
49
59
  if (!result && !error) {
@@ -75,8 +85,8 @@ export default function m(props: EventOrder_detail_upgradeProps): any {
75
85
  <LibTextstyle textStyle='m_overline' text={esp.lang("event/order_detail_upgrade", "current_ticket")} style={{ fontSize: 12, margin: 15, marginBottom: 0 }} />
76
86
 
77
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' }}>
78
- <LibTextstyle style={{ marginHorizontal: 5, fontSize: 20, color: "#000", textAlign: 'center', fontWeight: 'bold' }} numberOfLines={2} ellipsizeMode={'tail'} textStyle='m_button' text={dataTicket?.price_name} />
79
- <Text allowFontScaling={false} style={{ color: "#000" }}>{LibUtils.money(dataTicket.total)}</Text>
88
+ <LibHtmltext allowFontScaling={false} style={{ marginHorizontal: 5, fontSize: 20, color: "#000", textAlign: 'center', fontWeight: 'bold' }} numberOfLines={2} ellipsizeMode={'tail'}>{dataTicket?.price_name}</LibHtmltext>
89
+ <Text allowFontScaling={false} style={{ color: "#000", marginTop: 10 }}>{LibUtils.money(dataTicket.total)}</Text>
80
90
 
81
91
  <View style={applyStyle({ flexDirection: 'row', alignItems: 'center', justifyContent: 'center', position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 })}>
82
92
  <View style={applyStyle({ width: 25, height: 25, borderRadius: 12.5, backgroundColor: "#fff", marginLeft: -12.5 })} />
@@ -104,14 +114,15 @@ export default function m(props: EventOrder_detail_upgradeProps): any {
104
114
  ondate: item.ondate
105
115
  },
106
116
  },
107
- qty: dataTicket?.qty_upgrade
117
+ qty: dataTicket?.qty_upgrade,
118
+ tax_event: item.tax
108
119
  }
109
120
  setSelectedTicket(a)
110
121
  } else {
111
122
  LibDialog.warning(esp.lang("event/order_detail_upgrade", "oops"), item.message_error)
112
123
  }
113
124
  }} key={i} style={{ ...LibStyle.elevation(2), width: LibStyle.width - 35, marginLeft: 2.5, 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' }}>
114
- <LibTextstyle 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'} textStyle='m_button' text={item?.price_name_to} />
125
+ <LibHtmltext 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}</LibHtmltext>
115
126
  <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>
116
127
 
117
128
  {
@@ -134,19 +145,47 @@ export default function m(props: EventOrder_detail_upgradeProps): any {
134
145
  dataTicket: selectedTicket
135
146
  }).then((value) => {
136
147
  LibNavigation.navigate('event/order_detail_upgrade_payment', {
137
- dataTicket: dataTicket,
148
+ dataTicket: {
149
+ url_payment: result?.url_payment,
150
+ price_name: dataTicket?.price_name,
151
+ booking_id: dataTicket?.id,
152
+ qty_upgrade: dataTicket?.qty_upgrade,
153
+ tax_event: selectedTicket?.tax_event,
154
+ ondate: dataTicket?.ondate,
155
+ event_title: dataTicket?.event_name,
156
+ event_id: dataTicket?.event_id,
157
+ // ...dataTicket
158
+ },
138
159
  selectedTicket: {
139
160
  ...selectedTicket,
140
161
  row_id: value?.row_id,
141
162
  column_id: value?.column_id,
142
163
  seat_name: value?.seat_name,
164
+ },
165
+ fee_platform: {
166
+ fee_platform_amount: selectedTicket?.selected_ticket?.fee_platform_amount,
167
+ fee_platform_type: selectedTicket?.selected_ticket?.fee_platform_type,
143
168
  }
144
169
  })
145
170
  })
146
171
  } else {
147
172
  LibNavigation.navigate('event/order_detail_upgrade_payment', {
148
- dataTicket: dataTicket,
149
- selectedTicket: selectedTicket
173
+ dataTicket: {
174
+ url_payment: result?.url_payment,
175
+ price_name: dataTicket?.price_name,
176
+ booking_id: dataTicket?.id,
177
+ qty_upgrade: dataTicket?.qty_upgrade,
178
+ tax_event: selectedTicket?.tax_event,
179
+ ondate: dataTicket?.ondate,
180
+ event_title: dataTicket?.event_name,
181
+ event_id: dataTicket?.event_id,
182
+ // ...dataTicket
183
+ },
184
+ selectedTicket: selectedTicket,
185
+ fee_platform: {
186
+ fee_platform_amount: selectedTicket?.selected_ticket?.fee_platform_amount,
187
+ fee_platform_type: selectedTicket?.selected_ticket?.fee_platform_type,
188
+ }
150
189
  })
151
190
  }
152
191
  } else {
@@ -26,9 +26,9 @@ export interface EventOrder_detail_upgrade_paymentProps {
26
26
 
27
27
  }
28
28
  export default function m(props: EventOrder_detail_upgrade_paymentProps): any {
29
- const { dataTicket, selectedTicket }: any = LibNavigation.getArgsAll(props)
29
+ const { dataTicket, selectedTicket, fee_platform }: any = LibNavigation.getArgsAll(props)
30
30
  const [selectedPayment, setSelectedPayment] = useSafeState<any>()
31
- const [platformFee, setPlatformFee] = useSafeState<any>()
31
+ const [platformFee, setPlatformFee] = useSafeState<any>(fee_platform)
32
32
  const [charge, setCharge] = useSafeState<any>(0)
33
33
  const [chargePercent, setChargePercent] = useSafeState<any>()
34
34
 
@@ -46,7 +46,7 @@ export default function m(props: EventOrder_detail_upgrade_paymentProps): any {
46
46
 
47
47
  LibDialog.confirm(esp.lang("event/order_detail_upgrade_payment", "confirm_title"), esp.lang("event/order_detail_upgrade_payment", "confirm_msg", dataTicket?.price_name, selectedTicket?.selected_ticket?.price_name_to), esp.lang("event/order_detail_upgrade_payment", "confirm_ok"), () => {
48
48
  let post = {
49
- booking_id: dataTicket?.id,
49
+ booking_id: dataTicket?.booking_id,
50
50
  price_id_to: selectedTicket?.selected_ticket?.price_id_to,
51
51
  trx_id: trxId,
52
52
  payment_id: selectedPayment?.payment_id,
@@ -104,7 +104,7 @@ export default function m(props: EventOrder_detail_upgrade_paymentProps): any {
104
104
  return (percent * amount) / 100
105
105
  }
106
106
 
107
- let amount = Number(selectedTicket?.selected_ticket?.amount) * Number(dataTicket?.qty_upgrade)
107
+ let amount = Number(selectedTicket?.selected_ticket?.amount_difference) * Number(dataTicket?.qty_upgrade)
108
108
  let _tax = percentageCalculator(amount, dataTicket?.tax_event)
109
109
  let subtotalWithTax = amount + _tax
110
110
 
@@ -127,6 +127,7 @@ export default function m(props: EventOrder_detail_upgrade_paymentProps): any {
127
127
  )
128
128
  }
129
129
 
130
+
130
131
  return (
131
132
  <View style={{ flex: 1, backgroundColor: '#fff' }}>
132
133
  <EventHeader title={esp.lang("event/order_detail_upgrade_payment", "header_title")} />
@@ -168,6 +169,7 @@ export default function m(props: EventOrder_detail_upgrade_paymentProps): any {
168
169
 
169
170
  <BigbangPayment_list
170
171
  eventId={dataTicket?.event_id}
172
+ url_payment={dataTicket?.url_payment}
171
173
  onToggleCC={() => { scrollRef.current?.scrollToEnd({ animated: true }) }}
172
174
  order_type={14} // upgrade ticekt
173
175
  currency={selectedTicket?.selected_ticket?.currency}
@@ -34,7 +34,7 @@ export default function m(props: EventOrder_itemProps): any {
34
34
  return (
35
35
  <Pressable onPress={props.onPress} style={{ backgroundColor: '#fff', borderRadius: 5, overflow: 'hidden', width: LibStyle.width - 30, margin: 15, marginBottom: 0 }}>
36
36
  <View style={{ alignContent: 'center', borderBottomWidth: 1, borderBottomColor: textColor(item?.color), alignItems: 'center', justifyContent: 'center', backgroundColor: item?.color, padding: 10 }}>
37
- <EventHtmltext allowFontScaling={false} numberOfLines={1} ellipsizeMode="tail" style={{ color: textColor(item?.color), alignSelf: 'center', textAlign: 'center', fontSize: 16, fontWeight: 'bold' }}> {item?.price_name}</EventHtmltext>
37
+ <EventHtmltext allowFontScaling={false} numberOfLines={2} ellipsizeMode="tail" style={{ color: textColor(item?.color), alignSelf: 'center', textAlign: 'center', fontSize: 16, fontWeight: 'bold' }}> {item?.price_name}</EventHtmltext>
38
38
  </View>
39
39
  <View style={{ padding: 10, backgroundColor: '#fff', flex: 1 }}>
40
40
  <Text allowFontScaling={false} style={applyStyle({ marginHorizontal: 15, fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#4a4a4a" })}>{item?.event_name}</Text>
@@ -142,7 +142,7 @@ export default function m(props: EventOrder_share_toProps): any {
142
142
  dialogUser.current!.show()
143
143
  }
144
144
  }}
145
- style={{ marginLeft: 25, marginRight: 25, marginTop: 18 }} />
145
+ style={{ marginLeft: 25, marginRight: 25, marginTop: 18, borderRadius: 5 }} />
146
146
  <TouchableOpacity onPress={() => {
147
147
  if (inputEmail.current!.getText() == '') {
148
148
  LibToastProperty.show(esp.lang("event/order_share_to", "msg_error_input_email"))
@@ -1,7 +1,6 @@
1
1
  // withHooks
2
2
 
3
- import { EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
4
- import { LibCurl } from 'esoftplay/cache/lib/curl/import';
3
+ import { EventFirebase_socket, EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
5
4
  import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
6
5
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
7
6
  import { LibUtils } from 'esoftplay/cache/lib/utils/import';
@@ -13,7 +12,6 @@ import { useKeepAwake } from 'expo-keep-awake';
13
12
  import LottieView from 'lottie-react-native';
14
13
  import React, { useEffect, useRef } from 'react';
15
14
  import { Text, View } from 'react-native';
16
- import useFirebaseSocket from './firebase_socket';
17
15
 
18
16
  export interface EventQueueArgs {
19
17
 
@@ -43,9 +41,8 @@ export function state(): useGlobalReturn<any> {
43
41
  const queueNumberState = useGlobalState(1)
44
42
  export default function m(props: EventQueueProps): any {
45
43
  const counter = useRef<number>(0)
46
- const { addQueue, getQueue, updateQueueExp, doneQueue } = useFirebaseSocket()
44
+ const { addQueue, getQueue, updateQueueExp, doneQueue } = EventFirebase_socket()
47
45
  const [queueStatus, setQueueStatus] = useSafeState(0)
48
- const { isInPricingQueueConfig } = useFirebaseSocket()
49
46
  let { event_id, autoPass } = LibNavigation.getArgsAll<any>(props, props)
50
47
  event_id = String(event_id)
51
48
  const [number, setNumber, getNumber] = useSafeState(esp.lang("event/queue_pricing", "info"))
@@ -57,16 +54,10 @@ export default function m(props: EventQueueProps): any {
57
54
  useKeepAwake()
58
55
 
59
56
  useEffect(() => {
60
- new LibCurl("https://storage.googleapis.com/bbo-images/bbo.co.id/images/modules/api/queue.json", null,
61
- (res, message) => {
62
- if (res == 1) {
63
- setQueueStatus(1)
64
- addQueue(String(pathQueue), String(event_id), () => {
65
- getCurrentQueue(1)
66
- });
67
- }
68
- }, (err) => { console.log(err) }
69
- )
57
+ setQueueStatus(1)
58
+ addQueue(String(pathQueue), String(event_id), () => {
59
+ getCurrentQueue(1)
60
+ });
70
61
  timeout(() => {
71
62
  animation.current?.play()
72
63
  }, 300);
package/event/review.tsx CHANGED
@@ -93,7 +93,7 @@ export default function m(props: EventReviewProps): any {
93
93
  renderItem={(item: any) => {
94
94
  let type = calculateProb(item?.config?.review)
95
95
  let args = {
96
- url: "https://api.test.bbo.co.id/event_order_detail?id=" + item.id,
96
+ url: "event_order_detail?id=" + item.id,
97
97
  url_form: item.url_form + (item.url_detail.includes("?") ? "&" : "?") + 'type=' + type?.type,
98
98
  booking_id: item.id,
99
99
  type: type?.type,
package/event/seat.tsx CHANGED
@@ -116,7 +116,7 @@ export default function m(props: EventSeatProps): any {
116
116
  let post = {
117
117
  event_id: dataTicket?.event_id,
118
118
  booking_id: booking_id,
119
- price_id: dataTicket?.selected_ticket?.list?.price_id,
119
+ price_id: dataTicket?.selected_ticket?.list?.price_id || dataTicket?.selected_ticket?.price_id,
120
120
  ondate: dataTicket?.selected_ticket?.list?.ondate,
121
121
  }
122
122
  new LibCurl(url, post, (res, msg) => { // event_seat_shared
@@ -134,7 +134,7 @@ export default function m(props: EventSeatProps): any {
134
134
  function loadDataSize() {
135
135
  let post = {
136
136
  event_id: dataTicket?.event_id,
137
- price_id: dataTicket?.selected_ticket?.list?.price_id,
137
+ price_id: dataTicket?.selected_ticket?.list?.price_id || dataTicket?.selected_ticket?.price_id,
138
138
  ondate: dataTicket?.selected_ticket?.list?.ondate,
139
139
  }
140
140
  new LibCurl("event_seat_meta", post, (res, msg) => { // event_seat
@@ -166,7 +166,7 @@ export default function m(props: EventSeatProps): any {
166
166
  function loadSeat(_url?: string) {
167
167
  let post = {
168
168
  event_id: dataTicket?.event_id,
169
- price_id: dataTicket?.selected_ticket?.list?.price_id,
169
+ price_id: dataTicket?.selected_ticket?.list?.price_id || dataTicket?.selected_ticket?.price_id,
170
170
  ondate: dataTicket?.selected_ticket?.list?.ondate,
171
171
  }
172
172
  new LibCurl(_url ? _url : url, post, (res, msg) => { // event_seat
@@ -487,7 +487,7 @@ export default function m(props: EventSeatProps): any {
487
487
  y: resultDataSize.seat_row,
488
488
  url: url,
489
489
  event_id: dataTicket?.event_id,
490
- price_id: dataTicket?.selected_ticket?.list?.price_id,
490
+ price_id: dataTicket?.selected_ticket?.list?.price_id || dataTicket?.selected_ticket?.price_id,
491
491
  ondate: dataTicket?.selected_ticket?.list?.ondate,
492
492
  }, 345).then((item: any) => {
493
493
  setResult(undefined)
@@ -569,7 +569,7 @@ export default function m(props: EventSeatProps): any {
569
569
  }}
570
570
  onScroll={scrollHandlerY}>
571
571
  <View>
572
- {result?.list?.map(renderRow)}
572
+ {result?.list?.map?.(renderRow)}
573
573
  </View>
574
574
  </Animated.ScrollView>
575
575
  </Animated.ScrollView>
package/event/sheet.tsx CHANGED
@@ -3,6 +3,7 @@
3
3
  import { LibSlidingup } from 'esoftplay/cache/lib/slidingup/import';
4
4
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
5
5
  import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
6
+ import esp from 'esoftplay/esp';
6
7
  import React from 'react';
7
8
  import { ScrollView, TouchableOpacity, View } from 'react-native';
8
9
 
@@ -0,0 +1,80 @@
1
+ // withHooks
2
+ import { EventHeader } from 'esoftplay/cache/event/header/import';
3
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
4
+ import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
5
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
6
+ import { LibLoading } from 'esoftplay/cache/lib/loading/import';
7
+ import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
8
+ import { LibStyle } from 'esoftplay/cache/lib/style/import';
9
+ import { UseMap } from 'esoftplay/cache/use/map/import';
10
+ import esp from 'esoftplay/esp';
11
+ import useSafeState from 'esoftplay/state';
12
+
13
+ import React, { useEffect } from 'react';
14
+ import { Pressable, ScrollView, Text, View } from 'react-native';
15
+
16
+
17
+ export interface EventTms_gate_resultArgs {
18
+ type: "gate" | "hall",
19
+ event_id: number | string,
20
+ }
21
+ export interface EventTms_gate_resultProps {
22
+
23
+ }
24
+ export default function m(props: EventTms_gate_resultProps): any {
25
+
26
+ const { event_id, type } = LibNavigation.getArgsAll(props)
27
+
28
+ const backResult = LibNavigation.useBackResult(props)
29
+
30
+ const [data, setData] = useSafeState<any>()
31
+
32
+ useEffect(() => {
33
+ if (type == "gate") {
34
+ new LibCurl('event_gate', { event_id: event_id }, (res, msg) => {
35
+ if (res.length == 1) {
36
+ backResult(res[0])
37
+ }
38
+ setData(res)
39
+ }, (error) => {
40
+ LibDialog.warning(esp.lang("event/tms_gate", "warning_load"), error?.message)
41
+ LibNavigation.back()
42
+ }, 1)
43
+ } else if (type == "hall") {
44
+ new LibCurl('event_hall', { event_id: event_id }, (res, msg) => {
45
+ if (res.length == 1) {
46
+ backResult(res[0])
47
+ }
48
+ setData(res)
49
+ }, (error) => {
50
+ LibDialog.warning(esp.lang("event/tms_gate", "warning_loadhall"), error?.message)
51
+ LibNavigation.back()
52
+ }, 1)
53
+ }
54
+ }, [])
55
+
56
+
57
+ if (!data) {
58
+ return <LibLoading />
59
+ }
60
+
61
+ return (
62
+ <View style={{ flex: 1 }}>
63
+ <EventHeader title={type == "gate" ? esp.lang("event/tms_gate", "header_title1") : esp.lang("event/tms_gate", "header_title2")} subtitle={esp.lang("event/tms_gate", "gate_sub")} />
64
+ <ScrollView style={{}}>
65
+ <Text allowFontScaling={false} style={{ margin: 20, marginBottom: 10, fontFamily: "Arial", fontSize: 16, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, paddingLeft: 3, paddingRight: 3 }}>{esp.lang("event/tms_gate", "text_select", type == "gate" ? esp.lang("event/tms_gate", "gate") : esp.lang("event/tms_gate", "hall"))}</Text>
66
+ <UseMap
67
+ data={data}
68
+ renderItem={(item) => (
69
+ <Pressable onPress={() => {
70
+ backResult(item)
71
+ }} style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center', backgroundColor: '#fff', ...LibStyle.elevation(2), padding: 16, marginBottom: 10, marginHorizontal: 15, borderRadius: 5, flex: 1 }}>
72
+ <LibIcon name={"chevron-right"} size={18} color={"#3ea4dc"} />
73
+ <Text allowFontScaling={false} style={{ marginLeft: 10, fontSize: 17, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, textAlign: "center", color: '#9e9e9e', paddingLeft: 3, paddingRight: 3 }}>{item.name}</Text>
74
+ </Pressable>
75
+ )}
76
+ />
77
+ </ScrollView>
78
+ </View>
79
+ )
80
+ }
@@ -18,9 +18,9 @@ import useGlobalSubscriber, { useGlobalSubscriberReturn } from 'esoftplay/subscr
18
18
 
19
19
 
20
20
  import { applyStyle } from 'esoftplay';
21
- import { EventTms_out_successProperty } from 'esoftplay/cache/event/tms_out_success/import';
22
21
  import { EventTms_in_hall_successProperty } from 'esoftplay/cache/event/tms_in_hall_success/import';
23
22
  import { EventTms_out_hall_successProperty } from 'esoftplay/cache/event/tms_out_hall_success/import';
23
+ import { EventTms_out_successProperty } from 'esoftplay/cache/event/tms_out_success/import';
24
24
  import esp from 'esoftplay/esp';
25
25
  import useGlobalState, { useGlobalReturn } from 'esoftplay/global';
26
26
  import useSafeState from 'esoftplay/state';
@@ -577,19 +577,19 @@ export default function m(props: EventTms_homeProps): any {
577
577
  </TouchableOpacity>
578
578
 
579
579
  <TouchableOpacity onPress={() => {
580
- if (esp.isDebug("") && UserClass?.state().get().email == "bagus@fisip.net") {
581
- LibNavigation.navigate('tms/gate_in')
582
- } else {
583
- LibNavigation.navigate('component/scanner', {
584
- fromPage: 'event/tms_home',
585
- scan_type: typeScanner == "tms" ? 'entrance' : 'hall_in',
586
- gate_type: 1, // ini kalo 1 itu in
587
- price_type: resultTypeTicket,
588
- url_ticket_detail: result?.url_ticket_detail,
589
- url_ticket_update: result?.url_ticket_update,
590
- ...args
591
- })
592
- }
580
+ // if (esp.isDebug("") && UserClass?.state().get().email == "bagus@fisip.net") {
581
+ // LibNavigation.navigate('tms/gate_in')
582
+ // } else {
583
+ LibNavigation.navigate('component/scanner', {
584
+ fromPage: 'event/tms_home',
585
+ scan_type: typeScanner == "tms" ? 'entrance' : 'hall_in',
586
+ gate_type: 1, // ini kalo 1 itu in
587
+ price_type: resultTypeTicket,
588
+ url_ticket_detail: result?.url_ticket_detail,
589
+ url_ticket_update: result?.url_ticket_update,
590
+ ...args
591
+ })
592
+ // }
593
593
  }} style={applyStyle({ width: (LibStyle.width - 40) * 0.5, borderWidth: 1, borderColor: 'rgba(0, 0, 0, 0)', height: 40, borderRadius: 16, backgroundColor: LibStyle.colorGreen, flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center', paddingHorizontal: 9 })} >
594
594
  <Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: '#fff', marginRight: 15 })} >{esp.lang("event/tms_home", "entrance")}</Text>
595
595
  <LibIcon size={18} color="#fff" name="login" />
@@ -1,10 +1,10 @@
1
1
  // withHooks
2
2
 
3
- import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
4
3
  import { EventButton } from 'esoftplay/cache/event/button/import';
5
- import { EventTms_in_successProperty } from 'esoftplay/cache/event/tms_in_success/import';
6
4
  import { EventHeader } from 'esoftplay/cache/event/header/import';
7
5
  import { EventSheet } from 'esoftplay/cache/event/sheet/import';
6
+ import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
7
+ import { EventTms_in_successProperty } from 'esoftplay/cache/event/tms_in_success/import';
8
8
  import { LibCurl } from 'esoftplay/cache/lib/curl/import';
9
9
  import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
10
10
  import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
@@ -12,7 +12,6 @@ import { LibObject } from 'esoftplay/cache/lib/object/import';
12
12
  import { LibPicture } from 'esoftplay/cache/lib/picture/import';
13
13
  import { LibStyle } from 'esoftplay/cache/lib/style/import';
14
14
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
15
- import { LibUtils } from 'esoftplay/cache/lib/utils/import';
16
15
  import { UserClass } from 'esoftplay/cache/user/class/import';
17
16
  import esp from 'esoftplay/esp';
18
17
  import useSafeState from 'esoftplay/state';
@@ -75,12 +74,10 @@ export default function m(props: EventTms_idcardProps): any {
75
74
  }, [])
76
75
 
77
76
  function entrance() {
78
- let url = url_ticket_update + LibUtils.objectToUrlParam({
79
- is_turnstile: 0,
80
- })
77
+ let url = url_ticket_update
81
78
 
82
79
  let post = {
83
- "target-url": "https://api.test.bbo.co.id/gate_checkin",
80
+ "target-url": `https://api.${esp.config().domain}/gate_checkin`,
84
81
  price_id: 0,
85
82
  qr: encodeURIComponent(selectedTicket?.key),
86
83
  trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
@@ -1,8 +1,8 @@
1
1
  // withHooks
2
2
  import { useEffect } from 'react';
3
3
 
4
- import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
5
4
  import { EventButton } from 'esoftplay/cache/event/button/import';
5
+ import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
6
6
  import { LibCurl } from 'esoftplay/cache/lib/curl/import';
7
7
  import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
8
8
  import { LibIcon } from 'esoftplay/cache/lib/icon/import';
@@ -72,7 +72,7 @@ export default function m(props: EventTms_in_hall_failedProps): any {
72
72
  if (dataEntranceIn.length > 0) {
73
73
  mustBeEntrance += 1
74
74
  let post = {
75
- "target-url": "https://api.test.bbo.co.id/gate_checkin",
75
+ "target-url": `https://api.${esp.config().domain}/gate_checkin`,
76
76
  price_id: getData().ticket.price_id,
77
77
  qr: encodeURIComponent(postGetData.user_qr),
78
78
  trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
@@ -83,7 +83,7 @@ export default function m(props: EventTms_in_hall_failedProps): any {
83
83
  tms_id: UserClass.state().get()?.id,
84
84
  scanned: LibUtils.moment().format('YYYY-MM-DD HH:mm:ss'),
85
85
  }
86
- new LibCurl(url_ticket_update + "?is_turnstile=0", post,
86
+ new LibCurl(url_ticket_update, post,
87
87
  (res) => {
88
88
  doneEntrance += 1
89
89
  if (mustBeEntrance <= doneEntrance) {
@@ -234,7 +234,7 @@ export default function m(props: EventTms_in_hall_failedProps): any {
234
234
  </Pressable>
235
235
  </View>
236
236
  </UseCondition>
237
- <View style={{ flexDirection: 'row', width: LibStyle.width - 40, alignItems: 'center', marginVertical: 10, justifyContent: 'center' }}>
237
+ <View style={{ flexDirection: 'row', width: LibStyle.width - 40, alignItems: 'center', marginVertical: 10, justifyContent: 'space-between' }}>
238
238
  <UseCondition if={msgError?.status_code != 'EV043'}>
239
239
  <Pressable onPress={() => {
240
240
  LibDialog.warningConfirm(esp.lang("event/tms_in_failed", "warn_title"), esp.lang("event/tms_in_failed", "warn_msg"), esp.lang("event/tms_in_failed", "warn_ok"), () => {
@@ -245,7 +245,7 @@ export default function m(props: EventTms_in_hall_failedProps): any {
245
245
  <Text allowFontScaling={false} style={{ textAlign: 'center', fontWeight: 'bold', color: "#fff" }}>{esp.lang("event/tms_in_hall_failed", "report_error")}</Text>
246
246
  </Pressable>
247
247
  </UseCondition>
248
- <Pressable onPress={getBack} style={{ width: (LibStyle.width - 45) * 0.5, height: 40, borderRadius: 5, borderWidth: 5, borderColor: LibStyle.colorGreen, justifyContent: 'center', alignContent: 'center', alignItems: 'center', ...LibStyle.elevation(10) }}>
248
+ <Pressable onPress={getBack} style={{ width: (LibStyle.width - 45) * 0.5, backgroundColor: LibStyle.colorGreen, height: 40, borderRadius: 5, borderWidth: 5, borderColor: LibStyle.colorGreen, justifyContent: 'center', alignContent: 'center', alignItems: 'center', ...LibStyle.elevation(10) }}>
249
249
  <Text allowFontScaling={false} style={{ fontWeight: 'bold', color: "#fff" }}>{esp.lang("event/tms_in_hall_failed", "back")}</Text>
250
250
  </Pressable>
251
251
 
@@ -31,7 +31,7 @@ export function syncUsedTiket(): useGlobalReturn<any[]> {
31
31
 
32
32
  export default function m(props: EventTms_in_successProps): any {
33
33
  const { scan_type, url_ticket_update, url_ticket_detail, price_type, selectedTicket, gate_type, qr_code, event_id, selectGate, typeScanner, event_title, qty, configPriority } = LibNavigation.getArgsAll<any>(props)
34
- // const { set } = useFirebaseSocket()
34
+ // const { set } = EventFirebase_socket()
35
35
  const [isPaused, setIsPaused] = useSafeState<boolean>(false)
36
36
  const progress = useRef(new Animated.Value(0)).current;
37
37
  const animation = useRef<Animated.CompositeAnimation | null>(null);
@@ -93,12 +93,10 @@ export default function m(props: EventTms_in_successProps): any {
93
93
  }
94
94
 
95
95
  function useTicket() {
96
- let url = url_ticket_update + LibUtils.objectToUrlParam({
97
- is_turnstile: 0,
98
- })
96
+ let url = url_ticket_update
99
97
 
100
98
  let post = {
101
- "target-url": "https://api.test.bbo.co.id/gate_checkin",
99
+ "target-url": `https://api.${esp.config().domain}/gate_checkin`,
102
100
  price_id: selectedTicket?.price_id,
103
101
  qr: encodeURIComponent(qr_code),
104
102
  trx_id: new Date().getTime() + "" + UserClass.state().get()?.id,
package/id.json CHANGED
@@ -661,15 +661,26 @@
661
661
  },
662
662
  "event/exchange_ticket_list": {
663
663
  "all_in": "Semua Data Penukaran Tiket Sudah Dikirimkan",
664
+ "data_not_send": "Data belum terkirim",
665
+ "data_not_send_to_server": "Data nyangkut dilokal",
666
+ "data_send": "Data terkirim",
664
667
  "empty_data": "Tidak ada data",
668
+ "failed_scan": "Scan Gagal",
665
669
  "header_title": "Tiket yang sudah dipindai",
666
670
  "history": "Riwayat Tukar Tiket",
667
671
  "many_times_scan": "Tiket yang berkali-kali pindai",
672
+ "report_scan_exchange_ticket": "Laporan Scan Exchange Tiket",
668
673
  "scan": " pindai",
674
+ "scan_failed": "Jumlah tiket yang gagal dipindai",
675
+ "scan_success_send_to_server": "Data scan berhasil terkirim ke server",
676
+ "scan_ticket": "Scan Tiket",
669
677
  "scan_title": "Pindai",
670
678
  "scanned": "Terpindai",
679
+ "scanning": "Scan",
671
680
  "ticket": "Tiket ",
672
681
  "ticket_1": "Tiket",
682
+ "ticket_scanned": "Berapa kali pemindai melakukan scan",
683
+ "tickets_send": "Data Tiket Terkirim",
673
684
  "total_scan": "Total Tiket Terpindai"
674
685
  },
675
686
  "event/exchange_ticket_result": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay-event",
3
- "version": "0.0.0-d",
3
+ "version": "0.0.0-g",
4
4
  "description": "event module on esoftplay framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/mover.js DELETED
File without changes