Commit 66533f99 authored by 潘永坪's avatar 潘永坪

单产品判断条件处理

parent 869d5ed1
...@@ -70,9 +70,10 @@ ...@@ -70,9 +70,10 @@
</view> </view>
</view> </view>
<!-- 出行贴士 --> <!-- 出行贴士 -->
<view class="travelTips" v-if="travelTips"> <view class="travelTips" v-if="travelTips" @click="navigation()">
<view class="middle-title" style="padding-bottom: 4rpx;"> <view class="middle-title" style="padding-bottom: 4rpx;">
{{travelTips.title}} <text style="margin-right: 10rpx;">{{travelTips.title}}</text>
<u-icon name='map-fill'></u-icon>
</view> </view>
<view class="travel-content" v-for="(item,a) of travelTips.merchantChildTitleData" :key="a"> <view class="travel-content" v-for="(item,a) of travelTips.merchantChildTitleData" :key="a">
<text class="travel-left"> <text class="travel-left">
...@@ -151,7 +152,18 @@ export default { ...@@ -151,7 +152,18 @@ export default {
immediate: true immediate: true
} }
}, },
methods: {} methods: {
//---导航
navigation(){
uni.openLocation({
latitude:this.detailData.latitude,
longitude:this.detailData.longitude,
success: function () {
}
})
}
}
} }
</script> </script>
...@@ -188,6 +200,7 @@ export default { ...@@ -188,6 +200,7 @@ export default {
font-size: 30rpx; font-size: 30rpx;
font-weight: bold; font-weight: bold;
padding-bottom: 24rpx; padding-bottom: 24rpx;
display: flex;
} }
.opentime{ .opentime{
padding: 30rpx 16rpx; padding: 30rpx 16rpx;
......
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
<!-- 商户详情 --> <!-- 商户详情 -->
<merchantDetail :detailData='detailData' ref='merchantDetail'></merchantDetail> <merchantDetail :detailData='detailData' ref='merchantDetail'></merchantDetail>
<!-- 模态框 --> <!-- 模态框 -->
<u-modal :show="showModal" @confirm="chooseConfirm" @cancel="chooseCancel" title="提示" content="该产品不支持多选" show-cancel-button="true"> <u-modal :show="showModal" @confirm="chooseConfirm" @cancel="chooseCancel" title="提示" content="是否更改产品" show-cancel-button="true">
</u-modal> </u-modal>
</scroll-view> </scroll-view>
<image class="suodaoImg" v-if="showSuodaoImg" src="https://lx.pangdly.com/img/cjsdFirst.50a2e63.jpg"></image> <image class="suodaoImg" v-if="showSuodaoImg" src="https://lx.pangdly.com/img/cjsdFirst.50a2e63.jpg"></image>
...@@ -548,7 +548,9 @@ export default { ...@@ -548,7 +548,9 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
const query = uni.createSelectorQuery().in(this) const query = uni.createSelectorQuery().in(this)
query.select(`.${labels}`).boundingClientRect(data => { query.select(`.${labels}`).boundingClientRect(data => {
this.swiperHeight=data.height+20 if(data){
this.swiperHeight=data.height+20
}
}).exec() }).exec()
}) })
}, },
...@@ -664,19 +666,19 @@ export default { ...@@ -664,19 +666,19 @@ export default {
return item.id return item.id
}) })
let query ='?productIdList=' + JSON.stringify(productIdList) + '&groupId=' + this.groupId + '&groupChannelId=' + this.groupChannelId + '&orderSource=3' let query ='?productIdList=' + JSON.stringify(productIdList) + '&groupId=' + this.groupId + '&groupChannelId=' + this.groupChannelId + '&orderSource=3'
uni.navigateTo({ // uni.navigateTo({
url: '/pages/combination/combiOrder/combiOrder' + query // url: '/pages/combination/combiOrder/combiOrder' + query
}) // })
// //如果有联票 // //如果有联票
// if(this.chooseProduct.find(item=>item.ticketType==2)){ if(this.chooseProduct.find(item=>item.ticketType==2)){
// uni.navigateTo({ uni.navigateTo({
// url: '/pages/combination/combiOrder/combiOrder' + query url: '/pages/combination/combiOrder/combiOrder' + query
// }) })
// }else{ }else{
// uni.navigateTo({ uni.navigateTo({
// url: '/pages/scenic/scenicCombiOrder/scenicCombiOrder' + query url: '/pages/scenic/scenicCombiOrder/scenicCombiOrder' + query
// }) })
// } }
} }
}, },
//---跳转影集页面 //---跳转影集页面
......
...@@ -158,6 +158,9 @@ ...@@ -158,6 +158,9 @@
我的行记 我的行记
</view> </view>
</view> </view>
<!-- <view class="middle3-list">
<button @click="xxx()">客服</button>
</view> -->
</view> </view>
</view> </view>
</view> </view>
...@@ -172,6 +175,15 @@ export default { ...@@ -172,6 +175,15 @@ export default {
} }
}, },
methods: { methods: {
xxx(){
wx.openCustomerServiceChat({
extInfo: {url: 'https://work.weixin.qq.com/kfid/kfcbaf30d15641d16b0'},
corpId: 'ww2e9053ddd733ff39',
success(res) {
console.log(222)
}
})
},
//---跳转到订单列表 //---跳转到订单列表
goOrderlist(orderStatus){ goOrderlist(orderStatus){
uni.navigateTo({ uni.navigateTo({
......
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</view> </view>
</view> </view>
<view class="telephone" v-if="showTelephone"> <view class="telephone">
<text> 联系电话: </text> <text> 联系电话: </text>
<input type="number" maxlength="11" placeholder="请输入联系电话" v-model.trim="ticketPhone" /> <input type="number" maxlength="11" placeholder="请输入联系电话" v-model.trim="ticketPhone" />
</view> </view>
...@@ -376,7 +376,6 @@ export default { ...@@ -376,7 +376,6 @@ export default {
orderStatus:'',//上下架状态,任何一个产品状态为下架,该状态为下架 orderStatus:'',//上下架状态,任何一个产品状态为下架,该状态为下架
chooseTimeList:[],//选中产品时间列表 chooseTimeList:[],//选中产品时间列表
chooseDateList:[],//点击更多日期时对应的日期列表 chooseDateList:[],//点击更多日期时对应的日期列表
showTelephone:true,//用于判断是否显示输入联系人电话号码
areaIndex:0,//选择站点时对应的产品下标 areaIndex:0,//选择站点时对应的产品下标
originalTotal:0,//原价总价 originalTotal:0,//原价总价
sellTotal:0,//卖价总价 sellTotal:0,//卖价总价
...@@ -424,10 +423,6 @@ export default { ...@@ -424,10 +423,6 @@ export default {
}) })
for(let i=0;i<this.productList.length;i++){ for(let i=0;i<this.productList.length;i++){
let item=this.productList[i] let item=this.productList[i]
//任何一个产品需要填写游客信息,下面的联系电话必须填写
if(item.tripTemplateFlag!=2){
this.showTelephone=true
}
item.buyNum=1,//默认为1 item.buyNum=1,//默认为1
item.chooseContact=[]//选中的游客信息列表 item.chooseContact=[]//选中的游客信息列表
item.contactNum=1//需要选择几位联系人数量 item.contactNum=1//需要选择几位联系人数量
...@@ -526,10 +521,7 @@ export default { ...@@ -526,10 +521,7 @@ export default {
return return
} }
} }
if (this.showTelephone) { this.getContactList()
//需要填写联系人信息和手机号码
this.getContactList()
}
this.computedPrice()//计算价格 this.computedPrice()//计算价格
//解决初始化日期不显示的情况 //解决初始化日期不显示的情况
this.$forceUpdate() this.$forceUpdate()
...@@ -1093,7 +1085,7 @@ export default { ...@@ -1093,7 +1085,7 @@ export default {
return return
} }
} }
if(item.chooseContact.length!=item.contactNum){ if(item.tripTemplateFlag!=2&&item.chooseContact.length!=item.contactNum){
uni.showToast({ uni.showToast({
title: item.merchantName+'需要添加'+item.contactNum+'位出行人', title: item.merchantName+'需要添加'+item.contactNum+'位出行人',
icon: 'none' icon: 'none'
...@@ -1101,16 +1093,13 @@ export default { ...@@ -1101,16 +1093,13 @@ export default {
return return
} }
} }
if (this.showTelephone) { if (!this.$commonjs.phoneReg().test(this.ticketPhone)) {
//需要填写电话号码 //未填写正确手机号码
if (!this.$commonjs.phoneReg().test(this.ticketPhone)) { uni.showToast({
//未填写正确手机号码 title: '请填写正确的手机号码',
uni.showToast({ icon: 'none'
title: '请填写正确的手机号码', })
icon: 'none' return
})
return
}
} }
this.preOrder() this.preOrder()
}, },
......
<template>
<view>
<web-view :src="outUrl"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
enterUrl:'',//进入页面路由
outUrl:'',//跳出页面路由
}
},
onLoad(option) {
//#ifdef MP-WEIXIN
this.enterUrl=option.q
//#endif
//#ifdef MP-ALIPAY
this.enterUrl=uni.getStorageSync('alipayQrCode')
//#endif
if(this.enterUrl){//普通二维码扫码进入
let merchantId=this.getUrlKey('merchantId')
let companyId=this.getUrlKey('companyId')
let channelType=this.getUrlKey('channelType')
let pdOpenid=uni.getStorageSync('openid')//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')
let pdCreateUserId=uni.getStorageSync('createUserId')
let pdUserId=uni.getStorageSync('userId')
let baseUrl=this.$wxurl+'scenicProduct?pdOpenid='+pdOpenid+'&pdToken='+pdToken+'&pdCreateUserId='+pdCreateUserId+'&pdUserId='+pdUserId
let url='&merchantId='+merchantId+'&companyId='+companyId+'&channelType='+channelType
this.outUrl=baseUrl+url
}else{//小程序页面跳转进入
let merchantId=option.merchantId||''
let companyId=option.companyId||''
let channelType=option.channelType||0
let ifyukuaiCode=option.ifyukuaiCode||''//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程
let pdOpenid=uni.getStorageSync('openid')//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')
let pdCreateUserId=uni.getStorageSync('createUserId')
let pdUserId=uni.getStorageSync('userId')
let baseUrl=this.$wxurl+'scenicProduct?pdOpenid='+pdOpenid+'&pdToken='+pdToken+'&pdCreateUserId='+pdCreateUserId+'&pdUserId='+pdUserId
let url='&merchantId='+merchantId+'&companyId='+companyId+'&ifyukuaiCode='+ifyukuaiCode+'&channelType='+channelType
this.outUrl=baseUrl+url
}
},
methods: {
getUrlKey(name){//---------------------------------------------------------------获取url
return(new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(this.enterUrl)) || [, ''])[1].replace(/\+/g, '%20') || ''
},
}
}
</script>
<style>
</style>
\ No newline at end of file
<template> <template>
<view> <view>
<web-view :src="outUrl"></web-view> <view class="banner" v-if="detailData">
<u-swiper :list="detailData.imgList" @change="e => currentNum = e.current" indicatorStyle="right: 20px;bottom:25px" height="400" circular>
<view slot="indicator" class="indicator-num">
<text class="indicator-num__text">{{ currentNum + 1 }}/{{detailData.imgList.length}}</text>
</view>
</u-swiper>
</view>
<view class="middle">
<view class="middle-introduce">
<view>
<view>
重庆湖广会馆
</view>
<view>
<view>
<text>开园中</text>
<text>09:00~18:30</text>
</view>
<view>
<text>详情</text>
<u-icon name='arrow-right'></u-icon>
</view>
</view>
</view>
<view>
</view>
<view>
</view>
</view>
<view class="middle-list">
</view>
</view>
</view> </view>
</template> </template>
...@@ -8,53 +44,97 @@ ...@@ -8,53 +44,97 @@
export default { export default {
data() { data() {
return { return {
enterUrl:'',//进入页面路由 ticketList:[],//门票列表
outUrl:'',//跳出页面路由 detailData:'',//详情数据
currentNum:0,//轮播图下标
} }
}, },
onLoad(option) { onLoad(option) {
//#ifdef MP-WEIXIN this.nowTime=parseInt(new Date().Format('hhmm'))
this.enterUrl=option.q this.companyId=this.$commonjs.getCompanyId(option)||''
//#endif this.merchantId = this.$commonjs.getKey(option,'merchantId')|| ''
this.channelType = this.$commonjs.getKey(option,'channelType')|| 0
//#ifdef MP-ALIPAY this.initProduct()
this.enterUrl=uni.getStorageSync('alipayQrCode') this.initDetail()
//#endif
if(this.enterUrl){//普通二维码扫码进入
let merchantId=this.getUrlKey('merchantId')
let companyId=this.getUrlKey('companyId')
let channelType=this.getUrlKey('channelType')
let pdOpenid=uni.getStorageSync('openid')//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')
let pdCreateUserId=uni.getStorageSync('createUserId')
let pdUserId=uni.getStorageSync('userId')
let baseUrl=this.$wxurl+'scenicProduct?pdOpenid='+pdOpenid+'&pdToken='+pdToken+'&pdCreateUserId='+pdCreateUserId+'&pdUserId='+pdUserId
let url='&merchantId='+merchantId+'&companyId='+companyId+'&channelType='+channelType
this.outUrl=baseUrl+url
}else{//小程序页面跳转进入
let merchantId=option.merchantId||''
let companyId=option.companyId||''
let channelType=option.channelType||0
let ifyukuaiCode=option.ifyukuaiCode||''//是否是渝快码跳入,渝快码跳入需要在H5端另外走流程
let pdOpenid=uni.getStorageSync('openid')//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')
let pdCreateUserId=uni.getStorageSync('createUserId')
let pdUserId=uni.getStorageSync('userId')
let baseUrl=this.$wxurl+'scenicProduct?pdOpenid='+pdOpenid+'&pdToken='+pdToken+'&pdCreateUserId='+pdCreateUserId+'&pdUserId='+pdUserId
let url='&merchantId='+merchantId+'&companyId='+companyId+'&ifyukuaiCode='+ifyukuaiCode+'&channelType='+channelType
this.outUrl=baseUrl+url
}
}, },
methods: { methods: {
getUrlKey(name){//---------------------------------------------------------------获取url //---产品加载
return(new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(this.enterUrl)) || [, ''])[1].replace(/\+/g, '%20') || '' initProduct(){
this.ticketList=[]
let data={
merchantId:this.merchantId,//商户id
type:1,//类型:1景区、2酒店、3餐饮
channelType:this.channelType,//渠道Id
}
this.$request('scenic/user/product/findProductList',data).then((res)=>{
if(res.code=='00'){
let list=res.data.list||[]
list.forEach((item,index)=>{
//营业时间重新组成
if(item.businessTime){
item.businessTime=item.businessTime.split(';')
}
//等于7为特价
if(item.channelType!=7){
this.ticketList.push(item)
}
})
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
//---详情加载
initDetail(){
let data={
userId:uni.getStorageSync('userId')||'',
openid:uni.getStorageSync('openid')||'',
id:this.merchantId,//商户id
isDetail:1,//商户详情
}
this.$request('scenic/user/merchant/findDetailInfo',data).then((res)=>{
if(res.code=='00'){
this.detailData=res.data
if(this.detailData.tag){
this.tagArr=this.detailData.tag.split(',')
}
let start=''
let end=''
if(this.detailData.businessStart){
start=parseInt(this.$commonjs.changeTime(this.detailData.businessStart.substr(0,5)))
}
if(this.detailData.businessEnd){
end=parseInt(this.$commonjs.changeTime(this.detailData.businessEnd.substr(0,5)))
}
if(start<this.nowTime<end){
this.status='开园中'
}else{
this.status='闭园中'
}
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
}, },
} }
} }
</script> </script>
<style> <style scoped lang="scss">
.middle{
position: relative;
top: -60rpx;
}
.middle-introduce{
background: #FFFFFF;
padding: 30rpx 20rpx 0 20rpx;
border-radius: 24rpx 24rpx 0 0;
}
</style> </style>
\ No newline at end of file
...@@ -228,8 +228,8 @@ ...@@ -228,8 +228,8 @@
</view> </view>
<!-- ---------------------------------------------游客信息-------------------------------------------- --> <!-- ---------------------------------------------游客信息-------------------------------------------- -->
<view class="middle-bottom" v-if="productIfo.tripTemplateFlag != 2"> <view class="middle-bottom">
<view class="middle-visitor"> <view class="middle-visitor" v-if="productIfo.tripTemplateFlag != 2">
<view class="visitorTitle"> <view class="visitorTitle">
<text class="title-text"> 用户信息 </text> <text class="title-text"> 用户信息 </text>
<text> <text>
...@@ -283,7 +283,7 @@ ...@@ -283,7 +283,7 @@
</view> </view>
</view> </view>
<view class="middle-phone" v-if="productIfo.tripTemplateFlag != 2"> <view class="middle-phone">
<text> 联系电话: </text> <text> 联系电话: </text>
<input type="number" maxlength="11" placeholder="请输入联系电话" v-model.trim="ticketPhone" /> <input type="number" maxlength="11" placeholder="请输入联系电话" v-model.trim="ticketPhone" />
</view> </view>
...@@ -597,7 +597,7 @@ export default { ...@@ -597,7 +597,7 @@ export default {
this.sortUpDown() this.sortUpDown()
} }
if (this.productIfo.tripTemplateFlag != 2) { if (this.productIfo.tripTemplateFlag != 2) {
//等于2时不需要填写联系人信息和手机号码 //等于2时不需要填写联系人信息
this.getContactList() this.getContactList()
} }
if (this.dateList.length == 1 && this.beforeBookDays == 0) { if (this.dateList.length == 1 && this.beforeBookDays == 0) {
...@@ -851,6 +851,24 @@ export default { ...@@ -851,6 +851,24 @@ export default {
this.contactTotal.sort(function (a, b) { this.contactTotal.sort(function (a, b) {
return b.ifChoose-a.ifChoose return b.ifChoose-a.ifChoose
}) })
//先组成一个新的数组,把选中的联系人重新排序,用于找到选中联系人的第一个
let newArr=[]
this.contactTotal.forEach(item2=>{
this.chooseContact.forEach(item3=>{
if(item2.id==item3.id){
newArr.push(item2)
}
})
})
//找到选中联系人的第一个有号码的联系人,取电话号码
let phoneObj=newArr.find(item2=>{
return item2.phone
})
if(phoneObj){
this.ticketPhone=phoneObj.phone
}else{
this.ticketPhone=''
}
}, },
//---游客选择 //---游客选择
visitorChoose(i) { visitorChoose(i) {
...@@ -874,6 +892,24 @@ export default { ...@@ -874,6 +892,24 @@ export default {
}) })
this.chooseContact.splice(index, 1) //删除数组 this.chooseContact.splice(index, 1) //删除数组
} }
//先组成一个新的数组,把选中的联系人重新排序,用于找到选中联系人的第一个
let newArr=[]
this.contactTotal.forEach(item2=>{
this.chooseContact.forEach(item3=>{
if(item2.id==item3.id){
newArr.push(item2)
}
})
})
//找到选中联系人的第一个有号码的联系人,取电话号码
let phoneObj=newArr.find(item2=>{
return item2.phone
})
if(phoneObj){
this.ticketPhone=phoneObj.phone
}else{
this.ticketPhone=''
}
}, },
//---订单数量变化 //---订单数量变化
buyNumChange(e) { buyNumChange(e) {
...@@ -1097,56 +1133,6 @@ export default { ...@@ -1097,56 +1133,6 @@ export default {
} }
} }
if (this.serviceList.length > 0) { if (this.serviceList.length > 0) {
//有额外服务,没有选中额外服务的,弹出提示框
if (this.productIfo.tripTemplateFlag != 2) {
if (!this.$commonjs.phoneReg().test(this.ticketPhone)) {
//未填写正确手机号码
uni.showToast({
title: '请填写正确的手机号码',
icon: 'none'
})
return
}
}
if (this.productIfo.tripTemplateFlag == 1) {
//实名制
if (this.chooseContact.length != this.buyNum) {
uni.showToast({
title: '需要添加' + this.buyNum + '位出行人',
icon: 'none'
})
return
}
} else if (this.productIfo.tripTemplateFlag == 0) {
//非实名制
if (this.chooseContact.length < 1) {
uni.showToast({
title: '需要添加一位出行人',
icon: 'none'
})
return
}
}
if (this.productIfo.productType == 3) {
//如果为班次票,需要选择班次
if (this.cruisePlanId == '') {
uni.showToast({
title: '该票为班次票,请选择游玩时间',
icon: 'none'
})
return
}
}
if (this.productIfo.isFetch == 1 && this.areaUp) {
//需要选择站点的票种,必须选择站点
if (!this.areaObj.areaCode) {
uni.showToast({
title: '请选择站点',
icon: 'none'
})
return
}
}
if (this.chooseService.length == 0 && this.showErmai) { if (this.chooseService.length == 0 && this.showErmai) {
//没有购买额外服务,并且选择的北站,跳出弹窗 //没有购买额外服务,并且选择的北站,跳出弹窗
this.showExtraPop = true this.showExtraPop = true
...@@ -1194,24 +1180,24 @@ export default { ...@@ -1194,24 +1180,24 @@ export default {
return return
} }
} }
if (this.chooseContact.length != this.contactNum) { if (this.productIfo.tripTemplateFlag!=2) {
//等于2不需要填写联系人
if (this.chooseContact.length != this.contactNum) {
uni.showToast({
title: '需要添加' + this.contactNum + '位出行人',
icon: 'none'
})
return
}
}
if (!this.$commonjs.phoneReg().test(this.ticketPhone)) {
//未填写正确手机号码
uni.showToast({ uni.showToast({
title: '需要添加' + this.contactNum + '位出行人', title: '请填写正确的手机号码',
icon: 'none' icon: 'none'
}) })
return return
} }
if (this.productIfo.tripTemplateFlag != 2) {
//需要填写电话号码
if (!this.$commonjs.phoneReg().test(this.ticketPhone) && this.productIfo.tripTemplateFlag != 2) {
//未填写正确手机号码
uni.showToast({
title: '请填写正确的手机号码',
icon: 'none'
})
return
}
}
this.preOrder() this.preOrder()
}, },
//---预下单 //---预下单
......
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