|
|
@@ -220,6 +220,9 @@
|
|
|
getUserItem: [],
|
|
|
img_http: 'http://kfadmin.bocai186.com',//图片路径域
|
|
|
// img_http: 'http://192.168.2.187:8090',//图片路径域
|
|
|
+
|
|
|
+ uploadImg:[],
|
|
|
+ users:[]
|
|
|
};
|
|
|
},
|
|
|
components: {
|
|
|
@@ -232,6 +235,7 @@
|
|
|
this.frceArr = frce.frce;
|
|
|
this.value = this.options[2].value;
|
|
|
this.getSessionList(1)
|
|
|
+ this.get_vuex_info();
|
|
|
},
|
|
|
computed: {
|
|
|
|
|
|
@@ -265,7 +269,7 @@
|
|
|
|
|
|
// 上传之前
|
|
|
beforeAvatarUpload(file) {
|
|
|
- console.log(file, '上传之前')
|
|
|
+ // console.log(file, '上传之前')
|
|
|
const isJPG = file.type == 'image/jpeg' || 'image/jpg' || 'image/png' || 'image/svg';
|
|
|
if (!isJPG) {
|
|
|
this.$message.error('上传只能是图片格式!');
|
|
|
@@ -288,8 +292,6 @@
|
|
|
this.$message.error('上传失败,请重新上传')
|
|
|
},
|
|
|
handleRemove(file, fileList) {
|
|
|
- // console.log('123',fileList)
|
|
|
- // 重置为空数组赋值
|
|
|
// this.uploadImg = []
|
|
|
// fileList.forEach((res,index) => {
|
|
|
// this.uploadImg.push(URL.createObjectURL(res.raw))
|
|
|
@@ -298,14 +300,26 @@
|
|
|
},
|
|
|
// 每次改变图片状态返回的回调
|
|
|
uploadChange(file, fileList) {
|
|
|
- if (fileList.length > 4) {
|
|
|
- this.$message.error('上传图片最多4张')
|
|
|
- return false
|
|
|
- }
|
|
|
+
|
|
|
},
|
|
|
handleExceed(files, fileList) {
|
|
|
this.$message.error(`图片上传数量最多4张`);
|
|
|
},
|
|
|
+ sendMessage() {
|
|
|
+ this.$refs.upload.submit();
|
|
|
+ console.log(this.uploadImg, '图片');
|
|
|
+ let formData = new FormData();
|
|
|
+ formData.append("user_id",this.users.id);
|
|
|
+ formData.append("message_id", this.uid);
|
|
|
+ formData.append("reply_content", this.leaveInfor);
|
|
|
+ formData.append("images",this.uploadImg);
|
|
|
+
|
|
|
+ this.post('/api/service/Message/dealmessage', formData).then(res => {
|
|
|
+ console.log(res,'提交成功')
|
|
|
+ return false;
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
/*****************获取当前聊天用户信息****************/
|
|
|
get_user(id) {
|
|
|
let obj = {
|
|
|
@@ -318,34 +332,19 @@
|
|
|
|
|
|
this.post('api' + this.$ports.userInfo.accountInfo, obj).then(res => {
|
|
|
if (res.data.code == 1) {
|
|
|
- console.log(res.data.data, '用户信息');
|
|
|
+ // console.log(res.data.data, '用户信息');
|
|
|
this.userInfo = res.data.data;
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- sendMessage() {
|
|
|
- // 手动上传
|
|
|
- this.$refs.upload.submit();
|
|
|
- let _this = this;
|
|
|
- setTimeout(function () {
|
|
|
- let params = {
|
|
|
- 'name': _this.call,
|
|
|
- 'email': _this.eMail,
|
|
|
- 'content': _this.leaveInfor,
|
|
|
- 'phone': _this.phone,
|
|
|
- 'qq': _this.QQ,
|
|
|
- 'wechat': _this.WX,
|
|
|
- 'file': _this.uploadImg.join(',')
|
|
|
- }
|
|
|
- _this.$axios.post('/api/service/Message/dealmessage', params).then(res => {
|
|
|
- console.log('res', res)
|
|
|
- return false;
|
|
|
- })
|
|
|
- }, 500)
|
|
|
+ get_vuex_info(){
|
|
|
+ this.users = this.$store.getters.get_user_info
|
|
|
+ console.log(this.users,'用户信息');
|
|
|
},
|
|
|
|
|
|
|
|
|
+
|
|
|
widthCheck(str, len) {
|
|
|
var temp = 0
|
|
|
for (var i = 0; i < str.value.length; i++) {
|
|
|
@@ -396,7 +395,8 @@
|
|
|
pageSize: size,
|
|
|
pageNumber: page
|
|
|
},
|
|
|
- obj
|
|
|
+ obj,
|
|
|
+ str
|
|
|
).then(res => {
|
|
|
if (res.data.data) {
|
|
|
this.tableData = res.data.data;
|
|
|
@@ -407,8 +407,8 @@
|
|
|
},
|
|
|
click_row(row, column, event) {
|
|
|
// console.log(this.value);
|
|
|
- // console.log(row.uid)
|
|
|
- this.uid = row.uid;
|
|
|
+ console.log(row)
|
|
|
+ this.uid = row.message_id;
|
|
|
this.drawer = true;
|
|
|
// this.isShow = true;
|
|
|
this.getUserItem = row;
|