wangliang_wd

feat:优化早晚报点击,回滚埋点处理

@@ -98,7 +98,7 @@ export struct HomePageBottomCommentComponent { @@ -98,7 +98,7 @@ export struct HomePageBottomCommentComponent {
98 .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { 98 .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
99 if (isVisible) { 99 if (isVisible) {
100 let contentDTO = getParams(item) 100 let contentDTO = getParams(item)
101 - TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal, TrackParamConvert.program(contentDTO)) 101 + // TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal, TrackParamConvert.program(contentDTO))
102 } 102 }
103 }) 103 })
104 }, (item: CommentListItem, index: number) => index.toString()) 104 }, (item: CommentListItem, index: number) => index.toString())
@@ -99,7 +99,7 @@ export struct OtherHomePageBottomCommentComponent { @@ -99,7 +99,7 @@ export struct OtherHomePageBottomCommentComponent {
99 if (isVisible) { 99 if (isVisible) {
100 let contentDTO = getParams(item) 100 let contentDTO = getParams(item)
101 //埋点crash 后面看看 101 //埋点crash 后面看看
102 - TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal, TrackParamConvert.program(contentDTO)) 102 + // TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal, TrackParamConvert.program(contentDTO))
103 } 103 }
104 }) 104 })
105 }, (item: CommentListItem, index: number) => index.toString()) 105 }, (item: CommentListItem, index: number) => index.toString())
@@ -61,6 +61,8 @@ export struct TopNavigationComponentNew { @@ -61,6 +61,8 @@ export struct TopNavigationComponentNew {
61 @State indicatorLeftMargin: number = 0 61 @State indicatorLeftMargin: number = 0
62 @State indicatorWidth: number = 0 62 @State indicatorWidth: number = 0
63 63
  64 + @State isClickMorningEveningPaper: boolean = false
  65 +
64 build() { 66 build() {
65 Column() { 67 Column() {
66 // 频道分类list 68 // 频道分类list
@@ -171,15 +173,22 @@ export struct TopNavigationComponentNew { @@ -171,15 +173,22 @@ export struct TopNavigationComponentNew {
171 .height(30) 173 .height(30)
172 .width(124) 174 .width(124)
173 .onClick(() => { 175 .onClick(() => {
  176 + //防止多次点击
  177 + if(!this.isClickMorningEveningPaper) {
  178 + this.isClickMorningEveningPaper = true;
  179 + let c = setInterval(() => {
  180 + this.isClickMorningEveningPaper = false
  181 + }, 1000);
  182 +
  183 + // 早晚报埋点
  184 + const params: ParamType = {
  185 + "pageName": this.pageName,
  186 + "pageId": this.pageId,
  187 + }
  188 + Tracking.event("morning_evening_news_click", params)
174 189
175 - // 早晚报埋点  
176 - const params: ParamType = {  
177 - "pageName": this.pageName,  
178 - "pageId": this.pageId, 190 + this.clickMorningEveningPaper()
179 } 191 }
180 - Tracking.event("morning_evening_news_click", params)  
181 -  
182 - this.clickMorningEveningPaper()  
183 }) 192 })
184 }.width('100%') 193 }.width('100%')
185 .justifyContent(FlexAlign.SpaceBetween) 194 .justifyContent(FlexAlign.SpaceBetween)
@@ -18,23 +18,23 @@ export class Tracking { @@ -18,23 +18,23 @@ export class Tracking {
18 } 18 }
19 19
20 //TODO: 添加运行单独线程? 20 //TODO: 添加运行单独线程?
21 - taskpool.execute(doTrack, eventId, params).then(() => {  
22 - Logger.error('yyyy','event track success')  
23 - }).catch(()=>{  
24 - Logger.error('yyyy','event track failed')  
25 - })  
26 -  
27 - // let publicParams = new PublicParams()  
28 - // publicParams.getPublicParams().then((pubParams) => {  
29 - //  
30 - // if (params) {  
31 - // for (const obj of Object.entries(params)) {  
32 - // // Logger.info(TAG, ` ${obj[0]} => ` + `${obj[1]}`);  
33 - // pubParams[obj[0]] = obj[1]  
34 - // }  
35 - // }  
36 - // sensors.track(eventId, pubParams) 21 + // taskpool.execute(doTrack, eventId, params).then(() => {
  22 + // Logger.error('yyyy','event track success')
  23 + // }).catch(()=>{
  24 + // Logger.error('yyyy','event track failed')
37 // }) 25 // })
  26 +
  27 + let publicParams = new PublicParams()
  28 + publicParams.getPublicParams().then((pubParams) => {
  29 +
  30 + if (params) {
  31 + for (const obj of Object.entries(params)) {
  32 + // Logger.info(TAG, ` ${obj[0]} => ` + `${obj[1]}`);
  33 + pubParams[obj[0]] = obj[1]
  34 + }
  35 + }
  36 + sensors.track(eventId, pubParams)
  37 + })
38 } 38 }
39 } 39 }
40 40