Showing
6 changed files
with
44 additions
and
15 deletions
| @@ -144,7 +144,8 @@ export struct MorningEveningPaperComponent { | @@ -144,7 +144,8 @@ export struct MorningEveningPaperComponent { | ||
| 144 | 144 | ||
| 145 | Logger.info(TAG, "pageInfoBean dateTime = " + dateTime) | 145 | Logger.info(TAG, "pageInfoBean dateTime = " + dateTime) |
| 146 | Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle) | 146 | Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle) |
| 147 | - this.setComponentBgColor(pageInfoBean.backgroundImgUrl) | 147 | + |
| 148 | + this.setComponentBgColor(this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string) | ||
| 148 | 149 | ||
| 149 | let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) | 150 | let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) |
| 150 | // this.compInfoBean = compInfoBean | 151 | // this.compInfoBean = compInfoBean |
| @@ -223,8 +224,7 @@ export struct MorningEveningPaperComponent { | @@ -223,8 +224,7 @@ export struct MorningEveningPaperComponent { | ||
| 223 | effectKit.createColorPicker(pixelMap, (err, colorPicker) => { | 224 | effectKit.createColorPicker(pixelMap, (err, colorPicker) => { |
| 224 | let color = colorPicker.getMainColorSync(); | 225 | let color = colorPicker.getMainColorSync(); |
| 225 | Logger.debug(TAG, "compInfoBean compStyle = " + color) | 226 | Logger.debug(TAG, "compInfoBean compStyle = " + color) |
| 226 | - | ||
| 227 | - color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha}) | 227 | + // color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha}) |
| 228 | // 将取色器选取的color示例转换为十六进制颜色代码 | 228 | // 将取色器选取的color示例转换为十六进制颜色代码 |
| 229 | this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16); | 229 | this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16); |
| 230 | Logger.debug(TAG, "compInfoBean compStyle = " + this.mixedBgColor) | 230 | Logger.debug(TAG, "compInfoBean compStyle = " + this.mixedBgColor) |
| @@ -272,18 +272,17 @@ export struct MorningEveningPaperComponent { | @@ -272,18 +272,17 @@ export struct MorningEveningPaperComponent { | ||
| 272 | } | 272 | } |
| 273 | .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`).scrollBar(BarState.Off) | 273 | .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`).scrollBar(BarState.Off) |
| 274 | 274 | ||
| 275 | - PaperTitleComponent() | 275 | + PaperTitleComponent().margin({top:this.topSafeHeight}) |
| 276 | } | 276 | } |
| 277 | .width('100%') | 277 | .width('100%') |
| 278 | .height('100%') | 278 | .height('100%') |
| 279 | - .padding({ | ||
| 280 | - top: this.topSafeHeight, | ||
| 281 | - bottom: this.bottomSafeHeight | ||
| 282 | - }) | 279 | + // .padding({ |
| 280 | + // top: this.topSafeHeight, | ||
| 281 | + // bottom: this.bottomSafeHeight | ||
| 282 | + // }) | ||
| 283 | // .backgroundColor(Color.Black) | 283 | // .backgroundColor(Color.Black) |
| 284 | // .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black) | 284 | // .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black) |
| 285 | .backgroundColor(this.mixedBgColor ?? Color.Black) | 285 | .backgroundColor(this.mixedBgColor ?? Color.Black) |
| 286 | - | ||
| 287 | } | 286 | } |
| 288 | 287 | ||
| 289 | @Builder | 288 | @Builder |
| @@ -32,6 +32,7 @@ export struct topicInfoView { | @@ -32,6 +32,7 @@ export struct topicInfoView { | ||
| 32 | }) | 32 | }) |
| 33 | .id('img_cover') | 33 | .id('img_cover') |
| 34 | 34 | ||
| 35 | + if (this.frontLinkObject) { | ||
| 35 | Row() { | 36 | Row() { |
| 36 | Text("查看详情") | 37 | Text("查看详情") |
| 37 | .fontSize(14) | 38 | .fontSize(14) |
| @@ -49,19 +50,19 @@ export struct topicInfoView { | @@ -49,19 +50,19 @@ export struct topicInfoView { | ||
| 49 | .margin({ top: 8, left: 16, right: 16, bottom: 16 }) | 50 | .margin({ top: 8, left: 16, right: 16, bottom: 16 }) |
| 50 | .borderRadius(2) | 51 | .borderRadius(2) |
| 51 | .onClick(()=>{ | 52 | .onClick(()=>{ |
| 52 | - if (this.frontLinkObject) { | ||
| 53 | let contentDTO :ContentDTO = new ContentDTO(); | 53 | let contentDTO :ContentDTO = new ContentDTO(); |
| 54 | contentDTO.objectType = this.frontLinkObject?.newsType.toString() | 54 | contentDTO.objectType = this.frontLinkObject?.newsType.toString() |
| 55 | contentDTO.objectId = this.frontLinkObject?.newsId | 55 | contentDTO.objectId = this.frontLinkObject?.newsId |
| 56 | contentDTO.linkUrl = this.frontLinkObject?.linkUrl | 56 | contentDTO.linkUrl = this.frontLinkObject?.linkUrl |
| 57 | ProcessUtils.processPage(contentDTO) | 57 | ProcessUtils.processPage(contentDTO) |
| 58 | - } | 58 | + |
| 59 | }).width(80) | 59 | }).width(80) |
| 60 | .alignRules({ | 60 | .alignRules({ |
| 61 | left: { anchor: "__container__", align: HorizontalAlign.Start }, | 61 | left: { anchor: "__container__", align: HorizontalAlign.Start }, |
| 62 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom } | 62 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom } |
| 63 | }) | 63 | }) |
| 64 | .id('row_detail') | 64 | .id('row_detail') |
| 65 | + } | ||
| 65 | 66 | ||
| 66 | Text(this.frontLinkObject?.summary ?? "") | 67 | Text(this.frontLinkObject?.summary ?? "") |
| 67 | .margin({ top: 10 }) | 68 | .margin({ top: 10 }) |
| @@ -177,9 +177,9 @@ export class ColorUtils { | @@ -177,9 +177,9 @@ export class ColorUtils { | ||
| 177 | 177 | ||
| 178 | public static getMorningEveningPaperRgb(color: ColorRgb): ColorRgb{ | 178 | public static getMorningEveningPaperRgb(color: ColorRgb): ColorRgb{ |
| 179 | // RGB颜色取值范围是0~255,需要转换为0~1的浮点数 | 179 | // RGB颜色取值范围是0~255,需要转换为0~1的浮点数 |
| 180 | - const red: number = color.red / MAX_RGB_VALUE; | ||
| 181 | - const green: number = color.green / MAX_RGB_VALUE; | ||
| 182 | - const blue: number = color.blue / MAX_RGB_VALUE; | 180 | + const red: number = color.red ; |
| 181 | + const green: number = color.green ; | ||
| 182 | + const blue: number = color.blue; | ||
| 183 | 183 | ||
| 184 | const max: number = Math.max(red, green, blue); | 184 | const max: number = Math.max(red, green, blue); |
| 185 | const min: number = Math.min(red, green, blue); | 185 | const min: number = Math.min(red, green, blue); |
| @@ -29,10 +29,12 @@ struct LoginProtocolWebview { | @@ -29,10 +29,12 @@ struct LoginProtocolWebview { | ||
| 29 | this.contentID = params.contentID | 29 | this.contentID = params.contentID |
| 30 | } | 30 | } |
| 31 | if (params.contentID == "1") { //"人民日报客户端网络服务使用协议" | 31 | if (params.contentID == "1") { //"人民日报客户端网络服务使用协议" |
| 32 | + this.webUrl = this.userProtocol | ||
| 32 | this.webUrl = await SPHelper.default.get(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string | 33 | this.webUrl = await SPHelper.default.get(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string |
| 33 | this.webviewController.loadUrl(this.webUrl) | 34 | this.webviewController.loadUrl(this.webUrl) |
| 34 | 35 | ||
| 35 | } else if(params.contentID == "2"){ //"人民日报客户端用户隐私协议" | 36 | } else if(params.contentID == "2"){ //"人民日报客户端用户隐私协议" |
| 37 | + this.webUrl = this.privateProtocol | ||
| 36 | this.webUrl = await SPHelper.default.get(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string | 38 | this.webUrl = await SPHelper.default.get(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string |
| 37 | this.webviewController.loadUrl(this.webUrl) | 39 | this.webviewController.loadUrl(this.webUrl) |
| 38 | }else if(params.contentID == "3"){ //注销协议 | 40 | }else if(params.contentID == "3"){ //注销协议 |
| @@ -22,7 +22,15 @@ export class TrackParamConvert { | @@ -22,7 +22,15 @@ export class TrackParamConvert { | ||
| 22 | 22 | ||
| 23 | static pageCompProgram(pageInfo?: PageInfoDTO, comp?: CompInfoBean, program?: ContentDTO) : ParamType { | 23 | static pageCompProgram(pageInfo?: PageInfoDTO, comp?: CompInfoBean, program?: ContentDTO) : ParamType { |
| 24 | let params = TrackingUtils.generateParams() | 24 | let params = TrackingUtils.generateParams() |
| 25 | - | 25 | + if (program) { |
| 26 | + params["contentType"] = program.objectType | ||
| 27 | + params["contentId"] = program.objectId | ||
| 28 | + params["contentName"] = program.newsTitle | ||
| 29 | + params["channelSourceId"] = program.channelId | ||
| 30 | + params["rmhPlatform"] = program.rmhPlatform | ||
| 31 | + | ||
| 32 | + TrackParamConvert.appendRecommend(program, params) | ||
| 33 | + } | ||
| 26 | //TODO: 转换参数 | 34 | //TODO: 转换参数 |
| 27 | 35 | ||
| 28 | return params | 36 | return params |
| @@ -4,6 +4,7 @@ import { WDRouterPage } from 'wdRouter'; | @@ -4,6 +4,7 @@ import { WDRouterPage } from 'wdRouter'; | ||
| 4 | import { SPHelper } from 'wdKit/Index'; | 4 | import { SPHelper } from 'wdKit/Index'; |
| 5 | import { SpConstants } from 'wdConstant/Index'; | 5 | import { SpConstants } from 'wdConstant/Index'; |
| 6 | import { ButtonOptions, promptAction } from '@kit.ArkUI'; | 6 | import { ButtonOptions, promptAction } from '@kit.ArkUI'; |
| 7 | +import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'; | ||
| 7 | 8 | ||
| 8 | @Entry | 9 | @Entry |
| 9 | @Component | 10 | @Component |
| @@ -34,6 +35,8 @@ struct LaunchInterestsHobbiesPage { | @@ -34,6 +35,8 @@ struct LaunchInterestsHobbiesPage { | ||
| 34 | //直接跳过到首页 | 35 | //直接跳过到首页 |
| 35 | //跳转首页 | 36 | //跳转首页 |
| 36 | WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) | 37 | WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) |
| 38 | + | ||
| 39 | + this.trackingLaunchJumpOver(false) | ||
| 37 | }) | 40 | }) |
| 38 | } | 41 | } |
| 39 | .width('100%') | 42 | .width('100%') |
| @@ -148,6 +151,9 @@ struct LaunchInterestsHobbiesPage { | @@ -148,6 +151,9 @@ struct LaunchInterestsHobbiesPage { | ||
| 148 | this.saveTagIds() | 151 | this.saveTagIds() |
| 149 | //跳转首页 | 152 | //跳转首页 |
| 150 | WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) | 153 | WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) |
| 154 | + | ||
| 155 | + this.trackingLaunchJumpOver(true) | ||
| 156 | + | ||
| 151 | }) | 157 | }) |
| 152 | } | 158 | } |
| 153 | .width('100%') | 159 | .width('100%') |
| @@ -185,4 +191,17 @@ struct LaunchInterestsHobbiesPage { | @@ -185,4 +191,17 @@ struct LaunchInterestsHobbiesPage { | ||
| 185 | } | 191 | } |
| 186 | SPHelper.default.saveSync(SpConstants.PUBLICVISUTORMODE_INTERESTTAGS,tags) | 192 | SPHelper.default.saveSync(SpConstants.PUBLICVISUTORMODE_INTERESTTAGS,tags) |
| 187 | } | 193 | } |
| 194 | + | ||
| 195 | + trackingLaunchJumpOver(selectOrJump:boolean){ | ||
| 196 | + let tags = SPHelper.default.getSync(SpConstants.PUBLICVISUTORMODE_INTERESTTAGS,'') as string | ||
| 197 | + let action = selectOrJump?TrackConstants.ActionType.SelectInterestCard:TrackConstants.ActionType.CloseInterestCard | ||
| 198 | + let pageParam: ParamType = { | ||
| 199 | + 'interestContentOptions':tags, | ||
| 200 | + 'itemId':tags, | ||
| 201 | + 'action':action, | ||
| 202 | + 'sceneId':'9999', | ||
| 203 | + 'cnsTraceId':'selfHold', | ||
| 204 | + } | ||
| 205 | + TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Interest,TrackConstants.PageName.Interest,pageParam) | ||
| 206 | + } | ||
| 188 | } | 207 | } |
-
Please register or login to post a comment