wx.showModal({
title: '',
content: '是否要删除?',
success:res=>{
if (res.confirm) {
console.log('-----用户点击确定-----')
wx.request({
url: 'http://'+myip+':8181/community/deletebyid',
method:'POST',
data:{
id: communityid
},
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success:res=>{
if(res.statusCode == 200){
console.log("---删除成功---",res)
wx.navigateBack({
delta: 1,
})
}
},
fail:res=>{
console.log("---删除失败---")
console.log(res)
}
})
} else if (res.cancel) {
console.log('用户点击取消----')
}
}
})
wx.navigateBack的用法: 官网:https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateBack.html
|