esoftplay-event 0.0.0-r → 0.0.0-t

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.
@@ -40,8 +40,16 @@ export default function m(props: EventAdditionalProps): any {
40
40
  }, [])
41
41
 
42
42
  function loadData() {
43
- let url = 'event_booking_addition_form?event_id=' + event_id + "&price_id=" + price_id
43
+ let url = price_id
44
+ ? 'event_booking_addition_form?event_id=' + event_id + "&price_id=" + price_id
45
+ : 'event_booking_addition_form?event_id=' + event_id
46
+
44
47
  new LibCurl(url, null, (res, msg) => {
48
+ // langsung skip kalau confignya per event ada additionalnya dan di price_id tidak ada additionalnya
49
+ if (res?.additions?.length == 0) {
50
+ LibNavigation.sendBackResult("", LibNavigation.getResultKey(props))
51
+ }
52
+
45
53
  const a = res?.additions?.length > 0 && res?.additions?.map?.((item: any, i: number) => {
46
54
  return ({
47
55
  ...item,
@@ -58,9 +66,10 @@ export default function m(props: EventAdditionalProps): any {
58
66
  setDataAddPost(new Array(is_each).fill({}))
59
67
 
60
68
  }, (err) => {
69
+ esp.log({ err });
61
70
  LibToastProperty.show(err.message)
62
71
  LibNavigation.back()
63
- })
72
+ }, 1)
64
73
  }
65
74
 
66
75
  function renderItem(item: any, i: number) {
@@ -121,7 +130,12 @@ export default function m(props: EventAdditionalProps): any {
121
130
 
122
131
  return (
123
132
  <View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
124
- <EventHeader title={esp.lang("event/additional", "header_title")} subtitle={ondate && ondate != "0000-00-00" ? type_ticket + " " + LibUtils.moment(ondate).format("DD MMM YYYY") : type_ticket} />
133
+ <EventHeader title={esp.lang("event/additional", "header_title")} subtitle={
134
+ type_ticket ?
135
+ (ondate && ondate != "0000-00-00" ? type_ticket + " " + LibUtils.moment(ondate).format("DD MMM YYYY") : type_ticket)
136
+ :
137
+ ""
138
+ } />
125
139
  <ScrollView>
126
140
  <View style={{ margin: 15, marginBottom: 5, marginTop: 10, padding: 10, borderWidth: 1, borderColor: '#fff', borderRadius: 5, backgroundColor: '#fff', ...LibStyle.elevation(2) }}>
127
141
  <LibTextstyle textStyle='m_overline' text={esp.lang("event/additional", "buyer_info")} style={{ color: "#aaa", fontSize: 12, marginBottom: 5 }} />
package/event/artist.tsx CHANGED
@@ -62,7 +62,7 @@ export default function m(props: BigbangArtistProps): any {
62
62
  setResult(res)
63
63
  }, (err) => {
64
64
  setError(err?.message)
65
- })
65
+ }, 1)
66
66
  }
67
67
 
68
68
  useEffect(() => {
package/event/detail.tsx CHANGED
@@ -121,6 +121,8 @@ export default function m(props: EventDetailProps): any {
121
121
  const diffTime = startDate - currentDate;
122
122
  const diffDays = diffTime / (1000 * 60 * 60 * 24);
123
123
 
124
+ esp.log(result);
125
+
124
126
  return (
125
127
  <View style={{ flex: 1, backgroundColor: '#fff' }} >
126
128
  <EventHeader
@@ -268,7 +270,12 @@ export default function m(props: EventDetailProps): any {
268
270
  {
269
271
  result?.url_artist != "" &&
270
272
  <TouchableOpacity onPress={() => {
271
- LibNavigation.navigate('event/artist', { title: result?.title, url: result?.url_artist, has_addition: result?.has_addition })
273
+ // LibNavigation.navigate('event/artist', { title: result?.title, url: result?.url_artist, has_addition: result?.has_addition })
274
+ LibNavigation.navigate('event/artist', {
275
+ title: result?.title,
276
+ url: result?.url_artist,
277
+ has_addition: result?.has_addition
278
+ })
272
279
  }} style={applyStyle({ width: (LibStyle.width - 30) * 0.5, borderWidth: 2, borderColor: LibStyle.colorGreen, height: 40, borderRadius: 16, backgroundColor: 'white', flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center', paddingHorizontal: 9 })} >
273
280
  <Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: LibStyle.colorGreen })} >{esp.lang("event/detail", "line_up")}</Text>
274
281
  </TouchableOpacity>
@@ -281,6 +288,7 @@ export default function m(props: EventDetailProps): any {
281
288
  LibNavigation.navigate(result?.config?.hasOwnProperty('multiprice') && result?.config?.multiprice == 1 ? 'event/ticket_list2' : 'event/ticket_list', {
282
289
  url: result.url_price,
283
290
  has_addition: result?.has_addition,
291
+ has_addition_global: result?.has_addition_global,
284
292
  fee_platform: {
285
293
  fee_platform_amount: result?.fee_platform_amount,
286
294
  fee_platform_type: result?.fee_platform_type,
@@ -296,6 +304,7 @@ export default function m(props: EventDetailProps): any {
296
304
  LibNavigation.navigate(result?.config?.hasOwnProperty('multiprice') && result?.config?.multiprice == 1 ? 'event/ticket_list2' : 'event/ticket_list', {
297
305
  url: result.url_price,
298
306
  has_addition: result?.has_addition,
307
+ has_addition_global: result?.has_addition_global,
299
308
  fee_platform: {
300
309
  fee_platform_amount: result?.fee_platform_amount,
301
310
  fee_platform_type: result?.fee_platform_type,
@@ -130,9 +130,10 @@ export default function m(props: EventLoading_pageProps): any {
130
130
  // />
131
131
  // )
132
132
  } else {
133
- LibDialog.warningConfirm(esp.lang("event/loading_page", "oops"), error?.message, esp.lang("event/loading_page", "back"), () => {
133
+ if (error?.status_code != "GE043")
134
+ LibDialog.warningConfirm(esp.lang("event/loading_page", "oops"), error?.message, esp.lang("event/loading_page", "back"), () => {
134
135
 
135
- }, "", () => { })
136
+ }, "", () => { })
136
137
  }
137
138
  }, 1)
138
139
  } else {
@@ -182,9 +183,10 @@ export default function m(props: EventLoading_pageProps): any {
182
183
  // />
183
184
  // )
184
185
  } else {
185
- LibDialog.warningConfirm(esp.lang("event/loading_page", "oops"), error?.message, esp.lang("event/loading_page", "back"), () => {
186
+ if (error?.status_code != "GE043")
187
+ LibDialog.warningConfirm(esp.lang("event/loading_page", "oops"), error?.message, esp.lang("event/loading_page", "back"), () => {
186
188
 
187
- }, "", () => { })
189
+ }, "", () => { })
188
190
  }
189
191
  }, 1)
190
192
  }
package/event/order.tsx CHANGED
@@ -196,20 +196,25 @@ export default function m(props: EventOrderProps): any {
196
196
  url={buildUrl(url) + "&t=" + new Date().getTime()}
197
197
  key={buildUrl(url)}
198
198
  ListHeaderComponent={
199
- <Pressable onPress={() => {
200
- LibNavigation.navigate('event/order_waiting')
201
- }} style={{ padding: 7, margin: 15, backgroundColor: '#fff', marginBottom: 0, borderRadius: 5, borderWidth: 1, borderColor: LibStyle.colorPrimary, flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
202
- <Text allowFontScaling={false} style={{ marginLeft: 8 }}>{esp.lang("event/order", "wawit")}</Text>
203
- <View style={{ flexDirection: 'row', alignItems: 'center' }}>
204
- {
205
- badge != 0 &&
206
- <View style={{ backgroundColor: LibStyle.colorRed, height: 17, padding: 5, paddingVertical: 2, borderRadius: 10, alignContent: 'center', alignItems: 'center' }}>
207
- <Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, letterSpacing: 0, color: "#ffffff" }}>{badge > 99 ? "99+" : LibUtils.number(badge)}</Text>
199
+ <>
200
+ {
201
+ badge > 0 &&
202
+ <Pressable onPress={() => {
203
+ LibNavigation.navigate('event/order_waiting')
204
+ }} style={{ padding: 7, margin: 15, backgroundColor: '#fff', marginBottom: 0, borderRadius: 5, borderWidth: 1, borderColor: LibStyle.colorPrimary, flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
205
+ <Text allowFontScaling={false} style={{ marginLeft: 8 }}>{esp.lang("event/order", "wawit")}</Text>
206
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
207
+ {
208
+ badge != 0 &&
209
+ <View style={{ backgroundColor: LibStyle.colorRed, height: 17, padding: 5, paddingVertical: 2, borderRadius: 10, alignContent: 'center', alignItems: 'center' }}>
210
+ <Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, letterSpacing: 0, color: "#ffffff" }}>{badge > 99 ? "99+" : LibUtils.number(badge)}</Text>
211
+ </View>
212
+ }
213
+ <LibIcon name='chevron-right' />
208
214
  </View>
209
- }
210
- <LibIcon name='chevron-right' />
211
- </View>
212
- </Pressable>
215
+ </Pressable>
216
+ }
217
+ </>
213
218
  }
214
219
  errorView={(err: any) => (
215
220
  <EventMessage message={err} style={{ marginTop: 15 }} />
@@ -86,7 +86,7 @@ export default function m(props: EventOrder_detail_upgradeProps): any {
86
86
 
87
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' }}>
88
88
  <EventHtmltext allowFontScaling={false} style={{ marginHorizontal: 5, fontSize: 20, color: "#000", textAlign: 'center', fontWeight: 'bold' }} numberOfLines={2} ellipsizeMode={'tail'}>{dataTicket?.price_name}</EventHtmltext>
89
- <Text allowFontScaling={false} style={{ color: "#000", marginTop: 10 }}>{LibUtils.money(dataTicket.total)}</Text>
89
+ <Text allowFontScaling={false} style={{ color: "#000", marginTop: 10 }}>{LibUtils.money(dataTicket.total, dataTicket?.currency)}</Text>
90
90
 
91
91
  <View style={applyStyle({ flexDirection: 'row', alignItems: 'center', justifyContent: 'center', position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 })}>
92
92
  <View style={applyStyle({ width: 25, height: 25, borderRadius: 12.5, backgroundColor: "#fff", marginLeft: -12.5 })} />
@@ -122,7 +122,7 @@ export default function m(props: EventOrder_detail_upgradeProps): any {
122
122
  }
123
123
  }} key={i} style={{ ...LibStyle.elevation(2), marginHorizontal: 15, 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' }}>
124
124
  <EventHtmltext 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}</EventHtmltext>
125
- <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>
125
+ <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), item?.currency)}</Text>
126
126
 
127
127
  {
128
128
  item.info &&
@@ -130,12 +130,13 @@ export default function m(props: EventOrder_waitingProps): any {
130
130
  dataPost.card_expiry_month = dataCC?.expiry_month
131
131
 
132
132
  let url = 'event_booking/' + result?.event_id
133
- LibNavigation.navigateForResult('bigbang/loading_page', {
133
+ LibNavigation.navigateForResult('event/loading_page', {
134
134
  post: dataPost,
135
135
  url: url,
136
136
  title: esp.lang("bigbang/payment", "title_buy_ticket", result?.event_name),
137
137
  isSecure: 1,
138
138
  amount: LibUtils.numberAbsolute(result?.total),
139
+ currency: result?.currency,
139
140
  receive_name: "BBO",
140
141
  receive_image: 'https://bbo.co.id/images/uploads/logo-bbo-tagline_1.png',
141
142
  send_name: result?.name,
@@ -317,7 +318,7 @@ export default function m(props: EventOrder_waitingProps): any {
317
318
  </View>
318
319
 
319
320
  <EventButton
320
- label='Unduh'
321
+ label={esp.lang("event/order_detail_waiting", "download")}
321
322
  style={{ margin: 10, marginHorizontal: 20 }}
322
323
  backgroundColor={LibStyle.colorGreen}
323
324
  onPress={() => {
@@ -125,39 +125,39 @@ export default function m(props: EventOrder_share_toProps): any {
125
125
  setEmail(t)
126
126
  }}
127
127
  onSubmitEditing={() => {
128
- if (inputEmail.current!.getText() == '') {
128
+ if (inputEmail.current?.getText() == '') {
129
129
  LibToastProperty.show(esp.lang("event/order_share_to", "msg_error_input_email"))
130
- inputEmail.current!.blur()
130
+ inputEmail.current?.blur()
131
131
  return
132
132
  } else if (email === user.email) {
133
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
134
  setEmail("")
135
135
  inputEmail.current?.setText("")
136
- inputEmail.current!.focus()
136
+ inputEmail.current?.focus()
137
137
  }, "", () => {
138
138
 
139
139
  })
140
140
  return
141
141
  } else {
142
- dialogUser.current!.show()
142
+ dialogUser.current?.show()
143
143
  }
144
144
  }}
145
145
  style={{ marginLeft: 25, marginRight: 25, marginTop: 18, borderRadius: 5 }} />
146
146
  <TouchableOpacity onPress={() => {
147
- if (inputEmail.current!.getText() == '') {
147
+ if (inputEmail.current?.getText() == '') {
148
148
  LibToastProperty.show(esp.lang("event/order_share_to", "msg_error_input_email"))
149
- inputEmail.current!.blur()
149
+ inputEmail.current?.blur()
150
150
  return
151
151
  } else if (email === user.email) {
152
152
  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"), () => {
153
153
  setEmail("")
154
154
  inputEmail.current?.setText("")
155
- inputEmail.current!.focus()
155
+ inputEmail.current?.focus()
156
156
  }, "", () => {
157
157
 
158
158
  })
159
159
  } else {
160
- dialogUser.current!.show()
160
+ dialogUser.current?.show()
161
161
  }
162
162
  }} >
163
163
  <View style={{ marginBottom: 10, marginTop: 18, marginLeft: 25, marginRight: 25, height: 35, borderRadius: 17.5, backgroundColor: "#34a2ec", borderStyle: "solid", borderWidth: 0.5, borderColor: "#2980b9", alignItems: 'center', justifyContent: 'center' }} >
@@ -192,9 +192,9 @@ export default function m(props: EventOrder_share_toProps): any {
192
192
  } else {
193
193
  shareTicket()
194
194
  }
195
- dialogUser.current!.hide()
195
+ dialogUser.current?.hide()
196
196
  }} cancel={() => {
197
- dialogUser.current!.hide()
197
+ dialogUser.current?.hide()
198
198
  }}
199
199
  view={
200
200
  <View style={{ flexDirection: 'row', marginTop: 20, marginBottom: 8, justifyContent: 'center', alignContent: 'center', alignItems: 'center' }}>
@@ -240,7 +240,7 @@ export default function m(props: any) {
240
240
  </ScrollView>
241
241
  </View>
242
242
  <View style={{ height: 40, marginLeft: 20, marginRight: 20, backgroundColor: LibStyle.colorPrimary, marginBottom: 20, borderRadius: 2, justifyContent: 'center', alignItems: 'center' }} >
243
- <Text style={{ color: 'white', fontWeight: 'bold' }} >{stage || 'Depan'}</Text>
243
+ <Text style={{ color: 'white', fontWeight: 'bold' }} >{stage || esp.lang("event/seat_map", "front")}</Text>
244
244
  </View>
245
245
  <ScrollView horizontal showsHorizontalScrollIndicator >
246
246
  <EventTap onCoordinateGet={toggleSeat}>
@@ -23,7 +23,6 @@ import { EventCountdown_base } from 'esoftplay/cache/event/countdown_base/import
23
23
  import { EventFirebase_socket, EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
24
24
  import { EventHtmltext } from 'esoftplay/cache/event/htmltext/import';
25
25
  import { EventLoading_pageProperty } from 'esoftplay/cache/event/loading_page/import';
26
- import { EventPending_trx } from 'esoftplay/cache/event/pending_trx/import';
27
26
  import { LibEffect } from 'esoftplay/cache/lib/effect/import';
28
27
  import { LibProgress } from 'esoftplay/cache/lib/progress/import';
29
28
  import { UseDeeplinkProperty } from 'esoftplay/cache/use/deeplink/import';
@@ -135,7 +134,7 @@ export default function m(props: EventTicket_listProps): any {
135
134
 
136
135
  const [pendingData] = EventLoading_pageProperty.state().useState()
137
136
 
138
- const { url, fee_platform, has_addition, subscribed }: any = useRef(LibNavigation.getArgsAll(props)).current
137
+ const { url, fee_platform, has_addition, has_addition_global, subscribed }: any = useRef(LibNavigation.getArgsAll(props)).current
139
138
 
140
139
  const [deeplinkParams] = UseDeeplinkProperty.params.useState()
141
140
  const [timer] = EventCountdownProperty.countdownTime.useState()
@@ -539,7 +538,7 @@ export default function m(props: EventTicket_listProps): any {
539
538
  </LibSkeleton>
540
539
  :
541
540
  <>
542
- {
541
+ {/* {
543
542
  Object.values(pendingData).filter((item: any) => item?.order_type == "ticket").length > 0 &&
544
543
  <EventPending_trx
545
544
  onPress={() => {
@@ -550,7 +549,7 @@ export default function m(props: EventTicket_listProps): any {
550
549
  order_type="ticket"
551
550
  title={esp.lang("event/ticket_list", "pending", String(Object.values(pendingData).filter((item: any) => item?.order_type == "ticket").length))}
552
551
  />
553
- }
552
+ } */}
554
553
  {
555
554
  isInPricingQueueConfig(availableResult?.id) && isPass ?
556
555
  <LibEffect deps={[]}>
@@ -24,7 +24,6 @@ import { EventCountdownProperty } from 'esoftplay/cache/event/countdown/import';
24
24
  import { EventCountdown_base } from 'esoftplay/cache/event/countdown_base/import';
25
25
  import { EventFirebase_socket, EventFirebase_socketProperty } from 'esoftplay/cache/event/firebase_socket/import';
26
26
  import { EventLoading_pageProperty } from 'esoftplay/cache/event/loading_page/import';
27
- import { EventPending_trx } from 'esoftplay/cache/event/pending_trx/import';
28
27
  import { EventQueue_pricingProperty } from 'esoftplay/cache/event/queue_pricing/import';
29
28
  import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
30
29
  import { UseTasks } from 'esoftplay/cache/use/tasks/import';
@@ -136,7 +135,7 @@ export default function m(props: EventTicket_list2Props): any {
136
135
 
137
136
  const [pendingData] = EventLoading_pageProperty.state().useState()
138
137
 
139
- const { has_addition, url, fee_platform, subscribed }: any = useRef(LibNavigation.getArgsAll(props)).current
138
+ const { has_addition, has_addition_global, url, fee_platform, subscribed }: any = useRef(LibNavigation.getArgsAll(props)).current
140
139
 
141
140
  const [deeplinkParams] = UseDeeplinkProperty.params.useState()
142
141
  const [timer] = EventCountdownProperty.countdownTime.useState()
@@ -148,6 +147,8 @@ export default function m(props: EventTicket_list2Props): any {
148
147
  const [showAll, setShowAll] = useSafeState<any>({});
149
148
  const [urlPayment, setUrlPayment] = useLazyState<any>()
150
149
 
150
+ // esp.log(availableResult);
151
+
151
152
  let dataEvent: any = {
152
153
  event_id: availableResult?.id,
153
154
  event_title: availableResult?.title,
@@ -206,9 +207,25 @@ export default function m(props: EventTicket_list2Props): any {
206
207
  });
207
208
  })
208
209
 
209
- resetTicketAdditional()
210
- ticketAdditional(transformedData)
211
- setDataAddition([])
210
+
211
+ if (has_addition_global == 1) {
212
+ LibNavigation.navigateForResult('event/additional', {
213
+ event_id: dataEvent?.event_id,
214
+ qty: 1,
215
+ }, 696).then((value) => {
216
+ if (value != "") {
217
+ setDataAddition(dataAddition.push(JSON.parse(value)))
218
+ }
219
+ resetTicketAdditional()
220
+ ticketAdditional(transformedData)
221
+ })
222
+
223
+ } else {
224
+ resetTicketAdditional()
225
+ ticketAdditional(transformedData)
226
+ setDataAddition([])
227
+ }
228
+
212
229
  })
213
230
 
214
231
 
@@ -234,6 +251,9 @@ export default function m(props: EventTicket_list2Props): any {
234
251
  if (dataAddition?.length > 0) {
235
252
  dataEvent.addition = dataAddition
236
253
  }
254
+
255
+ esp.log(dataAddition);
256
+
237
257
  LibNavigation.navigate('payment/ticket_multi', {
238
258
  order_type: EventConfigProperty?.state()?.get()?.order_type?.ticket,
239
259
  fee_platform: fee_platform,
@@ -507,7 +527,7 @@ export default function m(props: EventTicket_list2Props): any {
507
527
  </LibSkeleton>
508
528
  :
509
529
  <>
510
- {
530
+ {/* {
511
531
  Object.values(pendingData).filter((item: any) => item?.order_type == "ticket").length > 0 &&
512
532
  <EventPending_trx
513
533
  onPress={() => {
@@ -518,7 +538,7 @@ export default function m(props: EventTicket_list2Props): any {
518
538
  order_type="ticket"
519
539
  title={esp.lang("event/ticket_list", "pending", String(Object.values(pendingData).filter((item: any) => item?.order_type == "ticket").length))}
520
540
  />
521
- }
541
+ } */}
522
542
  {
523
543
  isInPricingQueueConfig(availableResult?.id) && isPass ?
524
544
  <View style={{ backgroundColor: LibStyle.colorGreen, margin: 16, borderRadius: 5, padding: 10, ...LibStyle.elevation(2) }} >
@@ -12,11 +12,12 @@ import { LibToastProperty } from 'esoftplay/cache/lib/toast/import';
12
12
  import { applyStyle } from 'esoftplay';
13
13
  import { EventButton } from 'esoftplay/cache/event/button/import';
14
14
  import { EventHeader } from 'esoftplay/cache/event/header/import';
15
+ import { LibIcon } from 'esoftplay/cache/lib/icon/import';
15
16
  import { LibPicture } from 'esoftplay/cache/lib/picture/import';
16
17
  import esp from 'esoftplay/esp';
17
18
  import useSafeState from 'esoftplay/state';
18
19
  import React, { useEffect } from 'react';
19
- import { ScrollView, Text, View } from 'react-native';
20
+ import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
20
21
 
21
22
 
22
23
  export interface EventTms_out_temporaryArgs {
@@ -29,6 +30,7 @@ export default function m(props: EventTms_out_temporaryProps): any {
29
30
  const user_qr = LibNavigation.getArgs(props, 'qr_code')
30
31
  const { scan_type, event_id, selectGate, typeScanner }: any = LibNavigation.getArgsAll(props)
31
32
  const [result, setResult] = useSafeState<any>(undefined)
33
+ const [useAll, setUseAll] = useSafeState<boolean>(false)
32
34
 
33
35
  useEffect(() => {
34
36
  loadData()
@@ -61,7 +63,6 @@ export default function m(props: EventTms_out_temporaryProps): any {
61
63
  list: res?.list?.length == 0 ? [] : a,
62
64
  staff: res?.staff?.length == 0 ? [] : b
63
65
  }
64
- esp.log({ res, c });
65
66
  setResult(c)
66
67
 
67
68
  }, (error) => {
@@ -69,6 +70,23 @@ export default function m(props: EventTms_out_temporaryProps): any {
69
70
  }, 1)
70
71
  }
71
72
 
73
+ useEffect(() => {
74
+ setUseAll(result?.list?.some((x: any) => x.checked == 0) ? false : true)
75
+ }, [result])
76
+
77
+
78
+ const toggleCheckedAll = () => {
79
+ const isAllChecked = result?.list?.every((item: any) => item.checked == 1);
80
+ const newCheckedValue = isAllChecked ? 0 : 1;
81
+
82
+ const updatedList = result?.list?.map((item: any) => ({
83
+ ...item,
84
+ checked: newCheckedValue,
85
+ }));
86
+
87
+ setResult({ ...result, list: updatedList });
88
+ };
89
+
72
90
  function quitTemporary(): void {
73
91
  let list = [...result?.list, ...result.staff]
74
92
  let a = list.filter((item: any) => item.checked == 1).map((it: any) => it.id)
@@ -144,6 +162,7 @@ export default function m(props: EventTms_out_temporaryProps): any {
144
162
  )
145
163
  }
146
164
 
165
+
147
166
  let lastStatusStaff = ''
148
167
  function renderStaff(item: any, i: number) {
149
168
  const showStatusScanned = lastStatusStaff != item?.status_label
@@ -212,9 +231,21 @@ export default function m(props: EventTms_out_temporaryProps): any {
212
231
  </View>
213
232
  </ScrollView>
214
233
  <View style={{ padding: 10, backgroundColor: '#fff' }}>
234
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between', marginBottom: 10, alignContent: 'center', alignItems: 'center' }}>
235
+ <Text allowFontScaling={false} numberOfLines={2} ellipsizeMode={'tail'} style={{ flex: 1, fontWeight: 'bold', fontSize: 14, letterSpacing: 1 }}>{esp.lang("event/tms_in_list", "total_ticket_use", result?.list?.filter((it: any) => it.checked == 1).length)}</Text>
236
+ <TouchableOpacity onPress={() => {
237
+ toggleCheckedAll()
238
+ }} style={applyStyle({ paddingHorizontal: 10, borderWidth: 1, borderColor: 'rgba(0, 0, 0, 0)', height: 35, borderRadius: 16, backgroundColor: useAll ? LibStyle.colorRed : LibStyle.colorGreen, flexDirection: 'row', alignItems: 'center', alignContent: 'center', justifyContent: 'center' })} >
239
+ <Text allowFontScaling={false} style={applyStyle({ fontFamily: "ArialBold", fontSize: 14, textAlign: "center", textAlignVertical: 'center', color: '#fff', marginRight: 15 })} >{useAll ? esp.lang("event/tms_in_list", "cancel_use") : esp.lang("event/tms_in_list", "use_all")}</Text>
240
+ <LibIcon.Ionicons size={18} color="#fff" name={useAll ? "close" : "checkmark-done"} />
241
+ </TouchableOpacity>
242
+ </View>
243
+
215
244
  <EventButton
216
245
  label={esp.lang("event/tms_out_temporary", "btn_exit")}
217
- backgroundColor={LibStyle.colorRed}
246
+ backgroundColor={"#fff"}
247
+ borderColor={LibStyle.colorRed}
248
+ fontColor={LibStyle.colorRed}
218
249
  onPress={() => {
219
250
  quitTemporary()
220
251
  }}
package/id.json CHANGED
@@ -1043,6 +1043,7 @@
1043
1043
  "buy_now": "Bayar Sekarang",
1044
1044
  "canceled": "Order Cancelled",
1045
1045
  "choose_card": "Silahkan pilih kartu anda dahulu",
1046
+ "download": "Unduh",
1046
1047
  "err": "Oops",
1047
1048
  "err_confirm": "Oops",
1048
1049
  "expired_on": "Berlaku hingga : ",
@@ -1320,6 +1321,7 @@
1320
1321
  "chosen": "Dipilih",
1321
1322
  "chosen_by": "Sedang dipilih orang lain",
1322
1323
  "empty": "Kosong",
1324
+ "front": "Depan",
1323
1325
  "full": "Penuh",
1324
1326
  "header_title": "Pilih Kursi",
1325
1327
  "load_failed": "Oops!!",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay-event",
3
- "version": "0.0.0-r",
3
+ "version": "0.0.0-t",
4
4
  "description": "event module on esoftplay framework",
5
5
  "main": "index.js",
6
6
  "scripts": {