zhenghy

评论回调事件添加

... ... @@ -9,6 +9,8 @@ import { ContentDetailDTO } from 'wdBean/Index'
export struct CommentTabComponent {
private onCommentFocus: () => void = () => {
}
private onLoad: (dialogController: CustomDialogController) => void = () => {
}
@ObjectLink publishCommentModel: publishCommentModel
@Prop contentDetail: ContentDetailDTO
@Prop pageComponentType: number = -1 //1:视频详情页 2:竖屏直播页
... ... @@ -41,6 +43,8 @@ export struct CommentTabComponent {
backgroundColor: "#50000000",
})
this.onLoad(this.dialogController)
}
getCommentInputBackImg() {
... ... @@ -119,7 +123,6 @@ export struct CommentTabComponent {
if (this.contentDetail.bestNoticer === 1) {
this.publishCommentModel.placeHolderText = "优质评论会获得最佳评论人的称号"
}
this.dialogController?.open();
})
}
... ... @@ -156,7 +159,7 @@ export struct CommentIconComponent {
// Stack({alignContent:Alignment.Start}) {
if (Number.parseInt(this.publishCommentModel.totalCommentNumer) != 0) {
RelativeContainer() {
Image(this.styleType == 1 ? $r('app.media.comment_icon_number_bg'):$r('app.media.ic_like_back_Select'))
Image(this.styleType == 1 ? $r('app.media.comment_icon_number_bg') : $r('app.media.ic_like_back_Select'))
.objectFit(ImageFit.Fill)
.resizable({
slice: {
... ...
... ... @@ -83,6 +83,7 @@ export struct OperRowListView {
private AudioSuspension = new AudioSuspensionModel()
@State currentStatus: number | string | undefined = 0;
@State name: string = 'audio_recommend_status_wait'
@State dialogController: CustomDialogController | null = null;
async aboutToAppear() {
console.info(TAG, '22222----', this.styleType)
... ... @@ -207,6 +208,9 @@ export struct OperRowListView {
contentDetail: this.contentDetailData,
onCommentFocus: this.onCommentFocus,
pageComponentType: this.pageComponentType,
onLoad: (dialogController: CustomDialogController) => {
this.dialogController = dialogController
}
})
}
}
... ... @@ -222,6 +226,11 @@ export struct OperRowListView {
CommentIconComponent({ publishCommentModel: this.publishCommentModel, styleType: this.styleType })
.onClick(() => {
this.onCommentIconClick()
console.log(JSON.stringify(this.dialogController?.open))
// 评论弹框内部嵌入
!this.showBackIcon && this.dialogController?.open()
})
}
}
... ... @@ -290,7 +299,8 @@ export struct OperRowListView {
@Builder
builderListen() {
Column() {
Image(this.currentStatus === PlayerConstants.STATUS_START ? $r("app.media.icon_voice_playing") : $r("app.media.icon_listen"))
Image(this.currentStatus === PlayerConstants.STATUS_START ? $r("app.media.icon_voice_playing") :
$r("app.media.icon_listen"))
.width(24)
.height(24)
.aspectRatio(1)
... ...