Commit d6be35e3 by 施宇

1111

parent 71d8c9e4
......@@ -24,7 +24,8 @@ Page({
xb: 1, //1表示询价 2表示报价
isShowBottom: false,
isShowData: true,
isClick: ""
isClick: "",
headPic: '',
},
/**
......@@ -87,6 +88,16 @@ Page({
}
getData(apis.userInfo, 'GET', params, (res) => {
if (res.errcode === 0) {
// 未企业认证的时候优先读取微信头像
if (res.data.avatar == '') {
this.setData({
headPic: res.data.wechat_oauth ? res.data.wechat_oauth.oauth_head : ''
});
} else {
this.setData({
headPic: res.data.avatar
});
}
me.setData({
userInfo: res.data
});
......
......@@ -2,7 +2,7 @@
<view class="company-view">
<view class="company-head row verCenter">
<view class="img-view">
<image src="{{userInfo.avatar||'/res/images/imgs/heads.png'}}" class="company-img"></image>
<image src="{{headPic||'/res/images/imgs/heads.png'}}" class="company-img"></image>
</view>
<view class="text">
<view class="h3 bold">{{userInfo.company_name||'--'}}</view>
......
......@@ -77,7 +77,7 @@ Page({
// 未企业认证的时候优先读取微信头像
if (res.data.avatar == '') {
this.setData({
headPic: res.data.wechat_oauth.oauth_head
headPic: res.data.wechat_oauth ? res.data.wechat_oauth.oauth_head : ''
});
} else {
this.setData({
......
......@@ -62,7 +62,7 @@ Page({
// 未企业认证的时候优先读取微信头像
if (res.data.avatar == '') {
this.setData({
headPic: res.data.wechat_oauth.oauth_head
headPic: res.data.wechat_oauth ? res.data.wechat_oauth.oauth_head:''
});
} else {
this.setData({
......
......@@ -5,7 +5,7 @@
</view>
<view class="text">
<text class="t1">
{{userInfo.company_name||userInfo.wechat_oauth.oauth_nickname||'--'}}
{{userInfo.company_name||'--'}}
</text>
<view class="row verCenter">
<text class="t2" selectable="false" space="false" decode="false">普通会员</text>
......
......@@ -42,8 +42,14 @@ const getImUser = () => {
"token": token,
}, function(res) {
if (res.errcode == 0) {
let avatar = "";
wx.setStorageSync('user_id', res.data.user_id + '');
wx.setStorageSync('avatar', res.data.avatar || '');
if(res.data.avatar == ''){
avatar = res.data.wechat_oauth ? res.data.wechat_oauth.oauth_head : ''
}else{
avatar = res.data.avatar
}
wx.setStorageSync('avatar', avatar);
wx.setStorageSync('company_name', res.data.company_name || '');
wx.setStorageSync("myUsername", res.data.im_username);
wx.setStorageSync("myPassword", res.data.im_password);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment