From f60e3485abe71357dbbc8dd8a284aea9cb3b82fb 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, 9 Mar 2020 23:19:54 +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 --- .../modules/courses/Resource/Fileslistitem.js | 2 +- .../src/modules/courses/Resource/index.js | 19 +++++++++++++++---- .../courses/coursesPublic/sendResources.js | 10 ++++++++++ 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js index 37dd95298..bac740985 100644 --- a/public/react/src/modules/courses/Resource/Fileslistitem.js +++ b/public/react/src/modules/courses/Resource/Fileslistitem.js @@ -25,7 +25,7 @@ class Fileslistitem extends Component { if (bools === true) { this.props.Settingtypes(discussMessage.id) } else { - this.props.Settingtypess(discussMessage.id) + this.props.Settingtypess(discussMessage.id,discussMessage.title,discussMessage.link) } } diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index e76845102..ffb9e0395 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -43,7 +43,9 @@ class Fileslists extends Component{ has_course_groups:false, course_is_public:undefined, isSpin:false, - course_second_categories:[] + course_second_categories:[], + title: "", + link: "" } } @@ -595,6 +597,8 @@ class Fileslists extends Component{ }else{ this.setState({ Addanexternallink:false, + title: "", + link: "" }) if(ints===1){ this.Updateresourcepage(); @@ -627,11 +631,14 @@ class Fileslists extends Component{ }) } - Settingtypess=(id)=>{ + Settingtypess=(id,title,link)=>{ + debugger this.setState({ Addanexternallink:true, Exterchainname:"资源设置", discussMessageid:id, + title: title, + link: link }) } @@ -779,7 +786,9 @@ class Fileslists extends Component{ child, sort, Addanexternallink, - Exterchainname + Exterchainname, + title, + link, } = this.state; let category_id= this.props.match.params.category_id; @@ -876,6 +885,8 @@ class Fileslists extends Component{ {Addanexternallink&&Addanexternallink===true?:""} Settingtypes={(id)=>this.Settingtypes(id)} - Settingtypess={(id)=>this.Settingtypess(id)} + Settingtypess={(id,t,l)=>this.Settingtypess(id,t,l)} coursesId={this.props.match.params.coursesId} updatafiledfun={()=>this.updatafiled()} index={index} diff --git a/public/react/src/modules/courses/coursesPublic/sendResources.js b/public/react/src/modules/courses/coursesPublic/sendResources.js index 6bbe308f9..d7a3a2b98 100644 --- a/public/react/src/modules/courses/coursesPublic/sendResources.js +++ b/public/react/src/modules/courses/coursesPublic/sendResources.js @@ -63,6 +63,16 @@ class sendResources extends Component{ componentDidMount() { + try { + this.setState({ + resourcesname:this.props.title, + resourceurl:this.props.link, + addonAfteronelens3:this.props.title.length, + }) + }catch (e) { + + } + } //勾选实训