diff --git a/api/common.js b/api/common.js index a5f272a..9448300 100644 --- a/api/common.js +++ b/api/common.js @@ -33,6 +33,14 @@ export default { }) }, + //发送站内信 + sendMessage(data) { + let url = `/member/send_message` + return http.get(url,data).then(res => { + return res; + }) + }, + } \ No newline at end of file diff --git a/pages/common/im_chat_info.vue b/pages/common/im_chat_info.vue index 239f6c0..b0852ab 100644 --- a/pages/common/im_chat_info.vue +++ b/pages/common/im_chat_info.vue @@ -33,10 +33,10 @@ - + - + @@ -70,10 +70,7 @@ export default { tableList:[],//聊天数据列表 formData: { - images_arr: [], - images: '', content: '', - mailbox: '', }, } }, @@ -166,32 +163,44 @@ export default { // console.log('接收AQ上传回调xxx2',this.formData.member_store_certification_arr) }, + //发送站内信 async submitForm() { - let data = {...this.formData} - data.images = data.images_arr.join(',') + let data = { + hair_staff_id: this.filteredData.hair_staff_id, + content: this.formData.content, + } if (!data.content) { //反馈内容为必填项 uni.showToast({ - title: '反馈内容为必填项', + title: '请输入内容', icon: 'none' }) return } - let res = await memberApi.setFeedback(data) + let res = await commonApi.sendMessage(data) if (res.code != 1) { uni.showToast({ title: res.msg, icon: 'none' }) } else { - uni.showToast({ - title: '提交成功', - icon: 'none' - }) - //延迟1s执行 - setTimeout(() => { - this.$util.openHomeView(); - }, 1000); + let content = this.formData.content + this.formData.content = ''//清空输入框 + let msgData = { + "id": '', + "hair_staff_id": this.filteredData.hair_staff_id, + "closed_staff_id": '', + "content": content, + "status": 1, + "type": 2, + "create_time": "", + "redirect": null, + "title": null, + "direction": "right", + "show_time": "" + } + //将发送的消息放在最下方 + this.tableList = this.tableList.concat(msgData); } },