fix: 修复兑换码显示格式并优化退款流程

修复兑换码显示格式,添加冒号分隔符以提升可读性。优化退款流程,使用模态框确认退款金额,并添加加载状态和错误处理,提升用户体验。
This commit is contained in:
XiaoMo 2025-05-11 22:54:22 +08:00
parent 9c1ec1ef2a
commit 336227c4dc
2 changed files with 43 additions and 4 deletions

View File

@ -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'
})
}
})
}
}
})
}
})

View File

@ -11,7 +11,7 @@
<block wx:if="{{item.agent.length==0}}">不限</block>
</view>
<view class="indate">有效期:{{item.starttime}} - {{item.deadline}}</view>
<view class="indate">兑换时间:{{item.created_at}}, 兑换码{{item.code}}</view>
<view class="indate">兑换时间:{{item.created_at}}, 兑换码: {{item.code}}</view>
<!-- 如果有note -->
<view class="indate" wx:if="{{item.note}}">{{item.note}}</view>
</view>