迁移奖励金币弹窗入口
This commit is contained in:
@@ -79,6 +79,7 @@ export {
|
||||
renderRoomsOnlineStatusToContainer,
|
||||
resolveRoomUrl,
|
||||
} from "./chat-room/rooms.js";
|
||||
export { bindRewardModalControls, openRewardModal } from "./chat-room/reward-modal.js";
|
||||
export { createMessageQueue } from "./chat-room/message-queue.js";
|
||||
|
||||
import { escapeHtml, escapeHtmlWithLineBreaks } from "./chat-room/html.js";
|
||||
@@ -159,6 +160,7 @@ import {
|
||||
renderRoomsOnlineStatusToContainer,
|
||||
resolveRoomUrl,
|
||||
} from "./chat-room/rooms.js";
|
||||
import { bindRewardModalControls, openRewardModal } from "./chat-room/reward-modal.js";
|
||||
import { createMessageQueue } from "./chat-room/message-queue.js";
|
||||
|
||||
if (typeof window !== "undefined") {
|
||||
@@ -251,6 +253,8 @@ if (typeof window !== "undefined") {
|
||||
renderRoomsOnlineStatus,
|
||||
renderRoomsOnlineStatusToContainer,
|
||||
resolveRoomUrl,
|
||||
bindRewardModalControls,
|
||||
openRewardModal,
|
||||
createMessageQueue,
|
||||
};
|
||||
|
||||
@@ -265,6 +269,7 @@ if (typeof window !== "undefined") {
|
||||
window.loadMobileRoomList = loadMobileRoomList;
|
||||
window.openMobileDrawer = openMobileDrawer;
|
||||
window.openUserCard = openUserCard;
|
||||
window.openRewardModal = openRewardModal;
|
||||
window.renderMobileRoomList = renderMobileRoomList;
|
||||
window.renderMobileUserList = renderMobileUserList;
|
||||
window.scheduleRenderMobileUserList = scheduleRenderMobileUserList;
|
||||
@@ -316,6 +321,7 @@ if (typeof window !== "undefined") {
|
||||
bindVipControls();
|
||||
bindChatRightPanelControls();
|
||||
bindRoomStatusControls();
|
||||
bindRewardModalControls();
|
||||
bindMobileDrawerControls();
|
||||
bindWelcomeMenuControls();
|
||||
bindBlockMenuControls();
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// 聊天室职务奖励金币弹窗入口,提供 openRewardModal 全局兼容函数。
|
||||
|
||||
/**
|
||||
* 打开奖励金币独立弹窗。
|
||||
*
|
||||
* @param {string} username
|
||||
* @returns {void}
|
||||
*/
|
||||
export function openRewardModal(username) {
|
||||
const container = document.getElementById("reward-modal-container");
|
||||
if (!window.Alpine || !container) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.Alpine.$data(container)?.open?.(username);
|
||||
}
|
||||
|
||||
/**
|
||||
* 暴露奖励金币弹窗入口给存量按钮调用。
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
export function bindRewardModalControls() {
|
||||
if (typeof window === "undefined") {
|
||||
return;
|
||||
}
|
||||
|
||||
window.openRewardModal = openRewardModal;
|
||||
}
|
||||
@@ -1358,20 +1358,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* openRewardModal - 全局入口:打开奖励金币独立弹窗
|
||||
* @param {string} username 被奖励用户名
|
||||
*/
|
||||
function openRewardModal(username) {
|
||||
const el = document.getElementById('reward-modal-container');
|
||||
if (!window.Alpine || !el) return;
|
||||
const data = window.Alpine.$data(el);
|
||||
if (data) {
|
||||
data.open(username);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{{-- openRewardModal 已迁移到 resources/js/chat-room/reward-modal.js --}}
|
||||
|
||||
{{-- ═══════════ 好友系统通知监听 ═══════════ --}}
|
||||
{{-- 监听好友 WebSocket 事件,与好友操作逻辑集中在同一文件维护 --}}
|
||||
|
||||
Reference in New Issue
Block a user