|
|
|
@ -6,13 +6,13 @@
|
|
|
|
|
<meta name="author" content="陶士涵">
|
|
|
|
|
<title>GO-FLY咨询页</title>
|
|
|
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/theme-chalk/index.css">
|
|
|
|
|
<script src="/static/js/functions.js"></script>
|
|
|
|
|
<script src="/static/js/functions.js?v=0.1.1"></script>
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/index.js"></script>
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
|
|
|
|
|
<!-- Bootstrap core CSS -->
|
|
|
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
|
|
|
|
<link rel="stylesheet" href="/static/css/common.css" />
|
|
|
|
|
<link rel="stylesheet" href="/static/css/common.css?v=0.1.1" />
|
|
|
|
|
<style>
|
|
|
|
|
html,
|
|
|
|
|
body {
|
|
|
|
@ -25,7 +25,7 @@
|
|
|
|
|
width: 100%;
|
|
|
|
|
text-align: left;
|
|
|
|
|
position: relative;
|
|
|
|
|
margin-bottom: 69px;
|
|
|
|
|
margin-bottom: 86px;
|
|
|
|
|
}
|
|
|
|
|
.chatBox{
|
|
|
|
|
/*max-height: 600px;*/
|
|
|
|
@ -72,16 +72,16 @@
|
|
|
|
|
.chatBoxMe .el-col-3{float: right;text-align: right;}
|
|
|
|
|
.chatBoxMe .chatUser{text-align: right}
|
|
|
|
|
.chatBoxMe .chatContent:after{left:auto;right: -10px;}
|
|
|
|
|
.chatArea{float: left;width: 79%;margin: 4px 0 0 4px;}
|
|
|
|
|
.btnArea{width: 20%;float: right;}
|
|
|
|
|
.chatArea{float: left;width: 89%;margin: 4px 0 0 4px;}
|
|
|
|
|
.btnArea{width: 10%;float: right;}
|
|
|
|
|
@media screen and (max-width: 500px) {
|
|
|
|
|
body{background: #fff}
|
|
|
|
|
.chatArea {width: 66%;}
|
|
|
|
|
.btnArea{width: 32%;}
|
|
|
|
|
.chatArea {width: 70%;}
|
|
|
|
|
.btnArea{width: 20%;}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chatTitle{height: 30px;line-height: 30px;color: #1989fa}
|
|
|
|
|
.chatBoxSend{background: #f5f5f5;position: fixed;bottom: 0;width: 100%;height: 67px;max-width: 800px;}
|
|
|
|
|
.chatBoxSend{background: #f5f5f5;position: fixed;bottom: 0;width: 100%;height: 86px;max-width: 800px;}
|
|
|
|
|
.chatBoxSendBtn{float: right;margin: 12px 4px 0 0;}
|
|
|
|
|
.chatTime{text-align: center;color: #bbb;margin: 5px 0;font-size: 12px;}
|
|
|
|
|
.chatTimeHide{display: none;}
|
|
|
|
@ -118,6 +118,11 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="chatBoxSend">
|
|
|
|
|
<div class="iconBtns">
|
|
|
|
|
<div class="faceBtn visitorFaceBtn"></div>
|
|
|
|
|
<div class="imageBtn visitorImageBtn" id="uploadImg" v-on:click="uploadImg('/uploadimg')"></div>
|
|
|
|
|
<div class="clear"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<el-input type="textarea" class="chatArea" v-model="messageContent" v-on:keyup.enter.native="chatToUser"></el-input>
|
|
|
|
|
<div class="faceBox visitorFaceBox">
|
|
|
|
|
<ul class="faceBoxList">
|
|
|
|
@ -127,8 +132,6 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="btnArea">
|
|
|
|
|
<el-button type="primary" class="chatBoxSendBtn" size="small" v-on:click="chatToUser">{{.SendBtn}}</el-button>
|
|
|
|
|
<div class="faceBtn visitorFaceBtn"></div>
|
|
|
|
|
<div class="clear"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="clear"></div>
|
|
|
|
|
</div>
|
|
|
|
@ -436,6 +439,40 @@
|
|
|
|
|
$('.faceBox').hide();
|
|
|
|
|
this.messageContent+="face"+this.face[index].name;
|
|
|
|
|
},
|
|
|
|
|
//上传图片
|
|
|
|
|
uploadImg (url){
|
|
|
|
|
let _this=this;
|
|
|
|
|
$('#uploadImg').after('<input type="file" id="uploadImgFile" name="file" style="display:none" >');
|
|
|
|
|
$("#uploadImgFile").click();
|
|
|
|
|
$("#uploadImgFile").change(function (e) {
|
|
|
|
|
var formData = new FormData();
|
|
|
|
|
var file = $("#uploadImgFile")[0].files[0];
|
|
|
|
|
formData.append("imgfile",file); //传给后台的file的key值是可以自己定义的
|
|
|
|
|
filter(file) && $.ajax({
|
|
|
|
|
url: url || '',
|
|
|
|
|
type: "post",
|
|
|
|
|
data: formData,
|
|
|
|
|
contentType: false,
|
|
|
|
|
processData: false,
|
|
|
|
|
dataType: 'JSON',
|
|
|
|
|
mimeType: "multipart/form-data",
|
|
|
|
|
success: function (res) {
|
|
|
|
|
if(res.code!=200){
|
|
|
|
|
_this.$message({
|
|
|
|
|
message: res.msg,
|
|
|
|
|
type: 'error'
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
_this.messageContent+='img[/' + res.result.path + ']';
|
|
|
|
|
_this.chatToUser();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
error: function (data) {
|
|
|
|
|
console.log(data);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
created: function () {
|
|
|
|
|
this.init();
|
|
|
|
|