refactor(idiom): 将游戏配置和题库移到 IdiomSeeder,迁移只建表
This commit is contained in:
@@ -49,7 +49,7 @@ function handleIdiomGameAnswered(e) {
|
||||
const div = document.createElement("div");
|
||||
div.className = "msg-line";
|
||||
|
||||
div.innerHTML = `<span style="color:#16a34a;font-weight:bold;">🎉 恭喜 <b data-idiom-winner="${winner_username}" style="cursor:pointer;border-bottom:1px dashed #16a34a;" title="点击查看资料">${winner_username}</b> 率先答对成语「${answer}」,获得 ${reward_gold} 金币、${reward_exp} 经验!</span><span class="msg-time">(${timeStr})</span>`;
|
||||
div.innerHTML = `<span style="color:#16a34a;font-weight:bold;">🎉 恭喜 <span class="msg-user" data-chat-message-user data-u="${winner_username}" style="color:#16a34a;cursor:pointer;border-bottom:1px dashed #16a34a;">${winner_username}</span> 率先答对成语「${answer}」,获得 ${reward_gold} 金币、${reward_exp} 经验!</span><span class="msg-time">(${timeStr})</span>`;
|
||||
|
||||
const isWinner = winner_username === (window.chatContext?.username || "");
|
||||
if (isWinner) {
|
||||
@@ -259,15 +259,9 @@ export function bindIdiomQuizControls() {
|
||||
}
|
||||
});
|
||||
|
||||
// 猜成语结果消息中的用户名可点击 → 打开用户名片
|
||||
document.addEventListener("click", (e) => {
|
||||
const nameEl = e.target.closest("[data-idiom-winner]");
|
||||
if (!nameEl) return;
|
||||
const username = nameEl.getAttribute("data-idiom-winner") || "";
|
||||
if (username && typeof window.openUserCard === "function") {
|
||||
window.openUserCard(username);
|
||||
}
|
||||
});
|
||||
// ── 猜成语结果消息中的用户名可点击 → 打开用户名片
|
||||
// 注:单击/双击已由 right-panel.js 的全局 [data-chat-message-user] 事件委托统一处理
|
||||
|
||||
}
|
||||
|
||||
// ── 挂载到 window ──
|
||||
|
||||
Reference in New Issue
Block a user