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%; height: 100%;
aspect-ratio: 1/1; aspect-ratio: 1/1;
border-radius: 20px; border-radius: 20px;
object-fit: cover;
} }
.cover-image-item-delete { .cover-image-item-delete {

View File

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

View File

@@ -1,4 +1,5 @@
import { create } from "zustand"; import { create } from "zustand";
import dayjs from "dayjs";
import { import {
getGamesList, getGamesList,
getGamesIntegrateList, getGamesIntegrateList,
@@ -19,9 +20,10 @@ import dateRangeUtils from '@/utils/dateRange'
type TennisStore = ListState & ListActions; type TennisStore = ListState & ListActions;
const toDate = dateRangeUtils?.formatDate(new Date()) 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 = { const defaultFilterOptions: IFilterOptions = {
dateRange: [toDate, toDate], // 日期区间 dateRange: defaultDateRange, // 日期区间
timeSlot: "", // 时间段 timeSlot: "", // 时间段
ntrp: [1, 5], // NTRP 水平区间 ntrp: [1, 5], // NTRP 水平区间
venueType: "", // 场地类型 venueType: "", // 场地类型