点击【首页】上的列表,跳转到【实时】 页面,并加载数据,如下图所示:
【首页】列表的点击事件:
showPdsWendu(jid){
uni.setStorageSync('mainJid',jid);
uni.switchTab({
url: `/pages/tem/tem`, //要跳转的路径
success: function (e) {
var page = getCurrentPages()[0]
if (page == undefined || page == null) return;
page.onLoad();
}
})
},
1. tab页之间的跳转,不能传递参数,只能存在本地缓存里。如: uni.setStorageSync('mainJid',jid);
2. 跳转tab页,用 uni.switchTab
3、加载tab页的方法 page.onLoad();
【实时】 页面的onLoad()
onLoad() {
if (uni.getStorageSync('mainJid')>=0) {
}
},