自动提示

pull/23/head
陶士涵 5 years ago
parent 8c981daf68
commit 4981077643

@ -17,6 +17,7 @@
box-shadow: 0 3px 15px 0 rgba(0,0,0,.25)!important; box-shadow: 0 3px 15px 0 rgba(0,0,0,.25)!important;
position: absolute; position: absolute;
bottom: 60px; bottom: 60px;
right: 0;
color: #222; color: #222;
line-height: 1.5; line-height: 1.5;
font-size: 14px; font-size: 14px;

@ -45,7 +45,7 @@
<div class="folderBtn visitorFolderBtn" id="uploadFile" v-on:click="uploadFile('/uploadfile')"></div> <div class="folderBtn visitorFolderBtn" id="uploadFile" v-on:click="uploadFile('/uploadfile')"></div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<el-input type="textarea" class="chatArea" v-model="messageContent" @keyup.native="inputNextText" v-on:keyup.enter.native="chatToUser" placeholder="请输入内容"></el-input> <el-input type="textarea" class="chatArea" v-model="messageContent" @keyup.native="inputNextText" v-on:keyup.enter.native="chatToUser" :placeholder="flyLang.textarea"></el-input>
<div class="faceBox visitorFaceBox"> <div class="faceBox visitorFaceBox">
<ul class="faceBoxList"> <ul class="faceBoxList">
<li v-on:click="faceIconClick(i)" class="faceIcon" v-for="(v,i) in face" :title="v.name"><img :src=v.path></li> <li v-on:click="faceIconClick(i)" class="faceIcon" v-for="(v,i) in face" :title="v.name"><img :src=v.path></li>
@ -56,7 +56,7 @@
<el-button :disabled="sendDisabled||messageContent==''" type="primary" class="chatBoxSendBtn" size="small" v-on:click="chatToUser"><{flyLang.sent}></el-button> <el-button :disabled="sendDisabled||messageContent==''" type="primary" class="chatBoxSendBtn" size="small" v-on:click="chatToUser"><{flyLang.sent}></el-button>
</div> </div>
<div class="footContact clear"> <div class="footContact clear">
<a href="https://github.com/taoshihan1991/go-fly" target="_blank">GO-FLY1.0.0客服陶士涵提供技术支持</a> <a href="https://github.com/taoshihan1991/go-fly" target="_blank"><{flyLang.copyright}></a>
</div> </div>
</div> </div>
<!--//客服代码--> <!--//客服代码-->

@ -24,7 +24,8 @@
GOFLY.init({ GOFLY.init({
GOFLY_URL:"", GOFLY_URL:"",
GOFLY_KEFU_ID: "kefu2", GOFLY_KEFU_ID: "kefu2",
GOFLY_BTN_TEXT: "{{.OnlineChat}}" GOFLY_BTN_TEXT: "{{.OnlineChat}}",
GOFLY_LANG:"{{.Lang}}"
}) })
</script> </script>
<!--//对接客服代码--> <!--//对接客服代码-->

@ -5,12 +5,16 @@ var GOFLY_LANG={
"connectok":"连接成功!", "connectok":"连接成功!",
"chating":"正在与您沟通!", "chating":"正在与您沟通!",
"historymes":"—— 以上是历史消息 ——", "historymes":"—— 以上是历史消息 ——",
"copyright":"GO-FLY1.0.0客服陶士涵提供技术支持",
"textarea":"请输入内容",
}, },
"en":{ "en":{
"sent":"sent", "sent":"Send",
"connecting":"connecting...", "connecting":"connecting...",
"connectok":"connection succeeded!", "connectok":"connection succeeded!",
"chating":"chating with you!", "chating":"chating with you!",
"historymes":"—— above is old messages ——", "historymes":"—— Today ——",
"copyright":"We run on GOFLY",
"textarea":"Enter your message",
}, },
}; };

