王士厅

图集人民号点击头像跳转到号主页,对接评论点赞组合组件

... ... @@ -5,7 +5,8 @@ import {
PhotoListBean,
postInteractBrowsOperateParams,
postBatchAttentionStatusParams,
postInteractAccentionOperateParams
postInteractAccentionOperateParams,
Params
} from 'wdBean';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
import display from '@ohos.display';
... ... @@ -44,6 +45,7 @@ export struct MultiPictureDetailPageComponent {
@State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
@State showDownload: Boolean = false // 控制是否显示下载默认隐藏
@State publishCommentModel: publishCommentModel = new publishCommentModel()
@State operationButtonList: string[] = ['comment', 'like', 'collect', 'share']
//watch监听页码回调
onCurrentPageNumUpdated(): void {
... ... @@ -98,19 +100,31 @@ export struct MultiPictureDetailPageComponent {
if (this.contentDetailData.rmhPlatform == 1) {
Row() {
Row({ space: 8 }) {
Row() {
Image(this.contentDetailData?.rmhInfo?.rmhHeadUrl)
.borderRadius(24)
.aspectRatio(1)
.border({ width: 1, color: Color.White, style: BorderStyle.Solid })
.alt($r('app.media.picture_loading'))
.width(36)
.height(36)
.objectFit(ImageFit.Fill)
.interpolation(ImageInterpolation.High)
if (this.getImgUrl()){
Row() {
Image(this.getImgUrl())
.borderRadius(24)
.aspectRatio(1)
.border({ width: 1, color: Color.White, style: BorderStyle.Solid })
.width(36)
.height(36)
.objectFit(ImageFit.Fill)
.interpolation(ImageInterpolation.High)
.onClick(() => {
if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
// 号主页
const params: Params = {
creatorId: this.contentDetailData.rmhInfo.rmhId,
pageID: ''
}
WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
}
})
}
.width('13%')
.height('100%')
}
.width('13%')
.height('100%')
Row() {
Flex({
... ... @@ -190,6 +204,7 @@ export struct MultiPictureDetailPageComponent {
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.id('e_attention')
.visibility(!this.showDownload ? Visibility.Visible : Visibility.None)
}
if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {
Swiper(this.swiperController) {
... ... @@ -305,10 +320,8 @@ export struct MultiPictureDetailPageComponent {
OperRowListView({
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
})
.width('100%')
.height(56)
.border({ width: { top: 0.5 }, color: '#FFFFFF' })
}
.visibility(!this.showDownload ? Visibility.Visible : Visibility.None)
Column(){
... ... @@ -385,6 +398,7 @@ export struct MultiPictureDetailPageComponent {
if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) {
// 暂无内容
this.netStatus = 0
this.operationButtonList = []
Logger.info(TAG, `this.netStatus:${JSON.stringify(this.netStatus)}`)
}
Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`)
... ... @@ -399,12 +413,17 @@ export struct MultiPictureDetailPageComponent {
Logger.info(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`);
// 内容获取失败
this.netStatus = 9
this.operationButtonList = []
})
} catch (exception) {
}
}
getImgUrl() {
return this.contentDetailData?.rmhInfo?.rmhHeadUrl || this.contentDetailData?.userInfo?.userHeadUrl
}
// 记录浏览历史
private getInteractBrowsOperate() {
try {
... ...