升级提示调整

dev_forum
杨树明 5 years ago
parent 25ec1a755f
commit 438b20e528

@ -57,7 +57,7 @@ class coursesHome extends Component{
axios.get(upsystem).then((response)=>{ axios.get(upsystem).then((response)=>{
let updata=response.data; let updata=response.data;
this.setState({ this.setState({
updata updata:updata
}) })
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
@ -106,10 +106,9 @@ class coursesHome extends Component{
return ( return (
<div> <div>
<UpgradeModals {this.state.updata===undefined?"":<UpgradeModals
{...this.state} {...this.state}
{...this.props} />}
/>
<div className="newMain clearfix"> <div className="newMain clearfix">
<div className="courses-head pr" > <div className="courses-head pr" >
<div className="edu-txt-center pathNavLine"> <div className="edu-txt-center pathNavLine">

@ -10,6 +10,8 @@ import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import SiderBar from '../tpm/SiderBar'; import SiderBar from '../tpm/SiderBar';
import UpgradeModals from '../modals/UpgradeModals';
import { SnackbarHOC , getImageUrl} from 'educoder'; import { SnackbarHOC , getImageUrl} from 'educoder';
import Slider from '@icedesign/base/lib/slider'; import Slider from '@icedesign/base/lib/slider';
@ -35,6 +37,15 @@ class ShixunsHome extends Component {
} }
} }
componentDidMount(){ componentDidMount(){
const upsystem=`/users/system_update.json`;
axios.get(upsystem).then((response)=>{
let updata=response.data;
this.setState({
updata:updata
})
}).catch((error)=>{
console.log(error);
})
let url=`/home/index.json`; let url=`/home/index.json`;
axios.get(url).then((response)=> { axios.get(url).then((response)=> {
if(response.status===200){ if(response.status===200){
@ -106,6 +117,9 @@ class ShixunsHome extends Component {
return ( return (
<div className="newMain clearfix backFAFAFA"> <div className="newMain clearfix backFAFAFA">
{this.state.updata===undefined?"":<UpgradeModals
{...this.state}
/>}
<Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}> <Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
{/*懒加载*/} {/*懒加载*/}

@ -18,6 +18,10 @@ class UpgradeModals extends Component {
this.setState({ this.setState({
system_updates:true system_updates:true
}) })
}else if(SystemUpdateEndTime===undefined){
this.setState({
system_updates:true
})
}else if(moment(SystemUpdateEndTime) < moment(updata.end_time)){ }else if(moment(SystemUpdateEndTime) < moment(updata.end_time)){
this.setState({ this.setState({
system_updates:true system_updates:true
@ -31,9 +35,9 @@ class UpgradeModals extends Component {
} }
componentDidUpdate(prevProps){ componentDidUpdate(prevProps){
if (prevProps.data!=this.props.updata) { // if (prevProps.data!=this.props.updata){
this.updatasmodals() // this.updatasmodals()
} // }
} }
setmodalSave=()=>{ setmodalSave=()=>{

@ -71,7 +71,7 @@ class ShixunPathSearch extends Component{
axios.get(upsystem).then((response)=>{ axios.get(upsystem).then((response)=>{
let updata=response.data; let updata=response.data;
this.setState({ this.setState({
updata updata:updata
}) })
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
@ -108,10 +108,9 @@ class ShixunPathSearch extends Component{
let { order,sortList,search,page,total_count,select }=this.state; let { order,sortList,search,page,total_count,select }=this.state;
return ( return (
<div> <div>
<UpgradeModals {this.state.updata===undefined?"":<UpgradeModals
{...this.state} {...this.state}
{...this.props} />}
/>
<div className="path-head pr"> <div className="path-head pr">
<div className="edu-txt-center pathNavLine"> <div className="edu-txt-center pathNavLine">
<div className="inline path-nav"> <div className="inline path-nav">

@ -52,7 +52,7 @@ class ShixunsIndex extends Component {
axios.get(upsystem).then((response)=>{ axios.get(upsystem).then((response)=>{
let updata=response.data; let updata=response.data;
this.setState({ this.setState({
updata updata:updata
}) })
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
@ -379,12 +379,12 @@ class ShixunsIndex extends Component {
render() { render() {
let {middleshixundata, typepvisible, pages, search_tags, keyword,parsedid,newtag_level,newpalce} = this.state; let {middleshixundata, typepvisible, pages, search_tags, keyword,parsedid,newtag_level,newpalce} = this.state;
console.log(this.state.updata)
return ( return (
<div className="newMain clearfix backFAFAFA"> <div className="newMain clearfix backFAFAFA">
<UpgradeModals {this.state.updata===undefined?"":<UpgradeModals
{...this.state} {...this.state}
{...this.props} />}
/>
{/*<Spin spinning={typepvisible} size="large" style={{marginTop:'15%'}}>*/} {/*<Spin spinning={typepvisible} size="large" style={{marginTop:'15%'}}>*/}
<ShixunSearchBar <ShixunSearchBar
Updatasearchlist={this.Updatasearchlist.bind(this)} Updatasearchlist={this.Updatasearchlist.bind(this)}

@ -13,7 +13,7 @@ import { CNotificationHOC } from '../../courses/common/CNotificationHOC'
import "./usersInfo.css" import "./usersInfo.css"
import "../../courses/css/members.css" import "../../courses/css/members.css"
import "../../courses/css/Courses.css" import "../../courses/css/Courses.css"
import update from 'immutability-helper'
import Trialapplication from '../../login/Trialapplication' import Trialapplication from '../../login/Trialapplication'
@ -51,11 +51,11 @@ class Infos extends Component{
} }
} }
componentDidMount =()=>{ componentDidMount =()=>{
const upsystem=`/users/system_update.json`; let upsystem=`/users/system_update.json`;
axios.get(upsystem).then((response)=>{ axios.get(upsystem).then((response)=>{
let updata=response.data; let updata=response.data;
this.setState({ this.setState({
updata updata:updata
}) })
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
@ -68,7 +68,6 @@ class Infos extends Component{
//判断是否看的是当前用户的个人主页 //判断是否看的是当前用户的个人主页
componentDidUpdate =(prevProps)=> { componentDidUpdate =(prevProps)=> {
if(this.props.current_user && prevProps.current_user != this.props.current_user){ if(this.props.current_user && prevProps.current_user != this.props.current_user){
console.log(this.props);
if(this.props.current_user.login != this.props.match.params.username){ if(this.props.current_user.login != this.props.match.params.username){
this.setState({ this.setState({
is_current:false, is_current:false,
@ -226,10 +225,9 @@ class Infos extends Component{
moduleName=pathname.split("/")[3]; moduleName=pathname.split("/")[3];
return( return(
<div className="newMain"> <div className="newMain">
<UpgradeModals {this.state.updata===undefined?"":<UpgradeModals
{...this.state} {...this.state}
{...this.props} />}
/>
{ {
isRenders && <Trialapplication {...this.props} {...this.state} Cancel={() => this.cancelModulationModels()}/> isRenders && <Trialapplication {...this.props} {...this.state} Cancel={() => this.cancelModulationModels()}/>
} }

Loading…
Cancel
Save