From 8a0cc2373b379d85e83614755e46488ac65a8fd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=9D=B0?= Date: Thu, 11 Sep 2025 14:02:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=90=83=E5=B1=80=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E5=AE=8C=E5=96=84=20&=20=E7=90=83=E5=B1=80=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=9F=A5=E4=B8=80=E4=B8=AA=E6=9C=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UploadCover/index.scss | 1 + src/pages/detail/index.tsx | 16 ++++++++++------ src/store/listStore.ts | 4 +++- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/components/UploadCover/index.scss b/src/components/UploadCover/index.scss index e16b3a0..cb89e60 100644 --- a/src/components/UploadCover/index.scss +++ b/src/components/UploadCover/index.scss @@ -88,6 +88,7 @@ height: 100%; aspect-ratio: 1/1; border-radius: 20px; + object-fit: cover; } .cover-image-item-delete { diff --git a/src/pages/detail/index.tsx b/src/pages/detail/index.tsx index f880582..ea2820a 100644 --- a/src/pages/detail/index.tsx +++ b/src/pages/detail/index.tsx @@ -625,22 +625,26 @@ function GamePlayAndRequirement(props) { // 参与者 function Participants(props) { - const { detail = {} } = props; + const { detail = {}, handleJoinGame } = props; const participants = detail.participants || []; + const { participant_count, max_participants, user_action_status = {} } = detail + const { can_join } = user_action_status + const leftCount = max_participants - participant_count const organizer_id = Number(detail.publisher_id); return ( 参与者 · - 剩余空位 3 + {leftCount > 0 ? `剩余空位 ${leftCount}` : '已满员'} {/* application */} - { - Taro.showToast({ title: "To be continued", icon: "none" }); + handleJoinGame() + // Taro.showToast({ title: "To be continued", icon: "none" }); }} > 申请加入 - + } {/* participants list */} {/* participants */} - + {/* supplemental notes */} {/* organizer and recommend games by organizer */} diff --git a/src/store/listStore.ts b/src/store/listStore.ts index 7de11ab..d48640e 100644 --- a/src/store/listStore.ts +++ b/src/store/listStore.ts @@ -1,4 +1,5 @@ import { create } from "zustand"; +import dayjs from "dayjs"; import { getGamesList, getGamesIntegrateList, @@ -19,9 +20,10 @@ import dateRangeUtils from '@/utils/dateRange' type TennisStore = ListState & ListActions; const toDate = dateRangeUtils?.formatDate(new Date()) +const defaultDateRange: [string, string] = [dayjs().format('YYYY-MM-DD'), dayjs().add(1, 'M').format('YYYY-MM-DD')] const defaultFilterOptions: IFilterOptions = { - dateRange: [toDate, toDate], // 日期区间 + dateRange: defaultDateRange, // 日期区间 timeSlot: "", // 时间段 ntrp: [1, 5], // NTRP 水平区间 venueType: "", // 场地类型