Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
douaojie
2024-05-10 16:49:42 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
67b21ac36d3959253c780cef4f87078d5c6558c3
67b21ac3
1 parent
890f5113
fix: 缺省图调整
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
20 deletions
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/EmptyComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentComponent.ets
View file @
67b21ac
import ArrayList from '@ohos.util.ArrayList'
import { ViewType } from 'wdConstant/Index';
import { DateTimeUtils, EmitterEventId, EmitterUtils, LazyDataSource } from 'wdKit/Index';
import PageModel from '../../../viewmodel/PageModel';
import { commentItemModel, commentListModel, WDPublicUserType } from '../model/CommentModel';
import commentViewModel from '../viewmodel/CommentViewModel'
import { commentItemModel, WDPublicUserType } from '../model/CommentModel';
import commentViewModel from '../viewmodel/CommentViewModel';
import { CommentText } from './CommentText';
import measure from '@ohos.measure'
import { CommentCustomDialog } from './CommentCustomDialog'
import { CommentCustomDialog } from './CommentCustomDialog';
import { publishCommentModel } from '../model/PublishCommentModel';
import { ifaa } from '@kit.OnlineAuthenticationKit';
import { HttpUrlUtils, HttpUtils } from 'wdNetwork/Index';
import NoMoreLayout from '../../page/NoMoreLayout';
import { HttpUtils } from 'wdNetwork/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import {
ColorUtils } from '../../../utils/ColorUtils
';
import {
EmptyComponent } from '../../view/EmptyComponent
';
const TAG = 'CommentComponent';
...
...
@@ -27,10 +21,8 @@ export struct CommentComponent {
// @State private browSingModel: commentListModel = new commentListModel()
/*必传*/
@ObjectLink publishCommentModel: publishCommentModel
listScroller: ListScroller = new ListScroller(); // scroller控制器
historyOffset: number = 0; // 上次浏览到列表距离顶端的偏移量offset
isloading: boolean = false
@State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource();
@State dialogController: CustomDialogController | null = null;
...
...
@@ -142,7 +134,7 @@ export struct CommentComponent {
build() {
Column() {
List({
scroller:this.listScroller
}) {
List({
scroller: this.listScroller
}) {
ListItemGroup({ header: this.titleHeader() })
LazyForEach(this.allDatas, (item: commentItemModel, index: number) => {
...
...
@@ -181,10 +173,15 @@ export struct CommentComponent {
// 加载更多
ListItem() {
if (this.hasMore === false) NoMoreLayout()
if (this.hasMore === false) {
// NoMoreLayout()
EmptyComponent({ emptyType: 17 })
.height(300)
}
}
.onReachEnd(()=>{
}
.onReachEnd(() => {
if (this.hasMore) {
this.getData()
}
...
...
@@ -197,11 +194,13 @@ export struct CommentComponent {
//获取数据
async getData() {
commentViewModel.fetchContentCommentList(this.currentPage + '', this.publishCommentModel.targetId, this.publishCommentModel.targetType)
commentViewModel.fetchContentCommentList(this.currentPage + '', this.publishCommentModel.targetId,
this.publishCommentModel.targetType)
.then(commentListModel => {
this.currentPage++
if (Number.parseInt(commentListModel.totalCommentNum) > Number.parseInt(this.publishCommentModel.totalCommentNumer)) {
if (Number.parseInt(commentListModel.totalCommentNum) >
Number.parseInt(this.publishCommentModel.totalCommentNumer)) {
this.publishCommentModel.totalCommentNumer = commentListModel.totalCommentNum + ''
}
...
...
@@ -223,7 +222,7 @@ export struct CommentComponent {
});
}
else
{
}
else
{
this.hasMore = false
}
})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/EmptyComponent.ets
View file @
67b21ac
...
...
@@ -231,7 +231,7 @@ export struct EmptyComponent {
this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment1) {
imageString = $r('app.media.icon_no_comment')
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoSearchResult) {
imageString = $r('app.media.icon_no_result')
imageString = $r('app.media.icon_no_result
1
')
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) {
imageString = $r('app.media.icon_no_net1')
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) {
...
...
Please
register
or
login
to post a comment