From 5135c3d8763f37bf16ec19b69bbde73ec93f219f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=AE=BF=E6=98=95?= Date: Fri, 30 Oct 2020 12:38:42 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E7=AD=94=E6=8E=A5=E5=8F=A3=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shopping-cart/shopping-cart-cell.vue | 11 ++++++-- .../user/questions-answers/community.vue | 26 ++++++++----------- src/pages/user/questions-answers/my-qa.vue | 25 +++++++++++------- src/request/api/user.js | 8 +++--- 4 files changed, 40 insertions(+), 30 deletions(-) diff --git a/src/components/shopping-cart/shopping-cart-cell.vue b/src/components/shopping-cart/shopping-cart-cell.vue index f8058e0..89e6bca 100644 --- a/src/components/shopping-cart/shopping-cart-cell.vue +++ b/src/components/shopping-cart/shopping-cart-cell.vue @@ -75,7 +75,7 @@ -
+
计次收费:{{ getSpecification }} @@ -138,6 +138,8 @@
+
{{ cellItems.application.price }}金币/月
+
{{ cellItems.service.request_spcs_info.spcs_type_2.single_money }}金币/月
不限时长
@@ -152,7 +154,7 @@
- 200000000金币 + {{ getSumMoney }}金币 { - query.items.push({ id: item.id, reason: this.reason_form.reason }); + items.push({ id: item.id, reason: this.reason_form.reason }); }); - this.$api.user.delQuestions(query).then((response) => { + this.$api.user.delQuestions(items).then((response) => { if (response.data.success == 1) { this.$message({ message: "删除成功", @@ -273,13 +271,11 @@ export default { }); }, delA() { - let query = { - items: [], - }; + let items = []; this.selected_date.forEach((item) => { - query.items.push({ id: item.id, reason: this.reason_form.reason }); + items.push({ id: item.id, reason: this.reason_form.reason }); }); - this.$api.user.delAnswers(query).then((response) => { + this.$api.user.delAnswers(items).then((response) => { if (response.data.success == 1) { this.$message({ message: "删除成功", @@ -367,7 +363,7 @@ export default { align: "left", type: "html", getHtml: (str) => { - return `${str.content}`; + return `${str.answer}`; }, }, { @@ -376,19 +372,19 @@ export default { align: "left", type: "html", getHtml: (str) => { - return `${str.title}`; + return `${str.title}`; }, }, { - prop: "content", + prop: "question_content", label: "问题内容", align: "left", type: "html", getHtml: (str) => { - return `${str.content.replace(/<[^<>]+>/g, "")}`; + )}">${str.question_content.replace(/<[^<>]+>/g, "")}`; }, }, { diff --git a/src/pages/user/questions-answers/my-qa.vue b/src/pages/user/questions-answers/my-qa.vue index 46d2763..eb1b467 100644 --- a/src/pages/user/questions-answers/my-qa.vue +++ b/src/pages/user/questions-answers/my-qa.vue @@ -77,7 +77,11 @@ {{ item.title }}

- {{ item.content.replace(/<[^<>]+>/g, "") }} + {{ + item.answer + ? item.question_content.replace(/<[^<>]+>/g, "") + : item.content.replace(/<[^<>]+>/g, "") + }}

@@ -207,6 +211,12 @@ export default { watch: { activeName: { handler(val) { + this.data_list = []; + this.total = 0; + this.pagination = { + rowsPerPage: 10, + page: 1, + }; if (val == "0") { this.getQList(); } else if (val == "1") { @@ -313,10 +323,9 @@ export default { } }, delQ() { - let query = { - items: [{ id: this.delItem.id }], - }; - this.$api.user.delQuestions(query).then((response) => { + let items = [{ id: this.delItem.id }]; + console.log(items); + this.$api.user.delQuestions(items).then((response) => { if (response.data.success == 1) { this.$message({ message: "删除成功", @@ -326,10 +335,8 @@ export default { }); }, delA() { - let query = { - items: [{ id: this.delItem.id }], - }; - this.$api.user.delAnswers(query).then((response) => { + let items = [{ id: this.delItem.id }]; + this.$api.user.delAnswers(items).then((response) => { if (response.data.success == 1) { this.$message({ message: "删除成功", diff --git a/src/request/api/user.js b/src/request/api/user.js index 00a7c2d..5fb567a 100644 --- a/src/request/api/user.js +++ b/src/request/api/user.js @@ -59,11 +59,11 @@ const user = { getDeleteList() { return axios.get(`/apaas/support/qa/deleted`); }, - delQuestions(params) { - return axios.delete(`/apaas/support/qa/question/delete`, params); + delQuestions(items) { + return axios.delete(`/apaas/support/qa/question/delete`, { data: { items } }); }, - delAnswers(params) { - return axios.delete(`/apaas/support/qa/answer/delete`, params); + delAnswers(items) { + return axios.delete(`/apaas/support/qa/answer/delete`, { data: { items } }); }, getUserQA() { return axios.get(`/apaas/support/qa/info`) -- 2.26.0