wangliang_wd

feat:优化评论列表重复点击问题

... ... @@ -681,6 +681,7 @@ struct commentHeaderView {
@Consume inDialog: boolean
private dialogBeforeJumpOtherPageAction: () => void = () => {}
private leftGap: number = 64
@State isCanClickHeader:boolean = true
build() {
Column() {
... ... @@ -800,12 +801,20 @@ struct commentHeaderView {
.margin({ left: 8 + 4 })
.alignContent(Alignment.Center)
.onClick(() => {
if (this.isCanClickHeader === true){
this.isCanClickHeader = false
commentViewModel.jumpToAccountPage(this.item, () => {
if (this.inDialog) {
if (this.dialogBeforeJumpOtherPageAction) { this.dialogBeforeJumpOtherPageAction() }
}
})
}
let timer = setInterval(() => {
this.isCanClickHeader = true
clearInterval(timer);
}, 1000);
})
}
... ...