精简封装部分代码

master
taoshihan 1 year ago
parent ff311a11c1
commit 08b00b42d8

@ -185,6 +185,7 @@ location /
#PROXY-END/
```
### 如果在登录到后台后,出现了需要认证的弹窗,请前往官网注册账户并绑定手机。填入绑定的手机+自己的密码可以通过认证。如果没有中国手机号,请在官网联系我获取测试手机号和密码
### 版权声明

@ -128,7 +128,7 @@ server{
}
```
#### GOFLY is a live chat system for customer support service that is implemented using the Golang programming language and MySQL database. It is designed to allow businesses to communicate with their customers in real-time through a web-based platform. GOFLY provides a range of features and tools to help businesses manage customer inquiries and interactions, including support for multiple channels (e.g. chat, email, phone), customizable templates for responses, and the ability to track and analyze customer conversations.
#### If you encounter a pop-up window requiring authentication after logging into the backend, please go to the official website to register an account and bind your phone. Entering your bound phone number + your own password will allow you to pass the authentication. If you do not have a Chinese phone number, please contact me on the official website to obtain a test phone number and password.
### Copyright

@ -198,7 +198,7 @@
white-space: nowrap;
color: #999;
text-align: left;
margin-top: -15px;
margin: -5px 0px 3px 0px;
}
.chatMainPage{
margin-top: 1px;
@ -220,6 +220,9 @@
border-radius: 0px 8px 8px 8px;
padding: 10px 15px;
}
.chatBoxMe{
margin-top: 10px;
}
.chatBoxMe .chatContent2 {
border-radius: 8px 0px 8px 8px;
background-color: rgb(0, 145, 255);

@ -175,21 +175,6 @@ new Vue({
});
},
//正在输入
inputNextText:function(){
if(this.socketClosed||!this.socket){
return;
}
//console.log(this.messageContent);
var message = {}
message.type = "inputing";
message.data = {
from : this.visitor.visitor_id,
to : this.visitor.to_id,
content:this.messageContent
};
this.socket.send(JSON.stringify(message));
},
OnClose:function() {
console.log("ws:onclose");
this.focusSendConn=true;
@ -547,24 +532,10 @@ new Vue({
},
//提示音
alertSound:function(){
var b = document.getElementById("chatMessageAudio");
if (b.canPlayType('audio/ogg; codecs="vorbis"')) {
b.type= 'audio/mpeg';
b.src= '/static/images/alert2.ogg';
var p = b.play();
p && p.then(function () {
}).catch(function (e) {
});
}
alertSound("chatMessageAudio",'/static/images/alert2.ogg');
},
sendSound:function(){
var b = document.getElementById("chatMessageSendAudio");
if (b.canPlayType('audio/ogg; codecs="vorbis"')) {
b.type= 'audio/mpeg';
b.src= '/static/images/sent.ogg';
var p = b.play();
p && p.then(function(){}).catch(function(e){});
}
alertSound("chatMessageSendAudio",'/static/images/sent.ogg');
},
sendAjax:function(url,method,params,callback){
let _this=this;

@ -154,4 +154,13 @@ function utf8ToB64(str) {
function b64ToUtf8(str) {
return decodeURIComponent(escape(window.atob(str)));
}
//播放声音
function alertSound(id,src){
var b = document.getElementById(id);
if(src!=""){
b.src=src;
}
var p = b.play();
p && p.then(function(){}).catch(function(e){});
}
;

@ -73,7 +73,7 @@
</ul>
<div class="clear"></div>
</div>
<el-input show-word-limit maxlength="100" :rows="2" type="textarea" resize="none" class="visitorEditorArea" @focus="scrollBottom;showIconBtns=false" @blur="scrollBottom;showIconBtns=false" v-model="messageContent" @keyup.native="inputNextText" v-on:keyup.enter.native="chatToUser">
<el-input show-word-limit maxlength="100" :rows="2" type="textarea" resize="none" class="visitorEditorArea" @focus="scrollBottom;showIconBtns=false" @blur="scrollBottom;showIconBtns=false" v-model="messageContent" v-on:keyup.enter.native="chatToUser">
</el-input>
<el-button type="primary" size="mini" class="visitorEditorBtn" :disabled="sendDisabled||messageContent==''" v-on:click="chatToUser();showIconBtns=false"><{flyLang.sent}></el-button>
</div>
@ -87,10 +87,8 @@
<!--//客服代码-->
<audio id="chatMessageAudio">
<source id="chatMessageAudioSource" />
</audio>
<audio id="chatMessageSendAudio">
<source id="chatMessageSendAudioSource" />
</audio>
</template>
</div>

Loading…
Cancel
Save