【类 型】:fix
【原 因】:pay支付成功或失败后 跳转到订单页面 跳转时清楚了缓存 此时back按钮失效 【过 程】:判断没有缓存 back按钮退回到首页 【影 响】: # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
113b8a67bb
commit
1ce8d78649
@ -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
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user