Commit 3faeac9b by 高淑倩

取消订单

parent 39c403a1
......@@ -58,13 +58,93 @@ wxService.page({
})
},
// 删除订单
handelDelOrder() {
console.log('删除订单')
handelDelOrder(e) {
const { id } = e.currentTarget.dataset
console.log('删除订单',id)
wx.showLoading({
title: '加载中',
mask: true
})
wxService.post(`/sale/trade/buyer/delete/${id}`).then(res => {
if (res) {
const { result } = res.data
if (result == 0) {
wx.hideLoading()
wx.showToast({
title: `删除成功!`,
icon: 'none'
})
} else {
wx.showToast({
title: `删除失败!`,
icon: 'none'
})
}
}
})
},
// 立即支付
handelToPay() { console.log('立即支付') },
handelToPay(e) {
console.log('立即支付')
const { id } = e.currentTarget.dataset
wx.showLoading({
title: '加载中',
mask: true
})
wxService.post(`/sale/trade/buyer/wxprepay/${id}`).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
wx.requestPayment(Object.assign({
success(res) {
wx.hideLoading()
// wx.showToast({
// title: '支付成功',
// icon: 'none',
// mask: true
// })
// 支付成功页面
wxService.router('/subPackage/page/pages/paymentStatus/paymentStatus?status=S')
},
fail(res) {
wx.hideLoading()
wxService.router('/subPackage/page/pages/paymentStatus/paymentStatus?status=F')
}
}, data))
}
}
})
},
// 取消订单
handelCancelOrder() { console.log('取消订单') },
handelCancelOrder(e) {
console.log('取消订单')
const { id } = e.currentTarget.dataset
wx.showLoading({
title: '加载中',
mask: true
})
wxService.post(`/sale/trade/buyer/cancel/${id}`).then(res => {
if (res) {
const { result } = res.data
if (result == 0) {
wx.hideLoading()
wx.showToast({
title: `取消成功!`,
icon: 'none'
})
} else {
wx.showToast({
title: `取消失败!`,
icon: 'none'
})
}
}
})
},
// 申请退款
handelRequestRefund(e) {
console.log('----', e)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment