behindDivider.ets
2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { CompDTO, ContentDTO } from 'wdBean';
import { CommonConstants, CompStyle } from 'wdConstant/Index';
@Component
export struct behindDivider {
@ObjectLink compDTO: CompDTO
@State nextCompDTO: CompDTO = new CompDTO
@State compIndex: number = 0;
build() {
if (
this.compDTO.compStyle === CompStyle.Card_09 ||
this.compDTO.compStyle === CompStyle.Zh_Single_Column_09 ||
this.compDTO.compStyle === CompStyle.Zh_Single_Row_04 ||
this.compDTO.compStyle === CompStyle.Zh_Single_Row_06
) {
if (this.compDTO.compStyle === this.nextCompDTO.compStyle) {
Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 })
} else {
Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})
}
} else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
// if (this.compIndex === 0) {
// Divider().strokeWidth(1).color('#f5f5f5').width('120%').margin({left: -6})
// } else {
// Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})
// }
Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 })
} else if (this.compDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) {
// 大专题
// if (this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) {
// Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 })
// } else {
Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})
// }
} else if (this.compDTO.compType === 'appStyle'
|| this.compDTO.compStyle === CompStyle.Zh_Single_Row_01
|| this.compDTO.compStyle === CompStyle.Zh_Single_Row_02
|| this.compDTO.compStyle === CompStyle.Zh_Single_Row_03
|| this.compDTO.compStyle === CompStyle.Card_Comp_Adv
|| this.compDTO.compStyle === CompStyle.Zh_Single_Column_02
|| this.compDTO.compStyle === CompStyle.Zh_Single_Column_04
) {
if (
this.nextCompDTO.compStyle === CompStyle.Card_09 ||
this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10 ||
this.nextCompDTO.compStyle === CompStyle.Zh_Single_Column_09 ||
this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_04 ||
this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_06 ||
this.nextCompDTO.compStyle === CompStyle.Zh_Single_Column_12
) {
Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})
} else {
Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 })
}
} else {
Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 })
}
}
}