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-15 10:35:00 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
ab534dafb22730ebe43b7d9c374f6e5165b4a792
ab534daf
2 parents
ee769693
935b5eda
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
307 additions
and
261 deletions
sight_harmony/commons/wdConstant/src/main/ets/enum/CompStyle.ts
sight_harmony/features/wdBean/src/main/ets/bean/detail/VideoInfoDTO.ts
sight_harmony/features/wdComponent/oh-package.json5
sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
sight_harmony/features/wdComponent/src/main/ets/components/broadcast/BroadcastPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/broadcast/RecommendHeader.ets
sight_harmony/features/wdComponent/src/main/ets/components/broadcast/RecommendLists.ets
sight_harmony/features/wdComponent/src/main/ets/components/broadcast/RecommendTitle.ets
sight_harmony/features/wdComponent/src/main/ets/components/broadcast/SelectedColumns.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/RmhTitle.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card11Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card17Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card19Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card20Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card3Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card4Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card5Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card6Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleColumn04.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleColumn05.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/ChannelSubscriptionLayout.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/BannerComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LabelComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveHorizontalCardComponent.ets
sight_harmony/commons/wdConstant/src/main/ets/enum/CompStyle.ts
View file @
ab534da
...
...
@@ -20,47 +20,47 @@ export const enum CompStyle {
Masonry_Layout_01
=
'Masonry_Layout-01'
,
// 双列瀑布流/瀑布流卡:视频、直播、专题、活动
Zh_Carousel_Layout_01
=
'Zh_Carousel_Layout-01'
,
//1 轮播图卡---1
Zh_Single_Row_01
=
'Zh_Single_Row-01'
,
//2 横划卡 imageScale-封面图比例 1-4:3, 2-16:9, 3-3:2---1
Zh_Single_Row_02
=
'Zh_Single_Row-02'
,
//3 小视频横划卡---1
Zh_Carousel_Layout_01
=
'Zh_Carousel_Layout-01'
,
//1 轮播图卡
Zh_Single_Row_01
=
'Zh_Single_Row-01'
,
//2 横划卡 imageScale-封面图比例 1-4:3, 2-16:9, 3-3:2
Zh_Single_Row_02
=
'Zh_Single_Row-02'
,
//3 小视频横划卡
Zh_Single_Row_03
=
'Zh_Single_Row-03'
,
//6 直播预约卡
Zh_Single_Row_04
=
'Zh_Single_Row-04'
,
// 地方精选卡---2
Zh_Single_Row_05
=
'Zh_Single_Row-05'
,
//15 人民号横划卡---1
Zh_Single_Row_06
=
'Zh_Single_Row-06'
,
//20 热门评论卡--精选评论卡-1
Zh_Single_Row_04
=
'Zh_Single_Row-04'
,
// 地方精选卡
Zh_Single_Row_05
=
'Zh_Single_Row-05'
,
//15 人民号横划卡
Zh_Single_Row_06
=
'Zh_Single_Row-06'
,
//20 热门评论卡--精选评论卡
Zh_Single_Column_01
=
'Zh_Single_Column-01'
,
//5 专题时间链卡
Zh_Single_Column_02
=
'Zh_Single_Column-02'
,
//10 头图卡
---2
Zh_Single_Column_02
=
'Zh_Single_Column-02'
,
//10 头图卡
Zh_Single_Column_03
=
'Zh_Single_Column-03'
,
//9 直播大图卡
Zh_Single_Column_04
=
'Zh_Single_Column-04'
,
//17 人民号主题卡---1
Zh_Single_Column_05
=
'Zh_Single_Column-05'
,
//16 人民号入驻卡---1
Zh_Single_Column_04
=
'Zh_Single_Column-04'
,
//17 人民号主题卡
Zh_Single_Column_05
=
'Zh_Single_Column-05'
,
//16 人民号入驻卡
Zh_Single_Column_06
=
'Zh_Single_Column-06'
,
//12 本地问政卡
Zh_Single_Column_07
=
'Zh_Single_Column-07'
,
//14 热门留言卡
Zh_Single_Column_08
=
'Zh_Single_Column-08'
,
//12 问政提问卡
Zh_Single_Column_10
=
'Zh_Single_Column-10'
,
//18 服务组合卡
Zh_Single_Column_11
=
'Zh_Single_Column-11'
,
//19 问政组合卡
Zh_Grid_Layout_01
=
'Zh_Grid_Layout-01'
,
//4 信息流组合卡
Zh_Grid_Layout_02
=
'Zh_Grid_Layout-02'
,
//7 双列流小视频,一行两图卡---1
Zh_Grid_Layout_03
=
'Zh_Grid_Layout-03'
,
//11 金刚位卡---2
Zh_Grid_Layout_02
=
'Zh_Grid_Layout-02'
,
//7 双列流小视频,一行两图卡
Zh_Grid_Layout_03
=
'Zh_Grid_Layout-03'
,
//11 金刚位卡
Card_01
=
'1'
,
// 小图卡
Card_02
=
'2'
,
// 大图卡---2
Card_03
=
'3'
,
// 无图卡(全标题)---2
Card_04
=
'4'
,
// 三图卡---2
Card_05
=
'5'
,
// 头图卡---2
Card_06
=
'6'
,
// 小视频卡---2
Card_02
=
'2'
,
// 大图卡
Card_03
=
'3'
,
// 无图卡(全标题)
Card_04
=
'4'
,
// 三图卡
Card_05
=
'5'
,
// 头图卡
Card_06
=
'6'
,
// 小视频卡
Card_07
=
'7'
,
// 作者卡
Card_08
=
'8'
,
// 财经快讯卡
Card_09
=
'9'
,
// 时间轴卡---2
Card_10
=
'10'
,
// 大专题卡---2
Card_11
=
'11'
,
// 无图卡(标题省略)---2
Card_12
=
'12'
,
// 无图卡人民号---1
Card_13
=
'13'
,
// 单图卡---2--同6
Card_14
=
'14'
,
// 单图卡人民号---1
Card_15
=
'15'
,
// 大图卡人民号---1
Card_16
=
'16'
,
// 三图卡人民号---1
Card_17
=
'17'
,
// 图卡集---2
Card_09
=
'9'
,
// 时间轴卡
Card_10
=
'10'
,
// 大专题卡
Card_11
=
'11'
,
// 无图卡(标题省略)
Card_12
=
'12'
,
// 无图卡人民号
Card_13
=
'13'
,
// 单图卡--同6
Card_14
=
'14'
,
// 单图卡人民号
Card_15
=
'15'
,
// 大图卡人民号
Card_16
=
'16'
,
// 三图卡人民号
Card_17
=
'17'
,
// 图卡集
Card_18
=
'18'
,
// 图卡集人民号
Card_19
=
'19'
,
// 动态图文卡人民号---1
Card_20
=
'20'
,
// 动态视频卡人民号---1
Card_21
=
'21'
,
// 小视频卡人民号---1
Card_19
=
'19'
,
// 动态图文卡人民号
Card_20
=
'20'
,
// 动态视频卡人民号
Card_21
=
'21'
,
// 小视频卡人民号
Card_22
=
'22'
,
// 时间链
Card_23
=
'23'
,
// 问政卡
}
...
...
sight_harmony/features/wdBean/src/main/ets/bean/detail/VideoInfoDTO.ts
View file @
ab534da
...
...
@@ -4,6 +4,7 @@ export interface VideoInfoDTO {
resolutionWidth
:
number
;
videoDuration
:
number
;
// 视频时长
videoLandScape
:
number
;
// 1横屏 2竖屏
videoLandscape
:
number
;
// 1横屏 2竖屏
videoType
:
number
;
videoUrl
:
string
;
//视频播放地址
firstFrameImageUri
:
string
;
// 首帧图;【视频内容,contentPictures中】
...
...
sight_harmony/features/wdComponent/oh-package.json5
View file @
ab534da
...
...
@@ -16,6 +16,7 @@
"wdBean"
:
"file:../../features/wdBean"
,
"wdDetailPlayShortVideo"
:
"file:../../features/wdDetailPlayShortVideo"
,
"wdRouter"
:
"file:../../commons/wdRouter"
,
"wdNetwork"
:
"file:../../commons/wdNetwork"
"wdNetwork"
:
"file:../../commons/wdNetwork"
,
"wdJsBridge"
:
"file:../../commons/wdJsBridge"
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
View file @
ab534da
...
...
@@ -16,6 +16,7 @@ import { ZhGridLayout03 } from './compview/ZhGridLayout03';
import { CardParser } from './CardParser';
import { LiveHorizontalReservationComponent } from './view/LiveHorizontalReservationComponent';
import { ZhGridLayout02 } from './compview/ZhGridLayout02';
import { Card5Component } from './cardview/Card5Component'
/**
* comp适配器.
...
...
@@ -53,6 +54,9 @@ export struct CompParser {
ZhGridLayout03({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.Zh_Single_Row_04) {
ZhSingleRow04({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
//头图卡 和comStyle 2相同,
Card5Component({ contentDTO: compDTO.operDataList[0] })
} else if (compDTO.compStyle === CompStyle.Zh_Single_Column_04) {
ZhSingleColumn04({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.Zh_Single_Column_05) {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/broadcast/BroadcastPageComponent.ets
View file @
ab534da
...
...
@@ -14,7 +14,6 @@ import { CommonConstants } from 'wdConstant/Index';
const TAG = 'BroadcastPageComponent';
@Entry
@Component
export struct BroadcastPageComponent {
@State params:Params = router.getParams() as Params;
...
...
sight_harmony/features/wdComponent/src/main/ets/components/broadcast/RecommendHeader.ets
View file @
ab534da
...
...
@@ -4,7 +4,6 @@ import { CommonConstants } from 'wdConstant/Index';
/**
* 今日推荐顶部标题--fixed标题
*/
@Entry
@Component
export struct RecommendHeader {
build() {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/broadcast/RecommendLists.ets
View file @
ab534da
...
...
@@ -4,7 +4,6 @@ import { ProcessUtils } from '../../utils/ProcessUtils';
/**
* 播报--今日推荐列表
*/
@Entry
@Component
export struct RecommendLists {
@Prop recommendCompInfoBean: CompInfoBean = {} as CompInfoBean // 推荐-组件信息
...
...
sight_harmony/features/wdComponent/src/main/ets/components/broadcast/RecommendTitle.ets
View file @
ab534da
...
...
@@ -3,7 +3,6 @@ import { DateTimeUtils } from 'wdKit';
/**
* 播报标题描述
*/
@Entry
@Component
export struct RecommendTitle {
build() {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/broadcast/SelectedColumns.ets
View file @
ab534da
...
...
@@ -5,7 +5,6 @@ import { ProcessUtils } from '../../utils/ProcessUtils';
/**
* 精选栏目
*/
@Entry
@Component
export struct SelectedColumns {
@Prop columnsCompInfoBean: CompInfoBean = {} as CompInfoBean // 精选栏目组件信息
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/RmhTitle.ets
View file @
ab534da
...
...
@@ -4,7 +4,6 @@
import { RmhInfoDTO } from 'wdBean'
import { CommonConstants } from 'wdConstant/Index';
@Entry
@Component
export struct RmhTitle {
@Prop rmhInfo: RmhInfoDTO
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card11Component.ets
View file @
ab534da
...
...
@@ -2,11 +2,12 @@
import { CommonConstants } from 'wdConstant'
import { ContentDTO } from 'wdBean'
import { DateTimeUtils } from 'wdKit'
import { ProcessUtils } from '../../utils/ProcessUtils';
const TAG = 'Card11Component';
/**
* 无图卡(标题省略)
* 无图卡(标题省略)
Card_11 = '11
*/
@Component
export struct Card11Component {
...
...
@@ -21,33 +22,38 @@ export struct Card11Component {
.textOverflow({ overflow: TextOverflow.Ellipsis })
.width(CommonConstants.FULL_WIDTH)
Row() {
Text("锐评")
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_ED2800"))
Text(this.contentDTO.source)
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
.margin({ left: 6 })
Image($r("app.media.point"))
.width(16)
.height(16)
if (this.contentDTO.source) {
Text(this.contentDTO.source)
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
.margin({ left: 6 })
Image($r("app.media.point"))
.width(16)
.height(16)
}
Text(DateTimeUtils.
formatDat
e(Number.parseFloat(this.contentDTO.publishTime)))
Text(DateTimeUtils.
getCommentTim
e(Number.parseFloat(this.contentDTO.publishTime)))
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
.margin({ right: 6 })
// TODO '评论取哪个字段'
// Text(`1806评`)
// .fontSize($r("app.float.font_size_12"))
// .fontColor($r("app.color.color_B0B0B0"))
}.width(CommonConstants.FULL_WIDTH)
.justifyContent(FlexAlign.Start)
.margin({ top: 8 })
}.width(CommonConstants.FULL_WIDTH)
.padding({
top: 14,
left: 16,
right: 16,
bottom: 14
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor($r("app.color.white"))
.margin({ bottom: 8 })
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.contentDTO)
})
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card17Component.ets
View file @
ab534da
...
...
@@ -3,12 +3,13 @@ import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO';
import { CommonConstants } from 'wdConstant/Index';
import { DateTimeUtils } from 'wdKit';
import { WDRouterRule } from 'wdRouter';
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
const TAG = 'Card17Component';
/**
* 图卡集---2
*/
/**
* 图卡集---2
*/
@Component
export struct Card17Component {
@State compDTO: CompDTO = {} as CompDTO
...
...
@@ -18,82 +19,54 @@ export struct Card17Component {
Column({ space: 8 }) {
Text(this.contentDTO.newsTitle)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontSize(17)
.fontColor(0x222222)
.fontSize($r('app.float.font_size_17'))
.fontColor($r('app.color.color_222222'))
.lineHeight(25)
.maxLines(3)
.width(CommonConstants.FULL_WIDTH)
RelativeContainer() {
Image(this.contentDTO.fullColumnImgUrls[0].url)
.width('66.6%')
.aspectRatio(16 / 9)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.id('mainImage')
Image(this.contentDTO.fullColumnImgUrls[1].url)
.width('33%')
.aspectRatio(16 / 9)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
right: { anchor: "__container__", align: HorizontalAlign.End }
})
.id('subTopImage')
Stack({ alignContent: Alignment.BottomEnd }) {
// 三个图,
GridRow({ gutter: 2 }) {
GridCol({ span: { xs: 8 } }) {
Image(this.contentDTO.fullColumnImgUrls[0].url)
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(16 / 9)
.borderRadius({
topLeft: $r('app.float.image_border_radius'),
bottomLeft: $r('app.float.image_border_radius'),
})
}
Image(this.contentDTO.fullColumnImgUrls[2].url)
.width('33%')
.aspectRatio(16 / 9)
.alignRules({
right: { anchor: "__container__", align: HorizontalAlign.End },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
})
.id('subBottomImage')
// 下面是渲染右下角图标
Shape() {
Rect().width(33).height(18)
GridCol({ span: { xs: 4 } }) {
Image(this.contentDTO.fullColumnImgUrls[1].url)
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(16 / 9)
.margin({ bottom: 1 })
.borderRadius({
topRight: $r('app.float.image_border_radius'),
})
}
}
.fill(0x000000)
.fillOpacity(0.3)
.strokeLineCap(LineCapStyle.Round)
.strokeLineJoin(LineJoinStyle.Round)
.antiAlias(true)
.id('shape')
.alignRules({
right: { anchor: "__container__", align: HorizontalAlign.End },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
})
.margin({
right: 4,
bottom: 4
})
Image($r('app.media.album_card_shape'))
.width(22)
.height(18)
.alignRules({
left: { anchor: "shape", align: HorizontalAlign.Start },
top: { anchor: "shape", align: VerticalAlign.Top }
})
.id('shapeSubImage')
GridRow({ gutter: 2 }) {
GridCol({ span: { xs: 8 } }) {
}
GridCol({ span: { xs: 4 } }) {
Image(this.contentDTO.fullColumnImgUrls[2].url)
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(16 / 9)
.margin({ top: 1 })
.borderRadius({
bottomRight: $r('app.float.image_border_radius'),
})
}
}
Text(this.contentDTO.fullColumnImgUrls.length + '')
.fontSize(13)
.fontColor(0xFFFFFF)
.id('pageIndex')
.alignRules({
right: { anchor: "shape", align: HorizontalAlign.End },
top: { anchor: "shape", align: VerticalAlign.Top }
})
.margin({ right: 2 })
.textAlign(TextAlign.Center)
.width(17)
.height(17)
CardMediaInfo({ contentDTO: this.contentDTO })
}
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(24 / 9)
.onClick((event: ClickEvent) => {
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
...
...
@@ -112,23 +85,17 @@ export struct Card17Component {
Row() {
if (this.contentDTO.source) {
Text(this.contentDTO.source)
.fontSize(13)
.fontColor(0xB0B0B0)
.fontSize($r('app.float.font_size_13'))
.fontColor($r('app.color.color_B0B0B0'))
Image($r('app.media.point'))
.width(16)
.height(16)
}
if (this.contentDTO.publishTime && this.contentDTO.publishTime.length === 13) {
Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)))
.fontSize(13)
.fontColor(0xB0B0B0)
.fontSize($r('app.float.font_size_13'))
.fontColor($r('app.color.color_B0B0B0'))
}
Text('328评')
.fontSize(13)
.fontColor(0xB0B0B0)
.margin({
left: 6
})
}
.width(CommonConstants.FULL_WIDTH)
.height(16)
...
...
@@ -136,10 +103,10 @@ export struct Card17Component {
}
.width(CommonConstants.FULL_WIDTH)
.padding({
top: 14,
left: 16,
right: 16,
bottom: 14
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card19Component.ets
View file @
ab534da
...
...
@@ -6,7 +6,6 @@ const TAG = 'Card19Component';
/**
* 人民号-动态---19:动态图文卡人民号; 从无图--9图
*/
@Entry
@Component
export struct Card19Component {
@State contentDTO: ContentDTO = {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card20Component.ets
View file @
ab534da
...
...
@@ -8,7 +8,6 @@ const TAG = 'Card20Component';
/**
* 人民号-动态---20:动态视频卡人民号 分横屏和竖屏;
*/
@Entry
@Component
export struct Card20Component {
@State contentDTO: ContentDTO = {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
View file @
ab534da
//全标题 "appStyle":"2",
import { ContentDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant/Index';
import { DateTimeUtils } from 'wdKit/Index';
import { ProcessUtils } from '../../utils/ProcessUtils';
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
const TAG: string = 'Card2Component';
...
...
@@ -12,55 +14,50 @@ const TAG: string = 'Card2Component';
* 卡片宽度:充满父窗口
* 卡片高度,仅包含横板图片:图片高度由图片的宽度及宽高比决定,图片宽度占父窗口'100%',宽高比为16:9:
*/
// @Entry
@Component
export struct Card2Component {
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = {
// appStyle: '2',
// objectType: '1',
// coverUrl:
// 'https://rmrbcmsonline.peopleapp.com/upload/image/202404/202404141115457926.png?x-oss-process=image/resize,m_fill,h_450,w_800/quality,q_90',
// newsTitle: '又见花开!新疆伊犁花海延绵清新怡人',
// publishTime: '1713067227000',
// source: '荔枝新闻',
// videoInfo: {
// videoDuration: 25,
// videoLandscape: 1,
// videoUrl:
// 'https://rmrbcmsonline.peopleapp.com/upload/video/mp4/202404/1713064515901314d148763996.mp4'
// }
} as ContentDTO;
build() {
Column() {
Column() {
//新闻标题
Text(this.contentDTO.newsTitle)
.fontSize(17)
.fontColor('#222222')
.fontSize($r('app.float.font_size_17'))
.fontColor($r('app.color.color_222222'))
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.align(Alignment.Start)
//大图
Stack() {
Image(this.contentDTO.coverUrl)
.borderRadius(4)
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(16 / 9)
.borderRadius($r('app.float.image_border_radius'))
//播放状态+时长
Row() {
Image($r('app.media.icon_live'))
.width(22)
.height(18)
Stack() {
Text('直播中')
.fontColor('#FFFFFF')
.fontSize(11)
}
.width(44)
.height(18)
.backgroundColor('#4d000000')
}.margin({ right: 8, bottom: 8 })
CardMediaInfo({
contentDTO: this.contentDTO
})
}
.width('100%')
.height(192)
.alignContent(Alignment.BottomEnd)
.margin({ top: 8 })
}
.width('100%')
.justifyContent(FlexAlign.Start)
.width(CommonConstants.FULL_WIDTH)
.alignItems(HorizontalAlign.Start)
.padding({ top: 14 })
//bottom
Row() {
...
...
@@ -71,22 +68,21 @@ export struct Card2Component {
.width(12)
.height(12)
Text(this.contentDTO.source)
.bottomTextStyle()
Text(' ')
Text(this.contentDTO.subtitle)
Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)))
.bottomTextStyle()
}
.width(
'100%'
)
.width(
CommonConstants.FULL_WIDTH
)
.height(18)
.justifyContent(FlexAlign.Start)
// .padding({bottom:14})
.margin({ top: 8 })
}
.width('100%')
.padding({ left: 16, right: 16 })
.width(CommonConstants.FULL_WIDTH)
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.contentDTO)
})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card3Component.ets
View file @
ab534da
...
...
@@ -5,10 +5,21 @@ import { ProcessUtils } from '../../utils/ProcessUtils';
/**
* 卡片样式:"appStyle":"3"
* Card_03 = '3', // 无图卡(全标题)
*/
@Component
export struct Card3Component {
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = {
// appStyle: '3',
// channelId: '2002',
// newsTitle: '习近平向斯洛伐克当选总统佩',
// objectId: '30044351686',
// objectType: '8',
// publishTime: '1712967589000',
// relId: '500005307414',
// relType: '1',
// source: '新华社',
} as ContentDTO;
build() {
Column() {
...
...
@@ -17,35 +28,37 @@ export struct Card3Component {
.fontColor($r("app.color.color_222222"))
.width(CommonConstants.FULL_WIDTH)
Row() {
Text("锐评")
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_ED2800"))
Text(this.contentDTO.source)
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
.margin({ left: 6 })
Image($r("app.media.point"))
.width(16)
.height(16)
Text(DateTimeUtils.formatDate(Number.parseFloat(this.contentDTO.publishTime)))
// TODO "锐评"取得哪个字段,什么时候显示。
// Text("锐评")
// .fontSize($r("app.float.font_size_12"))
// .fontColor($r("app.color.color_ED2800"))
if(this.contentDTO.source) {
Text(this.contentDTO.source)
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
Image($r("app.media.point"))
.width(16)
.height(16)
}
Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)))
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
.margin({ right: 6 })
// TODO '评论取哪个字段'
// Text(`1806评`)
// .fontSize($r("app.float.font_size_12"))
// .fontColor($r("app.color.color_B0B0B0"))
}.width(CommonConstants.FULL_WIDTH)
.justifyContent(FlexAlign.Start)
.margin({ top: 8 })
}
.width(
"100%"
)
.width(
CommonConstants.FULL_WIDTH
)
.padding({
top: 14,
left: 16,
right: 16,
bottom: 14
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor($r("app.color.white"))
.margin({ bottom: 8 })
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.contentDTO)
})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card4Component.ets
View file @
ab534da
//全标题 "appStyle":"4",
import { ContentDTO } from 'wdBean';
import { ContentDTO, FullColumnImgUrlDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from '../../utils/ProcessUtils';
import { DateTimeUtils } from 'wdKit/Index';
const TAG: string = 'Card4Component';
...
...
@@ -13,50 +14,100 @@ const TAG: string = 'Card4Component';
*/
@Component
export struct Card4Component {
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = {
// appStyle: '4',
// fullColumnImgUrls: [
// {
// format: null,
// fullUrl: '',
// height: 187,
// landscape: 1,
// size: 1,
// url: 'https://rmrbcmsonline.peopleapp.com/upload/article_resource/image/1648118198_0c20f7c31c7b4eca6b0d0871e7771c62.png?x-oss-process=image/resize,m_fill,h_160,w_240/quality,q_90',
// weight: 248
// },
// {
// format: null,
// fullUrl: '',
// height: 187,
// landscape: 1,
// size: 1,
// url: 'https://rmrbcmsonline.peopleapp.com/upload/article_resource/image/1648118198_0c20f7c31c7b4eca6b0d0871e7771c62.png?x-oss-process=image/resize,m_fill,h_160,w_240/quality,q_90',
// weight: 248
// },
// {
// format: null,
// fullUrl: '',
// height: 187,
// landscape: 1,
// size: 1,
// url: 'https://rmrbcmsonline.peopleapp.com/upload/article_resource/image/1648118200_d10309bee894a67311e6c8f77df676d4.png?x-oss-process=image/resize,m_fill,h_160,w_240/quality,q_90',
// weight: 248
// },
// {
// format: null,
// fullUrl: '',
// height: 187,
// landscape: 1,
// size: 1,
// url: 'https://rmrbcmsonline.peopleapp.com/upload/article_resource/image/1648118202_f33743e452fb69ee2c45c18a56eccdf6.png?x-oss-process=image/resize,m_fill,h_160,w_240/quality,q_90',
// weight: 248
// }
// ],
// newsTitle: '科普:如何发现家中是否有白蚁危害?丨又到白蚁分飞季②',
// rmhInfo: {
// authIcon:
// 'https://cdnjdphoto.aikan.pdnews.cn/creator-category/icon/auth/blue.png',
// authTitle: '封面新闻',
// rmhDesc: '封面新闻,亿万年轻人的生活方式。',
// rmhHeadUrl:
// 'https://cdnjdphoto.aikan.pdnews.cn/image/creator/rmh/20221212/122faff796.jpeg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg',
// rmhId: '2016608',
// rmhName: '封面新闻',
// userId: '522390888224390',
// userType: '2'
// },
// source: '头条号',
// publishTime: '1651204607000',
} as ContentDTO;
build() {
Column() {
//body
Column() {
//新闻标题
Text(this.contentDTO.newsTitle)
.fontSize(17)
.fontColor('#222222')
.fontSize($r('app.float.font_size_17'))
.fontColor($r('app.color.color_222222'))
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
//三图
Row() {
Image(this.contentDTO.fullColumnImgUrls[0]?.url)
.width('32%')
.height(75)
.borderRadius({ topLeft:4,bottomLeft:4 })
Image(this.contentDTO.fullColumnImgUrls[1]?.url)
.width('32%')
.height(75)
Image(this.contentDTO.fullColumnImgUrls[2]?.url)
.width('32%')
.height(75)
.borderRadius({ topRight:4,bottomRight:4 })
GridRow({ gutter: 2 }) {
ForEach(this.contentDTO.fullColumnImgUrls, (item: FullColumnImgUrlDTO, index: number) => {
if (index < 3) {
GridCol({ span: { xs: 4 } }) {
Image(item.url)
.width('100%')
.aspectRatio(113 / 75)
.borderRadius({
topLeft: index === 0 ? $r('app.float.image_border_radius') : 0,
topRight: index === 2 ? $r('app.float.image_border_radius') : 0,
bottomLeft: index === 0 ? $r('app.float.image_border_radius') : 0,
bottomRight: index === 2 ? $r('app.float.image_border_radius') : 0,
})
}
}
})
}
}
.justifyContent(FlexAlign.SpaceBetween)
.width('100%')
.height(75)
.margin({top:8})
.borderRadius(8)
.margin({ top: 8 })
}
.width('100%')
.justifyContent(FlexAlign.Start)
.alignItems(HorizontalAlign.Start)
.padding({top:14})
.onClick((event: ClickEvent)=>{
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.contentDTO)
})
...
...
@@ -69,31 +120,29 @@ export struct Card4Component {
Image($r('app.media.point'))
.width(12)
.height(12)
Text(this.contentDTO.publishTime)
.bottomTextStyle()
Text(' ')
Text('518条评论')
Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)))
.bottomTextStyle()
// TODO 评论字段取值
// Text('518条评论')
// .bottomTextStyle()
}
.width('100%')
.justifyContent(FlexAlign.Start)
// .padding({bottom:14})
.margin({top:8})
.padding({bottom:14})
.margin({ top: 8 })
}
.width('100%')
.padding({top:8,left:16,right:16})
.width(CommonConstants.FULL_WIDTH)
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
}
}
@Extend(Text) function bottomTextStyle() {
@Extend(Text)
function bottomTextStyle() {
.fontSize(12)
.fontColor('#B0B0B0')
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card5Component.ets
View file @
ab534da
...
...
@@ -5,11 +5,21 @@ import { ProcessUtils } from '../../utils/ProcessUtils';
const TAG: string = 'Card5Component';
/**
* 卡片样式:"appStyle":"5"
* 卡片样式:"appStyle":"5"
头图卡
*/
// @Entry
@Component
export struct Card5Component {
@State contentDTO: ContentDTO = {} as ContentDTO;
@State contentDTO: ContentDTO = {
// coverSize: '850*478',
// coverType: 1,
// coverUrl:
// 'https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20240323/image/display/54ce2de0d20842839e96a644c78361b7.jpg?x-oss-process=image/resize,w_550/quality,q_90/format,jpg',
// linkUrl:
// 'https://pd-people-uat.pdnews.cn/h/atv/collect/1000000472?hiddenNavigator=1',
// newsTitle: '今天是周日,天气阴天,明天是周一。',
// objectType: '6'
} as ContentDTO;
build() {
Stack() {
...
...
@@ -43,8 +53,12 @@ export struct Card5Component {
}
.alignContent(Alignment.Bottom)
.width(CommonConstants.FULL_WIDTH)
.padding(
{ top: 16, bottom: 16, left: 14, right: 14 })
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.contentDTO)
})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card6Component.ets
View file @
ab534da
...
...
@@ -3,11 +3,11 @@ import { CommonConstants, CompStyle } from 'wdConstant';
import { DateTimeUtils } from 'wdKit';
import { ProcessUtils } from '../../utils/ProcessUtils';
const TAG: string = 'Card6Component';
const TAG: string = 'Card6Component
-Card13Component
';
const FULL_PARENT: string = '100%';
/**
* 卡片样式:"appStyle":"6"
* 卡片样式:"appStyle":"6"
以及13
*/
@Component
export struct Card6Component {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleColumn04.ets
View file @
ab534da
...
...
@@ -8,7 +8,6 @@ const TAG = 'Zh_Single_Column-04';
* 人民号主题卡
* 枚举值 Zh_Single_Column-04
*/
@Entry
@Component
export struct ZhSingleColumn04 {
@State compDTO: CompDTO = {} as CompDTO
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleColumn05.ets
View file @
ab534da
...
...
@@ -8,7 +8,6 @@ const TAG = 'Zh_Single_Column-05';
* 人民号入住卡
* 枚举值 Zh_Single_Column-05
*/
@Entry
@Component
export struct ZhSingleColumn05 {
@State compDTO: CompDTO = {} as CompDTO
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/ChannelSubscriptionLayout.ets
View file @
ab534da
...
...
@@ -287,8 +287,7 @@ struct ChannelDialog {
.height('100%')
.justifyContent(FlexAlign.Center)
.backgroundColor(item.homeChannel === '1' || item.movePermitted === 0 ? '#F5F5F5' : '#ffffff')
.onTouch((event?: TouchEvent) => {
if(event&&event.type === TouchType.Down){
.onClick(() => {
console.log('onTouch')
if (this.isEditIng) {
if (item.delPermitted === 1) {
...
...
@@ -298,7 +297,6 @@ struct ChannelDialog {
this.confirm(index)
this.controller?.close()
}
}
})
}
.width('23%')
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/BannerComponent.ets
View file @
ab534da
...
...
@@ -54,7 +54,6 @@ export struct BannerComponent {
.cachedCount(2)
.index(1) // The default index of Swiper.
.autoPlay(true)
.interval(DurationEnum.DURATION_4)
.indicator(Indicator.dot()
.right(5)
.itemWidth(4)
...
...
@@ -62,7 +61,6 @@ export struct BannerComponent {
.selectedItemWidth(10)
.selectedItemHeight(6))
.loop(true)
.duration(DurationEnum.DURATION_4)
.vertical(false)
.curve(Curve.Linear)
.onChange((index: number) => {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/LabelComponent.ets
View file @
ab534da
...
...
@@ -9,7 +9,6 @@ const TAG = 'LabelComponent';
* Label-03
* 重磅推荐/精选/电视剧/电影/综艺/短剧/更多>/
*/
@Entry
@Component
export struct LabelComponent {
@State compDTO: CompDTO = {} as CompDTO
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveHorizontalCardComponent.ets
View file @
ab534da
// 视频直播横划卡16:9
import { LiveVideoTypeComponent } from './LiveVideoTypeComponent'
import { LiveHorizontalCardForOneComponent } from './LiveHorizontalCardForOneComponent'
import {
CompDTO, ContentDTO
} from 'wdBean'
import {
Action, CompDTO, ContentDTO, Params
} from 'wdBean'
import { CommonConstants } from 'wdConstant'
import { WDRouterRule } from 'wdRouter/Index'
@Component
export struct LiveHorizontalCardComponent {
...
...
@@ -22,7 +23,7 @@ export struct LiveHorizontalCardComponent {
.fontWeight(600)
}
if (this.compDTO.operDataList.length >
10
) {
if (this.compDTO.operDataList.length >
8
) {
Row() {
Text("更多")
.fontSize($r("app.float.font_size_14"))
...
...
@@ -32,6 +33,15 @@ export struct LiveHorizontalCardComponent {
.width(14)
.height(14)
}
.onClick(() => {
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
params: {
url: this.compDTO.linkUrl
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
})
}
}.justifyContent(FlexAlign.SpaceBetween)
.padding({ left: 16, right: 16 })
...
...
Please
register
or
login
to post a comment