Showing
6 changed files
with
95 additions
and
69 deletions
| @@ -4,6 +4,8 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel' | @@ -4,6 +4,8 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel' | ||
| 4 | import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem' | 4 | import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem' |
| 5 | import { CommentListItem } from '../../../viewmodel/CommentListItem' | 5 | import { CommentListItem } from '../../../viewmodel/CommentListItem' |
| 6 | import measure from '@ohos.measure' | 6 | import measure from '@ohos.measure' |
| 7 | +import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index' | ||
| 8 | +import { ProcessUtils } from 'wdRouter/Index' | ||
| 7 | 9 | ||
| 8 | @Component | 10 | @Component |
| 9 | export struct ChildCommentComponent { | 11 | export struct ChildCommentComponent { |
| @@ -189,6 +191,11 @@ export struct ChildCommentComponent { | @@ -189,6 +191,11 @@ export struct ChildCommentComponent { | ||
| 189 | .width('100%') | 191 | .width('100%') |
| 190 | .height('69lpx') | 192 | .height('69lpx') |
| 191 | .justifyContent(FlexAlign.SpaceBetween) | 193 | .justifyContent(FlexAlign.SpaceBetween) |
| 194 | + .onClick(()=>{ | ||
| 195 | + let content = getParams(this.data) | ||
| 196 | + TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,TrackParamConvert.program(content)) | ||
| 197 | + ProcessUtils.processPage(content) | ||
| 198 | + }) | ||
| 192 | 199 | ||
| 193 | }.height('69lpx') | 200 | }.height('69lpx') |
| 194 | .justifyContent(FlexAlign.Center) | 201 | .justifyContent(FlexAlign.Center) |
| @@ -90,12 +90,12 @@ export struct HomePageBottomCommentComponent { | @@ -90,12 +90,12 @@ export struct HomePageBottomCommentComponent { | ||
| 90 | isLastItem: index === this.data_comment.totalCount() - 1 | 90 | isLastItem: index === this.data_comment.totalCount() - 1 |
| 91 | }) | 91 | }) |
| 92 | } | 92 | } |
| 93 | - .onClick(()=>{ | ||
| 94 | - let content = getParams(item) | ||
| 95 | - TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal,TrackParamConvert.program(content)) | ||
| 96 | - content.customParamTargetLayout = "comment" | ||
| 97 | - ProcessUtils.processPage(content) | ||
| 98 | - }) | 93 | + // .onClick(()=>{ |
| 94 | + // let content = getParams(item) | ||
| 95 | + // TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal,TrackParamConvert.program(content)) | ||
| 96 | + // content.customParamTargetLayout = "comment" | ||
| 97 | + // ProcessUtils.processPage(content) | ||
| 98 | + // }) | ||
| 99 | .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { | 99 | .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { |
| 100 | if (isVisible) { | 100 | if (isVisible) { |
| 101 | let contentDTO = getParams(item) | 101 | let contentDTO = getParams(item) |
| @@ -91,11 +91,7 @@ export struct OtherHomePageBottomCommentComponent { | @@ -91,11 +91,7 @@ export struct OtherHomePageBottomCommentComponent { | ||
| 91 | isLastItem: index === this.data_comment.totalCount() - 1, | 91 | isLastItem: index === this.data_comment.totalCount() - 1, |
| 92 | }) | 92 | }) |
| 93 | } | 93 | } |
| 94 | - .onClick(()=>{ | ||
| 95 | - let content = getParams(item) | ||
| 96 | - TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,TrackParamConvert.program(content)) | ||
| 97 | - ProcessUtils.processPage(content) | ||
| 98 | - }).onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { | 94 | + .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { |
| 99 | if (isVisible) { | 95 | if (isVisible) { |
| 100 | let contentDTO = getParams(item) | 96 | let contentDTO = getParams(item) |
| 101 | //埋点crash 后面看看 | 97 | //埋点crash 后面看看 |
| @@ -128,58 +128,81 @@ struct OneKeyLoginPage { | @@ -128,58 +128,81 @@ struct OneKeyLoginPage { | ||
| 128 | .padding({top: `${this.topSafeHeight}px`}) | 128 | .padding({top: `${this.topSafeHeight}px`}) |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | + // @Builder loginButton() { | ||
| 132 | + // Column() { | ||
| 133 | + // LoginWithHuaweiIDButton({ | ||
| 134 | + // params: { | ||
| 135 | + // // LoginWithHuaweiIDButton支持的样式。 | ||
| 136 | + // style: loginComponentManager.Style.BUTTON_CUSTOM, | ||
| 137 | + // // LoginWithHuaweiIDButton的边框圆角半径。 | ||
| 138 | + // borderRadius: 4, | ||
| 139 | + // // LoginWithHuaweiIDButton支持的登录类型。 | ||
| 140 | + // loginType: loginComponentManager.LoginType.QUICK_LOGIN, | ||
| 141 | + // // LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。 | ||
| 142 | + // supportDarkMode: true, | ||
| 143 | + // customButtonParams: { | ||
| 144 | + // fontColor: loginComponentManager.FontColor.WHITE, | ||
| 145 | + // // backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800" | ||
| 146 | + // backgroundColor:"#ED2800" | ||
| 147 | + // } | ||
| 148 | + // }, | ||
| 149 | + // controller: this.controller | ||
| 150 | + // }) | ||
| 151 | + // } | ||
| 152 | + // .backgroundColor("#ED2800") | ||
| 153 | + // .height(48) | ||
| 154 | + // .margin({ top: 20 ,left: 25, right: 25 }) | ||
| 155 | + // } | ||
| 156 | + | ||
| 131 | @Builder loginButton() { | 157 | @Builder loginButton() { |
| 132 | - Column() { | ||
| 133 | - LoginWithHuaweiIDButton({ | ||
| 134 | - params: { | ||
| 135 | - // LoginWithHuaweiIDButton支持的样式。 | ||
| 136 | - style: loginComponentManager.Style.BUTTON_CUSTOM, | ||
| 137 | - // LoginWithHuaweiIDButton的边框圆角半径。 | ||
| 138 | - borderRadius: 4, | ||
| 139 | - // LoginWithHuaweiIDButton支持的登录类型。 | ||
| 140 | - loginType: loginComponentManager.LoginType.QUICK_LOGIN, | ||
| 141 | - // LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。 | ||
| 142 | - supportDarkMode: true, | ||
| 143 | - customButtonParams: { | ||
| 144 | - fontColor: loginComponentManager.FontColor.WHITE, | ||
| 145 | - // backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800" | ||
| 146 | - backgroundColor:"#ED2800" | 158 | + Row() { |
| 159 | + Stack(){ | ||
| 160 | + Button() { | ||
| 161 | + Row() { | ||
| 162 | + Image($r("app.media.huawei_one_key_login_icon")) | ||
| 163 | + .width(24).height(24) | ||
| 164 | + Text("华为账号一键登录") | ||
| 165 | + .fontColor(Color.White) | ||
| 166 | + .margin({left:5}) | ||
| 147 | } | 167 | } |
| 148 | - }, | ||
| 149 | - controller: this.controller | ||
| 150 | - }) | 168 | + } |
| 169 | + .width('100%') | ||
| 170 | + .height(48) | ||
| 171 | + .borderRadius(4) | ||
| 172 | + .type(ButtonType.Normal) | ||
| 173 | + .backgroundColor("#ED2800") | ||
| 174 | + | ||
| 175 | + Stack(){ | ||
| 176 | + //目前不支持文字和图标同时展示,后面优化 | ||
| 177 | + LoginWithHuaweiIDButton({ | ||
| 178 | + params: { | ||
| 179 | + // LoginWithHuaweiIDButton支持的样式。 | ||
| 180 | + style: loginComponentManager.Style.BUTTON_CUSTOM, | ||
| 181 | + // LoginWithHuaweiIDButton的边框圆角半径。 | ||
| 182 | + // borderRadius: 4, | ||
| 183 | + // LoginWithHuaweiIDButton支持的登录类型。 | ||
| 184 | + loginType: loginComponentManager.LoginType.QUICK_LOGIN, | ||
| 185 | + // LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。 | ||
| 186 | + // supportDarkMode: true, | ||
| 187 | + customButtonParams: { | ||
| 188 | + fontColor: loginComponentManager.FontColor.WHITE, | ||
| 189 | + // backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800" | ||
| 190 | + backgroundColor:"#ED2800" | ||
| 191 | + } | ||
| 192 | + }, | ||
| 193 | + controller: this.controller | ||
| 194 | + }).opacity(0) | ||
| 195 | + } | ||
| 196 | + .width('100%') | ||
| 197 | + .height('100%') | ||
| 198 | + } | ||
| 151 | } | 199 | } |
| 152 | .height(48) | 200 | .height(48) |
| 153 | - .margin({ top: 20 ,left: 25, right: 25 }) | 201 | + .width("100%") |
| 202 | + .padding({ left: 25, right: 25 }) | ||
| 203 | + .margin({top: 20}) | ||
| 154 | } | 204 | } |
| 155 | 205 | ||
| 156 | - // @Builder loginButton() { | ||
| 157 | - // Row() { | ||
| 158 | - // Button() { | ||
| 159 | - // Row() { | ||
| 160 | - // Image($r("app.media.huawei_one_key_login_icon")) | ||
| 161 | - // .width(24).height(24) | ||
| 162 | - // Text("华为账号一键登录") | ||
| 163 | - // .fontColor(Color.White) | ||
| 164 | - // } | ||
| 165 | - // } | ||
| 166 | - // .type(ButtonType.Normal) | ||
| 167 | - // .height(48) | ||
| 168 | - // .backgroundColor(!this.agreeProtocol ? "#60ED2800" : "#ED2800") | ||
| 169 | - // .width("100%") | ||
| 170 | - // .onClick((event) => { | ||
| 171 | - // if (!this.agreeProtocol) { | ||
| 172 | - // return | ||
| 173 | - // } | ||
| 174 | - // | ||
| 175 | - // TrackingButton.click("oneClickLoginPageLoginButton", this.pageName, this.pageName) | ||
| 176 | - // this.requestLogin() | ||
| 177 | - // }) | ||
| 178 | - // } | ||
| 179 | - // .padding({ left: 25, right: 25 }) | ||
| 180 | - // .margin({top: 20}) | ||
| 181 | - // } | ||
| 182 | - | ||
| 183 | @Builder ProtocolRow() { | 206 | @Builder ProtocolRow() { |
| 184 | Row({space: 4}) { | 207 | Row({space: 4}) { |
| 185 | Image(this.agreeProtocol ? $r('app.media.login_checkbox_select') : $r('app.media.login_checkbox_unselected')) | 208 | Image(this.agreeProtocol ? $r('app.media.login_checkbox_select') : $r('app.media.login_checkbox_unselected')) |
| @@ -21,7 +21,7 @@ export class PublicParams { | @@ -21,7 +21,7 @@ export class PublicParams { | ||
| 21 | "isSign": AccountManagerUtils.isLoginSync() ? "1" : "0", | 21 | "isSign": AccountManagerUtils.isLoginSync() ? "1" : "0", |
| 22 | "environment": PublicParams.getEnv(), | 22 | "environment": PublicParams.getEnv(), |
| 23 | "os": AppUtils.getOSName(), | 23 | "os": AppUtils.getOSName(), |
| 24 | - "actionTime": Math.log(new Date().getTime() / 1000), | 24 | + "actionTime": Math.floor(new Date().getTime() / 1000), |
| 25 | "channel": AppUtils.getAppChannel(), | 25 | "channel": AppUtils.getAppChannel(), |
| 26 | "version": AppUtils.getAppVersionName(), | 26 | "version": AppUtils.getAppVersionName(), |
| 27 | "deviceId": DeviceUtil.clientId(), | 27 | "deviceId": DeviceUtil.clientId(), |
| @@ -24,17 +24,17 @@ export class Tracking { | @@ -24,17 +24,17 @@ export class Tracking { | ||
| 24 | // Logger.error('yyyy','event track failed') | 24 | // Logger.error('yyyy','event track failed') |
| 25 | // }) | 25 | // }) |
| 26 | 26 | ||
| 27 | - // let publicParams = new PublicParams() | ||
| 28 | - // publicParams.getPublicParams().then((pubParams) => { | ||
| 29 | - // | ||
| 30 | - // if (params) { | ||
| 31 | - // for (const obj of Object.entries(params)) { | ||
| 32 | - // // Logger.info(TAG, ` ${obj[0]} => ` + `${obj[1]}`); | ||
| 33 | - // pubParams[obj[0]] = obj[1] | ||
| 34 | - // } | ||
| 35 | - // } | ||
| 36 | - // sensors.track(eventId, pubParams) | ||
| 37 | - // }) | 27 | + let publicParams = new PublicParams() |
| 28 | + publicParams.getPublicParams().then((pubParams) => { | ||
| 29 | + | ||
| 30 | + if (params) { | ||
| 31 | + for (const obj of Object.entries(params)) { | ||
| 32 | + // Logger.info(TAG, ` ${obj[0]} => ` + `${obj[1]}`); | ||
| 33 | + pubParams[obj[0]] = obj[1] | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | + sensors.track(eventId, pubParams) | ||
| 37 | + }) | ||
| 38 | } | 38 | } |
| 39 | } | 39 | } |
| 40 | 40 |
-
Please register or login to post a comment