From 800089a4c395aa6abf314ad6318931c70d699b27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 24 Jun 2019 09:50:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesDetail/CoursesBanner.js | 35 ++----------------- public/react/src/modules/tpm/NewHeader.js | 29 +++++++++++++-- 2 files changed, 28 insertions(+), 36 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index f113209c4..e88e10a9f 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -44,35 +44,14 @@ class CoursesBanner extends Component { modalsBottomval: "", antIcon:false, coursedata:undefined, - user_phone_binded:false, - isRenders:false, - showTrial:false, } } componentDidMount() { this.onloadupdatabanner() - try { - if(this.props.current_user!==undefined){ - this.setState({ - user_phone_binded :this.props.current_user.user_phone_binded, - }) - } - }catch (e) { - console.log("CoursesBanner 60") - console.log(e) - } } - componentDidUpdate = (prevProps) => { - if(prevProps.current_user!=this.props.current_user){ - if(this.props.current_user!==undefined){ - this.setState({ - user_phone_binded :this.props.current_user.user_phone_binded, - }) - } - } - } + onloadupdatabanner=()=>{ this.updatabanner() } @@ -82,19 +61,10 @@ class CoursesBanner extends Component { axios.get(url).then((result) => { if( result!=undefined){ let data = result.data; - if(result.data.status === 407){ - this.setState({ - isRenders:true, - coursedata: data, - showTrial:false, - }) - }else{ this.setState({ coursedata: data, - showTrial:true, }) - } }else{ this.onloadupdatabanner() } @@ -352,11 +322,10 @@ class CoursesBanner extends Component { } render() { - let { Addcoursestypes, coursedata, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,user_phone_binded} = this.state; + let { Addcoursestypes, coursedata, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon} = this.state; return (