feat: wire order and chat state flow
This commit is contained in:
@@ -7,11 +7,12 @@ import { Button } from "@/components/ui/button"
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
|
||||
import { Label } from "@/components/ui/label"
|
||||
import { Textarea } from "@/components/ui/textarea"
|
||||
import { mockOrders } from "@/lib/mock"
|
||||
import { useOrderStore } from "@/store/orders"
|
||||
|
||||
export default function ReviewPage({ params }: { params: Promise<{ id: string }> }) {
|
||||
const { id } = use(params)
|
||||
const order = mockOrders.find((o) => o.id === id)
|
||||
const order = useOrderStore((state) => state.orders.find((item) => item.id === id))
|
||||
const updateOrderStatus = useOrderStore((state) => state.updateOrderStatus)
|
||||
const [rating, setRating] = useState(0)
|
||||
const [hoverRating, setHoverRating] = useState(0)
|
||||
const [content, setContent] = useState("")
|
||||
@@ -97,7 +98,14 @@ export default function ReviewPage({ params }: { params: Promise<{ id: string }>
|
||||
<span>评价采用密封机制:你的评价将在双方都提交后同时揭晓。</span>
|
||||
</div>
|
||||
|
||||
<Button className="w-full" disabled={rating === 0} onClick={() => setSubmitted(true)}>
|
||||
<Button
|
||||
className="w-full"
|
||||
disabled={rating === 0}
|
||||
onClick={() => {
|
||||
updateOrderStatus(id, "completed")
|
||||
setSubmitted(true)
|
||||
}}
|
||||
>
|
||||
提交评价
|
||||
</Button>
|
||||
</CardContent>
|
||||
|
||||
Reference in New Issue
Block a user