Commit b06770ce authored by qipeng's avatar qipeng

Merge branch 'album' of http://git.tbd.yanzuoguang.com/panyongping/uni-pdtravel into album

parents 2220b2a6 b382ed0c
......@@ -17,10 +17,13 @@
<view class="merchant-title">
<view class="title-left">
<text >{{item.name}}</text>
<image src="../../../static/img/scenic/coupon.png" ></image>
<text class="title-coupon">
劵惠
</text>
<template v-if="item.couponVoList&&item.couponVoList.length>0">
<image src="../../../static/img/scenic/coupon.png"></image>
<text class="title-coupon">
劵惠
</text>
</template>
</view>
<view v-if="showDistance" class="title-right">
......@@ -28,8 +31,8 @@
</view>
</view>
<label v-for="(items,a) in item.productListCopy" :key='a'>
<view class="product" :class="{'on':items.ifChoose}">
<label v-for="(items,a) in item.productListCopy" :key='a' :class="{'off':items.status==2}">
<view class="product" :class="{'on':items.ifChangeBg}">
<view class="product-left">
<checkbox class="blue" :disabled="items.status==2" :value="JSON.stringify(items)" :checked="items.ifChecked" />
</view>
......@@ -118,13 +121,15 @@
</view>
</view>
<view class="bottom-right">
<text class="btn">去预定</text>
<text class="btn" @click="goFillorder()">去预定</text>
</view>
</view>
<!-- 客服组件 -->
<customer :scenicList='scenicList' ref='customer'></customer>
<!-- 购买须知 -->
<buyKnow :buyKnowData='buyKnowData' ref='buyKnow'></buyKnow>
<!-- 详情明细 -->
<detail :chooseProduct='chooseProduct' ref='detail'></detail>
<!-- 模态框 -->
<u-modal
v-model="showModal"
......@@ -140,15 +145,18 @@
<script>
import customer from '@/components/customer.vue'//客服
import buyKnow from '@/components/buyKnow.vue'//购买须知
import detail from './components/detail.vue'//购买须知
export default {
components:{
customer,
buyKnow
buyKnow,
detail
},
data() {
return {
merchantId:'z0015605022691a5945bbe463141668c',//商户Id
tabbar:['热门景点','一日游','摄影/旅拍','文创DIY'],//tabbar标题列表
merchantId:'',//商户Id
// tabbar:['热门景点','一日游','摄影/旅拍','文创DIY'],//tabbar标题列表
tabbar:['热门景点','一日游','摄影/旅拍'],//tabbar标题列表
active:0,//导航栏下标
imgList:[],//图片列表
scenicList:[],//景区数据
......@@ -157,18 +165,14 @@ export default {
chooseProduct:[],//选中的产品
showModal:false,//是否显示模态框
chooseMerchantProduct:'',//不支持多产品购买时,选中的景区产品
groupId:'',//组合Id
groupChannelId:'',//组合渠道Id
}
},
watch: {
//选中产品的数量变化
chooseProduct: {
handler(newValue, oldValue){
// this.originalTotal=0
// this.sellTotal=0
// this.chooseProduct.forEach((item)=>{//通过选中的产品计算价格
// this.originalTotal+=item.originalPrice
// this.sellTotal+=item.sellingPrice
// })
//当选中产品时
if(newValue.length>oldValue.length){
//找到当前选中的产品
......@@ -204,7 +208,7 @@ export default {
item2.productList.forEach(item3=>{
if(item.id==item3.id){
item3.ifChecked=false
item3.ifChoose=false
item3.ifChangeBg=false
}
})
})
......@@ -223,6 +227,7 @@ export default {
},
onLoad(option){
this.merchantId=option.merchantId||''
let token = uni.getStorageSync('token')
if(token){
uni.getLocation({
......@@ -285,10 +290,12 @@ export default {
//判断是否选中产品,选中产品的背景颜色需要变化
this.scenicList.forEach(item=>{
item.productList.forEach(item2=>{
item2.ifChoose=false
item2.ifChangeBg=false
this.chooseProduct.forEach(item3=>{
if(item2.id==item3.id){
item2.ifChoose=true
item2.ifChangeBg=true
//解决是否支持多产品购买弹窗2次之后,选中状态错误bug,需要在选中时修改状态
item2.ifChecked=true
}
})
})
......@@ -304,7 +311,7 @@ export default {
item2.productList.forEach(item3=>{
if(item.id==item3.id){
item3.ifChecked=false
item3.ifChoose=false
item3.ifChangeBg=false
}
})
})
......@@ -326,7 +333,7 @@ export default {
item2.productList.forEach(item3=>{
if(item.id==item3.id){
item3.ifChecked=false
item3.ifChoose=false
item3.ifChangeBg=false
}
})
})
......@@ -339,12 +346,15 @@ export default {
initList(latitude,longitude) {
let data = {
merchantId: this.merchantId, //商户id
openid:uni.getStorageSync('openid')||'',
latitude,
longitude
}
this.$request('/scenic/groupGood/getGroupProducts', data).then(res => {
if (res.code == '00') {
this.scenicList = res.data.merchantList
this.scenicList = res.data.merchantList||[]
this.groupId=res.data.groupId||''
this.groupChannelId=res.data.groupChannelId||''
this.scenicList.forEach((item,index)=>{
//获取当前景区图片,把当前景区放在第一位
if(item.id==this.merchantId){
......@@ -385,6 +395,45 @@ export default {
}
})
},
//---跳转填写订单页面
goFillorder(){
for (let i = 0; i < this.chooseProduct.length; i++) {
let item = this.chooseProduct[i]
if (item.status == 2) {
uni.showToast({
title: '售罄产品不能进行购买',
icon: 'none'
})
return
}
}
if (this.chooseProduct.length == 0) {
uni.showToast({
title: '请选择至少一个产品',
icon: 'none'
})
return
} else if (this.chooseProduct.length == 1) {
let query='?merchantId='+this.chooseProduct[0].merchantId+'&productId='+this.chooseProduct[0].id+'&orderSource=3'
if(this.chooseProduct[0].ticketType==2){//联票
uni.navigateTo({
url:'/pages/scenic/scenicJointOrder/scenicJointOrder'+query
})
}else{//普通票
uni.navigateTo({
url:'/pages/scenic/scenicSingleOrder/scenicSingleOrder'+query
})
}
} else {
let productIdList = this.chooseProduct.map((item) => {
return item.id
})
let query='?productIdList='+JSON.stringify(productIdList)+'&groupId='+this.groupId+'&groupChannelId='+this.groupChannelId+'&orderSource=3'
uni.navigateTo({
url:'/pages/combination/combiOrder/combiOrder'+query
})
}
}
}
}
</script>
......@@ -431,6 +480,9 @@ export default {
margin-top: 24rpx;
padding: 24rpx;
}
.merchant label.off .product{
background: #F3F3F3;
}
.merchant-title{
display: flex;
justify-content: space-between;
......@@ -458,11 +510,12 @@ export default {
font-size: 24rpx;
}
.product{
padding: 16rpx;
padding:10rpx 16rpx;
background: #ffffff;
border-radius: 8rpx;
display: flex;
align-items: center;
margin-top: 10rpx;
}
.product.on{
background: #E2EEFF;
......
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