删除动态

main
wangdong 6 months ago
parent 68af2d1f64
commit a0e5a7c14e
  1. 8
      api/squareDynamic/index.js
  2. 30
      pages/squareDynamic/index.vue

@ -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'
}
// 发布动态
@ -22,3 +23,8 @@ export function getDynamic(param) {
export function dynamicLike(param) {
return request.post(api.dynamicLike, { ...param })
}
// 动态删除
export function deleteDynamic(param) {
return request.post(api.dynamicDelete, { ...param })
}

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

Loading…
Cancel
Save