简化代码

pull/23/head
taoshihan1991 4 years ago
parent 4d0a682665
commit 3d84c239d8

@ -1,5 +0,0 @@
.chatBtn{
position: fixed;
right: 10px;
bottom: 10px;
}

@ -1,54 +0,0 @@
var loadJs=function(url,callback){
var script = document.createElement('script'), fn = callback || function(){};
script.type = 'text/javascript';
if(script.readyState){
script.onreadystatechange = function(){
if( script.readyState == 'loaded' || script.readyState == 'complete' ){
script.onreadystatechange = null;
fn();
}
};
}else{
script.onload = function(){
fn();
};
}
script.src = url;
document.getElementsByTagName('head')[0].appendChild(script);
};
loadJs("https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js",function(){
loadJs("https://cdn.bootcdn.net/ajax/libs/layer/3.1.1/layer.min.js" ,function () {
$(function () {
var goflyKefuId="";
if(typeof GOFLY_KEFU_ID!="undefined"){
var goflyKefuId=GOFLY_KEFU_ID;
}
var div =document.createElement('div');
div.id ='goflyKefu';
div.className +='goflyKefu';
document.body.appendChild(div);
var w =document.getElementById('goflyKefu');
w.innerHTML='<div style="border-radius:5px;position: fixed;right: 10px;bottom: 10px;background: #66b1ff;padding: 10px 30px;color: #fff;cursor: pointer;">在线咨询</div>';
$("#goflyKefu").click(function () {
$("#goflyKefu").hide();
layer.open({
type: 2,
title: '在线咨询',
shadeClose: true,
shade: false,
maxmin: true,
area: ['660px', '600px'],
content: ['http://gofly.sopans.com/chat_page?kefu_id='+goflyKefuId,'no'],
end: function(){
$("#goflyKefu").show();
}
});
});
//END
})
});
});

@ -1,4 +1,3 @@
<!DOCTYPE html>
<html lang="en">
<head>
@ -8,28 +7,9 @@
<title>{{.Title}}</title>
<meta name="keywords" content="{{.Keywords}}" />
<meta name="description" content="{{.Desc}}" />
{{.CssJs}}
</head>
<body>
{{.Content}}
<!--对接客服代码,安装完成后更改成自己的域名或IP下面js文件路径以及GOFLY_URL都要改-->
<script src="/static/js/gofly-front.js?v=1"></script>
<script>
GOFLY.init({
GOFLY_URL:"",
GOFLY_KEFU_ID: "kefu2",
GOFLY_BTN_TEXT: "{{.OnlineChat}}",
GOFLY_LANG:"{{.Lang}}",
GOFLY_AUTO_OPEN:true,
})
</script>
<!--//对接客服代码-->
</body>
</html>

@ -45,15 +45,6 @@ func PageSettingDeploy(c *gin.Context) {
})
}
//前台js部署
func PageWebJs(c *gin.Context) {
c.HTML(http.StatusOK, "chat_web.js", nil)
}
//前台css部署
func PageWebCss(c *gin.Context) {
c.HTML(http.StatusOK, "chat_web.css", nil)
}
func PageKefuList(c *gin.Context) {
c.HTML(http.StatusOK, "setting_kefu_list.html", gin.H{
"tab_index": "3-2",

Loading…
Cancel
Save