guochunsong

合并样式

@@ -51,8 +51,8 @@ export interface ContentDTO { @@ -51,8 +51,8 @@ export interface ContentDTO {
51 publishTime:string; 51 publishTime:string;
52 visitorComment:number; 52 visitorComment:number;
53 fullColumnImgUrls:FullColumnImgUrlDTO[]; 53 fullColumnImgUrls:FullColumnImgUrlDTO[];
54 - liveInfo?: LiveInfoDTO; // 直播新闻信息【BFF聚合】  
55 - videoInfo?: VideoInfoDTO; // 视频新闻信息【BFF聚合】,视频非原片+清晰度最高的 54 + liveInfo: LiveInfoDTO; // 直播新闻信息【BFF聚合】
  55 + videoInfo: VideoInfoDTO; // 视频新闻信息【BFF聚合】,视频非原片+清晰度最高的
56 56
57 newsSummary: string; //appstyle:2 ,新闻详情 57 newsSummary: string; //appstyle:2 ,新闻详情
58 58
@@ -10,6 +10,12 @@ import { TriPicCardComponent } from './view/TriPicCardComponent'; @@ -10,6 +10,12 @@ import { TriPicCardComponent } from './view/TriPicCardComponent';
10 import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent'; 10 import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent';
11 import { HeadPictureCardComponent } from './view/HeadPictureCardComponent'; 11 import { HeadPictureCardComponent } from './view/HeadPictureCardComponent';
12 import { ZhGridLayoutComponent } from './view/ZhGridLayoutComponent'; 12 import { ZhGridLayoutComponent } from './view/ZhGridLayoutComponent';
  13 +import {
  14 + HorizontalStrokeCardThreeTwoRadioForMoreComponent
  15 +} from './view/HorizontalStrokeCardThreeTwoRadioForMoreComponent';
  16 +import {
  17 + HorizontalStrokeCardThreeTwoRadioForOneComponent
  18 +} from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent';
13 19
14 /** 20 /**
15 * comp适配器. 21 * comp适配器.
@@ -33,7 +39,7 @@ export struct CompParser { @@ -33,7 +39,7 @@ export struct CompParser {
33 TitleAllComponent({ compDTO: compDTO }) 39 TitleAllComponent({ compDTO: compDTO })
34 } else if (compDTO.compStyle === CompStyle.Carousel_Layout_01) { 40 } else if (compDTO.compStyle === CompStyle.Carousel_Layout_01) {
35 BannerComponent({ compDTO: compDTO }) 41 BannerComponent({ compDTO: compDTO })
36 - } else if (compDTO.compStyle === CompStyle.Single_Imagecard_02 || compDTO.compStyle === CompStyle.Single_Imagecard_03) { 42 + } else if (compDTO.compStyle === CompStyle.Single_Imagecard_03) {
37 SingleImageCardComponent({ compDTO: compDTO }) 43 SingleImageCardComponent({ compDTO: compDTO })
38 } else if (compDTO.compStyle === "2") { 44 } else if (compDTO.compStyle === "2") {
39 BigPicCardComponent({ compDTO: compDTO }) 45 BigPicCardComponent({ compDTO: compDTO })
@@ -41,6 +47,12 @@ export struct CompParser { @@ -41,6 +47,12 @@ export struct CompParser {
41 TriPicCardComponent({ compDTO: compDTO }) 47 TriPicCardComponent({ compDTO: compDTO })
42 } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 2) { 48 } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 2) {
43 LiveHorizontalCardComponent({ compDTO: compDTO }) 49 LiveHorizontalCardComponent({ compDTO: compDTO })
  50 + } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 3) {
  51 + if (compDTO.operDataList.length > 1) {
  52 + HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: compDTO })
  53 + } else {
  54 + HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: compDTO })
  55 + }
44 } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) { 56 } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
45 HeadPictureCardComponent({ compDTO: compDTO }) 57 HeadPictureCardComponent({ compDTO: compDTO })
46 } else if (compDTO.compStyle === CompStyle.ZhGrid_Layout_03) { 58 } else if (compDTO.compStyle === CompStyle.ZhGrid_Layout_03) {
@@ -51,7 +51,7 @@ export struct SingleColumn999Component { @@ -51,7 +51,7 @@ export struct SingleColumn999Component {
51 // clarity: 0, 51 // clarity: 0,
52 // resolutionHeight: 0, 52 // resolutionHeight: 0,
53 // resolutionWidth: 0, 53 // resolutionWidth: 0,
54 - videoDuration: "229", 54 + videoDuration: 229,
55 videoLandScape: 1, 55 videoLandScape: 1,
56 // videoType: 0, 56 // videoType: 0,
57 videoUrl: "https://cdnjdout.aikan.pdnews.cn/zhbj-20240116/vod/content/output/c72f4170db2c4d34befa453f60d39a69_opt.mp4", 57 videoUrl: "https://cdnjdout.aikan.pdnews.cn/zhbj-20240116/vod/content/output/c72f4170db2c4d34befa453f60d39a69_opt.mp4",
@@ -409,7 +409,7 @@ export struct PaperSingleColumn999CardView { @@ -409,7 +409,7 @@ export struct PaperSingleColumn999CardView {
409 .padding({ top: 10 }) 409 .padding({ top: 10 })
410 if (this.item?.videoInfo) { 410 if (this.item?.videoInfo) {
411 Stack() { 411 Stack() {
412 - Text(this.item?.videoInfo.videoDuration) 412 + Text(this.item?.videoInfo.videoDuration + "")
413 .backgroundColor(Color.Black) 413 .backgroundColor(Color.Black)
414 .opacity(0.6) 414 .opacity(0.6)
415 .width(CommonConstants.FULL_PARENT) 415 .width(CommonConstants.FULL_PARENT)
1 -import { CompDTO } from 'wdBean'  
2 import { CommonConstants } from 'wdConstant' 1 import { CommonConstants } from 'wdConstant'
  2 +import { ContentDTO,CompDTO } from 'wdBean'
3 3
4 @Component 4 @Component
5 export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { 5 export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
6 @State compDTO: CompDTO = {} as CompDTO 6 @State compDTO: CompDTO = {} as CompDTO
7 - private arr: number[] = [0, 1, 2] 7 +
8 build() { 8 build() {
9 Column() { 9 Column() {
10 Row() { 10 Row() {
@@ -13,7 +13,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -13,7 +13,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
13 .width(3) 13 .width(3)
14 .height(16) 14 .height(16)
15 .margin({ right: 4 }) 15 .margin({ right: 4 })
16 - Text("大标题") 16 + Text(this.compDTO.objectTitle)
17 .fontSize($r("app.float.font_size_17")) 17 .fontSize($r("app.float.font_size_17"))
18 .fontColor($r("app.color.color_222222")) 18 .fontColor($r("app.color.color_222222"))
19 .fontWeight(600) 19 .fontWeight(600)
@@ -29,38 +29,45 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -29,38 +29,45 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
29 .height(14) 29 .height(14)
30 } 30 }
31 }.justifyContent(FlexAlign.SpaceBetween) 31 }.justifyContent(FlexAlign.SpaceBetween)
32 - .padding({left:16,right:16})  
33 - .margin({top:8 ,bottom:8}) 32 + .padding({ left: 16, right: 16 })
  33 + .margin({ top: 8, bottom: 8 })
34 .width('100%') 34 .width('100%')
  35 +
35 // .backgroundColor($r("app.color.white")) 36 // .backgroundColor($r("app.color.white"))
36 List({ space: 12 }) { 37 List({ space: 12 }) {
37 38
38 - ForEach(this.arr, (item: number) => { 39 + ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
39 ListItem() { 40 ListItem() {
40 Column() { 41 Column() {
41 - Image($r("app.media.setting")) 42 + Image(item.coverUrl)
42 .aspectRatio(1.5) 43 .aspectRatio(1.5)
43 - .width(150) 44 + .width(this.compDTO.operDataList.length == 2 ? 210 : 150)
44 .borderRadius(4) 45 .borderRadius(4)
45 .objectFit(ImageFit.Cover) 46 .objectFit(ImageFit.Cover)
46 47
47 - Text("大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发") 48 + Text(item.newsTitle)
48 .fontSize($r("app.float.font_size_14")) 49 .fontSize($r("app.float.font_size_14"))
49 .fontColor($r("app.color.color_212228")) 50 .fontColor($r("app.color.color_212228"))
50 .fontWeight(400) 51 .fontWeight(400)
51 .maxLines(2) 52 .maxLines(2)
52 - .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 53 + .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
53 .textAlign(TextAlign.Start) 54 .textAlign(TextAlign.Start)
54 .margin({ top: 8 }) 55 .margin({ top: 8 })
55 .width(150) 56 .width(150)
56 } 57 }
57 } 58 }
58 - .padding({left:(item == 0)? 16:0, right:(item == this.arr.length - 1) ? 16:0}) 59 + .padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 })
59 // .offset({x:16}) 60 // .offset({x:16})
60 - }, (item: number) => JSON.stringify(item)) 61 + .onClick(() => {
  62 + if (item.objectType != '0') {
  63 + console.log(item.objectId)
  64 + }
  65 + })
  66 + })
61 67
62 }.listDirection(Axis.Horizontal) 68 }.listDirection(Axis.Horizontal)
63 .width('100%') 69 .width('100%')
  70 +
64 // .backgroundColor($r("app.color.color_FE4B05")) 71 // .backgroundColor($r("app.color.color_FE4B05"))
65 // .padding({left:16,right:16}) 72 // .padding({left:16,right:16})
66 // .margin({left:16,right:16}) 73 // .margin({left:16,right:16})
1 -import { CompDTO } from 'wdBean'  
2 import { CommonConstants } from 'wdConstant' 1 import { CommonConstants } from 'wdConstant'
  2 +import { CompDTO } from 'wdBean'
3 3
4 @Component 4 @Component
5 export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { 5 export struct HorizontalStrokeCardThreeTwoRadioForOneComponent {
@@ -12,7 +12,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { @@ -12,7 +12,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent {
12 .width(3) 12 .width(3)
13 .height(16) 13 .height(16)
14 .margin({ right: 4 }) 14 .margin({ right: 4 })
15 - Text("大标题") 15 + Text(this.compDTO.objectTitle)
16 .fontSize($r("app.float.font_size_17")) 16 .fontSize($r("app.float.font_size_17"))
17 .fontColor($r("app.color.color_222222")) 17 .fontColor($r("app.color.color_222222"))
18 .fontWeight(600) 18 .fontWeight(600)
1 -import { CommonConstants } from 'wdConstant'  
2 -import { CompDTO, ContentDTO } from 'wdBean' 1 +// 视频直播横划卡16:9
3 import { LiveVideoTypeComponent } from './LiveVideoTypeComponent' 2 import { LiveVideoTypeComponent } from './LiveVideoTypeComponent'
4 import { LiveHorizontalCardForOneComponent } from './LiveHorizontalCardForOneComponent' 3 import { LiveHorizontalCardForOneComponent } from './LiveHorizontalCardForOneComponent'
5 -import { ProcessUtils } from '../../utils/ProcessUtils' 4 +import { CompDTO } from 'wdBean'
  5 +import { CommonConstants } from 'wdConstant'
  6 +import { ContentDTO } from 'wdBean'
6 7
7 -/**  
8 - * 视频直播横划卡16:9  
9 - */  
10 @Component 8 @Component
11 export struct LiveHorizontalCardComponent { 9 export struct LiveHorizontalCardComponent {
12 @State compDTO: CompDTO = {} as CompDTO 10 @State compDTO: CompDTO = {} as CompDTO
@@ -42,7 +40,6 @@ export struct LiveHorizontalCardComponent { @@ -42,7 +40,6 @@ export struct LiveHorizontalCardComponent {
42 // 多个 40 // 多个
43 if (this.compDTO.operDataList.length >= 2) { 41 if (this.compDTO.operDataList.length >= 2) {
44 List({ space: 12 }) { 42 List({ space: 12 }) {
45 -  
46 ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { 43 ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
47 ListItem() { 44 ListItem() {
48 Column() { 45 Column() {
@@ -80,10 +77,11 @@ export struct LiveHorizontalCardComponent { @@ -80,10 +77,11 @@ export struct LiveHorizontalCardComponent {
80 } 77 }
81 .padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 }) 78 .padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 })
82 .onClick(() => { 79 .onClick(() => {
83 - ProcessUtils.processPage(item) 80 + if (item.objectType != '0') {
  81 + console.log(item.objectId)
  82 + }
  83 + })
84 }) 84 })
85 - }, (item: ContentDTO, index: number) => JSON.stringify(item))  
86 -  
87 }.listDirection(Axis.Horizontal) 85 }.listDirection(Axis.Horizontal)
88 .width(CommonConstants.FULL_WIDTH) 86 .width(CommonConstants.FULL_WIDTH)
89 .height(this.compDTO.operDataList.length == 2 ? 180 : 136) 87 .height(this.compDTO.operDataList.length == 2 ? 180 : 136)
1 -import { ContentDTO } from 'wdBean' 1 +// 视频直播横划卡16:9/1个
2 import { CommonConstants } from 'wdConstant' 2 import { CommonConstants } from 'wdConstant'
3 -import { ProcessUtils } from '../../utils/ProcessUtils' 3 +import { ContentDTO } from 'wdBean'
4 import { LiveVideoTypeComponent } from './LiveVideoTypeComponent' 4 import { LiveVideoTypeComponent } from './LiveVideoTypeComponent'
5 5
6 -/**  
7 - * 视频直播横划卡16:9/1个  
8 - */  
9 @Component 6 @Component
10 export struct LiveHorizontalCardForOneComponent { 7 export struct LiveHorizontalCardForOneComponent {
11 @State contentDTO: ContentDTO = {} as ContentDTO 8 @State contentDTO: ContentDTO = {} as ContentDTO
@@ -27,7 +24,7 @@ export struct LiveHorizontalCardForOneComponent { @@ -27,7 +24,7 @@ export struct LiveHorizontalCardForOneComponent {
27 right: 2 24 right: 2
28 }) 25 })
29 } else if (this.contentDTO.objectType === '1' && this.contentDTO.videoInfo) { 26 } else if (this.contentDTO.objectType === '1' && this.contentDTO.videoInfo) {
30 - LiveVideoTypeComponent({ nType: 1, name: this.contentDTO.videoInfo.videoDuration + "" ?? '00:00' }) 27 + LiveVideoTypeComponent({ nType: 1, name: this.contentDTO.videoInfo.videoDuration + '' ?? '00:00' })
31 .padding({ 28 .padding({
32 bottom: 2, 29 bottom: 2,
33 right: 2 30 right: 2
@@ -45,9 +42,6 @@ export struct LiveHorizontalCardForOneComponent { @@ -45,9 +42,6 @@ export struct LiveHorizontalCardForOneComponent {
45 .margin({ top: 8 }) 42 .margin({ top: 8 })
46 .width(CommonConstants.FULL_WIDTH) 43 .width(CommonConstants.FULL_WIDTH)
47 } 44 }
48 - .onClick((event: ClickEvent)=>{  
49 - ProcessUtils.processPage(this.contentDTO)  
50 - })  
51 .padding({ 45 .padding({
52 left: 16, 46 left: 16,
53 right: 16 47 right: 16
@@ -23,7 +23,6 @@ export const enum CompStyle { @@ -23,7 +23,6 @@ export const enum CompStyle {
23 Masonry_Layout_01 = 'Masonry_Layout-01', // 双列瀑布流/瀑布流卡:视频、直播、专题、活动 23 Masonry_Layout_01 = 'Masonry_Layout-01', // 双列瀑布流/瀑布流卡:视频、直播、专题、活动
24 Title_Abbr_01 = '11', // 标题缩略 24 Title_Abbr_01 = '11', // 标题缩略
25 Title_All_01 = '3', // 全标题 25 Title_All_01 = '3', // 全标题
26 - Single_Imagecard_02 = '13',//单图卡:2行标题  
27 Single_Imagecard_03 = '13',//单图卡:3行标题 26 Single_Imagecard_03 = '13',//单图卡:3行标题
28 ZhGrid_Layout_03 = 'Zh_Grid_Layout-03', //金刚位卡 27 ZhGrid_Layout_03 = 'Zh_Grid_Layout-03', //金刚位卡
29 } 28 }