esoftplay-event 0.0.0-m → 0.0.0-o

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.
@@ -1,261 +1,261 @@
1
- // // noPage
2
- // // useLibs
1
+ // noPage
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';
7
- // import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
8
- // import { LibCurl } from 'esoftplay/cache/lib/curl/import';
9
- // import { LibObject } from 'esoftplay/cache/lib/object/import';
10
- // import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
11
- // import esp from 'esoftplay/esp';
12
- // import useGlobalState from 'esoftplay/global';
13
- // import { createTimeout, useInterval } from 'esoftplay/timeout';
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';
7
+ import { EventTms_homeProperty } from 'esoftplay/cache/event/tms_home/import';
8
+ import { LibCurl } from 'esoftplay/cache/lib/curl/import';
9
+ import { LibObject } from 'esoftplay/cache/lib/object/import';
10
+ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
11
+ import esp from 'esoftplay/esp';
12
+ import useGlobalState from 'esoftplay/global';
13
+ import { createTimeout, useInterval } from 'esoftplay/timeout';
14
14
 
15
- // function getEventPath() {
16
- // return "event" + (esp.isDebug("cc") ? "BBT" : "BBO")
17
- // }
18
- // function getRandomSuffix(time: number): number {
19
- // return Number(time + "" + (Math.floor(Math.random() * 9000) + 1000))
20
- // }
15
+ function getEventPath() {
16
+ return "event" + (esp.isDebug("cc") ? "BBT" : "BBO")
17
+ }
18
+ function getRandomSuffix(time: number): number {
19
+ return Number(time + "" + (Math.floor(Math.random() * 9000) + 1000))
20
+ }
21
21
 
22
22
 
23
- // export const eventIdQueue = useGlobalState(0)
24
- // export const eventQueueConfig = useGlobalState<any>({})
25
- // const state = useGlobalState(0)
26
- // export const lastKeyInPages = useGlobalState<string[]>([])
27
- // export const userIdKeyReplacer = useGlobalState<any>({})
23
+ export const eventIdQueue = useGlobalState(0)
24
+ export const eventQueueConfig = useGlobalState<any>({})
25
+ const state = useGlobalState(0)
26
+ export const lastKeyInPages = useGlobalState<string[]>([])
27
+ export const userIdKeyReplacer = useGlobalState<any>({})
28
28
 
