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
xugenyuan
2024-08-09 18:42:14 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4a2eed3c644991308dda166c9f8389221191b26d
4a2eed3c
1 parent
a3ea43ea
ref |> 调整评论弹框上面点赞需要登录问题
Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
9 deletions
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentListDialog.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentComponent.ets
View file @
4a2eed3
...
...
@@ -48,6 +48,7 @@ export struct CommentComponent {
// 是否在弹框中
@Provide inDialog: boolean = false
private dialogBeforeJumpOtherPageAction: () => void = () => {}
// 在自定义组件即将析构销毁时将dialogControlle置空
aboutToDisappear() {
...
...
@@ -158,7 +159,8 @@ export struct CommentComponent {
commentHeaderView({
item: item,
dialogController: this.dialogController,
publishCommentModel: this.publishCommentModel
publishCommentModel: this.publishCommentModel,
dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction
})
}
...
...
@@ -194,7 +196,8 @@ export struct CommentComponent {
ChildCommentItem({
item: childItem,
dialogController: this.dialogController,
publishCommentModel: this.publishCommentModel
publishCommentModel: this.publishCommentModel,
dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction
});
}
.onClick(() => {
...
...
@@ -209,7 +212,8 @@ export struct CommentComponent {
ChildCommentItem({
item: childItem,
dialogController: this.dialogController,
publishCommentModel: this.publishCommentModel
publishCommentModel: this.publishCommentModel,
dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction
});
}
.onClick(() => {
...
...
@@ -319,6 +323,7 @@ struct ChildCommentItem {
@Consume contentDetailData: ContentDetailDTO
@Consume inDialog: boolean
private dialogBeforeJumpOtherPageAction: () => void = () => {}
build() {
Column() {
...
...
@@ -388,7 +393,8 @@ struct ChildCommentItem {
commentFooterView({
item: this.item,
dialogController: this.dialogController,
publishCommentModel: this.publishCommentModel
publishCommentModel: this.publishCommentModel,
dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction
}).margin({ left: 95, right: 16 })
}.alignItems(HorizontalAlign.Start)
.width('100%')
...
...
@@ -430,7 +436,7 @@ struct ChildCommentItem {
commentViewModel.jumpToAccountPage(this.item, () => {
if (this.inDialog) {
PublicDialogManager.shareInstance().closeLastDialog()
if (this.dialogBeforeJumpOtherPageAction) { this.dialogBeforeJumpOtherPageAction() }
}
})
})
...
...
@@ -541,6 +547,7 @@ struct commentHeaderView {
@ObjectLink item: commentItemModel
@Consume inDialog: boolean
private dialogBeforeJumpOtherPageAction: () => void = () => {}
build() {
Column() {
...
...
@@ -598,7 +605,8 @@ struct commentHeaderView {
commentFooterView({
item: this.item,
dialogController: this.dialogController,
publishCommentModel: this.publishCommentModel
publishCommentModel: this.publishCommentModel,
dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction
}).margin({ left: 59, right: 16 })
}.alignItems(HorizontalAlign.Start)
.padding({bottom: 8})
...
...
@@ -640,7 +648,7 @@ struct commentHeaderView {
commentViewModel.jumpToAccountPage(this.item, () => {
if (this.inDialog) {
PublicDialogManager.shareInstance().closeLastDialog()
if (this.dialogBeforeJumpOtherPageAction) { this.dialogBeforeJumpOtherPageAction() }
}
})
})
...
...
@@ -676,6 +684,7 @@ struct commentFooterView {
@ObjectLink item: commentItemModel
@Consume inDialog: boolean
private dialogBeforeJumpOtherPageAction: () => void = () => {}
build() {
Row() {
...
...
@@ -748,7 +757,7 @@ struct commentFooterView {
const user_id = HttpUtils.getUserId()
if (!user_id) {
if (this.inDialog) {
PublicDialogManager.shareInstance().closeLastDialog()
if (this.dialogBeforeJumpOtherPageAction) { this.dialogBeforeJumpOtherPageAction() }
}
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentListDialog.ets
View file @
4a2eed3
...
...
@@ -117,7 +117,12 @@ struct CommentListDialog {
publishCommentModel: this.publishCommentModel,
fixedHeightMode: true,
inDialog: true,
showTitleComponent: false
showTitleComponent: false,
dialogBeforeJumpOtherPageAction: () => {
if (this.onClose) {
this.onClose()
}
}
}).layoutWeight(1)
OperRowListView({
...
...
Please
register
or
login
to post a comment