hookehuyr

fix: 替换支付失败提示为模态框并防止重复显示

将支付失败时的toast提示改为模态框提示,并添加防止模态框重复显示的标志位
<!--
* @Date: 2024-01-15 16:25:51
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2026-01-16 18:01:23
* @LastEditTime: 2026-01-16 18:05:18
* @FilePath: /xyxBooking-weapp/src/pages/submit/index.vue
* @Description: 预约人员信息
-->
......@@ -149,6 +149,22 @@ const refreshVisitorList = async (options) => {
}
}
let is_showing_pay_modal = false;
const showPayErrorModal = async (content) => {
if (is_showing_pay_modal) return;
is_showing_pay_modal = true;
try {
await Taro.showModal({
title: '提示',
content: content || '支付失败,请稍后再试',
showCancel: false,
confirmText: '我知道了',
});
} finally {
is_showing_pay_modal = false;
}
}
const submitBtn = async () => {
if (is_submitting.value) return;
if (!checked_visitors.value.length) {
......@@ -211,12 +227,12 @@ const submitBtn = async () => {
},
fail(res) {
refreshVisitorList({ reset_checked: true }).catch(() => {});
Taro.showToast({ title: '支付未完成,可再次点击提交订单继续支付', icon: 'none' });
showPayErrorModal('支付未完成,可再次点击提交订单继续支付').catch(() => {});
}
})
} else {
refreshVisitorList({ reset_checked: true }).catch(() => {});
Taro.showToast({ title: payParams?.msg || '获取支付信息失败', icon: 'none' });
showPayErrorModal(payParams?.msg || '获取支付信息失败,请稍后再试').catch(() => {});
}
} else {
pending_pay_id.value = null;
......