feat: 球局详情完善 & 球局列表默认查一个月

This commit is contained in:
2025-09-11 14:02:32 +08:00
parent 35d3b12737
commit 8a0cc2373b
3 changed files with 14 additions and 7 deletions

View File

@@ -88,6 +88,7 @@
height: 100%;
aspect-ratio: 1/1;
border-radius: 20px;
object-fit: cover;
}
.cover-image-item-delete {

View File

@@ -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 (
<View className="detail-page-content-participants">
<View className="participants-title">
<Text></Text>
<Text>·</Text>
<Text> 3</Text>
<Text>{leftCount > 0 ? `剩余空位 ${leftCount}` : '已满员'}</Text>
</View>
<View className="participants-list">
{/* application */}
<View
{can_join && <View
className="participants-list-application"
onClick={() => {
Taro.showToast({ title: "To be continued", icon: "none" });
handleJoinGame()
// Taro.showToast({ title: "To be continued", icon: "none" });
}}
>
<Image
@@ -648,7 +652,7 @@ function Participants(props) {
src={img.ICON_DETAIL_APPLICATION_ADD}
/>
<Text className="participants-list-application-text"></Text>
</View>
</View>}
{/* participants list */}
<ScrollView className="participants-list-scroll" scrollX>
<View
@@ -957,7 +961,7 @@ function Index() {
{/* gameplay requirements */}
<GamePlayAndRequirement detail={detail} />
{/* participants */}
<Participants detail={detail} />
<Participants detail={detail} handleJoinGame={handleJoinGame} />
{/* supplemental notes */}
<SupplementalNotes detail={detail} />
{/* organizer and recommend games by organizer */}

View File

@@ -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: "", // 场地类型