fix: 详情管理功能按钮逻辑修改
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -8,4 +8,6 @@ node_modules/
|
||||
src/config/env.ts
|
||||
.vscode
|
||||
*.http
|
||||
.cursor
|
||||
.codewiz
|
||||
|
||||
|
||||
@@ -189,7 +189,8 @@ export default forwardRef(function GameManagePopup(props, ref) {
|
||||
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 || [])
|
||||
.filter((item) => item.status === "joined")
|
||||
@@ -207,7 +208,7 @@ export default forwardRef(function GameManagePopup(props, ref) {
|
||||
style={{ minHeight: "unset" }}
|
||||
>
|
||||
<View className={styles.container}>
|
||||
{!finished && !inTwoHours && !hasOtherParticiappants && (
|
||||
{!finished && !hasOtherParticiappants && beforeStart && (
|
||||
<View className={styles.button} onClick={handleEditGame}>
|
||||
编辑活动
|
||||
</View>
|
||||
@@ -217,12 +218,12 @@ export default forwardRef(function GameManagePopup(props, ref) {
|
||||
重新发布
|
||||
</View>
|
||||
)}
|
||||
{!finished && !inTwoHours && !hasOtherParticiappants && (
|
||||
{!finished && beforeStart && (
|
||||
<View className={styles.button} onClick={handleCancelGame}>
|
||||
取消活动
|
||||
</View>
|
||||
)}
|
||||
{!finished && hasJoin && (
|
||||
{!finished && beforeStart && hasJoin && (
|
||||
<View className={styles.button} onClick={handleQuitGame}>
|
||||
退出活动
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user