王士厅

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool

# Conflicts:
#	sight_harmony/products/phone/src/main/ets/pages/view/VideoChannelPage.ets
Showing 44 changed files with 327 additions and 191 deletions
... ... @@ -372,6 +372,8 @@ export class ProcessUtils {
type: 'JUMP_INNER_NEW_PAGE',
params: {
contentID: content?.objectId,
//fixme 图文外链,需要单独处理
url:content?.linkUrl,
pageID: 'IMAGE_TEXT_DETAIL',
extra: {
relType: content?.relType,
... ...
... ... @@ -75,6 +75,10 @@ export struct CompParser {
// Text(JSON.stringify(this.compDTO.compStyle))
this.componentBuilder();
}
.margin({
left: 6,
right: (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05 || this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) ? 0 : 6
})
}
@Builder
... ... @@ -206,16 +210,16 @@ export struct CompParser {
this.compDTO.compStyle === CompStyle.Zh_Single_Row_06
) {
if (this.compDTO.compStyle === this.nextCompDTO.compStyle) {
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(1).color('#f5f5f5').width('103%').padding({ left: 16, right: 16 }).margin({left: -6})
} else {
Divider().strokeWidth(5).color('#f5f5f5')
Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})
}
} else if (this.compDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) {
// 大专题
if (this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) {
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(1).color('#f5f5f5').width('103%').padding({ left: 16, right: 16 }).margin({left: -6})
} else {
Divider().strokeWidth(5).color('#f5f5f5')
Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})
}
} else if (this.compDTO.compType === 'appStyle' || this.compDTO.compStyle === CompStyle.Zh_Single_Row_01) {
if (
... ... @@ -225,9 +229,9 @@ export struct CompParser {
this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_04 ||
this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_06
) {
Divider().strokeWidth(5).color('#f5f5f5')
Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6})
} else {
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
Divider().strokeWidth(1).color('#f5f5f5').width('103%').padding({ left: 16, right: 16 }).margin({left: -6})
}
} else {
// Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
... ...
... ... @@ -238,20 +238,20 @@ export struct MorningEveningPaperComponent {
private async pickColor(imageSource: image.ImageSource | undefined) {
if (imageSource) {
const pixelMap: image.PixelMap = await imageNet2PixelMap(imageSource);
let allPixels: number[] = await traverseAllPixel(pixelMap);
let maxPixel: number = findMaxPixel(allPixels);
let rgb: ColorRgb = ColorUtils.numberToRgb(maxPixel);
let hsv: ColorHsv = ColorUtils.rgb2hsv(rgb);
rgb = ColorUtils.hsv2rgb(hsv);
this.mixedBgColor = "#" + rgb.red.toString(16) + rgb.green.toString(16) + rgb.blue.toString(16);
// effectKit.createColorPicker(pixelMap, (err, colorPicker) => {
// let color = colorPicker.getMainColorSync();
// console.log(TAG, "compInfoBean compStyle = " + color)
// // 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);
// console.log(TAG, "compInfoBean compStyle = " + this.mixedBgColor)
// });
// let allPixels: number[] = await traverseAllPixel(pixelMap);
// let maxPixel: number = findMaxPixel(allPixels);
// let rgb: ColorRgb = ColorUtils.numberToRgb(maxPixel);
// let hsv: ColorHsv = ColorUtils.rgb2hsv(rgb);
// rgb = ColorUtils.hsv2rgb(hsv);
// this.mixedBgColor = "#" + rgb.red.toString(16) + rgb.green.toString(16) + rgb.blue.toString(16);
effectKit.createColorPicker(pixelMap, (err, colorPicker) => {
let color = colorPicker.getMainColorSync();
console.log(TAG, "compInfoBean compStyle = " + color)
// 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);
console.log(TAG, "compInfoBean compStyle = " + this.mixedBgColor)
});
}
}
... ...
... ... @@ -82,10 +82,11 @@ export struct Card11Component {
// 评论等信息
CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO })
}.width(CommonConstants.FULL_WIDTH)
}
.width(CommonConstants.FULL_WIDTH)
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
... ...
... ... @@ -80,11 +80,13 @@ export struct Card12Component {
CarderInteraction({contentDTO: this.contentDTO})
}
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
if (router.getState().name !== 'MyCollectionListPage') {
... ...
... ... @@ -96,11 +96,13 @@ export struct Card14Component {
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
if (router.getState().name !== 'MyCollectionListPage') {
... ...
... ... @@ -95,11 +95,13 @@ export struct Card15Component {
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
if (router.getState().name !== 'MyCollectionListPage') {
... ...
... ... @@ -128,11 +128,13 @@ export struct Card16Component {
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
if (router.getState().name !== 'MyCollectionListPage') {
... ...
... ... @@ -134,12 +134,13 @@ export struct Card17Component {
// 评论等信息
CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO })
}
.width(CommonConstants.FULL_WIDTH)
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
}
}
... ...
... ... @@ -86,11 +86,13 @@ export struct Card19Component {
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
if (router.getState().name !== 'MyCollectionListPage') {
... ...
... ... @@ -80,11 +80,13 @@ export struct Card20Component {
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
if (router.getState().name !== 'MyCollectionListPage') {
... ...
... ... @@ -102,11 +102,12 @@ export struct Card21Component {
ProcessUtils.processPage(this.contentDTO)
})
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
}
}
\ No newline at end of file
... ...
... ... @@ -115,13 +115,14 @@ export struct Card2Component {
// 评论等信息
CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO })
}
.width(CommonConstants.FULL_WIDTH)
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
if (router.getState().name !== 'MyCollectionListPage') {
... ...
... ... @@ -78,13 +78,14 @@ export struct Card3Component {
// 评论等信息
CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO })
}
.width(CommonConstants.FULL_WIDTH)
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
if (router.getState().name !== 'MyCollectionListPage') {
... ...
... ... @@ -133,13 +133,14 @@ export struct Card4Component {
//bottom 评论等信息
CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO })
}
.width(CommonConstants.FULL_WIDTH)
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
}
}
... ...
... ... @@ -122,13 +122,14 @@ export struct Card5Component {
}
}
.alignContent(Alignment.Bottom)
.width(CommonConstants.FULL_WIDTH)
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
if (router.getState().name !== 'MyCollectionListPage') {
... ...
... ... @@ -123,12 +123,12 @@ export struct Card6Component {
ProcessUtils.processPage(this.contentDTO)
})
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
.height(this.contentDTO.appStyle === CompStyle.Card_13 ? '' : 184)
.justifyContent(FlexAlign.SpaceBetween)
... ...
... ... @@ -79,13 +79,14 @@ export struct SearchContentComponent {
//bottom 评论等信息
CardSourceInfo({compDTO:new CompDTO, contentDTO: this.contentDTO })
}
.width(CommonConstants.FULL_WIDTH)
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
}
}
... ...
... ... @@ -33,8 +33,14 @@ export struct CompNormalTitle {
.margin({ top: 16, bottom: 10 })
.width(CommonConstants.FULL_WIDTH)
}
.padding({
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
.padding({ left: 16, right: 16 })
}
}
... ...
... ... @@ -154,13 +154,14 @@ export struct ZhCarouselLayout01 {
}
}
.alignContent(Alignment.BottomEnd)
.width(CommonConstants.FULL_WIDTH)
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[this.swiperIndex], this.pageId, this.pageName)
Logger.info(TAG, `ZhCarouselLayout01 onClick event index: ${this.swiperIndex}`);
... ...
... ... @@ -37,7 +37,15 @@ export struct ZhGridLayout02NewsContent {
this.buildItemCard(item, index);
}
})
}.width("100%").padding({ left: 16, right: 16 })
}
.padding({
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
}
... ...
... ... @@ -43,11 +43,13 @@ export struct ZhGridLayout03 {
})
}
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: '0vp'
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width('100%')
}
/**
... ...
... ... @@ -44,13 +44,14 @@ export struct ZhSingleColumn04 {
})
}
}
.width(CommonConstants.FULL_WIDTH)
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width('100%')
}
@Builder
... ...
... ... @@ -42,13 +42,14 @@ export struct ZhSingleColumn05 {
WDRouterRule.jumpWithAction(taskAction)
})
}
.width(CommonConstants.FULL_WIDTH)
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width('100%')
}
}
... ...
... ... @@ -194,12 +194,13 @@ export struct ZhSingleColumn09 {
.justifyContent(FlexAlign.SpaceBetween)
}
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor($r('app.color.white'))
.backgroundColor(0xffffff)
.width('100%')
.visibility(this.selfClosed ? Visibility.None : Visibility.Visible)
}
}
... ...
... ... @@ -151,12 +151,13 @@ export struct ZhSingleRow02 {
})
}
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
// right: $r('app.float.card_comp_pagePadding_lf'),
top: 8,
bottom: 8
left: 10,
// right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor($r('app.color.white'))
.backgroundColor(0xffffff)
.width('100%')
.margin({ bottom: 8 })
}
... ...
... ... @@ -222,12 +222,13 @@ export struct ZhSingleRow03 {
})
}
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor($r('app.color.white'))
.backgroundColor(0xffffff)
.width('100%')
}
@Builder
... ...
... ... @@ -91,8 +91,14 @@ export struct ZhSingleRow04 {
.edgeEffect(EdgeEffect.None)
}
.width(CommonConstants.FULL_WIDTH)
.backgroundColor($r("app.color.white"))
.margin({ bottom: 8 })
.padding({
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width('100%')
}
}
... ...
... ... @@ -53,13 +53,13 @@ export struct ZhSingleRow05 {
.height(170)
}
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
// right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
// right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor($r('app.color.white'))
.margin({ bottom: 8 })
.backgroundColor(0xffffff)
.width('100%')
}
@Builder
... ...
... ... @@ -166,12 +166,13 @@ export struct ZhSingleRow06 {
.width('100%')
}
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor($r('app.color.white'))
.backgroundColor(0xffffff)
.width('100%')
.onClick(() => {
InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[0], this.pageId, this.pageName)
})
... ...
... ... @@ -39,22 +39,22 @@ export default struct MinePageUserSimpleInfoUI {
//头像
Stack(){
Image(this.isLogin?(this.headPhotoUrl?this.headPhotoUrl:this.userType === "1"?$r('app.media.default_head'):$r('app.media.AccountOwner_DefaultIcon')):$r('app.media.default_head'))
.alt($r('app.media.default_head'))
.width(`${this.calcHeight(110)}lpx`)
.height(`${this.calcHeight(110)}lpx`)
Image(this.isLogin?(this.headPhotoUrl?this.headPhotoUrl:this.userType === "1"?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon')):$r('app.media.default_head_userPage'))
.alt($r('app.media.default_head_userPage'))
.width(`${this.calcHeight(120)}lpx`)
.height(`${this.calcHeight(120)}lpx`)
.objectFit(ImageFit.Cover)
.borderRadius(50)
if(StringUtils.isNotEmpty(this.levelHead)){
Image(this.levelHead)
.width(`${this.calcHeight(140)}lpx`)
.height(`${this.calcHeight(140)}lpx`)
.width(`${this.calcHeight(155)}lpx`)
.height(`${this.calcHeight(155)}lpx`)
.objectFit(ImageFit.Cover)
.borderRadius(50)
}
}.width(`${this.calcHeight(130)}lpx`)
.height(`${this.calcHeight(130)}lpx`)
}.width(`${this.calcHeight(140)}lpx`)
.height(`${this.calcHeight(140)}lpx`)
.alignContent(Alignment.Center)
.onClick(()=>{
this.jumpLogin()
... ...
... ... @@ -21,7 +21,7 @@ export struct PagePersonFunction{
.type(ButtonType.Circle)
.width(`${this.calcHeight(12)}lpx`)
.height(`${this.calcHeight(12)}lpx`)
.backgroundColor($r('app.color.color_ED2800'))
.backgroundColor(this.navItem?.noticeColor.length > 0?this.navItem?.noticeColor:$r('app.color.color_ED2800'))
}
}.width(`${this.calcHeight(46)}lpx`)
.height(`${this.calcHeight(46)}lpx`)
... ... @@ -30,7 +30,6 @@ export struct PagePersonFunction{
.margin({top:`${this.calcHeight(8)}lpx`})
.height(`${this.calcHeight(23)}lpx`)
.fontColor(this.navItem?.homePageColor.length > 0?this.navItem.homePageColor:$r('app.color.color_222222'))
.fontColor($r('app.color.color_222222'))
.fontSize(`${this.calcHeight(23)}lpx`)
}
.alignItems(HorizontalAlign.Center)
... ...
... ... @@ -199,20 +199,22 @@ struct EditUserInfoPage {
if (backParams) {
let userName = backParams.userName as string ///昵称
let introduction = backParams.introduction as string ///简介
this.listData = []
if (userName) {
if (userName != this.currentUserInfo.userName) {
// this.currentUserInfo.userName = userName;
// this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_nickname
this.currentUserInfo.userName = userName;
this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_nickname
this.listData.push(...EditInfoViewModel.getEditListInfo(this.currentUserInfo))
// this.updateEditModel()
this.getAccountOwnerInfo()
// this.getAccountOwnerInfo()
}
} else if (introduction){
if (introduction != this.currentUserInfo.userExtend.introduction ) {
// this.currentUserInfo.userExtend.introduction = introduction;
// this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_intro
this.currentUserInfo.userExtend.introduction = introduction;
this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_intro
this.listData.push(...EditInfoViewModel.getEditListInfo(this.currentUserInfo))
// this.updateEditModel()
this.getAccountOwnerInfo()
// this.getAccountOwnerInfo()
}
}
}
... ...
... ... @@ -127,6 +127,10 @@ export struct MinePageComponent {
}
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.My,TrackConstants.PageName.My,Math.floor(duration))
}
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#000000',
})
}
aboutToAppear(){
... ...
import { BottomNavDTO, NavigationDetailDTO, TopNavDTO } from 'wdBean';
import { Logger, NetworkUtil, SPHelper, ToastUtils, WindowModel } from 'wdKit';
import { Logger, NetworkUtil, SPHelper, ToastUtils } from 'wdKit';
import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter';
import { PageComponent } from './PageComponent';
import { ChannelSubscriptionLayout } from './ChannelSubscriptionLayout';
... ... @@ -13,6 +13,8 @@ import { CompUtils } from '../../utils/CompUtils';
import ChannelViewModel from '../../viewmodel/ChannelViewModel';
import { GrayManageModel } from '../../viewmodel/GrayManageModel';
import { ColorUtils } from '../../utils/ColorUtils';
import { ImageKnifeComponent } from '@ohos/imageknife';
import { CommonUtils } from '../../utils/CommonUtils';
const TAG = 'TopNavigationComponent';
... ... @@ -36,8 +38,7 @@ export struct TopNavigationComponentNew {
*/
navItem: BottomNavDTO = {} as BottomNavDTO
// 首页当前正在哪个tab的索引值
@Link @Watch('setBarBackgroundColor') _currentNavIndex?: number;
@Link @Watch('setBarBackgroundColor') _currentNavIndex?: number;
@Consume @Watch('pageShowChange') pageShow: number
// 记录首页底部tab 的索引值
@State bottomNavIndex: number = 0
... ... @@ -45,7 +46,6 @@ export struct TopNavigationComponentNew {
@State @Watch('updateCurrentTopNavSelectedIndex') currentTopNavSelectedIndex: number = 0;
// 顶导数据
@State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = []
@Consume barBackgroundColor: Color
@Consume isImmersive: boolean
//
... ... @@ -349,36 +349,33 @@ export struct TopNavigationComponentNew {
@Builder
tabBarBuilder(item: TopNavDTO, index: number) {
Column() {
Text(item?.name)
.fontSize($r('app.float.selected_text_size'))
.fontWeight(this.currentTopNavSelectedIndex === index ? FontWeight.Bold : FontWeight.Normal)
.fontColor(this.tabSelectedColor(this.currentTopNavSelectedIndex === index))
.padding({ top: $r('app.float.top_tab_item_padding_top'), bottom: $r('app.float.top_tab_item_padding_bottom') })
.maxLines(this.MAX_LINE)
.id(index.toString())
// .onAreaChange((oldValue: Area, newValue: Area) => {
// if (this.currentTopNavSelectedIndex === index &&
// (this.indicatorLeftMargin === 0 || this.indicatorWidth === 0)) {
// if (newValue.position.x != undefined) {
// let positionX = Number.parseFloat(newValue.position.x.toString())
// this.indicatorLeftMargin = Number.isNaN(positionX) ? 0 : positionX
// }
// let width = Number.parseFloat(newValue.width.toString())
// this.indicatorWidth = Number.isNaN(width) ? 0 : width
// }
// })
if (this.currentTopNavSelectedIndex === index) {
Image($r('app.media.icon_channel_active'))
.colorFilter(ColorUtils.getDrawingColorFilter(this.getBothColor("")))
.width(20)
.height(3)
// Row()
// .width(20)
// .height(3)
// .backgroundImage($r('app.media.icon_channel_active'), ImageRepeat.NoRepeat)
// .backgroundImageSize(ImageSize.Contain)
if (item.iconUrl && item.iconCUrl) {
// 有图
ImageKnifeComponent({ imageKnifeOption: CommonUtils.getTopImageKnifeOption(item, this.currentTopNavSelectedIndex === index) })
.height(36)
.width(CommonUtils.calTopTabWidth(36,item.iconUrlSize))
.enabled(false)
} else {
// 无图
Text(item?.name)
.fontSize($r('app.float.selected_text_size'))
.fontWeight(this.currentTopNavSelectedIndex === index ? FontWeight.Bold : FontWeight.Normal)
.fontColor(this.tabSelectedColor(this.currentTopNavSelectedIndex === index))
.padding({
top: $r('app.float.top_tab_item_padding_top'),
bottom: $r('app.float.top_tab_item_padding_bottom')
})
.maxLines(this.MAX_LINE)
.id(index.toString())
if (this.currentTopNavSelectedIndex === index) {
Image($r('app.media.icon_channel_active'))//.colorFilter(ColorUtils.getDrawingColorFilter(this.getBothColor("")))
.width(20)
.height(3)
}
}
}
.hoverEffect(HoverEffect.Highlight)
.constraintSize({
... ... @@ -388,8 +385,8 @@ export struct TopNavigationComponentNew {
.height('100%')
// .backgroundColor(Color.Transparent)
.padding({
left: $r('app.float.top_tab_item_padding_horizontal'),
right: $r('app.float.top_tab_item_padding_horizontal'),
left: item.iconUrl && item.iconCUrl ? 0 : $r('app.float.top_tab_item_padding_horizontal'),
right: item.iconUrl && item.iconCUrl ? 0 : $r('app.float.top_tab_item_padding_horizontal'),
})
.justifyContent(FlexAlign.Center)
.id(`col_tabBar${index}`)
... ... @@ -405,6 +402,8 @@ export struct TopNavigationComponentNew {
})
}
/**
* 频道文字颜色
* @returns
... ... @@ -502,24 +501,22 @@ export struct TopNavigationComponentNew {
this.backgroundImageH = px2vp(this.topRectHeight) + 44
}
ColorUtils.changeTopStatusBarColor(this.navItem.statusBarColor)
ColorUtils.changeTopStatusBarColor(this.navItem.statusBarColor, 1)
}
pageShowChange() {
ColorUtils.changeTopStatusBarColor(this.navItem.statusBarColor)
ColorUtils.changeTopStatusBarColor(this.navItem.statusBarColor, 1)
}
/**
* 修改手机顶部状态栏颜色
*/
setBarBackgroundColor() {
if(this._currentNavIndex == this.bottomNavIndex){
ColorUtils.changeTopStatusBarColor(this.navItem.statusBarColor)
if (this._currentNavIndex == this.bottomNavIndex) {
ColorUtils.changeTopStatusBarColor(this.navItem.statusBarColor, 1)
this.isImmersive = false
this.barBackgroundColor = Color.White
... ... @@ -666,7 +663,6 @@ export struct TopNavigationComponentNew {
return null
}
/**
* 进入早晚报专题
*/
... ...
... ... @@ -44,7 +44,7 @@ export struct CustomTitleAndEditUI {
if (this.isDisplayButton){
Button(this.isEditState === true?'取消':'编辑')
.type(ButtonType.Normal)
.fontColor($r('app.color.color_222222'))
.fontColor($r('app.color.color_B0B0B0'))
.backgroundColor(Color.White)
.id("edit_Button")
.alignRules({
... ...
... ... @@ -78,7 +78,7 @@ export struct EmptyComponent {
/**
* The empty data text opacity.
*/
readonly TEXT_OPACITY: number = 0.4;
readonly TEXT_OPACITY: number = 1.0;
private timer: number = -1
retry: () => void = () => {
}
... ...
... ... @@ -113,6 +113,7 @@ export struct LiveLikeComponent {
.width(36)
.height(36)
.borderRadius(18)
.margin({top:6})
.backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' :
this.pageComponentType === 8 ? Color.Transparent : '#FFF5F5F5')
... ... @@ -120,6 +121,7 @@ export struct LiveLikeComponent {
RelativeContainer() {
Image(this.styleType == 1 ? $r('app.media.comment_icon_number_bg') : $r('app.media.ic_like_back_Select'))
.objectFit(ImageFit.Fill)
.height(10)
.resizable({
slice: {
top: 1,
... ... @@ -144,14 +146,15 @@ export struct LiveLikeComponent {
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})// .margin({left: 4,right:4
// })
})
/*动态计算文字宽度*/
.width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) +
12)// .backgroundColor(Color.Green)
8)// .backgroundColor(Color.Green)
.padding({left:2})
.id("Text")
.visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden)
}
.margin({left:10,top:3})
.offset({
x: 18
})
... ...
... ... @@ -20,6 +20,7 @@ import { EmitterEventId, EmitterUtils } from 'wdKit/Index'
import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index';
import { CommentCustomDialog, CommentDialogInputContent } from '../comment/view/CommentCustomDialog';
import { HttpUtils } from 'wdNetwork/Index';
import { faceDetector } from '@kit.CoreVisionKit';
const TAG = 'LiveOperRowListView';
... ... @@ -68,7 +69,8 @@ export struct LiveOperRowListView {
@Consume pageId: string
@State likesStyle: number | string = "love" // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
//非沉浸式
private isLlive = false
/// comment
@State showCommentInput: boolean = false
private banComment: boolean = true // 是否已禁言
... ... @@ -138,6 +140,7 @@ export struct LiveOperRowListView {
.interpolation(ImageInterpolation.High)
}
.width(48)
.padding({top:10})
.hoverEffect(HoverEffect.Scale)
.visibility(this.showBackIcon ? Visibility.Visible : Visibility.None)
.onClick(() => {
... ... @@ -169,10 +172,11 @@ export struct LiveOperRowListView {
.width('100%')
.backgroundColor(this.bgColor)
.padding({
top: 10,
// top: 10,
// bottom: 10
bottom: `${this.bottomSafeHeight}px`
bottom: `${this.bottomSafeHeight}px`,
// bottom: 50
right:20
})
}
... ... @@ -230,6 +234,7 @@ export struct LiveOperRowListView {
Blank()
}
}
.padding({top:10})
.layoutWeight(1)
.margin({ left: 16 })
}
... ... @@ -247,6 +252,7 @@ export struct LiveOperRowListView {
})
}
.width(48)
.margin({left:this.isLlive?0:10})
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty' || !this.openLikes ? Visibility.None : Visibility.Visible)
}
... ... @@ -274,8 +280,9 @@ export struct LiveOperRowListView {
})*/
}
.height(36)
.width(48)
.width(this.isLlive?48:36)
.borderRadius(18)
.margin({top:10,left:this.isLlive?0:10})
.backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent)
.onClick(() => {
this.toggleCollectStatus()
... ... @@ -299,9 +306,10 @@ export struct LiveOperRowListView {
this.share()
})
}
.margin({top:10,left:this.isLlive?0:10})
.justifyContent(FlexAlign.Center)
.height(36)
.width(48)
.width(this.isLlive?48:36)
.borderRadius(18)
.backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent)
}
... ...
... ... @@ -242,7 +242,7 @@ export class ColorUtils {
/**
* 获取图片填充的ColorFilter
* @param hex 十六进制颜色值
* @returns undefined:无填充颜色
* @returns undefined:无填充颜色
*/
public static getDrawingColorFilter(hex: string): ColorFilter | undefined {
... ... @@ -270,10 +270,16 @@ export class ColorUtils {
/**
* 修改手机顶部状态栏颜色
* @param statusValue
* @param statusValue 动态修改值
* @param defaultValue 页面默认值:statusValue== null 就按此值走
*/
public static changeTopStatusBarColor(statusValue: number) {
if (statusValue === 1) { // 黑色状态栏
public static changeTopStatusBarColor(statusValue: number, defaultValue: number) {
if (statusValue == null) {
statusValue = defaultValue
} else { //白色状态栏
}
if (statusValue === 1 || statusValue == null) { // 黑色状态栏
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#000000',
... ...
import { ALL, ImageKnifeOption } from '@ohos/imageknife';
import { TopNavDTO } from 'wdBean/Index';
/**
* 通用工具类,只记录处理build里面组件业务计算逻辑
*/
export class CommonUtils{
/**
* 获取顶部导航栏的频道option
* @param item
* @param isSelect
* @returns
*/
public static getTopImageKnifeOption(item: TopNavDTO, isSelect: boolean): ImageKnifeOption {
// let defaultIcon = this.getBottomLocalIcon(navItem, isSelect)
let url = isSelect ? item.iconCUrl:item.iconUrl // this.getBottomIcon(navItem, isSelect)
let imageKnifeOption: ImageKnifeOption = {
loadSrc: url,
// // 占位图使用本地资源
// placeholderSrc: defaultIcon,
// // 失败占位图使用本地资源
// errorholderSrc: defaultIcon,
// 是否开启一级内存缓存
isCacheable: true,
// 磁盘缓存
strategy: new ALL(),
gif: {
playTimes: 1
}
};
return imageKnifeOption
}
/**
* 计算 频道tab 宽度
* @param height 已知高度
* @returns
*/
public static calTopTabWidth(height:number,scale:string):number{
if(scale){
if(scale.includes('*')){
let scaleArray = scale.split('*');
return height*Number.parseInt(scaleArray[0])/parseInt(scaleArray[1])
}
}
return height*210/60
}
}
\ No newline at end of file
... ...
... ... @@ -109,6 +109,7 @@ export struct DetailPlayLivePage {
LiveOperRowListView({
operationButtonList: ['comment', 'collect', 'share', 'like'],
styleType: 1,
isLlive:this.displayDirection == DisplayDirection.VERTICAL,
contentDetailData: this.contentDetailData,
onCommentInputFocus: () => {
// 切换到大家聊
... ...
... ... @@ -2,15 +2,20 @@
* 视频频道,包含视频和直播
* 视频为沉浸式,直播同新闻页面
*/
import { BottomNavDTO, TopNavDTO } from 'wdBean/Index'
import { BottomNavDTO, TopNavDTO } from 'wdBean/Index';
import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { DisplayDirection } from 'wdConstant/Index';
import { CompUtils, PageComponent } from 'wdComponent/Index';
import { ParamType, TrackConstants, Tracking, TrackingButton } from 'wdTracking/Index';
import { Logger } from 'wdKit';
import { CompUtils, GrayManageModel, PageComponent } from 'wdComponent/Index';
import { TrackingButton, TrackConstants } from 'wdTracking/Index';
import { Logger, WindowModel } from 'wdKit';
import { ParamType, Tracking } from 'wdTracking/Index';
import { ColorUtils } from 'wdComponent/src/main/ets/utils/ColorUtils';
import { ImageKnifeComponent } from '@ohos/imageknife';
import { CommonUtils } from 'wdComponent/src/main/ets/utils/CommonUtils';
const TAG = 'VideoChannelPage'
... ... @@ -39,7 +44,6 @@ export struct VideoChannelPage {
navItem: BottomNavDTO = {} as BottomNavDTO
// 背景高度
@State backgroundImageH: number = 0
@Consume @Watch('setBarBackgroundColor') pageShow: number
// 国殇灰度管理
GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage')
... ... @@ -50,7 +54,6 @@ export struct VideoChannelPage {
this.setBarBackgroundColor()
}
/**
* 顶导、底导切换下标都到改变背景色,进入或退出沉浸式
*/
... ... @@ -59,16 +62,15 @@ export struct VideoChannelPage {
if (this.isImmerseChannel() && CompUtils.isVideo(this.currentBottomNavInfo)) {
this.barBackgroundColor = Color.Black
this.isImmersive = true
ColorUtils.changeTopStatusBarColor(0)// 沉浸页面顶部导航栏颜色固定黑色
ColorUtils.changeTopStatusBarColor(0, 0) // 沉浸页面顶部导航栏颜色固定黑色
} else {
this.isImmersive = false
this.barBackgroundColor = Color.White
ColorUtils.changeTopStatusBarColor(this.navItem.statusBarColor)
ColorUtils.changeTopStatusBarColor(this.navItem.statusBarColor, 1)
}
}
/**
* 得到顶导文字颜色
* @param item
... ... @@ -116,28 +118,35 @@ export struct VideoChannelPage {
Row() {
ForEach(this.topNavList, (item: TopNavDTO, index: number) => {
Column() {
Text(item.name)
.fontSize($r('app.float.selected_text_size'))
.fontWeight(this.currentTopNavSelectedIndex === index ? FontWeight.Bold : FontWeight.Normal)
.fontColor(this.getTopNavFontColor(item, index))
.padding({
top: $r('app.float.top_tab_item_padding_top'),
bottom: $r('app.float.top_tab_item_padding_bottom')
if (item.iconUrl && item.iconCUrl) {
// 有图
ImageKnifeComponent({
imageKnifeOption: CommonUtils.getTopImageKnifeOption(item, this.currentTopNavSelectedIndex === index)
})
.maxLines(this.MAX_LINE)
Image($r('app.media.icon_channel_active'))
.colorFilter(ColorUtils.getDrawingColorFilter(this.getBothColor("")))
.width(20)
.height(3).visibility(this.currentTopNavSelectedIndex === index ? Visibility.Visible : Visibility.Hidden)
.height(36)
.width(CommonUtils.calTopTabWidth(36, item.iconUrlSize))
.enabled(false)
} else {
Text(item.name)
.fontSize($r('app.float.selected_text_size'))
.fontWeight(this.currentTopNavSelectedIndex === index ? FontWeight.Bold : FontWeight.Normal)
.fontColor(this.getTopNavFontColor(item, index))
.padding({
top: $r('app.float.top_tab_item_padding_top'),
bottom: $r('app.float.top_tab_item_padding_bottom')
})
.maxLines(this.MAX_LINE)
Image($r('app.media.icon_channel_active'))// .colorFilter(ColorUtils.getDrawingColorFilter(this.getBothColor("")))
.width(20)
.height(3)
.visibility(this.currentTopNavSelectedIndex === index ? Visibility.Visible : Visibility.Hidden)
}
}
.padding({
left: $r('app.float.top_tab_item_padding_horizontal'),
right: $r('app.float.top_tab_item_padding_horizontal'),
left: item.iconUrl && item.iconCUrl ? 0 : $r('app.float.top_tab_item_padding_horizontal'),
right: item.iconUrl && item.iconCUrl ? 0 : $r('app.float.top_tab_item_padding_horizontal'),
})
.onClick(() => {
// 视频tab埋点
... ... @@ -185,7 +194,6 @@ export struct VideoChannelPage {
WDRouterRule.jumpWithPage(WDRouterPage.searchPage, params)
})
.backgroundColor(Color.Transparent)
.grayscale(this.GrayManage.get().isMourning() ? 1 : 0)
}
.zIndex(20)
... ... @@ -201,7 +209,7 @@ export struct VideoChannelPage {
* 检测是否是沉浸式频道
* @returns
*/
isImmerseChannel():boolean{
isImmerseChannel(): boolean {
return this.navItem.topNavChannelList[this.currentTopNavSelectedIndex].channelStyle === 1;
}
... ... @@ -219,7 +227,7 @@ export struct VideoChannelPage {
pageSwiperView() {
Swiper(this.swiperController) {
ForEach(this.topNavList, (item: TopNavDTO, index: number) => {
if (item.channelStyle===1) {
if (item.channelStyle === 1) {
// 视频
VideoChannelDetail({
bottomNavIndex: $_currentNavIndex,
... ...