yumaochao

fix:somebug

import { CompDTO, ContentDTO, } from 'wdBean';
import { CompDTO, ContentDTO } from 'wdBean';
import { BreakpointConstants, CommonConstants } from 'wdConstant';
import { BreakPointType, Logger } from 'wdKit';
import { CompUtils } from '../../utils/CompUtils';
... ... @@ -11,6 +11,7 @@ import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Zh_Carousel_Layout-01';
/**
* 轮播组件,即Banner/轮播大图/焦点图/自动滑动
* 样式:
... ... @@ -47,9 +48,11 @@ export struct ZhCarouselLayout01 {
@StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string =
BreakpointConstants.BREAKPOINT_XS;
@State compDTO: CompDTO = {} as CompDTO
@State firstWd: number = 0
@State SecondWd: number = 0
@State swiperIndex: number = 0
private data: MyDataSource = new MyDataSource([])
watchCurrentBreakpoint() {
... ... @@ -75,6 +78,7 @@ export struct ZhCarouselLayout01 {
}
build() {
if (this.compDTO?.operDataList?.length) {
Stack() {
Swiper() {
... ... @@ -206,9 +210,19 @@ struct CarouselLayout01CardView {
Blank()
// 文本信息
Stack() {
if (this.item.objectType == '5' || this.item.objectType == '6') {
if(this.item.objectType == '5'){
Notes({ objectType: this.item.objectType })
} else {
if (this.item.seoTags) {
Notes({ newTags: this.item.seoTags })
}
if (this.item.newTags) {
Notes({ newTags: this.item.newTags })
}
}
// if (this.item.objectType == '5' || this.item.objectType == '6') {
// Notes({ objectType: this.item.objectType })
// }
Text(`${this.item.corner}${this.item.newsTitle}`)
.width(CommonConstants.FULL_PARENT)
.fontColor(Color.White)
... ... @@ -218,7 +232,10 @@ struct CarouselLayout01CardView {
.align(Alignment.Bottom)
.maxLines(CompUtils.MAX_LINES_2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textIndent(this.item.objectType == '5' ? 35 : 0)
.textIndent((this.item.newTags?.length || this.item.seoTags?.length) > 2 &&
(this.item.newTags?.length ||this.item.seoTags?.length) < 5 ? 58 :
((this.item.newTags?.length > 0 || this.item.seoTags?.length > 0) ||this.item.objectType == '5') ? 35 :
0 )
}
// .height(39)
.padding({
... ...