This commit is contained in:
谢思 2023-04-27 11:05:40 +08:00
parent c525191ac3
commit 5e12fbdb3b
9 changed files with 61 additions and 39 deletions

View File

@ -12,7 +12,8 @@ import './index.scss';
import { FlexAJ } from '../../forge/Component/layout';
const Option = Select.Option;
function Apply(props) {
const phonereg = /^([1][3456789])\d{9}$/
const phonereg = /(^|\s*\+?0?0?86|\D)(1\d{2})[-\s]{0,3}(\d{4})[-\s]{0,3}(\d{4})(?=\D|$)/
const emailreg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/
const {form, current_user, showNotification, round} = props;
const {getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll } = form;
const [reload, setReload] = useState(undefined);
@ -53,12 +54,16 @@ function Apply(props) {
//
current_user && getUserApplyInfo({userId: current_user.user_id, round}).then(response=>{
if(response && response.message === "success"){
const {projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, registrationTaskList, projectLogoId} = response.data;
setUserApplyInfo(response.data);
if(!response.data){
return
}
const {projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, registrationTaskList, projectLogoId, contactMail} = response.data;
const taskInfo = {};
const taskCountArr = []
registrationTaskList.map((item, index)=>{
taskCountArr.push(index+1);
const{taskName, taskUrl, taskDifficulty, taskReward, tutorName, tutorMail, taskDesc} = item;
const{taskName, taskUrl, taskDifficulty, taskReward, tutorName, tutorMail, taskDesc, tutorPhone} = item;
taskInfo[`taskName${index+1}`] = taskName;
taskInfo[`taskUrl${index+1}`] = taskUrl;
taskInfo[`taskDifficulty${index+1}`] = taskDifficulty;
@ -66,14 +71,14 @@ function Apply(props) {
taskInfo[`tutorName${index+1}`] = tutorName;
taskInfo[`tutorMail${index+1}`] = tutorMail;
taskInfo[`taskDesc${index+1}`] = taskDesc;
taskInfo[`tutorPhone${index+1}`] = tutorPhone;
})
setTaskCount(taskCountArr);
setFieldsValue({
projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro,
projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, contactMail,
...taskInfo,
logo: {file:{response:{id: projectLogoId}}}
})
setUserApplyInfo(response.data);
}
})
}, [reload])
@ -102,12 +107,13 @@ function Apply(props) {
tutorName: values[`tutorName${item}`],
tutorMail: values[`tutorMail${item}`],
taskDesc: values[`taskDesc${item}`],
tutorPhone: values[`tutorPhone${item}`],
round
})
})
const {projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro} = values;
const {projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, contactMail} = values;
const params ={
projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, registrationTaskList, round,
projectName, projectType, gitlinkUrl, contactName, contactPhone, projectIntro, registrationTaskList, round, contactMail,
projectLogoId: values.logo.file.response.id+"",
userId: current_user.user_id,
userName: current_user.username
@ -235,6 +241,13 @@ function Apply(props) {
{ pattern: phonereg, message: "请输入正确的手机号码"},],
<Input placeholder="输入项目联系人手机号码" onBlur={()=>{verify("name")}}/>
)}
{helper('联系人邮箱',
'',
'contactMail',
[{ required: true, message: "输入项目联系人邮箱" },
{ pattern: emailreg, message: "请输入正确的邮箱地址"},],
<Input placeholder="输入项目联系人邮箱" onBlur={()=>{verify("name")}}/>
)}
<div className='introArea'>{helper('社区简介',
'',
'projectIntro',
@ -265,9 +278,9 @@ function Apply(props) {
return <div className='taskApplyBox' key={item}>
<FlexAJ className='taskApplyTitleBox'>
<div className='taskApplyTitle font-16'>课题信息<span>{index+1}</span>/5)</div>
{index && <Button type="link" onClick={()=>{deleteTaskApply(item)}}><i className='iconfont icon-shanchuicon3 mr5 font-15'></i>删除</Button>}
{index>0 && <Button type="link" onClick={()=>{deleteTaskApply(item)}}><i className='iconfont icon-shanchuicon3 mr5 font-15'></i>删除</Button>}
</FlexAJ>
<TaskApply helper={helper} taskKey={item}/>
<TaskApply helper={helper} taskKey={item} phonereg={phonereg} emailreg={emailreg}/>
</div>
})}
{taskCount && taskCount.length<5 && <div>

View File

@ -3,8 +3,7 @@ import { Breadcrumb, Button, Form, Input, Select, Upload, Modal, InputNumber } f
import TextArea from 'antd/lib/input/TextArea';
const Option = Select.Option;
function TaskApply(props) {
const emailreg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/
const {helper, disabled, taskKey} = props;
const {helper, disabled, taskKey, phonereg, emailreg} = props;
//
const difficultyList = [
{id: 1, name: "低"},
@ -58,7 +57,14 @@ function TaskApply(props) {
{ max: 32, message: '超出限制长度32位字符请重新编辑' }],
<Input placeholder="请输入导师姓名" disabled = {disabled} className={disabled? "disabledInput":""}/>
)}
{helper('导师邮箱地址',
{helper('导师手机号',
'',
`tutorPhone${taskKey}`,
[{ required: true, message: "请输入导师手机号" },
{ pattern: phonereg, message: "请输入正确的电话号码"},],
<Input placeholder="请输入导师手机号" disabled = {disabled} className={disabled? "disabledInput":""}/>
)}
{helper('导师邮箱',
'',
`tutorMail${taskKey}`,
[{ required: true, message: "请输入导师邮箱地址" },

View File

@ -21,7 +21,7 @@ import './index.scss';
// round20221 20232
// period: 0
export default (props) => {
const { current_user, isGlccApplyDate, showNotification, studentApplyStart, history, secondStudentApplyDate, isStudentApplyDate, checkedTaskId, checkTime1, checkTime2, checkTime3, round, match:{params:{id}}, period} = props;
const { current_user, isGlccApplyDate, showNotification, studentApplyStart, history, secondStudentApplyDate, isStudentApplyDate, checkedTaskId, checkTime1, checkTime2, checkTime3, round, match:{params:{id}}, period, showLoginDialog} = props;
function goToApply() {
if (isGlccApplyDate) {
if (current_user && current_user.login) {
@ -69,6 +69,15 @@ export default (props) => {
history.push("/glcc/result");
}
//
function gotoCheckLogin(url){
if(current_user && current_user.login){
history.push(url);
return
}
showLoginDialog();
}
return (
<div className="glcc">
{/* <Banner /> */}
@ -99,14 +108,14 @@ export default (props) => {
{/* 当前glcc */}
{round === 2 && <div className="applyBox">
{/* 项目报名入口 */}
{period === 0 && <Link to={current_user && current_user.login ? `/glcc/apply` : `/login?go_page=/glcc/apply`} className="apply project" >
{period === 0 && <a onClick={()=>{gotoCheckLogin(`/glcc/apply`)}} className="apply project" >
<div>
<img src={apply1} alt="" className="applyIcon" />
<span className="hover-none"><span className="til">项目报名</span> </span>
{/* <span className="hover-show">项目报名已截止</span> */}
</div>
<div className="pt6">项目报名开启导师席位虚位以待</div>
</Link>}
</a>}
{/* 6.28.-7.1 审核结果仅对导师可见7.1之后对所有用户可见*/}
{/* {resultTime2 && <div className="apply" onClick={goToCheckResult}>
<div>
@ -188,7 +197,7 @@ export default (props) => {
</div> */}
</div>
</div>
<Lightspot period={period} history={history} isGlccApplyDate={isGlccApplyDate} current_user={current_user} showNotification={showNotification} goToStudent={goToStudent}/>
<Lightspot period={period} history={history} current_user={current_user} round={round} showLoginDialog={showLoginDialog}/>
<TimerShaft />
<Award />
<News />

View File

@ -1,22 +1,17 @@
import { Button } from 'antd';
import React from 'react';
import teacherImg from '../../img/teacher-img.png';
import lightspot1 from '../../img/lightspot1.png';
import lightspot2 from '../../img/lightspot2.png';
import lightspot3 from '../../img/lightspot3.png';
import lightspot4 from '../../img/lightspot4.png';
import './index.scss';
import { Link } from 'react-router-dom';
function Lightspot(props) {
const {current_user, isGlccApplyDate, showNotification, goToStudent, period, history} = props;
const {current_user, period, history, round, showLoginDialog} = props;
function goToApply(){
if(current_user && !current_user.login){
history.push(`/login?go_page=/glcc/apply`);
showLoginDialog();
return;
}
history.push(period === 0 ? `/glcc/apply` : `/glcc/subjects`);
@ -31,14 +26,13 @@ function Lightspot(props) {
<div className="teacher-text">
<h3 className="teacher-invite">有兴趣成为GLCC的导师吗</h3>
<div className="teacher-content">想要扩大项目知名度和影响力为开源项目吸引新鲜血液培养长期开发者通过GitLink平台与高校建立连接指导开源新人传授他们的开源文化享受开源的乐趣</div>
{period === 0 ? <div className='applyBut' onClick={goToApply}>立即报名</div> : <div className='applyBut project'><span className='hover-none'>项目报名</span><span className='hover-show'>项目报名已截止</span></div>}
{period === 0 && round === 2 ? <div className='applyBut' onClick={goToApply}>立即报名</div> : <div className='applyBut project'><span className='hover-none'>项目报名</span><span className='hover-show'>已结束</span></div>}
</div>
<div className="teacher-text">
<h3 className="teacher-invite">你是开源新手有兴趣参加GLCC吗</h3>
<div className="teacher-content">想要参与一线开源项目开发熟悉开源社区运作流程接受资深开源软件专家指导获得丰厚奖金和实习机会参加GLCC开启全新的开源之旅</div>
{period === 2 ? <div className='applyBut' onClick={goToApply}>学生报名</div> : <div className='applyBut project'><span className='hover-none'>学生报名</span><span className='hover-show'>{period<2 ? "敬请期待" : "已结束"}</span></div>}
{period === 2 && round === 2 ? <div className='applyBut' onClick={goToApply}>学生报名</div> : <div className='applyBut project'><span className='hover-none'>学生报名</span><span className='hover-show'>{period<2 && round === 2 ? "敬请期待" : "已结束"}</span></div>}
</div>
{/* <img className="teacher-img" src={teacherImg} alt=''></img> */}
</div>
<div className="info-student">

View File

@ -14,12 +14,12 @@ const stepArr = [{
},
{
title: "Step2",
date: "5.30-6.5",
date: "5.30-6.3",
content: "公示项目、课题名单"
},
{
title: "Step2",
date: "6.5-6.23",
date: "6.4-6.21",
content: "学生报名提交Proposal"
},
{
@ -30,22 +30,22 @@ const stepArr = [{
},
{
title: "Step2",
date: "7.1-8.15",
date: "7.1-8.11",
content: "项目开发第一阶段",
},
{
title: "Step2",
date: "8.16-8.25",
date: "8.20",
content: "中期考核,公示考核结果",
},
{
title: "Step2",
date: "8.26-10.08",
date: "8.21-9.28",
content: "项目开发第二阶段",
},
{
title: "Step2",
date: "10.09-10.16",
date: "10.11",
content: "结项审核,公示考核结果",
},
{

View File

@ -242,7 +242,7 @@ const Glcc = (propsF) => {
<Route
path="/glcc/:id/final/result"
render={(props) => (
<MiddleResult round={round} current_user={current_user} history={props.history} checkTime3={checkTime3}/>
<MiddleResult id={id} round={round} current_user={current_user} history={props.history} checkTime3={checkTime3}/>
)}
></Route>

View File

@ -11,7 +11,7 @@ import '../project/index.scss';
const { Search } = Input;
//
function CheckResult({current_user, history, checkTime3, round}) {
function CheckResult({current_user, history, checkTime3, round, id}) {
//
const [keyword, setKeyword] = useState(undefined);
const [data, setData] = useState([]);
@ -107,7 +107,7 @@ function CheckResult({current_user, history, checkTime3, round}) {
<img className="bannerInterim" src={resultBanner} alt=""></img>
<div className='bgBox'>
<div className="resultList">
<div className='goBackBox'><a href='/glcc'>开源夏令营 / </a>结项课题考核结果公示</div>
<div className='goBackBox'><a href={`/glcc/${id}`}>开源夏令营 / </a>结项课题考核结果公示</div>
<div className='searchBox'>
<Search className='search' placeholder='请输入学生姓名或课题名称进行搜索' allowClear enterButton onSearch={(value) => { setCurrent(1); setKeyword(value) }} />
<div style={{width: 100}}></div>

View File

@ -34,7 +34,7 @@ function Project(propsF) {
<Link to={`/glcc/${id}/projects`} className={pathname.endsWith('projects') ? 'active' : ''}>项目列表</Link>
</div>
<div className='gobackBox'>
<a href='/glcc'>开源夏令营 / </a>
<a href={`/glcc/${id}`}>开源夏令营 / </a>
课题及项目列表
</div>
<Spin spinning={false}>

View File

@ -7,7 +7,7 @@ import './index.scss';
//
function TaskDetail(props) {
const {match, location, isStudentApplyDate, secondStudentApplyDate, applyTaskId, applyTask} = props
const {match, location, isStudentApplyDate, secondStudentApplyDate, applyTaskId, applyTask, match:{params:{id}}} = props
const taskId = Number(match.params.taskId);
const [detail, setDetail] = useState(undefined);
@ -26,8 +26,8 @@ function TaskDetail(props) {
{detail && <div className="bgBox">
<div className="detailBox">
<div className='goBackBox'>
<a href='/glcc'>开源夏令营 / </a>
<a href='/glcc/subjects'>课题及项目列表 / </a>
<a href={`/glcc/${id}`}>开源夏令营 / </a>
<a href={`/glcc/${id}/subjects`}>课题及项目列表 / </a>
课题详情
</div>
</div>