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
liyubing
2024-05-23 17:26:27 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
76068c8b55bd0d135b15dd89a67cc1b18b22eb79
76068c8b
2 parents
36b0ee75
fc4a598e
Merge remote-tracking branch 'origin/main'
Show whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
300 additions
and
55 deletions
sight_harmony/features/wdBean/src/main/ets/bean/component/CompDTO.ets
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/Card11Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card12Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card14Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card15Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card16Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card17Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card19Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card20Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card21Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card3Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card4Component.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/MoreComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/SearchContentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhCarouselLayout01.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhGridLayout02NewsContent.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhGridLayout03.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleColumn04.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleColumn05.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleRow02.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleRow03.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleRow04.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleRow05.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleRow06.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/HorizontalStrokeCardThreeTwoRadioForMoreComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/HorizontalStrokeCardThreeTwoRadioForOneComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveHorizontalCardComponent.ets
sight_harmony/features/wdComponent/src/main/ets/utils/infomationCardClick.ets
sight_harmony/features/wdBean/src/main/ets/bean/component/CompDTO.ets
View file @
76068c8
...
...
@@ -5,12 +5,15 @@ import { BaseDTO } from './BaseDTO';
@Observed
export class CompDTO implements BaseDTO {
expIds: string = '';
itemId: string = '';
contentText?: string = '';
backgroundColor: string = '';
backgroundImgUrl: string = '';
cityCode: string = '';
compStyle: string = '';
compType: string = '';
cardItemId: string = '';
// dataSourceRequest: any[];
districtCode: string = '';
extraData?: string;
...
...
@@ -44,7 +47,7 @@ export class CompDTO implements BaseDTO {
matInfo: CompAdvMatInfoBean = new CompAdvMatInfoBean
pageId?: string;
objectType?: string;
hasMore: number = 1
hasMore: number = 1
;
// keyGenerator相关字符串,用于刷新list布局
timestamp: String = '1'
...
...
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
View file @
76068c8
...
...
@@ -11,12 +11,15 @@ import { LiveRoomDataBean } from '../live/LiveRoomDataBean';
@Observed
export class ContentDTO implements BaseDTO {
expIds: string = '';
itemId: string = '';
shareFlag?: string = '1';
appStyle: string = '';
cityCode: string = '';
coverSize: string = '';
coverType: number = -1;
coverUrl: string = '';
cnsTraceId: string = ''
description: string = '';
districtCode: string = '';
endTime: string = '';
...
...
@@ -45,6 +48,8 @@ export class ContentDTO implements BaseDTO {
startTime: string = '';
subType: string = '';
subtitle: string = '';
sceneId: string = '';
subSceneId: string = '';
title: string = '';
vImageUrl: string = '';
screenType: string = '';
...
...
sight_harmony/features/wdComponent/src/main/ets/components/CardParser.ets
View file @
76068c8
...
...
@@ -23,6 +23,8 @@ import { SearchContentComponent } from './cardview/SearchContentComponent';
*/
@Component
export struct CardParser {
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@ObjectLink compDTO: CompDTO
...
...
@@ -34,39 +36,39 @@ export struct CardParser {
contentBuilder(contentDTO: ContentDTO) {
// Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO })
if (!!contentDTO.contentText) {
SearchContentComponent({ contentDTO })
SearchContentComponent({ contentDTO
, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName
})
} else {
if (contentDTO.appStyle === CompStyle.Card_02) {
Card2Component({ compDTO: this.compDTO, contentDTO })
Card2Component({ compDTO: this.compDTO, contentDTO
, pageId: this.pageId, pageName: this.pageName
})
} else if (contentDTO.appStyle === CompStyle.Card_03) {
Card3Component({ compDTO: this.compDTO, contentDTO })
Card3Component({ compDTO: this.compDTO, contentDTO
, pageId: this.pageId, pageName: this.pageName
})
} else if (contentDTO.appStyle === CompStyle.Card_04) {
Card4Component({ compDTO: this.compDTO, contentDTO })
Card4Component({ compDTO: this.compDTO, contentDTO
, pageId: this.pageId, pageName: this.pageName
})
} else if (contentDTO.appStyle === CompStyle.Card_05) {
Card5Component({ co
ntentDTO, titleShowPolicy: this.compDTO.titleShowPolicy
})
Card5Component({ co
mpDTO: this.compDTO, contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy, pageId: this.pageId, pageName: this.pageName
})
} else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle
.Card_13) {
Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO })
Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO
, pageId: this.pageId, pageName: this.pageName
})
} else if (contentDTO.appStyle === CompStyle.Card_10) {
Card10Component({ compDTO: this.compDTO, contentDTO })
Card10Component({ compDTO: this.compDTO, contentDTO
, pageId: this.pageId, pageName: this.pageName
})
} else if (contentDTO.appStyle === CompStyle.Card_11) {
Card11Component({ compDTO: this.compDTO, contentDTO })
Card11Component({ compDTO: this.compDTO, contentDTO
, pageId: this.pageId, pageName: this.pageName
})
} else if (contentDTO.appStyle === CompStyle.Card_12) {
Card12Component({ co
ntentDTO
})
Card12Component({ co
mpDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName
})
} else if (contentDTO.appStyle === CompStyle.Card_14) {
Card14Component({ contentDTO })
Card14Component({ contentDTO
, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName
})
} else if (contentDTO.appStyle === CompStyle.Card_15) {
Card15Component({ contentDTO })
Card15Component({ contentDTO
, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName
})
} else if (contentDTO.appStyle === CompStyle.Card_16) {
Card16Component({ contentDTO })
Card16Component({ contentDTO
, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName
})
} else if (contentDTO.appStyle === CompStyle.Card_17) {
Card17Component({ compDTO: this.compDTO, contentDTO })
Card17Component({ compDTO: this.compDTO, contentDTO
, pageId: this.pageId, pageName: this.pageName
})
} else if (contentDTO.appStyle === CompStyle.Card_19) {
Card19Component({ contentDTO })
Card19Component({ contentDTO
, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName
})
} else if (contentDTO.appStyle === CompStyle.Card_20) {
Card20Component({ contentDTO })
Card20Component({ contentDTO
, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName
})
} else if (contentDTO.appStyle === CompStyle.Card_21) {
Card21Component({ contentDTO })
Card21Component({ contentDTO
, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName
})
} else {
// todo:组件未实现 / Component Not Implemented
// Text(contentDTO.appStyle)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
View file @
76068c8
...
...
@@ -33,6 +33,8 @@ import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent'
*/
@Component
export struct CompParser {
@State pageId: string = '';
@State pageName: string = '';
@ObjectLink compDTO: CompDTO
@State compIndex: number = 0;
@State private pageModel: PageModel = new PageModel();
...
...
@@ -71,26 +73,26 @@ export struct CompParser {
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
if (this.compDTO.operDataList.length > this.audioItems.length) {
ZhCarouselLayout01({ compDTO: this.compDTO })
ZhCarouselLayout01({ compDTO: this.compDTO
, pageId: this.pageId, pageName: this.pageName
})
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
}
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 &&
this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡"
LiveHorizontalCardComponent({ compDTO: this.compDTO })
LiveHorizontalCardComponent({ compDTO: this.compDTO
, pageId: this.pageId, pageName: this.pageName
})
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) {
if (this.compDTO.operDataList.length > 1) {
HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: this.compDTO })
HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: this.compDTO
, pageId: this.pageId, pageName: this.pageName
})
} else {
HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: this.compDTO })
HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: this.compDTO
, pageId: this.pageId, pageName: this.pageName
})
}
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) {
ZhSingleRow02({ compDTO: this.compDTO })
ZhSingleRow02({ compDTO: this.compDTO
, pageId: this.pageId, pageName: this.pageName
})
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) {
ZhSingleRow03({ compDTO: this.compDTO })
ZhSingleRow03({ compDTO: this.compDTO
, pageId: this.pageId, pageName: this.pageName
})
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题
//ZhGridLayout02({ compDTO: this.compDTO })
...
...
@@ -98,34 +100,34 @@ export struct CompParser {
// Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡
ZhGridLayout02NewsContent({ compDTO: this.compDTO, operDataList: this.compDTO.operDataList })
ZhGridLayout02NewsContent({ compDTO: this.compDTO, operDataList: this.compDTO.operDataList
, pageId: this.pageId, pageName: this.pageName
})
} else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) {
ZhGridLayout03({ compDTO: this.compDTO })
ZhGridLayout03({ compDTO: this.compDTO
, pageId: this.pageId, pageName: this.pageName
})
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) {
ZhSingleRow04({ compDTO: this.compDTO })
ZhSingleRow04({ compDTO: this.compDTO
, pageId: this.pageId, pageName: this.pageName
})
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05) {
// ZhSingleRow05({ compDTO })
// Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) {
ZhSingleRow06({ compDTO: this.compDTO })
ZhSingleRow06({ compDTO: this.compDTO
, pageId: this.pageId, pageName: this.pageName
})
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
//头图卡 和comStyle 2相同,
Card5Component({ co
ntentDTO: this.compDTO.operDataList[0], titleShowPolicy: this.compDTO.titleShowPolicy
})
Card5Component({ co
mpDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0], titleShowPolicy: this.compDTO.titleShowPolicy, pageId: this.pageId, pageName: this.pageName
})
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) {
// 大图卡
Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0] })
Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0]
, pageId: this.pageId, pageName: this.pageName
})
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Card_09) {
//时间链卡
Card9Component({ co
ntentDTO:this.compDTO.operDataList[0]
})
Card9Component({ co
mpDTO: this.compDTO, contentDTO:this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName
})
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) {
ZhSingleColumn04({ compDTO: this.compDTO })
ZhSingleColumn04({ compDTO: this.compDTO
, pageId: this.pageId, pageName: this.pageName
})
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) {
// ZhSingleColumn05({ compDTO: compDTO })
...
...
@@ -140,7 +142,7 @@ export struct CompParser {
//Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 0, right: 0 })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (!Number.isNaN(Number(this.compDTO.compStyle))) {
CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO });
CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO
, pageId: this.pageId, pageName: this.pageName
});
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else {
// Text(this.compDTO.compStyle)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card10Component.ets
View file @
76068c8
...
...
@@ -5,6 +5,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { Notes } from './notes';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick'
/**
* 大专题卡--CompStyle: 10
...
...
@@ -14,6 +15,8 @@ const TAG: string = 'Card10Component';
@Preview
@Component
export struct Card10Component {
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@ObjectLink compDTO: CompDTO
...
...
@@ -57,6 +60,7 @@ export struct Card10Component {
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({ bottom: 19 })
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
ProcessUtils.processPage(this.contentDTO)
})
}
...
...
@@ -70,6 +74,7 @@ export struct Card10Component {
topRight: $r('app.float.image_border_radius')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
ProcessUtils.processPage(this.contentDTO)
})
if (this.contentDTO.objectType == '5') {
...
...
@@ -102,6 +107,7 @@ export struct Card10Component {
.justifyContent(FlexAlign.Center)
.margin({ top: 5 })
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
ProcessUtils.processPage(this.contentDTO)
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card11Component.ets
View file @
76068c8
...
...
@@ -6,6 +6,7 @@ import { ProcessUtils } from 'wdRouter';
import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { Notes } from './notes';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Card11Component';
...
...
@@ -14,6 +15,8 @@ const TAG = 'Card11Component';
*/
@Component
export struct Card11Component {
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State clicked: boolean = false;
@ObjectLink compDTO: CompDTO
...
...
@@ -78,6 +81,7 @@ export struct Card11Component {
})
.backgroundColor($r("app.color.white"))
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card12Component.ets
View file @
76068c8
import { ContentDTO } from 'wdBean';
import { ContentDTO
, CompDTO
} from 'wdBean';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter';
import {CarderInteraction} from '../CarderInteraction'
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Card12Component';
...
...
@@ -13,6 +14,9 @@ const TAG = 'Card12Component';
*/
@Component
export struct Card12Component {
@ObjectLink compDTO: CompDTO
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State clicked: boolean = false;
@State titleMarked: boolean = false;
...
...
@@ -70,6 +74,7 @@ export struct Card12Component {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card14Component.ets
View file @
76068c8
import { ContentDTO } from 'wdBean';
import { ContentDTO
, CompDTO
} from 'wdBean';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CommonConstants } from 'wdConstant/Index';
...
...
@@ -6,6 +6,7 @@ import { ProcessUtils } from 'wdRouter';
import {CarderInteraction} from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Card14Component';
...
...
@@ -14,6 +15,9 @@ const TAG = 'Card14Component';
*/
@Component
export struct Card14Component {
@ObjectLink compDTO: CompDTO
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
...
...
@@ -89,6 +93,7 @@ export struct Card14Component {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card15Component.ets
View file @
76068c8
import { ContentDTO } from 'wdBean';
import { ContentDTO
, CompDTO
} from 'wdBean';
import { ProcessUtils } from 'wdRouter';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
...
...
@@ -6,6 +6,7 @@ import { CommonConstants } from 'wdConstant/Index';
import {CarderInteraction} from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG: string = 'Card15Component';
...
...
@@ -18,6 +19,9 @@ const TAG: string = 'Card15Component';
*/
@Component
export struct Card15Component {
@ObjectLink compDTO: CompDTO
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
...
...
@@ -87,6 +91,7 @@ export struct Card15Component {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card16Component.ets
View file @
76068c8
import { ContentDTO } from 'wdBean';
import { ContentDTO
, CompDTO
} from 'wdBean';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CommonConstants } from 'wdConstant/Index';
...
...
@@ -6,6 +6,7 @@ import { ProcessUtils } from 'wdRouter';
import {CarderInteraction} from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Card16Component';
...
...
@@ -19,6 +20,9 @@ interface fullColumnImgUrlItem {
*/
@Component
export struct Card16Component {
@ObjectLink compDTO: CompDTO
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
...
...
@@ -88,6 +92,7 @@ export struct Card16Component {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card17Component.ets
View file @
76068c8
...
...
@@ -6,6 +6,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Card17Component';
...
...
@@ -14,6 +15,8 @@ const TAG = 'Card17Component';
*/
@Component
export struct Card17Component {
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
...
...
@@ -106,6 +109,7 @@ export struct Card17Component {
}
.width(CommonConstants.FULL_WIDTH)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
let taskAction: Action = {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card19Component.ets
View file @
76068c8
import { ContentDTO, FullColumnImgUrlDTO, PhotoListBean } from 'wdBean';
import { ContentDTO, FullColumnImgUrlDTO, PhotoListBean
, CompDTO
} from 'wdBean';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { ProcessUtils } from 'wdRouter';
import { CommonConstants } from 'wdConstant/Index';
import { CarderInteraction } from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Card19Component';
...
...
@@ -13,6 +14,9 @@ const TAG = 'Card19Component';
*/
@Component
export struct Card19Component {
@ObjectLink compDTO: CompDTO
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO()
@State clicked: boolean = false;
@State titleMarked: boolean = false;
...
...
@@ -58,6 +62,7 @@ export struct Card19Component {
.width(CommonConstants.FULL_WIDTH)
.lineHeight(25)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
ProcessUtils.processPage(this.contentDTO)
})
...
...
@@ -75,6 +80,7 @@ export struct Card19Component {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card20Component.ets
View file @
76068c8
import { ContentDTO } from 'wdBean';
import { ContentDTO
, CompDTO
} from 'wdBean';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CommonConstants } from 'wdConstant/Index';
...
...
@@ -6,6 +6,7 @@ import { ProcessUtils } from 'wdRouter';
import {CarderInteraction} from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Card20Component';
...
...
@@ -14,6 +15,9 @@ const TAG = 'Card20Component';
*/
@Component
export struct Card20Component {
@ObjectLink compDTO: CompDTO
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State clicked: boolean = false;
@State titleMarked: boolean = false;
...
...
@@ -72,6 +76,7 @@ export struct Card20Component {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
...
...
@@ -98,7 +103,7 @@ struct createImg {
build() {
GridRow() {
if (this.contentDTO.fullColumnImgUrls[0].landscape === 1) {
if (this.contentDTO.fullColumnImgUrls[0].landscape === 1
|| this.contentDTO.fullColumnImgUrls[0].weight > this.contentDTO.fullColumnImgUrls[0].height
) {
// 横屏
GridCol({
span: { xs: 12 }
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card21Component.ets
View file @
76068c8
import { ContentDTO } from 'wdBean';
import { ContentDTO
, CompDTO
} from 'wdBean';
import { CommonConstants, CompStyle } from 'wdConstant';
import { ProcessUtils } from 'wdRouter';
import { RmhTitle } from '../cardCommon/RmhTitle'
...
...
@@ -6,6 +6,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import {CarderInteraction} from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG: string = 'Card6Component-Card13Component';
...
...
@@ -14,6 +15,9 @@ const TAG: string = 'Card6Component-Card13Component';
*/
@Component
export struct Card21Component {
@ObjectLink compDTO: CompDTO
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
...
...
@@ -80,6 +84,7 @@ export struct Card21Component {
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
View file @
76068c8
...
...
@@ -6,8 +6,9 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { Notes } from './notes';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick';
const TAG: string = 'Card2Component';
/**
...
...
@@ -19,6 +20,8 @@ const TAG: string = 'Card2Component';
*/
@Component
export struct Card2Component {
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
...
...
@@ -111,6 +114,7 @@ export struct Card2Component {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card3Component.ets
View file @
76068c8
...
...
@@ -4,6 +4,8 @@ import { ProcessUtils } from 'wdRouter';
import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { Notes } from './notes';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
/**
* 卡片样式:"appStyle":"3"
...
...
@@ -11,6 +13,8 @@ import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
*/
@Component
export struct Card3Component {
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State clicked: boolean = false;
@ObjectLink compDTO: CompDTO
...
...
@@ -71,6 +75,7 @@ export struct Card3Component {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card4Component.ets
View file @
76068c8
...
...
@@ -6,6 +6,8 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Notes } from './notes';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG: string = 'Card4Component';
/**
...
...
@@ -17,6 +19,8 @@ const TAG: string = 'Card4Component';
*/
@Component
export struct Card4Component {
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
...
...
@@ -106,6 +110,7 @@ export struct Card4Component {
.justifyContent(FlexAlign.Start)
.alignItems(HorizontalAlign.Start)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card5Component.ets
View file @
76068c8
...
...
@@ -4,6 +4,8 @@ import { ProcessUtils } from 'wdRouter';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Notes } from './notes';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG: string = 'Card5Component';
...
...
@@ -12,7 +14,10 @@ const TAG: string = 'Card5Component';
*/
@Component
export struct Card5Component {
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@ObjectLink compDTO: CompDTO
@Prop titleShowPolicy: number | string
@State loadImg: boolean = false;
@State clicked: boolean = false;
...
...
@@ -96,6 +101,7 @@ export struct Card5Component {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card6Component.ets
View file @
76068c8
...
...
@@ -7,6 +7,7 @@ import { Notes } from './notes';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Logger } from 'wdKit/Index';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG: string = 'Card6Component-Card13Component';
...
...
@@ -15,6 +16,8 @@ const TAG: string = 'Card6Component-Card13Component';
*/
@Component
export struct Card6Component {
@State pageId: string = '';
@State pageName: string = '';
@State loadImg: boolean = false;
@State clicked: boolean = false;
@State titleMarked: boolean = false;
...
...
@@ -104,6 +107,7 @@ export struct Card6Component {
}
}
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card9Component.ets
View file @
76068c8
import { ContentDTO, slideShows } from 'wdBean';
import { ContentDTO, slideShows
, CompDTO
} from 'wdBean';
import { CommonConstants } from 'wdConstant';
import { DateTimeUtils } from 'wdKit';
import { ProcessUtils } from 'wdRouter';
import { Notes } from './notes';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
/**
* 时间链卡--CompStyle: 09
...
...
@@ -13,6 +14,9 @@ const TAG: string = 'Card9Component';
@Component
export struct Card9Component {
@ObjectLink compDTO: CompDTO
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
// @State loadImg: boolean = true;
@State clicked: boolean = false;
...
...
@@ -22,6 +26,7 @@ export struct Card9Component {
@State str03: string = '';
async aboutToAppear(): Promise<void> {
console.log('Card9Component', JSON.stringify(this.contentDTO))
this.titleInit();
// this.loadImg = await onlyWifiLoadImg();
this.clicked = hasClicked(this.contentDTO.objectId)
...
...
@@ -112,6 +117,7 @@ export struct Card9Component {
.backgroundColor($r("app.color.white"))
.margin({ bottom: 8 })
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/MoreComponent.ets
View file @
76068c8
/**
* More_Comp
*/
import { ContentDTO } from 'wdBean/Index';
const TAG: string = 'Card9Component';
const TAG: string = 'More_Comp';
@Entry
@Component
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/SearchContentComponent.ets
View file @
76068c8
...
...
@@ -4,6 +4,8 @@ import { ProcessUtils } from 'wdRouter';
import { CardSourceInfo } from '../cardCommon/CardSourceInfo'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG: string = 'Card4Component';
/**
...
...
@@ -11,6 +13,9 @@ const TAG: string = 'Card4Component';
*/
@Component
export struct SearchContentComponent {
@ObjectLink compDTO: CompDTO
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
...
...
@@ -57,6 +62,7 @@ export struct SearchContentComponent {
.justifyContent(FlexAlign.Start)
.alignItems(HorizontalAlign.Start)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
ProcessUtils.processPage(this.contentDTO)
})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhCarouselLayout01.ets
View file @
76068c8
...
...
@@ -7,6 +7,7 @@ import { EmptyComponent } from '../view/EmptyComponent';
import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Notes } from '../cardview/notes';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Zh_Carousel_Layout-01';
...
...
@@ -41,6 +42,8 @@ class MyDataSource implements IDataSource {
@Component
export struct ZhCarouselLayout01 {
@State pageId: string = '';
@State pageName: string = '';
@StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string =
BreakpointConstants.BREAKPOINT_XS;
@State compDTO: CompDTO = {} as CompDTO
...
...
@@ -149,6 +152,7 @@ export struct ZhCarouselLayout01 {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[this.swiperIndex], this.pageId, this.pageName)
Logger.info(TAG, `ZhCarouselLayout01 onClick event index: ${this.swiperIndex}`);
ProcessUtils.processPage(this.compDTO.operDataList[this.swiperIndex])
})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhGridLayout02NewsContent.ets
View file @
76068c8
...
...
@@ -4,6 +4,7 @@ import { Logger } from 'wdKit/Index';
import { ProcessUtils } from 'wdRouter';
import PageViewModel from '../../viewmodel/PageViewModel';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick'
let listSize: number = 2;
...
...
@@ -13,6 +14,8 @@ let listSize: number = 2;
*/
@Component
export struct ZhGridLayout02NewsContent {
@State pageId: string = '';
@State pageName: string = '';
@ObjectLink compDTO: CompDTO
@State operDataList: ContentDTO[] = []
@State loadImg: boolean = false;
...
...
@@ -74,6 +77,7 @@ export struct ZhGridLayout02NewsContent {
}
.width('100%')
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
ProcessUtils.processPage(item)
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhGridLayout03.ets
View file @
76068c8
...
...
@@ -4,6 +4,7 @@ import { Logger } from 'wdKit';
import { WDRouterRule } from 'wdRouter';
import { ProcessUtils } from 'wdRouter';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Zh_Grid_Layout-03';
const FULL_PARENT: string = '100%';
...
...
@@ -18,6 +19,8 @@ let listSize: number = 4;
@Preview
@Component
export struct ZhGridLayout03 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
@State loadImg: boolean = false;
...
...
@@ -73,6 +76,7 @@ export struct ZhGridLayout03 {
}
.width('100%')
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
if (item.objectType === '11') {
ProcessUtils.jumpChannelTab(item.objectId, item.pageId, item.newsTitle)
} else {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleColumn04.ets
View file @
76068c8
import { CompDTO, ContentDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant';
import { ProcessUtils } from 'wdRouter';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Zh_Single_Column-04';
...
...
@@ -10,6 +11,8 @@ const TAG = 'Zh_Single_Column-04';
*/
@Component
export struct ZhSingleColumn04 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
operDataList: ContentDTO[] = [
// {newsTitle: "民检普法课堂:正当防卫是什么正当防卫是什么正当防卫是什么正当防卫是什么?", tagWord: 1} as ContentDTO,
...
...
@@ -83,6 +86,7 @@ export struct ZhSingleColumn04 {
.backgroundImage($r('app.media.rmh_theme_bg'))
.backgroundImageSize({ width: CommonConstants.FULL_WIDTH, height: CommonConstants.FULL_WIDTH })
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
ProcessUtils.processPage(item)
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleColumn05.ets
View file @
76068c8
import { CommonConstants } from 'wdConstant';
import { Action, CompDTO, Params } from 'wdBean';
import { WDRouterRule } from 'wdRouter';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Zh_Single_Column-05';
...
...
@@ -10,6 +11,8 @@ const TAG = 'Zh_Single_Column-05';
*/
@Component
export struct ZhSingleColumn05 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
build() {
...
...
@@ -29,6 +32,7 @@ export struct ZhSingleColumn05 {
.justifyContent(FlexAlign.Center)
.borderRadius($r('app.float.button_border_radius'))
.onClick(() => {
// InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
params: {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleRow02.ets
View file @
76068c8
...
...
@@ -6,6 +6,7 @@ import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter';
import { HttpUtils } from 'wdNetwork/Index';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick'
/**
* 小视频横划卡
...
...
@@ -15,6 +16,8 @@ const TAG = 'Zh_Single_Row-02'
@Component
export struct ZhSingleRow02 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
build() {
...
...
@@ -26,7 +29,11 @@ export struct ZhSingleRow02 {
List() {
ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
CreatorItem({
item
item,
index,
compDTO: this.compDTO,
pageId: this.pageId,
pageName: this.pageName
})
.margin({right: index === this.compDTO.operDataList.length - 1 ? $r('app.float.card_comp_pagePadding_lf') : 0})
})
...
...
@@ -69,11 +76,6 @@ export struct ZhSingleRow02 {
Image($r("app.media.more"))
.width(14)
.height(14)
.onClick(() => {
// TODO 跳转的页面,定义的入参可能不合理。推荐id: 41
let params = {'index': "1"} as Record<string, string>
WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params)
})
}
.padding({
right: $r('app.float.card_comp_pagePadding_lf'),
...
...
@@ -103,7 +105,11 @@ function textOverflowStyle(maxLine: number) {
@Component
struct CreatorItem {
@Prop pageId: string = '';
@Prop pageName: string = '';
@Prop compDTO: CompDTO
@Prop item: ContentDTO
@Prop index: number
@State rmhIsAttention: number = 0
@State loadImg: boolean = false;
...
...
@@ -143,6 +149,7 @@ struct CreatorItem {
.borderRadius($r('app.float.image_border_radius'))
}
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.item, this.pageId, this.pageName)
ProcessUtils.processPage(this.item)
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleRow03.ets
View file @
76068c8
...
...
@@ -9,6 +9,7 @@ import { LiveModel } from '../../viewmodel/LiveModel'
import { Logger, ToastUtils } from 'wdKit';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { SpConstants } from 'wdConstant/Index'
import { InfomationCardClick } from '../../utils/infomationCardClick';
/**
* 直播预约卡
...
...
@@ -25,6 +26,8 @@ interface reserveReqItem {
@Entry
@Component
export struct ZhSingleRow03 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
@State isEndEdge: boolean = false;
// @State reserveStatus: reserveItem[] = []
...
...
@@ -197,6 +200,7 @@ export struct ZhSingleRow03 {
.backgroundColor(0xf9f9f9)
.margin({right: 8})
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
ProcessUtils.processPage(item)
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleRow04.ets
View file @
76068c8
...
...
@@ -2,6 +2,7 @@ import { CompDTO, ContentDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant';
import { DateTimeUtils } from 'wdKit';
import { ProcessUtils } from 'wdRouter';
import { InfomationCardClick } from '../../utils/infomationCardClick';
/**
* 本地精选卡
...
...
@@ -10,6 +11,8 @@ import { ProcessUtils } from 'wdRouter';
@Component
export struct ZhSingleRow04 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
build() {
...
...
@@ -71,6 +74,7 @@ export struct ZhSingleRow04 {
top: 6
})
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
ProcessUtils.processPage(item)
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleRow05.ets
View file @
76068c8
...
...
@@ -4,6 +4,7 @@ import { postInteractAccentionOperateParams } from 'wdBean';
import { PageRepository } from '../../repository/PageRepository';
import { CommonConstants } from 'wdConstant/Index';
import { HttpUtils } from 'wdNetwork/Index';
import { InfomationCardClick } from '../../utils/infomationCardClick';
/**
* 人民号横划卡
...
...
@@ -14,6 +15,8 @@ const TAG = 'Zh_Single_Row-05'
@Entry
@Component
export struct ZhSingleRow05 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {
// objectTitle: '创作者推荐',
// operDataList: [
...
...
@@ -83,8 +86,8 @@ export struct ZhSingleRow05 {
.height(14)
.onClick(() => {
// TODO 跳转的页面,定义的入参可能不合理。推荐id: 41
let params = {'index': "1"} as Record<string, string>;
WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params)
// let params = {'index': "1"} as Record<string, string>;
// WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params)
})
}
.padding({
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleRow06.ets
View file @
76068c8
...
...
@@ -10,6 +10,7 @@ import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailV
import commentViewModel from '../../components/comment/viewmodel/CommentViewModel';
import { commentItemModel } from '../../components/comment/model/CommentModel'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick';
/**
* 精选评论卡
...
...
@@ -19,6 +20,8 @@ const TAG = 'Zh_Single_Row-06'
@Entry
@Component
export struct ZhSingleRow06 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
@State newsStatusOfUser: batchLikeAndCollectResult = {
likeStatus: '0'
...
...
@@ -143,8 +146,6 @@ export struct ZhSingleRow06 {
Text(Number(this.newsStatusOfUser?.likeStatus) == 1 ? '已赞' : '点赞')
.fontSize(15)
.fontColor(0x999999)
.onClick(() => {
})
}
.onClick(() => {
this.toggleLikeStatus()
...
...
@@ -160,6 +161,9 @@ export struct ZhSingleRow06 {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor($r('app.color.white'))
.onClick(() => {
InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[0], this.pageId, this.pageName)
})
}
@Builder
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/HorizontalStrokeCardThreeTwoRadioForMoreComponent.ets
View file @
76068c8
import { CommonConstants } from 'wdConstant'
import { ContentDTO, CompDTO, Action, Params } from 'wdBean'
import { ProcessUtils, WDRouterRule, WDRouterPage } from 'wdRouter';
import { InfomationCardClick } from '../../utils/infomationCardClick';
@Component
export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
@State compDTO: CompDTO = {} as CompDTO
@State pageId: string = '';
@State pageName: string = '';
build() {
Column() {
...
...
@@ -76,6 +79,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
.padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 })
// .offset({x:16})
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
ProcessUtils.processPage(item)
})
})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/HorizontalStrokeCardThreeTwoRadioForOneComponent.ets
View file @
76068c8
...
...
@@ -3,9 +3,12 @@ import { WDRouterRule } from 'wdRouter/Index'
import { Logger } from 'wdKit/Index'
import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'
import { LiveModel } from '../../viewmodel/LiveModel'
import { InfomationCardClick } from '../../utils/infomationCardClick';
@Component
export struct HorizontalStrokeCardThreeTwoRadioForOneComponent {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
@State clicked: boolean = false;
...
...
@@ -64,6 +67,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent {
.backgroundColor($r("app.color.white"))
.margin({ bottom: 8 })
.onClick(() => {
InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[0], this.pageId, this.pageName)
this.clicked = true;
this.gotoLive(this.compDTO?.operDataList[0])
})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveHorizontalCardComponent.ets
View file @
76068c8
...
...
@@ -9,10 +9,13 @@ import { LiveModel } from '../../viewmodel/LiveModel'
import { ContentConstants } from '../../constants/ContentConstants'
import { ProcessUtils } from 'wdRouter';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick';
@Component
export struct LiveHorizontalCardComponent {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
@State loadImg: boolean = false;
...
...
@@ -95,6 +98,7 @@ export struct LiveHorizontalCardComponent {
}
.padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 })
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
if (item.objectType != '0') {
console.log(item.objectId)
this.gotoLive(item)
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/infomationCardClick.ets
0 → 100644
View file @
76068c8
import { TrackingContent, TrackConstants, ParamType } from 'wdTracking';
import { CompDTO, ContentDTO } from 'wdBean';
export class InfomationCardClick {
private static getLiveState(contentDTO: ContentDTO) {
if (contentDTO?.liveInfo?.liveState === 'wait') {
return 'liveSubscribe'
} else if (contentDTO?.liveInfo?.liveState === 'running') {
return 'livePlaying'
} else if (contentDTO?.liveInfo?.liveState === 'end') {
return 'liveEnd'
} else {
return ''
}
}
private static getSummaryType(objectType: string) {
let summaryType: string = ''
switch(objectType) {
case '2':
summaryType = 'liveTopic';
break;
case '8':
summaryType = 'articleTopic';
break;
case '13':
summaryType = 'audioTopic';
break;
// case '':
// summaryType = 'talkTopic';
// break;
// case '':
// summaryType = 'morningAndEveningNewsTopic';
// break;
// case '':
// summaryType = 'timeAxisTopic';
// break;
default:
summaryType = '';
break;
}
return summaryType;
}
public static track(compDTO: CompDTO, contentDTO: ContentDTO, pageId: string, pageName: string): void {
try {
const extParams: ParamType = {
'action': 'detailPageShow',
'shareChannel': '',
'duration': 0,
'contentName': contentDTO.newsTitle,
'contentType': contentDTO.objectType,
// 'contentClassify': '' // 废除
'contentId': contentDTO.objectId,
// 'compId': contentDTO.relId,
'contentStyle': contentDTO.appStyle,
'liveType': InfomationCardClick.getLiveState(contentDTO),
'channelSourceId': contentDTO.channelId,
'contentShowChannelId': contentDTO.channelId,
// 'contentShowChannelName': '',
'linkUrl': contentDTO.linkUrl,
'regionName': 2, // 信息流:2
'componentType': compDTO.compStyle,
'sceneId': contentDTO.sceneId,
'subSceneId': contentDTO.subSceneId,
'cnsTraceId': contentDTO.cnsTraceId,
'cardItemId': compDTO.cardItemId,
'itemId': compDTO.itemId || contentDTO.itemId,
'expIds': compDTO.expIds || contentDTO.expIds
}
if (contentDTO.objectType === '5') {
extParams['summaryId'] = contentDTO.objectId;
extParams['summaryType'] = InfomationCardClick.getSummaryType(contentDTO.objectType);
extParams['specialLink'] = contentDTO.linkUrl;
}
if (contentDTO.objectType === '2') {
extParams['liveStreamType'] = contentDTO?.liveInfo.vrType === 0 ? 1 : 2;
extParams['vliveId'] = contentDTO.objectId;
extParams['vliveName'] = contentDTO.newsTitle;
extParams['liveMode'] = 1;
}
if (contentDTO.rmhPlatform === 1) {
extParams['saAuthorName'] = contentDTO.rmhInfo?.rmhName;
extParams['saAuthorId'] = contentDTO.rmhInfo?.rmhId;
} else if (contentDTO.source) {
extParams['saAuthorName'] = contentDTO.source;
}
console.log('InfomationCardClick-params:', JSON.stringify(extParams))
TrackingContent.common(TrackConstants.EventType.Click, pageId, pageName, extParams)
} catch (err) {
console.log('InfomationCardClick-err', JSON.stringify(err))
}
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment