zhenghy

图文页评论滚动问题

... ... @@ -71,7 +71,7 @@ export struct CommentComponent {
if (this.publishCommentModel.lastCommentModel.parentId == '-1') {
this.allDatas.addFirstItem(model)
//TODO 跳转顶部
}else{
} else {
//二级评论
this.allDatas.getDataArray().forEach(element => {
if (element.id == this.publishCommentModel.lastCommentModel.rootCommentId) {
... ... @@ -98,7 +98,7 @@ export struct CommentComponent {
}
.margin({ left: 16 })
.onClick(()=>{
.onClick(() => {
// this.allDatas.push(new commentItemModel())
// this.allDatas.addFirstItem(new commentItemModel())
// this.allDatas.reloadData();
... ... @@ -148,7 +148,7 @@ export struct CommentComponent {
.onClick(() => {
console.log(TAG)
})
},(childItem: commentItemModel, subIndex: number) => JSON.stringify(childItem) + subIndex.toString())
}, (childItem: commentItemModel, subIndex: number) => JSON.stringify(childItem) + subIndex.toString())
}
} else {
ListItemGroup({ header: this.CommentHeaderItem(item, index) }) {
... ... @@ -163,12 +163,14 @@ export struct CommentComponent {
.onClick(() => {
console.log(TAG)
})
},(childItem: commentItemModel, subIndex: number) => JSON.stringify(childItem) + subIndex.toString())
}, (childItem: commentItemModel, subIndex: number) => JSON.stringify(childItem) + subIndex.toString())
}
}
},(item: commentItemModel, index: number) => JSON.stringify(item) + index.toString())
}.layoutWeight(1)
}, (item: commentItemModel, index: number) => JSON.stringify(item) + index.toString())
}
.enableScrollInteraction(false)
}
}
//获取数据
... ...