Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
libai
/
guodong
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
261cf160
authored
Mar 09, 2021
by
libai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试
parent
a9518c61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
gzh/customer/index.html
gzh/customer/index.html
View file @
261cf160
...
...
@@ -15,6 +15,9 @@
margin
:
0
;
padding
:
0
;
}
input
[
type
=
"button"
],
button
{
-webkit-appearance
:
none
;
}
.cs-box
{
width
:
100%
;
height
:
100%
;
...
...
@@ -183,6 +186,18 @@
-webkit-transform
:
translate
(
0
,
-50%
);
transform
:
translate
(
0
,
-50%
);
}
.copyright
{
width
:
100%
;
height
:
1rem
;
line-height
:
1rem
;
background-color
:
gainsboro
;
flex
:
0
0
auto
;
display
:
flex
;
position
:
relative
;
text-align
:
center
;
font-size
:
10px
;
color
:
#353535
;
}
.system
{
text-align
:
center
;
color
:
gray
;
...
...
@@ -246,6 +261,9 @@
</div>
<div
class=
"tips"
id=
"tips"
hidden=
"hidden"
>
测试
</div>
</div>
<div
class=
"copyright"
>
</div>
<input
type=
"text"
hidden=
"hidden"
id=
"guestid"
>
</div>
<script>
...
...
@@ -266,7 +284,7 @@
if
(
null
==
guestid
||
guestid
==
''
){
//连接客服
system
(
'正在转接客服,请稍等'
);
connect
();
connect
(
false
);
}
});
}
...
...
@@ -285,13 +303,13 @@
if
(
null
==
guestid
||
guestid
==
''
){
//连接客服
system
(
'正在转接客服,请稍等'
);
connect
();
connect
(
true
);
}
else
{
send
(
content
,
2001
)
}
}
function
connect
(){
function
connect
(
send
){
var
guestid
=
getCookie
(
'cs-guestid'
);
$
.
ajax
({
url
:
server
+
"/guest/service"
,
...
...
@@ -317,7 +335,7 @@
if
(
data
.
more
){
$
(
"#cs-chat"
).
prepend
(
'
<
div
class
=
"funbtn"
onclick
=
"more()"
>
更早的聊天
<
/div>'
)
;
}
WebSocketStart
(
guestid
);
WebSocketStart
(
guestid
,
send
);
}
else
{
system
(
"连接失败("
+
data
.
code
+
")"
);
}
...
...
@@ -422,7 +440,7 @@
}
function WebSocketStart(guestid) {
function WebSocketStart(guestid
,send
) {
state("连接中");
if(ws!=null&&ws.readyState == WebSocket.OPEN){
system("The socket is opening,please close first!");
...
...
@@ -442,7 +460,9 @@
{
state("连接成功");
system("客服已接入");
sendmsg();
if(send){
sendmsg();
}
checkTimer=setInterval("check()",60000);
};
ws.onmessage = function (evt)
...
...
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