fix: 详情管理功能按钮逻辑修改

This commit is contained in:
2026-02-09 20:07:05 +08:00
parent 632da5112d
commit 159d81ed12
2 changed files with 7 additions and 4 deletions

2
.gitignore vendored
View File

@@ -8,4 +8,6 @@ node_modules/
src/config/env.ts src/config/env.ts
.vscode .vscode
*.http *.http
.cursor
.codewiz

View File

@@ -189,7 +189,8 @@ export default forwardRef(function GameManagePopup(props, ref) {
detail.match_status, detail.match_status,
); );
const inTwoHours = dayjs(detail.start_time).diff(dayjs(), "hour") < 2; // const inTwoHours = dayjs(detail.start_time).diff(dayjs(), "hour") < 2;
const beforeStart = dayjs(detail.start_time).isAfter(dayjs());
const hasOtherParticiappants = (detail.participants || []) const hasOtherParticiappants = (detail.participants || [])
.filter((item) => item.status === "joined") .filter((item) => item.status === "joined")
@@ -207,7 +208,7 @@ export default forwardRef(function GameManagePopup(props, ref) {
style={{ minHeight: "unset" }} style={{ minHeight: "unset" }}
> >
<View className={styles.container}> <View className={styles.container}>
{!finished && !inTwoHours && !hasOtherParticiappants && ( {!finished && !hasOtherParticiappants && beforeStart && (
<View className={styles.button} onClick={handleEditGame}> <View className={styles.button} onClick={handleEditGame}>
</View> </View>
@@ -217,12 +218,12 @@ export default forwardRef(function GameManagePopup(props, ref) {
</View> </View>
)} )}
{!finished && !inTwoHours && !hasOtherParticiappants && ( {!finished && beforeStart && (
<View className={styles.button} onClick={handleCancelGame}> <View className={styles.button} onClick={handleCancelGame}>
</View> </View>
)} )}
{!finished && hasJoin && ( {!finished && beforeStart && hasJoin && (
<View className={styles.button} onClick={handleQuitGame}> <View className={styles.button} onClick={handleQuitGame}>
退 退
</View> </View>