fix: 修复走查样式问题
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user