wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  fix |> 修复直播详情直播间tab消息置顶标签宽度不正确问题
  fix: RmhTitle组件崩溃
  fix: 20110 大专题卡-左右边距偏大,未与信息流列表页其它组件边距对齐。
  fix: 20109 大专题卡-专题标题名称应最多展示2行,超过2行省略展示
  fix: 20106 3:2横滑卡-配置跳转专题,运营位封面图比例不符合3:2时,鸿蒙缺少封面图占位外框
  fix: 横划卡(16:9或3:2),左右横滑时,应从手机边缘消失
  fix |> 修复直播详情直播间tab消息置顶标签位置不正确问题
  fix |> 修复直播详情直播间tab视频消息封面未加载出来时,布局错乱问题
  ref |> 解决桌面组件widgets间接引用wdComponent中的AudioCapture导致崩溃
... ... @@ -26,7 +26,8 @@ export struct RmhTitle {
@Prop publishTime: string | undefined
@State loadImg: boolean = false;
isPeopleShipHome: boolean = false;
@Consume @Watch('pageShowForUpdateData') pageShow:number
// 当前页面没有使用,并且会导致奔溃
// @Consume @Watch('pageShowForUpdateData') pageShow:number
/**
* 是否需要隐藏发布时间超过2天的时间展示,默认不隐藏
*/
... ...
... ... @@ -101,7 +101,11 @@ export struct Card10Component {
.fontSize($r('app.float.font_size_18'))
.fontWeight(FontWeight.Normal)
.lineHeight(25)
.maxLines(this.contentDTO.appStyle === CompStyle.Card_09 ? 2 : 1)
.maxLines(
router.getState().name === 'MyCollectionListPage'
? this.contentDTO.appStyle === CompStyle.Card_09 ? 2 : 1
: 2
)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({ bottom: 8 })
.onClick((event: ClickEvent) => {
... ... @@ -162,8 +166,8 @@ export struct Card10Component {
}
.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')
})
... ...
... ... @@ -72,6 +72,9 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
.fontColor($r("app.color.color_222222"))
.fontWeight(600)
}
.padding({
left: this.compDTO.operDataList.length >= 2 ? 20 : 0
})
Row() {
Text("更多")
... ... @@ -102,7 +105,6 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
Image(item.coverUrl)
.aspectRatio(1.5)
.width(this.compDTO.operDataList.length == 2 ? 210 : 150)
.borderRadius(4)
.objectFit(ImageFit.Contain)
CardMediaInfo({
livePeopleNum:false,
... ... @@ -110,6 +112,8 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
})
}
.align(Alignment.BottomEnd)
.borderRadius(4)
.border({width: 1, color: 0xf5f5f5})
Text(item.newsTitle)
.fontSize($r("app.float.font_size_14"))
... ... @@ -129,6 +133,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
ProcessUtils.processPage(item)
})
.padding({ right: 16, left: index == 0 ? 20: 0 })
})
}
... ... @@ -190,16 +195,18 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
// .margin({left:16,right:16})
}
// .width("100%")
.width(this.compDTO.operDataList.length >= 2 ? 'calc(18vp + 100%)' : CommonConstants.FULL_WIDTH)
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
left: this.compDTO.operDataList.length >= 2 ? 0 : 10,
right: this.compDTO.operDataList.length >= 2 ? 0 : 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: 6
})
.backgroundColor($r("app.color.white"))
// .backgroundColor($r("app.color.color_FE4B05"))
.margin({ bottom: 8 })
.margin({
left: this.compDTO.operDataList.length >= 2 ? -6 : 0,
bottom: 8
})
}
private jumpToLiveMorePage() {
... ...
... ... @@ -122,6 +122,9 @@ export struct LiveHorizontalCardComponent {
.fontColor($r("app.color.color_222222"))
.fontWeight(600)
}
.padding({
left: this.compDTO.operDataList.length >= 2 ? 20 : 0
})
if (this.showMore()) {
Row() {
... ... @@ -139,7 +142,6 @@ export struct LiveHorizontalCardComponent {
}
}
.justifyContent(FlexAlign.SpaceBetween)
// .padding({ left: 16, right: 16 })
.margin({ bottom: 10 })
.width(CommonConstants.FULL_WIDTH)
... ... @@ -177,7 +179,7 @@ export struct LiveHorizontalCardComponent {
.lineHeight(21)
}
.height(this.compDTO.operDataList.length == 2 ? 167 : 134)
.padding({ right: 8 })
.padding({ right: index == this.compDTO.operDataList.length - 1 ? 16 : 8, left: index == 0 ? 20: 0 })
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
if (item.objectType != '0') {
... ... @@ -251,13 +253,16 @@ export struct LiveHorizontalCardComponent {
})
}
}
// .width(CommonConstants.FULL_WIDTH)
.width(this.compDTO.operDataList.length >= 2 ? 'calc(18vp + 100%)' : CommonConstants.FULL_WIDTH)
.padding({
left: 10,
right: 10,
left: this.compDTO.operDataList.length >= 2 ? 0 : 10,
right: this.compDTO.operDataList.length >= 2 ? 0 : 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.margin({
left: this.compDTO.operDataList.length >= 2 ? -6 : 0
})
.backgroundColor($r("app.color.white"))
}
... ...
... ... @@ -55,7 +55,7 @@ export struct TabLiveItemComponent {
.fontColor('#999999')
.margin({ left: 8 })
.visibility(StringUtils.isNotEmpty(this.item.time) ? Visibility.Visible : Visibility.None)
Blank()
Text('置顶')
.fontSize('11vp')
.fontWeight(400)
... ... @@ -69,7 +69,6 @@ export struct TabLiveItemComponent {
})
.borderRadius(2)
.margin({ left: 8 })
.width(100)
.visibility(1 == this.item.isTop ? Visibility.Visible : Visibility.None)
}
.justifyContent(FlexAlign.Start)
... ... @@ -126,6 +125,7 @@ export struct TabLiveItemComponent {
else if (this.item.dataType === LiveMessageOptType.ZH_VIDEO_MSG) {
RelativeContainer() {
Image(this.item.transcodeImageUrl)
.alt($r('app.media.cover_place_holder'))
.width('100%')
.objectFit(ImageFit.Cover)
.borderRadius(4)
... ... @@ -271,7 +271,7 @@ export struct TabLiveItemComponent {
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontSize(11)
.fontWeight(400)
.fontColor("#CB0000")
.fontColor("#ED2800")
.backgroundColor('#F1EFEB')
.padding({
left: 4,
... ...
import { CompInfoBean, ContentDTO, PageInfoBean } from 'wdBean/Index';
import { MorningEveningViewModel } from 'wdComponent/Index';
// import { MorningEveningViewModel } from 'wdComponent/Index';
import { CrptoUtils, FileUtils, Logger } from 'wdKit/Index';
import { FormNewspaperPaperType, FormNewspaperPaperContent,
FormNewspaperData } from "../dailynewspaperwidget/common/NewspaperWidgetData"
... ... @@ -8,6 +8,7 @@ import fs from '@ohos.file.fs';
import { BusinessError } from '@kit.BasicServicesKit';
import { JSON } from '@kit.ArkTS';
import { AppInnerLinkGenerator } from 'wdRouter';
import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
const TAG = "NewspaperDataFetcher"
... ... @@ -22,11 +23,11 @@ export class NewspaperDataFetcher {
data.paperInfo = { showLeftImage: false }
try {
let page: PageInfoBean = await MorningEveningViewModel.getDailyPaperTopic()
let page: PageInfoBean = await NewspaperDataFetcher.getDailyPaperTopic()
data.paperType = page.topicInfo?.topicPattern || FormNewspaperPaperType.unknown
let currentTime = new Date().getTime()
let compInfo = await MorningEveningViewModel.getMorningEveningCompInfo(
let compInfo = await NewspaperDataFetcher.getMorningEveningCompInfo(
page.id,
page.groups[0]?.id,
currentTime + "",
... ... @@ -208,5 +209,62 @@ export class NewspaperDataFetcher {
})
}
static async getDailyPaperTopic(): Promise<PageInfoBean> {
return new Promise<PageInfoBean>((success, error) => {
Logger.info(TAG, `getDailyPaperTopic pageInfo start`);
let url = HttpUrlUtils.getHost() + HttpUrlUtils.DAILY_PAPER_TOPIC;
WDHttp.get<ResponseDTO<PageInfoBean>>(url).then((resDTO: ResponseDTO<PageInfoBean>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'getDailyPaperTopic then navResDTO is empty');
error('resDTO is empty');
return
}
if (resDTO.code != 0) {
Logger.error(TAG, `getDailyPaperTopic then code:${resDTO.code}, message:${resDTO.message}`);
error('resDTO Response Code is failure');
return
}
// let navResStr = JSON.stringify(navResDTO);
Logger.info(TAG, "getDailyPaperTopic then,navResDTO.timestamp:" + resDTO.timestamp);
success(resDTO.data);
})
.catch((err: Error) => {
Logger.error(TAG, `getDailyPaperTopic catch, error.name : ${err.name}, error.message:${err.message}`);
error(err);
})
})
}
static async getMorningEveningCompInfo(pageId: number, groupId: number, refreshTime: string, topicId: string, pageNum: number = 1, pageSize: number = 20): Promise<CompInfoBean> {
return new Promise<CompInfoBean>((success, error) => {
Logger.info(TAG, `getMorningEveningCompInfo pageInfo start`);
let url = HttpUrlUtils.getHost() + HttpUrlUtils.COMP_PATH;
url = url + "?loadStrategy=first_load&pageNum=" + pageNum + "&refreshTime=" + refreshTime + "&pageId="
+ pageId + "&channelStrategy=2&groupId=" + groupId + "&topicId=" + topicId + "&pageSize=" + pageSize;
WDHttp.get<ResponseDTO<CompInfoBean>>(url).then((resDTO: ResponseDTO<CompInfoBean>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'getMorningEveningCompInfo then navResDTO is empty');
error('resDTO is empty');
return
}
if (resDTO.code != 0) {
Logger.error(TAG, `getMorningEveningCompInfo then code:${resDTO.code}, message:${resDTO.message}`);
error('resDTO Response Code is failure');
return
}
// let navResStr = JSON.stringify(navResDTO);
Logger.info(TAG, "getMorningEveningCompInfo then,navResDTO.timestamp:" + resDTO.timestamp);
success(resDTO.data);
})
.catch((err: Error) => {
Logger.error(TAG, `getMorningEveningCompInfo catch, error.name : ${err.name}, error.message:${err.message}`);
error(err);
})
})
}
}
\ No newline at end of file
... ...