From 336227c4dcd9d14d60f00d578a4faf8db9c5598f Mon Sep 17 00:00:00 2001 From: XiaoMo Date: Sun, 11 May 2025 22:54:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=85=91=E6=8D=A2?= =?UTF-8?q?=E7=A0=81=E6=98=BE=E7=A4=BA=E6=A0=BC=E5=BC=8F=E5=B9=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E9=80=80=E6=AC=BE=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复兑换码显示格式,添加冒号分隔符以提升可读性。优化退款流程,使用模态框确认退款金额,并添加加载状态和错误处理,提升用户体验。 --- pages/refund/refund.js | 45 ++++++++++++++++++++++++++-- pages/washCodeList/washCodeList.wxml | 2 +- 2 files changed, 43 insertions(+), 4 deletions(-) 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}}