产品列表 水滴静态-游戏/ 套餐/线路列表

This commit is contained in:
Eamon
2026-10-14 18:19:39 +08:00
parent 1fc625ede8
commit b5076d7ca7
7 changed files with 852 additions and 295 deletions

View File

@@ -116,6 +116,11 @@ export default function ChannelsPage() {
const [page, setPage] = useState(1)
const [selection, setSelection] = useState<Record<string, boolean>>({})
const selectedAccounts = useMemo(
() => data.filter(item => selection[String(item.Id)]),
[data, selection],
)
const selectedProduct = useMemo(
() =>
products.find(item => String(item.Product.Id) === query.productId) ??
@@ -207,7 +212,10 @@ export default function ChannelsPage() {
<SelectContent>
<SelectItem value="0">全部产品</SelectItem>
{products.map(item => (
<SelectItem key={item.Product.Id} value={String(item.Product.Id)}>
<SelectItem
key={item.Product.Id}
value={String(item.Product.Id)}
>
{item.Product.Name}
</SelectItem>
))}
@@ -256,7 +264,25 @@ export default function ChannelsPage() {
<div className="flex flex-wrap items-center gap-4 pt-2 p-4">
<Button
className="bg-red-600 hover:bg-red-700 text-white"
onClick={() => toast.info("续费功能开发中,敬请期待")}
onClick={() => {
if (selectedAccounts.length === 0) {
toast.error("请先勾选需要续费的账号")
return
}
const productIds = new Set(
selectedAccounts.map(item => item.ProductId),
)
if (productIds.size > 1) {
toast.error("所选账号必须为同一种产品")
return
}
const accounts = selectedAccounts
.map(item => item.Account)
.join(",")
const productId = selectedAccounts[0].ProductId
// 续费走后端老页面(/product/rebuyindex → /product/rebuy),与 juipnet 行为一致
window.location.href = `/product/rebuyindex?accounts=${encodeURIComponent(accounts)}&productId=${productId}`
}}
>
续费
</Button>