| @@ -22,6 +22,7 @@ App({ | |||
| this.globalData.userInfoData = {}; | |||
| this.globalData.userInfoData.avatarUrl = userInfoData.avatarUrl; | |||
| this.globalData.userInfoData.nickName = userInfoData.nickName; | |||
| this.globalData.userInfoData.userLevel = userInfoData.userLevel; | |||
| }else{ | |||
| if (openid){ | |||
| this.getUserInfo(); | |||
| @@ -181,7 +182,8 @@ App({ | |||
| this.globalData.userInfoData.nickName = nickName; | |||
| wx.setStorageSync('userInfoData', { | |||
| avatarUrl: avatarUrl, | |||
| nickName: nickName | |||
| nickName: nickName, | |||
| userLevel:0 | |||
| }) | |||
| } | |||
| }, this, "POST") | |||
| @@ -248,10 +250,12 @@ App({ | |||
| if (res.data && res.data.avatarUrl) { | |||
| this.globalData.userInfoData = {}; | |||
| this.globalData.userInfoData.avatarUrl = res.data.avatarUrl; | |||
| this.globalData.userInfoData.nickName = res.data.nickName; | |||
| this.globalData.userInfoData.nickName = res.data.nickName; | |||
| this.globalData.userInfoData.userLevel = res.data.userLevel; | |||
| wx.setStorageSync('userInfoData', { | |||
| avatarUrl: res.data.avatarUrl, | |||
| nickName: res.data.nickName | |||
| nickName: res.data.nickName, | |||
| userLevel: res.data.userLevel | |||
| }) | |||
| } | |||
| } | |||
| @@ -1,6 +1,6 @@ | |||
| <!--index.wxml--> | |||
| <view class="all" wx:if="{{mainShow}}"> | |||
| <view class="main"> | |||
| <view class="main" wx:if="{{isStartAdvertising==0 || !isStartAdvertisingShow}}"> | |||
| <view class="contentFrame"> | |||
| <view class="swiperFrame"> | |||
| <swiper class="swiperSty" autoplay current="{{swiperCurrent}}" bindchange="swiperChange"> | |||
| @@ -59,6 +59,7 @@ | |||
| </view> | |||
| <service></service> | |||
| </view> | |||
| <tabBar></tabBar> | |||
| <tabBar wx:if="{{isStartAdvertising==0 || !isStartAdvertisingShow}}"></tabBar> | |||
| <!-- <view wx:if="{{isStartAdvertisingShow}}" class='imgBg' catchtouchmove="ture"></view> --> | |||
| <image wx:if="{{isStartAdvertisingShow}}" style="opacity:{{isStartAdvertising}};" src="{{startAdvertisingUrl}}" class='imgBg' catchtouchmove="ture"></image> | |||
| </view> | |||
| @@ -93,6 +93,7 @@ Page({ | |||
| if (app.globalData.userInfoData) { | |||
| this.data.userData.avatarUrl = app.globalData.userInfoData.avatarUrl; | |||
| this.data.userData.nickName = app.globalData.userInfoData.nickName; | |||
| this.data.userData.userLevel = app.globalData.userInfoData.userLevel; | |||
| this.setData({ | |||
| userData: this.data.userData | |||
| }) | |||
| @@ -376,15 +377,22 @@ Page({ | |||
| if (res.data && res.data.avatarUrl) { | |||
| this.data.userData.userLevel = res.data.userLevel; | |||
| if (!app.globalData.userInfoData) { | |||
| console.log(app.globalData.userInfoData); | |||
| this.data.userData.avatarUrl = res.data.avatarUrl; | |||
| this.data.userData.nickName = res.data.nickName; | |||
| this.data.userData.userLevel = res.data.userLevel; | |||
| app.globalData.userInfoData = {}; | |||
| app.globalData.userInfoData.avatarUrl = res.data.avatarUrl; | |||
| app.globalData.userInfoData.nickName = res.data.nickName; | |||
| app.globalData.userInfoData.userLevel = res.data.userLevel; | |||
| wx.setStorageSync('userInfoData', { | |||
| avatarUrl: res.data.avatarUrl, | |||
| nickName: res.data.nickName | |||
| nickName: res.data.nickName, | |||
| userLevel: res.data.userLevel, | |||
| }) | |||
| } else if (app.globalData.userInfoData && app.globalData.userInfoData.userLevel != res.data.userLevel){ | |||
| app.globalData.userInfoData.userLevel = res.data.userLevel; | |||
| wx.setStorageSync('userInfoData', app.globalData.userInfoData); | |||
| } | |||
| this.setData({ | |||
| userData: this.data.userData, | |||