dev_forum
杨树林 6 years ago
parent d6fb28b970
commit 19f678e597

@ -32,6 +32,7 @@ class Trialapplication extends Component {
readonlyInput: true, readonlyInput: true,
user_phone_binded: false, user_phone_binded: false,
showTrial: false, showTrial: false,
user: undefined,
} }
//user_phone_binded 判断是否手机号验证 //user_phone_binded 判断是否手机号验证
// console.log("Trialapplication"); // console.log("Trialapplication");
@ -43,15 +44,32 @@ class Trialapplication extends Component {
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
// console.log("46");
// console.log(nextProps);
// console.log(this.props);
if (nextProps.user != this.props.user) {
// console.log("50");
// console.log(nextProps.user);
if (nextProps.user !== undefined) {
// console.log("53");
// console.log(nextProps.user);
this.setState({
user_phone_binded: nextProps.user.user_phone_binded,
})
}
} }
}
//初始化数据 //初始化数据
componentDidMount() { componentDidMount() {
console.log("53"); // console.log("53");
//
console.log(this.props.isRenders); // console.log(this.props.isRenders);
if (this.props.isRenders != undefined) { if (this.props.isRenders != undefined) {
this.setState({ this.setState({
@ -77,21 +95,6 @@ class Trialapplication extends Component {
//TODO 这里如果样式变了会出现css不加载的情况 //TODO 这里如果样式变了会出现css不加载的情况
}); });
console.log(this.props.isRenders);
console.log("89");
console.log(this.state.props.user_phone_binded );
try {
if (this.state.props.user_phone_binded !== undefined) {
console.log(this.state.props.user_phone_binded);
this.setState({
user_phone_binded: this.state.props.user_phone_binded,
})
}
} catch (e) {
console.log(e);
}
} }
@ -384,9 +387,6 @@ class Trialapplication extends Component {
<style> <style>
{ {
` `
// .dialogBox{
// height: 370px;
// }
.dialogBox2{ .dialogBox2{
height: 420px; height: 420px;
} }

@ -170,7 +170,6 @@ class NewHeader extends Component {
submitapplications:false, submitapplications:false,
isRender:false, isRender:false,
isRenders:false, isRenders:false,
user_phone_binded:false,
showTrial:false, showTrial:false,
} }
// console.log("176") // console.log("176")
@ -209,18 +208,18 @@ class NewHeader extends Component {
} }
componentDidUpdate = (prevProps) => { componentDidUpdate = (prevProps) => {
if(prevProps.user!=this.props.user){ // if(prevProps.user!=this.props.user){
// console.log("216") // // console.log("216")
// console.log(prevProps.user); // // console.log(prevProps.user);
// console.log(this.props.user); // // console.log(this.props.user);
if(this.props.user !== undefined){ // if(this.props.user !== undefined){
this.setState({ // this.setState({
user_phone_binded :this.props.user.user_phone_binded, // user_phone_binded :this.props.user.user_phone_binded,
}) // })
} // }
//
//
} // }
} }
componentWillReceiveProps(newProps, oldProps) { componentWillReceiveProps(newProps, oldProps) {
this.setState({ this.setState({
@ -581,7 +580,6 @@ submittojoinclass=(value)=>{
user, user,
isRender, isRender,
isRenders, isRenders,
user_phone_binded,
}=this.state; }=this.state;
/* /*
用户名称 用户头像url 用户名称 用户头像url
@ -627,7 +625,7 @@ submittojoinclass=(value)=>{
{/* />*/} {/* />*/}
{/* :""*/} {/* :""*/}
{/*}*/} {/*}*/}
<Trialapplication {...this.state} user_phone_binded={user_phone_binded} ></Trialapplication> <Trialapplication {...this.state} ></Trialapplication>
<div className="educontent clearfix"> <div className="educontent clearfix">
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/} {/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/}
<a href="/"> <a href="/">

Loading…
Cancel
Save