yumaochao

fix:somebug

1 -import { CompDTO, ContentDTO, } from 'wdBean'; 1 +import { CompDTO, ContentDTO } from 'wdBean';
2 import { BreakpointConstants, CommonConstants } from 'wdConstant'; 2 import { BreakpointConstants, CommonConstants } from 'wdConstant';
3 import { BreakPointType, Logger } from 'wdKit'; 3 import { BreakPointType, Logger } from 'wdKit';
4 import { CompUtils } from '../../utils/CompUtils'; 4 import { CompUtils } from '../../utils/CompUtils';
@@ -11,6 +11,7 @@ import { InfomationCardClick } from '../../utils/infomationCardClick' @@ -11,6 +11,7 @@ import { InfomationCardClick } from '../../utils/infomationCardClick'
11 11
12 const TAG = 'Zh_Carousel_Layout-01'; 12 const TAG = 'Zh_Carousel_Layout-01';
13 13
  14 +
14 /** 15 /**
15 * 轮播组件,即Banner/轮播大图/焦点图/自动滑动 16 * 轮播组件,即Banner/轮播大图/焦点图/自动滑动
16 * 样式: 17 * 样式:
@@ -47,9 +48,11 @@ export struct ZhCarouselLayout01 { @@ -47,9 +48,11 @@ export struct ZhCarouselLayout01 {
47 @StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string = 48 @StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string =
48 BreakpointConstants.BREAKPOINT_XS; 49 BreakpointConstants.BREAKPOINT_XS;
49 @State compDTO: CompDTO = {} as CompDTO 50 @State compDTO: CompDTO = {} as CompDTO
  51 +
50 @State firstWd: number = 0 52 @State firstWd: number = 0
51 @State SecondWd: number = 0 53 @State SecondWd: number = 0
52 @State swiperIndex: number = 0 54 @State swiperIndex: number = 0
  55 +
53 private data: MyDataSource = new MyDataSource([]) 56 private data: MyDataSource = new MyDataSource([])
54 57
55 watchCurrentBreakpoint() { 58 watchCurrentBreakpoint() {
@@ -75,6 +78,7 @@ export struct ZhCarouselLayout01 { @@ -75,6 +78,7 @@ export struct ZhCarouselLayout01 {
75 } 78 }
76 79
77 build() { 80 build() {
  81 +
78 if (this.compDTO?.operDataList?.length) { 82 if (this.compDTO?.operDataList?.length) {
79 Stack() { 83 Stack() {
80 Swiper() { 84 Swiper() {
@@ -206,9 +210,19 @@ struct CarouselLayout01CardView { @@ -206,9 +210,19 @@ struct CarouselLayout01CardView {
206 Blank() 210 Blank()
207 // 文本信息 211 // 文本信息
208 Stack() { 212 Stack() {
209 - if (this.item.objectType == '5' || this.item.objectType == '6') { 213 + if(this.item.objectType == '5'){
210 Notes({ objectType: this.item.objectType }) 214 Notes({ objectType: this.item.objectType })
  215 + } else {
  216 + if (this.item.seoTags) {
  217 + Notes({ newTags: this.item.seoTags })
  218 + }
  219 + if (this.item.newTags) {
  220 + Notes({ newTags: this.item.newTags })
  221 + }
211 } 222 }
  223 + // if (this.item.objectType == '5' || this.item.objectType == '6') {
  224 + // Notes({ objectType: this.item.objectType })
  225 + // }
212 Text(`${this.item.corner}${this.item.newsTitle}`) 226 Text(`${this.item.corner}${this.item.newsTitle}`)
213 .width(CommonConstants.FULL_PARENT) 227 .width(CommonConstants.FULL_PARENT)
214 .fontColor(Color.White) 228 .fontColor(Color.White)
@@ -218,7 +232,10 @@ struct CarouselLayout01CardView { @@ -218,7 +232,10 @@ struct CarouselLayout01CardView {
218 .align(Alignment.Bottom) 232 .align(Alignment.Bottom)
219 .maxLines(CompUtils.MAX_LINES_2) 233 .maxLines(CompUtils.MAX_LINES_2)
220 .textOverflow({ overflow: TextOverflow.Ellipsis }) 234 .textOverflow({ overflow: TextOverflow.Ellipsis })
221 - .textIndent(this.item.objectType == '5' ? 35 : 0) 235 + .textIndent((this.item.newTags?.length || this.item.seoTags?.length) > 2 &&
  236 + (this.item.newTags?.length ||this.item.seoTags?.length) < 5 ? 58 :
  237 + ((this.item.newTags?.length > 0 || this.item.seoTags?.length > 0) ||this.item.objectType == '5') ? 35 :
  238 + 0 )
222 } 239 }
223 // .height(39) 240 // .height(39)
224 .padding({ 241 .padding({