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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
7 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,8 +233,9 @@ $(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
true
return
false
}
else
{
return
true
}
},
curentTime
:
function
()
{
...
...
@@ -505,7 +510,10 @@ $(function () {
touserid
:
message
.
ext
.
touserid
},
false
);
if
(
self
.
customerNum
==
self
.
defaultName
)
{
self
.
addChatMember
(
message
.
ext
.
id
)
var
index
=
self
.
chatList
.
indexOf
(
message
.
from
);
if
(
index
==
-
1
)
{
self
.
addChatMember
(
message
.
ext
.
id
)
}
}
},
//收到文本消息;
onEmojiMessage
:
function
(
message
)
{
...
...
@@ -518,7 +526,10 @@ $(function () {
touserid
:
message
.
ext
.
touserid
},
false
);
if
(
self
.
customerNum
==
self
.
defaultName
)
{
self
.
addChatMember
(
message
.
ext
.
id
)
var
index
=
self
.
chatList
.
indexOf
(
message
.
from
);
if
(
index
==
-
1
)
{
self
.
addChatMember
(
message
.
ext
.
id
)
}
}
},
//收到表情消息;
...
...
@@ -555,7 +566,10 @@ $(function () {
touserid
:
message
.
ext
.
touserid
},
false
);
if
(
self
.
customerNum
==
self
.
defaultName
)
{
self
.
addChatMember
(
message
.
ext
.
id
)
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