yangchenggong1_wd

desc:埋点[关于页面 - 页面浏览]

  1 +import { DateTimeUtils } from 'wdKit/Index';
  2 +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index';
1 import { AboutPageUI } from '../setting/AboutPageUI'; 3 import { AboutPageUI } from '../setting/AboutPageUI';
2 4
3 @Entry 5 @Entry
4 @Component 6 @Component
5 struct SettingAboutPage { 7 struct SettingAboutPage {
  8 + pageShowTime:number = 0;
  9 + pageHideTime:number = 0;
  10 +
  11 + onPageShow() {
  12 + this.pageShowTime = DateTimeUtils.getTimeStamp()
  13 + }
  14 +
  15 + onPageHide(): void {
  16 + this.pageHideTime = DateTimeUtils.getTimeStamp()
  17 + let duration = 0
  18 + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
  19 + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.About,TrackConstants.PageName.About,duration)
  20 + }
  21 +
  22 +
6 build() { 23 build() {
7 Column(){ 24 Column(){
8 AboutPageUI() 25 AboutPageUI()
@@ -24,11 +24,7 @@ export struct AboutPageUI { @@ -24,11 +24,7 @@ export struct AboutPageUI {
24 }) 24 })
25 25
26 build() { 26 build() {
27 - // Navigation() {  
28 - //滑动区域  
29 this.aboutUi() 27 this.aboutUi()
30 - // }.titleMode(NavigationTitleMode.Mini)  
31 - // .title('关于')  
32 } 28 }
33 29
34 aboutToAppear() { 30 aboutToAppear() {
@@ -55,18 +51,6 @@ export struct AboutPageUI { @@ -55,18 +51,6 @@ export struct AboutPageUI {
55 this.dialogController.open() 51 this.dialogController.open()
56 }) 52 })
57 ) 53 )
58 - // Row(){  
59 - //  
60 - // }.backgroundColor(Color.Yellow)  
61 - // .width('100%')  
62 - // .height('97lpx')  
63 -  
64 - // Row(){  
65 - //  
66 - // }.backgroundColor(Color.Yellow)  
67 - // .width('100%')  
68 - // .height('97lpx')  
69 -  
70 54
71 List() { 55 List() {
72 ForEach(this.listData, (item: string, index: number) => { 56 ForEach(this.listData, (item: string, index: number) => {
@@ -85,69 +85,6 @@ export struct MineSettingComponent { @@ -85,69 +85,6 @@ export struct MineSettingComponent {
85 } 85 }
86 } 86 }
87 87
88 - // // 页面布局  
89 - // @Builder settingList() {  
90 - // Column() {  
91 - // List() {  
92 - // // 循环渲染ListItemGroup,contactsGroups为多个分组联系人contacts和标题title的数据集合  
93 - // ForEach(this.listData, (item: Array<string>, index: number) => {  
94 - // ListItemGroup({ header: index === 0 ? this.itemHead("") : this.itemHead("1") }) {  
95 - // // 循环渲染ListItem  
96 - // ForEach(item, (subItem: string, subIndex: number) => {  
97 - // ListItem() {  
98 - // if (subIndex == 6) {  
99 - // this.getArrowCell(subItem, subIndex, index)  
100 - // } else if (subIndex == 1 || subIndex == 3 || subIndex == 4 || subIndex == 5) {  
101 - // if (subIndex == 1 && index == 1) {  
102 - // this.getArrowCell(subItem, subIndex, index)  
103 - // } else {  
104 - // this.getSwitchCell(subItem, subIndex)  
105 - // }  
106 - //  
107 - // } else {  
108 - // this.getArrowCell(subItem, subIndex, index)  
109 - // }  
110 - //  
111 - // }.padding({ left: '27lpx' })  
112 - // .onClick(() => {  
113 - //  
114 - // // // 在Home页面中  
115 - // // let paramsInfo: object = {  
116 - // // pageId: 123,  
117 - // // pageType:'AccountAndSecurityLayout'  
118 - // // };  
119 - // console.log(subIndex + "")  
120 - // if (subIndex == 0 && index == 0) {  
121 - //  
122 - // let params: Params = {  
123 - // pageID: 'AccountAndSecurityLayout'  
124 - // }  
125 - // WDRouterRule.jumpWithPage(WDRouterPage.settingPage, params)  
126 - // }else if (subIndex == 2 && index == 0) {  
127 - // WDRouterRule.jumpWithPage(WDRouterPage.privacySettingPage)  
128 - // }else if (subIndex == 0 && index == 1) {  
129 - // this.dialogController.open()  
130 - // }  
131 - //  
132 - // })  
133 - // .height('117lpx')  
134 - // })  
135 - // }  
136 - // .divider({  
137 - // strokeWidth: 1,  
138 - // startMargin: 15,  
139 - // endMargin: 10,  
140 - // color: '#f0f0f0'  
141 - // })  
142 - // })  
143 - // }.onScrollFrameBegin((offset, state) => {  
144 - // return { offsetRemain: 0 }  
145 - // })  
146 - // }  
147 - // .backgroundColor(Color.White)  
148 - // .borderRadius(8)  
149 - // }  
150 -  
151 // 页面布局 88 // 页面布局
152 @Builder settingList() { 89 @Builder settingList() {
153 Column() { 90 Column() {
@@ -247,12 +184,6 @@ export struct MineSettingComponent { @@ -247,12 +184,6 @@ export struct MineSettingComponent {
247 Row() { 184 Row() {
248 // 左侧logo和标题 185 // 左侧logo和标题
249 Row() { 186 Row() {
250 - // 判断有没有图片  
251 - // if (this.privacySwitch) {  
252 - // Image('https://pic.rmb.bdstatic.com/e182cf67c341d1128d2a6cc05886bf62.jpeg@s_0,h_2000')  
253 - // .height('38lpx')  
254 - // .margin({ right: '5lpx' })  
255 - // }  
256 Text(`${item.title}`) 187 Text(`${item.title}`)
257 .margin({ top: '8lpx' }) 188 .margin({ top: '8lpx' })
258 .height('38lpx') 189 .height('38lpx')