esoftplay-event 0.0.1-s → 0.0.1-u

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.
@@ -3,7 +3,7 @@ import { applyStyle } from 'esoftplay';
3
3
  import { EventButton } from 'esoftplay/cache/event/button/import';
4
4
  import { EventHeader } from 'esoftplay/cache/event/header/import';
5
5
  import { EventMessage } from 'esoftplay/cache/event/message/import';
6
- import { LibCarrousel } from 'esoftplay/cache/lib/carrousel/import';
6
+ import { EventOrder_detailProperty } from 'esoftplay/cache/event/order_detail/import';
7
7
  import { LibCurl } from 'esoftplay/cache/lib/curl/import';
8
8
  import { LibDialog } from 'esoftplay/cache/lib/dialog/import';
9
9
  import { LibIcon } from 'esoftplay/cache/lib/icon/import';
@@ -16,13 +16,13 @@ import { LibStyle } from 'esoftplay/cache/lib/style/import';
16
16
  import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
17
17
  import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
18
18
  import { LibUtils } from 'esoftplay/cache/lib/utils/import';
19
- import { EventOrder_detailProperty } from 'esoftplay/cache/event/order_detail/import';
20
19
  import esp from 'esoftplay/esp';
20
+ import useLazyState from 'esoftplay/lazy';
21
21
  import moment from 'esoftplay/moment';
22
22
  import useSafeState from 'esoftplay/state';
23
23
 
24
24
  import React, { useEffect } from 'react';
25
- import { Pressable, ScrollView, Text, TouchableOpacity, View } from 'react-native';
25
+ import { Pressable, RefreshControl, ScrollView, Text, TouchableOpacity, View } from 'react-native';
26
26
 
27
27
 
