From a0e5a7c14ea9a8c23452c10fc3a566e376e1a3df Mon Sep 17 00:00:00 2001 From: wangdong <1551135706@qq.com> Date: Mon, 3 Jun 2024 17:28:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/squareDynamic/index.js | 8 +++++++- pages/squareDynamic/index.vue | 30 +++++++++++++++--------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/api/squareDynamic/index.js b/api/squareDynamic/index.js index c9d0b15..bb797ce 100644 --- a/api/squareDynamic/index.js +++ b/api/squareDynamic/index.js @@ -4,7 +4,8 @@ import request from '@/utils/request' const api = { publishDynamic: 'square/add', getDynamic: 'square/list', - dynamicLike: 'square/dynamicLike' + dynamicLike: 'square/dynamicLike', + dynamicDelete: 'square/delete' } // 发布动态 @@ -21,4 +22,9 @@ export function getDynamic(param) { // 动态点赞 export function dynamicLike(param) { return request.post(api.dynamicLike, { ...param }) +} + +// 动态删除 +export function deleteDynamic(param) { + return request.post(api.dynamicDelete, { ...param }) } \ No newline at end of file diff --git a/pages/squareDynamic/index.vue b/pages/squareDynamic/index.vue index 4d1b9d4..1f3204a 100644 --- a/pages/squareDynamic/index.vue +++ b/pages/squareDynamic/index.vue @@ -402,21 +402,21 @@ }) }, deleteDynamic(item) { - // Api.deleteDynamic({ - // id: item.id - // }) - // .then(result => { - // console.log(result); - // uni.showToast({ - // icon: 'success', - // title: '删除成功', - // }); - // this.finished = false; - // this.page = 1; - // this.dynamicList = []; - // this.getDynamicList(); - // }) - // .finally(() => {}) + Api.deleteDynamic({ + squareId: item.square_id + }) + .then(result => { + console.log(result); + uni.showToast({ + icon: 'success', + title: '删除成功', + }); + this.finished = false; + this.page = 1; + this.dynamicList = []; + this.getDynamicList(); + }) + .finally(() => {}) }, }, };