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(() => {}) }, }, };