Commit 793bf38d by songbingqi

修复订阅消息跳转问题

parent 9995ec5b
......@@ -5,7 +5,9 @@
<swiper :current="current" class="swiper" @change="swiperChange">
<swiper-item>
<view class="list" v-if="canuse.length!=0">
<Ticket v-for="(item,index) in canuse" :key="index" :info="item" :indexValue="index+1===canuse.length" type="use" @updata="updata"/>
<scroll-view class="A" scroll-y>
<Ticket v-for="(item,index) in canuse" :key="index" :info="item" :indexValue="index+1===canuse.length" type="use" @updata="updata"/>
</scroll-view>
</view>
<view class="emty" v-else>
<view class="text">暂无可用优惠券</view>
......@@ -13,7 +15,9 @@
</swiper-item>
<swiper-item>
<view class="list" v-if="cantuse.length!=0">
<scroll-view class="A" scroll-y>
<Ticket v-for="(item,index) in cantuse" :key="index" :info="item" type="use"/>
</scroll-view>
</view>
<view class="emty" v-else>
<view class="text">暂无不可用优惠券</view>
......@@ -142,8 +146,16 @@ export default {
// margin-bottom: 176rpx;
.swiper {
background: #F8F8F8;
height: calc(100vh - 64rpx);
height: calc(100vh - 90rpx);
.list{
.A {
max-height: calc(100vh - 90rpx);
overflow-y: scroll;
}
.B {
max-height: calc(100vh - 90rpx);
overflow-y: scroll;
}
height: 100%;
padding: 0rpx 32rpx;
overflow-y: scroll;
......
......@@ -140,11 +140,12 @@ export default {
this.initData(option)
},
onShow() {
uni.setStorageSync('goodsList',{})
this.backToMneu = false
},
onUnload(){
this.goBack()
},
// onUnload(){
// this.goBack()
// },
data() {
return {
orderInfo: {},
......@@ -242,10 +243,8 @@ export default {
}
// 从订阅消息进入
let Authorization = uni.getStorageSync('Authorization')
console.log(this.userms,'userms')
console.log(this.Authorization,'Authorization')
if(orderId){
if(!this.userms&&!this.Authorization){
if(!Authorization){
this.backFlag = true
uni.switchTab({ url: '/pages/order/order' })
return
......
......@@ -129,6 +129,8 @@ export default {
}).then(({ data }) => {
this.duration = data.data
})
}else{
uni.switchTab({ url: '/pages/menu/menu' })
}
this.BottomSafeHeight = uni.getStorageSync('BottomSafeHeight')
this.TermsStatus = uni.getStorageSync('TermsStatus') || false
......@@ -358,34 +360,33 @@ export default {
}else{
if(this.agreeTerms)uni.setStorageSync('TermsStatus',true)
}
let needChoseMsg = true
const { sendMsgFlag1, flagExpireData } = this.sendMsgData
const HasMessageFlag = JSON.stringify(sendMsgFlag1)=='true'||JSON.stringify(sendMsgFlag1)=='false'?true:false
if(!HasMessageFlag&&!flagExpireData){
console.log('用户从未选择过授权信息,弹框')
needChoseMsg = true
}else{
if(!flagExpireData&&HasMessageFlag){
console.log('用户已经永久授权信息,不弹框')
needChoseMsg = false
}else if(flagExpireData<new Date().valueOf()){
console.log('用户授权了信息没保存超过七天了,弹框')
needChoseMsg = true
}else{
console.log('用户授权了信息没保存没超过七天,不弹框')
needChoseMsg = false
}
}
if(needChoseMsg) {
this.messagePopup = true
}else{
this.saveReserve()
}
return
// let needChoseMsg = true
// const { sendMsgFlag1, flagExpireData } = this.sendMsgData
// const HasMessageFlag = JSON.stringify(sendMsgFlag1)=='true'||JSON.stringify(sendMsgFlag1)=='false'?true:false
// if(!HasMessageFlag&&!flagExpireData){
// console.log('用户从未选择过授权信息,弹框')
// needChoseMsg = true
// }else{
// if(!flagExpireData&&HasMessageFlag){
// console.log('用户已经永久授权信息,不弹框')
// needChoseMsg = false
// }else if(flagExpireData<new Date().valueOf()){
// console.log('用户授权了信息没保存超过七天了,弹框')
// needChoseMsg = true
// }else{
// console.log('用户授权了信息没保存没超过七天,不弹框')
// needChoseMsg = false
// }
// }
// if(needChoseMsg) {
// this.messagePopup = true
// }else{
// this.saveReserve()
// }
// return
const tmpid = ['1uErx-15S-3vuopXSvvsxCeM_Jd-1iZC-nXzd2yW3QU', 'Q4HDwBEvpTXpwtZktqWm4SZOTEuQK1x48xjqjD2GqyM', 'Fu_CPIXa0cnJ4EDdVKqFQ3qqKJccMqt2oorI5mfNq74']
const val = {}
wx.requestSubscribeMessage({
// 'Oq_zfRWRXijvXenRmfD2PARgpvdYlbkjR4laxKmBqb0'
tmplIds: tmpid,
success: (res) => {
const finalValue = Object.values(res).indexOf('reject')
......@@ -394,10 +395,10 @@ export default {
})
if(finalValue===-1){
uni.setStorageSync('isMessage', 'true')
User.setAllow(1)
// User.setAllow(1)
this.saveReserve(val)
}else{
User.setAllow(2)
// User.setAllow(2)
this.saveReserve(val)
}
},
......@@ -406,7 +407,7 @@ export default {
val[item] = false
})
console.log(err);
User.setAllow(2)
// User.setAllow(2)
this.saveReserve(val)
}
})
......@@ -453,13 +454,9 @@ export default {
// sendMsgFlag1:下单成功通知
// sendMsgFlag2:订单状态变更通知
// sendMsgFlag3:取餐提醒
const { sendMsgFlag1,
sendMsgFlag2,
sendMsgFlag3
} = this.sendMsgData
const sendMsgFlag1N = sendMsgFlag1?1:0
const sendMsgFlag2N = sendMsgFlag2?1:0
const sendMsgFlag3N = sendMsgFlag3?1:0
const sendMsgFlag1 = val['1uErx-15S-3vuopXSvvsxCeM_Jd-1iZC-nXzd2yW3QU']?1:0
const sendMsgFlag2 = val['Q4HDwBEvpTXpwtZktqWm4SZOTEuQK1x48xjqjD2GqyM']?1:0
const sendMsgFlag3 = val['Fu_CPIXa0cnJ4EDdVKqFQ3qqKJccMqt2oorI5mfNq74']?1:0
let res = await Utils.AssemblyOrder(this.shopData, this.totalPrice, this.totalNum, this.buyType, list);
if (res) {
......@@ -470,9 +467,9 @@ export default {
paidAmount:amount,
lat,
lng,
sendMsgFlag1:sendMsgFlag1N,
sendMsgFlag2:sendMsgFlag2N,
sendMsgFlag3:sendMsgFlag3N
sendMsgFlag1,
sendMsgFlag2,
sendMsgFlag3
}
if(JSON.stringify(this.selectCoupon)!="{}"){
sendData.couponId = this.selectCoupon.id||'',
......
......@@ -25,7 +25,7 @@ module.exports = (vm) => {
config.method = 'POST';
// 设置为json,返回后会对数据进行一次JSON.parse()
config.dataType = 'json';
config.timeout = 3000; // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
config.timeout = 30000; // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
// 配置请求头信息
config.header = {
'Content-Type': 'application/json', // 'application/x-www-form-urlencoded'
......
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