@@ -40,20 +40,21 @@


diff --git a/src/components/wangE.vue b/src/components/wangE.vue index a25acfb2ec29de1606786513980b8438a4c15c95..a20bcd75ddd96057b8982962779b17e06c0f7100 100644 --- a/src/components/wangE.vue +++ b/src/components/wangE.vue @@ -66,13 +66,13 @@ export default { this.editor = new E(this.$refs.toolbar); this.editor.config.uploadImgShowBase64 = false; // base 64 存储图片 this.editor.config.uploadImgServer = - "/tp-jiwei-pcsvc/display/cigApi/common/uploadFile"; // 配置服务器端地址 + "/apaas/static/image/upload"; // 配置服务器端地址 this.editor.config.uploadImgHeaders = {}; // 自定义 header this.editor.config.uploadFileName = "file"; // 后端接受上传文件的参数名 - // this.editor.config.uploadImgMaxSize = 2 * 1024 * 1024; // 将图片大小限制为 2M + this.editor.config.uploadImgMaxSize = 2 * 1024 * 1024; // 将图片大小限制为 2M this.editor.config.uploadImgMaxLength = 6; // 限制一次最多上传 3 张图片 this.editor.config.uploadImgTimeout = 3 * 60 * 1000; // 设置超时时间 - this.editor.config.uploadImgParams = { category: "图片" }; + this.editor.config.uploadImgParams = { directory: "image" }; this.editor.config.uploadImgHooks = { fail: (xhr, editor, result) => { @@ -95,13 +95,13 @@ export default { //循环插入图片 // for (let i = 0; i < 1; i++) { console.log(result); - let imgUrl = "/tp-jiwei-pcsvc/display" + result.data.visitPath; + let imgUrl = result.data; console.log(imgUrl); insertImg(imgUrl); // } } }; - this.editor.config.onchange = html => { + this.editor.config.onblur = html => { this.info_ = html; // 绑定当前逐渐地值 this.$emit("change", this.info_); // 将内容同步到父组件中 }; diff --git a/src/components/wangEBd.vue b/src/components/wangEBd.vue index 2200251133fa6dee3abbde89d30b7fdf3c2de495..d8a0d9d89746dd4015b8ff1699ca5e650b15e25f 100644 --- a/src/components/wangEBd.vue +++ b/src/components/wangEBd.vue @@ -74,13 +74,13 @@ export default { this.editor = new E(this.$refs.toolbar); this.editor.config.uploadImgShowBase64 = false; // base 64 存储图片 this.editor.config.uploadImgServer = - "/tp-jiwei-pcsvc/display/cigApi/common/uploadFile"; // 配置服务器端地址 + "/apaas/static/image/upload"; // 配置服务器端地址 this.editor.config.uploadImgHeaders = {}; // 自定义 header this.editor.config.uploadFileName = "file"; // 后端接受上传文件的参数名 - // this.editor.config.uploadImgMaxSize = 2 * 1024 * 1024; // 将图片大小限制为 2M + this.editor.config.uploadImgMaxSize = 2 * 1024 * 1024; // 将图片大小限制为 2M this.editor.config.uploadImgMaxLength = 6; // 限制一次最多上传 3 张图片 this.editor.config.uploadImgTimeout = 3 * 60 * 1000; // 设置超时时间 - this.editor.config.uploadImgParams = { category: "图片" }; + this.editor.config.uploadImgParams = { directory: "image" }; this.editor.config.uploadImgHooks = { fail: (xhr, editor, result) => { @@ -103,7 +103,7 @@ export default { //循环插入图片 // for (let i = 0; i < 1; i++) { console.log(result); - let imgUrl = "/tp-jiwei-pcsvc/display" + result.data.visitPath; + let imgUrl = result.data; console.log(imgUrl); insertImg(imgUrl); // } @@ -113,7 +113,7 @@ export default { this.editor.config.menus = this.menu } this.editor.config.showFullScreen = this.full - this.editor.config.onchange = html => { + this.editor.config.onblur = html => { this.info_ = html; // 绑定当前逐渐地值 this.$emit("change", this.info_); // 将内容同步到父组件中 }; diff --git a/src/pages/technical-support/answer-center/detail.vue b/src/pages/technical-support/answer-center/detail.vue index d1a8d1a865bcdb0b3cf9ca23e0cf6d86f95e8296..65bc2c7de20971c6d54c868356bb0788c1adb784 100644 --- a/src/pages/technical-support/answer-center/detail.vue +++ b/src/pages/technical-support/answer-center/detail.vue @@ -5,28 +5,28 @@ 详情
{{ question.title }}
- {{ question.asker }}发布于 {{ question.time }}
+ {{ question.user_name }}发布于 {{ deal_time(question.updated) }}
- {{ question.info_count }}
+ {{ question.answer_num }}
- {{ question.watcher }}
+ {{ question.view }}
{{question.info_count}}条回答
+{{answer_total}}条回答
@@ -40,20 +40,21 @@
{{it.username}} 回复{{it.answered_user}} @@ -65,28 +66,32 @@
用户
{{user_info.user_name}}
13123123123123
", - }, + question: {}, answer_count:[], + answer_total:'', answer_index:'', answer_child_index:'', back_person:'lll', back_info:'', + user_info:{}, + back_flag:true, menu:[ 'bold', 'foreColor', @@ -252,35 +253,130 @@ export default { watch: {}, computed: {}, created() { - + this.get_question() + this.get_answer() + this.get_user_info() }, mounted() {}, methods: { + get_question(){ + // /apaas/support/qa/question/detail?id=${this.$route.params.id} + this.$http + .get( + `/apaas/support/qa/question/detail?id=${this.$route.params.id}` + ).then((res)=>{ + if(res.data.success){ + this.question = res.data.data + } + }) + }, + get_answer(){ + // /apaas/support/qa/question/detail?id=${this.$route.params.id} + this.$http + .get( + `/apaas/support/qa/answer/detailList?id=${this.$route.params.id}&limit=1000&page=1` + ).then((res)=>{ + if(res.data.success){ + this.answer = res.data.data + this.answer_total = res.data.total + } + }) + }, + get_user_info(){ + this.$http + .get( + `/apaas/support/qa/info` + ).then((res)=>{ + if(res.data.success){ + this.user_info = res.data.data + } + }) + }, + answer_question(contentid,userid){ + if(this.back_info){ + + }else{ + this.$message.error('请填写回复') + return + } + this.$http + .post( + `/apaas/support/qa/answer/create`,{ + "question_id":parseInt(this.$route.params.id), + "content":this.back_info, + "parent_id":contentid, + "answered_user_id":userid + } + ).then((res)=>{ + if(res.data.success){ + this.$message.success('添加成功') + this.get_question() + this.get_answer() + }else{ + this.$message.error('添加失败') + } + }) + }, + answer_question1(){ + setTimeout(()=>{ + if(!this.back_flag){ + return + } + if(this.editstr){ + + }else{ + this.$message.error('请填写回复') + return + } + this.back_flag = false + this.$http + .post( + `/apaas/support/qa/answer/create`,{ + "question_id":parseInt(this.$route.params.id), + "content":this.editstr, + } + ).then((res)=>{ + this.back_flag = true + if(res.data.success){ + this.$message.success('添加成功') + this.editstr = '' + this.get_question() + this.get_answer() + }else{ + this.$message.error('添加失败') + } + }) + },100) + }, deal_time(time){ + console.log(time); return time.split('+')[0].replace("T"," ") - }, showinput(...arg){ console.log(arg); this.answer_count=[] this.answer_index='' + this.back_info = '' if(!arg[1]&&arg[1]!==0){ this.answer_index = arg[0] - setTimeout(()=>{ + this.$nextTick(()=>{ var temp = 'input'+arg[0] this.$refs[temp][0].$refs.input.focus() - },200) + }) }else{ this.answer_count=arg - setTimeout(()=>{ + this.$nextTick(()=>{ this.$refs['input'+arg[0]+arg[1]][0].$refs.input.focus(); - },200) + }) } }, clear_index(){ - this.answer_count=[] - this.answer_index='' + setTimeout(()=>{ + this.answer_count=[] + this.answer_index='' + this.back_info = '' + },500) } }, }; @@ -489,6 +585,7 @@ export default { font-size: 14px; background-color: #fbfbfc; padding-left: 24px; + margin-top: -16px; } .under_count span{ color: #515fe7; diff --git a/src/pages/technical-support/answer-center/edit.vue b/src/pages/technical-support/answer-center/edit.vue index 64b04b9401f324642a72bd53ae39585037d3569e..a21bc9994816892dde4fe2c4993411700d56d0ec 100644 --- a/src/pages/technical-support/answer-center/edit.vue +++ b/src/pages/technical-support/answer-center/edit.vue @@ -10,7 +10,7 @@