this.globalData.userInfoData = {}; | this.globalData.userInfoData = {}; | ||||
this.globalData.userInfoData.avatarUrl = userInfoData.avatarUrl; | this.globalData.userInfoData.avatarUrl = userInfoData.avatarUrl; | ||||
this.globalData.userInfoData.nickName = userInfoData.nickName; | this.globalData.userInfoData.nickName = userInfoData.nickName; | ||||
this.globalData.userInfoData.userLevel = userInfoData.userLevel; | |||||
}else{ | }else{ | ||||
if (openid){ | if (openid){ | ||||
this.getUserInfo(); | this.getUserInfo(); | ||||
this.globalData.userInfoData.nickName = nickName; | this.globalData.userInfoData.nickName = nickName; | ||||
wx.setStorageSync('userInfoData', { | wx.setStorageSync('userInfoData', { | ||||
avatarUrl: avatarUrl, | avatarUrl: avatarUrl, | ||||
nickName: nickName | |||||
nickName: nickName, | |||||
userLevel:0 | |||||
}) | }) | ||||
} | } | ||||
}, this, "POST") | }, this, "POST") | ||||
if (res.data && res.data.avatarUrl) { | if (res.data && res.data.avatarUrl) { | ||||
this.globalData.userInfoData = {}; | this.globalData.userInfoData = {}; | ||||
this.globalData.userInfoData.avatarUrl = res.data.avatarUrl; | 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', { | wx.setStorageSync('userInfoData', { | ||||
avatarUrl: res.data.avatarUrl, | avatarUrl: res.data.avatarUrl, | ||||
nickName: res.data.nickName | |||||
nickName: res.data.nickName, | |||||
userLevel: res.data.userLevel | |||||
}) | }) | ||||
} | } | ||||
} | } |
<!--index.wxml--> | <!--index.wxml--> | ||||
<view class="all" wx:if="{{mainShow}}"> | <view class="all" wx:if="{{mainShow}}"> | ||||
<view class="main"> | |||||
<view class="main" wx:if="{{isStartAdvertising==0 || !isStartAdvertisingShow}}"> | |||||
<view class="contentFrame"> | <view class="contentFrame"> | ||||
<view class="swiperFrame"> | <view class="swiperFrame"> | ||||
<swiper class="swiperSty" autoplay current="{{swiperCurrent}}" bindchange="swiperChange"> | <swiper class="swiperSty" autoplay current="{{swiperCurrent}}" bindchange="swiperChange"> | ||||
</view> | </view> | ||||
<service></service> | <service></service> | ||||
</view> | </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> | <image wx:if="{{isStartAdvertisingShow}}" style="opacity:{{isStartAdvertising}};" src="{{startAdvertisingUrl}}" class='imgBg' catchtouchmove="ture"></image> | ||||
</view> | </view> |
if (app.globalData.userInfoData) { | if (app.globalData.userInfoData) { | ||||
this.data.userData.avatarUrl = app.globalData.userInfoData.avatarUrl; | this.data.userData.avatarUrl = app.globalData.userInfoData.avatarUrl; | ||||
this.data.userData.nickName = app.globalData.userInfoData.nickName; | this.data.userData.nickName = app.globalData.userInfoData.nickName; | ||||
this.data.userData.userLevel = app.globalData.userInfoData.userLevel; | |||||
this.setData({ | this.setData({ | ||||
userData: this.data.userData | userData: this.data.userData | ||||
}) | }) | ||||
if (res.data && res.data.avatarUrl) { | if (res.data && res.data.avatarUrl) { | ||||
this.data.userData.userLevel = res.data.userLevel; | this.data.userData.userLevel = res.data.userLevel; | ||||
if (!app.globalData.userInfoData) { | if (!app.globalData.userInfoData) { | ||||
console.log(app.globalData.userInfoData); | |||||
this.data.userData.avatarUrl = res.data.avatarUrl; | this.data.userData.avatarUrl = res.data.avatarUrl; | ||||
this.data.userData.nickName = res.data.nickName; | this.data.userData.nickName = res.data.nickName; | ||||
this.data.userData.userLevel = res.data.userLevel; | |||||
app.globalData.userInfoData = {}; | app.globalData.userInfoData = {}; | ||||
app.globalData.userInfoData.avatarUrl = res.data.avatarUrl; | app.globalData.userInfoData.avatarUrl = res.data.avatarUrl; | ||||
app.globalData.userInfoData.nickName = res.data.nickName; | app.globalData.userInfoData.nickName = res.data.nickName; | ||||
app.globalData.userInfoData.userLevel = res.data.userLevel; | |||||
wx.setStorageSync('userInfoData', { | wx.setStorageSync('userInfoData', { | ||||
avatarUrl: res.data.avatarUrl, | 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({ | this.setData({ | ||||
userData: this.data.userData, | userData: this.data.userData, |