Commit 71d8c9e4 by 梁建民

bug

parent bea16c25
......@@ -12,17 +12,17 @@ Page({
data: {
userInfo: null,
business: null,
headPic: '',
type: "",
token: "",
userId: ""
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let type = options.type; //1编辑 2查看
let userId = options.userId||''; //查看时别人公司的id
let userId = options.userId || ''; //查看时别人公司的id
let token = wx.getStorageSync('access_token') || '';
let me = this;
this.setData({
......@@ -73,6 +73,18 @@ Page({
}
http.getData(apis.userInfo, 'GET', params, (res) => {
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({
userInfo: res.data
});
......
......@@ -2,7 +2,7 @@
<view class="head boxsiz row verCenter bothSide">
<view class="row">
<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 class="txt">
<text class="t1">{{userInfo.company_name||'--'}}</text>
......@@ -56,7 +56,7 @@
<text class="icon iconfont iconChevron"></text>
</view>
</view>
<view class="txt-wrap boxsiz ">
<view class="txt-wrap boxsiz">
<view class="pic" wx:if="{{userInfo.com_pic}}">
<cover-image class="im" src="{{userInfo.com_pic}}"></cover-image>
</view>
......
......@@ -27,10 +27,8 @@ Page({
*/
onLoad: function (options) {
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