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-05-21 17:55:27 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
862b33e55c78bc8e2422c8348466831712436d24
862b33e5
1 parent
27999804
ref |> 新增评论列表对话框
Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
4 deletions
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentCustomDialog.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentListDialog.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentCustomDialog.ets
View file @
862b33e
...
...
@@ -4,6 +4,7 @@ import { commentItemModel } from '../model/CommentModel'
import { publishCommentModel } from '../model/PublishCommentModel'
import commentViewModel from '../viewmodel/CommentViewModel'
/// 评论输入框
@Preview
@CustomDialog
export struct CommentCustomDialog {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentListDialog.ets
View file @
862b33e
import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index'
import { OperRowListView } from '../../view/OperRowListView'
import { publishCommentModel } from '../model/PublishCommentModel'
import { CommentComponent } from './CommentComponent'
/// 评论列表弹框
@CustomDialog
export struct CommentListDialog {
/// 内部使用
private publishCommentModel: publishCommentModel = new publishCommentModel()
@State private publishCommentModel: publishCommentModel = new publishCommentModel()
@State private operationButtonList: string[] = []
controller?: CustomDialogController
@State windowWidth: number = AppStorage.get<number>('windowWidth') || 0
@State windowHeight: number = AppStorage.get<number>('windowHeight') || 0
/// 外部初始化
contentDetail?: ContentDetailDTO
pageInfo?: PageInfoDTO
@Consume contentDetailData: ContentDetailDTO // 详情页传
@Consume pageInfo: PageInfoDTO // 专题页传
onClose?: () => void
build() {
aboutToAppear(): void {
if (this.contentDetailData) {
if (this.contentDetailData?.openComment) {
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')
this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '')
this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId || '')
this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')
this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
this.operationButtonList.push('comment')
}
this.operationButtonList.push('collect')
this.operationButtonList.push('share')
}
if (this.pageInfo) {
}
}
build() {
Column() {
CommentComponent({
publishCommentModel: this.publishCommentModel,
showCloseIcon: true,
fixedHeightMode: true,
onCloseClick: () => {
this.controller!.close()
if (this.onClose) {
this.onClose()
}
}
}).layoutWeight(1)
OperRowListView({
componentType: 1,
pageComponentType: 8,
showBackIcon: false,
operationButtonList: this.operationButtonList,
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
showCommentIcon: true,
})
}
.height(this.windowHeight - this.windowWidth * 9 / 16 + 'px')
.zIndex(1000)
.backgroundColor(Color.White)
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment