修改长效套餐号跳转问题

This commit is contained in:
Eamon
2026-05-20 15:42:51 +08:00
parent fc25858e72
commit 05c927111b
9 changed files with 142 additions and 35 deletions

View File

@@ -176,9 +176,24 @@ function getTodayUsage(lastAt: Date | null | undefined, daily: number) {
}
export default function ResourcesPage() {
const searchParams = useSearchParams()
const typeParam = searchParams.get("type")
const defaultTab = useMemo(() => {
if (typeParam === "1") return "short"
if (typeParam === "2") return "long"
return "short"
}, [typeParam])
const [activeTab, setActiveTab] = useState(defaultTab)
return (
<Page>
<Tabs defaultValue="short" className="overflow-hidden">
<Tabs
value={activeTab}
onValueChange={setActiveTab}
className="overflow-hidden"
>
<TabsList className="bg-card">
<TabsTrigger value="short" className="h-10 px-4 shadow-none">
@@ -253,6 +268,7 @@ function ResourceList({ resourceType }: ResourceListProps) {
)
const table = useDataTable<Resources>(fetchResources)
console.log(table, "table")
const handleStatusChange = useCallback(
async (resource: Resources, newStatusValue: string) => {
@@ -369,7 +385,7 @@ function ResourceList({ resourceType }: ResourceListProps) {
const detail = getResourceDetail(row.original)
const live = detail?.live
if (live === undefined) return "-"
return <span>{isLong ? `${live}小时` : `${live}分钟`}</span>
return <span>{isLong ? `${live}分钟` : `${live}分钟`}</span>
},
},
{