优化uniapp端删帖交互

This commit is contained in:
linfeng 2024-05-28 12:58:41 +08:00
parent 591e9680ff
commit 7a81f63f95
2 changed files with 23 additions and 11 deletions

View File

@ -239,9 +239,15 @@
}, },
methods: { methods: {
deletePost(){ deletePost(){
this.$H var that = this;
uni.showModal({
title: '提示',
content: '确定删除该帖子吗?',
success: function(res) {
if (res.confirm) {
that.$H
.post('post/deleteMyPost', { .post('post/deleteMyPost', {
id: this.postId id: that.postId
}) })
.then(res => { .then(res => {
if(res.code==0){ if(res.code==0){
@ -250,6 +256,12 @@
}) })
} }
}); });
} else if (res.cancel) {
}
}
});
}, },
messageRead(mid) { messageRead(mid) {
this.$H this.$H

View File

@ -153,7 +153,7 @@
}, },
commercialLink() { commercialLink() {
// #ifdef H5 // #ifdef H5
window.open("https://h5.linfeng.tech") window.open("https://www.linfengtech.cn")
// #endif // #endif
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
uni.navigateToMiniProgram({ uni.navigateToMiniProgram({