guochunsong
... ... @@ -5,7 +5,6 @@ import { LabelComponent } from './view/LabelComponent';
import { TitleAbbrComponent } from './view/TitleAbbrComponent';
import { TitleAllComponent } from './view/TitleAllComponent';
import { HorizontalStrokeCardThreeTwoRadioForOneComponent } from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent';
import { HorizontalStrokeCardThreeTwoRadioForTwoComponent } from './view/HorizontalStrokeCardThreeTwoRadioForTwoComponent';
import { HorizontalStrokeCardThreeTwoRadioForMoreComponent } from './view/HorizontalStrokeCardThreeTwoRadioForMoreComponent';
import { BigPicCardComponent } from './view/BigPicCardComponent';
import { TriPicCardComponent } from './view/TriPicCardComponent';
... ... @@ -41,7 +40,13 @@ export struct CompParser {
TriPicCardComponent({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 2 ) {
LiveHorizontalCardComponent({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
} else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 3 ) {
if(compDTO.operDataList.length > 1){
HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: compDTO })
}else{
HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: compDTO })
}
} else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
HeadPictureCardComponent({ compDTO: compDTO })
} else {
// todo:组件未实现 / Component Not Implemented
... ...
import { CommonConstants } from 'wdConstant'
import { CompDTO } from '../../repository/bean/CompDTO'
import { ContentDTO } from '../../repository/bean/ContentDTO'
@Component
export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
@State compDTO: CompDTO = {} as CompDTO
private arr: number[] = [0, 1, 2]
build() {
Column() {
Row() {
... ... @@ -13,7 +12,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
.width(3)
.height(16)
.margin({ right: 4 })
Text("大标题")
Text(this.compDTO.objectTitle)
.fontSize($r("app.float.font_size_17"))
.fontColor($r("app.color.color_222222"))
.fontWeight(600)
... ... @@ -35,16 +34,16 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
// .backgroundColor($r("app.color.white"))
List({ space: 12 }) {
ForEach(this.arr, (item: number) => {
ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
ListItem() {
Column() {
Image($r("app.media.setting"))
Image(item.coverUrl)
.aspectRatio(1.5)
.width(150)
.width(this.compDTO.operDataList.length == 2 ? 210 : 150)
.borderRadius(4)
.objectFit(ImageFit.Cover)
Text("大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发")
Text(item.newsTitle)
.fontSize($r("app.float.font_size_14"))
.fontColor($r("app.color.color_212228"))
.fontWeight(400)
... ... @@ -55,8 +54,13 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
.width(150)
}
}
.padding({left:(item == 0)? 16:0, right:(item == this.arr.length - 1) ? 16:0})
.padding({left:(index == 0)? 16:0, right:(index == this.compDTO.operDataList.length - 1) ? 16:0})
// .offset({x:16})
.onClick(() => {
if (item.objectType != '0') {
console.log(item.objectId)
}
})
}, item => item)
}.listDirection(Axis.Horizontal)
... ...
... ... @@ -12,7 +12,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent {
.width(3)
.height(16)
.margin({ right: 4 })
Text("大标题")
Text(this.compDTO.objectTitle)
.fontSize($r("app.float.font_size_17"))
.fontColor($r("app.color.color_222222"))
.fontWeight(600)
... ...
import { CommonConstants } from 'wdConstant'
import { CompDTO } from '../../repository/bean/CompDTO'
@Component
export struct HorizontalStrokeCardThreeTwoRadioForTwoComponent {
@State compDTO: CompDTO = {} as CompDTO
private arr: number[] = [0, 1, 2]
build() {
Column() {
Row() {
Row() {
Image($r("app.media.redLine"))
.width(3)
.height(16)
.margin({ right: 4 })
Text("大标题")
.fontSize($r("app.float.font_size_17"))
.fontColor($r("app.color.color_222222"))
.fontWeight(600)
}
Row() {
Text("更多")
.fontSize($r("app.float.font_size_14"))
.fontColor($r("app.color.color_999999"))
.margin({ right: 1 })
Image($r("app.media.more"))
.width(14)
.height(14)
}
}.justifyContent(FlexAlign.SpaceBetween)
.padding({left:16,right:16})
.margin({top:8 ,bottom:8})
.width('100%')
// .backgroundColor($r("app.color.white"))
List({ space: 12 }) {
ForEach(this.arr, (item: number) => {
ListItem() {
Column() {
Image($r("app.media.setting"))
.aspectRatio(1.5)
.width(210)
.borderRadius(4)
.objectFit(ImageFit.Cover)
Text("大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发大发大法师法师打发大水发生发大水发大水发")
.fontSize($r("app.float.font_size_14"))
.fontColor($r("app.color.color_212228"))
.fontWeight(400)
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
.textAlign(TextAlign.Start)
.margin({ top: 8 })
.width(210)
}
}
.padding({left:(item == 0)? 16:0, right:(item == this.arr.length - 1) ? 16:0})
// .offset({x:16})
}, item => item)
}.listDirection(Axis.Horizontal)
.width('100%')
// .backgroundColor($r("app.color.color_FE4B05"))
// .padding({left:16,right:16})
// .margin({left:16,right:16})
}
.width("100%")
.padding({
top: 14,
left: 0,
right: 0,
bottom: 14
})
.backgroundColor($r("app.color.white"))
// .backgroundColor($r("app.color.color_FE4B05"))
.margin({ bottom: 8 })
}
}
... ... @@ -6,6 +6,14 @@ import { DateTimeUtils } from 'wdKit'
@Component
export struct TitleAbbrComponent {
@State compDTO: CompDTO = {} as CompDTO
@State @Watch('isPoint') source:boolean=false;//来源是否为空 publishTime 字段是否为空
@State isPo:number=Visibility.Visible;
isPoint(){
if(this.source){
this.isPo=Visibility.None
}
}
build() {
Column() {
... ... @@ -15,21 +23,26 @@ export struct TitleAbbrComponent {
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.width(CommonConstants.FULL_WIDTH)
.fontWeight(400)
Row() {
Text(this.compDTO.operDataList[0].corner)
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_ED2800"))
.fontWeight(400)
Text(this.compDTO.operDataList[0].source)
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
.margin({ left: 6 })
.fontWeight(400)
Image($r("app.media.point"))
.width(16)
.height(16)
.visibility(this.isPo)
Text(DateTimeUtils.formatDate(Number.parseFloat(this.compDTO.operDataList[0].publishTime)))
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
.fontWeight(400)
}.width(CommonConstants.FULL_WIDTH)
.justifyContent(FlexAlign.Start)
... ... @@ -45,4 +58,13 @@ export struct TitleAbbrComponent {
.backgroundColor($r("app.color.white"))
.margin({ bottom: 8 })
}
aboutToAppear(){
if(this.compDTO.operDataList[0].source==""){
this.source=true;
}
if(this.compDTO.operDataList[0].publishTime==""){
this.source=true;
}
}
}
\ No newline at end of file
... ...
... ... @@ -7,6 +7,14 @@ import { Logger } from 'wdKit/src/main/ets/utils/Logger'
@Component
export struct TitleAllComponent {
@State compDTO: CompDTO = {} as CompDTO
@State @Watch('isPoint') source:boolean=false;//来源是否为空 publishTime 字段是否为空
@State isPo:number=Visibility.Visible;
isPoint(){
if(this.source){
this.isPo=Visibility.None
}
}
build() {
Column() {
... ... @@ -14,21 +22,26 @@ export struct TitleAllComponent {
.fontSize($r("app.float.font_size_17"))
.fontColor($r("app.color.color_222222"))
.width(CommonConstants.FULL_WIDTH)
.fontWeight(400)
Row() {
Text(this.compDTO.operDataList[0].corner)
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_ED2800"))
.fontWeight(400)
Text(this.compDTO.operDataList[0].source)
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
.margin({ left: 6 })
.fontWeight(400)
Image($r("app.media.point"))
.width(16)
.height(16)
.visibility(this.isPo)
Text(DateTimeUtils.formatDate(Number.parseFloat(this.compDTO.operDataList[0].publishTime)))
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
.fontWeight(400)
}.width(CommonConstants.FULL_WIDTH)
.justifyContent(FlexAlign.Start)
... ... @@ -44,7 +57,15 @@ export struct TitleAllComponent {
.backgroundColor($r("app.color.white"))
.margin({ bottom: 8 })
}
aboutToAppear(){
aboutToAppear() {
// Logger.info("ssx",JSON.stringify(this.compDTO.operDataList[0]))
if (this.compDTO.operDataList[0].source == "") {
this.source = true;
}
if (this.compDTO.operDataList[0].publishTime == "") {
this.source = true;
}
}
}
\ No newline at end of file
... ...