|
@@ -33,6 +33,10 @@ Page({
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad(options) {
|
|
|
+ app.fetchUserDataCallback = () => {
|
|
|
+ this.setUserInfo()
|
|
|
+ this.setTabBarList()
|
|
|
+ }
|
|
|
app.fetchSystemConfigCallback = () => {
|
|
|
this.setKefu()
|
|
|
}
|
|
@@ -53,18 +57,8 @@ Page({
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow() {
|
|
|
- const { shop_status } = app.globalData.userInfo
|
|
|
-
|
|
|
- this.getTabBar().init()
|
|
|
- this.setData({
|
|
|
- sessionId: wx.getStorageSync(sessionStorageKey),
|
|
|
- userInfo: app.globalData.userInfo
|
|
|
- })
|
|
|
-
|
|
|
- if (shop_status === 1 && this.getTabBar().data.list.findIndex(item => item.pagePath === 'pages/news/news') === -1) {
|
|
|
- this.getTabBar().setData({ list: app.globalData.tabBarList })
|
|
|
- }
|
|
|
-
|
|
|
+ this.setUserInfo()
|
|
|
+ this.setTabBarList()
|
|
|
this.setKefu()
|
|
|
},
|
|
|
|
|
@@ -332,7 +326,22 @@ Page({
|
|
|
const { kefu_phone } = app.globalData.objSystemConfig
|
|
|
|
|
|
this.setData({
|
|
|
- kefu: kefu_phone
|
|
|
+ kefu: kefu_phone || ''
|
|
|
})
|
|
|
+ },
|
|
|
+ setUserInfo() {
|
|
|
+ this.setData({
|
|
|
+ sessionId: wx.getStorageSync(sessionStorageKey),
|
|
|
+ userInfo: app.globalData.userInfo
|
|
|
+ })
|
|
|
+ },
|
|
|
+ setTabBarList() {
|
|
|
+ const { shop_status } = app.globalData.userInfo
|
|
|
+
|
|
|
+ this.getTabBar().init()
|
|
|
+
|
|
|
+ if (shop_status === 1 && this.getTabBar().data.list.findIndex(item => item.pagePath === 'pages/news/news') === -1) {
|
|
|
+ this.getTabBar().setData({ list: app.globalData.tabBarList })
|
|
|
+ }
|
|
|
}
|
|
|
})
|