|
@@ -117,7 +117,7 @@
|
|
|
<el-upload style="margin:10px;"
|
|
<el-upload style="margin:10px;"
|
|
|
action="/api/index/upload/uploadImg"
|
|
action="/api/index/upload/uploadImg"
|
|
|
:before-upload="beforeAvatarUpload"
|
|
:before-upload="beforeAvatarUpload"
|
|
|
- :on-progress="onProgress"
|
|
|
|
|
|
|
+
|
|
|
:on-change='uploadChange'
|
|
:on-change='uploadChange'
|
|
|
:on-success='uploadSuccess'
|
|
:on-success='uploadSuccess'
|
|
|
:on-error="uploadError"
|
|
:on-error="uploadError"
|
|
@@ -220,8 +220,8 @@
|
|
|
getUserItem: [],
|
|
getUserItem: [],
|
|
|
img_http: 'http://kfadmin.bocai186.com',//图片路径域
|
|
img_http: 'http://kfadmin.bocai186.com',//图片路径域
|
|
|
// img_http: 'http://192.168.2.187:8090',//图片路径域
|
|
// img_http: 'http://192.168.2.187:8090',//图片路径域
|
|
|
-
|
|
|
|
|
uploadImg:[],
|
|
uploadImg:[],
|
|
|
|
|
+ imgUrl:'',
|
|
|
users:[]
|
|
users:[]
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
@@ -282,9 +282,11 @@
|
|
|
},
|
|
},
|
|
|
// 上传成功时的回调
|
|
// 上传成功时的回调
|
|
|
uploadSuccess(res, file, fileList) {
|
|
uploadSuccess(res, file, fileList) {
|
|
|
- console.log(res)
|
|
|
|
|
- console.log(file)
|
|
|
|
|
- console.log(fileList)
|
|
|
|
|
|
|
+ console.log(res.data.src)
|
|
|
|
|
+ this.imgUrl = this.imgUrl ? this.imgUrl + "," + res.data.src :res.data.src;
|
|
|
|
|
+ console.log(this.imgUrl)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
// 发送中
|
|
// 发送中
|
|
@@ -295,32 +297,36 @@
|
|
|
uploadError() {
|
|
uploadError() {
|
|
|
this.$message.error('上传失败,请重新上传')
|
|
this.$message.error('上传失败,请重新上传')
|
|
|
},
|
|
},
|
|
|
- handleRemove(res, file, fileList) {
|
|
|
|
|
- this.uploadImg = []
|
|
|
|
|
- fileList.forEach((res,index) => {
|
|
|
|
|
- this.uploadImg.push(URL.createObjectURL(res.raw))
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ //删除回掉
|
|
|
|
|
+ handleRemove(file, fileList,) {
|
|
|
|
|
+ this.uploadImg = fileList
|
|
|
},
|
|
},
|
|
|
// 每次改变图片状态返回的回调
|
|
// 每次改变图片状态返回的回调
|
|
|
uploadChange(file, fileList) {
|
|
uploadChange(file, fileList) {
|
|
|
- this.uploadImg.push(file.raw);
|
|
|
|
|
|
|
+ console.log(file, fileList)
|
|
|
|
|
+
|
|
|
|
|
+ // this.uploadImg.push(file);
|
|
|
},
|
|
},
|
|
|
handleExceed(files, fileList) {
|
|
handleExceed(files, fileList) {
|
|
|
this.$message.error(`图片上传数量最多4张`);
|
|
this.$message.error(`图片上传数量最多4张`);
|
|
|
},
|
|
},
|
|
|
sendMessage() {
|
|
sendMessage() {
|
|
|
- console.log(this.uploadImg,"上传的图片")
|
|
|
|
|
|
|
+ console.log(this.uploadImg);
|
|
|
this.$refs.upload.submit();
|
|
this.$refs.upload.submit();
|
|
|
- // let parmas = {
|
|
|
|
|
- // "user_id":this.users.id,
|
|
|
|
|
- // "message_id":this.uid,
|
|
|
|
|
- // "reply_content":this.leaveInfor,
|
|
|
|
|
- // "images":this.uploadImg,
|
|
|
|
|
- // }
|
|
|
|
|
- // this.post('/api/service/Message/dealmessage', parmas).then(res => {
|
|
|
|
|
- // console.log(res);
|
|
|
|
|
- // this.$message.success(res.data.msg);
|
|
|
|
|
- // })
|
|
|
|
|
|
|
+
|
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
|
+ console.log(this.imgUrl,"上传的图片")
|
|
|
|
|
+ let parmas = {
|
|
|
|
|
+ "user_id":this.users.id,
|
|
|
|
|
+ "message_id":this.uid,
|
|
|
|
|
+ "reply_content":this.leaveInfor,
|
|
|
|
|
+ "images":this.imgUrl,
|
|
|
|
|
+ }
|
|
|
|
|
+ this.post('/api/service/Message/dealmessage', parmas).then(res => {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ this.$message.success(res.data.msg);
|
|
|
|
|
+ })
|
|
|
|
|
+ },1500)
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/*****************获取当前聊天用户信息****************/
|
|
/*****************获取当前聊天用户信息****************/
|