diff --git a/src/components/shopping-cart/shopping-cart-cell.vue b/src/components/shopping-cart/shopping-cart-cell.vue
index f8058e0f3aee314ec1649a13eee3e5534c648f39..89e6bcafc2016ce10c8f9cb71cb20e8a662863b9 100644
--- a/src/components/shopping-cart/shopping-cart-cell.vue
+++ b/src/components/shopping-cart/shopping-cart-cell.vue
@@ -75,7 +75,7 @@
- {{ 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 00a7c2d84a3e4fcae5e596ae2ff5523ad76a0946..5fb567a5c8fcdc78fe0925d389efbb662f2ddd4d 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`)