guochunsong
@@ -5,7 +5,6 @@ import { LabelComponent } from './view/LabelComponent'; @@ -5,7 +5,6 @@ import { LabelComponent } from './view/LabelComponent';
5 import { TitleAbbrComponent } from './view/TitleAbbrComponent'; 5 import { TitleAbbrComponent } from './view/TitleAbbrComponent';
6 import { TitleAllComponent } from './view/TitleAllComponent'; 6 import { TitleAllComponent } from './view/TitleAllComponent';
7 import { HorizontalStrokeCardThreeTwoRadioForOneComponent } from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent'; 7 import { HorizontalStrokeCardThreeTwoRadioForOneComponent } from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent';
8 -import { HorizontalStrokeCardThreeTwoRadioForTwoComponent } from './view/HorizontalStrokeCardThreeTwoRadioForTwoComponent';  
9 import { HorizontalStrokeCardThreeTwoRadioForMoreComponent } from './view/HorizontalStrokeCardThreeTwoRadioForMoreComponent'; 8 import { HorizontalStrokeCardThreeTwoRadioForMoreComponent } from './view/HorizontalStrokeCardThreeTwoRadioForMoreComponent';
10 import { BigPicCardComponent } from './view/BigPicCardComponent'; 9 import { BigPicCardComponent } from './view/BigPicCardComponent';
11 import { TriPicCardComponent } from './view/TriPicCardComponent'; 10 import { TriPicCardComponent } from './view/TriPicCardComponent';
@@ -41,6 +40,12 @@ export struct CompParser { @@ -41,6 +40,12 @@ export struct CompParser {
41 TriPicCardComponent({ compDTO: compDTO }) 40 TriPicCardComponent({ compDTO: compDTO })
42 } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 2 ) { 41 } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 2 ) {
43 LiveHorizontalCardComponent({ compDTO: compDTO }) 42 LiveHorizontalCardComponent({ compDTO: compDTO })
  43 + } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 3 ) {
  44 + if(compDTO.operDataList.length > 1){
  45 + HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: compDTO })
  46 + }else{
  47 + HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: compDTO })
  48 + }
