Commit dde8bd22 authored by 潘永坪's avatar 潘永坪

单产品下单bug处理

parent e93cc300
...@@ -8,7 +8,7 @@ import commonjs from 'common/common.js' ...@@ -8,7 +8,7 @@ import commonjs from 'common/common.js'
Vue.prototype.$commonjs = commonjs Vue.prototype.$commonjs = commonjs
Vue.prototype.$request = request Vue.prototype.$request = request
Vue.prototype.$wxurl = 'https://lx.pangdly.com/#/' Vue.prototype.$wxurl = 'https://wx.pangdly.com/#/'
Vue.prototype.imageError ='@/static/img/common/pangdingLogo.png' Vue.prototype.imageError ='@/static/img/common/pangdingLogo.png'
Vue.use(uView) Vue.use(uView)
uni.$u.config.unit = 'rpx' uni.$u.config.unit = 'rpx'
......
...@@ -331,15 +331,15 @@ ...@@ -331,15 +331,15 @@
"navigationBarTextStyle": "black" "navigationBarTextStyle": "black"
} }
}, },
{ // {
"path": "vlogface/vlogface", // "path": "vlogface/vlogface",
"style": { // "style": {
"navigationBarTitleText": "扫脸获取视频", // "navigationBarTitleText": "扫脸获取视频",
"enablePullDownRefresh": false, // "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff", // "navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black" // "navigationBarTextStyle": "black"
} // }
}, // },
{ {
"path": "scenicList/scenicList", "path": "scenicList/scenicList",
"style": { "style": {
......
<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 channelId=this.getUrlKey('channelId')
let companyId=this.getUrlKey('companyId')
let merchantId=this.getUrlKey('merchantId')
let groupId=this.getUrlKey('groupId')
let groupChannelId=this.getUrlKey('groupChannelId')
let pageType=this.getUrlKey('pageType')
let pdOpenid=uni.getStorageSync('openid')//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')
let pdCreateUserId=uni.getStorageSync('createUserId')
let pdUserId=uni.getStorageSync('userId')
let pageCode=this.getUrlKey('pageCode')//赠送优惠券接口参数
if(pageType==1){//组合
this.outUrl=this.$wxurl+'combiChoose?channelId='+channelId+'&merchantId='+merchantId+'&groupId='+groupId+'&groupChannelId='+groupChannelId+'&companyId='+companyId+'&pdOpenid='+pdOpenid+'&pdToken='+pdToken+'&pdCreateUserId='+pdCreateUserId+'&pdUserId='+pdUserId
}else{//分销
uni.navigateTo({
url:'../distributionCombiChoose/distributionCombiChoose?channelId='+channelId+'&merchantId='+merchantId+'&groupId='+groupId+'&groupChannelId='+groupChannelId+'&companyId='+companyId+'&pageCode'+pageCode
})
}
}else{//小程序页面跳转进入
let channelId=option.channelId||''
let companyId=option.companyId||''
let merchantId=option.merchantId||''
let groupId=option.groupId||''
let groupChannelId=option.groupChannelId||''
let thirdOpenid=option.thirdOpenid||''//第三方openid
let touristType=option.touristType||''//游客类型
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+'combiChoose?thirdOpenid='+thirdOpenid+'&touristType='+touristType
this.outUrl=baseUrl+'&channelId='+channelId+'&merchantId='+merchantId+'&groupId='+groupId+'&groupChannelId='+groupChannelId+'&companyId='+companyId+'&pdOpenid='+pdOpenid+'&pdToken='+pdToken+'&pdCreateUserId='+pdCreateUserId+'&pdUserId='+pdUserId
}
},
methods: {
getUrlKey(name){//---------------------------------------------------------------获取url
return(new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(this.enterUrl)) || [, ''])[1].replace(/\+/g, '%20') || ''
},
}
}
</script>
<style>
</style>
<template> <template>
<view> <view>
<web-view :src="outUrl"></web-view>
</view> </view>
</template> </template>
...@@ -8,60 +8,19 @@ ...@@ -8,60 +8,19 @@
export default { export default {
data() { data() {
return { return {
enterUrl:'',//进入页面路由
outUrl:'',//跳出页面路由
} }
}, },
onLoad(option) { onLoad(option) {
//#ifdef MP-WEIXIN //由于之前配置了这个页面,暂时进入页面直接跳转页面
this.enterUrl=option.q let merchantId=this.$commonjs.getKey(option,'merchantId')||''
//#endif let channelType=this.$commonjs.getKey(option,'channelType')||0
uni.navigateTo({
//#ifdef MP-ALIPAY url:`/pages/combination/distributionCombiChoose/distributionCombiChoose?merchantId=${merchantId}&channelType=${channelType}`
this.enterUrl=uni.getStorageSync('alipayQrCode') })
//#endif
if(this.enterUrl){//普通二维码扫码进入
let channelId=this.getUrlKey('channelId')
let companyId=this.getUrlKey('companyId')
let merchantId=this.getUrlKey('merchantId')
let groupId=this.getUrlKey('groupId')
let groupChannelId=this.getUrlKey('groupChannelId')
let pageType=this.getUrlKey('pageType')
let pdOpenid=uni.getStorageSync('openid')//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')
let pdCreateUserId=uni.getStorageSync('createUserId')
let pdUserId=uni.getStorageSync('userId')
let pageCode=this.getUrlKey('pageCode')//赠送优惠券接口参数
if(pageType==1){//组合
this.outUrl=this.$wxurl+'combiChoose?channelId='+channelId+'&merchantId='+merchantId+'&groupId='+groupId+'&groupChannelId='+groupChannelId+'&companyId='+companyId+'&pdOpenid='+pdOpenid+'&pdToken='+pdToken+'&pdCreateUserId='+pdCreateUserId+'&pdUserId='+pdUserId
}else{//分销
uni.navigateTo({
url:'../distributionCombiChoose/distributionCombiChoose?channelId='+channelId+'&merchantId='+merchantId+'&groupId='+groupId+'&groupChannelId='+groupChannelId+'&companyId='+companyId+'&pageCode'+pageCode
})
}
}else{//小程序页面跳转进入
let channelId=option.channelId||''
let companyId=option.companyId||''
let merchantId=option.merchantId||''
let groupId=option.groupId||''
let groupChannelId=option.groupChannelId||''
let thirdOpenid=option.thirdOpenid||''//第三方openid
let touristType=option.touristType||''//游客类型
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+'combiChoose?thirdOpenid='+thirdOpenid+'&touristType='+touristType
this.outUrl=baseUrl+'&channelId='+channelId+'&merchantId='+merchantId+'&groupId='+groupId+'&groupChannelId='+groupChannelId+'&companyId='+companyId+'&pdOpenid='+pdOpenid+'&pdToken='+pdToken+'&pdCreateUserId='+pdCreateUserId+'&pdUserId='+pdUserId
}
}, },
methods: { methods: {
getUrlKey(name){//---------------------------------------------------------------获取url
return(new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(this.enterUrl)) || [, ''])[1].replace(/\+/g, '%20') || ''
},
} }
} }
</script> </script>
......
<template>
<!-- 详情 -->
<u-popup :show="showPop" :round="20" @close="showPop = false">
<view class="son-wrap">
<view class="title">
<view style="flex: 1; text-align: center">
明细
</view>
<u-icon name="close" @click="showPop = false"></u-icon>
</view>
<view style="flex: 1;overflow-y: scroll;">
<view class="middle">
<view class="merchantlist" v-for="(item,index) in merchantList" :key="index">
<view class="merchant-title">
{{item.merchantName}}
</view>
<view class="productlist" v-for="(items,a) in item.productlist" :key='a'>
<text>
{{items.name}}
</text>
<text style="font-weight: bold;">
¥{{items.sellingPrice}}
</text>
</view>
</view>
</view>
<view class="bottom">
<view class="bottom-left">
合计:¥
<text style="font-weight: bold;font-size: 40rpx;">{{priceTotal}}</text>
</view>
<view class="bottom-right">
<text class="btn" @click="goFillorder()">
去预订
</text>
</view>
</view>
</view>
</view>
</u-popup>
</template>
<script>
export default {
props: ['chooseProduct'],
data() {
return {
showPop: false, //控制弹窗显示隐藏
priceTotal:0,//总价
merchantList:[],//商家列表
}
},
watch: {
//选中产品的数量变化
chooseProduct: {
handler(newValue, oldValue){
this.priceTotal=0
this.chooseProduct.forEach((item)=>{
this.priceTotal+=item.sellingPrice
})
this.priceTotal=parseFloat(this.priceTotal.toFixed(2))
this.merchantList=[]
this.chooseProduct.forEach(item=>{
if(!this.merchantList.find(item2=>item2.merchantId==item.merchantId)){
this.merchantList.push({
merchantName:item.merchantName,
merchantId:item.merchantId,
productlist:[]
})
}
})
//一级数组转化成二级数组
this.merchantList.forEach(item=>{
this.chooseProduct.forEach(item2=>{
if(item.merchantId==item2.merchantId){
item.productlist.push(item2)
}
})
})
},
deep:true,
immediate: false
},
},
methods: {
//---跳转填写订单页面
goFillorder(){
this.$parent.goFillorder()
}
}
}
</script>
<style scoped="scoped" lang="scss">
.son-wrap{
position: relative;
height:80vh;
display: flex;
flex-direction:column;
}
.title{
display: flex;
font-size: 32rpx;
font-weight: bold;
padding: 30rpx;
background: #fff;
border-radius: 20rpx 20rpx 0 0;
}
.middle {
padding:0 24rpx 100rpx 24rpx;
}
.merchantlist{
border-bottom:2rpx solid #ececec;
padding-bottom: 40rpx;
margin-top: 24rpx;
}
.merchant-title{
font-size: 36rpx;
font-weight: bold;
color: #191919;
}
.productlist{
display: flex;
justify-content: space-between;
font-size: 32rpx;
margin-top: 20rpx;
}
.bottom {
display: flex;
justify-content: space-between;
padding: 0 24rpx;
height: 100rpx;
align-items: center;
position: fixed;
bottom: 0;
width: 100%;
z-index: 9;
background: #FFFFFF;
box-sizing: border-box;
}
.bottom-left{
color:$red;
font-size: 32rpx;
}
.btn{
font-size: 32rpx;
width: 200rpx;
}
</style>
<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 channelId=this.getUrlKey('channelId')
let companyId=this.getUrlKey('companyId')
let merchantId=this.getUrlKey('merchantId')
let groupId=this.getUrlKey('groupId')
let groupChannelId=this.getUrlKey('groupChannelId')
let pageType=this.getUrlKey('pageType')
let pdOpenid=uni.getStorageSync('openid')//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let pdToken=uni.getStorageSync('token')
let pdCreateUserId=uni.getStorageSync('createUserId')
let pdUserId=uni.getStorageSync('userId')
let pageCode=this.getUrlKey('pageCode')//赠送优惠券接口参数
if(pageType==1){//组合
uni.navigateTo({
url:'../combiChoose/combiChoose?channelId='+channelId+'&merchantId='+merchantId+'&groupId='+groupId+'&groupChannelId='+groupChannelId+'&companyId='+companyId
})
}else{//分销
this.outUrl=this.$wxurl+'distributionCombiChooseS?channelId='+channelId+'&merchantId='+merchantId+'&groupId='+groupId+'&groupChannelId='+groupChannelId+'&companyId='+companyId+'&pdOpenid='+pdOpenid+'&pdToken='+pdToken+'&pdCreateUserId='+pdCreateUserId+'&pdUserId='+pdUserId+'&pageCode'+pageCode
}
}else{//小程序页面跳转进入
let channelId=option.channelId||''
let companyId=option.companyId||''
let merchantId=option.merchantId||''
let groupId=option.groupId||''
let groupChannelId=option.groupChannelId||''
let thirdOpenid=option.thirdOpenid||''//第三方openid
let touristType=option.touristType||''//游客类型
let pageCode=option.pageCode||''//赠送优惠券接口参数
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+'distributionCombiChooseS?thirdOpenid='+thirdOpenid+'&touristType='+touristType
this.outUrl=baseUrl+'&channelId='+channelId+'&merchantId='+merchantId+'&groupId='+groupId+'&groupChannelId='+groupChannelId+'&companyId='+companyId+'&pdOpenid='+pdOpenid+'&pdToken='+pdToken+'&pdCreateUserId='+pdCreateUserId+'&pdUserId='+pdUserId+'&pageCode'+pageCode
}
},
methods: {
getUrlKey(name){//---------------------------------------------------------------获取url
return(new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(decodeURIComponent(this.enterUrl)) || [, ''])[1].replace(/\+/g, '%20') || ''
}
}
}
</script>
<style>
</style>
...@@ -743,7 +743,7 @@ export default { ...@@ -743,7 +743,7 @@ export default {
}, },
//---展示日历---已修改 //---展示日历---已修改
showCalendar(index) { showCalendar(index) {
this.$refs.calendar.setDefaultDate(this.productList[index].chooseDate)//日历组件选中日期 this.$refs.calendar.defaultDate=this.productList[index].chooseDate//日历组件选中日期
this.moreDateIndex=index this.moreDateIndex=index
this.chooseDateList=this.productList[index].priceStockList this.chooseDateList=this.productList[index].priceStockList
this.$refs.calendar.showPop = true this.$refs.calendar.showPop = true
...@@ -755,7 +755,7 @@ export default { ...@@ -755,7 +755,7 @@ export default {
item.originalPrice=item2.originalPrice//产品原价为当前选中日期的原价 item.originalPrice=item2.originalPrice//产品原价为当前选中日期的原价
item.sellingPrice=item2.sellingPrice//产品卖价为当前选中日期的卖价 item.sellingPrice=item2.sellingPrice//产品卖价为当前选中日期的卖价
item.chooseDate=item2.startTime.substr(0,10) item.chooseDate=item2.startTime.substr(0,10)
this.$refs.calendar.setDefaultDate(item.chooseDate)//日历组件选中日期 this.$refs.calendar.defaultDate=item.chooseDate//日历组件选中日期
item.endDate=item2.endTime//开始日期 item.endDate=item2.endTime//开始日期
item.startDate=item2.startTime//结束日期 item.startDate=item2.startTime//结束日期
if(item.productType==3){ if(item.productType==3){
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
:show="showPop" :show="showPop"
@confirm="onConfirm" @confirm="onConfirm"
@close="showPop=false" @close="showPop=false"
:maxDate="maxDate" :maxDate="maxDate"
:minDate='minDate'
:defaultDate="defaultDate" :defaultDate="defaultDate"
:formatter='formatter' :formatter='formatter'
ref="calendar2" ref="calendar2"
...@@ -21,6 +22,9 @@ export default { ...@@ -21,6 +22,9 @@ export default {
handler(newValue, oldValue){ handler(newValue, oldValue){
if(newValue&&newValue.length>0){ if(newValue&&newValue.length>0){
this.maxDate=newValue[newValue.length-1].startTime.substr(0,10) this.maxDate=newValue[newValue.length-1].startTime.substr(0,10)
//默认和最小日期都为第一天
this.minDate=newValue[0].startTime.substr(0,10)
this.defaultDate=newValue[0].startTime.substr(0,10)
} }
}, },
deep:true, deep:true,
...@@ -32,6 +36,7 @@ export default { ...@@ -32,6 +36,7 @@ export default {
showPop: false, //控制日历显示隐藏 showPop: false, //控制日历显示隐藏
defaultDate:'', //默认日期 defaultDate:'', //默认日期
maxDate:'',//最大日期 maxDate:'',//最大日期
minDate:'',//最小日期
} }
}, },
mounted() { mounted() {
...@@ -39,7 +44,8 @@ export default { ...@@ -39,7 +44,8 @@ export default {
}, },
methods: { methods: {
//---日期确认事件 //---日期确认事件
onConfirm(date) { onConfirm(date){
console.log(date)
this.showPop = false this.showPop = false
this.$emit('dateConfig', date[0]) this.$emit('dateConfig', date[0])
}, },
...@@ -67,11 +73,7 @@ export default { ...@@ -67,11 +73,7 @@ export default {
// } // }
return day return day
}, }
//---设置默认日期
setDefaultDate(val) {
this.defaultDate=val
},
} }
} }
</script> </script>
......
...@@ -591,11 +591,7 @@ export default { ...@@ -591,11 +591,7 @@ export default {
return return
} }
if (this.dateList.length == 1 && this.beforeBookDays == 0) { if (this.dateList.length == 1 && this.beforeBookDays == 0) {
//长度为1而且只能预订当天,默认选中第一个日期 //长度为1而且只能预订当天,默认选中
//真机模拟的时候手机端不显示今天,明天后天,延迟执行
setTimeout(item => {
this.$refs.calendar.defaultDate = this.dateList[0].startTime.substr(0, 10)
}, 1000)
this.maxBookNum = Math.min(this.dateList[0].surplus, this.productIfo.maxBookNum) //剩余量 this.maxBookNum = Math.min(this.dateList[0].surplus, this.productIfo.maxBookNum) //剩余量
this.startDate = this.dateList[0].startTime //开始日期 this.startDate = this.dateList[0].startTime //开始日期
this.endDate = this.dateList[0].endTime //结束日期 this.endDate = this.dateList[0].endTime //结束日期
......
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