Commit 71d8c9e4 by 梁建民

bug

parent bea16c25
...@@ -12,17 +12,17 @@ Page({ ...@@ -12,17 +12,17 @@ Page({
data: { data: {
userInfo: null, userInfo: null,
business: null, business: null,
headPic: '',
type: "", type: "",
token: "", token: "",
userId: "" userId: ""
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
let type = options.type; //1编辑 2查看 let type = options.type; //1编辑 2查看
let userId = options.userId||''; //查看时别人公司的id let userId = options.userId || ''; //查看时别人公司的id
let token = wx.getStorageSync('access_token') || ''; let token = wx.getStorageSync('access_token') || '';
let me = this; let me = this;
this.setData({ this.setData({
...@@ -73,6 +73,18 @@ Page({ ...@@ -73,6 +73,18 @@ Page({
} }
http.getData(apis.userInfo, 'GET', params, (res) => { http.getData(apis.userInfo, 'GET', params, (res) => {
if (res.errcode === 0) { if (res.errcode === 0) {
// 未企业认证的时候优先读取微信头像
if (res.data.avatar == '') {
this.setData({
headPic: res.data.wechat_oauth.oauth_head
});
} else {
this.setData({
headPic: res.data.avatar
});
}
me.setData({ me.setData({
userInfo: res.data userInfo: res.data
}); });
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="head boxsiz row verCenter bothSide"> <view class="head boxsiz row verCenter bothSide">
<view class="row"> <view class="row">
<view class="pic"> <view class="pic">
<cover-image class="im" src="{{userInfo.avatar||'/res/images/imgs/heads.png'}}"></cover-image> <cover-image class="im" src="{{headPic ? headPic:'/res/images/imgs/heads.png'}}"></cover-image>
</view> </view>
<view class="txt"> <view class="txt">
<text class="t1">{{userInfo.company_name||'--'}}</text> <text class="t1">{{userInfo.company_name||'--'}}</text>
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<text class="icon iconfont iconChevron"></text> <text class="icon iconfont iconChevron"></text>
</view> </view>
</view> </view>
<view class="txt-wrap boxsiz "> <view class="txt-wrap boxsiz">
<view class="pic" wx:if="{{userInfo.com_pic}}"> <view class="pic" wx:if="{{userInfo.com_pic}}">
<cover-image class="im" src="{{userInfo.com_pic}}"></cover-image> <cover-image class="im" src="{{userInfo.com_pic}}"></cover-image>
</view> </view>
......
...@@ -27,10 +27,8 @@ Page({ ...@@ -27,10 +27,8 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
if (!http.judgeToken(true)) { if (!http.judgeToken(true)) {
return return;
} }
}, },
/** /**
......
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