Commit 7f90dec7 by 宋冰琦

修复结算返回跳转问题

parent bcfaaa09
<template>
<div class="pages">
<view class="topBar" :style="{'padding-top':statusBarHeight+'px','height':navigationBarHeight+'px'}">
<u-icon @click="goBack" name="arrow-left" color="#000000" size="20"></u-icon>
<u-icon @click="goBackOrder" name="arrow-left" color="#000000" size="20"></u-icon>
<view class="tabTitle" :style="{'line-height':navigationBarHeight+'px'}">订单详情</view>
</view>
<div class="order_status" :style="{'margin-top':(statusBarHeight+navigationBarHeight+getPx(32))+'px'}">
......@@ -116,7 +116,7 @@ export default {
onLoad(option) {
this.initData(option)
},
onHide(){
onUnload(){
this.goBack()
},
data() {
......@@ -135,10 +135,14 @@ export default {
// console.log(wx.getSystemInfoSync().windowWidth);
return rpx * (wx.getSystemInfoSync().windowWidth / 750);
},
goBackOrder(){
this.backFlag = true
this.goBack()
},
goBack(){
console.log('退出订单详情',this.backFlag)
if(!this.backFlag){
if(this.backFlag){
uni.switchTab({ url: '/pages/order/order' })
this.backFlag = false
}
},
async oneMoreOrder(item) {
......@@ -170,7 +174,7 @@ export default {
list.forEach(nextData => {
Utils.getallNum(nextData);
})
this.backFlag = true
this.backFlag = false
uni.switchTab({ url: '/pages/menu/menu' })
},
async initData(option){
......@@ -185,12 +189,16 @@ export default {
if(orderId){
console.log(!Authorization,Authorization)
if(!Authorization){
this.backFlag = true
this.goBack()
return
}else{
this.backFlag = false
oId = orderId
}
}
}else{
this.backFlag = true
}
// return
const {data = {}} = await Order.getOrderDetail({orderId:oId})
......@@ -198,7 +206,7 @@ export default {
const getTime = ['2', '3'].indexOf(this.orderInfo.state) >= 0
const isBuild = ['4', '5'].indexOf(this.orderInfo.state) >= 0;
if(getTime){
const {data = {}} = await Order.getOrderWaiteTime({orderId:oId})
const {data = {}} = await Order.getOrderWaiteTime({orderId:oId})||{}
this.waitTime = data?.data
}
if (isBuild) {
......@@ -235,8 +243,6 @@ export default {
success: (res) => {
if (res.confirm) {
Order.orderRefund({ orderId: this.orderInfo.id, refundAmount: this.orderInfo.amount }).then(res => {
// this.backFlag = true
// uni.switchTab({ url: '/pages/order/order' })
this.initData()
})
} else if (res.cancel) {
......@@ -251,7 +257,7 @@ export default {
},
cancelOrder() {
Order.cancelOrder({ orderId: this.orderInfo.id }).then(res => {
this.backFlag = true
this.backFlag = false
uni.switchTab({ url: '/pages/menu/menu' })
})
},
......
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