44 } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) { 49 } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
45 HeadPictureCardComponent({ compDTO: compDTO }) 50 HeadPictureCardComponent({ compDTO: compDTO })
46 } else { 51 } else {
1 import { CommonConstants } from 'wdConstant' 1 import { CommonConstants } from 'wdConstant'
2 import { CompDTO } from '../../repository/bean/CompDTO' 2 import { CompDTO } from '../../repository/bean/CompDTO'
3 - 3 +import { ContentDTO } from '../../repository/bean/ContentDTO'
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]  
8 build() { 7 build() {
9 Column() { 8 Column() {
10 Row() { 9 Row() {
@@ -13,7 +12,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -13,7 +12,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
13 .width(3) 12 .width(3)
14 .height(16) 13 .height(16)
15 .margin({ right: 4 }) 14 .margin({ right: 4 })
16 - Text("大标题") 15 + Text(this.compDTO.objectTitle)
17 .fontSize($r("app.float.font_size_17")) 16 .fontSize($r("app.float.font_size_17"))
18 .fontColor($r("app.color.color_222222")) 17 .fontColor($r("app.color.color_222222"))
19 .fontWeight(600) 18 .fontWeight(600)
@@ -35,16 +34,16 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -35,16 +34,16 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
35 // .backgroundColor($r("app.color.white")) 34 // .backgroundColor($r("app.color.white"))
36 List({ space: 12 }) { 35 List({ space: 12 }) {
37 36
38 - ForEach(this.arr, (item: number) => { 37 + ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
39 ListItem() { 38 ListItem() {
40 Column() { 39 Column() {
41 - Image($r("app.media.setting")) 40 + Image(item.coverUrl)
42 .aspectRatio(1.5) 41 .aspectRatio(1.5)
43 - .width(150) 42 + .width(this.compDTO.operDataList.length == 2 ? 210 : 150)
44 .borderRadius(4) 43 .borderRadius(4)
45 .objectFit(ImageFit.Cover) 44 .objectFit(ImageFit.Cover)
46 45
47 - Text("大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发") 46 + Text(item.newsTitle)
48 .fontSize($r("app.float.font_size_14")) 47 .fontSize($r("app.float.font_size_14"))
49 .fontColor($r("app.color.color_212228")) 48 .fontColor($r("app.color.color_212228"))
50 .fontWeight(400) 49 .fontWeight(400)
@@ -55,8 +54,13 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -55,8 +54,13 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
55 .width(150) 54 .width(150)
56 } 55 }
57 } 56 }
58 - .padding({left:(item == 0)? 16:0, right:(item == this.arr.length - 1) ? 16:0}) 57 + .padding({left:(index == 0)? 16:0, right:(index == this.compDTO.operDataList.length - 1) ? 16:0})
59 // .offset({x:16}) 58 // .offset({x:16})
  59 + .onClick(() => {
  60 + if (item.objectType != '0') {
  61 + console.log(item.objectId)
  62 + }
  63 + })
60 }, item => item) 64 }, item => item)
61 65
62 }.listDirection(Axis.Horizontal) 66 }.listDirection(Axis.Horizontal)
@@ -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 } from '../../repository/bean/CompDTO'  
3 -  
4 -@Component  
5 -export struct HorizontalStrokeCardThreeTwoRadioForTwoComponent {  
6 - @State compDTO: CompDTO = {} as CompDTO  
7 - private arr: number[] = [0, 1, 2]  
8 - build() {  
9 - Column() {  
10 - Row() {  
11 - Row() {  
12 - Image($r("app.media.redLine"))  
13 - .width(3)  
14 - .height(16)  
15 - .margin({ right: 4 })  
16 - Text("大标题")  
17 - .fontSize($r("app.float.font_size_17"))  
18 - .fontColor($r("app.color.color_222222"))  
19 - .fontWeight(600)  
20 - }  
21 -  
22 - Row() {  
23 - Text("更多")  
24 - .fontSize($r("app.float.font_size_14"))  
25 - .fontColor($r("app.color.color_999999"))  
26 - .margin({ right: 1 })  
27 - Image($r("app.media.more"))  
28 - .width(14)  
29 - .height(14)  
30 - }  
31 - }.justifyContent(FlexAlign.SpaceBetween)  
32 - .padding({left:16,right:16})  
33 - .margin({top:8 ,bottom:8})  
34 - .width('100%')  
35 - // .backgroundColor($r("app.color.white"))  
36 - List({ space: 12 }) {  
37 -  
38 - ForEach(this.arr, (item: number) => {  
39 - ListItem() {  
40 - Column() {  
41 - Image($r("app.media.setting"))  
42 - .aspectRatio(1.5)  
43 - .width(210)  
44 - .borderRadius(4)  
45 - .objectFit(ImageFit.Cover)  
46 -  
47 - Text("大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发")  
48 - .fontSize($r("app.float.font_size_14"))  
49 - .fontColor($r("app.color.color_212228"))  
50 - .fontWeight(400)  
51 - .maxLines(2)  
52 - .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。  
53 - .textAlign(TextAlign.Start)  
54 - .margin({ top: 8 })  
55 - .width(210)  
56 - }  
57 - }  
58 - .padding({left:(item == 0)? 16:0, right:(item == this.arr.length - 1) ? 16:0})  
59 - // .offset({x:16})  
60 - }, item => item)  
61 -  
62 - }.listDirection(Axis.Horizontal)  
63 - .width('100%')  
64 - // .backgroundColor($r("app.color.color_FE4B05"))  
65 - // .padding({left:16,right:16})  
66 - // .margin({left:16,right:16})  
67 -  
68 - }  
69 - .width("100%")  
70 - .padding({  
71 - top: 14,  
72 - left: 0,  
73 - right: 0,  
74 - bottom: 14  
75 - })  
76 - .backgroundColor($r("app.color.white"))  
77 - // .backgroundColor($r("app.color.color_FE4B05"))  
78 - .margin({ bottom: 8 })  
79 - }  
80 -}  
81 -  
@@ -6,6 +6,14 @@ import { DateTimeUtils } from 'wdKit' @@ -6,6 +6,14 @@ import { DateTimeUtils } from 'wdKit'
6 @Component 6 @Component
7 export struct TitleAbbrComponent { 7 export struct TitleAbbrComponent {
8 @State compDTO: CompDTO = {} as CompDTO 8 @State compDTO: CompDTO = {} as CompDTO
  9 + @State @Watch('isPoint') source:boolean=false;//来源是否为空 publishTime 字段是否为空
  10 + @State isPo:number=Visibility.Visible;
  11 +
  12 + isPoint(){
  13 + if(this.source){
  14 + this.isPo=Visibility.None
  15 + }
  16 + }
9 17
10 build() { 18 build() {
11 Column() { 19 Column() {
@@ -15,21 +23,26 @@ export struct TitleAbbrComponent { @@ -15,21 +23,26 @@ export struct TitleAbbrComponent {
15 .maxLines(3) 23 .maxLines(3)
16 .textOverflow({ overflow: TextOverflow.Ellipsis }) 24 .textOverflow({ overflow: TextOverflow.Ellipsis })
17 .width(CommonConstants.FULL_WIDTH) 25 .width(CommonConstants.FULL_WIDTH)
  26 + .fontWeight(400)
18 Row() { 27 Row() {
19 Text(this.compDTO.operDataList[0].corner) 28 Text(this.compDTO.operDataList[0].corner)
20 .fontSize($r("app.float.font_size_12")) 29 .fontSize($r("app.float.font_size_12"))
21 .fontColor($r("app.color.color_ED2800")) 30 .fontColor($r("app.color.color_ED2800"))
  31 + .fontWeight(400)
22 Text(this.compDTO.operDataList[0].source) 32 Text(this.compDTO.operDataList[0].source)
23 .fontSize($r("app.float.font_size_12")) 33 .fontSize($r("app.float.font_size_12"))
24 .fontColor($r("app.color.color_B0B0B0")) 34 .fontColor($r("app.color.color_B0B0B0"))
25 .margin({ left: 6 }) 35 .margin({ left: 6 })
  36 + .fontWeight(400)
26 Image($r("app.media.point")) 37 Image($r("app.media.point"))
27 .width(16) 38 .width(16)
28 .height(16) 39 .height(16)
  40 + .visibility(this.isPo)
29 41
30 Text(DateTimeUtils.formatDate(Number.parseFloat(this.compDTO.operDataList[0].publishTime))) 42 Text(DateTimeUtils.formatDate(Number.parseFloat(this.compDTO.operDataList[0].publishTime)))
31 .fontSize($r("app.float.font_size_12")) 43 .fontSize($r("app.float.font_size_12"))
32 .fontColor($r("app.color.color_B0B0B0")) 44 .fontColor($r("app.color.color_B0B0B0"))
  45 + .fontWeight(400)
33 46
34 }.width(CommonConstants.FULL_WIDTH) 47 }.width(CommonConstants.FULL_WIDTH)
35 .justifyContent(FlexAlign.Start) 48 .justifyContent(FlexAlign.Start)
@@ -45,4 +58,13 @@ export struct TitleAbbrComponent { @@ -45,4 +58,13 @@ export struct TitleAbbrComponent {
45 .backgroundColor($r("app.color.white")) 58 .backgroundColor($r("app.color.white"))
46 .margin({ bottom: 8 }) 59 .margin({ bottom: 8 })
47 } 60 }
  61 +
  62 + aboutToAppear(){
  63 + if(this.compDTO.operDataList[0].source==""){
  64 + this.source=true;
  65 + }
  66 + if(this.compDTO.operDataList[0].publishTime==""){
  67 + this.source=true;
  68 + }
  69 + }
48 } 70 }
@@ -7,6 +7,14 @@ import { Logger } from 'wdKit/src/main/ets/utils/Logger' @@ -7,6 +7,14 @@ import { Logger } from 'wdKit/src/main/ets/utils/Logger'
7 @Component 7 @Component
8 export struct TitleAllComponent { 8 export struct TitleAllComponent {
9 @State compDTO: CompDTO = {} as CompDTO 9 @State compDTO: CompDTO = {} as CompDTO
  10 + @State @Watch('isPoint') source:boolean=false;//来源是否为空 publishTime 字段是否为空
  11 + @State isPo:number=Visibility.Visible;
  12 +
  13 + isPoint(){
  14 + if(this.source){
  15 + this.isPo=Visibility.None
  16 + }
  17 + }
10 18
11 build() { 19 build() {
12 Column() { 20 Column() {
@@ -14,21 +22,26 @@ export struct TitleAllComponent { @@ -14,21 +22,26 @@ export struct TitleAllComponent {
14 .fontSize($r("app.float.font_size_17")) 22 .fontSize($r("app.float.font_size_17"))
15 .fontColor($r("app.color.color_222222")) 23 .fontColor($r("app.color.color_222222"))
16 .width(CommonConstants.FULL_WIDTH) 24 .width(CommonConstants.FULL_WIDTH)
  25 + .fontWeight(400)
17 Row() { 26 Row() {
18 Text(this.compDTO.operDataList[0].corner) 27 Text(this.compDTO.operDataList[0].corner)
19 .fontSize($r("app.float.font_size_12")) 28 .fontSize($r("app.float.font_size_12"))
20 .fontColor($r("app.color.color_ED2800")) 29 .fontColor($r("app.color.color_ED2800"))
  30 + .fontWeight(400)
21 Text(this.compDTO.operDataList[0].source) 31 Text(this.compDTO.operDataList[0].source)
22 .fontSize($r("app.float.font_size_12")) 32 .fontSize($r("app.float.font_size_12"))
23 .fontColor($r("app.color.color_B0B0B0")) 33 .fontColor($r("app.color.color_B0B0B0"))
24 .margin({ left: 6 }) 34 .margin({ left: 6 })
  35 + .fontWeight(400)
25 Image($r("app.media.point")) 36 Image($r("app.media.point"))
26 .width(16) 37 .width(16)
27 .height(16) 38 .height(16)
  39 + .visibility(this.isPo)
28 40
29 Text(DateTimeUtils.formatDate(Number.parseFloat(this.compDTO.operDataList[0].publishTime))) 41 Text(DateTimeUtils.formatDate(Number.parseFloat(this.compDTO.operDataList[0].publishTime)))
30 .fontSize($r("app.float.font_size_12")) 42 .fontSize($r("app.float.font_size_12"))
31 .fontColor($r("app.color.color_B0B0B0")) 43 .fontColor($r("app.color.color_B0B0B0"))
  44 + .fontWeight(400)
32 45
33 }.width(CommonConstants.FULL_WIDTH) 46 }.width(CommonConstants.FULL_WIDTH)
34 .justifyContent(FlexAlign.Start) 47 .justifyContent(FlexAlign.Start)
@@ -44,7 +57,15 @@ export struct TitleAllComponent { @@ -44,7 +57,15 @@ export struct TitleAllComponent {
44 .backgroundColor($r("app.color.white")) 57 .backgroundColor($r("app.color.white"))
45 .margin({ bottom: 8 }) 58 .margin({ bottom: 8 })
46 } 59 }
47 - aboutToAppear(){ 60 +
  61 + aboutToAppear() {
48 // Logger.info("ssx",JSON.stringify(this.compDTO.operDataList[0])) 62 // Logger.info("ssx",JSON.stringify(this.compDTO.operDataList[0]))
  63 + if (this.compDTO.operDataList[0].source == "") {
  64 + this.source = true;
  65 + }
  66 + if (this.compDTO.operDataList[0].publishTime == "") {
  67 + this.source = true;
  68 + }
  69 +
49 } 70 }
50 } 71 }