小程序实现两级跳转
Posted masterchd
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了小程序实现两级跳转相关的知识,希望对你有一定的参考价值。
界面从A->B->C,其中B是中转界面,想要在C返回的时候实现
C-> A
只需要在B界面加上一个中转标志,从A->B触发到C界面的标志
从C->B 触发到A的标志,下面的是中继界面B的写法
Page({ data: { hidden: false, backflag : 0 }, onLoad:function(res){ }, onShow:function(){ console.log(this.data.backflag) var that = this; if (that.data.backflag == 0) { wx.navigateTo({ url: ‘C界面路径‘, success: function (res) { that.setData({ backflag: 1 }) } }) } else { wx.navigateBack({ //这个直接返回A界面 }) } }, onReady:function(){ } })
以上是关于小程序实现两级跳转的主要内容,如果未能解决你的问题,请参考以下文章