Commit 261cf160 by libai

测试

parent a9518c61
Showing with 26 additions and 6 deletions
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment