From 9f3b63d7ac50fdc495fccd8d73768e24cb5464ef Mon Sep 17 00:00:00 2001 From: naruto2018 <4563196@qq.com> Date: Sat, 3 Jun 2023 20:07:59 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=B0=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mini/src/layout/thread/comment/index.jsx | 21 ++- .../thread/components/comment-list/index.jsx | 20 ++- web/components/q-poster-s/h5/index.jsx | 1 + web/components/q-poster-s/pc/index.jsx | 5 +- web/layout/thread/pc/index.jsx | 122 +++++++++--------- 5 files changed, 82 insertions(+), 87 deletions(-) diff --git a/mini/src/layout/thread/comment/index.jsx b/mini/src/layout/thread/comment/index.jsx index 01f526cef..2fda37120 100644 --- a/mini/src/layout/thread/comment/index.jsx +++ b/mini/src/layout/thread/comment/index.jsx @@ -611,21 +611,20 @@ class CommentH5Page extends React.Component { + {isReady && ( {/* 评论区触发 */} - {site.webConfig.setSite.siteComment[2].value && ( - this.onInputClick()}> - - - )} + this.onInputClick()}> + + {/* 操作区 */} diff --git a/mini/src/layout/thread/components/comment-list/index.jsx b/mini/src/layout/thread/components/comment-list/index.jsx index 1e6b9d1ab..3700a1ebc 100644 --- a/mini/src/layout/thread/components/comment-list/index.jsx +++ b/mini/src/layout/thread/components/comment-list/index.jsx @@ -221,18 +221,14 @@ class CommentList extends React.Component { {!isApproved ? 审核中 : } {/* 评论内容 */} - {site.webConfig.setSite.siteComment[2].value && ( - <> - - this.toCommentDetail()} - useShowMore={!!this.state.isShowOne} - content={this.props?.data?.content} - customHoverBg - > - - - )} + + this.toCommentDetail()} + useShowMore={!!this.state.isShowOne} + content={this.props?.data?.content} + customHoverBg + > + {/* { + console.log('readThreadPoster222222222222') console.log(res) this.setState({ loading:false, diff --git a/web/components/q-poster-s/pc/index.jsx b/web/components/q-poster-s/pc/index.jsx index 9de15c34f..8dc1fd4be 100644 --- a/web/components/q-poster-s/pc/index.jsx +++ b/web/components/q-poster-s/pc/index.jsx @@ -24,14 +24,15 @@ class Index extends React.Component { page: 1 }, }).then((res) => { - console.log(res) + console.log('readThreadPoster222222') + console.log(res) this.setState({ loading:false, list:res.data.pageData }) }); console.log('readThreadPoster') - console.log(this.state.list) + } gothead = (tid) => { Router.push({url: `/thread/${tid}`}); diff --git a/web/layout/thread/pc/index.jsx b/web/layout/thread/pc/index.jsx index 7e6b82f30..84bc52b18 100644 --- a/web/layout/thread/pc/index.jsx +++ b/web/layout/thread/pc/index.jsx @@ -91,20 +91,20 @@ class ThreadPCPage extends React.Component { if (threadBodyRef && threadBodyRef.current) { // 加载评论列表 const scrollDistance = threadBodyRef?.current?.scrollTop; - // const offsetHeight = threadBodyRef?.current?.offsetHeight; - // const scrollHeight = threadBodyRef?.current?.scrollHeight; - // const { isCommentReady, isNoMore } = this.props.thread; + const offsetHeight = threadBodyRef?.current?.offsetHeight; + const scrollHeight = threadBodyRef?.current?.scrollHeight; + const { isCommentReady, isNoMore } = this.props.thread; // 记录当前的滚动位置 this.props.thread.setScrollDistance(scrollDistance); - // if ( - // scrollDistance + offsetHeight >= scrollHeight - 20 && - // !this.state.isCommentLoading && - // isCommentReady && - // !isNoMore - // ) { - // this.page = this.page + 1; - // this.loadCommentList(); - // } + if ( + scrollDistance + offsetHeight >= scrollHeight - 20 && + !this.state.isCommentLoading && + isCommentReady && + !isNoMore + ) { + this.page = this.page + 1; + this.loadCommentList(); + } } } @@ -819,57 +819,55 @@ class ThreadPCPage extends React.Component { )} - {/*/!* 回复详情内容 *!/*/} - {/*{webConfig.setSite.siteComment[0].value && (*/} - {/*
*/} - {/* {isCommentReady && isApproved ? (*/} - {/* */} - {/* /!* 第一段列表 *!/*/} - {/* {isCommentReady && isShowCommentList && (*/} - {/* */} - {/* this.onSortChange(flag)}*/} - {/* replyAvatarClick={(comment, reply, floor) => this.replyAvatarClick(comment, reply, floor)}*/} - {/* >*/} - {/* {!isCommentPositionNoMore && (*/} - {/* // this.onLoadMoreClick()}*/} - {/* // noMoreType="line"*/} - {/* // loadingText="点击加载更多"*/} - {/* // isError={isCommentListError}*/} - {/* // noMore={isCommentPositionNoMore}*/} - {/* // >*/} - {/* */} - {/*
this.onLoadMoreClick()}>*/} - {/*
展开更多评论
*/} - {/* */} - {/*
*/} - {/* )}*/} - {/*
*/} - {/* )}*/} - {/* */} - {/* this.onSortChange(flag)}*/} - {/* onEditClick={comment => this.onEditClick(comment)}*/} - {/* onPublishClick={(value, imageList) => this.onPublishClick(value, imageList)}*/} - {/* onReportClick={comment => this.onReportClick(comment)}*/} - {/* >*/} - {/* /!* {this.state.isCommentLoading && } *!/*/} - {/*
*/} - {/* ) : (*/} - {/* isApproved && */} - {/* )}*/} - {/*
*/} - {/*)}*/} + {/* 回复详情内容 */} +
+ {isCommentReady && isApproved ? ( + + {/* 第一段列表 */} + {isCommentReady && isShowCommentList && ( + + this.onSortChange(flag)} + replyAvatarClick={(comment, reply, floor) => this.replyAvatarClick(comment, reply, floor)} + > + {!isCommentPositionNoMore && ( + // this.onLoadMoreClick()} + // noMoreType="line" + // loadingText="点击加载更多" + // isError={isCommentListError} + // noMore={isCommentPositionNoMore} + // > + +
this.onLoadMoreClick()}> +
展开更多评论
+ +
+ )} +
+ )} + + this.onSortChange(flag)} + onEditClick={comment => this.onEditClick(comment)} + onPublishClick={(value, imageList) => this.onPublishClick(value, imageList)} + onReportClick={comment => this.onReportClick(comment)} + > + {/* {this.state.isCommentLoading && } */} +
+ ) : ( + isApproved && + )} +
- {/* {isNoMore && } */} + {/*{isNoMore && }*/} ); } -- Gitee