【类 型】:fix

【原  因】:pay支付成功或失败后 跳转到订单页面 跳转时清楚了缓存 此时back按钮失效
【过  程】:判断没有缓存 back按钮退回到首页
【影  响】:

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
This commit is contained in:
air 2025-01-15 21:22:07 +08:00
parent 113b8a67bb
commit 1ce8d78649
2 changed files with 30 additions and 7 deletions

View File

@ -1,10 +1,16 @@
<template>
<view>
<!-- topbar -->
<u-navbar title="订单" bgColor="#d43030" :titleStyle="{ color: '#FFF'}" :autoBack="true" placeholder>
<view class="u-nav-slot" slot="left">
<u-icon name="arrow-left" color="#fff" size="19"></u-icon>
</view>
<u-navbar
title="订单"
bgColor="#d43030"
:titleStyle="{ color: '#FFF' }"
:autoBack="false"
placeholder
>
<view class="u-nav-slot" slot="left" @click="onBackClick">
<u-icon name="arrow-left" color="#fff" size="19"></u-icon>
</view>
</u-navbar>
<!-- tab -->
<view class="tabListBox m-l-24 m-r-24 m-t-24 flex msb pr">
@ -63,6 +69,8 @@
}
},
onLoad() {
//
this.$store.dispatch('fetchOrderList')
// tapline
this.lineOffset(this.current)
},
@ -87,6 +95,21 @@
}
},
methods: {
//
onBackClick() {
const pages = getCurrentPages() //
if (pages.length === 1) {
//
uni.reLaunch({
url: '/pages/index/index', //
})
} else {
//
uni.navigateBack({
delta: 1, //
})
}
},
//tab current
handlerTab(index) {
this.current = index

View File

@ -217,9 +217,9 @@
//退
if (res.data.status === 1) {
// 退tab
// uni.navigateTo({
// url: `/pages/shop/pay?order_sn=${res.data.order_sn}&fullPrice=${fullPrice}`
// })
uni.navigateTo({
url: `/pages/order/index`
})
} else if (res.data.status === -1) {
uni.removeStorage({ //
key: 'userInfo',