liyubing

Merge remote-tracking branch 'origin/main'

@@ -32,8 +32,8 @@ export class HttpBizUtil { @@ -32,8 +32,8 @@ export class HttpBizUtil {
32 if (!headers) { 32 if (!headers) {
33 headers = new HashMap() 33 headers = new HashMap()
34 } 34 }
35 - headers?.replace('RMRB-X-TOKEN', token)  
36 - headers?.replace('cookie', 'RMRB-X-TOKEN=' + token) 35 + headers?.set('RMRB-X-TOKEN', token)
  36 + headers?.set('cookie', 'RMRB-X-TOKEN=' + token)
37 Logger.debug(TAG, 'get again send: ' + token) 37 Logger.debug(TAG, 'get again send: ' + token)
38 // refreshToken为空场景不处理,直接请求接口。 38 // refreshToken为空场景不处理,直接请求接口。
39 WDHttp.get<T>(url, headers).then((againResDTO: T) => { 39 WDHttp.get<T>(url, headers).then((againResDTO: T) => {
@@ -71,8 +71,8 @@ export class HttpBizUtil { @@ -71,8 +71,8 @@ export class HttpBizUtil {
71 if (!headers) { 71 if (!headers) {
72 headers = new HashMap() 72 headers = new HashMap()
73 } 73 }
74 - headers?.replace('RMRB-X-TOKEN', token)  
75 - headers?.replace('cookie', 'RMRB-X-TOKEN=' + token) 74 + headers?.set('RMRB-X-TOKEN', token)
  75 + headers?.set('cookie', 'RMRB-X-TOKEN=' + token)
76 Logger.debug(TAG, 'post again send: ' + token) 76 Logger.debug(TAG, 'post again send: ' + token)
77 // refreshToken为空场景不处理,直接请求接口。 77 // refreshToken为空场景不处理,直接请求接口。
78 WDHttp.post<T>(url, data, headers).then((againResDTO: T) => { 78 WDHttp.post<T>(url, data, headers).then((againResDTO: T) => {
@@ -10,6 +10,7 @@ import { Logger, ToastUtils } from 'wdKit'; @@ -10,6 +10,7 @@ import { Logger, ToastUtils } from 'wdKit';
10 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 10 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
11 import { SpConstants } from 'wdConstant/Index' 11 import { SpConstants } from 'wdConstant/Index'
12 import { InfomationCardClick } from '../../utils/infomationCardClick'; 12 import { InfomationCardClick } from '../../utils/infomationCardClick';
  13 +import { ParamType, Tracking } from 'wdTracking/Index';
13 14
14 /** 15 /**
15 * 直播预约卡 16 * 直播预约卡
@@ -17,7 +18,17 @@ import { InfomationCardClick } from '../../utils/infomationCardClick'; @@ -17,7 +18,17 @@ import { InfomationCardClick } from '../../utils/infomationCardClick';
17 */ 18 */
18 const TAG = 'Zh_Single_Row-03' 19 const TAG = 'Zh_Single_Row-03'
19 20
20 - 21 +function getLiveState(contentDTO: ContentDTO) {
  22 + if (contentDTO?.liveInfo?.liveState === 'wait') {
  23 + return 'liveSubscribe'
  24 + } else if (contentDTO?.liveInfo?.liveState === 'running') {
  25 + return 'livePlaying'
  26 + } else if (contentDTO?.liveInfo?.liveState === 'end') {
  27 + return 'liveEnd'
  28 + } else {
  29 + return ''
  30 + }
  31 +}
21 interface reserveReqItem { 32 interface reserveReqItem {
22 liveId: string, 33 liveId: string,
23 relationId: string, 34 relationId: string,
@@ -255,7 +266,27 @@ export struct ZhSingleRow03 { @@ -255,7 +266,27 @@ export struct ZhSingleRow03 {
255 .textAlign(TextAlign.Center) 266 .textAlign(TextAlign.Center)
256 .borderRadius(3) 267 .borderRadius(3)
257 .onClick(() => { 268 .onClick(() => {
258 - this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId))) 269 + const isSubscribe = !this.isReserved(Number(item.objectId))
  270 +
  271 + // 直播预约埋点
  272 + const params: ParamType = {
  273 + 'contentName': item.newsTitle,
  274 + 'contentType': item.objectType,
  275 + "liveStreamType": item?.liveInfo.vrType === 0 ? 1 : 2,
  276 + "vliveId": item.objectId,
  277 + "vliveName": item.newsTitle,
  278 + "contentId": item.objectId,
  279 + "compId": item.relId,
  280 + "contentStyle": item.appStyle,
  281 + "liveType": getLiveState(item),
  282 + 'contentShowChannelId': item.channelId,
  283 + 'linkUrl': item.linkUrl,
  284 + "pageId": this.pageId,
  285 + "pageName": '直播',
  286 + }
  287 + Logger.info(TAG, `直播预约埋点: ${JSON.stringify(params)}`);
  288 + Tracking.event(isSubscribe? "live_subscribe_click": "cancel_live_subscribe_click", params)
  289 + this.bookAndCancel(item.relId, item.objectId, isSubscribe)
259 }) 290 })
260 291
261 } 292 }
@@ -45,7 +45,7 @@ export struct TopNavigationComponentNew { @@ -45,7 +45,7 @@ export struct TopNavigationComponentNew {
45 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 45 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
46 @Link _currentNavIndex?: number; 46 @Link _currentNavIndex?: number;
47 // 顶导当前选中/焦点下标 47 // 顶导当前选中/焦点下标
48 - @State currentTopNavSelectedIndex: number = 0; 48 + @State @Watch('updateCurrentTopNavSelectedIndex') currentTopNavSelectedIndex: number = 0;
49 // 顶导数据 49 // 顶导数据
50 @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = [] 50 @State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = []
51 @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 51 @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002
@@ -114,20 +114,6 @@ export struct TopNavigationComponentNew { @@ -114,20 +114,6 @@ export struct TopNavigationComponentNew {
114 .onChange((index) => { 114 .onChange((index) => {
115 Logger.info(TAG, `onChange index : ${index}`); 115 Logger.info(TAG, `onChange index : ${index}`);
116 116
117 - // 顶部tab埋点  
118 - if(this.currentBottomNavName === '新闻') {  
119 - const tab = this.myChannelList[index]  
120 - Logger.info(TAG, `顶部tab : ${JSON.stringify(tab)}`);  
121 -  
122 - const params: ParamType = {  
123 - "pageName": tab.name,  
124 - "tabName": tab.name,  
125 - "pageId": tab.pageId,  
126 - }  
127 - Tracking.event("home_page_tab_click ", params)  
128 - }  
129 -  
130 -  
131 if (this.isBroadcastByIndex(index)) { 117 if (this.isBroadcastByIndex(index)) {
132 // 跳转到播报页面 118 // 跳转到播报页面
133 ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) 119 ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
@@ -217,6 +203,7 @@ export struct TopNavigationComponentNew { @@ -217,6 +203,7 @@ export struct TopNavigationComponentNew {
217 moreChannelList: $moreChannelList, 203 moreChannelList: $moreChannelList,
218 localChannelList: $localChannelList, 204 localChannelList: $localChannelList,
219 changeTab: (index) => { 205 changeTab: (index) => {
  206 +
220 this.changePage(index) 207 this.changePage(index)
221 } 208 }
222 }) 209 })
@@ -496,6 +483,32 @@ export struct TopNavigationComponentNew { @@ -496,6 +483,32 @@ export struct TopNavigationComponentNew {
496 `onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`); 483 `onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`);
497 } 484 }
498 485
  486 + updateCurrentTopNavSelectedIndex() {
  487 + Logger.info(TAG, `currentTopNavSelectedIndex : ${this.currentTopNavSelectedIndex}、${this.currentBottomNavName}`);
  488 +
  489 + // 顶部tab埋点
  490 + if(this.currentBottomNavName === '新闻') {
  491 + const tab = this.myChannelList[this.currentTopNavSelectedIndex]
  492 + Logger.info(TAG, `新闻tab埋点: ${JSON.stringify(tab)}`);
  493 +
  494 + const params: ParamType = {
  495 + "pageName": tab.name,
  496 + "tabName": tab.name,
  497 + "pageId": tab.pageId,
  498 + }
  499 + Tracking.event("home_page_tab_click ", params)
  500 + } else if(this.currentBottomNavName === '人民号') {
  501 + const tab = this.topNavList[this.currentTopNavSelectedIndex]
  502 + Logger.info(TAG, `人民号tab埋点: ${JSON.stringify(tab)}`);
  503 +
  504 + const params: ParamType = {
  505 + "pageName": tab.name,
  506 + "tabName": tab.name,
  507 + "pageId": tab.pageId,
  508 + }
  509 + Tracking.event("People_account_page_tab_click", params)
  510 + }
  511 + }
499 onAutoRefresh() { 512 onAutoRefresh() {
500 if (this.bottomNavIndex != this._currentNavIndex) { 513 if (this.bottomNavIndex != this._currentNavIndex) {
501 return 514 return
@@ -8,6 +8,8 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter'; @@ -8,6 +8,8 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter';
8 import { DisplayDirection } from 'wdConstant/Index'; 8 import { DisplayDirection } from 'wdConstant/Index';
9 import { PageComponent } from 'wdComponent/Index'; 9 import { PageComponent } from 'wdComponent/Index';
10 import { TrackingButton, TrackConstants } from 'wdTracking/Index'; 10 import { TrackingButton, TrackConstants } from 'wdTracking/Index';
  11 +import { Logger } from 'wdKit';
  12 +import { ParamType, Tracking } from 'wdTracking/Index';
11 13
12 const TAG = 'VideoChannelPage' 14 const TAG = 'VideoChannelPage'
13 15
@@ -100,6 +102,18 @@ export struct VideoChannelPage { @@ -100,6 +102,18 @@ export struct VideoChannelPage {
100 right: $r('app.float.top_tab_item_padding_horizontal'), 102 right: $r('app.float.top_tab_item_padding_horizontal'),
101 }) 103 })
102 .onClick(() => { 104 .onClick(() => {
  105 +
  106 + // 视频tab埋点
  107 + const tab = this.topNavList[index]
  108 + Logger.info(TAG, `视频tab埋点: ${JSON.stringify(tab)}`);
  109 +
  110 + const params: ParamType = {
  111 + "pageName": tab.name,
  112 + "tabName": tab.name,
  113 + "pageId": tab.pageId,
  114 + }
  115 + Tracking.event("video_page_tab_click", params)
  116 +
103 if (this.currentTopNavSelectedIndex === index) { 117 if (this.currentTopNavSelectedIndex === index) {
104 this.autoRefresh++ 118 this.autoRefresh++
105 } 119 }