//判断跳转页
var pages = getCurrentPages(); // 当前页面
var beforePage = pages[pages.length - 2]; // 前一个页面
console.log('跳转页', beforePage.route)
if (beforePage.route == 'pages/my4/my4_performance_detail') {
console.log('自己')
this.isziji = true
} else if (beforePage.route == 'pages/my4/my4_performance') {
console.log('主管')
this.iszhuguan = true
} else if (beforePage.route == 'pages/my4/my4_performance_history') {
console.log('历史')
this.islishi = true
}
注意:Tab页面不进页面栈
这段代码主要用于判断当前页面的前一个页面路由,根据路由不同设置不同的页面状态。例如,如果前一个页面路由是'pages/my4/my4_performance_detail',则设置`isziji`为true;如果是'pages/my4/my4_performance',则设置`iszhuguan`为true;如果是'pages/my4/my4_performance_history',则设置`islishi`为true。请注意,Tab页面不进入页面栈。
3021

被折叠的 条评论
为什么被折叠?



