陈剑华

feat: 17052 UI还原问题--【生产环境】直播预告-横滑卡左右边距问题,看图

@@ -208,6 +208,7 @@ export struct ZhSingleRow03 { @@ -208,6 +208,7 @@ export struct ZhSingleRow03 {
208 208
209 @Builder 209 @Builder
210 ItemCard(item: ContentDTO) { 210 ItemCard(item: ContentDTO) {
  211 + if (this.compDTO.operDataList.length >= 2) {
211 Column() { 212 Column() {
212 Row() { 213 Row() {
213 Image(this.loadImg ? item.coverUrl : '') 214 Image(this.loadImg ? item.coverUrl : '')
@@ -215,6 +216,7 @@ export struct ZhSingleRow03 { @@ -215,6 +216,7 @@ export struct ZhSingleRow03 {
215 .height(60) 216 .height(60)
216 .margin({right: 12}) 217 .margin({right: 12})
217 .backgroundColor(0xf5f5f5) 218 .backgroundColor(0xf5f5f5)
  219 + .margin({right: 12})
218 220
219 Text(item.newsTitle) 221 Text(item.newsTitle)
220 .width(154) 222 .width(154)
@@ -273,6 +275,74 @@ export struct ZhSingleRow03 { @@ -273,6 +275,74 @@ export struct ZhSingleRow03 {
273 InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) 275 InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
274 ProcessUtils.processPage(item) 276 ProcessUtils.processPage(item)
275 }) 277 })
  278 + } else {
  279 + Column() {
  280 + Row() {
  281 + Image(this.loadImg ? item.coverUrl : '')
  282 + .width(106)
  283 + .height(60)
  284 + .backgroundColor(0xf5f5f5)
  285 + .margin({right: 12})
  286 +
  287 + Text(item.newsTitle)
  288 + .width(201)
  289 + .height(60)
  290 + .maxLines(3)
  291 + .textOverflow({overflow: TextOverflow.Ellipsis})
  292 + }
  293 + .margin({bottom: 16})
  294 + .justifyContent(FlexAlign.Start)
  295 +
  296 + Row() {
  297 + Flex({justifyContent: FlexAlign.SpaceBetween}){
  298 + Row() {
  299 + Text(this.format(new Date(item.liveInfo.liveStartTime).getTime()))
  300 + .margin({right: 6})
  301 + .fontColor(0x000000)
  302 + .fontSize(13)
  303 + .textAlign(TextAlign.Start)
  304 + Image($r('app.media.timeline_rect'))
  305 + .width(4)
  306 + .height(3)
  307 + .margin({right: 6})
  308 + Text(item.liveInfo.liveStartTime.split(' ')[1].slice(0, 5))
  309 + .margin({right: 6})
  310 + .fontColor(0x000000)
  311 + .fontSize(13)
  312 + Text('开始直播')
  313 + .fontColor(0xC8C8C8)
  314 + .fontSize(13)
  315 + }
  316 +
  317 + Row() {
  318 + Text(this.isReserved(Number(item.objectId)) ? '已预约' : '预约')
  319 + .width(48)
  320 + .height(24)
  321 + .backgroundColor(this.isReserved(Number(item.objectId)) ? 0xffffff : 0xED2800)
  322 + .fontColor(this.isReserved(Number(item.objectId)) ? 0xC8C8C8 : 0xffffff)
  323 + .fontSize(12)
  324 + .textAlign(TextAlign.Center)
  325 + .borderRadius(3)
  326 + .onClick(() => {
  327 + this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId)))
  328 + })
  329 +
  330 + }
  331 + .margin({top: -5})
  332 + }
  333 +
  334 + }
  335 + }
  336 + .width('100%')
  337 + .height(116)
  338 + .padding({top: 12, bottom: 12, left: 12, right: 12})
  339 + .backgroundColor(0xf9f9f9)
  340 + .margin({right: 8})
  341 + .onClick(() => {
  342 + InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
  343 + ProcessUtils.processPage(item)
  344 + })
  345 + }
276 } 346 }
277 347
278 348
@@ -299,9 +369,6 @@ export struct ZhSingleRow03 { @@ -299,9 +369,6 @@ export struct ZhSingleRow03 {
299 .width(14) 369 .width(14)
300 .height(14) 370 .height(14)
301 } 371 }
302 - .padding({  
303 - right: $r('app.float.card_comp_pagePadding_lf'),  
304 - })  
305 .onClick(() => { 372 .onClick(() => {
306 this.jumpToMore(); 373 this.jumpToMore();
307 }) 374 })
@@ -337,79 +404,3 @@ function textOverflowStyle(maxLine: number) { @@ -337,79 +404,3 @@ function textOverflowStyle(maxLine: number) {
337 .textOverflow({ overflow: TextOverflow.Ellipsis }) 404 .textOverflow({ overflow: TextOverflow.Ellipsis })
338 } 405 }
339 406
340 -@Component  
341 -struct CreatorItem {  
342 - @Prop item: ContentDTO  
343 - @State rmhIsAttention: number = 0  
344 - @State loadImg: boolean = false;  
345 -  
346 - async aboutToAppear(): Promise<void> {  
347 - this.loadImg = await onlyWifiLoadImg();  
348 - }  
349 - build() {  
350 - ListItem() {  
351 - Column() {  
352 - Stack({ alignContent: Alignment.Bottom }) {  
353 - Image(this.loadImg ? this.item.coverUrl : '')  
354 - .backgroundColor(0xf5f5f5)  
355 - .width(156)  
356 - .height(208)  
357 - .border({width: 1})  
358 - .borderRadius(3)  
359 - Row()  
360 - .width(156)  
361 - .height(80)  
362 - .linearGradient({  
363 - direction: GradientDirection.Bottom,  
364 - colors: [['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]]  
365 - })  
366 - Text(this.item.newsTitle)  
367 - .fontColor(0xffffff)  
368 - .fontSize(14)  
369 - .maxLines(2)  
370 - .textOverflow({overflow: TextOverflow.Ellipsis})  
371 - .width(140)  
372 - .margin({bottom: 8})  
373 - }  
374 - }  
375 - .width(156)  
376 - .height(208)  
377 - .margin({ right: 11 })  
378 - .borderColor($r('app.color.color_EDEDED'))  
379 - .borderRadius($r('app.float.image_border_radius'))  
380 - }  
381 - .onClick((event: ClickEvent) => {  
382 - ProcessUtils.processPage(this.item)  
383 - })  
384 - }  
385 -  
386 - /**  
387 - * 关注号主 TODO 这里后面需要抽离  
388 - */  
389 - handleAccention(item: ContentDTO, status: number) {  
390 - this.rmhIsAttention = this.rmhIsAttention ? 0 : 1  
391 - return  
392 - // 未登录,跳转登录  
393 - if (!HttpUtils.getUserId()) {  
394 - WDRouterRule.jumpWithPage(WDRouterPage.loginPage)  
395 - return  
396 - }  
397 -  
398 - const params: postInteractAccentionOperateParams = {  
399 - attentionUserType: item.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号)  
400 - attentionUserId: item.rmhInfo?.userId || '', // 被关注用户号主id  
401 - attentionCreatorId: item.rmhInfo?.rmhId || '', // 被关注用户号主id  
402 - // userType: 1,  
403 - // userId: '1', // TODO 用户id需要从本地获取  
404 - status: status,  
405 - }  
406 - PageRepository.postInteractAccentionOperate(params).then(res => {  
407 - console.log(TAG, '关注号主==', JSON.stringify(res.data))  
408 - if (status === 1) {  
409 - this.rmhIsAttention = 0  
410 - } else {  
411 - this.rmhIsAttention = 1  
412 - }  
413 - })  
414 - }  
415 -}