Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
施宇
/
icsalesProgram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
374a0d4a
authored
Sep 12, 2019
by
施宇
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
11
parent
e20902df
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
35 deletions
pages/person/company/index.wxml
pages/tab/me/me.js
pages/tab/me/me.wxml
utils/chat.js
pages/person/company/index.wxml
View file @
374a0d4a
...
...
@@ -2,10 +2,10 @@
<view class="head boxsiz row verCenter bothSide">
<view class="row">
<view class="pic">
<cover-image class="im" src="{{userInfo.avatar||
userInfo.wechat_oauth.oauth_head||
'/res/images/imgs/heads.png'}}"></cover-image>
<cover-image class="im" src="{{userInfo.avatar||'/res/images/imgs/heads.png'}}"></cover-image>
</view>
<view class="txt">
<text class="t1">{{userInfo.company_name||
userInfo.wechat_oauth.oauth_nickname||
'--'}}</text>
<text class="t1">{{userInfo.company_name||'--'}}</text>
<view class="row">
<view class="company-txt" wx:if="{{userInfo.auth_type!=''&&userInfo.auth_type!=undefined }}">
<text class="icon iconfont iconiconxiantiaoshouji24"></text>
...
...
pages/tab/me/me.js
View file @
374a0d4a
...
...
@@ -61,20 +61,10 @@ Page({
token
:
wx
.
getStorageSync
(
'access_token'
)
},
(
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
});
}
this
.
setData
({
userInfo
:
res
.
data
userInfo
:
res
.
data
,
headPic
:
res
.
data
.
avatar
});
...
...
pages/tab/me/me.wxml
View file @
374a0d4a
<view class="mine">
<view class="head row verCenter">
<view class="pic">
<cover-image class="im" src="{{headPic
? headPic:
'/res/images/imgs/heads.png'}}"></cover-image>
<cover-image class="im" src="{{headPic
||
'/res/images/imgs/heads.png'}}"></cover-image>
</view>
<view class="text">
<text class="t1">{{userInfo.company_name||
userInfo.wechat_oauth.oauth_nickname||
'--'}}</text>
<text class="t1">{{userInfo.company_name||'--'}}</text>
<view class="row verCenter">
<text class="t2" selectable="false" space="false" decode="false">普通会员</text>
<view>
...
...
utils/chat.js
View file @
374a0d4a
...
...
@@ -39,20 +39,16 @@ const onMessageError = (err) => {
const
getImUser
=
()
=>
{
let
token
=
wx
.
getStorageSync
(
'access_token'
)
||
''
;
let
reg
=
/
(\d{3})\d{4}(\d{4})
/
;
// let userId = wx.getStorageSync('user_id') || ''
getData
(
apis
.
userInfo
,
'get'
,
{
"token"
:
token
,
},
function
(
res
)
{
if
(
res
.
errcode
==
0
)
{
wx
.
setStorageSync
(
'user_id'
,
res
.
data
.
user_id
+
''
);
wx
.
setStorageSync
(
'avatar'
,
res
.
data
.
avatar
||
res
.
data
.
wechat_oauth
.
oauth_head
||
''
);
wx
.
setStorageSync
(
'company_name'
,
res
.
data
.
company_name
||
res
.
data
.
wechat_oauth
.
oauth_nickname
||
''
);
wx
.
setStorageSync
(
'avatar'
,
res
.
data
.
avatar
||
''
);
wx
.
setStorageSync
(
'company_name'
,
res
.
data
.
company_name
||
''
);
wx
.
setStorageSync
(
"myUsername"
,
res
.
data
.
im_username
);
wx
.
setStorageSync
(
"myPassword"
,
res
.
data
.
im_password
);
wx
.
setStorageSync
(
"imNick"
,
res
.
data
.
company_name
||
(
res
.
data
.
mobile
?
res
.
data
.
mobile
.
replace
(
reg
,
'$1****$2'
)
:
''
)
||
res
.
data
.
wechat_oauth
.
oauth_nickname
||
''
);
// if(!userId){
// setAvatarAndName(res.data)
// }
conn
.
open
({
apiUrl
:
WebIM
.
config
.
apiURL
,
user
:
res
.
data
.
im_username
,
...
...
@@ -65,19 +61,6 @@ const getImUser = () => {
}
},
false
)
};
const
setAvatarAndName
=
(
data
)
=>
{
//设置用户名和头像
if
(
data
.
avatar
&&
data
.
company_name
)
{
return
}
else
{
if
(
data
.
avatar
)
{
}
else
if
(
data
.
company_name
)
{
}
else
{
}
}
};
const
addImUser
=
(
message
)
=>
{
//接收消息后进行用户的处理,以便同步到pc
let
fromUserId
=
message
.
ext
.
id
;
let
fromImId
=
message
.
from
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment