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 { @@ -26,7 +26,8 @@ export struct RmhTitle {
26 @Prop publishTime: string | undefined 26 @Prop publishTime: string | undefined
27 @State loadImg: boolean = false; 27 @State loadImg: boolean = false;
28 isPeopleShipHome: boolean = false; 28 isPeopleShipHome: boolean = false;
29 - @Consume @Watch('pageShowForUpdateData') pageShow:number 29 + // 当前页面没有使用,并且会导致奔溃
  30 + // @Consume @Watch('pageShowForUpdateData') pageShow:number
30 /** 31 /**
31 * 是否需要隐藏发布时间超过2天的时间展示,默认不隐藏 32 * 是否需要隐藏发布时间超过2天的时间展示,默认不隐藏
32 */ 33 */
@@ -101,7 +101,11 @@ export struct Card10Component { @@ -101,7 +101,11 @@ export struct Card10Component {
101 .fontSize($r('app.float.font_size_18')) 101 .fontSize($r('app.float.font_size_18'))
102 .fontWeight(FontWeight.Normal) 102 .fontWeight(FontWeight.Normal)
103 .lineHeight(25) 103 .lineHeight(25)
104 - .maxLines(this.contentDTO.appStyle === CompStyle.Card_09 ? 2 : 1) 104 + .maxLines(
  105 + router.getState().name === 'MyCollectionListPage'
  106 + ? this.contentDTO.appStyle === CompStyle.Card_09 ? 2 : 1
  107 + : 2
  108 + )
105 .textOverflow({ overflow: TextOverflow.Ellipsis }) 109 .textOverflow({ overflow: TextOverflow.Ellipsis })
106 .margin({ bottom: 8 }) 110 .margin({ bottom: 8 })
107 .onClick((event: ClickEvent) => { 111 .onClick((event: ClickEvent) => {
@@ -162,8 +166,8 @@ export struct Card10Component { @@ -162,8 +166,8 @@ export struct Card10Component {
162 } 166 }
163 .width(CommonConstants.FULL_WIDTH) 167 .width(CommonConstants.FULL_WIDTH)
164 .padding({ 168 .padding({
165 - left: $r('app.float.card_comp_pagePadding_lf'),  
166 - right: $r('app.float.card_comp_pagePadding_lf'), 169 + left: 10,
  170 + right: 10,
167 top: $r('app.float.card_comp_pagePadding_tb'), 171 top: $r('app.float.card_comp_pagePadding_tb'),
168 bottom: $r('app.float.card_comp_pagePadding_tb') 172 bottom: $r('app.float.card_comp_pagePadding_tb')
169 }) 173 })
@@ -72,6 +72,9 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -72,6 +72,9 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
72 .fontColor($r("app.color.color_222222")) 72 .fontColor($r("app.color.color_222222"))
73 .fontWeight(600) 73 .fontWeight(600)
74 } 74 }
  75 + .padding({
  76 + left: this.compDTO.operDataList.length >= 2 ? 20 : 0
  77 + })
75 78
76 Row() { 79 Row() {
77 Text("更多") 80 Text("更多")
@@ -102,7 +105,6 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -102,7 +105,6 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
102 Image(item.coverUrl) 105 Image(item.coverUrl)
103 .aspectRatio(1.5) 106 .aspectRatio(1.5)
104 .width(this.compDTO.operDataList.length == 2 ? 210 : 150) 107 .width(this.compDTO.operDataList.length == 2 ? 210 : 150)
105 - .borderRadius(4)  
106 .objectFit(ImageFit.Contain) 108 .objectFit(ImageFit.Contain)
107 CardMediaInfo({ 109 CardMediaInfo({
108 livePeopleNum:false, 110 livePeopleNum:false,
@@ -110,6 +112,8 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -110,6 +112,8 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
110 }) 112 })
111 } 113 }
112 .align(Alignment.BottomEnd) 114 .align(Alignment.BottomEnd)
  115 + .borderRadius(4)
  116 + .border({width: 1, color: 0xf5f5f5})
113 117
114 Text(item.newsTitle) 118 Text(item.newsTitle)
115 .fontSize($r("app.float.font_size_14")) 119 .fontSize($r("app.float.font_size_14"))
@@ -129,6 +133,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -129,6 +133,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
129 InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) 133 InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
130 ProcessUtils.processPage(item) 134 ProcessUtils.processPage(item)
131 }) 135 })
  136 + .padding({ right: 16, left: index == 0 ? 20: 0 })
132 }) 137 })
133 } 138 }
134 139
@@ -190,16 +195,18 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -190,16 +195,18 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
190 // .margin({left:16,right:16}) 195 // .margin({left:16,right:16})
191 196
192 } 197 }
193 - // .width("100%") 198 + .width(this.compDTO.operDataList.length >= 2 ? 'calc(18vp + 100%)' : CommonConstants.FULL_WIDTH)
194 .padding({ 199 .padding({
195 - left: $r('app.float.card_comp_pagePadding_lf'),  
196 - right: $r('app.float.card_comp_pagePadding_lf'), 200 + left: this.compDTO.operDataList.length >= 2 ? 0 : 10,
  201 + right: this.compDTO.operDataList.length >= 2 ? 0 : 10,
197 top: $r('app.float.card_comp_pagePadding_tb'), 202 top: $r('app.float.card_comp_pagePadding_tb'),
198 bottom: 6 203 bottom: 6
199 }) 204 })
200 .backgroundColor($r("app.color.white")) 205 .backgroundColor($r("app.color.white"))
201 - // .backgroundColor($r("app.color.color_FE4B05"))  
202 - .margin({ bottom: 8 }) 206 + .margin({
  207 + left: this.compDTO.operDataList.length >= 2 ? -6 : 0,
  208 + bottom: 8
  209 + })
