wangliang_wd

feat:优化早晚报组件UI

@@ -127,18 +127,20 @@ export struct SingleColumn999Component { @@ -127,18 +127,20 @@ export struct SingleColumn999Component {
127 127
128 ListItem() { 128 ListItem() {
129 Text("已显示全部内容") 129 Text("已显示全部内容")
  130 + .fontSize(14)
130 .width("100%")// .height(100) 131 .width("100%")// .height(100)
  132 + .height(50)
131 .padding(9) 133 .padding(9)
132 .fontColor(Color.White) 134 .fontColor(Color.White)
133 .fontSize($r('app.float.font_size_14')) 135 .fontSize($r('app.float.font_size_14'))
134 .fontWeight(400) 136 .fontWeight(400)
135 .textAlign(TextAlign.Center) 137 .textAlign(TextAlign.Center)
136 - .align(Alignment.Bottom) 138 + .align(Alignment.Top)
137 .maxLines(1) 139 .maxLines(1)
138 .textOverflow({ overflow: TextOverflow.Ellipsis }) 140 .textOverflow({ overflow: TextOverflow.Ellipsis })
139 } 141 }
140 } 142 }
141 - .height("100%") // 必须设置height 143 + // .height("100%") // 必须设置height
142 // .margin({ left: 14, right: 14 }) 144 // .margin({ left: 14, right: 14 })
143 // .listDirection(Axis.Vertical) // 默认值:Axis.Vertical 145 // .listDirection(Axis.Vertical) // 默认值:Axis.Vertical
144 // .lanes(this.buildLanes()) // 行/列数,一列 // 默认值:1 146 // .lanes(this.buildLanes()) // 行/列数,一列 // 默认值:1
@@ -34,7 +34,7 @@ export struct topicInfoView { @@ -34,7 +34,7 @@ export struct topicInfoView {
34 34
35 if (this.frontLinkObject) { 35 if (this.frontLinkObject) {
36 Row() { 36 Row() {
37 - Text("查看详情") 37 + Text(this.frontLinkObject.linkUrl.length > 0?"查看详情":'')
38 .fontSize(14) 38 .fontSize(14)
39 .fontColor($r('app.color.white')) 39 .fontColor($r('app.color.white'))
40 .maxLines(1) 40 .maxLines(1)
@@ -50,6 +50,7 @@ export struct topicInfoView { @@ -50,6 +50,7 @@ export struct topicInfoView {
50 .margin({ top: 8, left: 16, right: 16, bottom: 16 }) 50 .margin({ top: 8, left: 16, right: 16, bottom: 16 })
51 .borderRadius(2) 51 .borderRadius(2)
52 .onClick(()=>{ 52 .onClick(()=>{
  53 + if (this.frontLinkObject.linkUrl.length === 0) return
53 let contentDTO :ContentDTO = new ContentDTO(); 54 let contentDTO :ContentDTO = new ContentDTO();
54 contentDTO.objectType = this.frontLinkObject?.newsType.toString() 55 contentDTO.objectType = this.frontLinkObject?.newsType.toString()
55 contentDTO.objectId = this.frontLinkObject?.newsId 56 contentDTO.objectId = this.frontLinkObject?.newsId
@@ -440,6 +440,7 @@ export struct PaperSingleColumn999CardView { @@ -440,6 +440,7 @@ export struct PaperSingleColumn999CardView {
440 .borderRadius(5) 440 .borderRadius(5)
441 .aspectRatio(319 / 179) ///图片设计比例 441 .aspectRatio(319 / 179) ///图片设计比例
442 .padding({ top: 10 }) 442 .padding({ top: 10 })
  443 + //视频
443 if (this.item?.videoInfo) { 444 if (this.item?.videoInfo) {
444 Row() { 445 Row() {
445 Image($r('app.media.card_play')) 446 Image($r('app.media.card_play'))
@@ -468,6 +469,64 @@ export struct PaperSingleColumn999CardView { @@ -468,6 +469,64 @@ export struct PaperSingleColumn999CardView {
468 .width(CommonConstants.FULL_PARENT) 469 .width(CommonConstants.FULL_PARENT)
469 .justifyContent(FlexAlign.End) 470 .justifyContent(FlexAlign.End)
470 } 471 }
  472 + //直播
  473 + if (this.item?.objectType === '2') {
  474 + Row() {
  475 + Image(this.buildLiveStateImage())
  476 + .width(14)
  477 + .height(14)
  478 + .objectFit(ImageFit.Contain)
  479 + Text(this.buildLiveStateString())
  480 + .fontColor(Color.White)
  481 + .fontSize($r('app.float.vp_12'))
  482 + .fontWeight(500)
  483 + .textAlign(TextAlign.End)
  484 + .lineHeight(18)
  485 + .textShadow({
  486 + radius: 2,
  487 + color: 'rgba(0,0,0,0.3)',
  488 + offsetY: 2
  489 + })
  490 + .margin({
  491 + right: 10,
  492 + left: 3
  493 + })
  494 + }
  495 + .margin({
  496 + bottom: 3
  497 + })
  498 + .width(CommonConstants.FULL_PARENT)
  499 + .justifyContent(FlexAlign.End)
  500 + }
  501 + //组图
  502 + if (this.item?.objectType === '9') {
  503 + Row() {
  504 + Image($r('app.media.card_image'))
  505 + .width(14)
  506 + .height(14)
  507 + .objectFit(ImageFit.Contain)
  508 + Text(this.item?.photoNum.toString())
  509 + .fontColor(Color.White)
  510 + .fontSize($r('app.float.vp_12'))
  511 + .fontWeight(500)
  512 + .textAlign(TextAlign.End)
  513 + .lineHeight(18)
  514 + .textShadow({
  515 + radius: 2,
  516 + color: 'rgba(0,0,0,0.3)',
  517 + offsetY: 2
  518 + })
  519 + .margin({
  520 + right: 10,
  521 + left: 3
  522 + })
  523 + }
  524 + .margin({
  525 + bottom: 3
  526 + })
  527 + .width(CommonConstants.FULL_PARENT)
  528 + .justifyContent(FlexAlign.End)
  529 + }
471 }.margin({ left: 16, right: 16 }) 530 }.margin({ left: 16, right: 16 })
472 } 531 }
473 if (this.item?.newsSummary) { 532 if (this.item?.newsSummary) {
@@ -483,14 +542,14 @@ export struct PaperSingleColumn999CardView { @@ -483,14 +542,14 @@ export struct PaperSingleColumn999CardView {
483 if (this.item) { 542 if (this.item) {
484 Row() { 543 Row() {
485 Row() { 544 Row() {
486 - if (this.item?.source.length > 0) {  
487 - Text(this.item?.source) 545 + if (this.buildSourceString().length > 0) {
  546 + Text(this.buildSourceString())
488 .fontSize(12) 547 .fontSize(12)
489 .fontColor('#B0B0B0') 548 .fontColor('#B0B0B0')
490 .margin({ left: 16 }) 549 .margin({ left: 16 })
491 550
492 ///不显示时间或者不显示评论 551 ///不显示时间或者不显示评论
493 - if (this.getPublishTime().length > 0 || this.item.objectType != '2' && this.interactData && this.interactData.commentNum && Number(this.interactData.collectNum) > 0) { 552 + if (this.getPublishTime().length > 0 || this.item.objectType != '2' && this.interactData && this.interactData.commentNum && Number(this.interactData.commentNum) > 0) {
494 Image($r('app.media.point')) 553 Image($r('app.media.point'))
495 .width(16) 554 .width(16)
496 .height(16) 555 .height(16)
@@ -502,7 +561,7 @@ export struct PaperSingleColumn999CardView { @@ -502,7 +561,7 @@ export struct PaperSingleColumn999CardView {
502 .fontSize(12) 561 .fontSize(12)
503 .fontColor('#B0B0B0') 562 .fontColor('#B0B0B0')
504 .margin({ left: this.item?.source.length > 0?0:16 }) 563 .margin({ left: this.item?.source.length > 0?0:16 })
505 - if (this.item.objectType != '2' && this.interactData && this.interactData.commentNum && Number(this.interactData.collectNum) > 0) { 564 + if (this.item.objectType != '2' && this.interactData && this.interactData.commentNum && Number(this.interactData.commentNum) > 0) {
506 Text(this.interactData.commentNum + "评") 565 Text(this.interactData.commentNum + "评")
507 .fontSize(12) 566 .fontSize(12)
508 .fontColor('#B0B0B0') 567 .fontColor('#B0B0B0')
@@ -555,5 +614,39 @@ export struct PaperSingleColumn999CardView { @@ -555,5 +614,39 @@ export struct PaperSingleColumn999CardView {
555 } 614 }
556 } 615 }
557 616
  617 + buildLiveStateString(): string {
  618 + let contentString: string = ''
  619 + if (this.item.liveInfo.liveState === 'wait') {
  620 + contentString = '预约'
  621 + }else if(this.item.liveInfo.liveState === 'running'){
  622 + contentString = '直播中'
  623 + }else if(this.item.liveInfo.liveState === 'end'){
  624 + contentString = '回看'
  625 + }
  626 + return contentString;
  627 + }
  628 +
  629 +
558 630
  631 + buildLiveStateImage(): Resource | string {
  632 + let imageString: Resource | string = ''
  633 + if (this.item.liveInfo.liveState === 'wait') {
  634 + imageString = $r('app.media.card_wait')
  635 + }else if(this.item.liveInfo.liveState === 'running'){
  636 + imageString = $r('app.media.card_live')
  637 + }else if(this.item.liveInfo.liveState === 'end'){
  638 + imageString = $r('app.media.card_play')
  639 + }
  640 + return imageString;
  641 + }
  642 +
  643 + buildSourceString(): string {
  644 + let contentString: string = ''
  645 + if (this.item?.rmhInfo?.rmhName.length > 0) {
  646 + contentString = this.item?.rmhInfo?.rmhName
  647 + }else if(this.item?.source.length > 0){
  648 + contentString = this.item?.source
  649 + }
  650 + return contentString;
  651 + }
559 } 652 }
@@ -40,12 +40,13 @@ struct MyCollectionListPage { @@ -40,12 +40,13 @@ struct MyCollectionListPage {
40 TrackingButton.click('morning_evening_news_click',TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect) 40 TrackingButton.click('morning_evening_news_click',TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect)
41 } 41 }
42 }, 42 },
43 - titleShow:false,  
44 - tipValue: this.isAllSelect?'是否确认清空?':'确认删除'+this.deleteNum.toString()+'条收藏' 43 + title:this.isAllSelect?'是否确认清空?':'确认删除'+this.deleteNum.toString()+'条收藏',
  44 + tipShow: false ,
  45 + leftTextColor:$r('app.color.color_648DF2'),
45 }), 46 }),
46 autoCancel: true, 47 autoCancel: true,
47 alignment: DialogAlignment.Center, 48 alignment: DialogAlignment.Center,
48 - customStyle: true 49 + customStyle: true,
49 }) 50 })
50 51
51 aboutToAppear(){ 52 aboutToAppear(){
@@ -627,7 +627,9 @@ export struct TopNavigationComponentNew { @@ -627,7 +627,9 @@ export struct TopNavigationComponentNew {
627 }else { 627 }else {
628 ToastUtils.showToast('暂无早晚报信息', 1000) 628 ToastUtils.showToast('暂无早晚报信息', 1000)
629 } 629 }
630 - }).catch() 630 + }).catch((err:string) =>{
  631 + ToastUtils.showToast('暂无早晚报信息', 1000)
  632 + })
631 } else { 633 } else {
632 ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) 634 ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
633 } 635 }