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