29
- // export default function useFirebaseSocket() {
30
- // const [status] = state.useState()
31
- // const isDirect = EventTms_homeProperty.state()
29
+ export default function useFirebaseSocket() {
30
+ const [status] = state.useState()
31
+ const isDirect = EventTms_homeProperty.state()
32
32
 
33
- // function isInLocal(state: any[], code: string) {
34
- // const encodedCode = encodeURIComponent(code)
35
- // return state.findIndex(([url, post]) => (post.qr == encodedCode || post.user_qr == encodedCode)) == -1 ? false : true
36
- // }
33
+ function isInLocal(state: any[], code: string) {
34
+ const encodedCode = encodeURIComponent(code)
35
+ return state.findIndex(([url, post]) => (post.qr == encodedCode || post.user_qr == encodedCode)) == -1 ? false : true
36
+ }
37
37
 
38
- // const auth = () => {
39
- // return getAuth()
40
- // }
41
- // const db = () => {
42
- // return getDatabase()
38
+ const auth = () => {
39
+ return getAuth()
40
+ }
41
+ const db = () => {
42
+ return getDatabase()
43
43
 
44
- // }
44
+ }
45
45
 
46
- // const signInAnonym = () => { }
46
+ const signInAnonym = () => { }
47
47
 
48
- // // ini get yang di live
49
- // async function _get(path: string, gate_id: string, onDone: (res: any) => void) {
50
- // let hasDone = false
51
- // if (isDirect.get()) {
52
- // new LibCurl('gate_check/' + path + '?t=' + new Date().getTime(), { gate_id }, (res) => {
53
- // hasDone = true
54
- // onDone(res)
55
- // }, (res) => {
56
- // onDone(res)
57
- // hasDone = true
58
- // }, 1)
59
- // return
60
- // }
48
+ // ini get yang di live
49
+ async function _get(path: string, gate_id: string, onDone: (res: any) => void) {
50
+ let hasDone = false
51
+ if (isDirect.get()) {
52
+ new LibCurl('gate_check/' + path + '?t=' + new Date().getTime(), { gate_id }, (res) => {
53
+ hasDone = true
54
+ onDone(res)
55
+ }, (res) => {
56
+ onDone(res)
57
+ hasDone = true
58
+ }, 1)
59
+ return
60
+ }
61
61
 
62
- // get(ref(getDatabase(), path))
63
- // .then((sn) => {
64
- // hasDone = true
65
- // if (sn.exists()) {
66
- // onDone(sn.val())
67
- // } else {
68
- // onDone(null)
69
- // }
70
- // })
71
- // .catch((e) => {
72
- // // if (e && !hasDone) {
73
- // // getBackup(path, (res) => {
74
- // // if (res) {
75
- // // onDone(res)
76
- // // } else {
77
- // // onDone(null)
78
- // // }
79
- // // })
80
- // // }
81
- // })
82
- // }
62
+ get(ref(getDatabase(), path))
63
+ .then((sn) => {
64
+ hasDone = true
65
+ if (sn.exists()) {
66
+ onDone(sn.val())
67
+ } else {
68
+ onDone(null)
69
+ }
70
+ })
71
+ .catch((e) => {
72
+ // if (e && !hasDone) {
73
+ // getBackup(path, (res) => {
74
+ // if (res) {
75
+ // onDone(res)
76
+ // } else {
77
+ // onDone(null)
78
+ // }
79
+ // })
80
+ // }
81
+ })
82
+ }
83
83
 
84
- // function listenChangeTime(merchant_id: string, callback: (params: any) => void): () => void {
85
- // const onChildChange = onValue(ref(getDatabase(), 'merchant_offline/' + merchant_id), (sn) => {
86
- // if (sn.exists()) {
87
- // callback(sn.val());
88
- // }
89
- // })
90
- // return () => onChildChange
91
- // }
84
+ function listenChangeTime(merchant_id: string, callback: (params: any) => void): () => void {
85
+ const onChildChange = onValue(ref(getDatabase(), 'merchant_offline/' + merchant_id), (sn) => {
86
+ if (sn.exists()) {
87
+ callback(sn.val());
88
+ }
89
+ })
90
+ return () => onChildChange
91
+ }
92
92
 
93
- // async function _set(path: string, data: any, onDone?: (res: any) => void) {
94
- // const timeout = createTimeout()
95
- // if (state.get() == 1)
96
- // set(ref(getDatabase(), path), data)
97
- // else
98
- // timeout.set(() => {
99
- // _set(path, data,)
100
- // timeout.clear()
101
- // }, 300);
102
- // }
93
+ async function _set(path: string, data: any, onDone?: (res: any) => void) {
94
+ const timeout = createTimeout()
95
+ if (state.get() == 1)
96
+ set(ref(getDatabase(), path), data)
97
+ else
98
+ timeout.set(() => {
99
+ _set(path, data,)
100
+ timeout.clear()
101
+ }, 300);
102
+ }
103
103
 
104
- // function path(...paths: any[]): string {
105
- // return paths.join('/')
106
- // }
104
+ function path(...paths: any[]): string {
105
+ return paths.join('/')
106
+ }
107
107
 
108
- // function addQueue(path: string, event_id: string, onSuccess?: () => void) {
109
- // const instance: any = esp.mod("firestore/index")().instance()
110
- // const db = getFirestore(instance)
108
+ function addQueue(path: string, event_id: string, onSuccess?: () => void) {
109
+ const instance: any = esp.mod("firestore/index")().instance()
110
+ const db = getFirestore(instance)
111
111
 
112
- // if (userIdKeyReplacer.get()?.priority == 1) {
113
- // const coll = collection(db, [getEventPath(), path, event_id].join('/'));
114
- // const q = query(coll, orderBy('t', 'asc'), where("t", "==", userIdKeyReplacer.get().t));
115
- // getDocs(q).then((doc) => {
116
- // if (doc.size == 0) {
117
- // LibToastProperty.show(esp.lang("event/firebase_socket", "priority_queue_used"))
118
- // userIdKeyReplacer.set(LibObject.set(userIdKeyReplacer.get(), 0)('priority'))
119
- // addQueue(path, event_id, onSuccess)
120
- // } else if (doc.size == 1) {
121
- // // console.log("SIJI")
122
- // doc.forEach((d) => {
123
- // userIdKeyReplacer.set(LibObject.set(userIdKeyReplacer.get(), d.id)('id'))
124
- // updateQueueExp(path, event_id)
125
- // new LibCurl('event_booking_waiting_allotment_use', { event_id: event_id })
126
- // if (onSuccess) onSuccess?.()
127
- // })
128
- // } else {
129
- // LibToastProperty.show("Antrian lebih dari 1", doc.size)
130
- // }
131
- // // console.log("SIZE", doc.size)
132
- // })
133
- // } else {
134
- // // console.log("ora")
135
- // if (userIdKeyReplacer.get()?.id)
136
- // esp.mod("firestore/index")().deleteDocument?.(instance, [getEventPath?.(), path, event_id, userIdKeyReplacer.get()?.id], () => { }, (e) => { })
137
- // const ctime = getDateTimebyGmt7().getTime()
138
- // const time = getRandomSuffix(ctime)
139
- // const data = { t: ctime, s: time }
140
- // // console.log(data)
141
- // esp.mod("firestore/index")().addCollection?.(instance, [getEventPath?.(), path, event_id], data, (dt) => {
142
- // // console.log("KENE",)
143
- // userIdKeyReplacer.set?.({
144
- // id: dt?.id,
145
- // ...data
146
- // })
147
- // if (onSuccess) onSuccess?.()
148
- // }, (err) => {
149
- // // console.log(err)
150
- // })
151
- // }
152
- // }
112
+ if (userIdKeyReplacer.get()?.priority == 1) {
113
+ const coll = collection(db, [getEventPath(), path, event_id].join('/'));
114
+ const q = query(coll, orderBy('t', 'asc'), where("t", "==", userIdKeyReplacer.get().t));
115
+ getDocs(q).then((doc) => {
116
+ if (doc.size == 0) {
117
+ LibToastProperty.show(esp.lang("event/firebase_socket", "priority_queue_used"))
118
+ userIdKeyReplacer.set(LibObject.set(userIdKeyReplacer.get(), 0)('priority'))
119
+ addQueue(path, event_id, onSuccess)
120
+ } else if (doc.size == 1) {
121
+ // console.log("SIJI")
122
+ doc.forEach((d) => {
123
+ userIdKeyReplacer.set(LibObject.set(userIdKeyReplacer.get(), d.id)('id'))
124
+ updateQueueExp(path, event_id)
125
+ new LibCurl('event_booking_waiting_allotment_use', { event_id: event_id })
126
+ if (onSuccess) onSuccess?.()
127
+ })
128
+ } else {
129
+ LibToastProperty.show("Antrian lebih dari 1", doc.size)
130
+ }
131
+ // console.log("SIZE", doc.size)
132
+ })
133
+ } else {
134
+ // console.log("ora")
135
+ if (userIdKeyReplacer.get()?.id)
136
+ esp.mod("firestore/index")().deleteDocument?.(instance, [getEventPath?.(), path, event_id, userIdKeyReplacer.get()?.id], () => { }, (e) => { })
137
+ const ctime = getDateTimebyGmt7().getTime()
138
+ const time = getRandomSuffix(ctime)
139
+ const data = { t: ctime, s: time }
140
+ // console.log(data)
141
+ esp.mod("firestore/index")().addCollection?.(instance, [getEventPath?.(), path, event_id], data, (dt) => {
142
+ // console.log("KENE",)
143
+ userIdKeyReplacer.set?.({
144
+ id: dt?.id,
145
+ ...data
146
+ })
147
+ if (onSuccess) onSuccess?.()
148
+ }, (err) => {
149
+ // console.log(err)
150
+ })
151
+ }
152
+ }
153
153
 
154
- // function getDateTimebyGmt7() {
155
- // const ori = new Date()
156
- // // const gmt = setTimeOffset(ori)
157
- // return ori
158
- // }
154
+ function getDateTimebyGmt7() {
155
+ const ori = new Date()
156
+ // const gmt = setTimeOffset(ori)
157
+ return ori
158
+ }
159
159
 
160
- // // get weather function
160
+ // get weather function
161
161
 
162
- // function getQueue(path: string, event_id: string, _limit: number, cb: (idx: number, key: string) => void) {
163
- // const instance: any = esp.mod("firestore/index")().instance()
164
- // const db = getFirestore(instance)
165
- // const coll = collection(db, [getEventPath(), path, event_id].join('/'));
166
- // const q = query(coll, orderBy('s', 'asc'), where("s", "<", userIdKeyReplacer.get().s));
162
+ function getQueue(path: string, event_id: string, _limit: number, cb: (idx: number, key: string) => void) {
163
+ const instance: any = esp.mod("firestore/index")().instance()
164
+ const db = getFirestore(instance)
165
+ const coll = collection(db, [getEventPath(), path, event_id].join('/'));
166
+ const q = query(coll, orderBy('s', 'asc'), where("s", "<", userIdKeyReplacer.get().s));
167
167
 
168
- // getCountFromServer(q).then((v) => {
169
- // cb(v.data().count, userIdKeyReplacer.get().id)
170
- // }).catch((e) => {
171
- // getQueue(path, event_id, _limit, cb)
172
- // console.log({ e })
173
- // })
174
- // // /* cleanup */
175
- // // const cdate = getDateTimebyGmt7().getTime()
176
- // // if (!cdate) {
177
- // // LibToastProperty.show(esp.lang("lib/firebase_socket", "something_wrong_1"))
178
- // // return
179
- // // }
180
- // // if (!_limit) {
181
- // // LibToastProperty.show(esp.lang("lib/firebase_socket", "something_wrong_2"))
182
- // // return
183
- // // }
184
- // // if (!userIdKeyReplacer?.get()?.s) {
185
- // // LibToastProperty.show(esp.lang("lib/firebase_socket", "something_wrong_3"))
186
- // // return
187
- // // }
188
- // // const exp = query(collection(instance, [getEventPath(), path, event_id].join('/')), where("t", "<", cdate - _limit), orderBy('t', 'asc'), limit(10));
189
- // // const batch = writeBatch(instance);
190
- // // getDocs(exp).then((expd) => {
191
- // // expd.forEach((doc) => {
192
- // // if (Number(doc.data().s) < Number(userIdKeyReplacer.get().s))
193
- // // batch.delete(doc.ref)
194
- // // // console.log(doc.data().t < cdate - limit, doc.data().t, cdate - limit, cdate - limit - doc.data().t)
195
- // // // console.log('->' + moment(new Date(Number(doc.data().t))).localeFormat('DD MMMM YYYY HH:mm:ss'))
196
- // // // console.log('-->' + moment(new Date(cdate - limit)).localeFormat('DD MMMM YYYY HH:mm:ss') + '\n\n')
197
- // // })
198
- // // batch.commit()
199
- // // })
200
- // // /* end cleanup */
201
- // }
168
+ getCountFromServer(q).then((v) => {
169
+ cb(v.data().count, userIdKeyReplacer.get().id)
170
+ }).catch((e) => {
171
+ getQueue(path, event_id, _limit, cb)
172
+ console.log({ e })
173
+ })
174
+ // /* cleanup */
175
+ // const cdate = getDateTimebyGmt7().getTime()
176
+ // if (!cdate) {
177
+ // LibToastProperty.show(esp.lang("lib/firebase_socket", "something_wrong_1"))
178
+ // return
179
+ // }
180
+ // if (!_limit) {
181
+ // LibToastProperty.show(esp.lang("lib/firebase_socket", "something_wrong_2"))
182
+ // return
183
+ // }
184
+ // if (!userIdKeyReplacer?.get()?.s) {
185
+ // LibToastProperty.show(esp.lang("lib/firebase_socket", "something_wrong_3"))
186
+ // return
187
+ // }
188
+ // const exp = query(collection(instance, [getEventPath(), path, event_id].join('/')), where("t", "<", cdate - _limit), orderBy('t', 'asc'), limit(10));
189
+ // const batch = writeBatch(instance);
190
+ // getDocs(exp).then((expd) => {
191
+ // expd.forEach((doc) => {
192
+ // if (Number(doc.data().s) < Number(userIdKeyReplacer.get().s))
193
+ // batch.delete(doc.ref)
194
+ // // console.log(doc.data().t < cdate - limit, doc.data().t, cdate - limit, cdate - limit - doc.data().t)
195
+ // // console.log('->' + moment(new Date(Number(doc.data().t))).localeFormat('DD MMMM YYYY HH:mm:ss'))
196
+ // // console.log('-->' + moment(new Date(cdate - limit)).localeFormat('DD MMMM YYYY HH:mm:ss') + '\n\n')
197
+ // })
198
+ // batch.commit()
199
+ // })
200
+ // /* end cleanup */
201
+ }
202
202
 
203
- // function updateQueueExp(path: string, event_id: string) {
204
- // const instance: any = esp.mod("firestore/index")().instance()
205
- // esp.mod("firestore/index")().updateDocument(instance, [getEventPath(), path, event_id, userIdKeyReplacer.get().id], [{ key: 't', value: getDateTimebyGmt7().getTime() }], () => { }, (e) => {
206
- // // updateQueueExp(path, event_id, key)
207
- // })
208
- // }
203
+ function updateQueueExp(path: string, event_id: string) {
204
+ const instance: any = esp.mod("firestore/index")().instance()
205
+ esp.mod("firestore/index")().updateDocument(instance, [getEventPath(), path, event_id, userIdKeyReplacer.get().id], [{ key: 't', value: getDateTimebyGmt7().getTime() }], () => { }, (e) => {
206
+ // updateQueueExp(path, event_id, key)
207
+ })
208
+ }
209
209
 
210
- // function doneQueue(path: string, event_id: string, key: string, cb: Function) {
211
- // if (key) {
212
- // const instance: any = esp.mod("firestore/index")().instance()
213
- // esp.mod("firestore/index")().deleteDocument(instance, [getEventPath(), path, event_id, key], () => {
214
- // cb()
215
- // userIdKeyReplacer.reset()
216
- // }, (e) => {
217
- // console.warn(e)
218
- // })
219
- // }
220
- // }
210
+ function doneQueue(path: string, event_id: string, key: string, cb: Function) {
211
+ if (key) {
212
+ const instance: any = esp.mod("firestore/index")().instance()
213
+ esp.mod("firestore/index")().deleteDocument(instance, [getEventPath(), path, event_id, key], () => {
214
+ cb()
215
+ userIdKeyReplacer.reset()
216
+ }, (e) => {
217
+ console.warn(e)
218
+ })
219
+ }
220
+ }
221
221
 
222
- // function isInPricingQueueConfig(event_id: string) {
223
- // return eventQueueConfig.get(event_id) && eventQueueConfig.get(event_id).limit > 0
224
- // }
222
+ function isInPricingQueueConfig(event_id: string) {
223
+ return eventQueueConfig.get(event_id) && eventQueueConfig.get(event_id).limit > 0
224
+ }
225
225
 
226
- // function useQueueConfigListener() {
227
- // function action() {
228
- // fetch(esp.config("events", "queue") + "?t=" + new Date().getTime(), { "method": "GET" })
229
- // .then(res => res.json())
230
- // .then((re) => {
231
- // eventQueueConfig.set(re)
232
- // })
226
+ function useQueueConfigListener() {
227
+ function action() {
228
+ fetch(esp.config("events", "queue") + "?t=" + new Date().getTime(), { "method": "GET" })
229
+ .then(res => res.json())
230
+ .then((re) => {
231
+ eventQueueConfig.set(re)
232
+ })
233
233
 
234
- // }
235
- // const timeout = useInterval()
236
- // action()
237
- // timeout(() => {
238
- // action()
239
- // }, 10000)
240
- // }
234
+ }
235
+ const timeout = useInterval()
236
+ action()
237
+ timeout(() => {
238
+ action()
239
+ }, 10000)
240
+ }
241
241
 
242
- // return {
243
- // status,
244
- // auth,
245
- // db,
246
- // signInAnonymously: signInAnonym,
247
- // get: _get,
248
- // set: _set,
249
- // isInLocal,
250
- // // getQueueConfig,
251
- // isInPricingQueueConfig,
252
- // useQueueConfigListener,
253
- // // isInBookingQueueConfig,
254
- // addQueue,
255
- // getQueue,
256
- // doneQueue,
257
- // updateQueueExp,
258
- // listenChangeTime,
259
- // path
260
- // }
261
- // }
242
+ return {
243
+ status,
244
+ auth,
245
+ db,
246
+ signInAnonymously: signInAnonym,
247
+ get: _get,
248
+ set: _set,
249
+ isInLocal,
250
+ // getQueueConfig,
251
+ isInPricingQueueConfig,
252
+ useQueueConfigListener,
253
+ // isInBookingQueueConfig,
254
+ addQueue,
255
+ getQueue,
256
+ doneQueue,
257
+ updateQueueExp,
258
+ listenChangeTime,
259
+ path
260
+ }
261
+ }
@@ -28,7 +28,7 @@ import { EventTransaction } from 'esoftplay/cache/event/transaction/import';
28
28
  import { LibAutoreload } from 'esoftplay/cache/lib/autoreload/import';
