|
|
|
@ -1,7 +1,7 @@ |
|
|
|
|
<template> |
|
|
|
|
<page-meta :page-style="'overflow:' + (show ? 'hidden' : 'visible')"></page-meta> |
|
|
|
|
<view class="m-content"> |
|
|
|
|
<view class="m-card m-card-one"> |
|
|
|
|
<view class="m-card m-card-one" v-if="overSituation"> |
|
|
|
|
<view class="m-one-first-row"> |
|
|
|
|
<view class="m-ticket-name">{{ ticket.ticketname }}</view> |
|
|
|
|
<view class="m-ticket-use-time" v-if="ticket && ticket.datesettings == 1"> |
|
|
|
@ -190,7 +190,7 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="m-feet-box"> |
|
|
|
|
<view class="m-feet-box" v-if="overSituation"> |
|
|
|
|
<view class="m-feet-left"> |
|
|
|
|
<view class="m-price"> |
|
|
|
|
总价 |
|
|
|
@ -214,6 +214,9 @@ |
|
|
|
|
</button> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="no-ticket-tips" v-if="!overSituation"> |
|
|
|
|
今日门票已售罄 |
|
|
|
|
</view> |
|
|
|
|
<!-- 人员 --> |
|
|
|
|
<liu-select :multiple="fasle" ref="scroll" :list="dataList" @change="chooseSuccess" @del="del" @edit="edit" |
|
|
|
|
@add="addPerson"></liu-select> |
|
|
|
@ -481,7 +484,8 @@ export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
maxNum: -1, |
|
|
|
|
maxBuyNums:300, |
|
|
|
|
maxBuyNums: 100, |
|
|
|
|
overSituation: true,//启明芯全局判断是否可选 |
|
|
|
|
tentId: null, |
|
|
|
|
selected: null, //门票日历 |
|
|
|
|
startDate: parseTime(new Date()), |
|
|
|
@ -591,9 +595,11 @@ export default { |
|
|
|
|
// val.num = 1; |
|
|
|
|
// } |
|
|
|
|
// if (val.qmxId == null) { |
|
|
|
|
const priceInCents = Math.round(Number(val.settlementPrice) * 100); |
|
|
|
|
const quantity = Number(val.num); |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.sumPrice = Number(val.settlementPrice) * Number(val.num); |
|
|
|
|
}) |
|
|
|
|
this.sumPrice = (priceInCents * quantity) / 100; |
|
|
|
|
}); |
|
|
|
|
// } |
|
|
|
|
}, |
|
|
|
|
deep: true, |
|
|
|
@ -617,7 +623,7 @@ export default { |
|
|
|
|
fullDate: this.getFullDate(i), |
|
|
|
|
isAvailable: true, |
|
|
|
|
price: "0元", |
|
|
|
|
inventory:0, |
|
|
|
|
inventory: 0, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
console.log(options); |
|
|
|
@ -628,9 +634,9 @@ export default { |
|
|
|
|
} else { |
|
|
|
|
this.maxNum = -1; |
|
|
|
|
} |
|
|
|
|
if (ticket.datesettings == 1 && ticket.inventorySettings == 2 && this.maxNum == -1) { |
|
|
|
|
this.maxNum = Number(ticket.currentinventory); |
|
|
|
|
} |
|
|
|
|
// if (ticket.datesettings == 1 && ticket.inventorySettings == 2 && this.maxNum == -1) { |
|
|
|
|
// this.maxNum = Number(ticket.currentinventory); |
|
|
|
|
// } |
|
|
|
|
this.tentId = options.tentId; |
|
|
|
|
this.getScencAndTicketInfo(ticket.id, options.tentId); |
|
|
|
|
const users = uni.getStorageSync('users') |
|
|
|
@ -755,6 +761,12 @@ export default { |
|
|
|
|
if (this.ticket.datesettings == 1) { |
|
|
|
|
// 不限库存 |
|
|
|
|
this.ticket.date = that.parseTime(new Date()) |
|
|
|
|
if (this.ticket.inventorySettings == 2) { |
|
|
|
|
this.maxBuyNums = Number(this.ticket.currentinventory) |
|
|
|
|
} |
|
|
|
|
if (this.ticket.inventorySettings == 1) { |
|
|
|
|
this.maxBuyNums = 100 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (this.ticket.datesettings == 2 || this.ticket.datesettings == 3) { |
|
|
|
|
//使用日期和使用小时模式:单日,这里使用日期设置不论星期还是多日都不影响返回的日期了 |
|
|
|
@ -772,7 +784,7 @@ export default { |
|
|
|
|
res.data.forEach(items => { |
|
|
|
|
const obj = { |
|
|
|
|
date: items.date, |
|
|
|
|
info: items.isAvailable ? "库存:" + that.ticket.currentinventory : '', |
|
|
|
|
info: items.isAvailable && items.inventory != -1 ? "库存:" + items.inventory : "", |
|
|
|
|
infoColor: "#666", |
|
|
|
|
topInfo: items.isAvailable ? items.settlementPrice + '元' : '', |
|
|
|
|
topInfoColor: "", |
|
|
|
@ -786,7 +798,7 @@ export default { |
|
|
|
|
selectedDates.forEach((item, index) => { |
|
|
|
|
that.dates[index].isAvailable = item.disable; |
|
|
|
|
that.dates[index].price = item.topInfo; |
|
|
|
|
that.dates[index].inventory = -1 |
|
|
|
|
that.dates[index].inventory = item.info == "" ? -1 : item.info.match(/\d+/)[0]; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
console.log(this.dates); |
|
|
|
@ -810,9 +822,9 @@ export default { |
|
|
|
|
res.data.forEach(items => { |
|
|
|
|
const obj = { |
|
|
|
|
date: items.date, |
|
|
|
|
info: items.isAvailable || items.inventory != 0 ? "库存:" + items.inventory : '', |
|
|
|
|
info: items.isAvailable ? "库存:" + items.inventory : "", |
|
|
|
|
infoColor: "#666", |
|
|
|
|
topInfo: items.isAvailable || items.inventory != 0 ? items.settlementPrice + '元' : '', |
|
|
|
|
topInfo: items.isAvailable ? items.settlementPrice + '元' : '', |
|
|
|
|
topInfoColor: "", |
|
|
|
|
badgeColor: "", |
|
|
|
|
disable: !items.isAvailable || items.inventory == 0, // 禁用 |
|
|
|
@ -823,7 +835,7 @@ export default { |
|
|
|
|
selectedDates.forEach((item, index) => { |
|
|
|
|
that.dates[index].isAvailable = item.disable; |
|
|
|
|
that.dates[index].price = item.topInfo; |
|
|
|
|
that.dates[index].inventory = item.inventory == -1 ? -1: item.inventory; |
|
|
|
|
that.dates[index].inventory = item.info == "" ? -1 : item.info.match(/\d+/)[0]; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
console.log(this.dates); |
|
|
|
@ -845,6 +857,20 @@ export default { |
|
|
|
|
that.selected = []; |
|
|
|
|
that.ticket.settlementPrice = res.data[0].settlementPrice |
|
|
|
|
|
|
|
|
|
const nowDate = that.parseTime(new Date()) |
|
|
|
|
console.log(nowDate) |
|
|
|
|
const index = res.data.findIndex(item => item.date == nowDate) |
|
|
|
|
if (index != -1) { |
|
|
|
|
if (res.data[index].isAvailable == true) { |
|
|
|
|
that.maxBuyNums = res.data[index].inventory |
|
|
|
|
that.overSituation = true |
|
|
|
|
} else { |
|
|
|
|
that.overSituation = false |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
that.overSituation = false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
console.log(that.ticket, 'thatthatthat') |
|
|
|
|
res.data.forEach(items => { |
|
|
|
|
const obj = { |
|
|
|
@ -862,7 +888,7 @@ export default { |
|
|
|
|
selectedDates.forEach((item, index) => { |
|
|
|
|
that.dates[index].isAvailable = item.disable; |
|
|
|
|
that.dates[index].price = item.topInfo; |
|
|
|
|
that.dates[index].inventory = item.inventory==-1?-1:item.inventory; |
|
|
|
|
that.dates[index].inventory = item.info == "" ? -1 : item.info.match(/\d+/)[0]; |
|
|
|
|
}); |
|
|
|
|
console.log(this.dates); |
|
|
|
|
|
|
|
|
@ -898,7 +924,7 @@ export default { |
|
|
|
|
res.data.forEach(items => { |
|
|
|
|
const obj = { |
|
|
|
|
date: items.date, |
|
|
|
|
info: items.isAvailable ? "库存:" + that.ticket.currentinventory : '', |
|
|
|
|
info: items.isAvailable && items.inventory != -1 ? "库存:" + items.inventory : "", |
|
|
|
|
infoColor: "#666", |
|
|
|
|
topInfo: items.isAvailable ? items.settlementPrice + '元' : '', |
|
|
|
|
topInfoColor: "", |
|
|
|
@ -927,9 +953,9 @@ export default { |
|
|
|
|
res.data.forEach(items => { |
|
|
|
|
const obj = { |
|
|
|
|
date: items.date, |
|
|
|
|
info: items.isAvailable || items.inventory == 0 ? "库存:" + items.inventory : '', |
|
|
|
|
info: items.isAvailable ? "库存:" + items.inventory : '', |
|
|
|
|
infoColor: "#666", |
|
|
|
|
topInfo: items.isAvailable || items.inventory == 0 ? items.settlementPrice + '元' : '', |
|
|
|
|
topInfo: items.isAvailable ? items.settlementPrice + '元' : '', |
|
|
|
|
topInfoColor: "", |
|
|
|
|
badgeColor: "", |
|
|
|
|
disable: !items.isAvailable || items.inventory == 0, // 禁用 |
|
|
|
@ -1040,8 +1066,8 @@ export default { |
|
|
|
|
console.log(date.price.replace("元", "")) |
|
|
|
|
this.ticket.settlementPrice = parseFloat(date.price.replace("元", "").trim()); |
|
|
|
|
this.ticket.num = 1 |
|
|
|
|
this.sumPrice = this.ticket.settlementPrice * this.ticket.num; |
|
|
|
|
this.maxBuyNums = date.inventory == -1 ? 300 : date.inventory |
|
|
|
|
this.sumPrice = this.ticket.settlementPrice; |
|
|
|
|
this.maxBuyNums = date.inventory == -1 ? 100 : date.inventory |
|
|
|
|
this.$forceUpdate(); |
|
|
|
|
console.log(this.ticket, "this.ticket"); |
|
|
|
|
|
|
|
|
@ -1495,7 +1521,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: res.msg + '请检查', |
|
|
|
|
title: res.msg, |
|
|
|
|
icon: 'none' |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -1523,13 +1549,13 @@ export default { |
|
|
|
|
that.nowIndex = -1 |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.maxBuyNums = e.info == "" ? 300 : Number(e.info.split(":")[1]) |
|
|
|
|
this.maxBuyNums = e.extraInfo.info == "" ? 100 : e.extraInfo.info.match(/\d+/)[0] |
|
|
|
|
this.ticket.date = e.fulldate; |
|
|
|
|
this.ticket.settlementPrice = parseFloat( |
|
|
|
|
e.extraInfo.topInfo.replace("元", "").trim() |
|
|
|
|
); |
|
|
|
|
this.ticket.num = 1 |
|
|
|
|
this.sumPrice = this.ticket.settlementPrice * this.ticket.num; |
|
|
|
|
this.sumPrice = this.ticket.settlementPrice; |
|
|
|
|
this.$forceUpdate(); |
|
|
|
|
console.log(this.ticket, "this.ticket"); |
|
|
|
|
|
|
|
|
@ -1548,7 +1574,9 @@ export default { |
|
|
|
|
changeCount(val, ticket) { |
|
|
|
|
console.log(val, ticket); |
|
|
|
|
this.ticket.num = val; |
|
|
|
|
this.sumPrice = Number(ticket.settlementPrice) * val; |
|
|
|
|
const priceInCents = Math.round(Number(ticket.settlementPrice) * 100); |
|
|
|
|
const quantity = Number(val); |
|
|
|
|
this.sumPrice = (priceInCents * quantity) / 100; |
|
|
|
|
}, |
|
|
|
|
//选择游客 |
|
|
|
|
selectUser(val, boo) { |
|
|
|
@ -2310,4 +2338,15 @@ export default { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.no-ticket-tips { |
|
|
|
|
text-align: center; |
|
|
|
|
background-color: #ffffff61; |
|
|
|
|
color: #333; |
|
|
|
|
padding: 200rpx 0; |
|
|
|
|
margin: 0 50rpx; |
|
|
|
|
font-size: 44rpx; |
|
|
|
|
border-radius: 20rpx; |
|
|
|
|
margin-top: 200rpx; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|