Showing
38 changed files
with
363 additions
and
147 deletions
| @@ -171,6 +171,24 @@ export class LazyDataSource<T> extends BasicDataSource<T> { | @@ -171,6 +171,24 @@ export class LazyDataSource<T> extends BasicDataSource<T> { | ||
| 171 | } | 171 | } |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | + // 删除index指定索引位置的元素 | ||
| 175 | + public deleteItems(startIndex: number, count?: number): void { | ||
| 176 | + if (startIndex < 0) { | ||
| 177 | + return | ||
| 178 | + } | ||
| 179 | + this.dataArray.splice(startIndex, count || (this.dataArray.length - startIndex)); | ||
| 180 | + let to = 0 | ||
| 181 | + if (count == undefined) { | ||
| 182 | + to = this.dataArray.length - 1 | ||
| 183 | + } else { | ||
| 184 | + to = count + startIndex | ||
| 185 | + if (to >= this.dataArray.length) { | ||
| 186 | + to = this.dataArray.length - 1; | ||
| 187 | + } | ||
| 188 | + } | ||
| 189 | + this.notifyDataMove(startIndex, to); | ||
| 190 | + } | ||
| 191 | + | ||
| 174 | // 删除最后1个元素 | 192 | // 删除最后1个元素 |
| 175 | public pop(): void { | 193 | public pop(): void { |
| 176 | this.deleteItem() | 194 | this.deleteItem() |
| @@ -42,23 +42,23 @@ export class HttpParams { | @@ -42,23 +42,23 @@ export class HttpParams { | ||
| 42 | switch (HostManager.getHost()) { | 42 | switch (HostManager.getHost()) { |
| 43 | case HostEnum.HOST_UAT: | 43 | case HostEnum.HOST_UAT: |
| 44 | headers['X-Ca-Stage'] = 'PRE' | 44 | headers['X-Ca-Stage'] = 'PRE' |
| 45 | - headers['Authorization'] = 'APPCODE 83092caa603a421aa0222308b3f6b27a' | ||
| 46 | - headers['appCode'] = '83092caa603a421aa0222308b3f6b27a' | 45 | + headers['Authorization'] = 'APPCODE 5e1b07c336ac48ae90794fc4d69beaf9' |
| 46 | + headers['appCode'] = '5e1b07c336ac48ae90794fc4d69beaf9' | ||
| 47 | break | 47 | break |
| 48 | case HostEnum.HOST_SIT: | 48 | case HostEnum.HOST_SIT: |
| 49 | headers['X-Ca-Stage'] = 'TEST' | 49 | headers['X-Ca-Stage'] = 'TEST' |
| 50 | - headers['Authorization'] = 'APPCODE 0af1f9085e484c97b2a44704bae72c07' | ||
| 51 | - headers['appCode'] = '0af1f9085e484c97b2a44704bae72c07' | 50 | + headers['Authorization'] = 'APPCODE b7d32f50747d456d8c84ae51f3baaf56' |
| 51 | + headers['appCode'] = 'b7d32f50747d456d8c84ae51f3baaf56' | ||
| 52 | break | 52 | break |
| 53 | case HostEnum.HOST_PRODUCT: | 53 | case HostEnum.HOST_PRODUCT: |
| 54 | headers['X-Ca-Stage'] = 'RELEASE' | 54 | headers['X-Ca-Stage'] = 'RELEASE' |
| 55 | - headers['Authorization'] = 'APPCODE 3d4181bceeb94d9780e10dbb6c67bbf6' | ||
| 56 | - headers['appCode'] = '3d4181bceeb94d9780e10dbb6c67bbf6' | 55 | + headers['Authorization'] = 'APPCODE c148017260324c3ba7e612757e8146c1' |
| 56 | + headers['appCode'] = 'c148017260324c3ba7e612757e8146c1' | ||
| 57 | break | 57 | break |
| 58 | case HostEnum.HOST_DEV: | 58 | case HostEnum.HOST_DEV: |
| 59 | headers['X-Ca-Stage'] = 'TEST' | 59 | headers['X-Ca-Stage'] = 'TEST' |
| 60 | - headers['Authorization'] = 'APPCODE ff33172859e14f9a8299e3bd769e79f9' | ||
| 61 | - headers['appCode'] = 'ff33172859e14f9a8299e3bd769e79f9' | 60 | + headers['Authorization'] = 'APPCODE 9272b6a5ad0549a0ab399d0011109793' |
| 61 | + headers['appCode'] = '9272b6a5ad0549a0ab399d0011109793' | ||
| 62 | break | 62 | break |
| 63 | default: | 63 | default: |
| 64 | break | 64 | break |
| @@ -82,26 +82,7 @@ export class HttpParams { | @@ -82,26 +82,7 @@ export class HttpParams { | ||
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | private static getVersion() { | 84 | private static getVersion() { |
| 85 | - // TODO | 85 | + // TODO build时间,待对接build生成属性 |
| 86 | return '202401242103'; | 86 | return '202401242103'; |
| 87 | } | 87 | } |
| 88 | - | ||
| 89 | - private static getVersionCode() { | ||
| 90 | - // TODO | ||
| 91 | - return '10000'; | ||
| 92 | - } | ||
| 93 | - | ||
| 94 | - public static getVersionName() { | ||
| 95 | - // TODO 读取配置 | ||
| 96 | - return '1.0.0'; | ||
| 97 | - } | ||
| 98 | - | ||
| 99 | - //获取机型 | ||
| 100 | - static getPhoneModel() { | ||
| 101 | - return 'getPhoneModel' | ||
| 102 | - } | ||
| 103 | - //获取当前手机系统版本号 | ||
| 104 | - static getSystemVersion() { | ||
| 105 | - return 'getSystemVersion' | ||
| 106 | - } | ||
| 107 | } | 88 | } |
| @@ -20,6 +20,7 @@ | @@ -20,6 +20,7 @@ | ||
| 20 | "wdJsBridge": "file:../../commons/wdJsBridge", | 20 | "wdJsBridge": "file:../../commons/wdJsBridge", |
| 21 | "wdDetailPlayApi": "file:../../features/wdDetailPlayApi", | 21 | "wdDetailPlayApi": "file:../../features/wdDetailPlayApi", |
| 22 | "wdHwAbility": "file:../../features/wdHwAbility", | 22 | "wdHwAbility": "file:../../features/wdHwAbility", |
| 23 | - "wdShare": "file:../../features/wdShare" | 23 | + "wdShare": "file:../../features/wdShare", |
| 24 | + "wdTracking": "file:../../features/wdTracking" | ||
| 24 | } | 25 | } |
| 25 | } | 26 | } |
| @@ -321,6 +321,7 @@ export struct ENewspaperPageComponent { | @@ -321,6 +321,7 @@ export struct ENewspaperPageComponent { | ||
| 321 | if (this.isOpenListDialog) { | 321 | if (this.isOpenListDialog) { |
| 322 | ENewspaperListDialog({ | 322 | ENewspaperListDialog({ |
| 323 | newspaperListBean: this.newspaperListBean, | 323 | newspaperListBean: this.newspaperListBean, |
| 324 | + scrollIndex: this.swiperIndex, | ||
| 324 | closeDialog: () => { | 325 | closeDialog: () => { |
| 325 | this.isOpenListDialog = false | 326 | this.isOpenListDialog = false |
| 326 | } | 327 | } |
| 1 | import { FeedbackTypeBean, PhotoListBean } from 'wdBean/Index'; | 1 | import { FeedbackTypeBean, PhotoListBean } from 'wdBean/Index'; |
| 2 | -import { FastClickUtil, Logger, NetworkUtil, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index'; | 2 | +import { AppUtils, |
| 3 | + DeviceUtil, | ||
| 4 | + FastClickUtil, Logger, NetworkUtil, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index'; | ||
| 3 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; | 5 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; |
| 4 | import { CustomTitleUI } from './reusable/CustomTitleUI' | 6 | import { CustomTitleUI } from './reusable/CustomTitleUI' |
| 5 | import { picker } from '@kit.CoreFileKit'; | 7 | import { picker } from '@kit.CoreFileKit'; |
| @@ -8,7 +10,6 @@ import { router } from '@kit.ArkUI'; | @@ -8,7 +10,6 @@ import { router } from '@kit.ArkUI'; | ||
| 8 | import { CommonConstants } from 'wdConstant/Index'; | 10 | import { CommonConstants } from 'wdConstant/Index'; |
| 9 | import { ProcessUtils } from 'wdRouter/Index'; | 11 | import { ProcessUtils } from 'wdRouter/Index'; |
| 10 | import { HashMap } from '@kit.ArkTS'; | 12 | import { HashMap } from '@kit.ArkTS'; |
| 11 | -import { HttpParams } from 'wdNetwork/src/main/ets/http/HttpCommonParams'; | ||
| 12 | 13 | ||
| 13 | const TAG = 'FeedBackActivity' | 14 | const TAG = 'FeedBackActivity' |
| 14 | 15 | ||
| @@ -355,8 +356,8 @@ export struct FeedBackActivity { | @@ -355,8 +356,8 @@ export struct FeedBackActivity { | ||
| 355 | map.set("userName", UserDataLocal.getUserName()); | 356 | map.set("userName", UserDataLocal.getUserName()); |
| 356 | } | 357 | } |
| 357 | //设备 | 358 | //设备 |
| 358 | - map.set("appVersion", "V" + HttpParams.getVersionName()); | ||
| 359 | - map.set("appDevice", "harmony" + HttpParams.getSystemVersion() + " " + HttpParams.getPhoneModel()); | 359 | + map.set("appVersion", "V" + AppUtils.getAppVersionName()); |
| 360 | + map.set("appDevice", "harmony" + DeviceUtil.getDisplayVersion() + " " + DeviceUtil.getProductModel()); | ||
| 360 | // //投诉图片 | 361 | // //投诉图片 |
| 361 | // if (imageUrl.size() > 0) { | 362 | // if (imageUrl.size() > 0) { |
| 362 | // String[] str = imageUrl.toArray(new String[imageUrl.size()]); | 363 | // String[] str = imageUrl.toArray(new String[imageUrl.size()]); |
| @@ -244,10 +244,12 @@ export struct MorningEveningPaperComponent { | @@ -244,10 +244,12 @@ export struct MorningEveningPaperComponent { | ||
| 244 | topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject }) | 244 | topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject }) |
| 245 | } | 245 | } |
| 246 | 246 | ||
| 247 | + if (this.audioPlayUrl.length > 0){ | ||
| 247 | ListItem() { | 248 | ListItem() { |
| 248 | this.AudioBarView(this.simpleAudioDialog) | 249 | this.AudioBarView(this.simpleAudioDialog) |
| 249 | } | 250 | } |
| 250 | } | 251 | } |
| 252 | + } | ||
| 251 | 253 | ||
| 252 | ListItem() { | 254 | ListItem() { |
| 253 | SingleColumn999Component({ | 255 | SingleColumn999Component({ |
| @@ -39,7 +39,7 @@ export struct topicInfoView { | @@ -39,7 +39,7 @@ export struct topicInfoView { | ||
| 39 | .borderRadius(2) | 39 | .borderRadius(2) |
| 40 | .padding({ left: 6, top: 4, bottom: 4 }) | 40 | .padding({ left: 6, top: 4, bottom: 4 }) |
| 41 | 41 | ||
| 42 | - Image($r('app.media.more'))// .height($r('app.float.top_arrow_size')) | 42 | + Image($r('app.media.more_w'))// .height($r('app.float.top_arrow_size')) |
| 43 | .width(12) | 43 | .width(12) |
| 44 | .height(12) | 44 | .height(12) |
| 45 | .margin({ left: 4, right: 7 }) | 45 | .margin({ left: 4, right: 7 }) |
| @@ -90,9 +90,6 @@ export struct SpacialTopicPageComponent { | @@ -90,9 +90,6 @@ export struct SpacialTopicPageComponent { | ||
| 90 | this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '') | 90 | this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '') |
| 91 | this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '') | 91 | this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '') |
| 92 | // } | 92 | // } |
| 93 | - if (this.contentDetailData[0]?.openComment) { | ||
| 94 | - this.operationButtonList = ['collect', 'share'] | ||
| 95 | - } | ||
| 96 | this.trySendData2H5() | 93 | this.trySendData2H5() |
| 97 | } | 94 | } |
| 98 | } | 95 | } |
| 1 | import { CompDTO } from 'wdBean/Index'; | 1 | import { CompDTO } from 'wdBean/Index'; |
| 2 | import { DateTimeUtils, Logger } from 'wdKit/Index'; | 2 | import { DateTimeUtils, Logger } from 'wdKit/Index'; |
| 3 | +import { PageHelper } from '../../viewmodel/PageHelper'; | ||
| 3 | import PageModel from '../../viewmodel/PageModel'; | 4 | import PageModel from '../../viewmodel/PageModel'; |
| 4 | 5 | ||
| 5 | /** | 6 | /** |
| @@ -61,6 +62,7 @@ export struct CardAdvBottom { | @@ -61,6 +62,7 @@ export struct CardAdvBottom { | ||
| 61 | } | 62 | } |
| 62 | if (currentIndex >= 0) { | 63 | if (currentIndex >= 0) { |
| 63 | this.pageModel.compList.deleteItem(currentIndex) | 64 | this.pageModel.compList.deleteItem(currentIndex) |
| 65 | + PageHelper.updateFirstPageEndIndex(this.pageModel, true, currentIndex) | ||
| 64 | } | 66 | } |
| 65 | } | 67 | } |
| 66 | } | 68 | } |
| 1 | import { CompDTO } from 'wdBean/Index'; | 1 | import { CompDTO } from 'wdBean/Index'; |
| 2 | import { DateTimeUtils, Logger } from 'wdKit/Index'; | 2 | import { DateTimeUtils, Logger } from 'wdKit/Index'; |
| 3 | +import {PageHelper} from '../../viewmodel/PageHelper'; | ||
| 3 | import PageModel from '../../viewmodel/PageModel'; | 4 | import PageModel from '../../viewmodel/PageModel'; |
| 4 | 5 | ||
| 5 | /** | 6 | /** |
| @@ -73,6 +74,7 @@ export struct CardAdvTop { | @@ -73,6 +74,7 @@ export struct CardAdvTop { | ||
| 73 | } | 74 | } |
| 74 | if (currentIndex >= 0) { | 75 | if (currentIndex >= 0) { |
| 75 | this.pageModel.compList.deleteItem(currentIndex) | 76 | this.pageModel.compList.deleteItem(currentIndex) |
| 77 | + PageHelper.updateFirstPageEndIndex(this.pageModel, true, currentIndex) | ||
| 76 | } | 78 | } |
| 77 | } | 79 | } |
| 78 | } | 80 | } |
| @@ -99,6 +99,7 @@ export struct CommentTabComponent { | @@ -99,6 +99,7 @@ export struct CommentTabComponent { | ||
| 99 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | 99 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, |
| 100 | }) | 100 | }) |
| 101 | .id("Image") | 101 | .id("Image") |
| 102 | + .visibility(this.contentDetail.appstyle !== 9 ? Visibility.Visible : Visibility.Hidden) | ||
| 102 | } | 103 | } |
| 103 | Text(this.placeHolder) | 104 | Text(this.placeHolder) |
| 104 | .fontSize(12) | 105 | .fontSize(12) |
| @@ -110,11 +111,13 @@ export struct CommentTabComponent { | @@ -110,11 +111,13 @@ export struct CommentTabComponent { | ||
| 110 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | 111 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, |
| 111 | }) | 112 | }) |
| 112 | .id("Text") | 113 | .id("Text") |
| 114 | + .visibility(this.contentDetail.appstyle !== 9 ? Visibility.Visible : Visibility.Hidden) | ||
| 113 | } | 115 | } |
| 114 | } | 116 | } |
| 115 | } | 117 | } |
| 116 | .height(30) | 118 | .height(30) |
| 117 | .onClick(() => { | 119 | .onClick(() => { |
| 120 | + if(this.contentDetail.appstyle === 9) return | ||
| 118 | this.onCommentFocus && this.onCommentFocus() | 121 | this.onCommentFocus && this.onCommentFocus() |
| 119 | 122 | ||
| 120 | this.publishCommentModel.rootCommentId = '-1'; | 123 | this.publishCommentModel.rootCommentId = '-1'; |
| @@ -134,6 +137,7 @@ export struct CommentIconComponent { | @@ -134,6 +137,7 @@ export struct CommentIconComponent { | ||
| 134 | @ObjectLink publishCommentModel: publishCommentModel | 137 | @ObjectLink publishCommentModel: publishCommentModel |
| 135 | /*展示类型*/ | 138 | /*展示类型*/ |
| 136 | @State type: number = 1 | 139 | @State type: number = 1 |
| 140 | + @Prop contentDetail: ContentDetailDTO | ||
| 137 | styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) | 141 | styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) |
| 138 | // aboutToAppear(): void { | 142 | // aboutToAppear(): void { |
| 139 | // setTimeout(() => { | 143 | // setTimeout(() => { |
| @@ -206,7 +210,10 @@ export struct CommentIconComponent { | @@ -206,7 +210,10 @@ export struct CommentIconComponent { | ||
| 206 | 210 | ||
| 207 | } | 211 | } |
| 208 | } | 212 | } |
| 209 | - }.width(24).height(24) | 213 | + } |
| 214 | + .width(24) | ||
| 215 | + .height(24) | ||
| 216 | + .visibility(this.contentDetail.appstyle !== 9 ? Visibility.Visible : Visibility.Hidden) | ||
| 210 | 217 | ||
| 211 | // .backgroundColor(Color.Blue) | 218 | // .backgroundColor(Color.Blue) |
| 212 | } | 219 | } |
| @@ -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 | +} |
| 1 | import { DateTimeUtils, StringUtils, ToastUtils } from 'wdKit/Index' | 1 | import { DateTimeUtils, StringUtils, ToastUtils } from 'wdKit/Index' |
| 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' |
| 3 | -import { WDMessageCenterMessageType } from '../../../model/InteractMessageModel' | 3 | +import { Remark, WDMessageCenterMessageType } from '../../../model/InteractMessageModel' |
| 4 | import MinePageDatasModel from '../../../model/MinePageDatasModel' | 4 | import MinePageDatasModel from '../../../model/MinePageDatasModel' |
| 5 | import { MessageItem } from '../../../viewmodel/MessageItem' | 5 | import { MessageItem } from '../../../viewmodel/MessageItem' |
| 6 | import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh' | 6 | import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh' |
| @@ -66,6 +66,24 @@ export struct MessageListUI { | @@ -66,6 +66,24 @@ export struct MessageListUI { | ||
| 66 | if (value.activeInfo.title) { | 66 | if (value.activeInfo.title) { |
| 67 | item.desc = value.activeInfo.title.replace("null","") | 67 | item.desc = value.activeInfo.title.replace("null","") |
| 68 | } | 68 | } |
| 69 | + let remark = JSON.parse(value.activeInfo.remark) as Remark | ||
| 70 | + switch (value.activeInfo.contentType){ | ||
| 71 | + case "204": | ||
| 72 | + item.desc = remark.userName + "关注了你" | ||
| 73 | + break; | ||
| 74 | + case "206": | ||
| 75 | + item.desc = remark.userName +"赞了你的作品" | ||
| 76 | + break; | ||
| 77 | + case "207": | ||
| 78 | + item.desc = remark.userName + "赞了你的评论" | ||
| 79 | + break; | ||
| 80 | + case "208": | ||
| 81 | + item.desc = remark.userName + "评论了你的作品" | ||
| 82 | + break; | ||
| 83 | + case "209": | ||
| 84 | + item.desc = remark.userName + "回复了你的评论" | ||
| 85 | + break; | ||
| 86 | + } | ||
| 69 | if (value.activeInfo.time) { | 87 | if (value.activeInfo.time) { |
| 70 | item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.activeInfo.time) + "") | 88 | item.time = this.getPublishTime(value.subscribeInfo.time,DateTimeUtils.getDateTimestamp(value.activeInfo.time) + "") |
| 71 | } | 89 | } |
| 1 | +import { DateTimeUtils } from 'wdKit/Index'; | ||
| 2 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; | ||
| 1 | import { AppointmentListUI } from '../mine/appointment/AppointmentListUI' | 3 | import { AppointmentListUI } from '../mine/appointment/AppointmentListUI' |
| 2 | 4 | ||
| 3 | const TAG = "AppointmentListPage" | 5 | const TAG = "AppointmentListPage" |
| @@ -5,6 +7,19 @@ const TAG = "AppointmentListPage" | @@ -5,6 +7,19 @@ const TAG = "AppointmentListPage" | ||
| 5 | @Entry | 7 | @Entry |
| 6 | @Component | 8 | @Component |
| 7 | struct AppointmentListPage { | 9 | struct AppointmentListPage { |
| 10 | + pageShowTime:number = 0; | ||
| 11 | + pageHideTime:number = 0; | ||
| 12 | + | ||
| 13 | + onPageShow() { | ||
| 14 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + onPageHide(): void { | ||
| 18 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 19 | + let duration = 0 | ||
| 20 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 21 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.My_Saved_Live,TrackConstants.PageName.My_Saved_Live,duration) | ||
| 22 | + } | ||
| 8 | 23 | ||
| 9 | build() { | 24 | build() { |
| 10 | Column(){ | 25 | Column(){ |
| @@ -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({ |
| @@ -424,7 +424,7 @@ export struct PaperSingleColumn999CardView { | @@ -424,7 +424,7 @@ export struct PaperSingleColumn999CardView { | ||
| 424 | Text(this.item?.newsTitle) | 424 | Text(this.item?.newsTitle) |
| 425 | .fontColor('#222222') | 425 | .fontColor('#222222') |
| 426 | .fontSize(16) | 426 | .fontSize(16) |
| 427 | - .fontWeight(FontWeight.Bold) | 427 | + .fontWeight(FontWeight.Medium) |
| 428 | .alignSelf(ItemAlign.Start) | 428 | .alignSelf(ItemAlign.Start) |
| 429 | .maxLines(3) | 429 | .maxLines(3) |
| 430 | .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | 430 | .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 |
| @@ -478,6 +478,7 @@ export struct PaperSingleColumn999CardView { | @@ -478,6 +478,7 @@ export struct PaperSingleColumn999CardView { | ||
| 478 | if (this.item) { | 478 | if (this.item) { |
| 479 | Row() { | 479 | Row() { |
| 480 | Row() { | 480 | Row() { |
| 481 | + if (this.item?.source.length > 0) { | ||
| 481 | Text(this.item?.source) | 482 | Text(this.item?.source) |
| 482 | .fontSize(12) | 483 | .fontSize(12) |
| 483 | .fontColor('#B0B0B0') | 484 | .fontColor('#B0B0B0') |
| @@ -486,9 +487,12 @@ export struct PaperSingleColumn999CardView { | @@ -486,9 +487,12 @@ export struct PaperSingleColumn999CardView { | ||
| 486 | .width(16) | 487 | .width(16) |
| 487 | .height(16) | 488 | .height(16) |
| 488 | .margin({ top: 10, bottom: 10 }) | 489 | .margin({ top: 10, bottom: 10 }) |
| 490 | + } | ||
| 491 | + | ||
| 489 | Text(this.getPublishTime()) | 492 | Text(this.getPublishTime()) |
| 490 | .fontSize(12) | 493 | .fontSize(12) |
| 491 | .fontColor('#B0B0B0') | 494 | .fontColor('#B0B0B0') |
| 495 | + .margin({ left: this.item?.source.length > 0?0:16 }) | ||
| 492 | if (this.item.objectType != '2' && this.interactData && this.interactData.commentNum && Number(this.interactData.collectNum) > 0) { | 496 | if (this.item.objectType != '2' && this.interactData && this.interactData.commentNum && Number(this.interactData.collectNum) > 0) { |
| 493 | Text(this.interactData.commentNum + "评") | 497 | Text(this.interactData.commentNum + "评") |
| 494 | .fontSize(12) | 498 | .fontSize(12) |
| 1 | import { Params } from 'wdBean'; | 1 | import { Params } from 'wdBean'; |
| 2 | import { FollowFirstTabsComponent } from '../mine/follow/FollowFirstTabsComponent' | 2 | import { FollowFirstTabsComponent } from '../mine/follow/FollowFirstTabsComponent' |
| 3 | import router from '@ohos.router'; | 3 | import router from '@ohos.router'; |
| 4 | +import { DateTimeUtils } from 'wdKit/Index'; | ||
| 5 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; | ||
| 4 | 6 | ||
| 5 | @Entry | 7 | @Entry |
| 6 | @Component | 8 | @Component |
| 7 | struct FollowListPage { | 9 | struct FollowListPage { |
| 8 | @State params:Record<string, string> = router.getParams() as Record<string, string>; | 10 | @State params:Record<string, string> = router.getParams() as Record<string, string>; |
| 9 | @State curIndex: string = '0'; | 11 | @State curIndex: string = '0'; |
| 12 | + pageShowTime:number = 0; | ||
| 13 | + pageHideTime:number = 0; | ||
| 10 | 14 | ||
| 11 | onPageShow() { | 15 | onPageShow() { |
| 12 | this.curIndex = this.params?.['index']; | 16 | this.curIndex = this.params?.['index']; |
| 17 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + onPageHide(): void { | ||
| 21 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 22 | + let duration = 0 | ||
| 23 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 24 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.My_Follow,TrackConstants.PageName.My_Follow,duration) | ||
| 13 | } | 25 | } |
| 14 | 26 | ||
| 15 | build() { | 27 | build() { |
| @@ -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,Math.floor(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() |
| 1 | -import { PermissionUtil } from 'wdKit' | 1 | +import { DateTimeUtils, PermissionUtil } from 'wdKit' |
| 2 | import { PrivacySettingModel } from '../../model/PrivacySettingModel' | 2 | import { PrivacySettingModel } from '../../model/PrivacySettingModel' |
| 3 | import { Params } from 'wdBean'; | 3 | import { Params } from 'wdBean'; |
| 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 5 | import { HttpUtils } from 'wdNetwork/Index'; | 5 | import { HttpUtils } from 'wdNetwork/Index'; |
| 6 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; | ||
| 6 | 7 | ||
| 7 | const TAG = 'PrivacySettingPage'; | 8 | const TAG = 'PrivacySettingPage'; |
| 8 | const DiyString = '开启个性化推荐' | 9 | const DiyString = '开启个性化推荐' |
| @@ -15,9 +16,19 @@ export struct PrivacySettingPage { | @@ -15,9 +16,19 @@ export struct PrivacySettingPage { | ||
| 15 | tips: string = '设置前可查阅' | 16 | tips: string = '设置前可查阅' |
| 16 | privacyTips: string = '《隐私政策》' | 17 | privacyTips: string = '《隐私政策》' |
| 17 | tipsEnd = '中相应权限使用规则' | 18 | tipsEnd = '中相应权限使用规则' |
| 19 | + pageShowTime:number = 0; | ||
| 20 | + pageHideTime:number = 0; | ||
| 18 | 21 | ||
| 19 | onPageShow(): void { | 22 | onPageShow(): void { |
| 20 | this.getPermissionStatus(); | 23 | this.getPermissionStatus(); |
| 24 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + onPageHide(): void { | ||
| 28 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 29 | + let duration = 0 | ||
| 30 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 31 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Privacy_Setting,TrackConstants.PageName.Privacy_Setting,duration) | ||
| 21 | } | 32 | } |
| 22 | 33 | ||
| 23 | aboutToAppear() { | 34 | aboutToAppear() { |
| 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() |
| @@ -4,6 +4,7 @@ import { AccountAndSecurityLayout } from '../setting/AccountAndSecurityLayout'; | @@ -4,6 +4,7 @@ import { AccountAndSecurityLayout } from '../setting/AccountAndSecurityLayout'; | ||
| 4 | import router from '@ohos.router'; | 4 | import router from '@ohos.router'; |
| 5 | import { Action, Params } from 'wdBean'; | 5 | import { Action, Params } from 'wdBean'; |
| 6 | import { DateTimeUtils } from 'wdKit/Index'; | 6 | import { DateTimeUtils } from 'wdKit/Index'; |
| 7 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; | ||
| 7 | 8 | ||
| 8 | @Entry | 9 | @Entry |
| 9 | @Component | 10 | @Component |
| @@ -13,10 +14,39 @@ struct SettingPage { | @@ -13,10 +14,39 @@ struct SettingPage { | ||
| 13 | @State params:Params = router.getParams() as Params; | 14 | @State params:Params = router.getParams() as Params; |
| 14 | @State enterActivityTime:number = 0; | 15 | @State enterActivityTime:number = 0; |
| 15 | 16 | ||
| 16 | - onPageShow() { | 17 | + pageShowSettingTime:number = 0; |
| 18 | + pageHideSettingTime:number = 0; | ||
| 19 | + pageShowAccountTime:number = 0; | ||
| 20 | + pageHideAccountTime:number = 0; | ||
| 17 | 21 | ||
| 22 | + onPageShow() { | ||
| 18 | this.pageType = this.params.pageID; | 23 | this.pageType = this.params.pageID; |
| 19 | this.enterActivityTime = DateTimeUtils.getTimeStamp() | 24 | this.enterActivityTime = DateTimeUtils.getTimeStamp() |
| 25 | + if (this.pageType == 'mainSetting'){ | ||
| 26 | + this.pageShowSettingTime = DateTimeUtils.getTimeStamp() | ||
| 27 | + }else{ | ||
| 28 | + this.pageShowAccountTime = DateTimeUtils.getTimeStamp() | ||
| 29 | + } | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + onPageHide(): void { | ||
| 33 | + if (this.pageType == 'mainSetting'){ | ||
| 34 | + this.pageHideSettingTime = DateTimeUtils.getTimeStamp() | ||
| 35 | + }else{ | ||
| 36 | + this.pageHideAccountTime = DateTimeUtils.getTimeStamp() | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + let duration = 0 | ||
| 40 | + if(this.pageType == 'mainSetting'){ | ||
| 41 | + duration = Math.floor((this.pageHideSettingTime - this.pageShowSettingTime)/1000) | ||
| 42 | + }else{ | ||
| 43 | + duration = Math.floor((this.pageHideAccountTime - this.pageShowAccountTime)/1000) | ||
| 44 | + } | ||
| 45 | + if(this.pageType == 'mainSetting'){ | ||
| 46 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Setting,TrackConstants.PageName.Setting,duration) | ||
| 47 | + }else{ | ||
| 48 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Account_Management,TrackConstants.PageName.Account_Management,duration) | ||
| 49 | + } | ||
| 20 | } | 50 | } |
| 21 | 51 | ||
| 22 | build() { | 52 | build() { |
| @@ -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') |
| @@ -233,7 +233,11 @@ export struct OperRowListView { | @@ -233,7 +233,11 @@ export struct OperRowListView { | ||
| 233 | if (this.showCommentIcon) { | 233 | if (this.showCommentIcon) { |
| 234 | Column() { | 234 | Column() { |
| 235 | if (this.publishCommentModel?.targetId) { | 235 | if (this.publishCommentModel?.targetId) { |
| 236 | - CommentIconComponent({ publishCommentModel: this.publishCommentModel, styleType: this.styleType }) | 236 | + CommentIconComponent({ |
| 237 | + publishCommentModel: this.publishCommentModel, | ||
| 238 | + styleType: this.styleType, | ||
| 239 | + contentDetail: this.contentDetailData | ||
| 240 | + }) | ||
| 237 | .onClick(() => { | 241 | .onClick(() => { |
| 238 | this.onCommentIconClick() | 242 | this.onCommentIconClick() |
| 239 | 243 |
| 1 | import router from '@ohos.router' | 1 | import router from '@ohos.router' |
| 2 | -import { NetworkUtil, StringUtils } from 'wdKit'; | 2 | +import { DateTimeUtils, NetworkUtil, StringUtils } from 'wdKit'; |
| 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 4 | import { editModelParams } from '../model/EditInfoModel'; | 4 | import { editModelParams } from '../model/EditInfoModel'; |
| 5 | import { HomePageBottomCommentComponent } from '../components/mine/home/HomePageBottomCommentComponent'; | 5 | import { HomePageBottomCommentComponent } from '../components/mine/home/HomePageBottomCommentComponent'; |
| @@ -7,6 +7,7 @@ import { HomePageBottomFollowComponent } from '../components/mine/home/HomePageB | @@ -7,6 +7,7 @@ import { HomePageBottomFollowComponent } from '../components/mine/home/HomePageB | ||
| 7 | import MinePageDatasModel from '../model/MinePageDatasModel'; | 7 | import MinePageDatasModel from '../model/MinePageDatasModel'; |
| 8 | import { EmptyComponent } from '../components/view/EmptyComponent'; | 8 | import { EmptyComponent } from '../components/view/EmptyComponent'; |
| 9 | import { CustomTitleUI } from '../components/reusable/CustomTitleUI'; | 9 | import { CustomTitleUI } from '../components/reusable/CustomTitleUI'; |
| 10 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; | ||
| 10 | 11 | ||
| 11 | const TAG = "MineHomePage" | 12 | const TAG = "MineHomePage" |
| 12 | 13 | ||
| @@ -37,8 +38,11 @@ struct MineHomePage { | @@ -37,8 +38,11 @@ struct MineHomePage { | ||
| 37 | @State isCommentEnter:string = ""; | 38 | @State isCommentEnter:string = ""; |
| 38 | @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() | 39 | @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() |
| 39 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 40 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 41 | + pageShowTime:number = 0; | ||
| 42 | + pageHideTime:number = 0; | ||
| 40 | 43 | ||
| 41 | onPageShow(): void { | 44 | onPageShow(): void { |
| 45 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 42 | this.getUserInfo() | 46 | this.getUserInfo() |
| 43 | 47 | ||
| 44 | let intervalID = setInterval(() => { | 48 | let intervalID = setInterval(() => { |
| @@ -50,6 +54,13 @@ struct MineHomePage { | @@ -50,6 +54,13 @@ struct MineHomePage { | ||
| 50 | }, 200); | 54 | }, 200); |
| 51 | } | 55 | } |
| 52 | 56 | ||
| 57 | + onPageHide(): void { | ||
| 58 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 59 | + let duration = 0 | ||
| 60 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 61 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal,duration) | ||
| 62 | + } | ||
| 63 | + | ||
| 53 | build() { | 64 | build() { |
| 54 | if(this.isConnectNetwork){ | 65 | if(this.isConnectNetwork){ |
| 55 | Stack({ alignContent: Alignment.Top }){ | 66 | Stack({ alignContent: Alignment.Top }){ |
| 1 | import router from '@ohos.router' | 1 | import router from '@ohos.router' |
| 2 | import { Params } from 'wdBean'; | 2 | import { Params } from 'wdBean'; |
| 3 | -import { NetworkUtil, StringUtils } from 'wdKit'; | 3 | +import { DateTimeUtils, NetworkUtil, StringUtils } from 'wdKit'; |
| 4 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; | ||
| 4 | import { OtherHomePageBottomCommentComponent } from '../components/mine/home/OtherHomePageBottomCommentComponent'; | 5 | import { OtherHomePageBottomCommentComponent } from '../components/mine/home/OtherHomePageBottomCommentComponent'; |
| 5 | import { OtherHomePageBottomFollowComponent } from '../components/mine/home/OtherHomePageBottomFollowComponent'; | 6 | import { OtherHomePageBottomFollowComponent } from '../components/mine/home/OtherHomePageBottomFollowComponent'; |
| 6 | import { CustomTitleUI } from '../components/reusable/CustomTitleUI'; | 7 | import { CustomTitleUI } from '../components/reusable/CustomTitleUI'; |
| @@ -16,9 +17,20 @@ struct OtherNormalUserHomePage { | @@ -16,9 +17,20 @@ struct OtherNormalUserHomePage { | ||
| 16 | @State params:Record<string, string> = router.getParams() as Record<string, string>; | 17 | @State params:Record<string, string> = router.getParams() as Record<string, string>; |
| 17 | @Watch('change') @State curUserId: string = '-1'; | 18 | @Watch('change') @State curUserId: string = '-1'; |
| 18 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 19 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 20 | + pageShowTime:number = 0; | ||
| 21 | + pageHideTime:number = 0; | ||
| 22 | + | ||
| 19 | 23 | ||
| 20 | onPageShow() { | 24 | onPageShow() { |
| 21 | this.curUserId = this.params?.['userId']; | 25 | this.curUserId = this.params?.['userId']; |
| 26 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + onPageHide(): void { | ||
| 30 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 31 | + let duration = 0 | ||
| 32 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 33 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,duration) | ||
| 22 | } | 34 | } |
| 23 | 35 | ||
| 24 | change(){ | 36 | change(){ |
| 1 | +import { DateTimeUtils } from 'wdKit/Index'; | ||
| 2 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; | ||
| 1 | import { SearchComponent } from '../components/search/SearchComponent' | 3 | import { SearchComponent } from '../components/search/SearchComponent' |
| 2 | 4 | ||
| 3 | @Entry | 5 | @Entry |
| 4 | @Component | 6 | @Component |
| 5 | struct SearchPage { | 7 | struct SearchPage { |
| 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.Search,TrackConstants.PageName.Search,duration) | ||
| 20 | + } | ||
| 21 | + | ||
| 6 | build() { | 22 | build() { |
| 7 | Column(){ | 23 | Column(){ |
| 8 | SearchComponent() | 24 | SearchComponent() |
| @@ -41,11 +41,23 @@ class SystemInfo{ | @@ -41,11 +41,23 @@ class SystemInfo{ | ||
| 41 | time: string = "" | 41 | time: string = "" |
| 42 | title: string = "" | 42 | title: string = "" |
| 43 | userId: number = -1 | 43 | userId: number = -1 |
| 44 | + remark: string = "" | ||
| 44 | } | 45 | } |
| 45 | 46 | ||
| 46 | class ActiveInfo{ | 47 | class ActiveInfo{ |
| 47 | - id:string = "" | 48 | + classify: string = "" |
| 49 | + contentId: string = "" | ||
| 50 | + contentType: string = "" | ||
| 51 | + id: number = -1 | ||
| 48 | message: string = "" | 52 | message: string = "" |
| 53 | + platform: string = "" | ||
| 54 | + privateMailId: number = -1 | ||
| 55 | + privateMailIds: string = "" | ||
| 56 | + privateMailNum: number = -1 | ||
| 57 | + read: boolean = false | ||
| 58 | + source: string = "" | ||
| 49 | time: string = "" | 59 | time: string = "" |
| 50 | title: string = "" | 60 | title: string = "" |
| 61 | + userId: number = -1 | ||
| 62 | + remark: string = "" | ||
| 51 | } | 63 | } |
| @@ -80,7 +80,7 @@ export class PageHelper { | @@ -80,7 +80,7 @@ export class PageHelper { | ||
| 80 | return; | 80 | return; |
| 81 | } | 81 | } |
| 82 | pageModel.pageInfo = pageInfo; | 82 | pageModel.pageInfo = pageInfo; |
| 83 | - pageModel.cachePageInfoMd5 = pageInfo.md5 | 83 | + pageModel.displayPageInfoMd5 = pageInfo.md5 |
| 84 | //解析页面挂角广告资源 | 84 | //解析页面挂角广告资源 |
| 85 | pageAdvModel.analysisAdvSource(pageInfo); | 85 | pageAdvModel.analysisAdvSource(pageInfo); |
| 86 | this.parseGroup(pageModel, true) | 86 | this.parseGroup(pageModel, true) |
| @@ -129,7 +129,7 @@ export class PageHelper { | @@ -129,7 +129,7 @@ export class PageHelper { | ||
| 129 | return; | 129 | return; |
| 130 | } | 130 | } |
| 131 | pageModel.pageInfo = pageInfo; | 131 | pageModel.pageInfo = pageInfo; |
| 132 | - if (pageInfo.md5 == pageModel.cachePageInfoMd5) { | 132 | + if (pageInfo.md5 == pageModel.displayPageInfoMd5) { |
| 133 | // 缓存一致,不解析 | 133 | // 缓存一致,不解析 |
| 134 | Logger.debug(TAG, 'getPageInfo 与缓存一致,不解析广告。。。') | 134 | Logger.debug(TAG, 'getPageInfo 与缓存一致,不解析广告。。。') |
| 135 | } else { | 135 | } else { |
| @@ -138,6 +138,7 @@ export class PageHelper { | @@ -138,6 +138,7 @@ export class PageHelper { | ||
| 138 | // 保存缓存 | 138 | // 保存缓存 |
| 139 | CacheData.saveCacheData(CacheData.comPageInfoCacheKey + pageModel.pageId, pageInfo, pageInfo.md5) | 139 | CacheData.saveCacheData(CacheData.comPageInfoCacheKey + pageModel.pageId, pageInfo, pageInfo.md5) |
| 140 | } | 140 | } |
| 141 | + pageModel.displayPageInfoMd5 = pageInfo.md5 | ||
| 141 | //解析页面挂角广告资源 | 142 | //解析页面挂角广告资源 |
| 142 | pageAdvModel.analysisAdvSource(pageInfo); | 143 | pageAdvModel.analysisAdvSource(pageInfo); |
| 143 | } | 144 | } |
| @@ -185,15 +186,25 @@ export class PageHelper { | @@ -185,15 +186,25 @@ export class PageHelper { | ||
| 185 | Logger.debug(TAG, 'parseGroup isCache: ' + isCache) | 186 | Logger.debug(TAG, 'parseGroup isCache: ' + isCache) |
| 186 | if (isCache) { | 187 | if (isCache) { |
| 187 | pageDto = await PageViewModel.getPageGroupCacheData(pageModel.bizCopy()) as PageDTO | 188 | pageDto = await PageViewModel.getPageGroupCacheData(pageModel.bizCopy()) as PageDTO |
| 188 | - pageModel.cacheGroupInfoMd5 = pageDto.md5 | 189 | + pageModel.displayGroupInfoMd5 = pageDto.md5 |
| 189 | } else { | 190 | } else { |
| 190 | pageDto = await PageViewModel.getPageGroupCompData(pageModel.bizCopy()) as PageDTO | 191 | pageDto = await PageViewModel.getPageGroupCompData(pageModel.bizCopy()) as PageDTO |
| 191 | - if (pageDto.md5 == pageModel.cacheGroupInfoMd5) { | 192 | + if (pageDto.md5 == pageModel.displayGroupInfoMd5) { |
| 192 | Logger.debug(TAG, 'parseGroup cache load, return: ' + pageDto.md5) | 193 | Logger.debug(TAG, 'parseGroup cache load, return: ' + pageDto.md5) |
| 194 | + // 下拉刷新场景,数据没变,拦截刷新UI,重置相关参数 | ||
| 195 | + if (pageModel.loadStrategy === 2) { | ||
| 193 | // 缓存数据一致,不再刷新 | 196 | // 缓存数据一致,不再刷新 |
| 197 | + this.refreshUIEnd(pageModel, true) | ||
| 198 | + // 第一页不刷新,分页数据清除 | ||
| 199 | + pageModel.hasMore = true | ||
| 200 | + this.deleteMorePage(pageModel) | ||
| 201 | + pageModel.pageTotalCompSize = pageModel.compList.size() | ||
| 202 | + } | ||
| 203 | + pageModel.currentPage++ | ||
| 194 | return | 204 | return |
| 195 | } | 205 | } |
| 196 | - Logger.debug(TAG, 'parseGroup cache load, save: ') | 206 | + pageModel.displayGroupInfoMd5 = pageDto.md5 |
| 207 | + Logger.debug(TAG, 'parseGroup cache load, save: ' + pageDto.md5) | ||
| 197 | // 保存缓存 | 208 | // 保存缓存 |
| 198 | CacheData.saveCacheData(CacheData.compGroupInfoDataCacheKey + pageModel.pageId + pageModel.groupId, pageDto, | 209 | CacheData.saveCacheData(CacheData.compGroupInfoDataCacheKey + pageModel.pageId + pageModel.groupId, pageDto, |
| 199 | pageDto.md5) | 210 | pageDto.md5) |
| @@ -238,9 +249,11 @@ export class PageHelper { | @@ -238,9 +249,11 @@ export class PageHelper { | ||
| 238 | 249 | ||
| 239 | // 批查互动数据 | 250 | // 批查互动数据 |
| 240 | this.allCompBatchRequest(pageInfo.oneRequestPageGroupCompList.convertToArray(), pageModel) | 251 | this.allCompBatchRequest(pageInfo.oneRequestPageGroupCompList.convertToArray(), pageModel) |
| 241 | - | ||
| 242 | - // | 252 | + // 记录第一页数量 |
| 253 | + this.saveFirstPageEndIndex(pageModel) | ||
| 254 | + if (!isCache) { | ||
| 243 | pageModel.currentPage++ | 255 | pageModel.currentPage++ |
| 256 | + } | ||
| 244 | pageModel.viewType = ViewType.LOADED | 257 | pageModel.viewType = ViewType.LOADED |
| 245 | this.refreshUIEnd(pageModel, true) | 258 | this.refreshUIEnd(pageModel, true) |
| 246 | 259 | ||
| @@ -754,6 +767,40 @@ export class PageHelper { | @@ -754,6 +767,40 @@ export class PageHelper { | ||
| 754 | } | 767 | } |
| 755 | 768 | ||
| 756 | } | 769 | } |
| 770 | + | ||
| 771 | + saveFirstPageEndIndex(pageModel: PageModel) { | ||
| 772 | + pageModel.firstPageEndIndex = pageModel.compList.size() - 1 | ||
| 773 | + } | ||
| 774 | + | ||
| 775 | + static updateFirstPageEndIndex(pageModel: PageModel, isDel: boolean, index: number) { | ||
| 776 | + if (index > pageModel.firstPageEndIndex) { | ||
| 777 | + return | ||
| 778 | + } | ||
| 779 | + // 这里默认删除、添加都是一条一条处理 | ||
| 780 | + let count = 1 | ||
| 781 | + let endIndex = pageModel.firstPageEndIndex | ||
| 782 | + if (isDel) { | ||
| 783 | + // 第一页里删除 | ||
| 784 | + let offset = Math.min(endIndex - index, count) | ||
| 785 | + endIndex = endIndex - offset | ||
| 786 | + } else { | ||
| 787 | + // 第一页里添加 | ||
| 788 | + endIndex = endIndex + count | ||
| 789 | + } | ||
| 790 | + pageModel.firstPageEndIndex = endIndex | ||
| 791 | + } | ||
| 792 | + | ||
| 793 | + /** | ||
| 794 | + * 删除分页数据,保留第一页的数据。(下拉刷新场景用到) | ||
| 795 | + */ | ||
| 796 | + deleteMorePage(pageModel: PageModel) { | ||
| 797 | + Logger.debug(TAG, 'deleteMorePage endindex: ' + pageModel.firstPageEndIndex) | ||
| 798 | + if (pageModel.firstPageEndIndex < 0) { | ||
| 799 | + return | ||
| 800 | + } | ||
| 801 | + // 从第二页开始删 | ||
| 802 | + pageModel.compList.deleteItems(pageModel.firstPageEndIndex + 1) | ||
| 803 | + } | ||
| 757 | } | 804 | } |
| 758 | 805 | ||
| 759 | 806 |
| @@ -63,9 +63,11 @@ export default class PageModel { | @@ -63,9 +63,11 @@ export default class PageModel { | ||
| 63 | pageType: number = 0; | 63 | pageType: number = 0; |
| 64 | 64 | ||
| 65 | extra: string = '' | 65 | extra: string = '' |
| 66 | - // 缓存数据相关 | ||
| 67 | - cachePageInfoMd5: string = '' | ||
| 68 | - cacheGroupInfoMd5: string = '' | 66 | + // 页面加载,md5数据相关(初始缓存、下拉刷新用到) |
| 67 | + displayPageInfoMd5: string = '' | ||
| 68 | + displayGroupInfoMd5: string = '' | ||
| 69 | + // 第一页,最后一个comp下标,用于区分分页加载(下拉刷新,清除分页数据) | ||
| 70 | + firstPageEndIndex = -1 | ||
| 69 | 71 | ||
| 70 | /** | 72 | /** |
| 71 | * 简单复制业务数据 | 73 | * 简单复制业务数据 |
479 Bytes
| @@ -12,6 +12,7 @@ | @@ -12,6 +12,7 @@ | ||
| 12 | "wdWebComponent": "file:../../commons/wdWebComponent", | 12 | "wdWebComponent": "file:../../commons/wdWebComponent", |
| 13 | "wdBean": "file:../../features/wdBean", | 13 | "wdBean": "file:../../features/wdBean", |
| 14 | "wdRouter": "file:../../commons/wdRouter", | 14 | "wdRouter": "file:../../commons/wdRouter", |
| 15 | - "wdNetwork": "file:../../commons/wdNetwork" | 15 | + "wdNetwork": "file:../../commons/wdNetwork", |
| 16 | + "wdTracking": "file:../../features/wdTracking" | ||
| 16 | } | 17 | } |
| 17 | } | 18 | } |
| @@ -10,6 +10,7 @@ import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/mai | @@ -10,6 +10,7 @@ import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/mai | ||
| 10 | import HuaweiAuth from '../../utils/HuaweiAuth' | 10 | import HuaweiAuth from '../../utils/HuaweiAuth' |
| 11 | import { loginComponentManager, LoginWithHuaweiIDButton } from '@hms.core.account.LoginComponent' | 11 | import { loginComponentManager, LoginWithHuaweiIDButton } from '@hms.core.account.LoginComponent' |
| 12 | import { BusinessError } from '@ohos.base' | 12 | import { BusinessError } from '@ohos.base' |
| 13 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index' | ||
| 13 | 14 | ||
| 14 | @Extend(Row) | 15 | @Extend(Row) |
| 15 | function otherStyle() { | 16 | function otherStyle() { |
| @@ -55,6 +56,8 @@ struct LoginPage { | @@ -55,6 +56,8 @@ struct LoginPage { | ||
| 55 | customStyle: true, | 56 | customStyle: true, |
| 56 | maskColor:"#00000000" | 57 | maskColor:"#00000000" |
| 57 | }) | 58 | }) |
| 59 | + pageShowTime:number = 0; | ||
| 60 | + pageHideTime:number = 0; | ||
| 58 | 61 | ||
| 59 | loginViewModel = new LoginViewModel() | 62 | loginViewModel = new LoginViewModel() |
| 60 | @State isProtocol:boolean=false | 63 | @State isProtocol:boolean=false |
| @@ -70,7 +73,15 @@ struct LoginPage { | @@ -70,7 +73,15 @@ struct LoginPage { | ||
| 70 | } | 73 | } |
| 71 | 74 | ||
| 72 | onPageShow() { | 75 | onPageShow() { |
| 73 | - Logger.debug(TAG, "onPageShow:" + this.isCodeSend + "") | 76 | + Logger.debug(TAG, "onPageShow:" + this.isCodeSend + " ") |
| 77 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + onPageHide(): void { | ||
| 81 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 82 | + let duration = 0 | ||
| 83 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 84 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page,duration) | ||
| 74 | } | 85 | } |
| 75 | 86 | ||
| 76 | build() { | 87 | build() { |
| 1 | -import { CustomToast} from 'wdKit/Index'; | 1 | +import { CustomToast, DateTimeUtils} from 'wdKit/Index'; |
| 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 3 | import { LoginModel } from './LoginModel'; | 3 | import { LoginModel } from './LoginModel'; |
| 4 | import { ModifyPasswordRequestItem } from './ModifyPasswordRequestItem'; | 4 | import { ModifyPasswordRequestItem } from './ModifyPasswordRequestItem'; |
| 5 | import { router } from '@kit.ArkUI'; | 5 | import { router } from '@kit.ArkUI'; |
| 6 | import { encryptMessage } from '../../utils/cryptoUtil'; | 6 | import { encryptMessage } from '../../utils/cryptoUtil'; |
| 7 | +import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; | ||
| 7 | 8 | ||
| 8 | /** | 9 | /** |
| 9 | * 修改密码页面 | 10 | * 修改密码页面 |
| @@ -26,7 +27,19 @@ struct ModifyPasswordPage { | @@ -26,7 +27,19 @@ struct ModifyPasswordPage { | ||
| 26 | customStyle: true, | 27 | customStyle: true, |
| 27 | maskColor:"#00000000" | 28 | maskColor:"#00000000" |
| 28 | }) | 29 | }) |
| 30 | + pageShowTime:number = 0; | ||
| 31 | + pageHideTime:number = 0; | ||
| 29 | 32 | ||
| 33 | + onPageShow() { | ||
| 34 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + onPageHide(): void { | ||
| 38 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 39 | + let duration = 0 | ||
| 40 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 41 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Change_Passwd,TrackConstants.PageName.Change_Passwd,duration) | ||
| 42 | + } | ||
| 30 | 43 | ||
| 31 | build() { | 44 | build() { |
| 32 | Row() { | 45 | Row() { |
| @@ -97,7 +97,7 @@ export namespace TrackConstants { | @@ -97,7 +97,7 @@ export namespace TrackConstants { | ||
| 97 | 97 | ||
| 98 | /// 设置页 | 98 | /// 设置页 |
| 99 | Setting = "settingPage", | 99 | Setting = "settingPage", |
| 100 | - /// 账号管理 | 100 | + /// 账号管理//账户与安全 |
| 101 | Account_Management = "accountManagementPage", | 101 | Account_Management = "accountManagementPage", |
| 102 | /// 注销账户 | 102 | /// 注销账户 |
| 103 | Cancel_Account = "cancelAccountPage", | 103 | Cancel_Account = "cancelAccountPage", |
-
Please register or login to post a comment