From dfefaaed8dc70d55a94c23e33bc24410b0b955e0 Mon Sep 17 00:00:00 2001 From: taiwan Date: Fri, 14 Jan 2022 16:52:56 +0800 Subject: [PATCH] 点击分销,显示选中后的图标 --- pages/distribution/distribution.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/pages/distribution/distribution.js b/pages/distribution/distribution.js index 708d871..125b7a6 100644 --- a/pages/distribution/distribution.js +++ b/pages/distribution/distribution.js @@ -3,6 +3,19 @@ const app = getApp(); let self = null, os = app.globalData.setting; var regeneratorRuntime = require('../../utils/runtime.js'); +// Component({ +// pageLifetimes: { +// show() { +// if (typeof this.getTabBar === 'function' && this.getTabBar()) { +// this.getTabBar().setData({ +// active: 2 +// }) +// } +// } +// } +// }) + + Page({ /** @@ -57,7 +70,13 @@ Page({ /** * 生命周期函数--监听页面显示 */ - onShow: function () { + onShow: function () { + if (typeof this.getTabBar === 'function' && this.getTabBar()) { + this.getTabBar().setData({ + active: 2 + }) + }; + var self=this,userinfo=app.globalData.userInfo; if(!app.globalData.userInfo){ return false; -- libgit2 0.21.4