yuzhilin

H5稿件头部样式

import { Logger, NumberFormatterUtils } from 'wdKit';
import { Logger, NumberFormatterUtils, DateTimeUtils } from 'wdKit';
import {
Action,
ContentDetailDTO,
... ... @@ -14,15 +14,15 @@ import DetailViewModel from '../viewmodel/DetailViewModel';
import { ImageAndTextWebComponent } from './ImageAndTextWebComponent';
import router from '@ohos.router';
import { RecommendList } from '../components/view/RecommendList'
import { CommonConstants } from 'wdConstant'
import { CommonConstants } from 'wdConstant';
import { HttpUrlUtils } from 'wdNetwork/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
import { PageRepository } from '../repository/PageRepository';
import { detailedSkeleton } from './skeleton/detailSkeleton'
import { detailedSkeleton } from './skeleton/detailSkeleton';
const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
const TAG = 'ImageAndTextPageComponent'
@Component
export struct ImageAndTextPageComponent {
scroller: Scroller = new Scroller();
... ... @@ -32,7 +32,7 @@ export struct ImageAndTextPageComponent {
@State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
@State interactData: InteractDataDTO = {} as InteractDataDTO
@State isPageEnd: boolean = false
@State publishTime: string = ''
build() {
Column() {
if (!this.isPageEnd) {
... ... @@ -40,10 +40,10 @@ export struct ImageAndTextPageComponent {
} else {
// 发布时间
Row() {
Image($r('app.media.icon_ren_min_ri_bao'))
.width(70)
Image(this.contentDetailData[0]?.rmhInfo ? $r('app.media.logo_rmh') : $r('app.media.logo_rmrb'))
.width(80)
.height(28)
Text(this.contentDetailData[0]?.publishTime)
Text(this.publishTime)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize($r('app.float.font_size_13'))
.height('100%')
... ... @@ -151,6 +151,8 @@ export struct ImageAndTextPageComponent {
let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType)
if (detailBeans && detailBeans.length > 0) {
this.contentDetailData = detailBeans;
let dateTime = DateTimeUtils.parseDate(this.contentDetailData[0]?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN);
this.publishTime = DateTimeUtils.formatDate(dateTime,PATTERN_DATE_CN_RN)
if (this.contentDetailData[0]?.recommendShow === 1) {
this.getRecommend()
}
... ...
import { CommonConstants } from 'wdConstant'
import { ContentDTO,CompDTO } from 'wdBean'
import { ContentDTO, CompDTO } from 'wdBean'
import { ProcessUtils } from '../../utils/ProcessUtils';
@Component
export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
... ... @@ -59,13 +60,12 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
.padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 })
// .offset({x:16})
.onClick(() => {
if (item.objectType != '0') {
console.log(item.objectId)
}
ProcessUtils.processPage(item)
})
})
}.listDirection(Axis.Horizontal)
.scrollBar(BarState.Off)
.width('100%')
// .backgroundColor($r("app.color.color_FE4B05"))
... ...