Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
wangliang_wd
2024-05-24 16:39:55 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f9f62e23a63ed7e4ab9cd98ad87c2fc3fd3da042
f9f62e23
1 parent
f1ab865c
feat:优化早晚报,优化埋点
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
66 additions
and
37 deletions
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/topicInfoView.ets
sight_harmony/features/wdComponent/src/main/ets/utils/ColorUtils.ets
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginProtocolWebview.ets
sight_harmony/features/wdTracking/src/main/ets/common/TrackParamConvert.ets
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchInterestsHobbiesPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
View file @
f9f62e2
...
...
@@ -144,7 +144,8 @@ export struct MorningEveningPaperComponent {
Logger.info(TAG, "pageInfoBean dateTime = " + dateTime)
Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle)
this.setComponentBgColor(pageInfoBean.backgroundImgUrl)
this.setComponentBgColor(this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string)
let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId)
// this.compInfoBean = compInfoBean
...
...
@@ -223,8 +224,7 @@ export struct MorningEveningPaperComponent {
effectKit.createColorPicker(pixelMap, (err, colorPicker) => {
let color = colorPicker.getMainColorSync();
Logger.debug(TAG, "compInfoBean compStyle = " + color)
color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha})
// color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha})
// 将取色器选取的color示例转换为十六进制颜色代码
this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16);
Logger.debug(TAG, "compInfoBean compStyle = " + this.mixedBgColor)
...
...
@@ -272,18 +272,17 @@ export struct MorningEveningPaperComponent {
}
.height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`).scrollBar(BarState.Off)
PaperTitleComponent()
PaperTitleComponent()
.margin({top:this.topSafeHeight})
}
.width('100%')
.height('100%')
.padding({
top: this.topSafeHeight,
bottom: this.bottomSafeHeight
})
// .padding({
// top: this.topSafeHeight,
// bottom: this.bottomSafeHeight
// })
// .backgroundColor(Color.Black)
// .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black)
.backgroundColor(this.mixedBgColor ?? Color.Black)
}
@Builder
...
...
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/topicInfoView.ets
View file @
f9f62e2
...
...
@@ -32,36 +32,37 @@ export struct topicInfoView {
})
.id('img_cover')
Row() {
Text("查看详情")
.fontSize(14)
.fontColor($r('app.color.white'))
.maxLines(1)
.borderRadius(2)
.padding({ left: 6, top: 4, bottom: 4 })
if (this.frontLinkObject) {
Row() {
Text("查看详情")
.fontSize(14)
.fontColor($r('app.color.white'))
.maxLines(1)
.borderRadius(2)
.padding({ left: 6, top: 4, bottom: 4 })
Image($r('app.media.more_w'))// .height($r('app.float.top_arrow_size'))
.width(12)
.height(12)
.margin({ left: 4, right: 7 })
}
.backgroundColor($r('app.color.color_99636363'))
.margin({ top: 8, left: 16, right: 16, bottom: 16 })
.borderRadius(2)
.onClick(()=>{
if (this.frontLinkObject) {
Image($r('app.media.more_w'))// .height($r('app.float.top_arrow_size'))
.width(12)
.height(12)
.margin({ left: 4, right: 7 })
}
.backgroundColor($r('app.color.color_99636363'))
.margin({ top: 8, left: 16, right: 16, bottom: 16 })
.borderRadius(2)
.onClick(()=>{
let contentDTO :ContentDTO = new ContentDTO();
contentDTO.objectType = this.frontLinkObject?.newsType.toString()
contentDTO.objectId = this.frontLinkObject?.newsId
contentDTO.linkUrl = this.frontLinkObject?.linkUrl
ProcessUtils.processPage(contentDTO)
}
}).width(80)
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Start },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
})
.id('row_detail')
}).width(80)
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Start },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
})
.id('row_detail')
}
Text(this.frontLinkObject?.summary ?? "")
.margin({ top: 10 })
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/ColorUtils.ets
View file @
f9f62e2
...
...
@@ -177,9 +177,9 @@ export class ColorUtils {
public static getMorningEveningPaperRgb(color: ColorRgb): ColorRgb{
// RGB颜色取值范围是0~255,需要转换为0~1的浮点数
const red: number = color.red / MAX_RGB_VALUE;
const green: number = color.green / MAX_RGB_VALUE;
const blue: number = color.blue / MAX_RGB_VALUE;
const red: number = color.red ;
const green: number = color.green ;
const blue: number = color.blue;
const max: number = Math.max(red, green, blue);
const min: number = Math.min(red, green, blue);
...
...
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginProtocolWebview.ets
View file @
f9f62e2
...
...
@@ -29,10 +29,12 @@ struct LoginProtocolWebview {
this.contentID = params.contentID
}
if (params.contentID == "1") { //"人民日报客户端网络服务使用协议"
this.webUrl = this.userProtocol
this.webUrl = await SPHelper.default.get(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string
this.webviewController.loadUrl(this.webUrl)
} else if(params.contentID == "2"){ //"人民日报客户端用户隐私协议"
this.webUrl = this.privateProtocol
this.webUrl = await SPHelper.default.get(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string
this.webviewController.loadUrl(this.webUrl)
}else if(params.contentID == "3"){ //注销协议
...
...
sight_harmony/features/wdTracking/src/main/ets/common/TrackParamConvert.ets
View file @
f9f62e2
...
...
@@ -22,7 +22,15 @@ export class TrackParamConvert {
static pageCompProgram(pageInfo?: PageInfoDTO, comp?: CompInfoBean, program?: ContentDTO) : ParamType {
let params = TrackingUtils.generateParams()
if (program) {
params["contentType"] = program.objectType
params["contentId"] = program.objectId
params["contentName"] = program.newsTitle
params["channelSourceId"] = program.channelId
params["rmhPlatform"] = program.rmhPlatform
TrackParamConvert.appendRecommend(program, params)
}
//TODO: 转换参数
return params
...
...
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchInterestsHobbiesPage.ets
View file @
f9f62e2
...
...
@@ -4,6 +4,7 @@ import { WDRouterPage } from 'wdRouter';
import { SPHelper } from 'wdKit/Index';
import { SpConstants } from 'wdConstant/Index';
import { ButtonOptions, promptAction } from '@kit.ArkUI';
import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index';
@Entry
@Component
...
...
@@ -34,6 +35,8 @@ struct LaunchInterestsHobbiesPage {
//直接跳过到首页
//跳转首页
WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
this.trackingLaunchJumpOver(false)
})
}
.width('100%')
...
...
@@ -148,6 +151,9 @@ struct LaunchInterestsHobbiesPage {
this.saveTagIds()
//跳转首页
WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
this.trackingLaunchJumpOver(true)
})
}
.width('100%')
...
...
@@ -185,4 +191,17 @@ struct LaunchInterestsHobbiesPage {
}
SPHelper.default.saveSync(SpConstants.PUBLICVISUTORMODE_INTERESTTAGS,tags)
}
trackingLaunchJumpOver(selectOrJump:boolean){
let tags = SPHelper.default.getSync(SpConstants.PUBLICVISUTORMODE_INTERESTTAGS,'') as string
let action = selectOrJump?TrackConstants.ActionType.SelectInterestCard:TrackConstants.ActionType.CloseInterestCard
let pageParam: ParamType = {
'interestContentOptions':tags,
'itemId':tags,
'action':action,
'sceneId':'9999',
'cnsTraceId':'selfHold',
}
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Interest,TrackConstants.PageName.Interest,pageParam)
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment