From e74165a7bb922333a8a1feb8c7ba5f48488d6f89 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Wed, 11 Jan 2023 10:05:43 +0800 Subject: [PATCH] bug --- src/project/fd/AppAnswer/Add.vue | 20 +++++++++++++++++++- src/project/fd/AppAnswer/component/List.vue | 19 +++++++++++++------ 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/project/fd/AppAnswer/Add.vue b/src/project/fd/AppAnswer/Add.vue index 5c02eee7..010af1ed 100644 --- a/src/project/fd/AppAnswer/Add.vue +++ b/src/project/fd/AppAnswer/Add.vue @@ -14,11 +14,28 @@ data () { return { + id: '', content: '' } }, + onLoad (query) { + if (query.id) { + this.id = query.id + + this.getInfo(query.id) + } + }, + methods: { + getInfo (id) { + this.$http.post(`/app/applearningquestion/queryDetailById?id=${id}`).then(res => { + if (res.code == 0) { + this.content = res.data.content + } + }) + }, + submit () { if (!this.content) { return this.$u.toast('请输入题目内容') @@ -26,7 +43,8 @@ this.$loading() this.$http.post(`/app/applearningquestion/addOrUpdate`, { - content: this.content + content: this.content, + id: this.id || '' }).then(res => { if (res.code == 0) { this.$u.toast('提交成功') diff --git a/src/project/fd/AppAnswer/component/List.vue b/src/project/fd/AppAnswer/component/List.vue index cc026303..8e31bbda 100644 --- a/src/project/fd/AppAnswer/component/List.vue +++ b/src/project/fd/AppAnswer/component/List.vue @@ -9,18 +9,18 @@
- + {{ item.createUserId === user.id ? '我' : item.createUserName }} 于{{ item.createTime }} 提问

{{ item.content }}

- 0 + {{ item.answerCount }} 条回答
- 修改问题 + 修改问题 去回答
@@ -34,20 +34,27 @@