diff --git a/app/(account)/layout.tsx b/app/(account)/layout.tsx index e9eceb6..12fc92e 100644 --- a/app/(account)/layout.tsx +++ b/app/(account)/layout.tsx @@ -6,7 +6,7 @@ export default function AccountLayout({ children }: { children: React.ReactNode return (
-
+
diff --git a/app/(account)/verify/page.tsx b/app/(account)/verify/page.tsx index 1224acb..3e9fadb 100644 --- a/app/(account)/verify/page.tsx +++ b/app/(account)/verify/page.tsx @@ -57,7 +57,7 @@ export default function VerifyPage() { ] return ( -
+

身份认证

diff --git a/app/(account)/wallet/page.tsx b/app/(account)/wallet/page.tsx index f8e0eda..490e8a9 100644 --- a/app/(account)/wallet/page.tsx +++ b/app/(account)/wallet/page.tsx @@ -74,7 +74,7 @@ export default function WalletPage() { } return ( -
+

钱包

diff --git a/app/(dashboard)/layout.tsx b/app/(dashboard)/layout.tsx index 458a344..ad3c673 100644 --- a/app/(dashboard)/layout.tsx +++ b/app/(dashboard)/layout.tsx @@ -14,7 +14,7 @@ export default function DashboardLayout({ children }: { children: React.ReactNod return (
-
+
diff --git a/app/(main)/community/page.tsx b/app/(main)/community/page.tsx index 405d53e..725a89e 100644 --- a/app/(main)/community/page.tsx +++ b/app/(main)/community/page.tsx @@ -78,7 +78,7 @@ export default function CommunityPage() {
-
+
{filteredPosts.map((post) => (() => { const linkedOrder = post.linkedOrderId diff --git a/app/(main)/page.tsx b/app/(main)/page.tsx index dbb8530..070f346 100644 --- a/app/(main)/page.tsx +++ b/app/(main)/page.tsx @@ -72,7 +72,10 @@ export default function HomePage() {
{players.map((player) => ( - + @@ -99,7 +102,7 @@ export default function HomePage() {
- +
{player.tags.map((tag) => ( @@ -132,12 +135,12 @@ export default function HomePage() {
{shops.map((shop) => ( - + {shop.name}

{shop.description}

- +
diff --git a/app/(main)/player/[id]/page.tsx b/app/(main)/player/[id]/page.tsx index 97dd4bc..4c9b24e 100644 --- a/app/(main)/player/[id]/page.tsx +++ b/app/(main)/player/[id]/page.tsx @@ -15,12 +15,7 @@ import { } from "@/components/ui/card" import { Separator } from "@/components/ui/separator" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" -import { - isFavorited as checkFavorited, - listPlayers, - listReviewsByTargetUser, - listServicesByPlayer, -} from "@/lib/api" +import { listPlayers, listReviewsByTargetUser, listServicesByPlayer } from "@/lib/api" export default async function PlayerDetailPage({ params }: { params: Promise<{ id: string }> }) { const { id } = await params @@ -35,8 +30,6 @@ export default async function PlayerDetailPage({ params }: { params: Promise<{ i player.services && player.services.length > 0 ? player.services : listServicesByPlayer(player.id) - const isFavorited = checkFavorited("u1", "player", player.id) - return (
@@ -79,11 +72,7 @@ export default async function PlayerDetailPage({ params }: { params: Promise<{ i )} - +
@@ -106,13 +95,13 @@ export default async function PlayerDetailPage({ params }: { params: Promise<{ i 服务列表 ({playerServices.length}) 评价 ({playerReviews.length}) diff --git a/app/(main)/search/page.tsx b/app/(main)/search/page.tsx index b5b45fa..386899c 100644 --- a/app/(main)/search/page.tsx +++ b/app/(main)/search/page.tsx @@ -14,7 +14,7 @@ import { } from "lucide-react" import Link from "next/link" import { useRouter, useSearchParams } from "next/navigation" -import { Suspense, useEffect, useMemo, useState } from "react" +import { Suspense, useEffect, useMemo, useState, useDeferredValue } from "react" import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" @@ -309,7 +309,14 @@ function FilterSection({
-

价格区间 (元)

+

+ 价格区间 (元) + {(priceRange.min || priceRange.max) && ( + + ¥{priceRange.min || "-"} - ¥{priceRange.max || "-"} + + )} +

s.price)) if (playerMinPrice < minP) return false - if (priceRange.max && playerMinPrice > maxP) return false + if (deferredPriceRange.max && playerMinPrice > maxP) return false if (onlyOnline && player.status !== "available") return false @@ -458,7 +466,7 @@ function SearchPageContent() { return true }) - }, [minRating, onlyOnline, players, priceRange, searchQuery, selectedGames]) + }, [minRating, onlyOnline, players, deferredPriceRange, searchQuery, selectedGames]) const filteredShops = useMemo(() => { return shopResultItems.filter((item) => { @@ -475,17 +483,17 @@ function SearchPageContent() { if (!hasGame) return false } - const minP = priceRange.min ? Number(priceRange.min) : 0 - const maxP = priceRange.max ? Number(priceRange.max) : Infinity + const minP = deferredPriceRange.min ? Number(deferredPriceRange.min) : 0 + const maxP = deferredPriceRange.max ? Number(deferredPriceRange.max) : Infinity if (item.minPrice < minP) return false - if (priceRange.max && item.minPrice > maxP) return false + if (deferredPriceRange.max && item.minPrice > maxP) return false if (onlyOnline && !item.hasAvailable) return false if (item.shop.rating < Number(minRating)) return false return true }) - }, [shopResultItems, searchQuery, selectedGames, priceRange, onlyOnline, minRating]) + }, [shopResultItems, searchQuery, selectedGames, deferredPriceRange, onlyOnline, minRating]) const sortedResults = useMemo(() => { const playerResults: SearchResult[] = filteredPlayers.map((player) => ({ diff --git a/app/(main)/shop/[id]/page.tsx b/app/(main)/shop/[id]/page.tsx index 412e491..3aef98c 100644 --- a/app/(main)/shop/[id]/page.tsx +++ b/app/(main)/shop/[id]/page.tsx @@ -8,13 +8,7 @@ import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { Separator } from "@/components/ui/separator" -import { - isFavorited as checkFavorited, - getShopById, - listPlayersByShop, - listReviews, - listServices, -} from "@/lib/api" +import { getShopById, listPlayersByShop, listReviews, listServices } from "@/lib/api" interface PageProps { params: Promise<{ id: string }> @@ -32,8 +26,6 @@ export default async function ShopPage({ params }: PageProps) { const playerIds = shopPlayers.map((p) => p.id) const shopServices = listServices().filter((s) => playerIds.includes(s.playerId)) const shopReviews = listReviews().filter((r) => playerIds.includes(r.toUserId)) - const isFavorited = checkFavorited("u1", "shop", shop.id) - const sortedSections = [...shop.templateConfig.sections] .filter((s) => s.enabled) .sort((a, b) => a.order - b.order) @@ -101,7 +93,7 @@ export default async function ShopPage({ params }: PageProps) {

@@ -144,7 +136,7 @@ export default async function ShopPage({ params }: PageProps) {
{shopServices.map((service) => ( - +
{service.gameName} @@ -155,18 +147,20 @@ export default async function ShopPage({ params }: PageProps) {
{service.title}
- +

{service.description}

{service.rankRange && ( -
+
段位:{service.rankRange}
)} - +
+ +
))} diff --git a/app/(order)/chat/page.tsx b/app/(order)/chat/page.tsx index c61572d..b8e0b66 100644 --- a/app/(order)/chat/page.tsx +++ b/app/(order)/chat/page.tsx @@ -16,7 +16,7 @@ export default function ChatListPage() {

消息

-
+
{sessions.map((session) => { const other = session.participants.find((participant) => participant.id !== userId) ?? @@ -58,10 +58,12 @@ export default function ChatListPage() { })} {sessions.length === 0 && ( -
- - 暂无消息 -
+ + + + 暂无消息 + + )}
diff --git a/components/header.tsx b/components/header.tsx index 524dc2a..0980fc4 100644 --- a/components/header.tsx +++ b/components/header.tsx @@ -93,44 +93,48 @@ export function Header() { ? `/player/${user.id}` : "/settings" : currentRole === "owner" - ? `/shop/${ownerShop?.id ?? "shop1"}` + ? ownerShop + ? `/shop/${ownerShop.id}` + : "/dashboard/shop" : user ? `/user/${user.id}` : "/settings" return (
-
- - - 聚玩 - +
+
+ + + 聚玩 + - + +
-
+
-
+
{isAuthenticated ? ( <>