yangsunyue_wd

3:2横划卡接入

@@ -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,7 +40,13 @@ export struct CompParser { @@ -41,7 +40,13 @@ 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 })
44 - } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) { 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 + }
  49 + } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
45 HeadPictureCardComponent({ compDTO: compDTO }) 50 HeadPictureCardComponent({ compDTO: compDTO })
46 } else { 51 } else {
47 // todo:组件未实现 / Component Not Implemented 52 // todo:组件未实现 / Component Not Implemented
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 -