Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
施宇
/
icsales
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
5c55a957
authored
Jul 23, 2019
by
施宇
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1312
parent
00fb5f97
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
23 deletions
dist/js/chat/index.js
dist/js/chat/index.js
View file @
5c55a957
...
...
@@ -48,17 +48,16 @@ $(function () {
});
},
addChatMember
:
function
(
id
)
{
console
.
log
(
id
)
// IcController.getData(apis.addrecord, 'GET', {
// "token": Util.getCookie('token') || '',
// "user_id": id
// }, function (res) {
// if (res.errcode === 0) {
IcController
.
getData
(
apis
.
addrecord
,
'GET'
,
{
"token"
:
Util
.
getCookie
(
'token'
)
||
''
,
"user_id"
:
id
},
function
(
res
)
{
if
(
res
.
errcode
===
0
)
{
//
} else {
//
console.log('添加聊天成员失败')
//
}
//
},false);
}
else
{
console
.
log
(
'添加聊天成员失败'
)
}
},
false
);
},
rendChatSection
:
function
(
data
)
{
console
.
log
(
'获取成员'
)
...
...
@@ -361,7 +360,7 @@ $(function () {
self
.
userHtml
(
0
,
message
,
regContent
)
+
'</div>'
;
var
messageStr
=
'<div class="chat_item active" id="'
+
message
.
from
+
'">'
+
messageSigleStr
+
'</div>'
$
(
".notice_classify[userid="
+
this
.
defaultName
+
"]"
).
after
(
userStr
);
$
(
".notice_classify[userid="
+
self
.
defaultName
+
"]"
).
after
(
userStr
);
// $('.notice_left_content').append(userStr);
$
(
'.chat_item_content'
).
append
(
messageStr
)
}
else
{
...
...
@@ -390,8 +389,7 @@ $(function () {
$
(
this
).
html
(
self
.
userHtml
(
num
+
1
,
message
,
regContent
));
var
html
=
$
(
this
).
clone
();
$
(
this
).
remove
();
$
(
".notice_classify[userid="
+
this
.
defaultName
+
"]"
).
after
(
html
);
$
(
".notice_classify[userid="
+
self
.
defaultName
+
"]"
).
after
(
html
);
if
(
!
firstClick
)
{
$
(
'#'
+
userId
).
find
(
'.notice_item_content'
).
append
(
self
.
messageHtml
(
2
,
htmlStr
,
isTemplate
));
...
...
@@ -402,13 +400,14 @@ $(function () {
}
else
{
if
(
index
==
len
-
1
)
{
//新用户
console
.
log
(
'新用户'
)
var
userStr
=
'<div class="notice_classify" userid="'
+
message
.
from
+
'" newMember="true">'
+
self
.
userHtml
(
1
,
message
,
regContent
)
+
'</div>'
;
var
messageStr
=
'<div class="chat_item" id="'
+
message
.
from
+
'">'
+
messageSigleStr
+
'</div>'
$
(
".notice_classify[userid="
+
this
.
defaultName
+
"]"
).
after
(
userStr
)
messageSigleStr
+
'</div>'
;
$
(
".notice_classify[userid="
+
self
.
defaultName
+
"]"
).
after
(
userStr
);
$
(
'.chat_item_content'
).
append
(
messageStr
)
}
}
...
...
@@ -426,18 +425,18 @@ $(function () {
},
onTextMessage
:
function
(
message
)
{
self
.
receiveData
(
1
,
{
name
:
message
.
ext
.
name
,
name
:
message
.
ext
.
name
||
'--'
,
id
:
message
.
ext
.
id
,
img
:
message
.
ext
.
img
,
img
:
message
.
ext
.
img
||
(
dist
+
"/images/default.jpg"
)
,
message
:
message
.
data
,
from
:
message
.
from
},
false
)
},
//收到文本消息;
onEmojiMessage
:
function
(
message
)
{
self
.
receiveData
(
3
,
{
name
:
message
.
ext
.
name
,
name
:
message
.
ext
.
name
||
'--'
,
id
:
message
.
ext
.
id
,
img
:
message
.
ext
.
img
,
img
:
message
.
ext
.
img
||
(
dist
+
"/images/default.jpg"
)
,
message
:
message
.
data
,
from
:
message
.
from
,
},
false
)
...
...
@@ -445,9 +444,9 @@ $(function () {
},
//收到表情消息;
onCmdMessage
:
function
(
message
)
{
self
.
receiveData
(
1
,
{
name
:
message
.
ext
.
name
,
name
:
message
.
ext
.
name
||
'--'
,
id
:
message
.
ext
.
id
,
img
:
message
.
ext
.
img
,
img
:
message
.
ext
.
img
||
(
dist
+
"/images/default.jpg"
)
,
from
:
message
.
from
,
type
:
message
.
ext
.
type
,
price
:
message
.
ext
.
price
,
...
...
@@ -467,9 +466,9 @@ $(function () {
options
.
onFileDownloadComplete
=
function
()
{
// 图片下载成功;
self
.
receiveData
(
2
,
{
name
:
message
.
ext
.
name
,
name
:
message
.
ext
.
name
||
'--'
,
id
:
message
.
ext
.
id
,
img
:
message
.
ext
.
img
,
img
:
message
.
ext
.
img
||
(
dist
+
"/images/default.jpg"
)
,
from
:
message
.
from
,
url
:
message
.
url
},
false
)
...
...
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