daijian_wd

fix: 评论底部栏bug修复

... ... @@ -176,6 +176,7 @@ export struct ImageAndTextPageComponent {
contentDetailData: this.contentDetailData[0],
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
styleType: 1,
})
}
}
... ...
... ... @@ -364,6 +364,7 @@ export struct MultiPictureDetailPageComponent {
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
styleType: 2,
})
}
.transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
... ...
... ... @@ -15,6 +15,7 @@ export struct CommentTabComponent {
@State type: number = 1
@State placeHolder: string = '说两句...'
@State dialogController: CustomDialogController | null = null;
styleType : number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏)
/*回调方法*/
dialogControllerConfirm: () => void = () => {
}
... ... @@ -69,6 +70,7 @@ export struct CommentIconComponent {
@ObjectLink publishCommentModel: publishCommentModel
/*展示类型*/
@State type: number = 1
styleType : number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏)
// aboutToAppear(): void {
// setTimeout(() => {
// this.publishCommentModel.totalCommentNumer = '444'
... ... @@ -87,7 +89,9 @@ export struct CommentIconComponent {
build() {
Row() {
Stack({ alignContent: Alignment.TopEnd }) {
Image($r('app.media.comment_icon')).width(24).height(24)
// Image($r('app.media.comment_icon')).width(24).height(24)
Image(this.styleType == 1 ? $r('app.media.comment_icon') :
$r('app.media.comment_icon_white')).width(24).height(24)
// Stack({alignContent:Alignment.Start}) {
if (Number.parseInt(this.publishCommentModel.totalCommentNumer) != 0) {
RelativeContainer() {
... ...
... ... @@ -14,6 +14,7 @@ export struct LikeComponent {
@Prop data: Record<string, string>
enableBtn = true
componentType : number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式
styleType : number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏)
@State likeCount: number = 0 //点赞数
//上层传值 样例
... ... @@ -81,7 +82,9 @@ export struct LikeComponent {
}else {
//1: 底部栏目样式 默认样式
Column() {
Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default'))
// Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default'))
Image(this.likeStatus ? $r('app.media.icon_like_select') : this.styleType == 1 ? $r('app.media.icon_like_default') :
$r('app.media.icon_like_default_white'))
.width(24)
.height(24)
.onClick(() => {
... ...
... ... @@ -50,6 +50,7 @@ export struct OperRowListView {
@Prop @Watch('onDetailUpdated') contentDetailData: ContentDetailDTO // 稿件详情
@State operationButtonList: string[] = ['comment', 'collect', 'share'] // 组件展示条件
@ObjectLink publishCommentModel: publishCommentModel
@State styleType: number = 1
// @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@State interactData: InteractDataDTO = {} as InteractDataDTO
@State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
... ... @@ -59,8 +60,14 @@ export struct OperRowListView {
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
needLike: boolean = true
// async aboutToAppear() {
async aboutToAppear() {
console.info(TAG, '22222----', this.styleType)
console.info(TAG, '3333----', this.needLike)
this.handleStyle()
}
async onDetailUpdated() {
console.info(TAG, '111111----', this.styleType)
this.handleStyle()
if (!this.contentDetailData) {
return
}
... ... @@ -98,7 +105,8 @@ export struct OperRowListView {
// AudioDialog()
Row() {
Column() {
Image($r('app.media.icon_arrow_left'))
Image(this.styleType == 1 ? $r('app.media.icon_arrow_left') :
$r('app.media.icon_arrow_left_white'))
.width(24)
.height(24)
.aspectRatio(1)
... ... @@ -160,7 +168,7 @@ export struct OperRowListView {
Column() {
if (this.publishCommentModel?.targetId) {
CommentIconComponent({ publishCommentModel: this.publishCommentModel })
CommentIconComponent({ publishCommentModel: this.publishCommentModel, styleType: this.styleType })
}
}
.width(46)
... ... @@ -174,7 +182,8 @@ export struct OperRowListView {
Column() {
if (this.likeBean?.contentId) {
LikeComponent({
data: this.likeBean
data: this.likeBean,
styleType: this.styleType
})
}
}
... ... @@ -189,7 +198,8 @@ export struct OperRowListView {
Column() {
Stack({ alignContent: Alignment.TopEnd }) {
Image(this.newsStatusOfUser?.collectStatus == 1 ? $r('app.media.ic_collect_check1') :
$r('app.media.iv_live_comment_collect_un'))
this.styleType == 1 ? $r('app.media.iv_live_comment_collect_un') :
$r('app.media.iv_live_comment_collect_un_white'))
.width(24)
.height(24)
.interpolation(ImageInterpolation.High)
... ... @@ -235,7 +245,8 @@ export struct OperRowListView {
@Builder
builderShare() {
Column() {
Image($r('app.media.iv_live_comment_share'))
Image(this.styleType == 1 ? $r('app.media.iv_live_comment_share') :
$r('app.media.iv_live_comment_share_white'))
.width(24)
.height(24)
.aspectRatio(1)
... ... @@ -248,6 +259,14 @@ export struct OperRowListView {
.width(42)
}
handleStyle() {
if (this.styleType == 1) {
this.bgColor = Color.White
} else if (this.styleType == 2) {
this.bgColor = Color.Black
}
}
share() {
WDShare.shareContent(this.contentDetailData)
}
... ...