203 } 210 }
204 211
205 private jumpToLiveMorePage() { 212 private jumpToLiveMorePage() {
@@ -122,6 +122,9 @@ export struct LiveHorizontalCardComponent { @@ -122,6 +122,9 @@ export struct LiveHorizontalCardComponent {
122 .fontColor($r("app.color.color_222222")) 122 .fontColor($r("app.color.color_222222"))
123 .fontWeight(600) 123 .fontWeight(600)
124 } 124 }
  125 + .padding({
  126 + left: this.compDTO.operDataList.length >= 2 ? 20 : 0
  127 + })
125 128
126 if (this.showMore()) { 129 if (this.showMore()) {
127 Row() { 130 Row() {
@@ -139,7 +142,6 @@ export struct LiveHorizontalCardComponent { @@ -139,7 +142,6 @@ export struct LiveHorizontalCardComponent {
139 } 142 }
140 } 143 }
141 .justifyContent(FlexAlign.SpaceBetween) 144 .justifyContent(FlexAlign.SpaceBetween)
142 - // .padding({ left: 16, right: 16 })  
143 .margin({ bottom: 10 }) 145 .margin({ bottom: 10 })
144 .width(CommonConstants.FULL_WIDTH) 146 .width(CommonConstants.FULL_WIDTH)
145 147
@@ -177,7 +179,7 @@ export struct LiveHorizontalCardComponent { @@ -177,7 +179,7 @@ export struct LiveHorizontalCardComponent {
177 .lineHeight(21) 179 .lineHeight(21)
178 } 180 }
179 .height(this.compDTO.operDataList.length == 2 ? 167 : 134) 181 .height(this.compDTO.operDataList.length == 2 ? 167 : 134)
180 - .padding({ right: 8 }) 182 + .padding({ right: index == this.compDTO.operDataList.length - 1 ? 16 : 8, left: index == 0 ? 20: 0 })
181 .onClick(() => { 183 .onClick(() => {
182 InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) 184 InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
183 if (item.objectType != '0') { 185 if (item.objectType != '0') {
@@ -251,13 +253,16 @@ export struct LiveHorizontalCardComponent { @@ -251,13 +253,16 @@ export struct LiveHorizontalCardComponent {
251 }) 253 })
252 } 254 }
253 } 255 }
254 - // .width(CommonConstants.FULL_WIDTH) 256 + .width(this.compDTO.operDataList.length >= 2 ? 'calc(18vp + 100%)' : CommonConstants.FULL_WIDTH)
255 .padding({ 257 .padding({
256 - left: 10,  
257 - right: 10, 258 + left: this.compDTO.operDataList.length >= 2 ? 0 : 10,
  259 + right: this.compDTO.operDataList.length >= 2 ? 0 : 10,
258 top: $r('app.float.card_comp_pagePadding_tb'), 260 top: $r('app.float.card_comp_pagePadding_tb'),
259 bottom: $r('app.float.card_comp_pagePadding_tb') 261 bottom: $r('app.float.card_comp_pagePadding_tb')
260 }) 262 })
  263 + .margin({
  264 + left: this.compDTO.operDataList.length >= 2 ? -6 : 0
  265 + })
261 .backgroundColor($r("app.color.white")) 266 .backgroundColor($r("app.color.white"))
262 } 267 }
263 268
@@ -55,7 +55,7 @@ export struct TabLiveItemComponent { @@ -55,7 +55,7 @@ export struct TabLiveItemComponent {
55 .fontColor('#999999') 55 .fontColor('#999999')
56 .margin({ left: 8 }) 56 .margin({ left: 8 })
57 .visibility(StringUtils.isNotEmpty(this.item.time) ? Visibility.Visible : Visibility.None) 57 .visibility(StringUtils.isNotEmpty(this.item.time) ? Visibility.Visible : Visibility.None)
58 - 58 + Blank()
59 Text('置顶') 59 Text('置顶')
60 .fontSize('11vp') 60 .fontSize('11vp')
61 .fontWeight(400) 61 .fontWeight(400)
@@ -69,7 +69,6 @@ export struct TabLiveItemComponent { @@ -69,7 +69,6 @@ export struct TabLiveItemComponent {
69 }) 69 })
70 .borderRadius(2) 70 .borderRadius(2)
71 .margin({ left: 8 }) 71 .margin({ left: 8 })
72 - .width(100)  
73 .visibility(1 == this.item.isTop ? Visibility.Visible : Visibility.None) 72 .visibility(1 == this.item.isTop ? Visibility.Visible : Visibility.None)
74 } 73 }
75 .justifyContent(FlexAlign.Start) 74 .justifyContent(FlexAlign.Start)
@@ -126,6 +125,7 @@ export struct TabLiveItemComponent { @@ -126,6 +125,7 @@ export struct TabLiveItemComponent {
126 else if (this.item.dataType === LiveMessageOptType.ZH_VIDEO_MSG) { 125 else if (this.item.dataType === LiveMessageOptType.ZH_VIDEO_MSG) {
127 RelativeContainer() { 126 RelativeContainer() {
128 Image(this.item.transcodeImageUrl) 127 Image(this.item.transcodeImageUrl)
  128 + .alt($r('app.media.cover_place_holder'))
129 .width('100%') 129 .width('100%')
130 .objectFit(ImageFit.Cover) 130 .objectFit(ImageFit.Cover)
131 .borderRadius(4) 131 .borderRadius(4)
@@ -271,7 +271,7 @@ export struct TabLiveItemComponent { @@ -271,7 +271,7 @@ export struct TabLiveItemComponent {
271 .textOverflow({ overflow: TextOverflow.Ellipsis }) 271 .textOverflow({ overflow: TextOverflow.Ellipsis })
272 .fontSize(11) 272 .fontSize(11)
273 .fontWeight(400) 273 .fontWeight(400)
274 - .fontColor("#CB0000") 274 + .fontColor("#ED2800")
275 .backgroundColor('#F1EFEB') 275 .backgroundColor('#F1EFEB')
276 .padding({ 276 .padding({
277 left: 4, 277 left: 4,
1 import { CompInfoBean, ContentDTO, PageInfoBean } from 'wdBean/Index'; 1 import { CompInfoBean, ContentDTO, PageInfoBean } from 'wdBean/Index';
2 -import { MorningEveningViewModel } from 'wdComponent/Index'; 2 +// import { MorningEveningViewModel } from 'wdComponent/Index';
3 import { CrptoUtils, FileUtils, Logger } from 'wdKit/Index'; 3 import { CrptoUtils, FileUtils, Logger } from 'wdKit/Index';
4 import { FormNewspaperPaperType, FormNewspaperPaperContent, 4 import { FormNewspaperPaperType, FormNewspaperPaperContent,
5 FormNewspaperData } from "../dailynewspaperwidget/common/NewspaperWidgetData" 5 FormNewspaperData } from "../dailynewspaperwidget/common/NewspaperWidgetData"
@@ -8,6 +8,7 @@ import fs from '@ohos.file.fs'; @@ -8,6 +8,7 @@ import fs from '@ohos.file.fs';
8 import { BusinessError } from '@kit.BasicServicesKit'; 8 import { BusinessError } from '@kit.BasicServicesKit';
9 import { JSON } from '@kit.ArkTS'; 9 import { JSON } from '@kit.ArkTS';
10 import { AppInnerLinkGenerator } from 'wdRouter'; 10 import { AppInnerLinkGenerator } from 'wdRouter';
  11 +import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
11 12
12 const TAG = "NewspaperDataFetcher" 13 const TAG = "NewspaperDataFetcher"
13 14
@@ -22,11 +23,11 @@ export class NewspaperDataFetcher { @@ -22,11 +23,11 @@ export class NewspaperDataFetcher {
22 data.paperInfo = { showLeftImage: false } 23 data.paperInfo = { showLeftImage: false }
23 24
24 try { 25 try {
25 - let page: PageInfoBean = await MorningEveningViewModel.getDailyPaperTopic() 26 + let page: PageInfoBean = await NewspaperDataFetcher.getDailyPaperTopic()
26 data.paperType = page.topicInfo?.topicPattern || FormNewspaperPaperType.unknown 27 data.paperType = page.topicInfo?.topicPattern || FormNewspaperPaperType.unknown
27 28
28 let currentTime = new Date().getTime() 29 let currentTime = new Date().getTime()
29 - let compInfo = await MorningEveningViewModel.getMorningEveningCompInfo( 30 + let compInfo = await NewspaperDataFetcher.getMorningEveningCompInfo(
30 page.id, 31 page.id,
31 page.groups[0]?.id, 32 page.groups[0]?.id,
32 currentTime + "", 33 currentTime + "",
@@ -208,5 +209,62 @@ export class NewspaperDataFetcher { @@ -208,5 +209,62 @@ export class NewspaperDataFetcher {
208 }) 209 })
209 } 210 }
210 211
  212 + static async getDailyPaperTopic(): Promise<PageInfoBean> {
  213 + return new Promise<PageInfoBean>((success, error) => {
  214 + Logger.info(TAG, `getDailyPaperTopic pageInfo start`);
  215 +
  216 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.DAILY_PAPER_TOPIC;
  217 + WDHttp.get<ResponseDTO<PageInfoBean>>(url).then((resDTO: ResponseDTO<PageInfoBean>) => {
  218 + if (!resDTO || !resDTO.data) {
  219 + Logger.error(TAG, 'getDailyPaperTopic then navResDTO is empty');
  220 + error('resDTO is empty');
  221 + return
  222 + }
  223 + if (resDTO.code != 0) {
  224 + Logger.error(TAG, `getDailyPaperTopic then code:${resDTO.code}, message:${resDTO.message}`);
  225 + error('resDTO Response Code is failure');
  226 + return
  227 + }
  228 + // let navResStr = JSON.stringify(navResDTO);
  229 + Logger.info(TAG, "getDailyPaperTopic then,navResDTO.timestamp:" + resDTO.timestamp);
  230 + success(resDTO.data);
  231 + })
  232 + .catch((err: Error) => {
  233 + Logger.error(TAG, `getDailyPaperTopic catch, error.name : ${err.name}, error.message:${err.message}`);
  234 + error(err);
  235 + })
  236 + })
  237 + }
  238 +
  239 + static async getMorningEveningCompInfo(pageId: number, groupId: number, refreshTime: string, topicId: string, pageNum: number = 1, pageSize: number = 20): Promise<CompInfoBean> {
  240 + return new Promise<CompInfoBean>((success, error) => {
  241 + Logger.info(TAG, `getMorningEveningCompInfo pageInfo start`);
  242 +
  243 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.COMP_PATH;
  244 + url = url + "?loadStrategy=first_load&pageNum=" + pageNum + "&refreshTime=" + refreshTime + "&pageId="
  245 + + pageId + "&channelStrategy=2&groupId=" + groupId + "&topicId=" + topicId + "&pageSize=" + pageSize;
  246 +
  247 + WDHttp.get<ResponseDTO<CompInfoBean>>(url).then((resDTO: ResponseDTO<CompInfoBean>) => {
  248 + if (!resDTO || !resDTO.data) {
  249 + Logger.error(TAG, 'getMorningEveningCompInfo then navResDTO is empty');
  250 + error('resDTO is empty');
  251 + return
  252 + }
  253 + if (resDTO.code != 0) {
  254 + Logger.error(TAG, `getMorningEveningCompInfo then code:${resDTO.code}, message:${resDTO.message}`);
  255 + error('resDTO Response Code is failure');
  256 + return
  257 + }
  258 + // let navResStr = JSON.stringify(navResDTO);
  259 + Logger.info(TAG, "getMorningEveningCompInfo then,navResDTO.timestamp:" + resDTO.timestamp);
  260 + success(resDTO.data);
  261 + })
  262 + .catch((err: Error) => {
  263 + Logger.error(TAG, `getMorningEveningCompInfo catch, error.name : ${err.name}, error.message:${err.message}`);
  264 + error(err);
  265 + })
  266 + })
  267 + }
  268 +
211 269
212 } 270 }