esoftplay-event 0.0.2-s → 0.0.2-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.
@@ -195,7 +195,6 @@ export default function m(props: EventOrder_detailProps): any {
195
195
  checked: 0,
196
196
  })
197
197
  })
198
- esp.log({ data });
199
198
  setDataTicket(data)
200
199
  LibUtils.debounce(() => { dialogQtyAddons?.current?.show() }, 100)
201
200
  }, (error: any) => {
@@ -454,6 +453,7 @@ export default function m(props: EventOrder_detailProps): any {
454
453
 
455
454
  let startEvent = result?.start_date + " " + result?.start_time
456
455
  let dateNow = LibUtils.moment().localeFormat("YYYY-MM-DD HH:mm")
456
+ let valid = dataTicket?.some((item: any) => item.status == 1 && item.checked == 1);
457
457
 
458
458
  return (
459
459
  <View style={{ flex: 1, backgroundColor: LibStyle.colorBgGrey }}>
@@ -722,10 +722,8 @@ export default function m(props: EventOrder_detailProps): any {
722
722
  onPress={() => {
723
723
  setGroupAddon(item)
724
724
  LibUtils.debounce(() => {
725
- // setQty(1)
726
725
  dialogAddonList?.current?.show()
727
726
  }, 100)
728
- // loadDataAddons(item?.addons_id, item?.url)
729
727
  }}
730
728
  icon={'chevron-down'}
731
729
  title={item.title}
@@ -741,11 +739,9 @@ export default function m(props: EventOrder_detailProps): any {
741
739
  color={result?.color}
742
740
  onPress={() => {
743
741
  if (item?.hasOwnProperty('status') && item?.status == 1) {
744
- // setQty(1)
745
- setSelectedAddon(item)
746
- loadDataTicket(result?.id, item?.[0]?.price_id, item?.[0]?.ondate)
747
-
748
- // loadDataAddons(item?.addons_id, item?.url)
742
+ setGroupAddon(item)
743
+ setSelectedAddon(item?.list?.[0])
744
+ loadDataTicket(result?.id, item?.list?.[0]?.price_id, item?.list?.[0]?.ondate)
749
745
  }
750
746
  }}
751
747
  icon={'plus-circle-outline'}
@@ -1220,9 +1216,13 @@ export default function m(props: EventOrder_detailProps): any {
1220
1216
  </ScrollView>
1221
1217
 
1222
1218
  <EventButton label={esp.lang("event/order_detail", "next")} onPress={() => {
1223
- dialogQtyAddons?.current?.hide()
1224
- loadDataAddons(getSelectedAddon()?.addons_id, getSelectedAddon()?.url)
1225
- }} backgroundColor={"#FFF"} borderColor={LibStyle.colorGreen} fontColor={LibStyle.colorGreen} />
1219
+ if (valid) {
1220
+ dialogQtyAddons?.current?.hide()
1221
+ loadDataAddons(getSelectedAddon()?.addons_id, getSelectedAddon()?.url)
1222
+ }
1223
+ }}
1224
+ backgroundColor={!valid ? LibStyle.colorGrey : LibStyle.colorGreen}
1225
+ />
1226
1226
  </View>
1227
1227
  </LibSlidingup>
1228
1228
 
@@ -136,6 +136,7 @@ export default function m(props: EventOrder_detail_shareProps): any {
136
136
  }
137
137
 
138
138
  let checkNotUsed = dataTicket?.length > 0 && dataTicket?.filter((x: any) => x?.checked == 0)
139
+ let valid = dataTicket?.some((item: any) => item.checked == 1);
139
140
 
140
141
  return (
141
142
  <LibKeyboard_avoid style={{ flex: 1, backgroundColor: '#fff' }}>
@@ -284,13 +285,15 @@ export default function m(props: EventOrder_detail_shareProps): any {
284
285
  <EventButton
285
286
  label={esp.lang("event/order_detail_share", "share_ticket")}
286
287
  onPress={() => {
287
- LibNavigation.navigateForResult("bigbang/payment_pin", undefined, 1132).then((p) => {
288
- if (p) {
289
- shareTicket(p)
290
- }
291
- })
288
+ if (valid) {
289
+ LibNavigation.navigateForResult("bigbang/payment_pin", undefined, 1132).then((p) => {
290
+ if (p) {
291
+ shareTicket(p)
292
+ }
293
+ })
294
+ }
292
295
  }}
293
- backgroundColor={LibStyle.colorPrimary}
296
+ backgroundColor={valid ? LibStyle.colorPrimary : LibStyle.colorBgGrey}
294
297
  style={{ borderRadius: 5, marginTop: 10 }}
295
298
  />
296
299
  </View>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay-event",
3
- "version": "0.0.2-s",
3
+ "version": "0.0.2-t",
4
4
  "description": "event module on esoftplay framework",
5
5
  "main": "index.js",
6
6
  "scripts": {