|
|
@@ -19,13 +19,14 @@
|
|
|
<span>{{commodityDetails.commodity.commodityName}}</span>
|
|
|
</van-skeleton>
|
|
|
</div>
|
|
|
+ <!--
|
|
|
<div class="stock">
|
|
|
<van-skeleton :row="1" :loading="loading">
|
|
|
<span>{{commodityDetails.commodity.stock}}</span>
|
|
|
</van-skeleton>
|
|
|
<span>{{$t('productDetails.stock')}}</span>
|
|
|
-
|
|
|
</div>
|
|
|
+ -->
|
|
|
</div>
|
|
|
<div class="discount" v-if="commodityDetails.commodity.commodityCouponList.length">
|
|
|
<div class="left">
|
|
|
@@ -308,7 +309,7 @@ export default {
|
|
|
let num = 0;
|
|
|
if (this.travelList[0] && this.travelList[1]) {
|
|
|
num =
|
|
|
- this.commodityDetails.commodity.stock -
|
|
|
+ this.getSeatNum(this.commodityDetails.commodity.seatInfoLst) -
|
|
|
(this.travelList[0].num + this.travelList[1].num);
|
|
|
}
|
|
|
if (num < 0) {
|
|
|
@@ -319,9 +320,9 @@ export default {
|
|
|
//计算成人票数限制
|
|
|
adultNum() {
|
|
|
let num = 0;
|
|
|
- if (this.commodityDetails.commodity.stock && this.travelList[1]) {
|
|
|
+ if (this.getSeatNum(this.commodityDetails.commodity.seatInfoLst) && this.travelList[1]) {
|
|
|
num =
|
|
|
- this.commodityDetails.commodity.stock -
|
|
|
+ this.getSeatNum(this.commodityDetails.commodity.seatInfoLst) -
|
|
|
this.travelList[1].num;
|
|
|
}
|
|
|
return num;
|
|
|
@@ -329,9 +330,9 @@ export default {
|
|
|
//计算儿童票数限制
|
|
|
childrenNum() {
|
|
|
let num = 0;
|
|
|
- if (this.commodityDetails.commodity.stock && this.travelList[0]) {
|
|
|
+ if (this.getSeatNum(this.commodityDetails.commodity.seatInfoLst) && this.travelList[0]) {
|
|
|
num =
|
|
|
- this.commodityDetails.commodity.stock -
|
|
|
+ this.getSeatNum(this.commodityDetails.commodity.seatInfoLst) -
|
|
|
this.travelList[0].num;
|
|
|
}
|
|
|
return num;
|
|
|
@@ -739,6 +740,29 @@ export default {
|
|
|
}
|
|
|
return day;
|
|
|
},
|
|
|
+
|
|
|
+ //取得座位数
|
|
|
+ getSeatNum(seatList) {
|
|
|
+ //取得选中日期
|
|
|
+ let departureDate = "";
|
|
|
+ for (let i = 0; i < this.dateList.length; i++) {
|
|
|
+ if (this.dateList[i].active) {
|
|
|
+ departureDate = this.dateList[i].timeAll;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(`选中日期:` + departureDate);
|
|
|
+ let seatNum = 0;
|
|
|
+ if (departureDate != "") {
|
|
|
+ for (let i = 0; i < seatList.length; i++) {
|
|
|
+ if (seatList[i].departureDate == departureDate) {
|
|
|
+ seatNum = seatList[i].seatNum;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return seatNum;
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|