陈剑华

feat: 兴趣卡埋点

... ... @@ -135,7 +135,7 @@ export struct CompParser {
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) {
Divider().strokeWidth(3).color('#ffffff').padding({ left: 0, right: 0 }).margin({ top: -3 })
Divider().strokeWidth(6).color('#f5f5f5')
ZhSingleColumn09({ compDTO: this.compDTO })
ZhSingleColumn09({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(6).color('#f5f5f5')
} else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告
AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO })
... ...
... ... @@ -5,6 +5,8 @@ import { postInteractAccentionOperateParams } from 'wdBean';
import { PageRepository } from '../../repository/PageRepository';
import { CommonConstants } from 'wdConstant/Index';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Tracking, TrackingContent, TrackConstants, ParamType } from 'wdTracking';
import { TrackingUtils } from 'wdTracking/src/main/ets/common/TrackingUtils'
/**
* 兴趣卡
* Zh_Single_Column-09
... ... @@ -14,6 +16,8 @@ const TAG = 'Zh_Single_Column-09'
@Entry
@Component
export struct ZhSingleColumn09 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
@State activeIndexs: Array<number> = []
@State operDataList: ContentDTO[] = this.compDTO?.operDataList || []
... ... @@ -25,6 +29,45 @@ export struct ZhSingleColumn09 {
this.operDataList = this.shuffleArray(this.compDTO?.operDataList)
}
trackClick(type: 'close_interest_card_click' | 'interest_card_selecting_click') {
try {
const contentDTO = this.compDTO.operDataList[0];
const extParams: ParamType = {
'value': type === 'close_interest_card_click' ? 'closeInterestCard' : 'selectInterestCard',
'shareChannel': '',
'duration': 0,
'action': 'detailPageShow',
'shareChannel': '',
'duration': 0,
'contentName': '兴趣选项卡',
'contentType': this.compDTO.objectType || '',
'contentId': this.compDTO.objectId,
// 'channelSourceId': this.compDTO.channelId,
// 'contentShowChannelId': this.compDTO.channelId,
'regionName': 2, // 信息流:2
'componentType': this.compDTO.compStyle,
'sceneId': contentDTO.sceneId,
'subSceneId': contentDTO.subSceneId,
'cnsTraceId': contentDTO.cnsTraceId,
'cardItemId': this.compDTO.cardItemId,
'itemId': this.compDTO.itemId || contentDTO.itemId,
'expIds': this.compDTO.expIds || contentDTO.expIds,
}
if (type === 'interest_card_selecting_click') {
// extParams['interestOptions'] = this.operDataList.map(item => {
// return item.
// })
}
let params = TrackingUtils.generateParams(extParams);
params['pageId'] = this.pageId;
params['pageName'] = this.pageName;
TrackingUtils.fillPositionWith(params)
Tracking.event(type, params)
} catch (e) {
console.log('Zh_Single_Column-09', JSON.stringify(e))
}
}
getItemWidth(index: number) {
if (index % 4 === 0 || index % 4 === 3) {
return 80
... ... @@ -73,6 +116,7 @@ export struct ZhSingleColumn09 {
.margin({top: -10})
.padding({top: 0, bottom: 0, left: 0, right: 0})
.onClick(() => {
this.trackClick('interest_card_selecting_click')
if (this.activeIndexs.length > 0) {
this.selfClosed = true;
}
... ... @@ -142,6 +186,7 @@ export struct ZhSingleColumn09 {
.width(14)
.height(14)
.onClick(() => {
this.trackClick('close_interest_card_click')
this.selfClosed = true;
})
}
... ...