diff --git a/pages/refund/refund.js b/pages/refund/refund.js index fa6dc94..afd04f3 100644 --- a/pages/refund/refund.js +++ b/pages/refund/refund.js @@ -102,9 +102,48 @@ Page({ // 线下退款 onSubmitToGroup2() { - wx.showToast({ - title: '请联系客服, 线下退款', - icon: 'none' + wx.showModal({ + title: '确认退款', + content: `确定退款金额:${this.data.userInfo.money}元`, + success: (res) => { + if (res.confirm) { + wx.showLoading({ + title: '退款中...' + }) + if (!this.data.userInfo.token) { + wx.showToast({ + title: '退款信息不完整', + icon: 'none' + }) + return + } + t.request('/miniprogram/pay/refundOffline', {token: this.data.userInfo.token}, !0).then((res) => { + wx.hideLoading() + if (res.code == 200) { + wx.showToast({ + title: '退款成功', + icon: 'success' + }) + // 刷新页面数据 + this.setData({ + showResult: false, + userInfo: { + mobile: '', + uid: '', + givenamount: "0.00", + money: "0.00", + principal: "0.00" + } + }) + } else { + wx.showToast({ + title: res.message || '退款失败', + icon: 'none' + }) + } + }) + } + } }) } }) \ No newline at end of file diff --git a/pages/washCodeList/washCodeList.wxml b/pages/washCodeList/washCodeList.wxml index e9e54f0..80f15c7 100644 --- a/pages/washCodeList/washCodeList.wxml +++ b/pages/washCodeList/washCodeList.wxml @@ -11,7 +11,7 @@ 不限 有效期:{{item.starttime}} - {{item.deadline}} - 兑换时间:{{item.created_at}}, 兑换码{{item.code}} + 兑换时间:{{item.created_at}}, 兑换码: {{item.code}} {{item.note}}