consumer模块完成度95%,检查消费者前端bug并修复
This commit is contained in:
@@ -746,21 +746,16 @@ const shareForFree = async () => {
|
||||
// 使用 onBackPress 拦截物理返回键和系统导航栏返回
|
||||
onBackPress((_): boolean => {
|
||||
const pages = getCurrentPages()
|
||||
console.log('[order-detail onBackPress] pages count:', pages.length)
|
||||
|
||||
if (pages.length > 1) {
|
||||
// @ts-ignore
|
||||
const prevPage = pages[pages.length - 2]
|
||||
// @ts-ignore
|
||||
const prevRoute: string = prevPage.route ?? ''
|
||||
|
||||
if (prevRoute.includes('product-detail') || prevRoute.includes('payment')) {
|
||||
uni.redirectTo({ url: '/pages/mall/consumer/orders' })
|
||||
return true
|
||||
}
|
||||
} else {
|
||||
uni.redirectTo({ url: '/pages/mall/consumer/orders' })
|
||||
return true
|
||||
// 正常返回上一页
|
||||
return false
|
||||
}
|
||||
return false
|
||||
|
||||
// 如果只有当前页面,跳转到 orders
|
||||
uni.redirectTo({ url: '/pages/mall/consumer/orders' })
|
||||
return true
|
||||
})
|
||||
|
||||
// 生命周期 - 在所有函数定义之后
|
||||
|
||||
Reference in New Issue
Block a user