修改长效套餐号跳转问题
This commit is contained in:
@@ -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>
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user