liyubing

Merge remote-tracking branch 'origin/main'

... ... @@ -32,8 +32,8 @@ export class HttpBizUtil {
if (!headers) {
headers = new HashMap()
}
headers?.replace('RMRB-X-TOKEN', token)
headers?.replace('cookie', 'RMRB-X-TOKEN=' + token)
headers?.set('RMRB-X-TOKEN', token)
headers?.set('cookie', 'RMRB-X-TOKEN=' + token)
Logger.debug(TAG, 'get again send: ' + token)
// refreshToken为空场景不处理,直接请求接口。
WDHttp.get<T>(url, headers).then((againResDTO: T) => {
... ... @@ -71,8 +71,8 @@ export class HttpBizUtil {
if (!headers) {
headers = new HashMap()
}
headers?.replace('RMRB-X-TOKEN', token)
headers?.replace('cookie', 'RMRB-X-TOKEN=' + token)
headers?.set('RMRB-X-TOKEN', token)
headers?.set('cookie', 'RMRB-X-TOKEN=' + token)
Logger.debug(TAG, 'post again send: ' + token)
// refreshToken为空场景不处理,直接请求接口。
WDHttp.post<T>(url, data, headers).then((againResDTO: T) => {
... ...
... ... @@ -10,6 +10,7 @@ import { Logger, ToastUtils } from 'wdKit';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { SpConstants } from 'wdConstant/Index'
import { InfomationCardClick } from '../../utils/infomationCardClick';
import { ParamType, Tracking } from 'wdTracking/Index';
/**
* 直播预约卡
... ... @@ -17,7 +18,17 @@ import { InfomationCardClick } from '../../utils/infomationCardClick';
*/
const TAG = 'Zh_Single_Row-03'
function 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 ''
}
}
interface reserveReqItem {
liveId: string,
relationId: string,
... ... @@ -255,7 +266,27 @@ export struct ZhSingleRow03 {
.textAlign(TextAlign.Center)
.borderRadius(3)
.onClick(() => {
this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId)))
const isSubscribe = !this.isReserved(Number(item.objectId))
// 直播预约埋点
const params: ParamType = {
'contentName': item.newsTitle,
'contentType': item.objectType,
"liveStreamType": item?.liveInfo.vrType === 0 ? 1 : 2,
"vliveId": item.objectId,
"vliveName": item.newsTitle,
"contentId": item.objectId,
"compId": item.relId,
"contentStyle": item.appStyle,
"liveType": getLiveState(item),
'contentShowChannelId': item.channelId,
'linkUrl': item.linkUrl,
"pageId": this.pageId,
"pageName": '直播',
}
Logger.info(TAG, `直播预约埋点: ${JSON.stringify(params)}`);
Tracking.event(isSubscribe? "live_subscribe_click": "cancel_live_subscribe_click", params)
this.bookAndCancel(item.relId, item.objectId, isSubscribe)
})
}
... ...
... ... @@ -45,7 +45,7 @@ export struct TopNavigationComponentNew {
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@Link _currentNavIndex?: number;
// 顶导当前选中/焦点下标
@State currentTopNavSelectedIndex: number = 0;
@State @Watch('updateCurrentTopNavSelectedIndex') currentTopNavSelectedIndex: number = 0;
// 顶导数据
@State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = []
@State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002
... ... @@ -114,20 +114,6 @@ export struct TopNavigationComponentNew {
.onChange((index) => {
Logger.info(TAG, `onChange index : ${index}`);
// 顶部tab埋点
if(this.currentBottomNavName === '新闻') {
const tab = this.myChannelList[index]
Logger.info(TAG, `顶部tab : ${JSON.stringify(tab)}`);
const params: ParamType = {
"pageName": tab.name,
"tabName": tab.name,
"pageId": tab.pageId,
}
Tracking.event("home_page_tab_click ", params)
}
if (this.isBroadcastByIndex(index)) {
// 跳转到播报页面
ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
... ... @@ -217,6 +203,7 @@ export struct TopNavigationComponentNew {
moreChannelList: $moreChannelList,
localChannelList: $localChannelList,
changeTab: (index) => {
this.changePage(index)
}
})
... ... @@ -496,6 +483,32 @@ export struct TopNavigationComponentNew {
`onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`);
}
updateCurrentTopNavSelectedIndex() {
Logger.info(TAG, `currentTopNavSelectedIndex : ${this.currentTopNavSelectedIndex}、${this.currentBottomNavName}`);
// 顶部tab埋点
if(this.currentBottomNavName === '新闻') {
const tab = this.myChannelList[this.currentTopNavSelectedIndex]
Logger.info(TAG, `新闻tab埋点: ${JSON.stringify(tab)}`);
const params: ParamType = {
"pageName": tab.name,
"tabName": tab.name,
"pageId": tab.pageId,
}
Tracking.event("home_page_tab_click ", params)
} else if(this.currentBottomNavName === '人民号') {
const tab = this.topNavList[this.currentTopNavSelectedIndex]
Logger.info(TAG, `人民号tab埋点: ${JSON.stringify(tab)}`);
const params: ParamType = {
"pageName": tab.name,
"tabName": tab.name,
"pageId": tab.pageId,
}
Tracking.event("People_account_page_tab_click", params)
}
}
onAutoRefresh() {
if (this.bottomNavIndex != this._currentNavIndex) {
return
... ...
... ... @@ -8,6 +8,8 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { DisplayDirection } from 'wdConstant/Index';
import { PageComponent } from 'wdComponent/Index';
import { TrackingButton, TrackConstants } from 'wdTracking/Index';
import { Logger } from 'wdKit';
import { ParamType, Tracking } from 'wdTracking/Index';
const TAG = 'VideoChannelPage'
... ... @@ -100,6 +102,18 @@ export struct VideoChannelPage {
right: $r('app.float.top_tab_item_padding_horizontal'),
})
.onClick(() => {
// 视频tab埋点
const tab = this.topNavList[index]
Logger.info(TAG, `视频tab埋点: ${JSON.stringify(tab)}`);
const params: ParamType = {
"pageName": tab.name,
"tabName": tab.name,
"pageId": tab.pageId,
}
Tracking.event("video_page_tab_click", params)
if (this.currentTopNavSelectedIndex === index) {
this.autoRefresh++
}
... ...