Merge pull request '修改竞赛样式图片等' (#359) from tongChong/forgeplus-react:dev_military_qz2022 into pre_dev_military

This commit is contained in:
xxq250 2022-04-20 09:16:23 +08:00
commit 1778e751ad
21 changed files with 112 additions and 70 deletions

View File

@ -68,7 +68,6 @@ export function appendFileSizeToUploadFile(item) {
return `${item.title}${uploadNameSizeSeperator}${item.filesize}`
}
export function appendFileSizeToUploadFileAll(fileList) {
console.log('fileList',fileList);
return fileList && fileList.map(item => {
if(!item.name)item.name=item.fileName;
if(!item.uid)item.uid="rc-upload" + item.id;

View File

@ -12,7 +12,7 @@ import './index.scss';
let setting = {
infinite: true,
speed: 28000,
speed: 21000,
slidesToShow: 1,
slidesToScroll: 1,
autoplaySpeed: 0,
@ -34,7 +34,7 @@ function SecondSection() {
return (
<div className="home-competition-slide">
<div className="home-competition-slide homepage-main">
<Slider {...setting}>
<div>

View File

@ -1,7 +1,6 @@
.home-competition-slide {
position: relative;
// height: 50px;
width: calc(100vw + 500px);
overflow: hidden;
top: 4.375em;
left: 0;
right: 0;
@ -9,7 +8,7 @@
.competition-slide-item {
display: flex;
justify-content: flex-end;
justify-content: center;
height: 2.6vw;
}

View File

@ -70,6 +70,10 @@ export default ({ current_user, showLoginDialog }) => {
})
}
const main_web_site_url =
localStorage.chromesetting &&
JSON.parse(localStorage.chromesetting).main_web_site_url;
return (
<div className="qz-login">
{current_user === undefined || current_user.login === "" ?
@ -83,15 +87,15 @@ export default ({ current_user, showLoginDialog }) => {
</span>
:
<div className="ml30 edu-menu-panel" style={{ height: "70px", lineHeight: "70px" }}>
<a href={`/users/${current_user === undefined ? "" : current_user.login}/courses`}>
{/* <a href={`/users/${current_user === undefined ? "" : current_user.login}/courses`}> */}
<img alt="头像" className="radius" height="34" id="nh_user_logo" name="avatar_image"
src={getImageUrl(current_user.image_url)} width="34">
</img>
</a>
{/* </a> */}
<ul className="edu-menu-list" style={{ top: '60px', textAlign: 'center' }}>
<li className="bor-bottom-greyE" style={{ cursor: "default", background: "#fff" }}>{current_user.username}</li>
<li>
<Link to={`/users/${current_user.login}`}>个人中心</Link>
<a target='_blank' href={`${main_web_site_url}/accounts/${current_user.login}`}>个人中心</a>
</li>
<li>
<Link to={`/task/myTask`}>创客管理</Link>

View File

@ -9,7 +9,7 @@ import Loading from "../Loading";
import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC";
import './qz2022/index.scss';
import { Menu, Popover, Spin } from "antd";
import banner from './qz2022/image/banner.png';
import banner from './qz2022/image/banner.jpg';
import banner_local from './qz2022/image/banner_local.jpg';
import { getQz2022, userCompetitionStatus } from "./qz2022/api";
import { paths } from "./qz2022/static";
@ -100,6 +100,17 @@ const Qz2022 = (props) => {
}
}, []);
// useEffect(()=>{
// let footer=document.querySelector('.newFooter');
// let loading=document.querySelector('..ant-spin-nested-loading');
// if((footer.offsetTop +107)<window.screen.height){
// footer.style.position="absolute";
// loading.margin-b
// }else{
// footer.style.position="relative";
// }
// },[history])
function scrollListener() {
let qz2022Top = document.querySelector('.qz2022').offsetTop;
let top = document.documentElement.scrollTop;
@ -148,12 +159,13 @@ const Qz2022 = (props) => {
}
const is_local= qzDetail &&qzDetail.is_local;
const banner_url= qzDetail &&qzDetail.banner_url;
return (
<React.Fragment>
<Login {...props} />
{/* banner图+选项 */}
<img src={is_local?banner_local: banner} className="qz_banner"/>
<img src={banner_url || (is_local?banner_local: banner)} className="qz_banner"/>
<div className="qz2022">
<div className={`qz2022-top ${fixedTop}`}>
{paths.indexOf(active) !== -1 && <ul className="qz2022Menu mt20 qz_main">
@ -161,7 +173,7 @@ const Qz2022 = (props) => {
<Link to={{ pathname: `/competition/qz2022/introduce` }}>首页</Link>
</li>
<li className={active === "fingerpost" ? "active" : ""}>
<Link to={{ pathname: `/competition/qz2022/fingerpost` }}>{is_local?'赛事指南':'大赛简介'}</Link>
<Link to={{ pathname: `/competition/qz2022/fingerpost` }}>赛事指南</Link>
</li>
<li className={active === "notice" ? "active" : ""}>
<Link to={{ pathname: `/competition/qz2022/notice` }}>通知公告</Link>
@ -207,13 +219,13 @@ const Qz2022 = (props) => {
{/* 通知公告编辑页 */}
<Route path="/competition/qz2022/notice/:type/:noticeId"
render={
({ match }) => (<NoticeEdit {...props} match={match} />)
({ match }) => (<NoticeEdit {...props} match={match} qzDetail={qzDetail}/>)
}
></Route>
{/* 通知公告新增页 */}
<Route path="/competition/qz2022/notice/:type"
render={
({ match }) => (<NoticeEdit {...props} match={match} />)
({ match }) => (<NoticeEdit {...props} match={match} qzDetail={qzDetail}/>)
}
></Route>
{/* 大赛介绍、大赛指南、关于我们 编辑页 */}
@ -237,7 +249,7 @@ const Qz2022 = (props) => {
{/* 提案提交 */}
<Route path="/competition/qz2022/refer"
render={
() => (<Refer {...props} enrollStatus={enrollStatus} qzDetail={qzDetail}/>)
() => (<Refer {...props} enrollStatus={enrollStatus} qzDetail={qzDetail} setReload={setReload}/>)
}
></Route>
{/* 交流互动 */}
@ -249,7 +261,7 @@ const Qz2022 = (props) => {
{/* 联系我们 */}
<Route path="/competition/qz2022/contact"
render={
() => (<Contact {...props} aboutUs={qzDetail && qzDetail.about_us} />)
() => (<Contact {...props} aboutUs={qzDetail && qzDetail.about_us} qzDetail={qzDetail}/>)
}
></Route>
{/* 数据统计 */}

View File

@ -9,10 +9,17 @@ import '../notice/index.scss';
import '../notice/detail.scss';
export default Form.create()((props) => {
const {form, history, match:{params:{type}}, qzDetail, setReloadDetail} = props;
const {form, history, match:{params:{type}}, qzDetail, setReloadDetail, current_user} = props;
const {getFieldDecorator, validateFields, setFieldsValue } = form;
const [description, setDescription] = useState(qzDetail && type === "introduce" ? (qzDetail && qzDetail.content) : type === "fingerpost" ? (qzDetail && qzDetail.guide) : (qzDetail && qzDetail.about_us));
const [errorMessage, setErrorMessage] = useState(undefined);
const manageEdit = (qzDetail && qzDetail.is_manager) || (current_user && current_user.admin);
useEffect(() =>{
if(!manageEdit){
window.location.href="/403";
}
}, [manageEdit])
useEffect(()=>{
setDescription(qzDetail && type === "introduce" ? (qzDetail && qzDetail.content) : type === "fingerpost" ? (qzDetail && qzDetail.guide) : (qzDetail && qzDetail.about_us));

View File

@ -1,5 +1,5 @@
import React from "react";
import contactPng from "../image/qz-logo.png";
import contactPng from "../image/qz-logo.jpg";
import RenderHtml from "src/components/render-html";
import Link from "react-router-dom/Link";
import { Button } from "antd";
@ -8,16 +8,15 @@ import '../../index.scss';
function Contact({ aboutUs, qzDetail, current_user }) {
const manageEdit = (qzDetail && qzDetail.is_manager) || (current_user && current_user.admin);
const is_local= qzDetail &&qzDetail.is_local;
console.log(is_local);
return (
<div className="contact-bg">
{manageEdit && <div className="qz_main manageEdit mb20">
<Link to={"/competition/qz2022/contact/edit"}><Button><i className="iconfont icon-a-bianji11 font-13 mr5"></i>编辑</Button></Link>
</div>}
<div className="contact qz_main">
{/* <div className="contact-png"> */}
<img className="contact-png" src={contactPng} ></img>
{/* </div> */}
{ !is_local&&<img className="contact-png" src={contactPng} ></img>}
<div className="contact-words">
<RenderHtml value={aboutUs} className="contact-content" />
</div>

View File

@ -5,19 +5,16 @@
}
.contact {
margin: 0 auto;
padding: 3rem;
padding:1rem 3rem;
background: #fff;
// display: flex;
// justify-content: space-around;
display: flex;
justify-content: space-around;
align-items: center;
.contact-png{
max-width: 50%;
margin-right:1rem;
float: left;
// img{
// width: 100%;
// }
}
.contact-tit{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 393 KiB

After

Width:  |  Height:  |  Size: 475 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 KiB

After

Width:  |  Height:  |  Size: 518 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 592 KiB

After

Width:  |  Height:  |  Size: 688 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 688 KiB

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

View File

@ -70,7 +70,7 @@
);
}
.qzCont {
min-height: 35vh;
min-height: 40vh;
border-radius: 4px;
}
}
@ -110,6 +110,7 @@
}
.manageEdit{
text-align: right;
margin-bottom: 10px;
}
// 按钮样式
.but_2e5 {

View File

@ -18,10 +18,12 @@ function Introduce({ qzDetail, current_user }) {
</div>}
<div className="introduce">
<div className="introduce-content clearfix">
<div className="introduce-video"><video src={video_url} autoPlay controls muted></video></div>
<div className="introduce-info">
<RenderHtml value={content} className="info-content"/>
</div>
{/* <div className="introduce-video"> */}
<video className="introduce-video" src={video_url} autoPlay controls muted></video>
{/* </div> */}
{/* <div className="introduce-info"> className="info-content"*/}
<RenderHtml value={content} />
{/* </div> */}
</div>
</div>
</div>

View File

@ -4,59 +4,66 @@
}
.introduce {
width: 100%;
height: 36.3vw;
background-image: url("../image/introduce.png");
background-size: 100% 100.5%;
background-size: 100% 100%;
background-color:#f1f7fc;
padding-bottom: 4%;
.introduce-content {
width: 62.5%;
height: 100%;
margin: 0 auto;
// padding: 2.75% 2% 5% 2.5%;
padding: 4.5% 2% 5% 2%;
padding: 2%;
box-sizing: border-box;
background: #fff;
}
.introduce-video {
height: 80%;
margin-right: 2.2%;
min-width: 30%;
max-width: 62.5%;
float: left;
video {
width: 100%;
max-width: 100%;
max-height: 100%;
}
// video {
// width: 100%;
// max-width: 100%;
// max-height: 100%;
// }
}
.introduce-info {
display: flex;
flex-direction: column;
justify-content: center;
min-width: 35%;
min-height: 75%;
position: relative;
// .introduce-info {
// // display: flex;
// // flex-direction: column;
// // justify-content: center;
// // min-width: 35%;
// // min-height: 75%;
// // position: relative;
.manageEdit{
text-align: left;
position: absolute;
bottom: -36px;
}
.info-content{
height: 25rem;
// overflow-y: auto;
}
// .manageEdit{
// text-align: left;
// position: absolute;
// bottom: -36px;
// }
// // .info-content{
// // height: 25rem;
// // overflow: auto;
// // // overflow-y: auto;
// // }
p{
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 14;
line-clamp: 14;
-webkit-box-orient: vertical;
}
// p{
// text-overflow: -o-ellipsis-lastline;
// overflow: hidden;
// text-overflow: ellipsis;
// display: -webkit-box;
// -webkit-line-clamp: 14;
// line-clamp: 14;
// -webkit-box-orient: vertical;
// }
// }
.markdown-body{
overflow: visible;
}
.info-tit {

View File

@ -11,10 +11,17 @@ import RenderHtml from "src/components/render-html";
const Option = Select.Option;
export default Form.create()((props) => {
const {form, history, match:{params:{noticeId,type}, params}} = props;
const {form, history, match:{params:{noticeId,type}}, current_user, qzDetail} = props;
const {getFieldDecorator, validateFields, setFieldsValue } = form;
const [description, setDescription] = useState(undefined);
const [errorMessage, setErrorMessage] = useState(undefined);
const manageEdit = (qzDetail && qzDetail.is_manager) || (current_user && current_user.admin);
useEffect(() =>{
if(!manageEdit){
window.location.href="/403";
}
}, [manageEdit])
useEffect(() => {
if(noticeId && type === "edit"){

View File

@ -14,7 +14,7 @@ import './index.scss';
import '../../index.scss';
const Option = Select.Option;
function Introduce({ form, showNotification, match, history, enrollStatus, current_user, qzDetail}) {
function Introduce({ form, showNotification, match, history, enrollStatus, current_user, qzDetail, setReload}) {
// loading
const [loading, setLoading] = useState(false);
const [files, setFiles] = useState();
@ -76,6 +76,7 @@ function Introduce({ form, showNotification, match, history, enrollStatus, curre
}
uploadCompetition(params).then(response=>{
if(response && response.status === 200){
setReload(Math.random());
message.success('提交作品成功');
}else{
message.error(response.data.message);

View File

@ -50,8 +50,15 @@ body>.-task-title {
max-height: 700px !important;
}
.indexHOC > .ant-spin-nested-loading {
background: #000;
/* background: #000; */
height: 100%;
margin-bottom: 107px;
}
.indexHOC .homePage+.ant-spin-nested-loading {
margin-bottom: 0;
}
.newFooter{
position:absolute !important;
}
.indexHOC > .ant-spin-nested-loading > div > .ant-spin .ant-spin-dot {
top: 50% !important;