Showing
5 changed files
with
54 additions
and
2 deletions
| @@ -2,6 +2,7 @@ import MinePageMoreFunctionModel from '../../viewmodel/MinePageMoreFunctionModel | @@ -2,6 +2,7 @@ import MinePageMoreFunctionModel from '../../viewmodel/MinePageMoreFunctionModel | ||
| 2 | import { WDRouterRule, WDRouterPage, ProcessUtils } from 'wdRouter' | 2 | import { WDRouterRule, WDRouterPage, ProcessUtils } from 'wdRouter' |
| 3 | import { Params } from 'wdBean'; | 3 | import { Params } from 'wdBean'; |
| 4 | import { ToastUtils } from 'wdKit/Index'; | 4 | import { ToastUtils } from 'wdKit/Index'; |
| 5 | +import { TrackingButton, TrackConstants } from 'wdTracking/Index'; | ||
| 5 | 6 | ||
| 6 | @Component | 7 | @Component |
| 7 | export default struct MinePageMoreFunctionUI { | 8 | export default struct MinePageMoreFunctionUI { |
| @@ -70,13 +71,16 @@ export default struct MinePageMoreFunctionUI { | @@ -70,13 +71,16 @@ export default struct MinePageMoreFunctionUI { | ||
| 70 | .onClick(() => { | 71 | .onClick(() => { |
| 71 | console.log(index + "") | 72 | console.log(index + "") |
| 72 | if (item.msg == "设置") { //设置 | 73 | if (item.msg == "设置") { //设置 |
| 74 | + trackButtonClick("myPageUserSetting") | ||
| 73 | let params: Params = { | 75 | let params: Params = { |
| 74 | pageID: 'mainSetting' | 76 | pageID: 'mainSetting' |
| 75 | } | 77 | } |
| 76 | WDRouterRule.jumpWithPage(WDRouterPage.settingPage, params) | 78 | WDRouterRule.jumpWithPage(WDRouterPage.settingPage, params) |
| 77 | }else if (item.msg == "关于") { // 关于 | 79 | }else if (item.msg == "关于") { // 关于 |
| 80 | + trackButtonClick("myPageUserAbout") | ||
| 78 | WDRouterRule.jumpWithPage(WDRouterPage.aboutPage) | 81 | WDRouterRule.jumpWithPage(WDRouterPage.aboutPage) |
| 79 | }else if (item.msg == "意见反馈") { // 关于 | 82 | }else if (item.msg == "意见反馈") { // 关于 |
| 83 | + trackButtonClick("myPageUserFeedBack") | ||
| 80 | ProcessUtils.gotoFeedBackActivity() | 84 | ProcessUtils.gotoFeedBackActivity() |
| 81 | } | 85 | } |
| 82 | }) | 86 | }) |
| @@ -91,3 +95,7 @@ export default struct MinePageMoreFunctionUI { | @@ -91,3 +95,7 @@ export default struct MinePageMoreFunctionUI { | ||
| 91 | .margin({ left: '23lpx', right: '23lpx', top: "19lpx" }) | 95 | .margin({ left: '23lpx', right: '23lpx', top: "19lpx" }) |
| 92 | } | 96 | } |
| 93 | } | 97 | } |
| 98 | + | ||
| 99 | +function trackButtonClick(buttonName: string){ | ||
| 100 | + TrackingButton.click(buttonName, TrackConstants.PageName.My, TrackConstants.PageName.My) | ||
| 101 | +} |
| 1 | import { WDRouterRule, WDRouterPage } from 'wdRouter' | 1 | import { WDRouterRule, WDRouterPage } from 'wdRouter' |
| 2 | +import { TrackConstants } from 'wdTracking/src/main/ets/common/TrackConstants' | ||
| 3 | +import { TrackingButton } from 'wdTracking/src/main/ets/tracking/TrackingButton' | ||
| 2 | import MinePageDatasModel from '../../model/MinePageDatasModel' | 4 | import MinePageDatasModel from '../../model/MinePageDatasModel' |
| 3 | import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunctionsItem' | 5 | import MinePagePersonalFunctionsItem from '../../viewmodel/MinePagePersonalFunctionsItem' |
| 4 | import { PagePersonFunction } from './PagePersonFunction' | 6 | import { PagePersonFunction } from './PagePersonFunction' |
| @@ -25,6 +27,7 @@ export default struct MinePagePersonFunctionUI { | @@ -25,6 +27,7 @@ export default struct MinePagePersonFunctionUI { | ||
| 25 | }else { | 27 | }else { |
| 26 | let params: Record<string, string> = {'comment': "1"}; | 28 | let params: Record<string, string> = {'comment': "1"}; |
| 27 | WDRouterRule.jumpWithPage(WDRouterPage.mineHomePage,params) | 29 | WDRouterRule.jumpWithPage(WDRouterPage.mineHomePage,params) |
| 30 | + trackButtonClick("myPageUserComment") | ||
| 28 | } | 31 | } |
| 29 | break; | 32 | break; |
| 30 | } | 33 | } |
| @@ -33,6 +36,7 @@ export default struct MinePagePersonFunctionUI { | @@ -33,6 +36,7 @@ export default struct MinePagePersonFunctionUI { | ||
| 33 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | 36 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) |
| 34 | return | 37 | return |
| 35 | } | 38 | } |
| 39 | + trackButtonClick("myPageUserSubscribe") | ||
| 36 | WDRouterRule.jumpWithPage(WDRouterPage.appointmentListPage) | 40 | WDRouterRule.jumpWithPage(WDRouterPage.appointmentListPage) |
| 37 | break; | 41 | break; |
| 38 | } | 42 | } |
| @@ -42,6 +46,7 @@ export default struct MinePagePersonFunctionUI { | @@ -42,6 +46,7 @@ export default struct MinePagePersonFunctionUI { | ||
| 42 | return | 46 | return |
| 43 | } | 47 | } |
| 44 | WDRouterRule.jumpWithPage(WDRouterPage.followListPage) | 48 | WDRouterRule.jumpWithPage(WDRouterPage.followListPage) |
| 49 | + trackButtonClick("myPageUserFollow") | ||
| 45 | break; | 50 | break; |
| 46 | } | 51 | } |
| 47 | case "收藏":{ | 52 | case "收藏":{ |
| @@ -50,6 +55,7 @@ export default struct MinePagePersonFunctionUI { | @@ -50,6 +55,7 @@ export default struct MinePagePersonFunctionUI { | ||
| 50 | return | 55 | return |
| 51 | } | 56 | } |
| 52 | WDRouterRule.jumpWithPage(WDRouterPage.myCollectionListPagePage) | 57 | WDRouterRule.jumpWithPage(WDRouterPage.myCollectionListPagePage) |
| 58 | + trackButtonClick("myPageUserCollection") | ||
| 53 | break; | 59 | break; |
| 54 | } | 60 | } |
| 55 | case "历史":{ | 61 | case "历史":{ |
| @@ -66,6 +72,7 @@ export default struct MinePagePersonFunctionUI { | @@ -66,6 +72,7 @@ export default struct MinePagePersonFunctionUI { | ||
| 66 | return | 72 | return |
| 67 | } | 73 | } |
| 68 | this.messageClick() | 74 | this.messageClick() |
| 75 | + trackButtonClick("myPageUserNotice") | ||
| 69 | WDRouterRule.jumpWithPage(WDRouterPage.mineMessagePage) | 76 | WDRouterRule.jumpWithPage(WDRouterPage.mineMessagePage) |
| 70 | break; | 77 | break; |
| 71 | } | 78 | } |
| @@ -89,3 +96,7 @@ export default struct MinePagePersonFunctionUI { | @@ -89,3 +96,7 @@ export default struct MinePagePersonFunctionUI { | ||
| 89 | } | 96 | } |
| 90 | } | 97 | } |
| 91 | 98 | ||
| 99 | +function trackButtonClick(buttonName: string){ | ||
| 100 | + TrackingButton.click(buttonName, TrackConstants.PageName.My, TrackConstants.PageName.My) | ||
| 101 | +} | ||
| 102 | + |
| 1 | import { StringUtils, UserDataLocal } from 'wdKit' | 1 | import { StringUtils, UserDataLocal } from 'wdKit' |
| 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter' | 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter' |
| 3 | +import { TrackingButton, TrackConstants } from 'wdTracking/Index' | ||
| 3 | import MinePageDatasModel from '../../model/MinePageDatasModel' | 4 | import MinePageDatasModel from '../../model/MinePageDatasModel' |
| 4 | const TAG = "MinePageUserSimpleInfoUI" | 5 | const TAG = "MinePageUserSimpleInfoUI" |
| 5 | 6 | ||
| @@ -45,6 +46,7 @@ export default struct MinePageUserSimpleInfoUI { | @@ -45,6 +46,7 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 45 | .alignContent(Alignment.Center) | 46 | .alignContent(Alignment.Center) |
| 46 | .onClick(()=>{ | 47 | .onClick(()=>{ |
| 47 | this.jumpLogin() | 48 | this.jumpLogin() |
| 49 | + trackButtonClick("myPageUserHead") | ||
| 48 | }) | 50 | }) |
| 49 | 51 | ||
| 50 | if(this.isLogin){ | 52 | if(this.isLogin){ |
| @@ -68,6 +70,7 @@ export default struct MinePageUserSimpleInfoUI { | @@ -68,6 +70,7 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 68 | }.width('100%') | 70 | }.width('100%') |
| 69 | .onClick(()=>{ | 71 | .onClick(()=>{ |
| 70 | this.jumpLogin() | 72 | this.jumpLogin() |
| 73 | + trackButtonClick("myPageUserName") | ||
| 71 | }) | 74 | }) |
| 72 | 75 | ||
| 73 | Stack(){ | 76 | Stack(){ |
| @@ -101,6 +104,7 @@ export default struct MinePageUserSimpleInfoUI { | @@ -101,6 +104,7 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 101 | Blank() | 104 | Blank() |
| 102 | }.onClick(()=>{ | 105 | }.onClick(()=>{ |
| 103 | this.jumpLogin() | 106 | this.jumpLogin() |
| 107 | + trackButtonClick("myPageUserLogin") | ||
| 104 | }) | 108 | }) |
| 105 | .margin({top:'11lpx',left:'23lpx'}) | 109 | .margin({top:'11lpx',left:'23lpx'}) |
| 106 | .width('352lpx') | 110 | .width('352lpx') |
| @@ -198,3 +202,7 @@ export default struct MinePageUserSimpleInfoUI { | @@ -198,3 +202,7 @@ export default struct MinePageUserSimpleInfoUI { | ||
| 198 | } | 202 | } |
| 199 | } | 203 | } |
| 200 | } | 204 | } |
| 205 | + | ||
| 206 | +function trackButtonClick(buttonName: string){ | ||
| 207 | + TrackingButton.click(buttonName, TrackConstants.PageName.My, TrackConstants.PageName.My) | ||
| 208 | +} |
| @@ -73,7 +73,7 @@ export struct BottomNavigationComponent { | @@ -73,7 +73,7 @@ export struct BottomNavigationComponent { | ||
| 73 | TabContent() { | 73 | TabContent() { |
| 74 | if (CompUtils.isMine(navItem)) { | 74 | if (CompUtils.isMine(navItem)) { |
| 75 | // 我的页面组件数据列表 | 75 | // 我的页面组件数据列表 |
| 76 | - MinePageComponent() | 76 | + MinePageComponent({isMinePage: this.currentNavIndex === this.bottomNavList.length-1}) |
| 77 | } else if (navItem.name === '视频') { | 77 | } else if (navItem.name === '视频') { |
| 78 | // 视频频道,包含视频和直播 | 78 | // 视频频道,包含视频和直播 |
| 79 | VideoChannelPage({ | 79 | VideoChannelPage({ |
| @@ -5,10 +5,12 @@ import MinePageDatasModel from '../../model/MinePageDatasModel' | @@ -5,10 +5,12 @@ import MinePageDatasModel from '../../model/MinePageDatasModel' | ||
| 5 | import MinePageUserSimpleInfoUI from '../mine/MinePageUserSimpleInfoUI' | 5 | import MinePageUserSimpleInfoUI from '../mine/MinePageUserSimpleInfoUI' |
| 6 | import MinePagePersonFunctionUI from '../mine/MinePagePersonFunctionUI' | 6 | import MinePagePersonFunctionUI from '../mine/MinePagePersonFunctionUI' |
| 7 | import MinePageMoreFunctionUI from '../mine/MinePageMoreFunctionUI' | 7 | import MinePageMoreFunctionUI from '../mine/MinePageMoreFunctionUI' |
| 8 | -import { SPHelper, StringUtils } from 'wdKit' | 8 | +import { DateTimeUtils, SPHelper, StringUtils } from 'wdKit' |
| 9 | import { SpConstants } from 'wdConstant' | 9 | import { SpConstants } from 'wdConstant' |
| 10 | import dataPreferences from '@ohos.data.preferences'; | 10 | import dataPreferences from '@ohos.data.preferences'; |
| 11 | import { MergeRecordDialog } from '../../dialog/MergeRecordDialog' | 11 | import { MergeRecordDialog } from '../../dialog/MergeRecordDialog' |
| 12 | +import { TrackingPageBrowse } from 'wdTracking/src/main/ets/tracking/TrackingPageBrowse' | ||
| 13 | +import { TrackConstants } from 'wdTracking/src/main/ets/common/TrackConstants' | ||
| 12 | 14 | ||
| 13 | const TAG = 'MinePageComponent'; | 15 | const TAG = 'MinePageComponent'; |
| 14 | 16 | ||
| @@ -52,12 +54,35 @@ export struct MinePageComponent { | @@ -52,12 +54,35 @@ export struct MinePageComponent { | ||
| 52 | autoCancel: false | 54 | autoCancel: false |
| 53 | }) | 55 | }) |
| 54 | @Consume @Watch('pageShowForUpdateData') pageShow :number | 56 | @Consume @Watch('pageShowForUpdateData') pageShow :number |
| 57 | + @Consume @Watch('pageHideForUpdateData') pageHide :number | ||
| 58 | + pageShowTime:number = 0; | ||
| 59 | + pageHideTime:number = 0; | ||
| 60 | + pageFirstCreateTime:number = 0; | ||
| 61 | + @Prop isMinePage:boolean = false; | ||
| 55 | 62 | ||
| 63 | + //第一次还没创建时候 pageShow 接收不到监听 | ||
| 56 | pageShowForUpdateData(): void { | 64 | pageShowForUpdateData(): void { |
| 65 | + if(this.isMinePage){ | ||
| 57 | this.getMessageData() | 66 | this.getMessageData() |
| 67 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 68 | + } | ||
| 69 | + } | ||
| 70 | + pageHideForUpdateData(): void { | ||
| 71 | + if(this.isMinePage){ | ||
| 72 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 73 | + let duration = 0 | ||
| 74 | + if(this.pageShowTime != 0){ | ||
| 75 | + duration = (this.pageHideTime - this.pageShowTime)/1000 | ||
| 76 | + }else{ | ||
| 77 | + duration = (this.pageHideTime - this.pageFirstCreateTime)/1000 | ||
| 78 | + } | ||
| 79 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.My,TrackConstants.PageName.My,duration) | ||
| 80 | + } | ||
| 58 | } | 81 | } |
| 59 | 82 | ||
| 60 | aboutToAppear(){ | 83 | aboutToAppear(){ |
| 84 | + this.pageFirstCreateTime = DateTimeUtils.getTimeStamp() | ||
| 85 | + | ||
| 61 | this.getUserLogin() | 86 | this.getUserLogin() |
| 62 | this.getFunctionData() | 87 | this.getFunctionData() |
| 63 | this.addLoginStatusObserver() | 88 | this.addLoginStatusObserver() |
-
Please register or login to post a comment