diff --git a/src/glcc/student/index.jsx b/src/glcc/student/index.jsx index 51948a58f..45341f6b6 100644 --- a/src/glcc/student/index.jsx +++ b/src/glcc/student/index.jsx @@ -43,8 +43,12 @@ function Apply(props) { const [allTaskList, setAllTaskList] = useState([]); useEffect(() => { - // 进入此页面置顶 - window.scrollTo(0, 0); + // 进入此页面到填写页面 + // setTimeout(()=>{ + let clientWidth = document.body.clientWidth; + let scrollHeight = 500 * clientWidth / 1920; + window.scrollTo(0, scrollHeight); + if (!isGlccApplyDate) { // 不在开源夏令营报名时间之内 window.location.href = "/glcc"; @@ -55,6 +59,7 @@ function Apply(props) { } }, []) + useEffect(() => { const params = { curPage: 1, @@ -94,13 +99,13 @@ function Apply(props) { applyInfo['memoAttachmentId' + i] = item.memoAttachmentId; if (i == 0) { - setFiles([{ + item.memoAttachment && setFiles([{ name: item.memoAttachment && item.memoAttachment.fileName || '已上传文件', id: item.memoAttachmentId, uid: item.memoAttachmentId }]); } else { - setFiles1([{ + item.memoAttachment && setFiles1([{ name: item.memoAttachment && item.memoAttachment.fileName || '已上传文件', id: item.memoAttachmentId, uid: item.memoAttachmentId, @@ -205,15 +210,29 @@ function Apply(props) { ); - // 检查文件上传是否符合规定 + // 检查图片文件上传是否符合规定 function beforeUpload(file) { + const isLittle = file.size / 1024 / 1024 < 5; + if (!isLittle) { + showNotification(`文件大小必须小于${5}MB!`); + } const isType = file.type === "image/png" || file.type === "image/jpg" || file.type === "image/jpeg"; if (!isType) { showNotification("只能上传png、jpg、jpeg格式文件"); } - return isType; + return isLittle && isType; } + // 检查文件上传是否符合规定 + function beforeUpload2(file) { + const isLittle = file.size / 1024 / 1024 < 5; + if (!isLittle) { + showNotification(`文件大小必须小于${5}MB!`); + } + return isLittle; + } + + function getBase64(img, callback) { const reader = new FileReader(); reader.addEventListener('load', () => callback(reader.result)); @@ -313,6 +332,8 @@ function Apply(props) { setMyTaskList(taskListNew); } + const chooseArr=myTaskList.map(i=>{return i.taskId}); + return (
@@ -326,7 +347,7 @@ function Apply(props) {

申请说明:

-
1、学生报名时间为2022年5月21日-6月19日,请在报名截止时间(北京时间2022年6月19日18点)前提交报名信息。
+
1、学生报名时间为2022年5月26日-6月24日,请在报名截止时间(北京时间2022年6月24日24点)前提交报名信息。
2、本次GLCC夏令营基于GitLink代码托管平台完成编程任务,若您没有平台账户,请先注册后完成课题申请
3、每位学员最多可申请2个课题,至多有且仅有1个课题可以入选
4、建议在提交课题申请,与课题导师邮件沟通,详细了解课题描述、编码任务、技能要求&编程语言、预期产出结果等信息,以便您能够选择最适合的课题
@@ -376,18 +397,24 @@ function Apply(props) { {helper('联系电话', '', 'phone', - [{ required: true, message: "请正确输入联系电话" }], + [{ required: true, message: "请正确输入联系电话" }, + { max: 14, message: '超出限制长度14位字符,请重新编辑' }, + { pattern: /^(^(\d{3,4}-)?\d{7,8})$|(13[0-9]{9})$/, message: '请正确输入联系电话' }], { verify("phone") }} className={editable ? "" : "disabledInput"} disabled={editable ? false : true} /> )} {helper('邮箱地址', '', 'mail', - [{ required: true, message: "请正确输入邮箱地址" }], + [ + { type: 'email', message: '请输入正确的邮箱地址', }, + { required: true, message: "请输入邮箱地址" }, + { max: 50, message: '超出限制长度50位字符,请重新编辑' }, + ], { verify("mail") }} className={editable ? "" : "disabledInput"} disabled={editable ? false : true} /> )}
{helper('学生证明', - '请以图片的形式上传学生证明,格式为png、jpg、jpeg', + '请以图片的形式上传学生证明,大小不超过5M,格式为png、jpg、jpeg', 'proveAttachmentId', [{ required: true, message: "请正确上传学生证明" }], userApplyInfo && userApplyInfo.proveAttachmentId ?
@@ -425,7 +452,7 @@ function Apply(props) { onBlur={() => { verify("taskId" + i) }} onChange={(val) => { changeTaskItem("taskId", val, i) }} > - {allTaskList.map(item => { return })} + {allTaskList.map(item => { return })} )}
{helper('自荐书', @@ -437,7 +464,7 @@ function Apply(props) { )}
{helper('附件', - '', + '可以上传自荐书文件,大小不超过5M', 'memoAttachmentId' + i, [], { bookChange(info, i) }} onDownload={download} + beforeUpload={beforeUpload2} showUploadList={{ showDownloadIcon: true, downloadIcon: ,