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
guochunsong
2024-02-04 15:03:25 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0aea843ea3ab720af70fc3a0e78e8e72376fdade
0aea843e
1 parent
0a33bce3
合并样式
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
49 additions
and
39 deletions
sight_harmony/wdBean/src/main/ets/bean/content/ContentDTO.ets
sight_harmony/wdComponent/src/main/ets/components/CompParser.ets
sight_harmony/wdComponent/src/main/ets/components/MorningEveningPaper/SingleColumn999Component.ets
sight_harmony/wdComponent/src/main/ets/components/page/CardView.ets
sight_harmony/wdComponent/src/main/ets/components/view/HorizontalStrokeCardThreeTwoRadioForMoreComponent.ets
sight_harmony/wdComponent/src/main/ets/components/view/HorizontalStrokeCardThreeTwoRadioForOneComponent.ets
sight_harmony/wdComponent/src/main/ets/components/view/LiveHorizontalCardComponent.ets
sight_harmony/wdComponent/src/main/ets/components/view/LiveHorizontalCardForOneComponent.ets
sight_harmony/wdConstant/src/main/ets/enum/CompStyle.ts
sight_harmony/wdBean/src/main/ets/bean/content/ContentDTO.ets
View file @
0aea843
...
...
@@ -51,8 +51,8 @@ export interface ContentDTO {
publishTime:string;
visitorComment:number;
fullColumnImgUrls:FullColumnImgUrlDTO[];
liveInfo?: LiveInfoDTO; // 直播新闻信息【BFF聚合】
videoInfo?: VideoInfoDTO; // 视频新闻信息【BFF聚合】,视频非原片+清晰度最高的
liveInfo: LiveInfoDTO; // 直播新闻信息【BFF聚合】
videoInfo: VideoInfoDTO; // 视频新闻信息【BFF聚合】,视频非原片+清晰度最高的
newsSummary: string; //appstyle:2 ,新闻详情
...
...
sight_harmony/wdComponent/src/main/ets/components/CompParser.ets
View file @
0aea843
...
...
@@ -10,6 +10,12 @@ import { TriPicCardComponent } from './view/TriPicCardComponent';
import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent';
import { HeadPictureCardComponent } from './view/HeadPictureCardComponent';
import { ZhGridLayoutComponent } from './view/ZhGridLayoutComponent';
import {
HorizontalStrokeCardThreeTwoRadioForMoreComponent
} from './view/HorizontalStrokeCardThreeTwoRadioForMoreComponent';
import {
HorizontalStrokeCardThreeTwoRadioForOneComponent
} from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent';
/**
* comp适配器.
...
...
@@ -33,7 +39,7 @@ export struct CompParser {
TitleAllComponent({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.Carousel_Layout_01) {
BannerComponent({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.Single_Imagecard_0
2 || compDTO.compStyle === CompStyle.Single_Imagecard_0
3) {
} else if (compDTO.compStyle === CompStyle.Single_Imagecard_03) {
SingleImageCardComponent({ compDTO: compDTO })
} else if (compDTO.compStyle === "2") {
BigPicCardComponent({ compDTO: compDTO })
...
...
@@ -41,6 +47,12 @@ export struct CompParser {
TriPicCardComponent({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 2) {
LiveHorizontalCardComponent({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 3) {
if (compDTO.operDataList.length > 1) {
HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: compDTO })
} else {
HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: compDTO })
}
} else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
HeadPictureCardComponent({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.ZhGrid_Layout_03) {
...
...
sight_harmony/wdComponent/src/main/ets/components/MorningEveningPaper/SingleColumn999Component.ets
View file @
0aea843
...
...
@@ -51,7 +51,7 @@ export struct SingleColumn999Component {
// clarity: 0,
// resolutionHeight: 0,
// resolutionWidth: 0,
videoDuration:
"229"
,
videoDuration:
229
,
videoLandScape: 1,
// videoType: 0,
videoUrl: "https://cdnjdout.aikan.pdnews.cn/zhbj-20240116/vod/content/output/c72f4170db2c4d34befa453f60d39a69_opt.mp4",
...
...
sight_harmony/wdComponent/src/main/ets/components/page/CardView.ets
View file @
0aea843
...
...
@@ -409,7 +409,7 @@ export struct PaperSingleColumn999CardView {
.padding({ top: 10 })
if (this.item?.videoInfo) {
Stack() {
Text(this.item?.videoInfo.videoDuration)
Text(this.item?.videoInfo.videoDuration
+ ""
)
.backgroundColor(Color.Black)
.opacity(0.6)
.width(CommonConstants.FULL_PARENT)
...
...
sight_harmony/wdComponent/src/main/ets/components/view/HorizontalStrokeCardThreeTwoRadioForMoreComponent.ets
View file @
0aea843
import { CompDTO } from 'wdBean'
import { CommonConstants } from 'wdConstant'
import { ContentDTO,CompDTO } from 'wdBean'
@Component
export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
@State compDTO: CompDTO = {} as CompDTO
private arr: number[] = [0, 1, 2]
build() {
Column() {
Row() {
...
...
@@ -13,7 +13,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
.width(3)
.height(16)
.margin({ right: 4 })
Text(
"大标题"
)
Text(
this.compDTO.objectTitle
)
.fontSize($r("app.float.font_size_17"))
.fontColor($r("app.color.color_222222"))
.fontWeight(600)
...
...
@@ -29,38 +29,45 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
.height(14)
}
}.justifyContent(FlexAlign.SpaceBetween)
.padding({left:16,right:16})
.margin({top:8 ,bottom:8})
.padding({ left: 16, right: 16 })
.margin({ top: 8, bottom: 8 })
.width('100%')
// .backgroundColor($r("app.color.white"))
List({ space: 12 }) {
ForEach(this.
arr, (item
: number) => {
ForEach(this.
compDTO.operDataList, (item: ContentDTO, index
: number) => {
ListItem() {
Column() {
Image(
$r("app.media.setting")
)
Image(
item.coverUrl
)
.aspectRatio(1.5)
.width(150)
.width(
this.compDTO.operDataList.length == 2 ? 210 :
150)
.borderRadius(4)
.objectFit(ImageFit.Cover)
Text(
"大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发"
)
Text(
item.newsTitle
)
.fontSize($r("app.float.font_size_14"))
.fontColor($r("app.color.color_212228"))
.fontWeight(400)
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
// 超出的部分显示省略号。
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.textAlign(TextAlign.Start)
.margin({ top: 8 })
.width(150)
}
}
.padding({
left:(item == 0)? 16:0, right:(item == this.arr.length - 1) ? 16:0
})
.padding({
left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0
})
// .offset({x:16})
}, (item: number) => JSON.stringify(item))
.onClick(() => {
if (item.objectType != '0') {
console.log(item.objectId)
}
})
})
}.listDirection(Axis.Horizontal)
.width('100%')
// .backgroundColor($r("app.color.color_FE4B05"))
// .padding({left:16,right:16})
// .margin({left:16,right:16})
...
...
sight_harmony/wdComponent/src/main/ets/components/view/HorizontalStrokeCardThreeTwoRadioForOneComponent.ets
View file @
0aea843
import { CompDTO } from 'wdBean'
import { CommonConstants } from 'wdConstant'
import { CompDTO } from 'wdBean'
@Component
export struct HorizontalStrokeCardThreeTwoRadioForOneComponent {
...
...
@@ -12,7 +12,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent {
.width(3)
.height(16)
.margin({ right: 4 })
Text(
"大标题"
)
Text(
this.compDTO.objectTitle
)
.fontSize($r("app.float.font_size_17"))
.fontColor($r("app.color.color_222222"))
.fontWeight(600)
...
...
sight_harmony/wdComponent/src/main/ets/components/view/LiveHorizontalCardComponent.ets
View file @
0aea843
import { CommonConstants } from 'wdConstant'
import { CompDTO, ContentDTO } from 'wdBean'
// 视频直播横划卡16:9
import { LiveVideoTypeComponent } from './LiveVideoTypeComponent'
import { LiveHorizontalCardForOneComponent } from './LiveHorizontalCardForOneComponent'
import { ProcessUtils } from '../../utils/ProcessUtils'
import { CompDTO } from 'wdBean'
import { CommonConstants } from 'wdConstant'
import { ContentDTO } from 'wdBean'
/**
* 视频直播横划卡16:9
*/
@Component
export struct LiveHorizontalCardComponent {
@State compDTO: CompDTO = {} as CompDTO
...
...
@@ -42,7 +40,6 @@ export struct LiveHorizontalCardComponent {
// 多个
if (this.compDTO.operDataList.length >= 2) {
List({ space: 12 }) {
ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
ListItem() {
Column() {
...
...
@@ -80,10 +77,11 @@ export struct LiveHorizontalCardComponent {
}
.padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 })
.onClick(() => {
ProcessUtils.processPage(item)
if (item.objectType != '0') {
console.log(item.objectId)
}
})
}, (item: ContentDTO, index: number) => JSON.stringify(item))
})
}.listDirection(Axis.Horizontal)
.width(CommonConstants.FULL_WIDTH)
.height(this.compDTO.operDataList.length == 2 ? 180 : 136)
...
...
sight_harmony/wdComponent/src/main/ets/components/view/LiveHorizontalCardForOneComponent.ets
View file @
0aea843
import { ContentDTO } from 'wdBean'
// 视频直播横划卡16:9/1个
import { CommonConstants } from 'wdConstant'
import {
ProcessUtils } from '../../utils/ProcessUtils
'
import {
ContentDTO } from 'wdBean
'
import { LiveVideoTypeComponent } from './LiveVideoTypeComponent'
/**
* 视频直播横划卡16:9/1个
*/
@Component
export struct LiveHorizontalCardForOneComponent {
@State contentDTO: ContentDTO = {} as ContentDTO
...
...
@@ -27,7 +24,7 @@ export struct LiveHorizontalCardForOneComponent {
right: 2
})
} else if (this.contentDTO.objectType === '1' && this.contentDTO.videoInfo) {
LiveVideoTypeComponent({ nType: 1, name: this.contentDTO.videoInfo.videoDuration +
""
?? '00:00' })
LiveVideoTypeComponent({ nType: 1, name: this.contentDTO.videoInfo.videoDuration +
''
?? '00:00' })
.padding({
bottom: 2,
right: 2
...
...
@@ -45,9 +42,6 @@ export struct LiveHorizontalCardForOneComponent {
.margin({ top: 8 })
.width(CommonConstants.FULL_WIDTH)
}
.onClick((event: ClickEvent)=>{
ProcessUtils.processPage(this.contentDTO)
})
.padding({
left: 16,
right: 16
...
...
sight_harmony/wdConstant/src/main/ets/enum/CompStyle.ts
View file @
0aea843
...
...
@@ -23,7 +23,6 @@ export const enum CompStyle {
Masonry_Layout_01
=
'Masonry_Layout-01'
,
// 双列瀑布流/瀑布流卡:视频、直播、专题、活动
Title_Abbr_01
=
'11'
,
// 标题缩略
Title_All_01
=
'3'
,
// 全标题
Single_Imagecard_02
=
'13'
,
//单图卡:2行标题
Single_Imagecard_03
=
'13'
,
//单图卡:3行标题
ZhGrid_Layout_03
=
'Zh_Grid_Layout-03'
,
//金刚位卡
}
...
...
Please
register
or
login
to post a comment