From f867e912e9ee23bae70aa749d5134175fd666bd2 Mon Sep 17 00:00:00 2001 From: lkddi Date: Wed, 4 Mar 2026 14:19:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E6=89=80=E6=9C=89=E6=8F=90=E7=A4=BA=E6=94=B9?= =?UTF-8?q?=E7=94=A8=E5=85=A8=E5=B1=80=20chatDialog=EF=BC=8C=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E5=8E=9F=E7=94=9F=20alert()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - savePassword():修改密码成功/失败/校验提示全部改为 window.chatDialog.alert() - saveSettings():保存资料成功/失败提示改为 window.chatDialog.alert() - sendEmailCode():发送验证码相关提示改为 window.chatDialog.alert() - 工具栏「银行」按钮的 alert 也一并改为 chatDialog --- .../views/chat/partials/toolbar.blade.php | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/resources/views/chat/partials/toolbar.blade.php b/resources/views/chat/partials/toolbar.blade.php index 7a825a7..7719849 100644 --- a/resources/views/chat/partials/toolbar.blade.php +++ b/resources/views/chat/partials/toolbar.blade.php @@ -18,7 +18,7 @@
商店
存点
娱乐
-
银行
+
银行
婚姻
好友
头像
@@ -179,15 +179,15 @@ const newPwd = document.getElementById('set-new-pwd').value; const newPwd2 = document.getElementById('set-new-pwd2').value; if (!oldPwd || !newPwd) { - alert('请填写旧密码和新密码'); + window.chatDialog.alert('请填写旧密码和新密码', '提示', '⚠️'); return; } if (newPwd.length < 6) { - alert('新密码最少6位!'); + window.chatDialog.alert('新密码最少6位!', '提示', '⚠️'); return; } if (newPwd !== newPwd2) { - alert('两次输入的新密码不一致!'); + window.chatDialog.alert('两次输入的新密码不一致!', '提示', '⚠️'); return; } @@ -207,15 +207,15 @@ }); const data = await res.json(); if (res.ok && data.status === 'success') { - alert('密码修改成功!'); + window.chatDialog.alert('密码修改成功!', '修改成功', '🔒'); document.getElementById('set-old-pwd').value = ''; document.getElementById('set-new-pwd').value = ''; document.getElementById('set-new-pwd2').value = ''; } else { - alert('修改失败: ' + (data.message || '请输入正确的旧密码')); + window.chatDialog.alert('修改失败:' + (data.message || '请输入正确的旧密码'), '修改失败', '❌'); } } catch (e) { - alert('网络异常'); + window.chatDialog.alert('网络异常,请稍后重试', '错误', '🌐'); } } @@ -246,12 +246,12 @@ }); const data = await res.json(); if (res.ok && data.status === 'success') { - alert('设置保存成功!'); + window.chatDialog.alert('资料保存成功!', '保存成功', '✅'); } else { - alert('保存失败: ' + (data.message || '输入有误')); + window.chatDialog.alert('保存失败:' + (data.message || '输入有误'), '保存失败', '❌'); } } catch (e) { - alert('网络异常'); + window.chatDialog.alert('网络异常,请稍后重试', '错误', '🌐'); } } @@ -261,7 +261,7 @@ async function sendEmailCode() { const emailInput = document.getElementById('set-email').value.trim(); if (!emailInput) { - alert('请先填写邮箱地址后再获取验证码!'); + window.chatDialog.alert('请先填写邮箱地址后再获取验证码!', '提示', '📧'); return; } @@ -287,7 +287,7 @@ const data = await res.json(); if (res.ok && data.status === 'success') { - alert(data.message || '验证码发送成功,请前往邮箱查收!(有效期5分钟)'); + window.chatDialog.alert(data.message || '验证码发送成功,请前往邮箱查收!(有效期5分钟)', '发送成功', '📬'); // 开始 60 秒防暴力点击倒计时 let count = 60; @@ -306,7 +306,7 @@ }, 1000); } else { - alert('发送失败: ' + (data.message || '系统繁忙')); + window.chatDialog.alert('发送失败:' + (data.message || '系统繁忙'), '发送失败', '❌'); // 失败了立刻解除禁用以重新尝试 btn.innerText = '获取验证码'; btn.disabled = false; @@ -314,7 +314,7 @@ btn.style.cursor = 'pointer'; } } catch (e) { - alert('网络异常,验证码发送请求失败。'); + window.chatDialog.alert('网络异常,验证码发送失败,请稍后重试。', '错误', '🌐'); btn.innerText = '获取验证码'; btn.disabled = false; btn.style.opacity = '1';