Commit f183ca51 by 高淑倩

撤销退款

parent 31a0852c
...@@ -177,6 +177,29 @@ if(currentIndex == 5){ ...@@ -177,6 +177,29 @@ if(currentIndex == 5){
handelCancelRefund(e){ handelCancelRefund(e){
const { id } = e.currentTarget.dataset const { id } = e.currentTarget.dataset
console.log('取消退款', id ) console.log('取消退款', id )
this.handelRevokeRefund(id)
},
handelRevokeRefund(id) {
wx.showLoading({
title: '加载中',
mask: true
})
const params = {id}
wxService.post(`/sale/refund/buyer/cancel`,params).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
wx.showToast({
title: '撤销退款成功',
icon: 'none'
});
setTimeout(() => {
wxService.router('/pages/order/order')
},200)
}
}
})
}, },
// 订单详情 // 订单详情
handelDetail(e) { handelDetail(e) {
......
...@@ -10,8 +10,8 @@ wxService.page({ ...@@ -10,8 +10,8 @@ wxService.page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
showApplyRefundModal:false, showApplyRefundModal: false,
id:'', id: '',
refundDetail: null refundDetail: null
}, },
...@@ -27,14 +27,37 @@ wxService.page({ ...@@ -27,14 +27,37 @@ wxService.page({
*/ */
onShow: function () { onShow: function () {
const { id } = this.options const { id } = this.options
if(id) { if (id) {
this.setData({ this.setData({
id id
},()=>{ }, () => {
this.getRfDetail(id) this.getRfDetail(id)
}) })
} }
}, },
handelRevokeRefund() {
const { id } = this.data
wx.showLoading({
title: '加载中',
mask: true
})
const params = {id}
wxService.post(`/sale/refund/buyer/cancel`,params).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
wx.showToast({
title: '撤销退款成功',
icon: 'none'
});
setTimeout(() => {
wxService.router('/pages/order/order')
},200)
}
}
})
},
getRfDetail(id) { getRfDetail(id) {
wx.showLoading({ wx.showLoading({
title: '加载中', title: '加载中',
...@@ -52,21 +75,21 @@ wxService.page({ ...@@ -52,21 +75,21 @@ wxService.page({
} }
}) })
}, },
copy(e){ copy(e) {
wx.setClipboardData({ wx.setClipboardData({
//准备复制的数据 //准备复制的数据
data: e.currentTarget.dataset.content, data: e.currentTarget.dataset.content,
success: function (res) { success: function (res) {
wx.showToast({ wx.showToast({
title: '复制成功', title: '复制成功',
icon:'none' icon: 'none'
}); });
} }
}); });
}, },
//填写物流信息 //填写物流信息
tapWriteLogis(){ tapWriteLogis() {
console.log('222') console.log('222')
this.setData({ this.setData({
showApplyRefundModal: true showApplyRefundModal: true
......
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
</view> </view>
<view class="cancel"> <view class="cancel">
<button class="btn btn-primary btn-lg">撤销退款</button> <button class="btn btn-primary btn-lg" bindtap="handelRevokeRefund">撤销退款</button>
</view> </view>
</view> </view>
......
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