diff --git a/src/App.js b/src/App.js index 4d1d294e..600abff3 100644 --- a/src/App.js +++ b/src/App.js @@ -70,7 +70,7 @@ const Expert = Loadable({ loading: Loading, }) // 启智2022 (为此竞赛定制化页面以及内容) -const Qz2022 = Loadable({ +const Competition = Loadable({ loader: () => import('./military/qz2022'), loading: Loading, }) @@ -134,11 +134,6 @@ const AboutUs = Loadable({ // loading: Loading, // }); -// 首页 -const HomePage = Loadable({ - loader: () => import('./home'), - loading: Loading, -}); // 管理页面 const Managements = Loadable({ @@ -382,7 +377,7 @@ class App extends Component { {/*专家评审*/} {/*启智2022*/} - + { - const { history, current_user } = props; + const { history, current_user, match } = props; const { location } = history; const { pathname } = location; const [active, setActive] = useState(); @@ -77,13 +78,15 @@ const Qz2022 = (props) => { const [fixedTop, setFixedTop] = useState(''); + const { competitionId } = match.params; + const menu = ( - { current_user && !current_user.login && props.showLoginDialog() }}>报名列表 + { current_user && !current_user.login && props.showLoginDialog() }}>报名列表 - { current_user && !current_user.login && props.showLoginDialog() }}>作品列表 + { current_user && !current_user.login && props.showLoginDialog() }}>作品列表 ); @@ -101,16 +104,6 @@ const Qz2022 = (props) => { } }, []); - // useEffect(()=>{ - // let footer=document.querySelector('.newFooter'); - // let loading=document.querySelector('..ant-spin-nested-loading'); - // if((footer.offsetTop +107) { } useEffect(() => { - // 获取启智2022详情 - getQz2022().then(response => { + // 获取竞赛详情 + getQz2022(competitionId).then(response => { if (response && response.status === 200) { setQzDetail(response.data.data); } @@ -133,7 +126,7 @@ const Qz2022 = (props) => { useEffect(() => { // 获取用户参与竞赛状态 - userCompetitionStatus('qz2022').then(response => { + userCompetitionStatus(competitionId).then(response => { if (response && response.status === 200) { setEnrollStatus(response.data.data); } @@ -152,59 +145,60 @@ const Qz2022 = (props) => { function goToRefer() { if (current_user && !current_user.login) { props.showLoginDialog(); - }else if(enrollStatus && !enrollStatus.enroll_status){ + } else if (enrollStatus && !enrollStatus.enroll_status) { props.showNotification("您还未报名竞赛!"); - }else if(enrollStatus && enrollStatus.status === 0){ + } else if (enrollStatus && enrollStatus.status === 0) { props.showNotification("报名信息被管理员驳回!"); } else { !referStatus ? props.showNotification(!referEnd ? `竞赛尚未开始提交作品,提交作品开始时间为:${qzDetail && qzDetail.enroll_date.substring(0, 10)}` : "比赛已结束") : ""; } } - const is_local= qzDetail &&qzDetail.is_local; - const banner_url= qzDetail &&qzDetail.banner_url; + const is_local = qzDetail && qzDetail.is_local; + const banner_url = qzDetail && qzDetail.banner_url && getImageUrl(qzDetail.banner_url); return ( {/* banner图+选项 */} - + + {pathname.indexOf("qz2022") && }
- {paths.indexOf(active) !== -1 &&
    -
  • - -
  • -
  • - 首页 -
  • -
  • - 赛事指南 -
  • -
  • - 通知公告 -
  • - {/* 处于报名阶段正常跳转到报名页面,不处于右侧弹消息 */} -
  • - {current_user && current_user.login ? !applyStatus && props.showNotification("报名时间已截止") : props.showLoginDialog()}}>参赛报名 -
  • -
  • - 提案提交 -
  • - {/*
  • - 参赛报名 + {paths.indexOf(active) !== -1 &&
      +
    • + +
    • +
    • + 首页 +
    • +
    • + 赛事指南 +
    • +
    • + 通知公告 +
    • + {/* 处于报名阶段正常跳转到报名页面,不处于右侧弹消息 */} +
    • + { current_user && current_user.login ? !applyStatus && props.showNotification("报名时间已截止") : props.showLoginDialog() }}>参赛报名 +
    • +
    • + 提案提交 +
    • + {/*
    • + 参赛报名
    • */} {/*
    • - 提案提交 + 提案提交
    • */}
    • - 数据统计 + 数据统计
    • - 交流互动 + 交流互动
    • - 联系我们 + 联系我们
    • {qzDetail && qzDetail.is_manager &&
    • @@ -217,91 +211,91 @@ const Qz2022 = (props) => { {/* 通知公告详情页 */} - () } > {/* 通知公告编辑页 */} - () + ({ match }) => () } > {/* 通知公告新增页 */} - () + ({ match }) => () } > {/* 大赛介绍、大赛指南、关于我们 编辑页 */} - () + ({ match }) => () } > {/* 通知公告 */} - () } > {/* 参赛报名 */} - () + () => () } > {/* 提案提交 */} - () + () => () } > {/* 交流互动 */} - () + () => () } > {/* 联系我们 */} - () + () => () } > {/* 数据统计 */} - () } > {/* 后台管理-报名列表 */} - () + () => () } > {/* 后台管理-作品列表 */} - () + () => () } > {/* 大赛介绍 */} - () } > {/* 大赛指南 */} - () + () => () } > {/* 大赛介绍 */} - () } diff --git a/src/military/qz2022/api.js b/src/military/qz2022/api.js index 8d18ee84..e2085e1b 100644 --- a/src/military/qz2022/api.js +++ b/src/military/qz2022/api.js @@ -6,8 +6,8 @@ export async function userCompetitionStatus(id) { } // 启智2022详情接口 -export function getQz2022() { - return axios.get(`/competition_infos/qz2022.json`); +export function getQz2022(competitionId) { + return axios.get(`/competition_infos/${competitionId}.json`); } // 报名启智2022 竞赛?debug=teacher @@ -21,8 +21,8 @@ export async function enrollUpdate(data){ } // 统计启智2022 竞赛 -export async function stattistics(data){ - return axios.get( `/competition_infos/qz2022/statistics.json`); +export async function stattistics(competitionId){ + return axios.get( `/competition_infos/${competitionId}/statistics.json`); } // 竞赛提交作品 diff --git a/src/military/qz2022/apply/index.jsx b/src/military/qz2022/apply/index.jsx index 0673cf39..efc86e39 100644 --- a/src/military/qz2022/apply/index.jsx +++ b/src/military/qz2022/apply/index.jsx @@ -37,6 +37,12 @@ export default Form.create()((props) => { setSourceBy(enrollStatus.enroll_info.subject_source_type); setFieldsValue(enrollStatus.enroll_info); } + enrollStatus&&enrollStatus.enroll_info&&enrollStatus.enroll_info.enroll_template&& + setFiles([{...enrollStatus.enroll_info.enroll_template, + uid:"rc-upload-"+enrollStatus.enroll_info.enroll_template.id, + name:enrollStatus.enroll_info.enroll_template.title, + response:{id:enrollStatus.enroll_info.enroll_template.id} + }]); },[current_user, enrollStatus]) // form表单公共处理函数 @@ -145,6 +151,7 @@ export default Form.create()((props) => { function handleChange(info) { if (info.file.status === 'uploading' || info.file.status === "done" || info.file.status === 'removed') { setLoading(true); + console.log(info.fileList); setFiles(appendFileSizeToUploadFileAll(info.fileList).slice(-1)); } if(info.file.status === "done" || info.file.status === 'removed'){ @@ -298,9 +305,11 @@ export default Form.create()((props) => {
