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
陈剑华
2024-09-06 10:44:58 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
319368d2804d6385a4ed1b2eca64ccd72a29af50
319368d2
1 parent
0ba9405f
fix: 19529 【UI走查-卡片】折叠屏展开-小视频卡
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
108 additions
and
48 deletions
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/cardCommon/behindDivider.ets
sight_harmony/features/wdComponent/src/main/ets/components/CardParser.ets
View file @
319368d
...
...
@@ -20,6 +20,7 @@ import { DateTimeUtils } from 'wdKit/Index';
import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
import { LiveBigImage02Component } from './cardview/LiveBigImage02Component';
import { LiveBigImage01Component } from './cardview/LiveBigImage01Component';
import { behindDivider } from './cardCommon/behindDivider'
/**
* card适配器,卡片样式汇总,依据ContentDTO#appStyle
...
...
@@ -31,6 +32,7 @@ export struct CardParser {
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State compIndex: number = 0;
@State nextCompDTO: CompDTO = new CompDTO
@ObjectLink compDTO: CompDTO
pageShowTime: number = 0;
pageHideTime: number = 0;
...
...
@@ -62,6 +64,15 @@ export struct CardParser {
}
@Builder
getBehindDivider() {
behindDivider({
compDTO: this.compDTO,
nextCompDTO: this.nextCompDTO,
compIndex: this.compIndex
})
}
@Builder
contentBuilder(contentDTO: ContentDTO) {
// Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO })
if (!!contentDTO.contentText) {
...
...
@@ -79,6 +90,7 @@ export struct CardParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
} else if (contentDTO.appStyle === CompStyle.Card_03) {
Card3Component({
compDTO: this.compDTO,
...
...
@@ -86,6 +98,7 @@ export struct CardParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
} else if (contentDTO.appStyle === CompStyle.Card_04) {
Card4Component({
compDTO: this.compDTO,
...
...
@@ -93,6 +106,7 @@ export struct CardParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
} else if (contentDTO.appStyle === CompStyle.Card_05) {
Card5Component({
compDTO: this.compDTO,
...
...
@@ -101,6 +115,7 @@ export struct CardParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
} else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle.Card_13) {
Card6Component({
compDTO: this.compDTO,
...
...
@@ -108,6 +123,7 @@ export struct CardParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
} else if (contentDTO.appStyle === CompStyle.Card_10 || contentDTO.appStyle === CompStyle.Card_09) {
Card10Component({
compDTO: this.compDTO,
...
...
@@ -115,6 +131,7 @@ export struct CardParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
} else if (contentDTO.appStyle === CompStyle.Card_11) {
Card11Component({
compDTO: this.compDTO,
...
...
@@ -122,6 +139,7 @@ export struct CardParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
} else if (contentDTO.appStyle === CompStyle.Card_12) {
Card12Component({
compDTO: this.compDTO,
...
...
@@ -129,6 +147,7 @@ export struct CardParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
} else if (contentDTO.appStyle === CompStyle.Card_14) {
Card14Component({
contentDTO,
...
...
@@ -136,6 +155,7 @@ export struct CardParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
} else if (contentDTO.appStyle === CompStyle.Card_15) {
Card15Component({
contentDTO,
...
...
@@ -143,6 +163,7 @@ export struct CardParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
} else if (contentDTO.appStyle === CompStyle.Card_16) {
Card16Component({
contentDTO,
...
...
@@ -150,6 +171,7 @@ export struct CardParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
} else if (contentDTO.appStyle === CompStyle.Card_17) {
Card17Component({
compDTO: this.compDTO,
...
...
@@ -157,6 +179,7 @@ export struct CardParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
} else if (contentDTO.appStyle === CompStyle.Card_19) {
Card19Component({
contentDTO,
...
...
@@ -164,6 +187,7 @@ export struct CardParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
} else if (contentDTO.appStyle === CompStyle.Card_20) {
Card20Component({
contentDTO,
...
...
@@ -172,6 +196,7 @@ export struct CardParser {
pageName: this.pageName,
isPeopleShipHome:this.isPeopleShipHome
})
this.getBehindDivider()
} else if (contentDTO.appStyle === CompStyle.Card_21) {
Card21Component({
contentDTO,
...
...
@@ -179,6 +204,7 @@ export struct CardParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
} else if (contentDTO.appStyle === CompStyle.Card_Comp_Live_Big_Image_01) {
LiveBigImage01Component({
contentDTO: contentDTO,
...
...
@@ -187,6 +213,7 @@ export struct CardParser {
pageName: this.pageName,
index: this.compIndex
})
this.getBehindDivider()
} else if (contentDTO.appStyle === CompStyle.Card_Comp_Live_Big_Image_02) {
LiveBigImage02Component({
contentDTO: contentDTO,
...
...
@@ -195,6 +222,7 @@ export struct CardParser {
pageName: this.pageName,
index:this.compIndex
})
this.getBehindDivider()
} else {
// todo:组件未实现 / Component Not Implemented
// Text(contentDTO.appStyle)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
View file @
319368d
import { CompDTO, ContentDTO } from 'wdBean';
import { CommonConstants, CompStyle } from 'wdConstant/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import PageModel from '../viewmodel/PageModel';
import { CardParser } from './CardParser';
import { Card2Component } from './cardview/Card2Component';
...
...
@@ -14,7 +13,6 @@ import { CompNormalTitle } from './compview/CompNormalTitle';
import { ZhGridLayout02NewsContent } from './compview/ZhGridLayout02NewsContent';
import { ZhGridLayout03 } from './compview/ZhGridLayout03';
import { ZhSingleColumn04 } from './compview/ZhSingleColumn04';
import { ZhSingleColumn05 } from './compview/ZhSingleColumn05';
import { ZhSingleColumn09 } from './compview/ZhSingleColumn09';
import { ZhSingleRow02 } from './compview/ZhSingleRow02';
import { ZhSingleRow03 } from './compview/ZhSingleRow03';
...
...
@@ -28,6 +26,7 @@ import {
} from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent';
import { LabelComponent } from './view/LabelComponent';
import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent';
import { behindDivider } from './cardCommon/behindDivider'
/**
* comp适配器.
...
...
@@ -100,47 +99,12 @@ export struct CompParser {
// }
@Builder
behindDevider() {
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})
}
} 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_03 || this.compDTO.compStyle === CompStyle.Card_Comp_Adv || this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
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').padding({ left: 16, right: 16 })
}
getBehindDivider() {
behindDivider({
compDTO: this.compDTO,
nextCompDTO: this.nextCompDTO,
compIndex: this.compIndex
})
}
@Builder
...
...
@@ -151,14 +115,17 @@ export struct CompParser {
this.compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口
if (this.compDTO.compStyle === CompStyle.Label_03) {
LabelComponent({ compDTO: this.compDTO })
this.getBehindDivider()
} else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
if (this.compDTO.operDataList.length > this.audioItems.length) {
ZhCarouselLayout01({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
}
this.getBehindDivider()
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 &&
this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡"
// Text('LiveHorizontalCardComponent')
LiveHorizontalCardComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
this.getBehindDivider()
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) {
if (this.compDTO.operDataList.length > 1) {
// Text('HorizontalStrokeCardThreeTwoRadioForMoreComponent')
...
...
@@ -175,14 +142,17 @@ export struct CompParser {
pageName: this.pageName
})
}
this.getBehindDivider()
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) {
ZhSingleRow02({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 }
)
this.getBehindDivider(
)
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) {
ZhSingleRow03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
this.getBehindDivider()
} else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题
//ZhGridLayout02({ compDTO: this.compDTO })
CompNormalTitle({ compDTO: this.compDTO })
this.getBehindDivider()
} else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡
ZhGridLayout02NewsContent({
...
...
@@ -191,16 +161,19 @@ export struct CompParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
} else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) {
ZhGridLayout03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 }
)
this.getBehindDivider(
)
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) {
ZhSingleRow04({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
this.getBehindDivider()
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05) {
// ZhSingleRow05({ compDTO })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) {
ZhSingleRow06({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
this.getBehindDivider()
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
//头图卡 和comStyle 2相同,
Card5Component({
...
...
@@ -210,6 +183,7 @@ export struct CompParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) {
// 大图卡
Card2Component({
...
...
@@ -218,6 +192,7 @@ export struct CompParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
} else if (this.compDTO.compStyle === CompStyle.Card_09) {
//时间链卡
Card9Component({
...
...
@@ -226,6 +201,7 @@ export struct CompParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
} else if (this.compDTO.compStyle === CompStyle.Card_13) {
Card6Component({
compDTO: this.compDTO,
...
...
@@ -233,6 +209,7 @@ export struct CompParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
} else if (this.compDTO.compStyle === CompStyle.Card_03) {
Card3Component({
compDTO: this.compDTO,
...
...
@@ -240,15 +217,18 @@ export struct CompParser {
pageId: this.pageId,
pageName: this.pageName
})
this.getBehindDivider()
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) {
ZhSingleColumn04({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 }
)
this.getBehindDivider(
)
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) {
// ZhSingleColumn05({ compDTO: compDTO })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) {
ZhSingleColumn09({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName, pageModel: this.pageModel, compIndex: this.compIndex })
this.getBehindDivider()
} else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告
AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO })
this.getBehindDivider()
//Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 0, right: 0 })
} else if (!Number.isNaN(Number(this.compDTO.compStyle)) || this.compDTO.compType === 'appStyle') {
CardParser({
...
...
@@ -256,7 +236,8 @@ export struct CompParser {
compDTO: this.compDTO,
pageId: this.pageId,
pageName: this.pageName,
compIndex: this.compIndex
compIndex: this.compIndex,
nextCompDTO: this.nextCompDTO
});
} else {
// Text(this.compDTO.compStyle)
...
...
@@ -269,7 +250,6 @@ export struct CompParser {
// })
}
this.behindDevider()
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/behindDivider.ets
0 → 100644
View file @
319368d
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})
}
} 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_03 || this.compDTO.compStyle === CompStyle.Card_Comp_Adv || this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
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').padding({ left: 16, right: 16 })
}
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment