防止多次发送

pull/23/head
陶士涵 4 years ago
parent 12fc64d1ff
commit 5e0e102a71

@ -136,7 +136,7 @@
</div>
<div class="faceBtn"></div>
<div class="imageBtn" id="uploadImg" v-on:click="uploadImg('/uploadimg')"></div>
<el-button size="small" class="floatRight" type="primary" v-on:click="chatToUser">发送</el-button>
<el-button :disabled="sendDisabled" size="small" class="floatRight" type="primary" v-on:click="chatToUser">发送</el-button>
</div>
<div class="clear"></div>
<el-input type="textarea" class="chatArea" v-model="messageContent" v-on:keyup.enter.native="chatToUser"></el-input>
@ -287,5 +287,5 @@
</template>
</div>
</body>
<script src="/static/js/chat-main.js?v=0.3.8"></script>
<script src="/static/js/chat-main.js?v=0.3.9"></script>
</html>

@ -58,7 +58,7 @@
<div class="clear"></div>
</div>
<div class="btnArea">
<el-button type="primary" class="chatBoxSendBtn" size="small" v-on:click="chatToUser">{{.SendBtn}}</el-button>
<el-button :disabled="sendDisabled" type="primary" class="chatBoxSendBtn" size="small" v-on:click="chatToUser">{{.SendBtn}}</el-button>
</div>
<div class="footContact clear">
<a href="https://github.com/taoshihan1991/go-fly" target="_blank">GO-FLY0.2.2客服陶士涵提供技术支持</a>
@ -79,5 +79,5 @@
var KEFU_ID='{{.KEFU_ID}}';
var REFER='{{.Refer}}';
</script>
<script src="/static/js/chat-page.js?v=0.3.7"></script>
<script src="/static/js/chat-page.js?v=0.3.8"></script>
</html>

@ -44,6 +44,7 @@ var app=new Vue({
replys:[],
replyContent:"",
ipBlacks:[],
sendDisabled:false,
},
methods: {
//跳转
@ -191,6 +192,7 @@ var app=new Vue({
if(this.messageContent==""||this.messageContent=="\r\n"||this.currentGuest==""){
return;
}
this.sendDisabled=true;
let _this=this;
let mes = {};
mes.type = "kefu";
@ -216,6 +218,7 @@ var app=new Vue({
// content.is_kefu = true;
// content.time = '';
// this.msgList.push(content);
_this.sendDisabled=false;
this.scrollBottom();
},
//处理当前在线用户列表

@ -15,6 +15,7 @@ new Vue({
showKfonline:false,
socketClosed:false,
timer:null,
sendDisabled:false,
},
methods: {
//初始化websocket
@ -102,6 +103,7 @@ new Vue({
});
return;
}
this.sendDisabled=true;
let _this=this;
let mes = {};
mes.type = "visitor";
@ -130,6 +132,7 @@ new Vue({
_this.messageContent = "";
clearInterval(_this.timer);
_this.sendSound();
_this.sendDisabled=false;
});
},

Loading…
Cancel
Save