29
29
  import useLazyState from 'esoftplay/lazy';
30
30
  import React, { useEffect } from 'react';
31
- import { Text, TouchableOpacity, View } from 'react-native';
31
+ import { Linking, Text, TouchableOpacity, View } from 'react-native';
32
32
  import QRCode from 'react-native-qrcode-svg';
33
33
 
34
34
 
@@ -53,9 +53,9 @@ export default function m(props: EventOrder_waitingProps): any {
53
53
  useEffect(() => {
54
54
  loadData()
55
55
  stateData.reset()
56
- LibAutoreload.set(() => {
57
- loadData()
58
- }, 6000)
56
+ // LibAutoreload.set(() => {
57
+ // loadData()
58
+ // }, 6000)
59
59
  return () => LibAutoreload.clear()
60
60
  }, [])
61
61
 
@@ -63,6 +63,7 @@ export default function m(props: EventOrder_waitingProps): any {
63
63
  function loadData() {
64
64
  EventOrderProperty.subscribe().trigger()
65
65
  new LibCurl(url + ((url.includes("?") ? "&" : "?") + 't=' + new Date().getTime()), null, (res) => {
66
+ // esp.log(res);
66
67
  setResult(res)
67
68
  if (res?.status == 1) {
68
69
  // LibAutoreload.clear()
@@ -346,21 +347,11 @@ export default function m(props: EventOrder_waitingProps): any {
346
347
  }}
347
348
  />
348
349
 
349
- <View style={{ height: 3, backgroundColor: "#f6f6f6" }} />
350
- <Text allowFontScaling={false} style={{ fontSize: 10, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#9b9b9b", marginTop: 14 }}>{esp.lang("event/order_detail", "Checked_within_10_minutes_after_payment_is_made")}</Text>
351
- <TouchableOpacity onPress={() => {
352
- LibNavigation.navigate('event/order_detail_payment', {
353
- data: result?.payment?.description
354
- })
355
- }}>
356
- <Text allowFontScaling={false} style={{ fontSize: 10, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#16a085", marginTop: 7 }}>{esp.lang("event/order_detail", "payment_instruction")}</Text>
357
- </TouchableOpacity>
358
350
  </>
359
351
  }
360
352
 
361
353
  {
362
- // cc dan bbopay
363
- result?.payment?.payment_type != 3 && result?.payment?.payment_type != 4 && result?.payment?.payment_type != 11 &&
354
+ result?.payment?.payment_type != 3 && result?.payment?.payment_type != 4 && result?.payment?.payment_type != 11 && result?.payment?.payment_type != 13 &&
364
355
  <>
365
356
  <View style={{ height: 3, backgroundColor: "#f6f6f6" }} />
366
357
 
@@ -373,9 +364,9 @@ export default function m(props: EventOrder_waitingProps): any {
373
364
  LibUtils.copyToClipboard(result?.params != null && result?.params?.va_no)
374
365
  LibToastProperty.show(esp.lang("event/order_detail", "success_copied") + result?.params != null && result?.params?.va_no)
375
366
  }}>
376
- <View style={{ flex: 2, flexDirection: 'row', justifyContent: 'center', alignContent: 'center' }}>
377
- <LibIcon.Ionicons name='copy' style={{ fontSize: 12, color: '#2e83bb', marginRight: 7 }} />
378
- <Text allowFontScaling={false} style={{ fontSize: 12, fontStyle: "normal", letterSpacing: 0, color: "#2e83bb" }}>{esp.lang("event/order_detail", "copy")}</Text>
367
+ <View style={{ flex: 2, alignContent: 'center', alignItems: 'center', justifyContent: 'center', flexDirection: 'row', }}>
368
+ <LibIcon name='content-copy' style={{ color: '#2e83bb' }} size={13} />
369
+ <Text allowFontScaling={false} style={{ marginLeft: 5, fontSize: 12, fontStyle: "normal", letterSpacing: 0, color: "#2e83bb" }}>{esp.lang("event/order_detail", "copy")}</Text>
379
370
  </View>
380
371
  </TouchableOpacity>
381
372
  </View>
@@ -388,26 +379,51 @@ export default function m(props: EventOrder_waitingProps): any {
388
379
  LibUtils.copyToClipboard(result?.params != null && result?.params.cvs_no)
389
380
  LibToastProperty.show(esp.lang("event/order_detail", "success_copied") + result?.params != null && result?.params.cvs_no)
390
381
  }}>
391
- <View style={{ flex: 2, flexDirection: 'row', justifyContent: 'center', alignContent: 'center' }}>
392
- <LibIcon.Ionicons name='copy' style={{ fontSize: 12, color: '#2e83bb', marginRight: 7 }} />
393
- <Text allowFontScaling={false} style={{ fontSize: 12, fontStyle: "normal", letterSpacing: 0, color: "#2e83bb" }}>{esp.lang("event/order_detail", "copy")}</Text>
382
+ <View style={{ flex: 2, alignContent: 'center', alignItems: 'center', justifyContent: 'center', flexDirection: 'row', }}>
383
+ <LibIcon name='content-copy' style={{ color: '#2e83bb' }} size={13} />
384
+ <Text allowFontScaling={false} style={{ marginLeft: 5, fontSize: 12, fontStyle: "normal", letterSpacing: 0, color: "#2e83bb" }}>{esp.lang("event/order_detail", "copy")}</Text>
394
385
  </View>
395
386
  </TouchableOpacity>
396
387
  </View>
397
388
  }
398
389
 
390
+ </>
391
+ }
392
+
393
+ {
394
+ // ewallet
395
+ result?.payment?.payment_type == 13 &&
396
+ <>
399
397
  <View style={{ height: 3, backgroundColor: "#f6f6f6" }} />
400
- <Text allowFontScaling={false} style={{ fontSize: 10, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#9b9b9b", marginTop: 14 }}>{esp.lang("event/order_detail", "Checked_within_10_minutes_after_payment_is_made")}</Text>
401
- <TouchableOpacity onPress={() => {
402
- LibNavigation.navigate('event/order_detail_payment', {
403
- data: result?.payment?.description
404
- })
405
- }}>
406
- <Text allowFontScaling={false} style={{ fontSize: 10, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#16a085", marginTop: 7 }}>{esp.lang("event/order_detail", "payment_instruction")}</Text>
398
+
399
+ <TouchableOpacity
400
+ onPress={() => {
401
+ Linking.openURL(result?.params?.url_mobile)
402
+ }}
403
+ style={{ marginTop: 15, borderRadius: 10, borderWidth: 2, overflow: 'hidden', borderColor: "#f6f6f6" }}>
404
+ <View style={{ padding: 15, backgroundColor: '#000', justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
405
+ <Text allowFontScaling={false} style={{ flex: 1, alignContent: 'center', alignItems: 'center', fontWeight: 'bold', fontSize: 16, fontStyle: "normal", letterSpacing: 0, color: "#fff" }}>{esp.lang("event/order_detail_waiting", "scan_or_tap")}</Text>
406
+ </View>
407
+ <View style={{ margin: 15, alignSelf: 'center' }}>
408
+ <QRCode ecl="H" size={250} value={result?.params?.qr} />
409
+ </View>
410
+
407
411
  </TouchableOpacity>
412
+
408
413
  </>
409
414
  }
410
415
 
416
+ <View style={{ height: 3, backgroundColor: "#f6f6f6" }} />
417
+ <Text allowFontScaling={false} style={{ fontSize: 10, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#9b9b9b", marginTop: 14 }}>{esp.lang("event/order_detail", "Checked_within_10_minutes_after_payment_is_made")}</Text>
418
+ <TouchableOpacity onPress={() => {
419
+ LibNavigation.navigate('event/order_detail_payment', {
420
+ data: result?.payment?.description
421
+ })
422
+ }}>
423
+ <Text allowFontScaling={false} style={{ fontSize: 10, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: "#16a085", marginTop: 7 }}>{esp.lang("event/order_detail", "payment_instruction")}</Text>
424
+ </TouchableOpacity>
425
+
426
+
411
427
  </View>
412
428
  </LibScroll>
413
429
  {
package/id.json CHANGED
@@ -843,6 +843,10 @@
843
843
  "event/header": {
844
844
  "search_product": "Cari Produk"
845
845
  },
846
+ "event/header_home": {
847
+ "myprofile": "Profile saya",
848
+ "search": "Cari..."
849
+ },
846
850
  "event/list": {
847
851
  "find_event": "Temukan event",
848
852
  "text_filter": "Filter"
@@ -1048,6 +1052,7 @@
1048
1052
  "pay_again": "Bayar Ulang",
1049
1053
  "qty": "Jumlah",
1050
1054
  "repay": "Bayar Ulang",
1055
+ "scan_or_tap": "SCAN OR TAP TO PAY",
1051
1056
  "ticket": "Tiket",
1052
1057
  "total_bill": "Total Tagihan",
1053
1058
  "wait": "Mohon tunggu"
@@ -1849,9 +1854,5 @@
1849
1854
  "header_title": "Gunakan Voucher",
1850
1855
  "label_code": "Kode Voucher",
1851
1856
  "voucher_or_referral_code": "Kode Voucher atau Kode Referral"
1852
- },
1853
- "event/header_home": {
1854
- "search": "Cari...",
1855
- "myprofile": "Profile saya"
1856
1857
  }
1857
1858
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay-event",
3
- "version": "0.0.0-m",
3
+ "version": "0.0.0-o",
4
4
  "description": "event module on esoftplay framework",
5
5
  "main": "index.js",
6
6
  "scripts": {