升级提示调整

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

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

@ -10,6 +10,8 @@ import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import SiderBar from '../tpm/SiderBar';
import UpgradeModals from '../modals/UpgradeModals';
import { SnackbarHOC , getImageUrl} from 'educoder';
import Slider from '@icedesign/base/lib/slider';
@ -35,6 +37,15 @@ class ShixunsHome extends Component {
}
}
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`;
axios.get(url).then((response)=> {
if(response.status===200){
@ -106,6 +117,9 @@ class ShixunsHome extends Component {
return (
<div className="newMain clearfix backFAFAFA">
{this.state.updata===undefined?"":<UpgradeModals
{...this.state}
/>}
<Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
{/*懒加载*/}

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

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

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

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

Loading…
Cancel
Save