@ -2,26 +2,40 @@ var GOFLY={
GOFLY_URL:"https://gofly.sopans.com", GOFLY_URL:"https://gofly.sopans.com",
GOFLY_KEFU_ID:"", GOFLY_KEFU_ID:"",
GOFLY_BTN_TEXT:"Chat with me", GOFLY_BTN_TEXT:"Chat with me",
GOFLY_LANG:"en",
}; };
GOFLY.launchButtonFlag=false; GOFLY.launchButtonFlag=false;
GOFLY.titleTimer=0; GOFLY.titleTimer=0;
GOFLY.titleNum=0; GOFLY.titleNum=0;
GOFLY.noticeTimer=null;
GOFLY.originTitle=document.title; GOFLY.originTitle=document.title;
GOFLY.init=function(config){ GOFLY.init=function(config){
var _this=this;
if(typeof config=="undefined"){ if(typeof config=="undefined"){
return; return;
} }
if (typeof config.GOFLY_URL!="undefined"){ if (typeof config.GOFLY_URL!="undefined"){
this.GOFLY_URL=config.GOFLY_URL; this.GOFLY_URL=config.GOFLY_URL;
} }
this.dynamicLoadCss(this.GOFLY_URL+"/static/css/gofly-front.css?v=1");
if (typeof config.GOFLY_KEFU_ID!="undefined"){ if (typeof config.GOFLY_KEFU_ID!="undefined"){
this.GOFLY_KEFU_ID=config.GOFLY_KEFU_ID; this.GOFLY_KEFU_ID=config.GOFLY_KEFU_ID;
} }
if (typeof config.GOFLY_BTN_TEXT!="undefined"){ if (typeof config.GOFLY_BTN_TEXT!="undefined"){
this.GOFLY_BTN_TEXT=config.GOFLY_BTN_TEXT; this.GOFLY_BTN_TEXT=config.GOFLY_BTN_TEXT;
} }
this.dynamicLoadCss(this.GOFLY_URL+"/static/css/gofly-front.css?v=1");
var _this=this; this.dynamicLoadJs(this.GOFLY_URL+"/static/js/functions.js?v=1",function(){
_this.GOFLY_LANG=checkLang();
if (typeof config.GOFLY_LANG!="undefined"){
this.GOFLY_LANG=config.GOFLY_LANG;
}else{
this.GOFLY_LANG=config.GOFLY_LANG;
}
});
if (typeof $!="function"){ if (typeof $!="function"){
this.dynamicLoadJs("https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js",function () { this.dynamicLoadJs("https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js",function () {
_this.dynamicLoadJs("https://cdn.bootcdn.net/ajax/libs/layer/3.1.1/layer.min.js",function () { _this.dynamicLoadJs("https://cdn.bootcdn.net/ajax/libs/layer/3.1.1/layer.min.js",function () {
@ -83,9 +97,31 @@ GOFLY.clickBtn=function (){
_this.showKefu(); _this.showKefu();
}); });
setTimeout(function(){ setTimeout(function(){
$("#launchButtonNotice").show(); // $("#launchButtonNotice").show();
$("#launchIcon").show(); // $("#launchIcon").show();
},4000); _this.getNotice();
},3000);
}
GOFLY.getNotice=function(){
$.get("/notice?kefu_id="+this.GOFLY_KEFU_ID,function(res) {
//debugger;
if (res.result != null) {
var msg = res.result;
var len=msg.length;
var i=0;
if(len>0){
if(typeof msg[0]=="undefined"||msg[0]==null){
return;
}
var content = msg[0];
if(typeof content.content =="undefined"){
return;
}
$("#launchButtonNotice").html(replaceContent(content.content)).show();
}
}
});
} }
GOFLY.isIE=function(){ GOFLY.isIE=function(){
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串 var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
@ -142,7 +178,7 @@ GOFLY.layerOpen=function (){
area: ['520px', '530px'], area: ['520px', '530px'],
offset: 'rb', //右下角弹出 offset: 'rb', //右下角弹出
anim: 2, anim: 2,
content: [this.GOFLY_URL+'/chatIndex?kefu_id='+this.GOFLY_KEFU_ID+'&refer='+window.document.title, 'yes'], //iframe的urlno代表不显示滚动条 content: [this.GOFLY_URL+'/chatIndex?kefu_id='+this.GOFLY_KEFU_ID+'&lang='+this.GOFLY_LANG+'&refer='+window.document.title, 'yes'], //iframe的urlno代表不显示滚动条
end: function(){ end: function(){
_this.launchButtonFlag=false; _this.launchButtonFlag=false;
$(".launchButtonBox").show(); $(".launchButtonBox").show();
@ -150,7 +186,7 @@ GOFLY.layerOpen=function (){
}); });
} }
GOFLY.windowOpen=function (){ GOFLY.windowOpen=function (){
window.open(this.GOFLY_URL+'/chatIndex?kefu_id='+this.GOFLY_KEFU_ID+'&refer='+window.document.title); window.open(this.GOFLY_URL+'/chatIndex?kefu_id='+this.GOFLY_KEFU_ID+'&lang='+this.GOFLY_LANG+'&refer='+window.document.title);
} }
GOFLY.flashTitle=function () { GOFLY.flashTitle=function () {
this.titleNum++; this.titleNum++;

Loading…
Cancel
Save