关闭时只隐藏访客端

pull/23/head
taoshihan1991 4 years ago
parent 3eba7d985d
commit 7371f2c305

@ -19,10 +19,10 @@
<!--对接客服代码,安装完成后更改成自己的域名或IP下面js文件路径以及GOFLY_URL都要改--> <!--对接客服代码,安装完成后更改成自己的域名或IP下面js文件路径以及GOFLY_URL都要改-->
<script src="https://gofly.sopans.com/static/js/gofly-front.js?v=1"></script> <script src="/static/js/gofly-front.js?v=1"></script>
<script> <script>
GOFLY.init({ GOFLY.init({
GOFLY_URL:"https://gofly.sopans.com", GOFLY_URL:"",
GOFLY_KEFU_ID: "kefu2", GOFLY_KEFU_ID: "kefu2",
GOFLY_BTN_TEXT: "{{.OnlineChat}}", GOFLY_BTN_TEXT: "{{.OnlineChat}}",
GOFLY_LANG:"{{.Lang}}", GOFLY_LANG:"{{.Lang}}",

@ -60,6 +60,8 @@ GOFLY.init=function(config){
var msg=e.data; var msg=e.data;
if(msg.type=="message"){ if(msg.type=="message"){
_this.flashTitle();//标题闪烁 _this.flashTitle();//标题闪烁
$("#launchNoticeContent").html(replaceContent(msg.data.content,_this.GOFLY_URL));
$("#launchButtonNotice").show();
} }
}); });
window.onfocus = function () { window.onfocus = function () {
@ -131,7 +133,7 @@ GOFLY.getNotice=function(){
var welcomeHtml="<div class='flyUser'><img class='flyAvatar' src='"+_this.GOFLY_URL+res.result.avatar+"'/> <span class='flyUsername'>"+res.result.username+"</span>" + var welcomeHtml="<div class='flyUser'><img class='flyAvatar' src='"+_this.GOFLY_URL+res.result.avatar+"'/> <span class='flyUsername'>"+res.result.username+"</span>" +
"<span id='launchNoticeClose' class='flyClose'>×</span>" + "<span id='launchNoticeClose' class='flyClose'>×</span>" +
"</div>"; "</div>";
welcomeHtml+="<div>"+replaceContent(content.content,_this.GOFLY_URL)+"</div>"; welcomeHtml+="<div id='launchNoticeContent'>"+replaceContent(content.content,_this.GOFLY_URL)+"</div>";
$("#launchButtonNotice").html(welcomeHtml).show(); $("#launchButtonNotice").html(welcomeHtml).show();
i++; i++;
$("#launchIcon").text(i).show(); $("#launchIcon").text(i).show();
@ -187,6 +189,10 @@ GOFLY.showKefu=function (){
} }
GOFLY.layerOpen=function (){ GOFLY.layerOpen=function (){
if (this.launchButtonFlag) return; if (this.launchButtonFlag) return;
if($("#layui-layer1").css("display")=="none"){
$("#layui-layer1").show();
return;
}
var _this=this; var _this=this;
layer.open({ layer.open({
type: 2, type: 2,
@ -200,6 +206,12 @@ GOFLY.layerOpen=function (){
end: function(){ end: function(){
_this.launchButtonFlag=false; _this.launchButtonFlag=false;
$(".launchButtonBox").show(); $(".launchButtonBox").show();
},
cancel: function(index, layero){
$("#layui-layer1").hide();
_this.launchButtonFlag=false;
$(".launchButtonBox").show();
return false;
} }
}); });
} }

Loading…
Cancel
Save