描述: 如果大于1个页面就后退

This commit is contained in:
SelfRidicule 2024-05-17 15:08:07 +08:00
parent 3c2689c7f5
commit 2fb0a73c16

View File

@ -78,8 +78,18 @@ Page({
wx.setStorageSync('token', token)
wx.setStorageSync('parkId', user.parkId)
wx.setStorageSync('parkName', user.parkName)
// 跳转首页
wx.navigateBack()
let currentPages = getCurrentPages();
console.log('currentPages' , currentPages);
// 大于一个页面就后退,否则直接跳转首页
if(currentPages.length > 1){
wx.navigateBack()
}else{
// 跳转首页
wx.reLaunch({
url: '/pages/index/index',
})
}
},
/**