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
f6f2f613
authored
Sep 11, 2019
by
施宇
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1111
parent
1d4bac63
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
34 additions
and
23 deletions
components/chat/inputbar/suit/image/image.js
components/chat/inputbar/suit/main/main.js
pages/detail/chat/index.js
pages/list/ratemanage/index.wxml
pages/person/setting/index.js
pages/tab/me/me.wxml
pages/tab/message/message.js
utils/chat.js
utils/util.js
components/chat/inputbar/suit/image/image.js
View file @
f6f2f613
...
...
@@ -79,7 +79,7 @@ Component({
filename
:
tempFilePaths
[
0
]
};
let
userId
=
wx
.
getStorageSync
(
'user_id'
);
let
companyName
=
wx
.
getStorageSync
(
'
company_name
'
);
let
companyName
=
wx
.
getStorageSync
(
'
imNick
'
);
let
avatar
=
wx
.
getStorageSync
(
'avatar'
);
msg
.
set
({
apiUrl
:
WebIM
.
config
.
apiURL
,
...
...
components/chat/inputbar/suit/main/main.js
View file @
f6f2f613
...
...
@@ -85,7 +85,7 @@ Component({
let
id
=
WebIM
.
conn
.
getUniqueId
();
let
msg
=
new
WebIM
.
message
(
msgType
.
TEXT
,
id
);
let
userId
=
wx
.
getStorageSync
(
'user_id'
);
let
companyName
=
wx
.
getStorageSync
(
'
company_name
'
);
let
companyName
=
wx
.
getStorageSync
(
'
imNick
'
);
let
avatar
=
wx
.
getStorageSync
(
'avatar'
);
msg
.
set
({
msg
:
this
.
data
.
userMessage
,
...
...
@@ -132,7 +132,7 @@ Component({
let
id
=
WebIM
.
conn
.
getUniqueId
();
let
msg
=
new
WebIM
.
message
(
msgType
.
CMD
,
id
);
let
userId
=
wx
.
getStorageSync
(
'user_id'
);
let
companyName
=
wx
.
getStorageSync
(
'
company_name
'
);
let
companyName
=
wx
.
getStorageSync
(
'
imNick
'
);
let
avatar
=
wx
.
getStorageSync
(
'avatar'
);
let
touserid
=
this
.
data
.
username
.
id
==
userId
?
this
.
data
.
username
.
touserid
:
this
.
data
.
username
.
id
;
let
members
=
wx
.
getStorageSync
(
'member'
)
||
''
;
...
...
@@ -146,6 +146,7 @@ Component({
img1
:
this
.
data
.
username
.
name
==
companyName
?
this
.
data
.
username
.
img1
:
this
.
data
.
username
.
img
,
timer
:
WebIM
.
time
()
});
console
.
log
(
params
)
msg
.
set
({
msg
:
'template'
,
from
:
me
.
data
.
username
.
myName
,
...
...
pages/detail/chat/index.js
View file @
f6f2f613
...
...
@@ -23,7 +23,7 @@ Page({
});
}
else
{
wx
.
setNavigationBarTitle
({
title
:
username
.
title
title
:
username
.
title
||
'--'
});
}
if
(
getApp
().
globalData
.
imBoolean
)
{
...
...
pages/list/ratemanage/index.wxml
View file @
f6f2f613
...
...
@@ -28,7 +28,7 @@
<view class="item-top row bothSide verCenter special-top">
<view class="top-left row verCenter">
<image src="{{item.avatar||'/res/images/imgs/s.png'}}" class="img"></image>
<text class="name">{{item.
evaluate_
company_name||'--'}}</text>
<text class="name">{{item.company_name||'--'}}</text>
</view>
<view class="top-right row verCenter">
<block wx:if="{{item.is_praise == 1}}">
...
...
pages/person/setting/index.js
View file @
f6f2f613
...
...
@@ -93,6 +93,7 @@ Page({
wx
.
removeStorageSync
(
'myUsername'
);
wx
.
removeStorageSync
(
'myPassword'
);
wx
.
removeStorageSync
(
'auth'
);
wx
.
removeStorageSync
(
'imNick'
);
wx
.
reLaunch
({
url
:
'/pages/person/auth/index'
,
});
...
...
pages/tab/me/me.wxml
View file @
f6f2f613
...
...
@@ -4,7 +4,7 @@
<cover-image class="im" src="{{headPic ? headPic:'/res/images/imgs/heads.png'}}"></cover-image>
</view>
<view class="text">
<text class="t1">{{userInfo.company_name}}</text>
<text class="t1">{{userInfo.company_name
||userInfo.wechat_oauth.oauth_nickname||'--'
}}</text>
<view class="row verCenter">
<text class="t2" selectable="false" space="false" decode="false">普通会员</text>
<view>
...
...
pages/tab/message/message.js
View file @
f6f2f613
...
...
@@ -133,6 +133,7 @@ Page({
img
:
detail
.
ext
.
img
,
img1
:
detail
.
ext
.
img1
};
console
.
log
(
nameList
)
wx
.
navigateTo
({
url
:
"/pages/detail/chat/index?username="
+
JSON
.
stringify
(
nameList
)
});
...
...
utils/chat.js
View file @
f6f2f613
...
...
@@ -37,28 +37,22 @@ const onMessageError = (err) => {
return
true
;
}
const
getImUser
=
()
=>
{
let
token
=
wx
.
getStorageSync
(
'access_token'
)
||
''
;
// let imName = wx.getStorageSync('myUsername') || '';
// let imPassword = wx.getStorageSync('myPassword') || '';
// if (imName && imPassword) {
// conn.open({
// apiUrl: WebIM.config.apiURL,
// user: imName,
// pwd: imPassword,
// appKey: WebIM.config.appkey
// });
// return;
// }
let
reg
=
/
(\d{3})\d{4}(\d{4})
/
;
// let userId = wx.getStorageSync('user_id') || ''
getData
(
apis
.
userInfo
,
'get'
,
{
"token"
:
token
,
},
function
(
res
)
{
},
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
||
res
.
data
.
wechat_oauth
.
oauth_head
||
''
);
wx
.
setStorageSync
(
'company_name'
,
res
.
data
.
company_name
||
res
.
data
.
wechat_oauth
.
oauth_nickname
||
''
);
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
,
...
...
@@ -71,6 +65,19 @@ 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
;
...
...
@@ -87,7 +94,7 @@ const addImUser = (message) => { //接收消息后进行用户的处理,以便
};
const
registerIm
=
()
=>
{
let
token
=
wx
.
getStorageSync
(
'access_token'
)
||
''
;
getData
(
apis
.
authregistim
,
'post'
,
{},
function
(
res
)
{
getData
(
apis
.
authregistim
,
'post'
,
{},
function
(
res
)
{
if
(
res
.
errcode
==
0
)
{
getImUser
();
}
else
{
...
...
@@ -172,7 +179,7 @@ const webimListen = () => {
calcUnReadSpot
(
message
);
}
},
onBlacklistUpdate
:
function
(
list
)
{
//黑名单变动
onBlacklistUpdate
:
function
(
list
)
{
//黑名单变动
// 查询黑名单,将好友拉黑,将好友从黑名单移除都会回调这个函数,list则是黑名单现有的所有好友信息
console
.
log
(
list
);
},
...
...
utils/util.js
View file @
f6f2f613
...
...
@@ -76,6 +76,7 @@ const getData = (url, type, param, callBack, loading, isheader, istoken) => {
wx
.
removeStorageSync
(
'myUsername'
);
wx
.
removeStorageSync
(
'myPassword'
);
wx
.
removeStorageSync
(
'auth'
);
wx
.
removeStorageSync
(
'imNick'
);
wx
.
reLaunch
({
url
:
'/pages/person/auth/index'
,
});
...
...
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