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
ed85262c
authored
Aug 22, 2019
by
施宇
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1111
parent
7ab8c457
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
dist/js/chat/index.js
dist/js/chat/index.js
View file @
ed85262c
...
...
@@ -8,16 +8,17 @@ $(function () {
templateObj
:
JSON
.
parse
(
Util
.
getCookie
(
'template'
)
||
"{}"
),
customerText
:
Util
.
getCookie
(
'customer'
)
||
""
,
isLoginSuccess
:
false
,
chatList
:
[],
img
:
""
,
name
:
""
,
id
:
""
,
init
:
function
()
{
if
(
this
.
ieFun
())
{
if
(
this
.
ieFun
())
{
this
.
getUserInfo
();
this
.
connection
();
this
.
connListen
();
this
.
bindFunction
();
}
else
{
}
else
{
layer
.
open
({
title
:
'提示'
,
content
:
'浏览器不兼容聊天系统,建议使用其他浏览器!'
...
...
@@ -57,6 +58,9 @@ $(function () {
if
(
res
.
errcode
===
0
)
{
self
.
rendChatSection
(
res
.
data
);
self
.
login
(
name
,
password
);
for
(
var
i
=
0
;
i
<
res
.
data
.
length
;
i
++
)
{
self
.
chatList
.
push
(
res
.
data
[
i
].
im_username
)
}
}
else
{
layer
.
msg
(
'获取历史纪录失败'
);
self
.
deleteCookie
()
...
...
@@ -229,7 +233,8 @@ $(function () {
},
ieFun
:
function
()
{
if
(
navigator
.
appName
==
"Microsoft Internet Explorer"
&&
(
navigator
.
appVersion
.
split
(
";"
)[
1
].
replace
(
/
[
]
/g
,
""
)
==
"MSIE8.0"
||
navigator
.
appVersion
.
split
(
";"
)[
1
].
replace
(
/
[
]
/g
,
""
)
==
"MSIE9.0"
))
{
return
false
}
else
{
return
false
}
else
{
return
true
}
},
...
...
@@ -505,8 +510,11 @@ $(function () {
touserid
:
message
.
ext
.
touserid
},
false
);
if
(
self
.
customerNum
==
self
.
defaultName
)
{
var
index
=
self
.
chatList
.
indexOf
(
message
.
from
);
if
(
index
==
-
1
)
{
self
.
addChatMember
(
message
.
ext
.
id
)
}
}
},
//收到文本消息;
onEmojiMessage
:
function
(
message
)
{
self
.
receiveData
(
3
,
{
...
...
@@ -518,8 +526,11 @@ $(function () {
touserid
:
message
.
ext
.
touserid
},
false
);
if
(
self
.
customerNum
==
self
.
defaultName
)
{
var
index
=
self
.
chatList
.
indexOf
(
message
.
from
);
if
(
index
==
-
1
)
{
self
.
addChatMember
(
message
.
ext
.
id
)
}
}
},
//收到表情消息;
onCmdMessage
:
function
(
message
)
{
...
...
@@ -555,8 +566,11 @@ $(function () {
touserid
:
message
.
ext
.
touserid
},
false
);
if
(
self
.
customerNum
==
self
.
defaultName
)
{
var
index
=
self
.
chatList
.
indexOf
(
message
.
from
);
if
(
index
==
-
1
)
{
self
.
addChatMember
(
message
.
ext
.
id
)
}
}
};
options
.
onFileDownloadError
=
function
()
{
// 图片下载失败
...
...
@@ -704,7 +718,10 @@ $(function () {
action
:
"template"
,
ext
:
params
,
success
:
function
()
{
var
index
=
self
.
chatList
.
indexOf
(
userId
);
if
(
index
==
-
1
)
{
self
.
addChatMember
(
templateObj
.
targetId
);
}
$
(
'#'
+
userId
).
find
(
'.notice_item_content'
).
append
(
self
.
messageHtml
(
1
,
params
,
true
));
var
imgLen
=
$
(
'#'
+
userId
).
find
(
'img'
).
length
;
...
...
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