修复:chatDialog.alert() 第三参数改为颜色值,修正标题栏和按钮背景色
之前误将第三个 color 参数传入 emoji(⚠️、🔒、❌ 等), 导致 background 被设为无效值,标题栏变白色、文字和按钮不可见。 全部改为正确 HEX 颜色值: - 提示/警告 → #d97706(琥珀橙) - 成功 → #16a34a(绿色) - 失败/错误 → #dc2626(红色) - 网络错误 → #6b7280(灰色) - 开发中 → #78716c(石灰灰)
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
<div class="tool-btn" onclick="openShopModal()" title="购买道具">商店</div>
|
||||
<div class="tool-btn" onclick="saveExp()" title="手动存经验点">存点</div>
|
||||
<div class="tool-btn" onclick="openGameHall()" title="娱乐游戏大厅">娱乐</div>
|
||||
<div class="tool-btn" onclick="window.chatDialog.alert('银行功能开发中,敬请期待!', '开发中', '🚧')" title="银行(待开发)">银行</div>
|
||||
<div class="tool-btn" onclick="window.chatDialog.alert('银行功能开发中,敬请期待!', '开发中', '#78716c')" title="银行(待开发)">银行</div>
|
||||
<div class="tool-btn" onclick="openMarriageStatusModal()" title="婚姻状态">婚姻</div>
|
||||
<div class="tool-btn" onclick="openFriendPanel()" title="好友列表">好友</div>
|
||||
<div class="tool-btn" onclick="openAvatarPicker()" title="修改头像">头像</div>
|
||||
@@ -84,7 +84,7 @@
|
||||
<div
|
||||
style="background:#fff; border-radius:8px; width:380px; max-height:90vh;
|
||||
box-shadow:0 8px 32px rgba(0,0,0,0.3); display:flex; flex-direction:column;">
|
||||
{{-- --}}}
|
||||
{{-- --}}
|
||||
<div
|
||||
style="background:linear-gradient(135deg,#336699,#5a8fc0); color:#fff;
|
||||
padding:12px 16px; border-radius:8px 8px 0 0; display:flex; justify-content:space-between; align-items:center; flex-shrink:0;">
|
||||
@@ -180,15 +180,15 @@
|
||||
const newPwd = document.getElementById('set-new-pwd').value;
|
||||
const newPwd2 = document.getElementById('set-new-pwd2').value;
|
||||
if (!oldPwd || !newPwd) {
|
||||
window.chatDialog.alert('请填写旧密码和新密码', '提示', '⚠️');
|
||||
window.chatDialog.alert('请填写旧密码和新密码', '提示', '#d97706');
|
||||
return;
|
||||
}
|
||||
if (newPwd.length < 6) {
|
||||
window.chatDialog.alert('新密码最少6位!', '提示', '⚠️');
|
||||
window.chatDialog.alert('新密码最少6位!', '提示', '#d97706');
|
||||
return;
|
||||
}
|
||||
if (newPwd !== newPwd2) {
|
||||
window.chatDialog.alert('两次输入的新密码不一致!', '提示', '⚠️');
|
||||
window.chatDialog.alert('两次输入的新密码不一致!', '提示', '#d97706');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -208,15 +208,15 @@
|
||||
});
|
||||
const data = await res.json();
|
||||
if (res.ok && data.status === 'success') {
|
||||
window.chatDialog.alert('密码修改成功!', '修改成功', '🔒');
|
||||
window.chatDialog.alert('密码修改成功!', '修改成功', '#16a34a');
|
||||
document.getElementById('set-old-pwd').value = '';
|
||||
document.getElementById('set-new-pwd').value = '';
|
||||
document.getElementById('set-new-pwd2').value = '';
|
||||
} else {
|
||||
window.chatDialog.alert('修改失败:' + (data.message || '请输入正确的旧密码'), '修改失败', '❌');
|
||||
window.chatDialog.alert('修改失败:' + (data.message || '请输入正确的旧密码'), '修改失败', '#dc2626');
|
||||
}
|
||||
} catch (e) {
|
||||
window.chatDialog.alert('网络异常,请稍后重试', '错误', '🌐');
|
||||
window.chatDialog.alert('网络异常,请稍后重试', '错误', '#6b7280');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,12 +247,12 @@
|
||||
});
|
||||
const data = await res.json();
|
||||
if (res.ok && data.status === 'success') {
|
||||
window.chatDialog.alert('资料保存成功!', '保存成功', '✅');
|
||||
window.chatDialog.alert('资料保存成功!', '保存成功', '#16a34a');
|
||||
} else {
|
||||
window.chatDialog.alert('保存失败:' + (data.message || '输入有误'), '保存失败', '❌');
|
||||
window.chatDialog.alert('保存失败:' + (data.message || '输入有误'), '保存失败', '#dc2626');
|
||||
}
|
||||
} catch (e) {
|
||||
window.chatDialog.alert('网络异常,请稍后重试', '错误', '🌐');
|
||||
window.chatDialog.alert('网络异常,请稍后重试', '错误', '#6b7280');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@
|
||||
async function sendEmailCode() {
|
||||
const emailInput = document.getElementById('set-email').value.trim();
|
||||
if (!emailInput) {
|
||||
window.chatDialog.alert('请先填写邮箱地址后再获取验证码!', '提示', '📧');
|
||||
window.chatDialog.alert('请先填写邮箱地址后再获取验证码!', '提示', '#d97706');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@
|
||||
const data = await res.json();
|
||||
|
||||
if (res.ok && data.status === 'success') {
|
||||
window.chatDialog.alert(data.message || '验证码发送成功,请前往邮箱查收!(有效期5分钟)', '发送成功', '📬');
|
||||
window.chatDialog.alert(data.message || '验证码发送成功,请前往邮箱查收!(有效期5分钟)', '发送成功', '#16a34a');
|
||||
|
||||
// 开始 60 秒防暴力点击倒计时
|
||||
let count = 60;
|
||||
@@ -307,7 +307,7 @@
|
||||
}, 1000);
|
||||
|
||||
} else {
|
||||
window.chatDialog.alert('发送失败:' + (data.message || '系统繁忙'), '发送失败', '❌');
|
||||
window.chatDialog.alert('发送失败:' + (data.message || '系统繁忙'), '发送失败', '#dc2626');
|
||||
// 失败了立刻解除禁用以重新尝试
|
||||
btn.innerText = '获取验证码';
|
||||
btn.disabled = false;
|
||||
@@ -315,7 +315,7 @@
|
||||
btn.style.cursor = 'pointer';
|
||||
}
|
||||
} catch (e) {
|
||||
window.chatDialog.alert('网络异常,验证码发送失败,请稍后重试。', '错误', '🌐');
|
||||
window.chatDialog.alert('网络异常,验证码发送失败,请稍后重试。', '错误', '#6b7280');
|
||||
btn.innerText = '获取验证码';
|
||||
btn.disabled = false;
|
||||
btn.style.opacity = '1';
|
||||
|
||||
Reference in New Issue
Block a user