feat(api, ui, i18n): 增强奖池管理与钱包功能
新增奖池余额调整与调整记录查询相关 API,提升后台对奖池的管理与控制能力。 更新奖池与钱包相关多语言文案,新增余额调整与转账完成提示信息,提升用户理解与反馈体验。 优化奖池管理相关 UI 组件,新增余额调整功能并改进页面布局,提升操作易用性。 重构相关组件以整合新功能,并进一步优化后台管理界面的整体用户体验。
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { AdminPermissionGate } from "@/components/admin/admin-permission-gate";
|
||||
@@ -9,12 +9,18 @@ import { ConfigDocPage } from "@/modules/config/config-doc-page";
|
||||
import { ConfigSection } from "@/modules/config/config-section";
|
||||
import { OddsConfigDocScreen } from "@/modules/config/doc/odds-config-doc-screen";
|
||||
import { RebateConfigDocScreen } from "@/modules/config/doc/rebate-config-doc-screen";
|
||||
import { useOddsConfigWorkspace } from "@/modules/config/use-odds-config-workspace";
|
||||
import { RulesPageShell } from "@/modules/rules/rules-page-shell";
|
||||
|
||||
/** 赔率与回水:共用赔率版本线,单页上下分区。 */
|
||||
export function RulesOddsConfigScreen() {
|
||||
const { t } = useTranslation("config");
|
||||
const [sharedVersionId, setSharedVersionId] = useState("");
|
||||
const workspace = useOddsConfigWorkspace(sharedVersionId, setSharedVersionId);
|
||||
const rebateSectionRef = useRef<HTMLDivElement>(null);
|
||||
const [rebateMounted, setRebateMounted] = useState(
|
||||
() => typeof window !== "undefined" && window.location.hash === "#rebate",
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
const scrollToRebate = () => {
|
||||
@@ -28,23 +34,43 @@ export function RulesOddsConfigScreen() {
|
||||
return () => window.removeEventListener("hashchange", scrollToRebate);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (rebateMounted) {
|
||||
return;
|
||||
}
|
||||
const node = rebateSectionRef.current;
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
const observer = new IntersectionObserver(
|
||||
([entry]) => {
|
||||
if (entry?.isIntersecting) {
|
||||
setRebateMounted(true);
|
||||
}
|
||||
},
|
||||
{ rootMargin: "240px 0px" },
|
||||
);
|
||||
observer.observe(node);
|
||||
return () => observer.disconnect();
|
||||
}, [rebateMounted]);
|
||||
|
||||
return (
|
||||
<RulesPageShell>
|
||||
<AdminPermissionGate requiredAny={PRD_RULES_ODDS_ACCESS_ANY}>
|
||||
<ConfigDocPage title={t("nav.rulesOddsTitle")} contentClassName="space-y-8">
|
||||
<ConfigSection title={t("nav.items.odds")}>
|
||||
<OddsConfigDocScreen
|
||||
embedded
|
||||
versionId={sharedVersionId}
|
||||
onVersionIdChange={setSharedVersionId}
|
||||
/>
|
||||
<OddsConfigDocScreen embedded workspace={workspace} />
|
||||
</ConfigSection>
|
||||
<ConfigSection id="rebate" title={t("nav.items.rebate")}>
|
||||
<RebateConfigDocScreen
|
||||
embedded
|
||||
versionId={sharedVersionId}
|
||||
onVersionIdChange={setSharedVersionId}
|
||||
/>
|
||||
<div ref={rebateSectionRef}>
|
||||
{rebateMounted ? (
|
||||
<RebateConfigDocScreen embedded workspace={workspace} />
|
||||
) : (
|
||||
<p className="text-muted-foreground py-6 text-center text-sm">
|
||||
{t("rebate.lazyLoadHint", { ns: "config" })}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</ConfigSection>
|
||||
</ConfigDocPage>
|
||||
</AdminPermissionGate>
|
||||
|
||||
Reference in New Issue
Block a user