报名表扫描件: - {enrollStatus && enrollStatus.enroll_info.enroll_template ? + {/* */} + {/* {enrollStatus && enrollStatus.enroll_info.enroll_template ? {enrollStatus.enroll_info.enroll_template.title} - :: */} + { >
- 1. 您可选择是否上传单位盖章后的报名表扫描件
- 2. 上传附件名称需更改为“单位名称+参赛团队负责人”
- 3. 支持上传单个zip、rar格式文件,文件大小限制10M
- 4. 密级必须为{qzDetail && qzDetail.is_local ? '秘密及以下' : '公开级'}
-
} +
1. 您已成功报名,此处报名表扫描件不是必填项!!!
+ 2. 您可选择是否上传单位盖章后的报名表扫描件
+ 3. 上传附件名称需更改为“单位名称+参赛团队负责人”
+ 4. 支持上传单个zip、rar格式文件,文件大小限制10M
+ 5. 密级必须为{qzDetail && qzDetail.is_local ? '秘密及以下' : '公开级'} + {enrollStatus && enrollStatus.enroll_info.enroll_template ?
您已成功提交报名表扫描件,若再次提交,将覆盖您上一次的提交记录
:""} +
+ + + {/* } */}
- {enrollStatus && !enrollStatus.enroll_info.enroll_template && } + {enrollStatus && } } {enrollStatus && (!enrollStatus.enroll_status || enrollStatus.status === 0) &&
diff --git a/src/military/qz2022/apply/index.scss b/src/military/qz2022/apply/index.scss index 9435f942..a2e2ad45 100644 --- a/src/military/qz2022/apply/index.scss +++ b/src/military/qz2022/apply/index.scss @@ -111,6 +111,9 @@ font-size: 14px; color: gray; } + .text_red{ + color: red; + } .download{ color: #2e5bfe; &:hover{ diff --git a/src/military/qz2022/components/infoModal/index.jsx b/src/military/qz2022/components/infoModal/index.jsx new file mode 100644 index 00000000..0b762d05 --- /dev/null +++ b/src/military/qz2022/components/infoModal/index.jsx @@ -0,0 +1,48 @@ +import React, { memo, useEffect, useState } from 'react'; +import { Modal } from 'antd'; +import { Link } from 'react-router-dom'; + +import bg from '../../image/infoModal.jpg'; +import './index.scss'; + + + +function QzModal() { + + const [visible, setVisible] = useState(false); + + useEffect(() => { + let qzInfoTime = localStorage.qzInfoTime; + let nowTime = new Date().getTime(); + let lastTime=new Date("2022-05-26").getTime(); + if(nowTime>lastTime)return; + if (qzInfoTime) { + if (nowTime - qzInfoTime > 24 * 3600 * 1000) { + // 延时展示,保证渲染modal不会白屏 + setTimeout(()=>{setVisible(true);},800) + localStorage.setItem('qzInfoTime', nowTime); + } + } else { + setTimeout(()=>{setVisible(true);},800) + localStorage.setItem('qzInfoTime', nowTime); + } + }, []) + + return ( + { setVisible(false) }} + footer={null} + className='qzInfoModal' + width='728px' + maskClosable={false} + > + + + {/* 查看详情 */} + + ) +} + +export default memo(QzModal); \ No newline at end of file diff --git a/src/military/qz2022/components/infoModal/index.scss b/src/military/qz2022/components/infoModal/index.scss new file mode 100644 index 00000000..133e0034 --- /dev/null +++ b/src/military/qz2022/components/infoModal/index.scss @@ -0,0 +1,49 @@ +.qzInfoModal { + top:calc(50vh - 250px); + .ant-modal-body { + padding: 0; + background: #fff; + + img { + border-radius: 2px; + width: 100%; + } + } + + .ant-modal-header { + height: 0; + background: #fff; + display: none !important; + } + + .ant-modal-close { + top: -50px !important; + right: -50px; + } + .ant-modal-close-icon { + border: 1px solid #fff; + color: #fff; + border-radius: 50%; + padding: 5%; + } + + .qz-btn { + position: absolute; + bottom: -70px; + left: 295px; + width: 137px; + height: 49px; + background-color: #e96d2a; + border-color: #e96d2a; + border-radius: 6px; + color: #fff; + font-size:16px; + text-align: center; + line-height: 49px; + &:hover{ + color: #fff !important; + background-color: #f96d2a; + border-color: #f96d2a; + } + } +} diff --git a/src/military/qz2022/image/infoModal.jpg b/src/military/qz2022/image/infoModal.jpg new file mode 100644 index 00000000..87d47a3f Binary files /dev/null and b/src/military/qz2022/image/infoModal.jpg differ diff --git a/src/military/qz2022/statistics/index.jsx b/src/military/qz2022/statistics/index.jsx index 55b2ade5..3e2dbd06 100644 --- a/src/military/qz2022/statistics/index.jsx +++ b/src/military/qz2022/statistics/index.jsx @@ -12,7 +12,8 @@ import EchartBar from './EchartBar'; const initBarYData = [[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]]; -function Statistics({ showNotification, qzDetail }) { +function Statistics({ showNotification, qzDetail,match }) { + const {competitionId}=match.params; const is_local= qzDetail &&qzDetail.is_local; const [pieArr, setPieArr] = useState([]); @@ -24,7 +25,7 @@ function Statistics({ showNotification, qzDetail }) { useEffect(() => { - stattistics().then(res => { + stattistics(competitionId).then(res => { if (res && res.data && Array.isArray(res.data.data)) { let pieArrList = []; let xData = []; diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js index 3507d678..7d65b0c9 100644 --- a/src/modules/tpm/TPMIndexHOC.js +++ b/src/modules/tpm/TPMIndexHOC.js @@ -280,7 +280,7 @@ export function TPMIndexHOC(WrappedComponent, headFoot) { resetUserInfo:this.fetchUsers, showCompeleteDialog:this.showCompeleteDialog }; - let qz2022 = this.props.match.path.includes('/competition/qz2022'); + let competition = this.props.match.path.includes('/competition'); return (
: ""} {/*
*/} {/* */} - {!qz2022&&} + {!competition&&}
- {!publicNav && !qz2022&&
} + {!publicNav && !competition&&
} { current_user && this.initCommonState(user)}