fix: 详情管理功能按钮逻辑修改
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -8,4 +8,6 @@ node_modules/
|
|||||||
src/config/env.ts
|
src/config/env.ts
|
||||||
.vscode
|
.vscode
|
||||||
*.http
|
*.http
|
||||||
|
.cursor
|
||||||
|
.codewiz
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user