竞赛弹窗调整

dev_aliyun
杨树明 5 years ago
parent 32eb383c19
commit aaaabd11c1

@ -12,15 +12,31 @@
<div class="educontent newLogipopup" id="backImg" >
<div class="pr edu-txt-center height-100 pt110">
<div class="login_reg pr login_regs">
<div>
<a href="javascript:void(0)" onclick="hideModal();" id="closeIcon" style="position: absolute;right: 0px;"><i class="iconfont icon-shanchudiao"></i></a>
<div style="position: relative;">
<a href="javascript:void(0)" onclick="competitionfun();" id="closeIcon" style="position: absolute;right: 0px;top: 36px;">
<i class="iconfont icon-shanchudiao"></i>
</a>
<img src="/images/educoder/competitionslog.png" height="600px" width="600px" />
<img height="600px" width="600px" src="/images/educoder/applys.png" />
<a style="position: absolute;left:39%; bottom:18px;" onclick="setcompetitionfun();" >
<img height="40px" width="150px" src="/images/educoder/applys.png" />
</a>
</div>
</div>
</div>
</div>
<script>
console.log("############");
</script>
function competitionfun(){
localStorage.setItem('competition_uid', true);
}
function setcompetitionfun(){
competitionfun();
window.location.href="/competitions"
}
</script>

@ -128,6 +128,7 @@
$("#all_status_show_value").text("用户");
<% end %>
<% end %>
if (window.localStorage) {
var uid = localStorage.getItem('competition_uid');
} else {

@ -5,6 +5,8 @@ import PropTypes from 'prop-types';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import { Modal} from 'antd';
// import searchImg from '../../../../images/educoder/icon/search.svg'
// /images/educoder/icon/search.svg
@ -134,7 +136,8 @@ class NewHeader extends Component {
ImageUrl:"",
ecUrl:null,
project_packages_url:null,
ImageUrlType:false
ImageUrlType:false,
competitiontype:false
}
}
componentWillMount(){
@ -230,9 +233,30 @@ class NewHeader extends Component {
});
if (window.localStorage) {
var uid = localStorage.getItem('competition_uid');
} else {
var uid = false
}
if(!uid){
this.setState({
competitiontype:true
})
}
}
setcompetitionfun=()=>{
this.competitionfun();
window.location.href="/competitions"
}
competitionfun=()=>{
this.setState({
competitiontype:false
})
localStorage.setItem('competition_uid', true);
}
render() {
let {careerslist,isLogin,current_user,ImageUrl,ecUrl,ImageUrlType,project_packages_url} = this.state;
// const isLogin = isLogintype; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。
@ -268,6 +292,45 @@ class NewHeader extends Component {
// console.log(match.path.startsWith("/ec_courses"))
return (
<div className="newHeader" id="nHeader">
<style>
{
`
.competitiontype .ant-modal{
width: 615px !important;
}
.competitiontype .ant-modal-content{
background-color: transparent !important;
box-shadow: none !important;
}
`
}
</style>
<Modal
visible={this.state.competitiontype}
closable={false}
footer={null}
className={"competitiontype"}
>
<div className="login_reg pr login_regs">
<div style={{position: "relative"}} >
<a onClick={()=>this.competitionfun()} id="closeIcon"
style={{position: "absolute",right: "0px",top: "36px"}}
>
<i className="iconfont icon-shanchudiao"></i>
</a>
<img src={"http://localhost:3000/images/educoder/competitionslog.png"} height="600px" width="600px"/>
<a style={{position: "absolute",left:"39%", bottom:"18px"}} onClick={()=>this.setcompetitionfun()}>
<img height="40px" width="150px" src={"http://localhost:3000/images/educoder/applys.png"}/>
</a>
</div>
</div>
</Modal>
<div className="educontent clearfix">
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/}
<a href="/">
@ -464,11 +527,3 @@ class NewHeader extends Component {
export default NewHeader;
// <ul id="header-nav">
// <li className="active">1{/*<%= link_to "首页", home_path %>*/}</li>
// <li>2{/*<%= link_to "精选实训", shixuns_path %>*/}</li>
// <li>3{/*<%= link_to "实训路径", subjects_path %>*/}</li>
// <li>4{/*<%= link_to "在线课堂", courses_path %>*/}</li>
// <li>5{/*<%= link_to "讨论组", forums_path %>*/}</li>
// </ul>

@ -1243,6 +1243,5 @@ html>body #ajax-indicator { position: fixed; }
}
.login_regs{
margin-right: 35%;
width: 558px;
width: 580px !important;
}
Loading…
Cancel
Save