|
@@ -9,7 +9,7 @@ import {
|
|
|
} from '~/store/index'
|
|
|
Page({
|
|
|
data: {
|
|
|
- activityList: true,
|
|
|
+ activityList: false,
|
|
|
bannerList: []
|
|
|
},
|
|
|
onShow() {
|
|
@@ -17,17 +17,22 @@ Page({
|
|
|
this.getTabBar().setData({
|
|
|
selected: 1
|
|
|
})
|
|
|
- this.storeBindings = createStoreBindings(this, {
|
|
|
- store,
|
|
|
- fields: {
|
|
|
- userInfo: 'userInfo'
|
|
|
- },
|
|
|
- })
|
|
|
- this.storeBindings.updateStoreBindings()
|
|
|
- this.setData({
|
|
|
- activityList: true
|
|
|
- })
|
|
|
- this.getBannerList()
|
|
|
+ this.getLocUserInfo()
|
|
|
+ if (Object.keys(this.data.userInfo).length > 0) {
|
|
|
+ this.getBannerList()
|
|
|
+ this.setData({
|
|
|
+ activityList: true
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ getApp().callBack = (res) => {
|
|
|
+ this.getLocUserInfo()
|
|
|
+ this.getBannerList()
|
|
|
+ this.setData({
|
|
|
+ activityList: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
onHide() {
|
|
@@ -47,6 +52,15 @@ Page({
|
|
|
this.selectComponent('#activityList').getActivities()
|
|
|
this.getBannerList()
|
|
|
},
|
|
|
+ async getLocUserInfo() {
|
|
|
+ this.storeBindings = createStoreBindings(this, {
|
|
|
+ store,
|
|
|
+ fields: {
|
|
|
+ userInfo: 'userInfo'
|
|
|
+ },
|
|
|
+ })
|
|
|
+ this.storeBindings.updateStoreBindings()
|
|
|
+ },
|
|
|
onUnload() {
|
|
|
this.storeBindings.destroyStoreBindings()
|
|
|
},
|