This commit is contained in:
@@ -93,10 +93,15 @@ const ActivityDetail = () => {
|
||||
const signUpMutation = useMutation({
|
||||
mutationFn: (values) => signUpActivity(id, { signup_info: values || {} }),
|
||||
onSuccess: (data) => {
|
||||
// 检查是否需要支付
|
||||
if (data.payment_required) {
|
||||
setPaymentInfo(data);
|
||||
setPaymentModalVisible(true);
|
||||
// 先关闭报名表单,确保层级正确
|
||||
setSignupFormVisible(false);
|
||||
// 延迟一点点时间打开支付弹窗,避免状态更新冲突
|
||||
setTimeout(() => {
|
||||
setPaymentModalVisible(true);
|
||||
}, 100);
|
||||
message.info(data.message || '请扫码支付');
|
||||
return;
|
||||
}
|
||||
@@ -471,12 +476,15 @@ const ActivityDetail = () => {
|
||||
footer={null}
|
||||
destroyOnHidden
|
||||
width={360}
|
||||
zIndex={1001} // 确保层级高于其他弹窗
|
||||
>
|
||||
<div style={{ textAlign: 'center', padding: '20px 0' }}>
|
||||
{paymentInfo?.code_url ? (
|
||||
<>
|
||||
<QRCodeSVG value={paymentInfo.code_url} size={200} />
|
||||
<p style={{ marginTop: 20, fontSize: 16, fontWeight: 'bold' }}>¥{paymentInfo.price}</p>
|
||||
<div style={{ background: '#fff', padding: 10, display: 'inline-block' }}>
|
||||
<QRCodeSVG value={paymentInfo.code_url} size={200} />
|
||||
</div>
|
||||
<p style={{ marginTop: 20, fontSize: 18, fontWeight: 'bold' }}>¥{paymentInfo.price}</p>
|
||||
<p style={{ color: '#666' }}>请使用微信扫一扫支付</p>
|
||||
</>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user