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
zhanglun_wd
2024-05-30 14:29:05 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
eeec1a3923a958a4911e366ab7a8f0f0dd2b7963
eeec1a39
1 parent
860293cc
埋点
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
1 deletions
sight_harmony/features/wdBean/src/main/ets/bean/navigation/BottomNavDTO.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
sight_harmony/products/phone/src/main/ets/pages/view/BottomNavigationComponent.ets
sight_harmony/features/wdBean/src/main/ets/bean/navigation/BottomNavDTO.ets
View file @
eeec1a3
...
...
@@ -4,6 +4,7 @@ import { TopNavDTO } from './TopNavDTO';
* 底导(包含顶导列表)数据
*/
export interface BottomNavDTO {
pageName: string;
backgroundUrl: string; // 迭代四:页面背景图
channelChooseActionUrl: string; // 迭代四:频道选中下划线动画
channelChooseCColor: string; // 迭代四:频道未选中颜色
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponent.ets
View file @
eeec1a3
...
...
@@ -9,6 +9,7 @@ import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils
import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent';
import { channelSkeleton } from '../skeleton/channelSkeleton';
import { TrackingButton, TrackConstants } from 'wdTracking/Index';
import { ParamType, Tracking } from 'wdTracking/Index';
const TAG = 'TopNavigationComponent';
...
...
@@ -25,6 +26,9 @@ const storage = LocalStorage.getShared();
export struct TopNavigationComponent {
private groupId: number = 0
private currentBottomNavName: string = ''
private pageName: string = ''
private pageId: number = 0
private tabsController: TabsController = new TabsController()
@Consume isLayoutFullScreen: boolean
@Consume bottomRectHeight: number
...
...
@@ -223,6 +227,14 @@ export struct TopNavigationComponent {
.width(124)
.onClick(() => {
if (NetworkUtil.isNetConnected()) {
// 早晚报埋点
const params: ParamType = {
"pageName": this.pageName,
"pageId": this.pageId,
}
Tracking.event("morning_evening_news_click", params)
ProcessUtils.gotoMorningEveningPaper()
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
View file @
eeec1a3
...
...
@@ -10,6 +10,7 @@ import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent';
import { channelSkeleton } from '../skeleton/channelSkeleton';
import { TrackConstants, TrackingButton } from 'wdTracking/Index';
import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'
import { ParamType, Tracking } from 'wdTracking/Index';
const TAG = 'TopNavigationComponent';
...
...
@@ -29,6 +30,8 @@ export struct TopNavigationComponentNew {
* @deprecated TODO type判断
*/
private currentBottomNavName: string = ''
private pageName: string = ''
private pageId: number = 0
private swiperController: SwiperController = new SwiperController()
private listScroller: Scroller = new Scroller()
@Consume barBackgroundColor: Color
...
...
@@ -110,6 +113,21 @@ 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)
...
...
@@ -166,6 +184,14 @@ export struct TopNavigationComponentNew {
.height(30)
.width(124)
.onClick(() => {
// 早晚报埋点
const params: ParamType = {
"pageName": this.pageName,
"pageId": this.pageId,
}
Tracking.event("morning_evening_news_click", params)
this.clickMorningEveningPaper()
})
}.width('100%')
...
...
sight_harmony/products/phone/src/main/ets/pages/view/BottomNavigationComponent.ets
View file @
eeec1a3
...
...
@@ -8,6 +8,7 @@ import { CompUtils, TopNavigationComponent, TopNavigationComponentNew } from 'wd
import { VideoChannelPage } from './VideoChannelPage';
import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel';
import { ALL, ImageKnifeComponent, ImageKnifeOption, NONE } from '@ohos/imageknife';
import { ParamType, Tracking } from 'wdTracking/Index';
const TAG = 'BottomNavigationComponent';
PersistentStorage.persistProp('channelIds', '');
...
...
@@ -90,10 +91,12 @@ export struct BottomNavigationComponent {
if (this.isNewTopPage) {
TopNavigationComponentNew({
groupId: navItem.id,
pageId: navItem.id,
topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),
_currentNavIndex: $currentNavIndex,
bottomNavIndex: index,
currentBottomNavName: navItem.name,
pageName: navItem.pageName,
assignChannel: this.assignChannel,
autoRefresh: this.autoRefresh
})
...
...
@@ -102,6 +105,8 @@ export struct BottomNavigationComponent {
groupId: navItem.id,
topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),
_currentNavIndex: $currentNavIndex,
pageName: navItem.pageName,
pageId: navItem.id,
navIndex: index,
currentBottomNavName: navItem.name,
assignChannel: this.assignChannel,
...
...
@@ -171,6 +176,14 @@ export struct BottomNavigationComponent {
// .hitTestBehavior(HitTestMode.Block)
.onClick(() => {
Logger.info(TAG, `onChange, index: ${index}`);
Logger.info(TAG, `onChange, navItem: ${JSON.stringify(navItem)}`);
// 底部bar埋点
const params: ParamType = {
"pageName": navItem.pageName,
"pageId": navItem.id,
}
Tracking.event("bar_click", params)
this.onBottomNavigationIndexChange(navItem, index)
})
...
...
@@ -368,7 +381,15 @@ export struct BottomNavigationComponent {
Logger.info(TAG, `setData, bottomNav.length: ${list.length}`);
// 使用filter方法移除name为'服务'的项
list = list.filter(item => item.name !== '服务');
this.bottomNavList = list
list.forEach(item => {
switch (item.name) {
case '新闻': item.pageName = 'NEWS'; break;
case '人民号': item.pageName = 'PEOPLE'; break;
case '视频': item.pageName = 'VIDEOS'; break;
case '我的': item.pageName = 'MY'; break;
default : item.pageName = 'NEWS'; break;
}
})
}
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment