This commit is contained in:
ltx 2026-04-10 01:07:09 +08:00
commit 54f2a7f0a5
2 changed files with 26 additions and 2 deletions

View File

@ -146,10 +146,33 @@ Page({
confirmText: '确定',
success: (res) => {
if (!res || !res.confirm) return;
// TODO: 接入后端“取消报名/退款”接口后提交所选项目
wx.showToast({ title: '已提交(待接接口)', icon: 'none' });
this.submitCancelRegistration();
}
});
},
submitCancelRegistration() {
wx.showLoading({ title: '提交中...' });
request({
path: API.cancelRegistrationRefund,
method: 'POST',
needAuth: true,
data: {
registrationId: this.data.registrationId,
refundReason: '用户取消报名'
}
})
.then(() => {
wx.hideLoading();
wx.showToast({ title: '退款申请已提交', icon: 'success' });
setTimeout(() => {
wx.navigateBack();
}, 1500);
})
.catch((err) => {
wx.hideLoading();
wx.showToast({ title: (err && err.message) || '提交失败,请稍后重试', icon: 'none' });
});
}
});

View File

@ -12,6 +12,7 @@ const API = {
myRegistrationDetail: (registrationId) => `/api/eventclient/my-registration/${registrationId}`,
apply: '/api/eventclient/apply',
calculateAmount: '/api/eventclient/calculate-amount',
cancelRegistrationRefund: '/api/eventclient/cancel-registration-refund',
wechatLogin: '/api/oauth/login',
loginByCode: '/api/oauth/login',