Commit 3646ae60 authored by 潘永坪's avatar 潘永坪

组合票,联票不能组合购买

parent 7c7a72be
......@@ -174,8 +174,11 @@
<detail :chooseProduct="chooseProduct" ref="detail"></detail>
<!-- 商户详情 -->
<merchantDetail :detailData='detailData' ref='merchantDetail'></merchantDetail>
<!-- 模态框 -->
<u-modal :show="showModal" @confirm="chooseConfirm" @cancel="chooseCancel" title="提示" content="是否更改产品" show-cancel-button="true">
<!-- 模态框1,用于是否更改产品 -->
<u-modal :show="showModal1" @confirm="chooseConfirm" @cancel="chooseCancel" title="提示" content="是否更改产品" show-cancel-button="true">
</u-modal>
<!-- 模态框2,用于联票不能组合购买 -->
<u-modal :show="showModal2" @confirm="notBuyConfirm" title="提示" content="联票产品不能进行多产品购买" >
</u-modal>
<image class="suodaoImg" v-if="showSuodaoImg" src="https://lx.pangdly.com/img/cjsdFirst.50a2e63.jpg"></image>
<!-- 系统无法访问时弹窗 -->
......@@ -233,7 +236,8 @@ export default {
showDistance: false, //定位成功显示距离
buyKnowData: '', //购买须知数据
chooseProduct: [], //选中的产品
showModal: false, //是否显示模态框
showModal1: false, //模态框1,用于是否更改产品
showModal2: false, //模态框2,用于联票不能组合购买
chooseMerchantProduct: '', //不支持多产品购买时,选中的景区产品
merchantIndex:0,//选中的商家下标
middleHeight:0,//中间列表盒子高度
......@@ -257,8 +261,15 @@ export default {
handler(newValue, oldValue) {
//当选中产品时
if (newValue.length > oldValue.length) {
//找到当前选中的产品
let product = newValue[newValue.length - 1]
//一、联票不允许组合
if(this.chooseProduct.length>1){
if(this.chooseProduct.find(item=>item.ticketType==2)){
this.showModal2=true
return
}
}
//二、该产品是否支持多产品购买
let product = newValue[newValue.length - 1]//找到当前选中的产品
//商家一级
let merchant = ''
//通过产品一级找到商家一级
......@@ -277,7 +288,7 @@ export default {
if (product.isMoreBuy !== 0) {
if (number > 1) {
//显示确认弹窗
this.showModal = true
this.showModal1 = true
//当前选中的景区产品,用于确定以及取消方法取值
this.chooseMerchantProduct = product
}
......@@ -301,6 +312,8 @@ export default {
return val
})
}
}
},
deep: true,
......@@ -777,7 +790,7 @@ export default {
this.chooseProduct = this.chooseProduct.filter(function (val) {
return val
})
this.showModal = false
this.showModal1 = false
},
//---不支持多选产品,选择取消事件
chooseCancel() {
......@@ -796,9 +809,27 @@ export default {
this.chooseProduct.splice(index, 1)
}
})
this.showModal = false
this.showModal1 = false
},
//---联票产品不支持组合购买
notBuyConfirm(){
//获取最新的一个产品,删除最新的产品
let product=this.chooseProduct[this.chooseProduct.length-1]
//取消选中状态和选中背景颜色
this.scenicList.forEach(item2 => {
item2.productList.forEach(item3 => {
if (product.id == item3.id) {
item3.ifChecked = false
item3.ifChangeBg = false
}
})
})
delete this.chooseProduct[this.chooseProduct.length-1]
this.chooseProduct = this.chooseProduct.filter(function (val) {
return val
})
this.showModal2=false
},
//---跳转填写订单页面
goFillorder() {
for (let i = 0; i < this.chooseProduct.length; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment