diff --git a/src/pages/Competitions/Detail/index.tsx b/src/pages/Competitions/Detail/index.tsx index 37ce6ebe3..41f6d9006 100644 --- a/src/pages/Competitions/Detail/index.tsx +++ b/src/pages/Competitions/Detail/index.tsx @@ -89,7 +89,7 @@ const competitionDetails: FC = ({ const [isshowmodal,setisshowmodal]=useState(false); const [isAddmodel, setIsAddmodel] = useState(false) //新建战队 const [isJoin, setJoin] = useState(false) //加入战队 - const [isClick,setIsClick]=useState(true)//增加参数 防止点击过快 多次调用 + const [isClick,setIsClick]=useState(true)//增加参数 防止点击过快 多次调用 const [showphone,setshowphone]=useState(false); const [isopen,setisopen]=useState(false); const [datas,setdatas]=useState(''); @@ -103,12 +103,12 @@ const competitionDetails: FC = ({ setSubGitlinkShow(true); } },[user?.userInfo]) - + useEffect(() => { if (identifier) { setTimeout(() => { init(); - }, 200); + }, 200); } }, [identifier]) @@ -166,18 +166,18 @@ const competitionDetails: FC = ({ type: 'competitions/getItem', payload: { url: item.module_url, - + } }) } - + setIsRanKing(false) setIsAward(false) setMdTab(false) setItemData(data); setshowmake(false); setentrance(false) - + setModelType(item.module_type); if (item.module_type === "chart") { setIsRanKing(true) @@ -208,10 +208,10 @@ const competitionDetails: FC = ({ setIssee(true); localStorage.setItem('issee','1'); } - + } - + async function gotocourse(e: any, item: any, url: string) { e.stopPropagation(); @@ -241,15 +241,15 @@ const competitionDetails: FC = ({ } - // if (HeaderDetail?.is_authentication && !user?.userInfo?.authentication) { - // dispatch({ - // type: 'shixunsDetail/setActionTabs', - // payload: { - // key: 'Banner-Auth', - // }, - // }) - // return - // } + if (HeaderDetail?.is_authentication && !user?.userInfo?.authentication) { + dispatch({ + type: 'shixunsDetail/setActionTabs', + payload: { + key: 'Banner-Auth', + }, + }) + return + } if (HeaderDetail?.enroll_url) { openNewWindow(HeaderDetail?.enroll_url); return @@ -274,7 +274,7 @@ const competitionDetails: FC = ({ } } } else { - + if (StaffDetail.enrolled === true) { openNewWindow(url) return; @@ -320,7 +320,7 @@ const competitionDetails: FC = ({ // owner:user?.userInfo?.login // } // }) - // // data.data || + // // data.data || // let a = data.data; // console.log(a); // let filter = a.filter((i:any)=>i === identifier.toString()); @@ -392,7 +392,7 @@ const competitionDetails: FC = ({ async function getTabResults() { - + setTabResults( await dispatch({ type: 'competitions/TabResults', @@ -588,8 +588,8 @@ async function JoinTeams(name: any) { } }>{StaffDetail.enrolled ? HeaderDetail.need_attachment ? '上传作品' : '已报名' : HeaderDetail?.enroll_url ? '前往大赛官网报名' : '立即报名'} : null} - - + + {user.userInfo.real_name != "游客" && !HeaderDetail?.enroll_url && gotocourse(e, HeaderDetail, HeaderDetail.mode === 2 ? 'ismodel' : HeaderDetail.personal ? 'personal' : `/competitions/index/${HeaderDetail.identifier}/enroll`)} className={styles.myteam}>{isSuperAdmin() ? '参赛战队>>' : '我的战队>>'}} @@ -686,9 +686,9 @@ async function JoinTeams(name: any) { setHeaderDetail(res) }} /> - {setVisible(false)}} + {setVisible(false)}} onOk={()=>{ setVisible(false); setisshowmodal(true); diff --git a/src/pages/Competitions/Index/index.tsx b/src/pages/Competitions/Index/index.tsx index e296f0431..da253770b 100755 --- a/src/pages/Competitions/Index/index.tsx +++ b/src/pages/Competitions/Index/index.tsx @@ -64,7 +64,7 @@ const competitionsIndexPage: FC = ({ const [isshowmodal, setisshowmodal] = useState(false); const [isAddmodel, setIsAddmodel] = useState(false) //新建战队 const [isJoin, setJoin] = useState(false) //加入战队 - const [isClick, setIsClick] = useState(true)//增加参数 防止点击过快 多次调用 + const [isClick, setIsClick] = useState(true)//增加参数 防止点击过快 多次调用 let [items, setitems] = useState([]); const [showphone,setshowphone]=useState(false); const [isopen,setisopen]=useState(false) @@ -134,15 +134,15 @@ const competitionsIndexPage: FC = ({ if (!handleVerify(dispatch)) { return; } - // if (item?.is_authentication && !user?.userInfo?.authentication) { - // dispatch({ - // type: 'shixunsDetail/setActionTabs', - // payload: { - // key: 'Banner-Auth', - // }, - // }); - // return; - // } + if (item?.is_authentication && !user?.userInfo?.authentication) { + dispatch({ + type: 'shixunsDetail/setActionTabs', + payload: { + key: 'Banner-Auth', + }, + }); + return; + } if (url === 'ismodel') { if (item.member_of_course === true) { openNewWindow(`/classrooms/${item.course_id}`); @@ -324,7 +324,7 @@ const competitionsIndexPage: FC = ({ setshowphone(true) return } - + let data =await dispatch({ type: 'competitions/GetKylinId', payload: { @@ -649,9 +649,9 @@ const competitionsIndexPage: FC = ({ payload: { ...competitions.listParams }, }); }} /> - {setVisible(false)}} + {setVisible(false)}} onOk={()=>{ setVisible(false); setisshowmodal(true);