設(shè)置全局變量之后依然不能正常獲得數(shù)據(jù)萤彩,
關(guān)鍵在于跳轉(zhuǎn)之后杏死,onLoad()方法并不會重新加載摹芙,
需要在前一個頁面跳轉(zhuǎn)成功之后對跳轉(zhuǎn)過去的頁面設(shè)置刷新函數(shù)
clickclassify:function(e){
? ? let that =this? ? let id = e.currentTarget.dataset.id
? ? console.log(id)
? ? app.globalData.classifyId = id
? ? wx.switchTab({
? ? ? url: `/pages/classify/index`,? ? ??
????????????success:function (e) {
? ? ? ? varpage = getCurrentPages().pop();
? ? ? ? if(page == undefined || page ==null)return;
? ? ? ? page.onLoad();
? ? ? }
? ? })
? },
加黑字體