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
Hide 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 () {
...
@@ -48,17 +48,16 @@ $(function () {
});
});
},
},
addChatMember
:
function
(
id
)
{
addChatMember
:
function
(
id
)
{
console
.
log
(
id
)
IcController
.
getData
(
apis
.
addrecord
,
'GET'
,
{
// IcController.getData(apis.addrecord, 'GET', {
"token"
:
Util
.
getCookie
(
'token'
)
||
''
,
// "token": Util.getCookie('token') || '',
"user_id"
:
id
// "user_id": id
},
function
(
res
)
{
// }, function (res) {
if
(
res
.
errcode
===
0
)
{
// if (res.errcode === 0) {
//
} else {
}
else
{
//
console.log('添加聊天成员失败')
console
.
log
(
'添加聊天成员失败'
)
//
}
}
//
},false);
},
false
);
},
},
rendChatSection
:
function
(
data
)
{
rendChatSection
:
function
(
data
)
{
console
.
log
(
'获取成员'
)
console
.
log
(
'获取成员'
)
...
@@ -361,7 +360,7 @@ $(function () {
...
@@ -361,7 +360,7 @@ $(function () {
self
.
userHtml
(
0
,
message
,
regContent
)
+
'</div>'
;
self
.
userHtml
(
0
,
message
,
regContent
)
+
'</div>'
;
var
messageStr
=
'<div class="chat_item active" id="'
+
message
.
from
+
'">'
+
var
messageStr
=
'<div class="chat_item active" id="'
+
message
.
from
+
'">'
+
messageSigleStr
+
'</div>'
messageSigleStr
+
'</div>'
$
(
".notice_classify[userid="
+
this
.
defaultName
+
"]"
).
after
(
userStr
);
$
(
".notice_classify[userid="
+
self
.
defaultName
+
"]"
).
after
(
userStr
);
// $('.notice_left_content').append(userStr);
// $('.notice_left_content').append(userStr);
$
(
'.chat_item_content'
).
append
(
messageStr
)
$
(
'.chat_item_content'
).
append
(
messageStr
)
}
else
{
}
else
{
...
@@ -390,8 +389,7 @@ $(function () {
...
@@ -390,8 +389,7 @@ $(function () {
$
(
this
).
html
(
self
.
userHtml
(
num
+
1
,
message
,
regContent
));
$
(
this
).
html
(
self
.
userHtml
(
num
+
1
,
message
,
regContent
));
var
html
=
$
(
this
).
clone
();
var
html
=
$
(
this
).
clone
();
$
(
this
).
remove
();
$
(
this
).
remove
();
$
(
".notice_classify[userid="
+
this
.
defaultName
+
"]"
).
after
(
html
);
$
(
".notice_classify[userid="
+
self
.
defaultName
+
"]"
).
after
(
html
);
if
(
!
firstClick
)
{
if
(
!
firstClick
)
{
$
(
'#'
+
userId
).
find
(
'.notice_item_content'
).
append
(
self
.
messageHtml
(
2
,
$
(
'#'
+
userId
).
find
(
'.notice_item_content'
).
append
(
self
.
messageHtml
(
2
,
htmlStr
,
isTemplate
));
htmlStr
,
isTemplate
));
...
@@ -402,13 +400,14 @@ $(function () {
...
@@ -402,13 +400,14 @@ $(function () {
}
else
{
}
else
{
if
(
index
==
len
-
1
)
{
if
(
index
==
len
-
1
)
{
//新用户
//新用户
console
.
log
(
'新用户'
)
var
userStr
=
'<div class="notice_classify" userid="'
+
var
userStr
=
'<div class="notice_classify" userid="'
+
message
.
from
+
'" newMember="true">'
+
message
.
from
+
'" newMember="true">'
+
self
.
userHtml
(
1
,
message
,
regContent
)
+
'</div>'
;
self
.
userHtml
(
1
,
message
,
regContent
)
+
'</div>'
;
var
messageStr
=
'<div class="chat_item" id="'
+
var
messageStr
=
'<div class="chat_item" id="'
+
message
.
from
+
'">'
+
message
.
from
+
'">'
+
messageSigleStr
+
'</div>'
messageSigleStr
+
'</div>'
;
$
(
".notice_classify[userid="
+
this
.
defaultName
+
"]"
).
after
(
userStr
)
$
(
".notice_classify[userid="
+
self
.
defaultName
+
"]"
).
after
(
userStr
);
$
(
'.chat_item_content'
).
append
(
messageStr
)
$
(
'.chat_item_content'
).
append
(
messageStr
)
}
}
}
}
...
@@ -426,18 +425,18 @@ $(function () {
...
@@ -426,18 +425,18 @@ $(function () {
},
},
onTextMessage
:
function
(
message
)
{
onTextMessage
:
function
(
message
)
{
self
.
receiveData
(
1
,
{
self
.
receiveData
(
1
,
{
name
:
message
.
ext
.
name
,
name
:
message
.
ext
.
name
||
'--'
,
id
:
message
.
ext
.
id
,
id
:
message
.
ext
.
id
,
img
:
message
.
ext
.
img
,
img
:
message
.
ext
.
img
||
(
dist
+
"/images/default.jpg"
)
,
message
:
message
.
data
,
message
:
message
.
data
,
from
:
message
.
from
from
:
message
.
from
},
false
)
},
false
)
},
//收到文本消息;
},
//收到文本消息;
onEmojiMessage
:
function
(
message
)
{
onEmojiMessage
:
function
(
message
)
{
self
.
receiveData
(
3
,
{
self
.
receiveData
(
3
,
{
name
:
message
.
ext
.
name
,
name
:
message
.
ext
.
name
||
'--'
,
id
:
message
.
ext
.
id
,
id
:
message
.
ext
.
id
,
img
:
message
.
ext
.
img
,
img
:
message
.
ext
.
img
||
(
dist
+
"/images/default.jpg"
)
,
message
:
message
.
data
,
message
:
message
.
data
,
from
:
message
.
from
,
from
:
message
.
from
,
},
false
)
},
false
)
...
@@ -445,9 +444,9 @@ $(function () {
...
@@ -445,9 +444,9 @@ $(function () {
},
//收到表情消息;
},
//收到表情消息;
onCmdMessage
:
function
(
message
)
{
onCmdMessage
:
function
(
message
)
{
self
.
receiveData
(
1
,
{
self
.
receiveData
(
1
,
{
name
:
message
.
ext
.
name
,
name
:
message
.
ext
.
name
||
'--'
,
id
:
message
.
ext
.
id
,
id
:
message
.
ext
.
id
,
img
:
message
.
ext
.
img
,
img
:
message
.
ext
.
img
||
(
dist
+
"/images/default.jpg"
)
,
from
:
message
.
from
,
from
:
message
.
from
,
type
:
message
.
ext
.
type
,
type
:
message
.
ext
.
type
,
price
:
message
.
ext
.
price
,
price
:
message
.
ext
.
price
,
...
@@ -467,9 +466,9 @@ $(function () {
...
@@ -467,9 +466,9 @@ $(function () {
options
.
onFileDownloadComplete
=
function
()
{
options
.
onFileDownloadComplete
=
function
()
{
// 图片下载成功;
// 图片下载成功;
self
.
receiveData
(
2
,
{
self
.
receiveData
(
2
,
{
name
:
message
.
ext
.
name
,
name
:
message
.
ext
.
name
||
'--'
,
id
:
message
.
ext
.
id
,
id
:
message
.
ext
.
id
,
img
:
message
.
ext
.
img
,
img
:
message
.
ext
.
img
||
(
dist
+
"/images/default.jpg"
)
,
from
:
message
.
from
,
from
:
message
.
from
,
url
:
message
.
url
url
:
message
.
url
},
false
)
},
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