esoftplay-event 0.0.0-s → 0.0.0-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.
@@ -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/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
@@ -286,6 +288,7 @@ export default function m(props: EventDetailProps): any {
286
288
  LibNavigation.navigate(result?.config?.hasOwnProperty('multiprice') && result?.config?.multiprice == 1 ? 'event/ticket_list2' : 'event/ticket_list', {
287
289
  url: result.url_price,
288
290
  has_addition: result?.has_addition,
291
+ has_addition_global: result?.has_addition_global,
289
292
  fee_platform: {
290
293
  fee_platform_amount: result?.fee_platform_amount,
291
294
  fee_platform_type: result?.fee_platform_type,
@@ -301,6 +304,7 @@ export default function m(props: EventDetailProps): any {
301
304
  LibNavigation.navigate(result?.config?.hasOwnProperty('multiprice') && result?.config?.multiprice == 1 ? 'event/ticket_list2' : 'event/ticket_list', {
302
305
  url: result.url_price,
303
306
  has_addition: result?.has_addition,
307
+ has_addition_global: result?.has_addition_global,
304
308
  fee_platform: {
305
309
  fee_platform_amount: result?.fee_platform_amount,
306
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
  }
@@ -118,16 +118,18 @@ export default function m(props: EventOrder_waitingProps): any {
118
118
  payment_id: result?.payment_id,
119
119
  }
120
120
 
121
- function rebuy(dataCC: any) {
121
+ function rebuy(dataCC?: any) {
122
122
  if (result?.has_addition == 1) {
123
123
  dataPost.addition = getAddition()
124
124
  }
125
125
 
126
- dataPost.card_id = dataCC?.card_id
127
- dataPost.card_number = dataCC?.card_number
128
- dataPost.card_cvv = dataCC?.card_cvv
129
- dataPost.card_expiry_year = dataCC?.card_expiry_month
130
- dataPost.card_expiry_month = dataCC?.expiry_month
126
+ if (!!dataCC) {
127
+ dataPost.card_id = dataCC?.card_id
128
+ dataPost.card_number = dataCC?.card_number
129
+ dataPost.card_cvv = dataCC?.card_cvv
130
+ dataPost.card_expiry_year = dataCC?.card_expiry_month
131
+ dataPost.card_expiry_month = dataCC?.expiry_month
132
+ }
131
133
 
132
134
  let url = 'event_booking/' + result?.event_id
133
135
  LibNavigation.navigateForResult('event/loading_page', {
@@ -136,6 +138,7 @@ export default function m(props: EventOrder_waitingProps): any {
136
138
  title: esp.lang("bigbang/payment", "title_buy_ticket", result?.event_name),
137
139
  isSecure: 1,
138
140
  amount: LibUtils.numberAbsolute(result?.total),
141
+ currency: result?.currency,
139
142
  receive_name: "BBO",
140
143
  receive_image: 'https://bbo.co.id/images/uploads/logo-bbo-tagline_1.png',
141
144
  send_name: result?.name,
@@ -187,7 +190,7 @@ export default function m(props: EventOrder_waitingProps): any {
187
190
 
188
191
  LibProgress.show(esp.lang("event/order_detail_waiting", "wait"))
189
192
  new LibCurl('event_order_waiting_pay', post, (res, msg) => {
190
- if (dataCC) {
193
+ if (res?.url_web) {
191
194
  let forWebCC = {
192
195
  url: url,
193
196
  url_web: res?.url_web,
@@ -221,6 +224,33 @@ export default function m(props: EventOrder_waitingProps): any {
221
224
 
222
225
  }
223
226
 
227
+ function payWithCC(cc?: boolean) {
228
+ if (!!cc) {
229
+ LibNavigation.navigateForResult('component/payment_cc', {
230
+ amount: result?.total,
231
+ event_id: result?.event_id,
232
+ currency: result?.currency
233
+ }).then((value) => {
234
+ doBuy(value)
235
+ })
236
+ } else {
237
+ doBuy()
238
+ }
239
+
240
+ function doBuy(value?: any) {
241
+ LibDialog.confirm(esp.lang("bigbang/payment", "dialog_title"), esp.lang("bigbang/payment", "dialog_msg"), esp.lang("bigbang/payment", "dialog_ok"), () => {
242
+ if (result?.hasOwnProperty("url_pay") && result?.url_pay != "") {
243
+ pay(value)
244
+ } else {
245
+ rebuy(value)
246
+ }
247
+ }, esp.lang("bigbang/payment", "dialog_cancel"), () => {
248
+
249
+ })
250
+ }
251
+
252
+ }
253
+
224
254
  if (!result) {
225
255
  return <LibLoading />
226
256
  }
@@ -317,7 +347,7 @@ export default function m(props: EventOrder_waitingProps): any {
317
347
  </View>
318
348
 
319
349
  <EventButton
320
- label='Unduh'
350
+ label={esp.lang("event/order_detail_waiting", "download")}
321
351
  style={{ margin: 10, marginHorizontal: 20 }}
322
352
  backgroundColor={LibStyle.colorGreen}
323
353
  onPress={() => {
@@ -351,7 +381,7 @@ export default function m(props: EventOrder_waitingProps): any {
351
381
  }
352
382
 
353
383
  {
354
- result?.payment?.payment_type != 3 && result?.payment?.payment_type != 4 && result?.payment?.payment_type != 11 && result?.payment?.payment_type != 13 &&
384
+ result?.payment?.payment_type != 3 && result?.payment?.payment_type != 4 && result?.payment?.payment_type != 11 && result?.payment?.payment_type != 13 && result?.payment?.payment_type != 14 &&
355
385
  <>
356
386
  <View style={{ height: 3, backgroundColor: "#f6f6f6" }} />
357
387
 
@@ -430,7 +460,7 @@ export default function m(props: EventOrder_waitingProps): any {
430
460
  result?.status == 0 && LibUtils.moment(result?.exp_payment).serverFormat('YYYY-MM-DD HH:mm:ss') >= dateNow &&
431
461
  <View style={{ padding: 15, paddingTop: 10, paddingBottom: 10 }}>
432
462
  {
433
- result?.payment?.payment_type == 3 && //khusus cc
463
+ (result?.payment?.payment_type == 3 || result?.payment?.payment_type == 14) && //khusus cc & FPX
434
464
  <TouchableOpacity onPress={() => {
435
465
  if (result?.hasOwnProperty("has_addition") && result?.has_addition == 1) {
436
466
  LibNavigation.navigateForResult('event/additional', {
@@ -442,38 +472,10 @@ export default function m(props: EventOrder_waitingProps): any {
442
472
  if (additions != "") {
443
473
  setAddition(additions)
444
474
  }
445
- LibNavigation.navigateForResult('component/payment_cc', {
446
- amount: result?.total,
447
- event_id: result?.event_id,
448
- currency: result?.currency
449
- }).then((value) => {
450
- LibDialog.confirm(esp.lang("bigbang/payment", "dialog_title"), esp.lang("bigbang/payment", "dialog_msg"), esp.lang("bigbang/payment", "dialog_ok"), () => {
451
- if (result?.hasOwnProperty("url_pay") && result?.url_pay != "") {
452
- pay(value)
453
- } else {
454
- rebuy(value)
455
- }
456
- }, esp.lang("bigbang/payment", "dialog_cancel"), () => {
457
-
458
- })
459
- })
475
+ payWithCC(result?.payment?.payment_type == 3)
460
476
  })
461
477
  } else {
462
- LibNavigation.navigateForResult('component/payment_cc', {
463
- amount: result?.total,
464
- event_id: result?.event_id,
465
- currency: result?.currency
466
- }).then((value) => {
467
- LibDialog.confirm(esp.lang("bigbang/payment", "dialog_title"), esp.lang("bigbang/payment", "dialog_msg"), esp.lang("bigbang/payment", "dialog_ok"), () => {
468
- if (result?.hasOwnProperty("url_pay") && result?.url_pay != "") {
469
- pay(value)
470
- } else {
471
- rebuy(value)
472
- }
473
- }, esp.lang("bigbang/payment", "dialog_cancel"), () => {
474
-
475
- })
476
- })
478
+ payWithCC(result?.payment?.payment_type == 3)
477
479
  }
478
480
  }}>
479
481
  <View style={{ marginBottom: 10, height: 35, borderRadius: 17, backgroundColor: LibStyle.colorRed, justifyContent: 'center', alignItems: 'center', borderWidth: 1, borderColor: LibStyle.colorRed }} >
@@ -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}>
@@ -134,7 +134,7 @@ export default function m(props: EventTicket_listProps): any {
134
134
 
135
135
  const [pendingData] = EventLoading_pageProperty.state().useState()
136
136
 
137
- 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
138
138
 
139
139
  const [deeplinkParams] = UseDeeplinkProperty.params.useState()
140
140
  const [timer] = EventCountdownProperty.countdownTime.useState()
@@ -135,7 +135,7 @@ export default function m(props: EventTicket_list2Props): any {
135
135
 
136
136
  const [pendingData] = EventLoading_pageProperty.state().useState()
137
137
 
138
- 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
139
139
 
140
140
  const [deeplinkParams] = UseDeeplinkProperty.params.useState()
141
141
  const [timer] = EventCountdownProperty.countdownTime.useState()
@@ -147,6 +147,8 @@ export default function m(props: EventTicket_list2Props): any {
147
147
  const [showAll, setShowAll] = useSafeState<any>({});
148
148
  const [urlPayment, setUrlPayment] = useLazyState<any>()
149
149
 
150
+ // esp.log(availableResult);
151
+
150
152
  let dataEvent: any = {
151
153
  event_id: availableResult?.id,
152
154
  event_title: availableResult?.title,
@@ -205,9 +207,25 @@ export default function m(props: EventTicket_list2Props): any {
205
207
  });
206
208
  })
207
209
 
208
- resetTicketAdditional()
209
- ticketAdditional(transformedData)
210
- 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
+
211
229
  })
212
230
 
213
231
 
@@ -233,6 +251,9 @@ export default function m(props: EventTicket_list2Props): any {
233
251
  if (dataAddition?.length > 0) {
234
252
  dataEvent.addition = dataAddition
235
253
  }
254
+
255
+ esp.log(dataAddition);
256
+
236
257
  LibNavigation.navigate('payment/ticket_multi', {
237
258
  order_type: EventConfigProperty?.state()?.get()?.order_type?.ticket,
238
259
  fee_platform: fee_platform,
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-s",
3
+ "version": "0.0.0-u",
4
4
  "description": "event module on esoftplay framework",
5
5
  "main": "index.js",
6
6
  "scripts": {