Showing
4 changed files
with
61 additions
and
1 deletions
| @@ -4,6 +4,7 @@ import { TopNavDTO } from './TopNavDTO'; | @@ -4,6 +4,7 @@ import { TopNavDTO } from './TopNavDTO'; | ||
| 4 | * 底导(包含顶导列表)数据 | 4 | * 底导(包含顶导列表)数据 |
| 5 | */ | 5 | */ |
| 6 | export interface BottomNavDTO { | 6 | export interface BottomNavDTO { |
| 7 | + pageName: string; | ||
| 7 | backgroundUrl: string; // 迭代四:页面背景图 | 8 | backgroundUrl: string; // 迭代四:页面背景图 |
| 8 | channelChooseActionUrl: string; // 迭代四:频道选中下划线动画 | 9 | channelChooseActionUrl: string; // 迭代四:频道选中下划线动画 |
| 9 | channelChooseCColor: string; // 迭代四:频道未选中颜色 | 10 | channelChooseCColor: string; // 迭代四:频道未选中颜色 |
| @@ -9,6 +9,7 @@ import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils | @@ -9,6 +9,7 @@ import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils | ||
| 9 | import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent'; | 9 | import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent'; |
| 10 | import { channelSkeleton } from '../skeleton/channelSkeleton'; | 10 | import { channelSkeleton } from '../skeleton/channelSkeleton'; |
| 11 | import { TrackingButton, TrackConstants } from 'wdTracking/Index'; | 11 | import { TrackingButton, TrackConstants } from 'wdTracking/Index'; |
| 12 | +import { ParamType, Tracking } from 'wdTracking/Index'; | ||
| 12 | 13 | ||
| 13 | const TAG = 'TopNavigationComponent'; | 14 | const TAG = 'TopNavigationComponent'; |
| 14 | 15 | ||
| @@ -25,6 +26,9 @@ const storage = LocalStorage.getShared(); | @@ -25,6 +26,9 @@ const storage = LocalStorage.getShared(); | ||
| 25 | export struct TopNavigationComponent { | 26 | export struct TopNavigationComponent { |
| 26 | private groupId: number = 0 | 27 | private groupId: number = 0 |
| 27 | private currentBottomNavName: string = '' | 28 | private currentBottomNavName: string = '' |
| 29 | + | ||
| 30 | + private pageName: string = '' | ||
| 31 | + private pageId: number = 0 | ||
| 28 | private tabsController: TabsController = new TabsController() | 32 | private tabsController: TabsController = new TabsController() |
| 29 | @Consume isLayoutFullScreen: boolean | 33 | @Consume isLayoutFullScreen: boolean |
| 30 | @Consume bottomRectHeight: number | 34 | @Consume bottomRectHeight: number |
| @@ -223,6 +227,14 @@ export struct TopNavigationComponent { | @@ -223,6 +227,14 @@ export struct TopNavigationComponent { | ||
| 223 | .width(124) | 227 | .width(124) |
| 224 | .onClick(() => { | 228 | .onClick(() => { |
| 225 | if (NetworkUtil.isNetConnected()) { | 229 | if (NetworkUtil.isNetConnected()) { |
| 230 | + | ||
| 231 | + // 早晚报埋点 | ||
| 232 | + const params: ParamType = { | ||
| 233 | + "pageName": this.pageName, | ||
| 234 | + "pageId": this.pageId, | ||
| 235 | + } | ||
| 236 | + Tracking.event("morning_evening_news_click", params) | ||
| 237 | + | ||
| 226 | ProcessUtils.gotoMorningEveningPaper() | 238 | ProcessUtils.gotoMorningEveningPaper() |
| 227 | } else { | 239 | } else { |
| 228 | ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) | 240 | ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) |
| @@ -10,6 +10,7 @@ import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent'; | @@ -10,6 +10,7 @@ import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent'; | ||
| 10 | import { channelSkeleton } from '../skeleton/channelSkeleton'; | 10 | import { channelSkeleton } from '../skeleton/channelSkeleton'; |
| 11 | import { TrackConstants, TrackingButton } from 'wdTracking/Index'; | 11 | import { TrackConstants, TrackingButton } from 'wdTracking/Index'; |
| 12 | import DailyPaperTopicModel from '../../model/DailyPaperTopicModel' | 12 | import DailyPaperTopicModel from '../../model/DailyPaperTopicModel' |
| 13 | +import { ParamType, Tracking } from 'wdTracking/Index'; | ||
| 13 | 14 | ||
| 14 | const TAG = 'TopNavigationComponent'; | 15 | const TAG = 'TopNavigationComponent'; |
| 15 | 16 | ||
| @@ -29,6 +30,8 @@ export struct TopNavigationComponentNew { | @@ -29,6 +30,8 @@ export struct TopNavigationComponentNew { | ||
| 29 | * @deprecated TODO type判断 | 30 | * @deprecated TODO type判断 |
| 30 | */ | 31 | */ |
| 31 | private currentBottomNavName: string = '' | 32 | private currentBottomNavName: string = '' |
| 33 | + private pageName: string = '' | ||
| 34 | + private pageId: number = 0 | ||
| 32 | private swiperController: SwiperController = new SwiperController() | 35 | private swiperController: SwiperController = new SwiperController() |
| 33 | private listScroller: Scroller = new Scroller() | 36 | private listScroller: Scroller = new Scroller() |
| 34 | @Consume barBackgroundColor: Color | 37 | @Consume barBackgroundColor: Color |
| @@ -110,6 +113,21 @@ export struct TopNavigationComponentNew { | @@ -110,6 +113,21 @@ export struct TopNavigationComponentNew { | ||
| 110 | }) | 113 | }) |
| 111 | .onChange((index) => { | 114 | .onChange((index) => { |
| 112 | Logger.info(TAG, `onChange index : ${index}`); | 115 | Logger.info(TAG, `onChange index : ${index}`); |
| 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 | + | ||
| 113 | if (this.isBroadcastByIndex(index)) { | 131 | if (this.isBroadcastByIndex(index)) { |
| 114 | // 跳转到播报页面 | 132 | // 跳转到播报页面 |
| 115 | ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) | 133 | ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) |
| @@ -166,6 +184,14 @@ export struct TopNavigationComponentNew { | @@ -166,6 +184,14 @@ export struct TopNavigationComponentNew { | ||
| 166 | .height(30) | 184 | .height(30) |
| 167 | .width(124) | 185 | .width(124) |
| 168 | .onClick(() => { | 186 | .onClick(() => { |
| 187 | + | ||
| 188 | + // 早晚报埋点 | ||
| 189 | + const params: ParamType = { | ||
| 190 | + "pageName": this.pageName, | ||
| 191 | + "pageId": this.pageId, | ||
| 192 | + } | ||
| 193 | + Tracking.event("morning_evening_news_click", params) | ||
| 194 | + | ||
| 169 | this.clickMorningEveningPaper() | 195 | this.clickMorningEveningPaper() |
| 170 | }) | 196 | }) |
| 171 | }.width('100%') | 197 | }.width('100%') |
| @@ -8,6 +8,7 @@ import { CompUtils, TopNavigationComponent, TopNavigationComponentNew } from 'wd | @@ -8,6 +8,7 @@ import { CompUtils, TopNavigationComponent, TopNavigationComponentNew } from 'wd | ||
| 8 | import { VideoChannelPage } from './VideoChannelPage'; | 8 | import { VideoChannelPage } from './VideoChannelPage'; |
| 9 | import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel'; | 9 | import ChannelViewModel from 'wdComponent/src/main/ets/viewmodel/ChannelViewModel'; |
| 10 | import { ALL, ImageKnifeComponent, ImageKnifeOption, NONE } from '@ohos/imageknife'; | 10 | import { ALL, ImageKnifeComponent, ImageKnifeOption, NONE } from '@ohos/imageknife'; |
| 11 | +import { ParamType, Tracking } from 'wdTracking/Index'; | ||
| 11 | 12 | ||
| 12 | const TAG = 'BottomNavigationComponent'; | 13 | const TAG = 'BottomNavigationComponent'; |
| 13 | PersistentStorage.persistProp('channelIds', ''); | 14 | PersistentStorage.persistProp('channelIds', ''); |
| @@ -90,10 +91,12 @@ export struct BottomNavigationComponent { | @@ -90,10 +91,12 @@ export struct BottomNavigationComponent { | ||
| 90 | if (this.isNewTopPage) { | 91 | if (this.isNewTopPage) { |
| 91 | TopNavigationComponentNew({ | 92 | TopNavigationComponentNew({ |
| 92 | groupId: navItem.id, | 93 | groupId: navItem.id, |
| 94 | + pageId: navItem.id, | ||
| 93 | topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073), | 95 | topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073), |
| 94 | _currentNavIndex: $currentNavIndex, | 96 | _currentNavIndex: $currentNavIndex, |
| 95 | bottomNavIndex: index, | 97 | bottomNavIndex: index, |
| 96 | currentBottomNavName: navItem.name, | 98 | currentBottomNavName: navItem.name, |
| 99 | + pageName: navItem.pageName, | ||
| 97 | assignChannel: this.assignChannel, | 100 | assignChannel: this.assignChannel, |
| 98 | autoRefresh: this.autoRefresh | 101 | autoRefresh: this.autoRefresh |
| 99 | }) | 102 | }) |
| @@ -102,6 +105,8 @@ export struct BottomNavigationComponent { | @@ -102,6 +105,8 @@ export struct BottomNavigationComponent { | ||
| 102 | groupId: navItem.id, | 105 | groupId: navItem.id, |
| 103 | topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073), | 106 | topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073), |
| 104 | _currentNavIndex: $currentNavIndex, | 107 | _currentNavIndex: $currentNavIndex, |
| 108 | + pageName: navItem.pageName, | ||
| 109 | + pageId: navItem.id, | ||
| 105 | navIndex: index, | 110 | navIndex: index, |
| 106 | currentBottomNavName: navItem.name, | 111 | currentBottomNavName: navItem.name, |
| 107 | assignChannel: this.assignChannel, | 112 | assignChannel: this.assignChannel, |
| @@ -171,6 +176,14 @@ export struct BottomNavigationComponent { | @@ -171,6 +176,14 @@ export struct BottomNavigationComponent { | ||
| 171 | // .hitTestBehavior(HitTestMode.Block) | 176 | // .hitTestBehavior(HitTestMode.Block) |
| 172 | .onClick(() => { | 177 | .onClick(() => { |
| 173 | Logger.info(TAG, `onChange, index: ${index}`); | 178 | Logger.info(TAG, `onChange, index: ${index}`); |
| 179 | + Logger.info(TAG, `onChange, navItem: ${JSON.stringify(navItem)}`); | ||
| 180 | + // 底部bar埋点 | ||
| 181 | + const params: ParamType = { | ||
| 182 | + "pageName": navItem.pageName, | ||
| 183 | + "pageId": navItem.id, | ||
| 184 | + } | ||
| 185 | + Tracking.event("bar_click", params) | ||
| 186 | + | ||
| 174 | this.onBottomNavigationIndexChange(navItem, index) | 187 | this.onBottomNavigationIndexChange(navItem, index) |
| 175 | }) | 188 | }) |
| 176 | 189 | ||
| @@ -368,7 +381,15 @@ export struct BottomNavigationComponent { | @@ -368,7 +381,15 @@ export struct BottomNavigationComponent { | ||
| 368 | Logger.info(TAG, `setData, bottomNav.length: ${list.length}`); | 381 | Logger.info(TAG, `setData, bottomNav.length: ${list.length}`); |
| 369 | // 使用filter方法移除name为'服务'的项 | 382 | // 使用filter方法移除name为'服务'的项 |
| 370 | list = list.filter(item => item.name !== '服务'); | 383 | list = list.filter(item => item.name !== '服务'); |
| 371 | - this.bottomNavList = list | 384 | + list.forEach(item => { |
| 385 | + switch (item.name) { | ||
| 386 | + case '新闻': item.pageName = 'NEWS'; break; | ||
| 387 | + case '人民号': item.pageName = 'PEOPLE'; break; | ||
| 388 | + case '视频': item.pageName = 'VIDEOS'; break; | ||
| 389 | + case '我的': item.pageName = 'MY'; break; | ||
| 390 | + default : item.pageName = 'NEWS'; break; | ||
| 391 | + } | ||
| 392 | + }) | ||
| 372 | } | 393 | } |
| 373 | } | 394 | } |
| 374 | } | 395 | } |
-
Please register or login to post a comment