28
28
  export interface EventOrder_rescheduleArgs {
@@ -31,12 +31,14 @@ export interface EventOrder_rescheduleArgs {
31
31
  export interface EventOrder_rescheduleProps {
32
32
 
33
33
  }
34
+
34
35
  export default function m(props: EventOrder_rescheduleProps): any {
35
36
  let { url } = LibNavigation.getArgsAll(props)
36
- const [result, setResult] = useSafeState<any>()
37
37
 
38
+ const [result, setResult, getResult] = useLazyState<any>()
38
39
  const imgWidth = LibStyle.width - 30
39
40
  const imgHeight = imgWidth / 1080 * 647
41
+ const [refreshing, setRefreshing] = useSafeState<boolean>(false);
40
42
 
41
43
  let defaultTabs = [
42
44
  {
@@ -48,7 +50,7 @@ export default function m(props: EventOrder_rescheduleProps): any {
48
50
  title: /*refund*/esp.lang("event/order_reschedule", "refund")
49
51
  },
50
52
  ]
51
- const [activeTab, setActiveTab] = useSafeState<any>(1)
53
+ const [activeTab, setActiveTab] = useLazyState<any>(1)
52
54
 
53
55
 
54
56
  useEffect(() => {
@@ -57,15 +59,22 @@ export default function m(props: EventOrder_rescheduleProps): any {
57
59
 
58
60
  function loadData() {
59
61
  new LibCurl(url, null, (res, msg) => {
60
- setResult(res)
62
+ setResult(res)()
63
+ setRefreshing(false)
61
64
  }, (error) => {
65
+ setRefreshing(false)
62
66
  LibDialog.warning(esp.lang("event/order_reschedule", "load_err"), error?.message)
63
67
  }, 1)
64
68
  }
65
69
 
70
+ function onRefresh() {
71
+ setRefreshing(true)
72
+ loadData()
73
+ }
74
+
66
75
  function rescheduleTicket() {
67
- let a = result.booking_list?.map?.((item: any) => item.price_type?.filter?.((item1: any) => item1.check == 1))
68
- let _booking_ids = result.booking_list?.map?.((item: any) => {
76
+ let a = getResult().booking_list?.map?.((item: any) => item.price_type?.filter?.((item1: any) => item1.check == 1))
77
+ let _booking_ids = getResult().booking_list?.map?.((item: any) => {
69
78
  if (item.price_type?.some((x: any) => x.check == 1)) {
70
79
  return item.id
71
80
  }
@@ -131,7 +140,7 @@ export default function m(props: EventOrder_rescheduleProps): any {
131
140
  }
132
141
 
133
142
  function refundTicket() {
134
- let a = result.booking_list?.filter?.((item: any) => item.check == 1)
143
+ let a = getResult().booking_list?.filter?.((item: any) => item.check == 1)
135
144
  let _booking_ids: any[] = []
136
145
 
137
146
  for (let i = 0; i < a.length; i++) {
@@ -179,19 +188,19 @@ export default function m(props: EventOrder_rescheduleProps): any {
179
188
  }
180
189
 
181
190
  function updateResult(item: any, i: number, item1: any, i1: number) {
182
- setResult(
183
- LibObject.update(result, (data) => {
184
- for (let j = 0; j < data.price_type.length; j++) {
185
- data.price_type[j].check = i1 == j ? data.price_type[j].hasOwnProperty("check") && data.price_type[j].check == 1 ? 0 : 1 : 0
186
- }
187
- return { ...data }
188
- })('booking_list', i)
189
- )
191
+ let a = LibObject.update(getResult(), (data) => {
192
+ for (let j = 0; j < data.price_type.length; j++) {
193
+ data.price_type[j].check = i1 == j ? data.price_type[j].hasOwnProperty("check") && data.price_type[j].check == 1 ? 0 : 1 : 0
194
+ }
195
+ return { ...data }
196
+ })('booking_list', i)
197
+
198
+ setResult(a)()
190
199
 
191
200
 
192
201
  if (item.reseat == 1) {
193
202
  let data = {
194
- event_id: result.id,
203
+ event_id: getResult().id,
195
204
  qty: item.qty,
196
205
  // kenapa seperti ini, biar objeknya sama dengan di event/ticket_list
197
206
  selected_ticket: {
@@ -214,11 +223,15 @@ export default function m(props: EventOrder_rescheduleProps): any {
214
223
  function renderRescheduleList(item: any, i: number) {
215
224
  return (
216
225
  <View key={i}>
217
- <View style={applyStyle({ backgroundColor: '#f1f2f3', padding: 14, borderTopWidth: 3, borderTopColor: '#999', marginTop: 20 })}>
226
+ <View style={applyStyle({ backgroundColor: '#f1f2f3', padding: 14, borderTopWidth: 3, borderTopColor: '#999', marginTop: 10 })}>
218
227
  <View style={{ flexDirection: 'row', justifyContent: 'space-between' }} >
219
- <Text style={applyStyle({ fontFamily: "Arial", fontSize: 12, lineHeight: 20, fontStyle: "normal", letterSpacing: 0 })} >{(item.price_name) + " (" + item.qty + " " + esp.lang("event/order_reschedule", "ticket_text")}<Text style={{ color: "orange" }} >{item.qty_shared > 0 ? esp.lang("event/order_reschedule", "shared", item?.qty_shared) : ""}</Text>{")"}</Text>
228
+ <View style={{ flex: 2 }}>
229
+ <Text style={applyStyle({ fontFamily: "Arial", fontSize: 12, lineHeight: 20, fontStyle: "normal", letterSpacing: 0 })} >{(item.price_name) + " (" + item.qty + " " + esp.lang("event/order_reschedule", "ticket_text")}<Text style={{ color: "orange" }} >{item.qty_shared > 0 ? esp.lang("event/order_reschedule", "shared", item?.qty_shared) : ""}</Text>{")"}</Text>
230
+ </View>
220
231
 
221
- <Text style={applyStyle({ fontFamily: "Arial", fontSize: 12, lineHeight: 20, fontStyle: "normal", fontWeight: 'bold', letterSpacing: 0 })} >{LibUtils.money(item.price)}</Text>
232
+ <View style={{ flex: 1, alignContent: 'flex-end', alignItems: 'flex-end' }}>
233
+ <Text style={applyStyle({ fontFamily: "Arial", fontSize: 12, lineHeight: 20, fontStyle: "normal", fontWeight: 'bold', letterSpacing: 0 })} >{LibUtils.money(item.price)}</Text>
234
+ </View>
222
235
  </View>
223
236
  {
224
237
  item.ondate != "0000-00-00" &&
@@ -278,7 +291,7 @@ export default function m(props: EventOrder_rescheduleProps): any {
278
291
  </View>
279
292
  </View>
280
293
  <View style={applyStyle({ marginLeft: 10, flexDirection: 'column', marginRight: 6 })} >
281
- <Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "right", color: _selectTicket ? "#3ea4dc" : '#999', opacity: opacityPassed })} >{LibUtils.money(item1.price)}</Text>
294
+ <Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, textAlign: "right", color: _selectTicket ? "#3ea4dc" : '#999', opacity: opacityPassed })} >{LibUtils.money(item1.price, item1.currency)}</Text>
282
295
  </View>
283
296
 
284
297
  <TouchableOpacity onPress={() => {
@@ -300,6 +313,7 @@ export default function m(props: EventOrder_rescheduleProps): any {
300
313
  )
301
314
  }
302
315
 
316
+ esp.log(result);
303
317
  function renderRefundList(item: any, i: number) {
304
318
  let _selectTicket = item.hasOwnProperty('check') && item.check == 1
305
319
  const styleID_12nkjf: any = { marginLeft: 10, textDecorationLine: 'line-through', textDecorationStyle: 'solid', opacity: item.is_refundable == 1 ? 1 : 0.5, marginTop: 4, fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : '#999' }
@@ -307,20 +321,21 @@ export default function m(props: EventOrder_rescheduleProps): any {
307
321
  <View key={i}>
308
322
  <TouchableOpacity onPress={() => {
309
323
  if (item.is_refundable == 1) {
310
- setResult(
311
- LibObject.set(result, item.hasOwnProperty('check') && item.check == 1 ? 0 : 1)('booking_list', i, "check")
312
- )
324
+ setResult(() => LibObject.set(getResult(), item.hasOwnProperty('check') && item.check == 1 ? 0 : 1)('booking_list', i, "check"))()
313
325
  }
314
326
  }} style={{ flex: 1, backgroundColor: item.is_refundable == 1 ? '#fff' : LibStyle.colorLightGrey, flexDirection: 'row', justifyContent: 'space-between', padding: 10 }}>
315
327
  <View style={applyStyle({ flex: 1 })}>
316
- <Text style={applyStyle({ fontFamily: "Arial", fontSize: 12, lineHeight: 20, fontStyle: "normal", fontWeight: 'bold', letterSpacing: 0 })} >{esp.lang("event/order_reschedule", "ticket_date", moment(item.ondate).format("DD MMMM YYYY"))}</Text>
328
+ {
329
+ item.ondate != "0000-00-00" &&
330
+ <Text style={applyStyle({ fontFamily: "Arial", fontSize: 12, lineHeight: 20, fontStyle: "normal", fontWeight: 'bold', letterSpacing: 0 })} >{esp.lang("event/order_reschedule", "ticket_date", moment(item.ondate).format("DD MMMM YYYY"))}</Text>
331
+ }
317
332
  {item.qty_shared > 0 &&
318
333
  <LibTextstyle textStyle='caption1' text={esp.lang("event/order_reschedule", "chared", item.qty_shared)} style={{ color: 'orange' }} />
319
334
  }
320
335
  <Text allowFontScaling={false} style={{ opacity: item.is_refundable == 1 ? 1 : 0.5, fontFamily: "Arial", fontSize: 10, marginBottom: 4, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0.23, color: LibStyle.colorRed }}>{item.refund == "0.00" ? esp.lang("event/order_reschedule", "cant_refund") : esp.lang("event/order_reschedule", "refundable", LibUtils.numberAbsolute(item.refund).toString())}</Text>
321
336
  <Text allowFontScaling={false} style={applyStyle({ fontFamily: "Arial", fontSize: 14, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : '#999' })}>{esp.lang("ticket/refund", "ticket")} {item.price_name + " (" + item.qty + " " + esp.lang("ticket/refund", "ticket") + ") "}</Text>
322
337
  <View style={{ flexDirection: 'row', alignContent: 'center', alignItems: 'center' }}>
323
- <Text allowFontScaling={false} style={applyStyle({ marginTop: 4, fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : '#999' })}>{LibUtils.money(item.refund == "0.00" ? item.price : item.price_cancellable)}</Text>
338
+ <Text allowFontScaling={false} style={applyStyle({ marginTop: 4, fontFamily: "Arial", fontSize: 12, fontWeight: "normal", fontStyle: "normal", letterSpacing: 0, color: _selectTicket ? "#3ea4dc" : '#999' })}>{LibUtils.money(item.price_cancellable, item.currency)}</Text>
324
339
  {
325
340
  item.refund != "0.00" && item.refund != "100.00" &&
326
341
  <Text allowFontScaling={false} style={styleID_12nkjf}>{LibUtils.money(item.price)}</Text>
@@ -329,9 +344,7 @@ export default function m(props: EventOrder_rescheduleProps): any {
329
344
  </View>
330
345
  <TouchableOpacity onPress={() => {
331
346
  if (item.is_refundable == 1) {
332
- setResult(
333
- LibObject.set(result, item.hasOwnProperty('check') && item.check == 1 ? 0 : 1)('booking_list', i, "check")
334
- )
347
+ setResult(() => LibObject.set(getResult(), item.hasOwnProperty('check') && item.check == 1 ? 0 : 1)('booking_list', i, "check"))()
335
348
  }
336
349
  }} style={applyStyle({ padding: 8, opacity: 1 })} >
337
350
  <LibIcon name={_selectTicket ? "checkbox-marked-circle" : "radiobox-blank"} size={22} style={{ opacity: item.is_refundable == 1 ? 1 : 0.5 }} color={_selectTicket ? "#3ea4dc" : "#434343"} />
@@ -341,12 +354,6 @@ export default function m(props: EventOrder_rescheduleProps): any {
341
354
  )
342
355
  }
343
356
 
344
- function renderImageCarousel(item1: any, i: number) {
345
- return (
346
- <LibPicture key={i} source={{ uri: item1.image }} style={applyStyle({ borderTopLeftRadius: 0, borderTopRightRadius: 0, height: imgHeight, width: imgWidth, resizeMode: 'cover' })} />
347
- )
348
- }
349
-
350
357
 
351
358
  const dateRange = LibUtils.getDateRange(result?.start_date, result?.end_date, " - ")
352
359
 
@@ -360,7 +367,8 @@ export default function m(props: EventOrder_rescheduleProps): any {
360
367
  defaultTabs.map((item: any, i: number) => {
361
368
  return (
362
369
  <Pressable onPress={() => {
363
- setActiveTab(item.id)
370
+ loadData()
371
+ setActiveTab(item.id)()
364
372
  }} key={i} style={{ flex: 1, padding: 10, borderTopLeftRadius: 10, borderTopRightRadius: 10, backgroundColor: item.id == activeTab ? "#fff" : LibStyle.colorBgGrey }}>
365
373
  <Text allowFontScaling={false} style={{ opacity: item.id == activeTab ? 1 : 0.7, alignSelf: 'center', textAlign: 'center', fontFamily: "Arial", fontWeight: item.id == activeTab ? "bold" : "normal", fontStyle: "normal", letterSpacing: 0, color: item.id == activeTab ? "#000" : "#aab0b7" }} >{item.title}</Text>
366
374
  </Pressable>
@@ -370,20 +378,12 @@ export default function m(props: EventOrder_rescheduleProps): any {
370
378
  </View>
371
379
  }
372
380
 
373
- <ScrollView>
381
+ <ScrollView refreshControl={
382
+ <RefreshControl refreshing={refreshing} onRefresh={onRefresh} />
383
+ }>
374
384
  <View style={{ marginTop: result?.global_refundable == 1 ? 0 : 10, margin: 15, borderTopLeftRadius: 0, borderTopRightRadius: 0, borderRadius: 10, backgroundColor: '#fff', paddingBottom: activeTab == 2 ? 10 : 0 }}>
375
- <LibCarrousel
376
- delay={4000}
377
- style={{ borderTopLeftRadius: 0, borderTopRightRadius: 0, height: imgHeight, width: imgWidth }}
378
- autoplay
379
- bullets
380
- bulletStyle={{ width: 7, height: 7, backgroundColor: "#7e7e7e", borderRadius: 3.5, borderWidth: 0, marginHorizontal: 2 }}
381
- chosenBulletStyle={{ width: 7, height: 7, backgroundColor: "white", borderRadius: 3.5, borderWidth: 0, marginHorizontal: 2 }}
382
- bulletsContainerStyle={{ marginBottom: -15 }} >
383
- {
384
- result?.images.map(renderImageCarousel)
385
- }
386
- </LibCarrousel>
385
+ <LibPicture source={{ uri: result?.image }} style={applyStyle({ borderTopLeftRadius: 0, borderTopRightRadius: 0, height: imgHeight, width: imgWidth, resizeMode: 'cover' })} />
386
+
387
387
  <View style={{ flexDirection: 'row', margin: 14, marginTop: 4, justifyContent: 'space-between' }}>
388
388
  <Text allowFontScaling={false} style={{ marginTop: 14, fontFamily: "Arial", fontSize: 20, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0, color: "#484848" }}>{result?.title}</Text>
389
389
  </View>
@@ -399,8 +399,6 @@ export default function m(props: EventOrder_rescheduleProps): any {
399
399
  <View style={{ width: 19, height: 19, borderRadius: 9.5, backgroundColor: LibStyle.colorBgGrey, marginRight: -9.5 }} />
400
400
  </View>
401
401
 
402
- {/* <Text style={{ margin: 14, fontFamily: "Arial", fontSize: 12, fontWeight: "bold", fontStyle: "normal", letterSpacing: 0 }} >{esp.lang("event/order_reschedule", "schedule_ticket_new")}</Text> */}
403
-
404
402
  {
405
403
  activeTab == 2 &&
406
404
  <View style={{ padding: 14, backgroundColor: '#f1f2f3' }}>
@@ -64,13 +64,14 @@ export default function m(props: EventOrder_share_toProps): any {
64
64
  setQty(qty == 1 ? 1 : qty - 1)
65
65
  }
66
66
 
67
- function shareTicket() {
67
+ function shareTicket(p: any) {
68
68
  LibDialog.warningConfirm(esp.lang("event/order_share_to", "title_alert_share_ticket"), esp.lang("event/order_share_to", "msg_alert_share_ticket"), esp.lang("event/order_share_to", "btn_yes_alert_share_ticket"), () => {
69
69
  let post = {
70
70
  receiver_email: email,
71
71
  booking_id: result?.booking_id,
72
72
  qty_shared: qty,
73
- trx_id: trxId
73
+ trx_id: trxId,
74
+ pin: p
74
75
  }
75
76
  LibProgress.show(esp.lang("event/order_share_to", "msg_wait"))
76
77
  new LibCurl('event_booking_shared?id=' + result?.event_id, post, (res, msg) => {
@@ -124,24 +125,6 @@ export default function m(props: EventOrder_share_toProps): any {
124
125
  onChangeText={(t) => {
125
126
  setEmail(t)
126
127
  }}
127
- onSubmitEditing={() => {
128
- if (inputEmail.current?.getText() == '') {
129
- LibToastProperty.show(esp.lang("event/order_share_to", "msg_error_input_email"))
130
- inputEmail.current?.blur()
131
- return
132
- } else if (email === user.email) {
133
- LibDialog.warningConfirm(esp.lang("event/order_share_to", "title_alert_fault"), esp.lang("event/order_share_to", "msg_alert_cant_share_ticket_to_myself"), esp.lang("event/order_share_to", "btn_yes_alert_cant_share_ticket_to_myself"), () => {
134
- setEmail("")
135
- inputEmail.current?.setText("")
136
- inputEmail.current?.focus()
137
- }, "", () => {
138
-
139
- })
140
- return
141
- } else {
142
- dialogUser.current?.show()
143
- }
144
- }}
145
128
  style={{ marginLeft: 25, marginRight: 25, marginTop: 18, borderRadius: 5 }} />
146
129
  <TouchableOpacity onPress={() => {
147
130
  if (inputEmail.current?.getText() == '') {
@@ -190,7 +173,11 @@ export default function m(props: EventOrder_share_toProps): any {
190
173
  receiver_email: email,
191
174
  })
192
175
  } else {
193
- shareTicket()
176
+ LibNavigation.navigateForResult("bigbang/payment_pin", undefined, 1132).then((p) => {
177
+ if (p) {
178
+ shareTicket(p)
179
+ }
180
+ })
194
181
  }
195
182
  dialogUser.current?.hide()
196
183
  }} cancel={() => {
@@ -76,13 +76,14 @@ export default function m(props: EventOrder_share_to_detailProps): any {
76
76
  set_qty(_qty == 1 ? 1 : _qty - 1)
77
77
  }
78
78
 
79
- function shareTicket() {
79
+ function shareTicket(p: any) {
80
80
  LibDialog.warningConfirm(esp.lang("event/order_share_to_detail", "title_confirm_share_ticket"), esp.lang("event/order_share_to_detail", "msg_confirm_share_ticket"), esp.lang("event/order_share_to_detail", "btn_yes_confirm_share_ticket"), () => {
81
81
  let post = {
82
82
  receiver_email: userTo?.email,
83
83
  booking_id: result?.booking_id,
84
84
  qty_shared: _qty,
85
- trx_id: trxId
85
+ trx_id: trxId,
86
+ pin: p
86
87
  }
87
88
 
88
89
  LibProgress.show(esp.lang("event/order_share_to_detail", "msg_wait"))
@@ -170,7 +171,11 @@ export default function m(props: EventOrder_share_to_detailProps): any {
170
171
  receiver_email: userTo.email,
171
172
  })
172
173
  } else {
173
- shareTicket()
174
+ LibNavigation.navigateForResult("bigbang/payment_pin", undefined, 1132).then((p) => {
175
+ if (p) {
176
+ shareTicket(p)
177
+ }
178
+ })
174
179
  }
175
180
  }} />
176
181
 
@@ -86,7 +86,7 @@ export default function m(props: EventOrder_waitingProps): any {
86
86
  item?.status == 0 ?
87
87
  <View style={applyStyle({ marginHorizontal: 25, marginBottom: 10, flex: 1, borderTopColor: "#000", borderTopWidth: 1, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', alignContent: 'center' })}>
88
88
  <View style={{ flex: 1 }}>
89
- <EventCountdown_base expired={LibUtils.moment(item?.exp_payment).serverFormat('YYYY-MM-DD HH:mm:ss')} style={applyStyle({ fontSize: 12, color: LibStyle.colorRed, fontFamily: "ArialBold", fontWeight: "normal", fontStyle: "normal" })} />
89
+ <EventCountdown_base expired={LibUtils.moment(item?.exp_payment).serverFormat('YYYY-MM-DD HH:mm:ss', item?.timezone)} style={applyStyle({ fontSize: 12, color: LibStyle.colorRed, fontFamily: "ArialBold", fontWeight: "normal", fontStyle: "normal" })} />
90
90
  </View>
91
91
  {
92
92
  !!item?.booking_code &&
@@ -7,7 +7,7 @@ import { LibUtils } from 'esoftplay/cache/lib/utils/import';
7
7
  import esp from 'esoftplay/esp';
8
8
  import useGlobalState, { useGlobalReturn } from 'esoftplay/global';
9
9
  import useSafeState from 'esoftplay/state';
10
- import { useTimeout } from 'esoftplay/timeout';
10
+ import { useDebounce, useTimeout } from 'esoftplay/timeout';
11
11
  import { useKeepAwake } from 'expo-keep-awake';
12
12
  import LottieView from 'lottie-react-native';
13
13
  import React, { useEffect, useRef } from 'react';
@@ -51,13 +51,26 @@ export default function m(props: EventQueueProps): any {
51
51
  const pathQueue = EVENT_PRICING_QUEUE
52
52
 
53
53
  const timeout = useTimeout()
54
+ const redebounce = useDebounce()
54
55
  useKeepAwake()
55
56
 
57
+ function checkIsHasNumber() {
58
+ redebounce(() => {
59
+ if (!(Number(number) > 0)) {
60
+ addQueue(String(pathQueue), String(event_id), () => {
61
+ getCurrentQueue(1)
62
+ });
63
+ checkIsHasNumber()
64
+ }
65
+ }, 7000)
66
+ }
67
+
56
68
  useEffect(() => {
57
69
  setQueueStatus(1)
58
70
  addQueue(String(pathQueue), String(event_id), () => {
59
71
  getCurrentQueue(1)
60
72
  });
73
+ checkIsHasNumber()
61
74
  timeout(() => {
62
75
  animation.current?.play()
63
76
  }, 300);
@@ -76,7 +89,7 @@ export default function m(props: EventQueueProps): any {
76
89
  clearTimeout(refTimeout.current)
77
90
  refTimeout.current = setTimeout(() => {
78
91
  LibNavigation.replace('event/queue_pricing', { event_id, autoPass })
79
- }, 10000);
92
+ }, 12000);
80
93
  }
81
94
  }, [queueStatus])
82
95
 
@@ -1,17 +1,15 @@
1
1
  // withHooks
2
+ // noPage
2
3
 
3
4
  import { LibIcon } from 'esoftplay/cache/lib/icon/import';
4
5
  import useSafeState from 'esoftplay/state';
5
6
  import React from 'react';
6
7
  import { Animated, TouchableOpacity } from 'react-native';
7
8
 
8
-
9
- export interface EventRefresh_buttonArgs {
10
-
11
- }
12
9
  export interface EventRefresh_buttonProps {
13
10
  onPress: () => void,
14
11
  size?: number
12
+ containerStyle?: any
15
13
  }
16
14
  export default function m(props: EventRefresh_buttonProps): any {
17
15
  const [anim, setAnim] = useSafeState(new Animated.Value(0))
@@ -31,7 +29,7 @@ export default function m(props: EventRefresh_buttonProps): any {
31
29
  })
32
30
 
33
31
  return (
34
- <TouchableOpacity onPress={() => { rotate(); props.onPress(); }} style={{ height: 30, width: 30, alignItems: 'center', justifyContent: 'center' }} >
32
+ <TouchableOpacity onPress={() => { rotate(); props.onPress(); }} style={{ height: 30, width: 30, alignItems: 'center', justifyContent: 'center', ...props.containerStyle }} >
35
33
  <Animated.View style={{ height: size + 8, width: size + 8, transform: [{ rotate: rotateAnim }], alignItems: 'center', justifyContent: 'center' }} >
36
34
  <LibIcon name="refresh" size={size} color="#999" />
37
35
  </Animated.View>
package/event/seat.tsx CHANGED
@@ -221,14 +221,13 @@ export default function m(props: EventSeatProps): any {
221
221
  LibNavigation.sendBackResult(value)
222
222
  }
223
223
 
224
- function shareTicket() {
224
+ function shareTicket(p: any) {
225
225
  if (dataTicket?.qty != counter) {
226
226
  LibToastProperty.show(esp.lang("event/seat", "select_seat1"))
227
227
  return
228
228
  }
229
229
 
230
- let _rowId = result?.list?.filter((item: any) => item.check).map((it: any) => it.seat_row)
231
- let _colId = result?.list?.filter((item: any) => item.check).map((it: any) => it.seat_column)
230
+ let seatName = result?.list?.filter((item: any) => item.check).map((it: any) => it.seat_name)
232
231
  let _bookingMemberId = result?.list?.filter((item: any) => item.check).map((it: any) => it.id)
233
232
 
234
233
  LibDialog.confirm(esp.lang("event/seat", "share_title"), esp.lang("event/seat", "share_msg"), esp.lang("event/seat", "share_confirm"), () => {
@@ -236,10 +235,10 @@ export default function m(props: EventSeatProps): any {
236
235
  receiver_email: receiver_email,
237
236
  booking_id: result?.booking_id,
238
237
  qty_shared: dataTicket?.qty,
239
- row_id: _rowId.join('|'),
240
- column_id: _colId.join('|'),
238
+ seat_name: seatName.join('|'),
241
239
  booking_member_id: _bookingMemberId.join('|'),
242
- trx_id: trxId
240
+ trx_id: trxId,
241
+ pin: p
243
242
  }
244
243
 
245
244
  LibProgress.show(esp.lang("event/seat", "share_wait"))
@@ -261,7 +260,7 @@ export default function m(props: EventSeatProps): any {
261
260
  })
262
261
  }
263
262
 
264
- function sendBackTicket() {
263
+ function sendBackTicket(p: any) {
265
264
  if (dataTicket?.qty != counter) {
266
265
  LibToastProperty.show(esp.lang("event/seat", "select_seat2"))
267
266
  return
@@ -273,7 +272,8 @@ export default function m(props: EventSeatProps): any {
273
272
  let _bookingMemberId = result?.tickets?.filter((item: any) => item.check).map((it: any) => it.id)
274
273
 
275
274
  let post = {
276
- booking_member_id: _bookingMemberId.join('|')
275
+ booking_member_id: _bookingMemberId.join('|'),
276
+ pin: p
277
277
  }
278
278
  new LibCurl('event_booking_shared_return?booking_id=' + result?.booking_id + '&qty_shared=' + dataTicket?.qty, post, (res, msg) => {
279
279
  // LibNotify(res)
@@ -437,7 +437,11 @@ export default function m(props: EventSeatProps): any {
437
437
  </ScrollView>
438
438
  <View style={{ paddingVertical: 10, paddingHorizontal: 20 }} >
439
439
  <EventButton label={esp.lang("event/seat", "next")} onPress={() => {
440
- shareTicket()
440
+ LibNavigation.navigateForResult("bigbang/payment_pin", undefined, 1132).then((p) => {
441
+ if (p) {
442
+ shareTicket(p)
443
+ }
444
+ })
441
445
  }} style={{ backgroundColor: dataTicket?.qty != counter ? LibStyle.colorGrey : LibStyle.colorPrimary }} />
442
446
  </View>
443
447
  </>
@@ -463,7 +467,12 @@ export default function m(props: EventSeatProps): any {
463
467
  </ScrollView>
464
468
  <View style={{ paddingVertical: 10, paddingHorizontal: 20 }} >
465
469
  <EventButton label={esp.lang("event/seat", "next")} onPress={() => {
466
- sendBackTicket()
470
+ LibNavigation.navigateForResult("bigbang/payment_pin", undefined, 1132).then((p) => {
471
+ if (p) {
472
+ sendBackTicket(p)
473
+ }
474
+ })
475
+
467
476
  }} style={{ backgroundColor: dataTicket?.qty != counter ? LibStyle.colorGrey : LibStyle.colorPrimary }} />
468
477
  </View>
469
478
  </>
@@ -26,6 +26,7 @@ import { EventLoading_pageProperty } from 'esoftplay/cache/event/loading_page/im
26
26
  import { LibEffect } from 'esoftplay/cache/lib/effect/import';
27
27
  import { LibProgress } from 'esoftplay/cache/lib/progress/import';
28
28
  import { UseDeeplinkProperty } from 'esoftplay/cache/use/deeplink/import';
29
+ import { UserClass } from 'esoftplay/cache/user/class/import';
29
30
  import esp from 'esoftplay/esp';
30
31
  import useLazyState from 'esoftplay/lazy';
31
32
  import useSafeState from 'esoftplay/state';
@@ -233,6 +234,9 @@ export default function m(props: EventTicket_listProps): any {
233
234
  if (value.quota != 0 && qty > value.quota) {
234
235
  qty = value.quota
235
236
  }
237
+ if (qty < 1) {
238
+ qty = 1
239
+ }
236
240
  setQty(qty)
237
241
  }
238
242
 
@@ -589,6 +593,15 @@ export default function m(props: EventTicket_listProps): any {
589
593
 
590
594
  }} key={i} style={{ overflow: 'hidden', margin: 15, marginBottom: 5, backgroundColor: '#fff', borderRadius: 5, borderWidth: 1.5, borderColor: selTic ? LibStyle.colorBlue : LibStyle.colorBgGrey }}>
591
595
  <View style={{ padding: 10, backgroundColor: '#f1f2f3', borderTopLeftRadius: 5, borderTopRightRadius: 5 }}>
596
+ {
597
+ esp.isDebug("") && UserClass.state().get()?.email == "bagus@fisip.net" &&
598
+ <View style={applyStyle({ flexDirection: 'row' })}>
599
+ <View style={applyStyle({ alignContent: 'center', alignItems: 'center', justifyContent: 'center', borderWidth: 1, backgroundColor: LibStyle.colorGreen, borderColor: "#4cd964", borderRadius: 5, padding: 2, paddingHorizontal: 5, opacity: 1 })}>
600
+ <Text allowFontScaling={false} style={{ fontSize: 10, fontStyle: "normal", letterSpacing: 0.5, color: '#fff', fontWeight: 'bold' }}>Disini kah boy</Text>
601
+ </View>
602
+ </View>
603
+ }
604
+
592
605
  <View style={{ alignContent: 'center', alignItems: 'center', flexDirection: 'row', justifyContent: 'space-between', }}>
593
606
  <View>
594
607
  <EventHtmltext allowFontScaling={false} style={{ opacity: textOpacity, fontWeight: 'bold' }}>{item.type}
@@ -149,7 +149,6 @@ export default function m(props: EventTicket_list2Props): any {
149
149
  const [showAll, setShowAll] = useSafeState<any>({});
150
150
  const [urlPayment, setUrlPayment] = useLazyState<any>()
151
151
 
152
-
153
152
  let dataEvent: any = {
154
153
  event_id: availableResult?.id,
155
154
  event_title: availableResult?.title,
@@ -292,6 +291,7 @@ export default function m(props: EventTicket_list2Props): any {
292
291
 
293
292
  function loadData() {
294
293
  new LibCurl(url, null, (res, msg) => {
294
+ esp.log(res, url);
295
295
  const availablePriceType = LibObject.update(res, (arr: any[]) => arr.filter((x) => x.status != 0))('price_type')
296
296
  const unAvailablePriceType = LibObject.update(res, (arr: any[]) => arr.filter((x) => x.status == 0))('price_type')
297
297
 
@@ -98,6 +98,8 @@ export default function m(props: EventTms_check_codeProps): any {
98
98
  )
99
99
  }
100
100
 
101
+ esp.log(result);
102
+
101
103
  return (
102
104
  <View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
103
105
  <EventHeader title={tab?.title} />
@@ -151,6 +153,10 @@ export default function m(props: EventTms_check_codeProps): any {
151
153
  <LibTextstyle text={result?.data?.exhibitor_name} textStyle="headline" style={{ fontWeight: 'bold' }} />
152
154
  }
153
155
  <LibTextstyle text={result?.info} textStyle="m_body1" style={{ lineHeight: 20, marginTop: 10 }} />
156
+ {
157
+ result?.is_claimed == true &&
158
+ <LibTextstyle text={result?.data?.status_label} textStyle="m_overline" style={{ marginTop: 10, fontWeight: 'bold', fontSize: 12, color: result?.data?.status_color }} />
159
+ }
154
160
  </View>
155
161
  }
156
162
  </ScrollView>