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
张善主
2024-04-28 16:13:17 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c367b6fafb054181a647206ef095bd64df507a1b
c367b6fa
1 parent
f5853d2f
feat(动态):评论对接
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
2 deletions
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
View file @
c367b6f
...
...
@@ -25,6 +25,9 @@ import { BusinessError } from '@ohos.base';
import { CommonConstants, SpConstants } from 'wdConstant/Index';
import { CardMediaInfo } from '../components/cardCommon/CardMediaInfo'
import router from '@ohos.router';
import { publishCommentModel } from './comment/model/PublishCommentModel';
import { CommentComponent } from './comment/view/CommentComponent';
const TAG = 'DynamicDetailComponent'
@Preview
@Component
...
...
@@ -50,6 +53,8 @@ export struct DynamicDetailComponent {
//跳转
private mJumpInfo: ContentDTO = {} as ContentDTO;
@State publishCommentModel: publishCommentModel = new publishCommentModel()
async aboutToAppear() {
await this.getContentDetailData()
}
...
...
@@ -355,8 +360,14 @@ export struct DynamicDetailComponent {
//点赞操作
this.toggleLikeStatus()
})
// 评论
if (this.contentDetailData?.openComment) {
Divider().strokeWidth(6).color('#f5f5f5')
CommentComponent({
publishCommentModel: this.publishCommentModel
})
}
Blank().layoutWeight(1)
//fixme 评论组件
}
}
.width(CommonConstants.FULL_WIDTH)
...
...
@@ -365,7 +376,10 @@ export struct DynamicDetailComponent {
.scrollBar(BarState.Off)
.alignSelf(ItemAlign.Start)
//底部交互区
OperRowListView({ contentDetailData: this.contentDetailData,interactData:this.interactDataDTO,newsStatusOfUser:this.newsStatusOfUser })
OperRowListView({ contentDetailData: this.contentDetailData
,interactData:this.interactDataDTO
,newsStatusOfUser:this.newsStatusOfUser
,publishCommentModel: this.publishCommentModel})
}
}
.alignSelf(ItemAlign.Start)
...
...
@@ -384,6 +398,17 @@ export struct DynamicDetailComponent {
} catch (exception) {
console.log('请求失败',JSON.stringify(exception))
}
if (this.contentDetailData.openComment) {
this.publishCommentModel = {
targetId: String(this.contentDetailData?.newsId || ''),
targetRelId: this.contentDetailData?.reLInfo?.relId,
targetTitle: this.contentDetailData?.newsTitle,
targetRelType: this.contentDetailData?.reLInfo?.relType,
targetRelObjectId: String(this.contentDetailData?.reLInfo?.relObjectId),
keyArticle: String(this.contentDetailData?.keyArticle),
targetType: String(this.contentDetailData?.newsType),
} as publishCommentModel
}
this.getBatchAttentionStatus()
this.getInteractDataStatus()
this.makeJumpInfo()
...
...
Please
register
or
login
to post a comment