Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
douaojie
2024-05-13 15:32:31 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b89908db483eefb817707f2bd97a5ffddce8d9e6
b89908db
1 parent
9ca7dfab
fix: 调整
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
35 additions
and
29 deletions
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
sight_harmony/features/wdComponent/src/main/ets/components/CardParser.ets
sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card10Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card5Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card6Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card9Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/notes.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhCarouselLayout01.ets
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
View file @
b89908d
...
...
@@ -84,7 +84,7 @@ export class ContentDTO implements BaseDTO {
openType: string = '';
extra: string = ''
static clone(old:ContentDTO): ContentDTO {
static clone(old:
ContentDTO): ContentDTO {
let content = new ContentDTO();
content.appStyle = old.appStyle;
content.cityCode = old.cityCode;
...
...
sight_harmony/features/wdComponent/src/main/ets/components/CardParser.ets
View file @
b89908d
import { CommonConstants, CompStyle } from 'wdConstant';
import { ContentDTO } from 'wdBean';
import { CompStyle } from 'wdConstant';
import { CompDTO, ContentDTO } from 'wdBean';
import { Card2Component } from './cardview/Card2Component';
import { Card3Component } from './cardview/Card3Component';
import { Card4Component } from './cardview/Card4Component';
...
...
@@ -24,13 +24,14 @@ import { Card21Component } from './cardview/Card21Component';
@Component
export struct CardParser {
@State contentDTO: ContentDTO = new ContentDTO();
@State compDTO: CompDTO = {} as CompDTO
build() {
this.contentBuilder(this.contentDTO);
this.contentBuilder(this.contentDTO
, this.compDTO
);
}
@Builder
contentBuilder(contentDTO: ContentDTO) {
contentBuilder(contentDTO: ContentDTO
, compDTO: CompDTO
) {
if (contentDTO.appStyle === CompStyle.Card_02) {
Card2Component({ contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_03) {
...
...
@@ -38,7 +39,7 @@ export struct CardParser {
} else if (contentDTO.appStyle === CompStyle.Card_04) {
Card4Component({ contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_05) {
Card5Component({ contentDTO })
Card5Component({ contentDTO
, titleShowPolicy: compDTO.titleShowPolicy
})
} else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle
.Card_13) {
Card6Component({ contentDTO })
...
...
@@ -64,8 +65,7 @@ export struct CardParser {
Card20Component({ contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_21) {
Card21Component({ contentDTO })
}
else {
} else {
// todo:组件未实现 / Component Not Implemented
// Text(contentDTO.appStyle)
// .width(CommonConstants.FULL_PARENT)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
View file @
b89908d
...
...
@@ -32,12 +32,12 @@ import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent'
@Component
export struct CompParser {
@State compDTO: CompDTO = {} as CompDTO
@State private pageModel: PageModel = new PageModel();
@State compIndex: number = 0;
@State private pageModel: PageModel = new PageModel();
build() {
Column() {
if (this.compDTO.name !="月度排行卡") {
if (this.compDTO.name !=
"月度排行卡") {
this.componentBuilder(this.compDTO, this.compIndex);
}
...
...
@@ -53,7 +53,8 @@ export struct CompParser {
} else if (compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
ZhCarouselLayout01({ compDTO: compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 2) {// && compDTO.name ==="横划卡"
} else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 &&
compDTO.imageScale === 2) { // && compDTO.name ==="横划卡"
LiveHorizontalCardComponent({ compDTO: compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
...
...
@@ -87,7 +88,7 @@ export struct CompParser {
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
//头图卡 和comStyle 2相同,
Card5Component({ contentDTO: compDTO.operDataList[0] })
Card5Component({ contentDTO: compDTO.operDataList[0]
, titleShowPolicy: compDTO.titleShowPolicy
})
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (compDTO.compStyle === CompStyle.Zh_Single_Column_03) {
// 大图卡
...
...
@@ -107,10 +108,9 @@ export struct CompParser {
//Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 16, right: 16 })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else if (!Number.isNaN(Number(compDTO.compStyle))) {
CardParser({ contentDTO: compDTO.operDataList[0] });
CardParser({ contentDTO: compDTO.operDataList[0]
, compDTO
});
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
}
else {
} else {
Text(compDTO.compStyle)
.width(CommonConstants.FULL_PARENT)
.padding(10)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card10Component.ets
View file @
b89908d
...
...
@@ -48,8 +48,9 @@ export struct Card10Component {
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.contentDTO)
})
if (this.contentDTO.objectType == '5') {
Notes({ objectType: 5 }).margin({ left: 5, bottom: 5 })
}
}.alignContent(Alignment.BottomStart)
// 专题列表--后端返回三个,
...
...
@@ -106,7 +107,7 @@ export struct Card10Component {
.fontColor($r('app.color.color_222222'))
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textIndent(item.objectType == '5' ?
40
: 0)
.textIndent(item.objectType == '5' ?
38
: 0)
}.alignContent(Alignment.TopStart)
CardSourceInfo(
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
View file @
b89908d
...
...
@@ -40,7 +40,7 @@ export struct Card2Component {
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.align(Alignment.Start)
.textIndent(this.contentDTO.objectType == '5' ?
40
: 0)
.textIndent(this.contentDTO.objectType == '5' ?
35
: 0)
}
.alignContent(Alignment.TopStart)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card5Component.ets
View file @
b89908d
...
...
@@ -12,7 +12,7 @@ const TAG: string = 'Card5Component';
@Component
export struct Card5Component {
@State contentDTO: ContentDTO = new ContentDTO();
@
State titleShowPolicy: number | string = 1
@
Prop titleShowPolicy: number | string
@State loadImg: boolean = false;
@State clicked: boolean = false;
...
...
@@ -22,12 +22,13 @@ export struct Card5Component {
build() {
Stack() {
Image(this.loadImg ? this.contentDTO.coverUrl : '')
.backgroundColor(0xf5f5f5)
.width(CommonConstants.FULL_WIDTH)
.autoResize(true)
.borderRadius($r('app.float.image_border_radius'))
// if ((this.titleShowPolicy === 1 || this.contentDTO.titleShow === 1) && this.contentDTO.newsTitle
) {
if (this.titleShowPolicy === 1
) {
Row()
.width(CommonConstants.FULL_WIDTH)
.height(59)
...
...
@@ -41,20 +42,21 @@ export struct Card5Component {
if (this.contentDTO.objectType == '5') {
Notes({ objectType: this.contentDTO.objectType })
}
Text(this.contentDTO.newsTitle)
.width(CommonConstants.FULL_WIDTH)
// .height(CommonConstants.FULL_HEIGHT)
.width(CommonConstants.FULL_WIDTH)
.fontColor(Color.White)
.fontSize($r('app.float.normal_text_size'))
.fontWeight(FontWeight.Bold)
.maxLines(2)
.align(Alignment.TopStart)
.textIndent(this.contentDTO.objectType == '5' ?
40
: 0)
.textIndent(this.contentDTO.objectType == '5' ?
35
: 0)
}.alignContent(Alignment.TopStart)
}
.justifyContent(FlexAlign.Start)
// .height(40)
.margin({ left: 12, bottom: 10, right: 12 })
// }
}
}
.alignContent(Alignment.Bottom)
.width(CommonConstants.FULL_WIDTH)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card6Component.ets
View file @
b89908d
...
...
@@ -49,7 +49,7 @@ export struct Card6Component {
.maxLines(3)
.alignSelf(ItemAlign.Start)
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ?
60
:
.textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ?
58
:
(this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
this.contentDTO.objectType == '5' ? 30 : 0)
}.alignContent(Alignment.TopStart)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card9Component.ets
View file @
b89908d
...
...
@@ -43,8 +43,11 @@ export struct Card9Component {
topRight: $r('app.float.image_border_radius')
})
if (this.contentDTO.objectType == '5') {
Notes({ objectType: 5 })
.margin({ left: 5, bottom: 5 })
}
}.alignContent(Alignment.BottomStart)
// 时间线--后端返回三个,
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/notes.ets
View file @
b89908d
...
...
@@ -13,10 +13,10 @@ export struct Notes {
build() {
if (this.returnTypeTitleFn()) {
Text(this.returnTypeTitleFn())
.fontSize($r('app.float.font_size_1
2
'))
.fontSize($r('app.float.font_size_1
1
'))
.padding({
left: 5,
right: 5,
left: 4,
right: 4,
top: 3,
bottom: 3
})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhCarouselLayout01.ets
View file @
b89908d
...
...
@@ -214,7 +214,7 @@ struct CarouselLayout01CardView {
.align(Alignment.Bottom)
.maxLines(CompUtils.MAX_LINES_2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textIndent(this.item.objectType == '5' ?
40
: 0)
.textIndent(this.item.objectType == '5' ?
35
: 0)
}
// .height(39)
.padding({
...
...
Please
register
or
login
to post a comment