|
|
|
@ -354,12 +354,6 @@ export default { |
|
|
|
|
if (index != -1) { |
|
|
|
|
const currentNum = that.car[index].num; |
|
|
|
|
if (Number(that.selectItem.currentinventory) - currentNum >= 1) { |
|
|
|
|
// 超过库存 |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: 'none', |
|
|
|
|
title: '库存不足' |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
let newItem = { ...that.selectItem, date: e.fulldate, num: currentNum + 1, zkc: that.selectItem.currentinventory }; |
|
|
|
|
uni.setStorageSync('ALL_TICKET', that.car) |
|
|
|
|
const data = JSON.stringify(newItem) |
|
|
|
@ -368,6 +362,12 @@ export default { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/pages/addUserinfo/addUserinfo?needInfoItem=' + data + '&event=' + eve |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
// 超过库存 |
|
|
|
|
uni.showToast({ |
|
|
|
|
icon: 'none', |
|
|
|
|
title: '库存不足' |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
let newItem = { ...that.selectItem, date: e.fulldate, num: 1, zkc: that.selectItem.currentinventory }; |
|
|
|
@ -536,6 +536,8 @@ export default { |
|
|
|
|
//有效期模式, |
|
|
|
|
debugger; |
|
|
|
|
if (item.datesettings == 1) { |
|
|
|
|
const date = this.parseTime(new Date(),'{y}-{m}-{d}') |
|
|
|
|
item.date = date |
|
|
|
|
// 不限库存 |
|
|
|
|
if (item.inventorySettings == 1) { |
|
|
|
|
//无需游客信息 |
|
|
|
@ -561,7 +563,34 @@ export default { |
|
|
|
|
|
|
|
|
|
that.$refs.cartAnimation.touchOnGoods(that.event, that.busPos); |
|
|
|
|
} |
|
|
|
|
//需要游客信息一个或全部 |
|
|
|
|
// //需要游客信息一个 |
|
|
|
|
// if (item.touristInformation == 2) { |
|
|
|
|
// let index, |
|
|
|
|
// if (that.car.length > 0) { |
|
|
|
|
// index = that.car.findIndex(items=>Number(items.id) == Number(item.id)&&items.date == item.date) |
|
|
|
|
// if(index!=-1){ |
|
|
|
|
// that.car[index].num++ |
|
|
|
|
// uni.setStorageSync('ALL_TICKET', that.car) |
|
|
|
|
// }else{ |
|
|
|
|
// uni.setStorageSync('ALL_TICKET', that.car) |
|
|
|
|
// const data = JSON.stringify(item) |
|
|
|
|
// const eve = JSON.stringify(event) |
|
|
|
|
// item.btnLoading = false; |
|
|
|
|
// uni.navigateTo({ |
|
|
|
|
// url: '/pages/addUserinfo/addUserinfo?needInfoItem=' + data + '&event=' + eve |
|
|
|
|
// }) |
|
|
|
|
// } |
|
|
|
|
// }else{ |
|
|
|
|
// uni.setStorageSync('ALL_TICKET', that.car) |
|
|
|
|
// const data = JSON.stringify(item) |
|
|
|
|
// const eve = JSON.stringify(event) |
|
|
|
|
// item.btnLoading = false; |
|
|
|
|
// uni.navigateTo({ |
|
|
|
|
// url: '/pages/addUserinfo/addUserinfo?needInfoItem=' + data + '&event=' + eve |
|
|
|
|
// }) |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
//需要游客信息全部 |
|
|
|
|
if (item.touristInformation == 2 || item.touristInformation == 3) { |
|
|
|
|
uni.setStorageSync('ALL_TICKET', that.car) |
|
|
|
|
const data = JSON.stringify(item) |
|
|
|
|