Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_forum
cxt 6 years ago
commit 30a1048c95

@ -18,6 +18,9 @@ import Notcompletedysl from './modules/user/Notcompletedysl';
import Trialapplicationysl from './modules/login/Trialapplicationysl';
import Trialapplicationreview from './modules/user/Trialapplicationreview';
import Addcourses from "./modules/courses/coursesPublic/Addcourses";
import AccountProfile from"./modules/user/AccountProfile";
import Trialapplication from './modules/login/Trialapplication'
import NotFoundPage from './NotFoundPage'
@ -278,6 +281,7 @@ class App extends Component {
<Trialapplicationysl {...this.props} {...this.state}></Trialapplicationysl>
<Trialapplicationreview {...this.props} {...this.state}></Trialapplicationreview>
<Addcourses {...this.props} {...this.state}/>
<AccountProfile {...this.props} {...this.state}/>
{/*{*/}
{/* isRender === true?*/}
{/* <LoginDialog></LoginDialog> : ""*/}

@ -38,7 +38,6 @@ class Addcourses extends Component{
}
return response;
}, (error) => {
//TODO 这里如果样式变了会出现css不加载的情况
});

@ -1560,9 +1560,28 @@ input.ant-input-number-input:focus {
border-radius: 5px;
}
.ant-modal-wrap{
overflow: hidden;
@media screen and (min-width: 1400px) {
.ant-modal-wrap{
overflow: hidden;
}
}
/* 设置了浏览器宽度不小于1201px时 abc 显示1200px宽度 */
@media screen and (max-width: 1400px) {
}
/* 设置了浏览器宽度不大于1200px时 abc 显示900px宽度 */
@media screen and (max-width: 900px) {
}
/* 设置了浏览器宽度不大于900px时 abc 显示200px宽度 */
@media screen and (max-width: 500px) {
}
/* 设置了浏览器宽度不大于500px时 abc 显示100px宽度 */
/* 试卷答题 */
.stageTable .ant-table-tbody tr:last-child td,.stageTable .ant-table-thead > tr > th{

@ -100,7 +100,8 @@ class Header extends Component {
{/*<img src="/images/task/coin.png" className="fl" width="30" height="30" alt=""/>*/}
<span style={{width:'20px', height:'20px', background:'#FFD633', borderRadius: '10px', marginTop: '3px' }} className="fl"></span>
<span className="ml5 color-white fl" id="user_grade">
<a href={`${user.user_url}/user_grade`} target="_blank">{ grade === 0 ? grade : (grade || '')}</a>
{/* href={`${user.user_url}/user_grade`} target="_blank" */}
<span>{ grade === 0 ? grade : (grade || '')}</span>
</span>
</div>}

@ -466,7 +466,7 @@ class DetailCardsEditAndAdd extends Component{
<span className="color-orange-tip">{ChooseShixunList && ChooseShixunList.shixuns_count}</span>
<span>个实训</span>
</span>
<div className="fr search-new">
<div className="fr search-new mb0">
<Search
placeholder="请输入创建者或者实训名称进行搜索"
onInput={this.searchNameInput}

@ -499,7 +499,7 @@ class DetailCardsEditAndEdit extends Component{
<span className="color-orange-tip">{ChooseShixunList && ChooseShixunList.shixuns_count}</span>
<span>个实训</span>
</span>
<div className="fr search-new">
<div className="fr search-new mb0">
<Search
placeholder="请输入创建者或者实训名称进行搜索"
onInput={this.searchNameInput}

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { Redirect } from 'react-router';
import AccountProfile from"../user/AccountProfile";
import PropTypes from 'prop-types';
// import searchImg from '../../../../images/educoder/icon/search.svg'
@ -527,24 +527,36 @@ submittojoinclass=(value)=>{
}
//头部获取是否已经登录了
getUser=(url)=>{
console.log("点击了503")
console.log(url);
// console.log("点击了503")
// console.log(url);
let{user} =this.state;
if(user===undefined){
this.setState({
isRender:true
})
return
}
if(user&&user.login===""){
this.setState({
isRender:true
})
return;
}
if(user&&user.profile_completed===false){
this.setState({
AccountProfiletype:true
})
return;
}
if(url !== undefined || url!==""){
window.location.href = url;
}
}
//修改登录方法
@ -554,6 +566,12 @@ submittojoinclass=(value)=>{
})
}
hideAccountProfile=()=>{
this.setState({
AccountProfiletype:false
})
}
render() {
const isLogin = true; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。
const {match ,} = this.props;
@ -568,7 +586,7 @@ submittojoinclass=(value)=>{
Checkboxteachingtype,
code_notice,
checked_notice,
RadioGroupvalue,
AccountProfiletype,
submitapplications,
submitapplicationsvalue,
user,
@ -610,6 +628,12 @@ submittojoinclass=(value)=>{
{...this.props}
/>:""}
{AccountProfiletype===true?<AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.state}
{...this.props}
/>:""}
<div className="educontent clearfix">
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/}
<a href="/">

@ -8,6 +8,8 @@ import PropTypes from 'prop-types';
import {Modal,Input,Radio,Pagination,message,Spin,Icon,Tooltip} from 'antd';
import AccountProfile from"../user/AccountProfile";
import 'antd/lib/pagination/style/index.css';
import axios from 'axios'
@ -381,6 +383,14 @@ class TPMBanner extends Component {
//开始实战按钮
startshixunCombat=(id, reset)=>{
if(this.props.current_user&&this.props.current_user.profile_completed===false){
this.setState({
AccountProfiletype:true
})
return
}
let {shixunsDetails} = this.props
if( shixunsDetails.shixun_status>1){
this.setState({
@ -455,7 +465,11 @@ class TPMBanner extends Component {
})
}
hideAccountProfile=()=>{
this.setState({
AccountProfiletype:false
})
}
render() {
let {
@ -480,7 +494,7 @@ class TPMBanner extends Component {
shixunsreplace,
hidestartshixunsreplacevalue,
Forkvisibletype,
Senttothevcaluetype,
AccountProfiletype,
isIE} = this.state;
let {shixunsDetails, shixunId, star_info, star_infos} = this.props;
let challengeBtnTipText = '';
@ -555,6 +569,13 @@ class TPMBanner extends Component {
<div>
<div className="shixunDetail_top">
{AccountProfiletype===true?<AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.state}
{...this.props}
/>:""}
{this.state.Modalstype===true?<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}

@ -20,6 +20,8 @@ import '../shixunchildCss/Challenges.css'
import axios from 'axios';
import AccountProfile from"../../../user/AccountProfile";
const $ = window.$;
class Challenges extends Component {
@ -218,7 +220,14 @@ class Challenges extends Component {
//开始实战按钮
startshixunCombat = (type, ids, id) => {
if(this.props.current_user&&this.props.current_user.profile_completed===false){
this.setState({
AccountProfiletype:true
})
return
}
debugger
let { ChallengesDataList } = this.state;
// let id = this.props.match.params.shixunId;
this.setState({
@ -271,8 +280,15 @@ class Challenges extends Component {
startshixunCombattype:false
})
}
hideAccountProfile=()=>{
this.setState({
AccountProfiletype:false
})
}
render() {
let { ChallengesDataList, startbtns, sumidtype ,startshixunCombattype,shixunsreplace,shixunsmessage,hidestartshixunsreplacevalue,operationstrue} = this.state;
let { ChallengesDataList, startbtns, sumidtype ,startshixunCombattype,shixunsreplace,shixunsmessage,hidestartshixunsreplacevalue,operationstrue,AccountProfiletype} = this.state;
let { loadingContent } = this.props;
if (ChallengesDataList != undefined) {
this.updatamakedown("ReactMarkdown")
@ -281,6 +297,12 @@ class Challenges extends Component {
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return (
<React.Fragment>
{AccountProfiletype===true?<AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.state}
{...this.props}
/>:""}
{loadingContent ?
<CircularProgress size={40} thickness={3} style={{
marginLeft: 'auto',

@ -0,0 +1,74 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import {Modal} from 'antd';
import axios from 'axios';
class AccountProfile extends Component {
constructor(props) {
super(props);
this.state = {
AccountProfiletype:false
}
}
componentDidMount() {
if(this.props.AccountProfiletype!=undefined){
this.setState({
AccountProfiletype:this.props.AccountProfiletype
})
}
axios.interceptors.response.use((response) => {
if (response != undefined)
if (response && response.data.status === 402) {
this.setState({
AccountProfiletype: true
})
}
return response;
}, (error) => {
});
}
gotoback=()=>{
if(this.props.AccountProfiletype!=undefined){
this.setState({
AccountProfiletype:false
})
this.props.hideAccountProfile()
}else{
window.location.href="/";
this.setState({
AccountProfiletype:false
})
}
}
render() {
return(
<Modal
keyboard={false}
title="提示"
visible={this.state.AccountProfiletype}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
width="530px"
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16">您需要去完善您的个人资料才能使用此功能</p>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={()=>this.gotoback()}>取消</a>
<a className="task-btn task-btn-orange" href={"/account/profile/edit"}>立即完善</a>
</div>
</div>
</Modal>
)
}
}
export default AccountProfile;

@ -106,6 +106,8 @@ class AccountBasic extends Component {
this.setState({
school_id,
school: selectedName
}, () => {
this.filterList(selectedName)
})
} else if(basicInfo && basicInfo.school_name){
this.setState({
@ -199,7 +201,7 @@ class AccountBasic extends Component {
}
// 过滤学校
filterList=(e)=>{
filterList =(e)=>{
const inputVal = e.trim()
let arr=[];
if(inputVal){
@ -211,7 +213,7 @@ class AccountBasic extends Component {
})
this.setState({
school: inputVal,
filterSchoolList:arr
filterSchoolList: arr
})
} else {
this.setState({
@ -254,6 +256,7 @@ class AccountBasic extends Component {
this.setState({
department_id: '',
departmentsName: e,
filterDepartments: [],
})
this.this_department_id = ''
return;
@ -261,7 +264,7 @@ class AccountBasic extends Component {
this.this_department_id = arr[0].id
this.setState({
departmentsName:e,
department_id: arr[0].id
department_id: arr[0].id,
})
}
@ -365,7 +368,6 @@ class AccountBasic extends Component {
// this.setState({ schoolList })
this.getSchoolList(this.props.basicInfo, name);
this.props.form.setFieldsValue({
name: name
})
@ -676,7 +678,7 @@ class AccountBasic extends Component {
</Form.Item>
{!filterSchoolList || (filterSchoolList && filterSchoolList.length==0 )&& school &&
<div style={{marginLeft: '100px',height:"20px",lineHeight:"20px"}}>
<div style={{marginLeft: '113px',height:"20px",lineHeight:"20px"}}>
<span>
<span style={{color: '#CDCDCD'}}>未找到包含{school}的高校</span>
<span style={{color: '#4CACFF', cursor: 'pointer'}} onClick={this.showApplyForAddOrgModal}>申请新增</span>
@ -716,10 +718,10 @@ class AccountBasic extends Component {
</Form.Item>
{
!filterDepartments || (filterDepartments && filterDepartments.length==0 )&& departmentsName &&
<div style={{marginLeft: '100px',height:"20px",lineHeight:"20px"}}>
(!filterDepartments || (filterDepartments && filterDepartments.length==0 ) || (departmentsName == '' && !this.state.department_id)) &&
<div style={{marginLeft: '113px',height:"20px",lineHeight:"20px"}}>
<span>
<span style={{color: '#CDCDCD'}}>未找到包含{departmentsName}的院系/部门</span>
<span style={{color: '#CDCDCD'}}>{departmentsName ? `未找到包含“${departmentsName}”的院系/部门` : '未找到院系'}</span>
<span style={{color: '#4CACFF', cursor: 'pointer'}} onClick={this.showApplyForAddChildOrgModal}>申请新增</span>
</span>
</div>

@ -239,14 +239,14 @@ class Infos extends Component{
<div className="inline">
<div className="fl headtab">
<span>{is_current ? "我":"TA"}的经验值</span>
<a
<a style={{ cursor: 'default' }}
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_experience`}
>{data && data.experience}</a>
</div>
<em className="v-h-line fl"></em>
<div className="fl headtab">
<span>{is_current ? "我":"TA"}的金币</span>
<a
<a style={{ cursor: 'default' }}
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_grade`}
id="user_code">{data && data.grade}</a>
</div>
@ -255,14 +255,14 @@ class Infos extends Component{
</div>
<div className="fl headtab">
<span>{is_current ? "我":"TA"}的粉丝</span>
<a
<a style={{ cursor: 'default' }}
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_fanslist`}
id="user_h_fan_count">{data && data.fan_count}</a>
</div>
<em className="v-h-line fl"></em>
<div className="fl headtab">
<span>{is_current ? "我":"TA"}的关注</span>
<a
<a style={{ cursor: 'default' }}
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_watchlist`}
>{data && data.follow_count}</a>
</div>

@ -130,7 +130,7 @@ class InfosCourse extends Component{
this.props.current_user && this.props.current_user.user_identity != "学生" ? <Create href={"/courses/new"} name={"新建课堂"} index="1"></Create> : ""
}
{
(!data || data.courses.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" || category) && <NoneData></NoneData>
(!data || data.courses.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && <NoneData></NoneData>
}
{
data && data.courses && data.courses.map((item,key)=>{

@ -152,7 +152,7 @@ class InfosPath extends Component{
this.props.current_user && this.props.current_user.user_identity != "学生" ? <Create href={"/paths/new"} name={"新建实践课程"} index="3"></Create>:""
}
{
(!data || data.subjects.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" || category) && <NoneData></NoneData>
(!data || data.subjects.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && <NoneData></NoneData>
}
{
data && data.subjects && data.subjects.map((item,key)=>{

@ -125,7 +125,7 @@ class InfosProject extends Component{
<Create href={`${this.props.Headertop && this.props.Headertop.old_url}/projects/new`} name={"新建项目"} index="4"></Create>:""
}
{
(!data || data.projects.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" || category) && <NoneData></NoneData>
(!data || data.projects.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && <NoneData></NoneData>
}
{
data && data.projects && data.projects.map((item,key)=>{

@ -161,7 +161,7 @@ class InfosShixun extends Component{
<Create href={"/shixuns/new"} name={"新建实训"} index="2"></Create>:""
}
{
(!data || data.shixuns.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" || category) && <NoneData></NoneData>
(!data || data.shixuns.length==0) && (this.props.current_user && this.props.current_user.user_identity === "学生" ) && <NoneData></NoneData>
}
{
data && data.shixuns && data.shixuns.map((item,key)=>{

Loading…
Cancel
Save