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
6873067c
authored
Jul 26, 2019
by
施宇
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
321
parent
5c4278ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
dist/js/chat/index.js
dist/js/chat/index.js
View file @
6873067c
...
...
@@ -89,8 +89,12 @@ $(function () {
},
customerChat
:
function
()
{
Util
.
delCookie
(
'customer'
,
cookieHostname
);
$
(
".notice_classify[userid="
+
this
.
defaultName
+
"]"
).
attr
(
'isCustomer'
,
true
);
if
(
Util
.
getCookie
(
'customer'
))
{
Util
.
delCookie
(
'customer'
,
cookieHostname
);
$
(
".notice_classify[userid="
+
this
.
defaultName
+
"]"
).
attr
(
'isCustomer'
,
true
);
}
},
addUser
:
function
(
obj
,
isDefault
,
isFirst
)
{
...
...
@@ -371,7 +375,7 @@ $(function () {
if
(
!
len
)
{
//新用户
Util
.
delCookie
(
'templateBoolean'
,
cookieHostname
);
Util
.
delCookie
(
'templateBoolean'
,
cookieHostname
);
var
userStr
=
'<div class="notice_classify active" userid="'
+
message
.
from
+
'" firstClick="true" newMember="true" touserid='
+
message
.
touserid
+
'>'
+
self
.
userHtml
(
0
,
message
,
regContent
)
+
'</div>'
;
var
messageStr
=
'<div class="chat_item active" id="'
+
message
.
from
+
'">'
+
...
...
@@ -414,7 +418,7 @@ $(function () {
}
else
{
//非当前用户
Util
.
delCookie
(
'templateBoolean'
,
cookieHostname
);
Util
.
delCookie
(
'templateBoolean'
,
cookieHostname
);
var
num
=
Number
(
$
(
this
).
find
(
'.num'
).
text
());
$
(
this
).
html
(
self
.
userHtml
(
num
+
1
,
message
,
regContent
));
var
html
=
$
(
this
).
clone
();
...
...
@@ -430,7 +434,7 @@ $(function () {
}
else
{
if
(
index
==
len
-
1
)
{
//新用户
Util
.
delCookie
(
'templateBoolean'
,
cookieHostname
);
Util
.
delCookie
(
'templateBoolean'
,
cookieHostname
);
var
userStr
=
'<div class="notice_classify" userid="'
+
message
.
from
+
'" newMember="true" touserid='
+
message
.
touserid
+
'>'
+
self
.
userHtml
(
1
,
message
,
regContent
)
+
'</div>'
;
...
...
@@ -451,7 +455,7 @@ $(function () {
onOpened
:
function
(
message
)
{
console
.
log
(
'登入成功'
)
self
.
isLoginSuccess
=
true
;
self
.
customerChat
()
self
.
customerChat
()
;
self
.
singleChat
();
},
onTextMessage
:
function
(
message
)
{
...
...
@@ -601,6 +605,7 @@ $(function () {
layer
.
msg
(
'消息发送失败'
);
}
});
// console.log(msg.body)
this
.
conn
.
send
(
msg
.
body
);
},
sendCmd
:
function
(
templateObj
)
{
...
...
@@ -772,6 +777,7 @@ $(function () {
layer
.
msg
(
'聊天系统出错'
);
return
;
}
return
;
}
if
(
isTemplate
)
{
$
(
this
).
removeAttr
(
'isTemplate'
);
...
...
@@ -794,7 +800,8 @@ $(function () {
if
(
firstClick
)
{
$
(
this
).
removeAttr
(
'firstClick'
);
if
(
self
.
isLoginSuccess
)
{
//登入成功 获取聊天记录
self
.
getHistoryData
(
id
)
self
.
getHistoryData
(
id
);
}
else
{
layer
.
msg
(
'聊天系统出错'
);
return
;
...
...
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