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


From d8accb6445ce7eaebf7f040dade9f180ecc4ee59 Mon Sep 17 00:00:00 2001
From: zhangjun1
{{ 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 64b04b9..a21bc99 100644 --- a/src/pages/technical-support/answer-center/edit.vue +++ b/src/pages/technical-support/answer-center/edit.vue @@ -10,7 +10,7 @@