From 16fec9e90ede69612c0153c5167c18b58c05a022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sun, 1 Sep 2019 22:10:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=B5=8F=E8=A7=88=E5=99=A8?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=A4=A7=E5=B0=8F=E5=88=B0=E5=BA=95=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E5=85=BC=E5=AE=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/busyWork/CommonWorkPost.js | 7 +++++-- .../react/src/modules/courses/coursesPublic/PathModal.js | 4 +++- .../src/modules/courses/coursesPublic/SelectResource.js | 4 +++- .../src/modules/courses/coursesPublic/ShixunModal.js | 5 ++++- .../modules/courses/coursesPublic/modal/ShixunModal2.js | 4 +++- .../src/modules/courses/exercise/Ecerciseallbackagain.js | 5 ++++- .../graduation/tasks/GraduationTasksSubmitedit.js | 9 ++++++--- .../courses/graduation/tasks/GraduationTasksSubmitnew.js | 5 ++++- .../shixunHomework/Shixunworkdetails/ShixunWorkModal.js | 5 ++++- public/react/src/modules/message/js/MessagChat.js | 4 +++- .../modules/paths/PathDetail/DetailCardsEditAndAdd.js | 5 ++++- .../modules/paths/PathDetail/DetailCardsEditAndEdit.js | 5 ++++- .../src/modules/paths/PathDetail/addCollaborators.js | 5 ++++- .../tpm/shixunchild/Collaborators/Collaborators.js | 4 +++- 14 files changed, 54 insertions(+), 17 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkPost.js b/public/react/src/modules/courses/busyWork/CommonWorkPost.js index 5b43a8237..664fefd2c 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkPost.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkPost.js @@ -409,7 +409,7 @@ class CommonWorkPost extends Component{ } }).then((result)=>{ - if(result.status===200){ + if(result){ this.setState({ page: result.data.members.length == 0 ? page - 1 : page, members: page != 1 && search == this.state.lastSearch ? this.state.members.concat(result.data.members) : result.data.members, @@ -426,7 +426,10 @@ class CommonWorkPost extends Component{ contentViewScroll=(e)=>{ //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; + + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ // console.log("到达底部"); let{ search,page,limit }=this.state; diff --git a/public/react/src/modules/courses/coursesPublic/PathModal.js b/public/react/src/modules/courses/coursesPublic/PathModal.js index 33a2cb68d..b6b37559d 100644 --- a/public/react/src/modules/courses/coursesPublic/PathModal.js +++ b/public/react/src/modules/courses/coursesPublic/PathModal.js @@ -123,8 +123,10 @@ class PathModal extends Component{ contentViewScrolledit=(e)=>{ //滑动到底判断 const {shixunmodallist} = this.state; + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ if(shixunmodallist.subject_list.length===0){ return; diff --git a/public/react/src/modules/courses/coursesPublic/SelectResource.js b/public/react/src/modules/courses/coursesPublic/SelectResource.js index f9433ddf7..47ec9ac47 100644 --- a/public/react/src/modules/courses/coursesPublic/SelectResource.js +++ b/public/react/src/modules/courses/coursesPublic/SelectResource.js @@ -101,9 +101,11 @@ class Selectresource extends Component{ } contentViewScroll=(e)=>{ let {page,searchtype}=this.state; + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ let newpage=page+1; let url if(searchtype==="getallfiles"){ diff --git a/public/react/src/modules/courses/coursesPublic/ShixunModal.js b/public/react/src/modules/courses/coursesPublic/ShixunModal.js index 24bb7310e..a38b3f6e9 100644 --- a/public/react/src/modules/courses/coursesPublic/ShixunModal.js +++ b/public/react/src/modules/courses/coursesPublic/ShixunModal.js @@ -102,7 +102,10 @@ class ShixunModal extends Component{ contentViewScrolledit=(e)=>{ const {shixunmodallist}=this.state; //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight) { + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; + + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1) { if (shixunmodallist.shixun_list.length === 0) { return; diff --git a/public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js b/public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js index 59f157597..5331ac014 100644 --- a/public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js +++ b/public/react/src/modules/courses/coursesPublic/modal/ShixunModal2.js @@ -41,8 +41,10 @@ class ShixunModal extends Component{ contentViewScrolledit=(e)=>{ //滑动到底判断 + let newscrollTop=parseInt(e.currentTarget.scrollTop) + let allclientHeight=e.currentTarget.clientHeight+newscrollTop - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ let {Searchvalue,type,page}=this.state; let newpage=page+1 diff --git a/public/react/src/modules/courses/exercise/Ecerciseallbackagain.js b/public/react/src/modules/courses/exercise/Ecerciseallbackagain.js index 3e100fdab..8aa6af17b 100644 --- a/public/react/src/modules/courses/exercise/Ecerciseallbackagain.js +++ b/public/react/src/modules/courses/exercise/Ecerciseallbackagain.js @@ -53,7 +53,10 @@ class Ecerciseallbackagain extends Component{ contentViewScroll=(e)=>{ //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; + + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ let {page,limit,datalist}=this.state; let newpage=page+1; let newdata=datalist; diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js index 0d5a756de..070ca8b6d 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js @@ -47,7 +47,7 @@ class GraduationTasksSubmitedit extends Component{ let url = "/graduation_works/"+workId+"/edit.json"; axios.get(url).then((result)=>{ - if(result.status===200){ + if(result){ console.log(result.data.description); this.setState({ @@ -246,7 +246,7 @@ class GraduationTasksSubmitedit extends Component{ limit:limit }).then((result)=>{ - if(result.status===200){ + if(result){ if(types===1){ if(result.data.members.length>0) { result.data.members.map((item, key) => { @@ -279,7 +279,10 @@ class GraduationTasksSubmitedit extends Component{ contentViewScroll=(e)=>{ //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; + + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ // console.log("到达底部"); let{ search,page,limit,workslist}=this.state; diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js index 9ebefcaef..e73c1872b 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js @@ -270,7 +270,10 @@ class GraduationTasksSubmitnew extends Component{ contentViewScroll=(e)=>{ //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; + + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ // console.log("到达底部"); let{ search,page,limit }=this.state; diff --git a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js index 293310a90..daa0868a8 100644 --- a/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js +++ b/public/react/src/modules/courses/shixunHomework/Shixunworkdetails/ShixunWorkModal.js @@ -86,7 +86,10 @@ class ShixunWorkModal extends Component{ contentViewScroll=(e)=>{ //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; + + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ let {page,limit,group_list}=this.state; let newpage=page+1; let newgroup_list=group_list; diff --git a/public/react/src/modules/message/js/MessagChat.js b/public/react/src/modules/message/js/MessagChat.js index 52c8d9870..bd87ad90f 100644 --- a/public/react/src/modules/message/js/MessagChat.js +++ b/public/react/src/modules/message/js/MessagChat.js @@ -83,9 +83,11 @@ class MessagChat extends Component{ } // 滑动刷新 contentViewScrolledit=(e)=>{ + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ // console.log("滑动到底判断"); let {page}=this.state; let newpage=page+1 diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js index 9f4d49a04..9ed079957 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js @@ -299,7 +299,10 @@ class DetailCardsEditAndAdd extends Component{ contentViewScrolladd=(e)=>{ const {ChooseShixunList}=this.state; //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; + + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ if(ChooseShixunList.shixun_list.length===0){ return diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js index b6c7e53b2..c7ca9538b 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js @@ -339,7 +339,10 @@ class DetailCardsEditAndEdit extends Component{ contentViewScrolledit=(e)=>{ //滑动到底判断 const {ChooseShixunList}=this.state; - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; + + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ if(ChooseShixunList.shixun_list.length===0){ return diff --git a/public/react/src/modules/paths/PathDetail/addCollaborators.js b/public/react/src/modules/paths/PathDetail/addCollaborators.js index 056e69b31..646ea5ead 100644 --- a/public/react/src/modules/paths/PathDetail/addCollaborators.js +++ b/public/react/src/modules/paths/PathDetail/addCollaborators.js @@ -127,7 +127,10 @@ class addCollaborators extends Component{ contentViewScroll=(e)=>{ //滑动到底判断 - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; + + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ // console.log("到达底部"); let id=this.props.match.params.pathId; diff --git a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js index ea99b740d..9fbb2d716 100644 --- a/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js +++ b/public/react/src/modules/tpm/shixunchild/Collaborators/Collaborators.js @@ -372,8 +372,10 @@ class Collaborators extends Component { contentViewScrolledit=(e)=>{ //滑动到底判断 + let newscrollTop=parseInt(e.currentTarget.scrollTop); + let allclientHeight=e.currentTarget.clientHeight+newscrollTop; - if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ + if(e.currentTarget.scrollHeight-allclientHeight===0||e.currentTarget.scrollHeight-allclientHeight===1){ let {page,collaboratorList,user_name,school_name,Searchadmin} = this.state; let newpage=page+1; let newSearchadmin=Searchadmin