-
价格区间 (元)
+
+ 价格区间 (元)
+ {(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 ? (
<>