fix: 修复走查样式问题

This commit is contained in:
2025-10-26 18:00:32 +08:00
parent 753b6b0c2c
commit 6dc9c7eff2
12 changed files with 213 additions and 43 deletions

View File

@@ -10,6 +10,7 @@ import CommonPopup from "../CommonPopup";
import styles from "./index.module.scss";
import detailService, { MATCH_STATUS } from "@/services/detailService";
import { useUserInfo } from "@/store/userStore";
import dayjs from "dayjs";
const CancelPopup = forwardRef((props, ref) => {
const { detail } = props;
@@ -185,6 +186,12 @@ export default forwardRef(function GameManagePopup(props, ref) {
detail.match_status
);
const inTwoHours = dayjs(detail.start_time).diff(dayjs(), "hour") < 2;
const hasOtherParticiappants = (detail.participants || [])
.filter((item) => item.status === "joined")
.some((item) => item.user.id !== userInfo.id);
return (
<>
<CommonPopup
@@ -194,17 +201,20 @@ export default forwardRef(function GameManagePopup(props, ref) {
zIndex={1001}
enableDragToClose={false}
onClose={onClose}
style={{ minHeight: "unset" }}
>
<View className={styles.container}>
<View className={styles.button} onClick={handleEditGame}>
</View>
{!inTwoHours && !hasOtherParticiappants && (
<View className={styles.button} onClick={handleEditGame}>
</View>
)}
{finished && (
<View className={styles.button} onClick={handleRepubGame}>
</View>
)}
{!finished && (
{!inTwoHours && !hasOtherParticiappants && (
<View className={styles.button} onClick={handleCancelGame}>
</View>