zhenghy

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

# Conflicts:
#	sight_harmony/features/wdComponent/src/main/ets/components/page/PageComponent.ets
@@ -50,6 +50,8 @@ export { GroupDTO } from './src/main/ets/bean/component/GroupDTO'; @@ -50,6 +50,8 @@ export { GroupDTO } from './src/main/ets/bean/component/GroupDTO';
50 50
51 export { CompDTO } from './src/main/ets/bean/component/CompDTO'; 51 export { CompDTO } from './src/main/ets/bean/component/CompDTO';
52 52
  53 +export { LiveReviewDTO } from './src/main/ets/bean/component/LiveReviewDTO';
  54 +
53 export { NewspaperListBean } from './src/main/ets/bean/newspaper/NewspaperListBean'; 55 export { NewspaperListBean } from './src/main/ets/bean/newspaper/NewspaperListBean';
54 56
55 export { NewspaperListItemBean } from './src/main/ets/bean/newspaper/NewspaperListItemBean'; 57 export { NewspaperListItemBean } from './src/main/ets/bean/newspaper/NewspaperListItemBean';
  1 +import { ContentDTO } from '../content/ContentDTO';
  2 +
  3 +export interface LiveReviewDTO {
  4 + hasNext: boolean;
  5 + pageNum: number;
  6 + pageSize: number;
  7 + totalCount: number;
  8 + list: ContentDTO[];
  9 +}
@@ -62,9 +62,11 @@ export interface ContentDTO { @@ -62,9 +62,11 @@ export interface ContentDTO {
62 // 二次请求接口,返回的数据,这里组装到content里; 62 // 二次请求接口,返回的数据,这里组装到content里;
63 interactData:InteractDataDTO; 63 interactData:InteractDataDTO;
64 64
65 - hasMore: number,  
66 - slideShows: slideShows[],  
67 - voiceInfo: VoiceInfoDTO,  
68 - tagWord: number,  
69 - rmhInfo: RmhInfoDTO, // 人民号信息 65 + hasMore: number;
  66 + slideShows: slideShows[];
  67 + voiceInfo: VoiceInfoDTO;
  68 + tagWord: number;
  69 + rmhInfo: RmhInfoDTO; // 人民号信息
  70 + photoNum: string;
  71 +
70 } 72 }
@@ -3,6 +3,7 @@ export interface FullColumnImgUrlDTO { @@ -3,6 +3,7 @@ export interface FullColumnImgUrlDTO {
3 height: number; 3 height: number;
4 landscape: number; 4 landscape: number;
5 size: number | null; 5 size: number | null;
6 - url: string; 6 + url: string; // 图片地址--列表显示
7 weight: number; 7 weight: number;
  8 + fullUrl: string; // 图片地址--预览地址使用;【人民号动态卡预览】
8 } 9 }
@@ -42,12 +42,14 @@ export struct CardParser { @@ -42,12 +42,14 @@ export struct CardParser {
42 Card9Component({ contentDTO }) 42 Card9Component({ contentDTO })
43 } else if (contentDTO.appStyle === CompStyle.Card_10) { 43 } else if (contentDTO.appStyle === CompStyle.Card_10) {
44 Card10Component({ contentDTO }) 44 Card10Component({ contentDTO })
45 - } else if (contentDTO.appStyle === CompStyle.Card_15) {  
46 - // Card15Component({ contentDTO })  
47 } else if (contentDTO.appStyle === CompStyle.Card_11) { 45 } else if (contentDTO.appStyle === CompStyle.Card_11) {
48 Card11Component({ contentDTO }) 46 Card11Component({ contentDTO })
  47 + } else if (contentDTO.appStyle === CompStyle.Card_15) {
  48 + Card15Component({ contentDTO })
49 } else if (contentDTO.appStyle === CompStyle.Card_17) { 49 } else if (contentDTO.appStyle === CompStyle.Card_17) {
50 Card17Component({ contentDTO }) 50 Card17Component({ contentDTO })
  51 + } else if (contentDTO.appStyle === CompStyle.Card_19) {
  52 + Card19Component({ contentDTO })
51 } else if (contentDTO.appStyle === CompStyle.Card_20) { 53 } else if (contentDTO.appStyle === CompStyle.Card_20) {
52 Card20Component({ contentDTO }) 54 Card20Component({ contentDTO })
53 } 55 }
  1 +import { ContentDTO } from 'wdBean/Index'
1 import { DateTimeUtils } from 'wdKit/Index' 2 import { DateTimeUtils } from 'wdKit/Index'
2 3
3 /** 4 /**
@@ -6,35 +7,81 @@ import { DateTimeUtils } from 'wdKit/Index' @@ -6,35 +7,81 @@ import { DateTimeUtils } from 'wdKit/Index'
6 * 音频: 音频图标+时长 7 * 音频: 音频图标+时长
7 * 视频:点播图标+时长;直播图标+'直播中' 8 * 视频:点播图标+时长;直播图标+'直播中'
8 */ 9 */
9 -@Preview  
10 @Component 10 @Component
11 export struct CardMediaInfo { 11 export struct CardMediaInfo {
12 - @State duration: number = 0 // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中  
13 - @State mediaType: string = 'video' // audio: 音频;video: 视频 12 + @State contentDTO: ContentDTO = {} as ContentDTO // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中
  13 + // objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,
  14 + // 14动态图文,15动态视频16问政;100人民号,101标签
14 15
15 build() { 16 build() {
16 Row() { 17 Row() {
17 - if (this.mediaType === 'audio') {  
18 - Image($r('app.media.broadcast_listen'))  
19 - .height(14)  
20 - .borderRadius($r('app.float.button_border_radius'))  
21 - } else {  
22 - Image(this.duration ? $r('app.media.videoTypeIcon') : $r('app.media.icon_live'))  
23 - .width(22)  
24 - .height(18)  
25 - .borderRadius($r('app.float.button_border_radius')) 18 + if(this.contentDTO.objectType === '1') {
  19 + // 显示点播
  20 + Row(){
  21 + Image($r('app.media.videoTypeIcon'))
  22 + .width(22)
  23 + .height(18)
  24 + .borderRadius($r('app.float.button_border_radius'))
  25 + Text(DateTimeUtils.getFormattedDuration(this.contentDTO.videoInfo.videoDuration * 1000))
  26 + .fontColor($r('app.color.color_fff'))
  27 + .fontSize($r('app.float.font_size_12'))
  28 + .width(40)
  29 + .height(18)
  30 + .textAlign(TextAlign.Center)
  31 + .margin({ left: -3 })
  32 + }
  33 + .backgroundColor('#4d000000')
  34 + .borderRadius($r('app.float.button_border_radius'))
  35 + } else if(this.contentDTO.objectType === '2') {
  36 + // 显示直播信息
  37 + Row(){
  38 + Image($r('app.media.icon_live'))
  39 + .width(22)
  40 + .height(18)
  41 + .borderRadius($r('app.float.button_border_radius'))
  42 + Text('直播中')
  43 + .fontColor($r('app.color.color_fff'))
  44 + .fontSize($r('app.float.font_size_12'))
  45 + .width(40)
  46 + .height(18)
  47 + .textAlign(TextAlign.Center)
  48 + .margin({ left: -3 })
  49 + }
  50 + .backgroundColor('#4d000000')
  51 + .borderRadius($r('app.float.button_border_radius'))
  52 + } else if(this.contentDTO.objectType === '9') {
  53 + // 显示组图;图片数量
  54 + Row(){
  55 + Image($r('app.media.album_card_shape'))
  56 + .width(22)
  57 + .height(18)
  58 + .borderRadius($r('app.float.button_border_radius'))
  59 + Text(this.contentDTO.photoNum)
  60 + .fontColor($r('app.color.color_fff'))
  61 + .fontSize($r('app.float.font_size_12'))
  62 + .width(20)
  63 + .height(18)
  64 + .textAlign(TextAlign.Center)
  65 + .margin({ left: -3 })
  66 + }
  67 + .backgroundColor('#4d000000')
  68 + .borderRadius($r('app.float.button_border_radius'))
  69 + } else if(this.contentDTO.objectType === '13') {
  70 + // 显示音频信息
  71 + Row(){
  72 + Image($r('app.media.broadcast_listen'))
  73 + .height(14)
  74 + .borderRadius($r('app.float.button_border_radius'))
  75 + Text(DateTimeUtils.getFormattedDuration(this.contentDTO.voiceInfo.voiceDuration * 1000))
  76 + .fontColor($r('app.color.color_fff'))
  77 + .fontSize($r('app.float.font_size_12'))
  78 + .width(40)
  79 + .height(18)
  80 + .textAlign(TextAlign.Center)
  81 + .margin({ left: -3 })
  82 + }
26 } 83 }
27 -  
28 - Text(this.duration ? DateTimeUtils.getFormattedDuration(this.duration * 1000) : '直播中')  
29 - .fontColor($r('app.color.color_fff'))  
30 - .fontSize($r('app.float.font_size_12'))  
31 - .width(40)  
32 - .height(18)  
33 - .textAlign(TextAlign.Center)  
34 - .margin({ left: -3 })  
35 } 84 }
36 - .backgroundColor(this.mediaType === 'audio' ? '': '#4d000000')  
37 - .borderRadius($r('app.float.button_border_radius'))  
38 .margin(6) 85 .margin(6)
39 } 86 }
40 } 87 }
1 -//全标题 "appStyle":"2",  
2 import { ContentDTO } from 'wdBean'; 1 import { ContentDTO } from 'wdBean';
3 import { ProcessUtils } from '../../utils/ProcessUtils'; 2 import { ProcessUtils } from '../../utils/ProcessUtils';
4 - 3 +import { RmhTitle } from '../cardCommon/RmhTitle'
  4 +import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
  5 +import { CommonConstants } from 'wdConstant/Index';
5 6
6 const TAG: string = 'Card15Component'; 7 const TAG: string = 'Card15Component';
7 8
@@ -12,89 +13,91 @@ const TAG: string = 'Card15Component'; @@ -12,89 +13,91 @@ const TAG: string = 'Card15Component';
12 * 卡片宽度:充满父窗口 13 * 卡片宽度:充满父窗口
13 * 卡片高度,仅包含横板图片:图片高度由图片的宽度及宽高比决定,图片宽度占父窗口'100%',宽高比为16:9: 14 * 卡片高度,仅包含横板图片:图片高度由图片的宽度及宽高比决定,图片宽度占父窗口'100%',宽高比为16:9:
14 */ 15 */
15 -// @Entry  
16 @Component 16 @Component
17 export struct Card15Component { 17 export struct Card15Component {
18 - @State contentDTO: ContentDTO = {} as ContentDTO; 18 + @State contentDTO: ContentDTO = {
  19 + // appStyle: '15',
  20 + // coverType: 1,
  21 + // objectType: '9',
  22 + // coverUrl: 'https://rmrbcmsonline.peopleapp.com/rb_recsys/img/2024/0413/VL20Z09ISBEKXZU_963672030241091584.jpeg?x-oss-process=image/resize,m_fill,h_450,w_800/quality,q_90',
  23 + // fullColumnImgUrls: [
  24 + // {
  25 + // landscape: 2,
  26 + // size: 1,
  27 + // url: 'https://rmrbcmsonline.peopleapp.com/rb_recsys/img/2024/0413/VL20Z09ISBEKXZU_963672030241091584.jpeg?x-oss-process=image/resize,m_fill,h_450,w_800/quality,q_90',
  28 + // weight: 1170
  29 + // }
  30 + // ],
  31 + // newsTitle: '押解画面公开!被湖北民警从柬埔寨押解回国被湖北民警从柬埔寨押解回国的130名涉赌诈嫌疑人是他们被湖北民警从柬埔寨押解回国的130名涉赌诈嫌疑人是他们的130名涉赌诈嫌疑人是他们',
  32 + // publishTime: '1712993333000',
  33 + // rmhInfo: {
  34 + // authIcon: '',
  35 + // authTitle: '',
  36 + // authTitle2: '',
  37 + // banControl: 0,
  38 + // cnIsAttention: 1,
  39 + // rmhDesc: '中共武汉市委机关报长江日报官方人民号',
  40 + // rmhHeadUrl: 'https://uatjdcdnphoto.aikan.pdnews.cn/vod/content/202302/202302Sa121448724/TUw.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg',
  41 + // rmhId: '4255270',
  42 + // rmhName: '长江日报',
  43 + // userId: '513696944662469',
  44 + // userType: '3'
  45 + // },
  46 + // videoInfo: {
  47 + // firstFrameImageUri: '',
  48 + // videoDuration: 12,
  49 + // // videoLandscape: 2,
  50 + // videoUrl: 'https://rmrbcmsonline.peopleapp.com/rb_recsys/video/2024/0413/VL20Z09ISBEKXZU_963672027208609792.mp4'
  51 + // },
  52 + // photoNum: '9',
  53 + // voiceInfo: {
  54 + // voiceDuration: 12
  55 + // }
  56 + } as ContentDTO;
19 57
20 build() { 58 build() {
21 Column() { 59 Column() {
22 -  
23 - Column() {  
24 - //新闻标题 60 + // rmh信息
  61 + RmhTitle({ rmhInfo: this.contentDTO.rmhInfo })
  62 + //新闻标题
  63 + if (this.contentDTO.newsTitle) {
25 Text(this.contentDTO.newsTitle) 64 Text(this.contentDTO.newsTitle)
26 - .fontSize(17)  
27 - .fontColor('#222222')  
28 - .maxLines(3)  
29 - .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。  
30 - .align(Alignment.Start)  
31 - //大图  
32 - Stack() {  
33 - Image(this.contentDTO.coverUrl)  
34 - .borderRadius(4)  
35 -  
36 -  
37 - //播放状态+时长  
38 - Row() {  
39 - Image($r('app.media.icon_live'))  
40 - .width(22)  
41 - .height(18)  
42 -  
43 - Stack() {  
44 - Text('直播中')  
45 - .fontColor('#FFFFFF')  
46 - .fontSize(11)  
47 - }  
48 - .width(44)  
49 - .height(18)  
50 - .backgroundColor('#4d000000')  
51 - }.margin({ right: 8, bottom: 8 })  
52 -  
53 - }  
54 - .width('100%')  
55 - .height(192)  
56 - .alignContent(Alignment.BottomEnd)  
57 - .margin({ top: 8 })  
58 - 65 + .fontSize($r('app.float.font_size_17'))
  66 + .fontColor($r('app.color.color_222222'))
  67 + .width(CommonConstants.FULL_WIDTH)
  68 + .textOverflowStyle(2)
  69 + .margin({ bottom: 8 })
59 } 70 }
60 - .width('100%')  
61 - .justifyContent(FlexAlign.Start)  
62 - .alignItems(HorizontalAlign.Start)  
63 - .padding({ top: 14 })  
64 -  
65 - //bottom  
66 - Row() {  
67 - Text(this.contentDTO.source)  
68 - .bottomTextStyle()  
69 - //间隔点  
70 - Image($r('app.media.point'))  
71 - .width(12)  
72 - .height(12)  
73 -  
74 - Text(this.contentDTO.source)  
75 - .bottomTextStyle()  
76 - Text(' ')  
77 -  
78 - Text(this.contentDTO.subtitle)  
79 - .bottomTextStyle()  
80 - 71 + //大图
  72 + Stack() {
  73 + Image(this.contentDTO.coverUrl)
  74 + .borderRadius($r('app.float.image_border_radius'))
  75 + //播放状态+时长
  76 + CardMediaInfo({
  77 + contentDTO: this.contentDTO
  78 + })
81 } 79 }
82 - .width('100%')  
83 - .height(18)  
84 - .justifyContent(FlexAlign.Start)  
85 - // .padding({bottom:14})  
86 - .margin({ top: 8 }) 80 + .width(CommonConstants.FULL_WIDTH)
  81 + .aspectRatio(16 / 9)
  82 + .alignContent(Alignment.BottomEnd)
  83 +
  84 + //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
87 } 85 }
88 - .width('100%')  
89 - .padding({ left: 16, right: 16 }) 86 + .padding({
  87 + left: $r('app.float.card_comp_pagePadding_lf'),
  88 + right: $r('app.float.card_comp_pagePadding_lf'),
  89 + top: $r('app.float.card_comp_pagePadding_tb'),
  90 + bottom: $r('app.float.card_comp_pagePadding_tb')
  91 + })
90 .onClick((event: ClickEvent) => { 92 .onClick((event: ClickEvent) => {
91 ProcessUtils.processPage(this.contentDTO) 93 ProcessUtils.processPage(this.contentDTO)
92 }) 94 })
93 } 95 }
94 } 96 }
95 97
  98 +
96 @Extend(Text) 99 @Extend(Text)
97 -function bottomTextStyle() {  
98 - .fontSize(12)  
99 - .fontColor('#B0B0B0') 100 +function textOverflowStyle(maxLine: number) {
  101 + .maxLines(maxLine)
  102 + .textOverflow({ overflow: TextOverflow.Ellipsis })
100 } 103 }
1 -import { ArticleListDTO, appStyleImagesDTO } from 'wdBean'; 1 +import { ContentDTO, FullColumnImgUrlDTO } from 'wdBean';
2 import { RmhTitle } from '../cardCommon/RmhTitle' 2 import { RmhTitle } from '../cardCommon/RmhTitle'
3 3
4 const TAG = 'Card19Component'; 4 const TAG = 'Card19Component';
@@ -9,7 +9,66 @@ const TAG = 'Card19Component'; @@ -9,7 +9,66 @@ const TAG = 'Card19Component';
9 @Entry 9 @Entry
10 @Component 10 @Component
11 export struct Card19Component { 11 export struct Card19Component {
12 - @State articleListItem: ArticleListDTO = {} as ArticleListDTO 12 + @State contentDTO: ContentDTO = {
  13 + // appStyle: '19',
  14 + // coverUrl: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994160362418176.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg',
  15 + // fullColumnImgUrls: [
  16 + // {
  17 + // fullUrl: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994160362418176.png?x-oss-process=image/quality,q_90/auto-orient,1',
  18 + // height: 1500,
  19 + // landscape: 1,
  20 + // size: 1,
  21 + // url: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994160362418176.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg',
  22 + // weight: 2000
  23 + // },
  24 + // {
  25 + // fullUrl: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994155727712256.png?x-oss-process=image/quality,q_90/auto-orient,1',
  26 + // height: 1500,
  27 + // landscape: 1,
  28 + // size: 1,
  29 + // url: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994155727712256.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg',
  30 + // weight: 2000
  31 + // },
  32 + // {
  33 + // fullUrl: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994132109586432.png?x-oss-process=image/quality,q_90/auto-orient,1',
  34 + // height: 1280,
  35 + // landscape: 1,
  36 + // size: 1,
  37 + // url: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994132109586432.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg',
  38 + // weight: 1707
  39 + // },
  40 + // {
  41 + // fullUrl: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994132109586432.png?x-oss-process=image/quality,q_90/auto-orient,1',
  42 + // height: 1280,
  43 + // landscape: 1,
  44 + // size: 1,
  45 + // url: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994132109586432.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg',
  46 + // weight: 1707
  47 + // }
  48 + // ],
  49 + // newsSummary: '#平安建设双提升#【进工地,送安全】3月21日下午,@合肥交警 包河大队走进辖区建筑工地为驾驶员、安全员们开展春季交通安全主题宣传活动。活动中,交警结合涉工程运输车、渣土车交通事故案例,详细讲解行驶注意事项,并普及了“一盔一带”“右转必停”等安全常识,要求驾驶员牢固树立交通安全意识,自觉遵守交通法律法规,确保出行安全。',
  50 + // newsTitle: '#平安建设双提升#【进工地,送安全】3月21日下午,@合肥交警 包河大队走进辖区建筑工地为驾驶员、安全员们开展春季交通安全主题宣传活动。活动中,交警结合涉工程运输车、渣土车交通事故案例,详细讲解行驶注意事项,并普及了“一盔一带”“右转必停”等安全常识,要求驾驶员牢固树立交通安全意识,自觉遵守交通法律法规,确保出行安全。',
  51 + // publishTime: '1711185754000',
  52 + // relType: '1',
  53 + // rmhInfo: {
  54 + // authIcon: '',
  55 + // authTitle: '',
  56 + // authTitle2: '',
  57 + // banControl: 0,
  58 + // cnIsAttention: 1,
  59 + // cnIsComment: 1,
  60 + // cnIsLike: 1,
  61 + // cnMainControl: 1,
  62 + // cnShareControl: 1,
  63 + // posterShareControl: 1,
  64 + // rmhDesc: '合肥市公安局官方人民号',
  65 + // rmhHeadUrl: 'https://uatjdcdnphoto.aikan.pdnews.cn/vod/content/202302/202302Sa121448724/TUw.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg',
  66 + // rmhId: '4255290',
  67 + // rmhName: '合肥警方',
  68 + // userId: '513697181730757',
  69 + // userType: '2'
  70 + // }
  71 + } as ContentDTO
13 72
14 aboutToAppear(): void { 73 aboutToAppear(): void {
15 } 74 }
@@ -17,17 +76,17 @@ export struct Card19Component { @@ -17,17 +76,17 @@ export struct Card19Component {
17 build() { 76 build() {
18 Column() { 77 Column() {
19 // rmh信息 78 // rmh信息
20 - // RmhTitle() 79 + RmhTitle({ rmhInfo: this.contentDTO.rmhInfo })
21 // 标题 80 // 标题
22 - if (this.articleListItem.title) {  
23 - Text(this.articleListItem.title) 81 + if (this.contentDTO.newsTitle) {
  82 + Text(this.contentDTO.newsTitle)
24 .fontSize($r('app.float.font_size_17')) 83 .fontSize($r('app.float.font_size_17'))
25 .fontColor($r('app.color.color_222222')) 84 .fontColor($r('app.color.color_222222'))
26 .textOverflowStyle(2) 85 .textOverflowStyle(2)
27 .margin({ bottom: 8 }) 86 .margin({ bottom: 8 })
28 } 87 }
29 // 图片-从无图到9图展示 88 // 图片-从无图到9图展示
30 - createArticleListItem({ appStyleImages: this.articleListItem.appStyleImages }) 89 + createImg({ fullColumnImgUrls: this.contentDTO.fullColumnImgUrls })
31 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 90 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
32 } 91 }
33 .padding({ 92 .padding({
@@ -47,9 +106,15 @@ interface radiusType { @@ -47,9 +106,15 @@ interface radiusType {
47 } 106 }
48 107
49 @Component 108 @Component
50 -struct createArticleListItem {  
51 - @Prop appStyleImages: appStyleImagesDTO[]  
52 - 109 +struct createImg {
  110 + @Prop fullColumnImgUrls: FullColumnImgUrlDTO[]
  111 + aboutToAppear(): void {
  112 + if(this.fullColumnImgUrls.length === 4) { // 为了使用栅格布局以便于占用三分之二的宽度,加一个占位
  113 + this.fullColumnImgUrls.splice(2,0, {
  114 + fullUrl: ''
  115 + } as FullColumnImgUrlDTO)
  116 + }
  117 + }
53 caclImageRadius(index: number) { 118 caclImageRadius(index: number) {
54 let radius: radiusType = { 119 let radius: radiusType = {
55 topLeft: index === 0 ? $r('app.float.image_border_radius') : 0, 120 topLeft: index === 0 ? $r('app.float.image_border_radius') : 0,
@@ -57,14 +122,14 @@ struct createArticleListItem { @@ -57,14 +122,14 @@ struct createArticleListItem {
57 bottomLeft: 0, 122 bottomLeft: 0,
58 bottomRight: 0, 123 bottomRight: 0,
59 } 124 }
60 - if (this.appStyleImages.length === 1) { 125 + if (this.fullColumnImgUrls.length === 1) {
61 radius.topRight = index === 0 ? $r('app.float.image_border_radius') : 0 126 radius.topRight = index === 0 ? $r('app.float.image_border_radius') : 0
62 radius.bottomLeft = index === 0 ? $r('app.float.image_border_radius') : 0 127 radius.bottomLeft = index === 0 ? $r('app.float.image_border_radius') : 0
63 radius.bottomRight = index === 0 ? $r('app.float.image_border_radius') : 0 128 radius.bottomRight = index === 0 ? $r('app.float.image_border_radius') : 0
64 - } else if (this.appStyleImages.length === 4) { 129 + } else if (this.fullColumnImgUrls.length === 5 && !this.fullColumnImgUrls[2].fullUrl) {
65 radius.topRight = index === 1 ? $r('app.float.image_border_radius') : 0 130 radius.topRight = index === 1 ? $r('app.float.image_border_radius') : 0
66 - radius.bottomLeft = index === 2 ? $r('app.float.image_border_radius') : 0  
67 - radius.bottomRight = index === 3 ? $r('app.float.image_border_radius') : 0 131 + radius.bottomLeft = index === 3 ? $r('app.float.image_border_radius') : 0
  132 + radius.bottomRight = index === 4 ? $r('app.float.image_border_radius') : 0
68 } else { 133 } else {
69 radius.topRight = index === 2 ? $r('app.float.image_border_radius') : 0 134 radius.topRight = index === 2 ? $r('app.float.image_border_radius') : 0
70 radius.bottomLeft = index === 6 ? $r('app.float.image_border_radius') : 0 135 radius.bottomLeft = index === 6 ? $r('app.float.image_border_radius') : 0
@@ -77,8 +142,8 @@ struct createArticleListItem { @@ -77,8 +142,8 @@ struct createArticleListItem {
77 GridRow({ 142 GridRow({
78 gutter: { x: 2, y: 2 } 143 gutter: { x: 2, y: 2 }
79 }) { 144 }) {
80 - ForEach(this.appStyleImages, (item: appStyleImagesDTO, index: number) => {  
81 - if (this.appStyleImages.length === 1) { 145 + ForEach(this.fullColumnImgUrls, (item: FullColumnImgUrlDTO, index: number) => {
  146 + if (this.fullColumnImgUrls.length === 1) {
82 GridCol({ 147 GridCol({
83 span: { xs: 8 } 148 span: { xs: 8 }
84 }) { 149 }) {
@@ -86,9 +151,9 @@ struct createArticleListItem { @@ -86,9 +151,9 @@ struct createArticleListItem {
86 .width('100%') 151 .width('100%')
87 .borderRadius(this.caclImageRadius(index)) 152 .borderRadius(this.caclImageRadius(index))
88 } 153 }
89 - } else if (this.appStyleImages.length === 4) { 154 + } else if (this.fullColumnImgUrls.length === 4) {
90 GridCol({ 155 GridCol({
91 - span: { xs: 5 } 156 + span: { xs: 4 }
92 }) { 157 }) {
93 Image(item.fullUrl) 158 Image(item.fullUrl)
94 .aspectRatio(1) 159 .aspectRatio(1)
1 -  
2 -import { ContentDTO } from 'wdBean'; 1 +import { ContentDTO } from 'wdBean';
3 import { RmhTitle } from '../cardCommon/RmhTitle' 2 import { RmhTitle } from '../cardCommon/RmhTitle'
4 import { CardMediaInfo } from '../cardCommon/CardMediaInfo' 3 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
5 import { CommonConstants } from 'wdConstant/Index'; 4 import { CommonConstants } from 'wdConstant/Index';
@@ -38,6 +37,7 @@ export struct Card20Component { @@ -38,6 +37,7 @@ export struct Card20Component {
38 // userId: '522435359667845', 37 // userId: '522435359667845',
39 // userType: '2' 38 // userType: '2'
40 // }, 39 // },
  40 + // objectType: '1',
41 // videoInfo: { 41 // videoInfo: {
42 // firstFrameImageUri: '', 42 // firstFrameImageUri: '',
43 // videoDuration: 37, 43 // videoDuration: 37,
@@ -45,12 +45,13 @@ export struct Card20Component { @@ -45,12 +45,13 @@ export struct Card20Component {
45 // } 45 // }
46 } as ContentDTO; 46 } as ContentDTO;
47 47
48 - aboutToAppear(): void {} 48 + aboutToAppear(): void {
  49 + }
49 50
50 build() { 51 build() {
51 Column() { 52 Column() {
52 // rmh信息 53 // rmh信息
53 - RmhTitle({rmhInfo: this.contentDTO.rmhInfo}) 54 + RmhTitle({ rmhInfo: this.contentDTO.rmhInfo })
54 // 标题 55 // 标题
55 if (this.contentDTO.newsTitle) { 56 if (this.contentDTO.newsTitle) {
56 Text(this.contentDTO.newsTitle) 57 Text(this.contentDTO.newsTitle)
@@ -60,7 +61,7 @@ export struct Card20Component { @@ -60,7 +61,7 @@ export struct Card20Component {
60 .textOverflowStyle(2) 61 .textOverflowStyle(2)
61 .margin({ bottom: 8 }) 62 .margin({ bottom: 8 })
62 } 63 }
63 - if(this.contentDTO.fullColumnImgUrls[0]) { 64 + if (this.contentDTO.fullColumnImgUrls[0]) {
64 createImg({ contentDTO: this.contentDTO }) 65 createImg({ contentDTO: this.contentDTO })
65 } 66 }
66 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 67 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
@@ -95,11 +96,9 @@ struct createImg { @@ -95,11 +96,9 @@ struct createImg {
95 Stack() { 96 Stack() {
96 Image(this.contentDTO.coverUrl) 97 Image(this.contentDTO.coverUrl)
97 .width(CommonConstants.FULL_WIDTH) 98 .width(CommonConstants.FULL_WIDTH)
98 - .aspectRatio(16/9) 99 + .aspectRatio(16 / 9)
99 .borderRadius($r('app.float.image_border_radius')) 100 .borderRadius($r('app.float.image_border_radius'))
100 - CardMediaInfo({  
101 - duration: this.contentDTO.videoInfo.videoDuration, mediaType: 'video'  
102 - }) 101 + CardMediaInfo({ contentDTO: this.contentDTO })
103 } 102 }
104 .align(Alignment.BottomEnd) 103 .align(Alignment.BottomEnd)
105 } 104 }
@@ -112,9 +111,7 @@ struct createImg { @@ -112,9 +111,7 @@ struct createImg {
112 Image(this.contentDTO.coverUrl) 111 Image(this.contentDTO.coverUrl)
113 .width(CommonConstants.FULL_WIDTH) 112 .width(CommonConstants.FULL_WIDTH)
114 .borderRadius($r('app.float.image_border_radius')) 113 .borderRadius($r('app.float.image_border_radius'))
115 - CardMediaInfo({  
116 - duration: this.contentDTO.videoInfo.videoDuration, mediaType: 'video'  
117 - }) 114 + CardMediaInfo({ contentDTO: this.contentDTO })
118 } 115 }
119 .align(Alignment.BottomEnd) 116 .align(Alignment.BottomEnd)
120 } 117 }
1 import { CommonConstants, ViewType } from 'wdConstant'; 1 import { CommonConstants, ViewType } from 'wdConstant';
2 -import { Logger, DateTimeUtils } from 'wdKit'; 2 +import { DateTimeUtils, Logger } from 'wdKit';
3 import PageViewModel from '../../viewmodel/PageViewModel'; 3 import PageViewModel from '../../viewmodel/PageViewModel';
4 import { EmptyComponent } from '../view/EmptyComponent'; 4 import { EmptyComponent } from '../view/EmptyComponent';
5 import { ErrorComponent } from '../view/ErrorComponent'; 5 import { ErrorComponent } from '../view/ErrorComponent';
@@ -11,8 +11,8 @@ import NoMoreLayout from './NoMoreLayout'; @@ -11,8 +11,8 @@ import NoMoreLayout from './NoMoreLayout';
11 import LoadMoreLayout from './LoadMoreLayout'; 11 import LoadMoreLayout from './LoadMoreLayout';
12 import CustomRefreshLoadLayout from './CustomRefreshLoadLayout'; 12 import CustomRefreshLoadLayout from './CustomRefreshLoadLayout';
13 import { CompParser } from '../CompParser'; 13 import { CompParser } from '../CompParser';
14 -import { CompDTO } from 'wdBean';  
15 import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index'; 14 import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index';
  15 +import { CompDTO, LiveReviewDTO } from 'wdBean';
16 16
17 const TAG = 'PageComponent'; 17 const TAG = 'PageComponent';
18 18
@@ -22,6 +22,14 @@ export struct PageComponent { @@ -22,6 +22,14 @@ export struct PageComponent {
22 navIndex: number = 0; 22 navIndex: number = 0;
23 pageId: string = ""; 23 pageId: string = "";
24 channelId: string = ""; 24 channelId: string = "";
  25 + pageNum: number = 1;
  26 + liveReviewDTO: LiveReviewDTO = {
  27 + hasNext: false,
  28 + pageNum: 0,
  29 + pageSize: 0,
  30 + totalCount: 0,
  31 + list: []
  32 + };
25 name: string = ""; 33 name: string = "";
26 @Link @Watch('onChange') currentTopNavSelectedIndex: number 34 @Link @Watch('onChange') currentTopNavSelectedIndex: number
27 35
@@ -109,9 +117,12 @@ export struct PageComponent { @@ -109,9 +117,12 @@ export struct PageComponent {
109 117
110 async aboutToAppear() { 118 async aboutToAppear() {
111 // 选中tab,才请求数据。拦截大量接口请求 119 // 选中tab,才请求数据。拦截大量接口请求
112 - if (this.navIndex === this.currentTopNavSelectedIndex) { 120 + if (this.navIndex === 0 && this.navIndex === this.currentTopNavSelectedIndex) {
113 this.getData(); 121 this.getData();
  122 + } else if (this.navIndex === 1) {
  123 + this.getPreviewData()
114 } 124 }
  125 +
115 } 126 }
116 127
117 onChange() { 128 onChange() {
@@ -149,6 +160,13 @@ export struct PageComponent { @@ -149,6 +160,13 @@ export struct PageComponent {
149 Logger.debug(TAG, 'aboutToAppear, data response page ' + this.pageId + ', comp list is empty.'); 160 Logger.debug(TAG, 'aboutToAppear, data response page ' + this.pageId + ', comp list is empty.');
150 this.pageModel.viewType = ViewType.EMPTY; 161 this.pageModel.viewType = ViewType.EMPTY;
151 } 162 }
  163 +
  164 + }
  165 +
  166 + async getPreviewData() {
  167 + this.liveReviewDTO = await PageViewModel.getLiveReviewUrl(this.pageNum, this.pageModel.pageSize)
  168 + Logger.debug(TAG, 'aboutToAppear, getPreviewData ' + this.liveReviewDTO.hasNext);
  169 + this.getData();
152 } 170 }
153 } 171 }
154 172
@@ -5,8 +5,10 @@ import { @@ -5,8 +5,10 @@ import {
5 batchLikeAndCollectResult, 5 batchLikeAndCollectResult,
6 CompInfoBean, 6 CompInfoBean,
7 ContentDetailDTO, 7 ContentDetailDTO,
  8 + ContentDTO,
8 contentListParams, 9 contentListParams,
9 InteractDataDTO, 10 InteractDataDTO,
  11 + LiveReviewDTO,
10 MorningEveningPaperDTO, 12 MorningEveningPaperDTO,
11 NavigationBodyDTO, 13 NavigationBodyDTO,
12 NewspaperListBean, 14 NewspaperListBean,
@@ -18,8 +20,7 @@ import { @@ -18,8 +20,7 @@ import {
18 postExecuteCollectRecordParams, 20 postExecuteCollectRecordParams,
19 postExecuteLikeParams, 21 postExecuteLikeParams,
20 postInteractAccentionOperateParams, 22 postInteractAccentionOperateParams,
21 - postRecommendListParams,  
22 - ContentDTO 23 + postRecommendListParams
23 } from 'wdBean'; 24 } from 'wdBean';
24 25
25 const TAG = 'HttpRequest'; 26 const TAG = 'HttpRequest';
@@ -146,9 +147,9 @@ export class PageRepository { @@ -146,9 +147,9 @@ export class PageRepository {
146 return url; 147 return url;
147 } 148 }
148 149
149 - static getLivePreviewUrl() {  
150 - let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_REVIEW_PATH;  
151 - Logger.info(TAG, "getLivePreviewUrl url = " + url) 150 + static getLiveReviewUrl(pageNum: number = 1, pageSize: number = 20) {
  151 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_REVIEW_PATH + "?pageNum=" + pageNum + "&pageSize=" + pageSize;
  152 + Logger.info(TAG, "getLiveReviewUrl url = " + url)
152 return url; 153 return url;
153 } 154 }
154 155
@@ -322,10 +323,10 @@ export class PageRepository { @@ -322,10 +323,10 @@ export class PageRepository {
322 /** 323 /**
323 * 获取直播回顾双卡位数据 324 * 获取直播回顾双卡位数据
324 * */ 325 * */
325 - static fetchLivePreviewUrl() {  
326 - let url = PageRepository.getLivePreviewUrl() 326 + static fetchLiveReviewUrl(pageNum: number, pageSize: number) {
  327 + let url = PageRepository.getLiveReviewUrl(pageNum, pageSize)
327 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 328 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
328 - return WDHttp.get<ResponseDTO<PageInfoBean>>(url, headers) 329 + return WDHttp.get<ResponseDTO<LiveReviewDTO>>(url, headers)
329 }; 330 };
330 331
331 /** 332 /**
@@ -334,7 +335,7 @@ export class PageRepository { @@ -334,7 +335,7 @@ export class PageRepository {
334 * @param params 335 * @param params
335 * @returns 336 * @returns
336 * */ 337 * */
337 - static postRecommendList(params:postRecommendListParams){ 338 + static postRecommendList(params: postRecommendListParams) {
338 let url = HttpUrlUtils.getHost() + HttpUrlUtils.RECOMMEND_LIST 339 let url = HttpUrlUtils.getHost() + HttpUrlUtils.RECOMMEND_LIST
339 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 340 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
340 Logger.info(TAG, "postRecommendList url = " + url + JSON.stringify(params)) 341 Logger.info(TAG, "postRecommendList url = " + url + JSON.stringify(params))
@@ -3,11 +3,12 @@ import { @@ -3,11 +3,12 @@ import {
3 ContentBean, 3 ContentBean,
4 InteractDataDTO, 4 InteractDataDTO,
5 InteractParam, 5 InteractParam,
  6 + LiveReviewDTO,
6 MorningEveningPaperDTO, 7 MorningEveningPaperDTO,
7 NavigationBodyDTO, 8 NavigationBodyDTO,
8 - PageDTO,  
9 - PageInfoBean 9 + PageDTO
10 } from 'wdBean'; 10 } from 'wdBean';
  11 +
11 import { CollectionUtils, Logger, ResourcesUtils, StringUtils } from 'wdKit'; 12 import { CollectionUtils, Logger, ResourcesUtils, StringUtils } from 'wdKit';
12 import { ResponseDTO, } from 'wdNetwork'; 13 import { ResponseDTO, } from 'wdNetwork';
13 import { PageRepository } from '../repository/PageRepository'; 14 import { PageRepository } from '../repository/PageRepository';
@@ -285,10 +286,10 @@ export class PageViewModel extends BaseViewModel { @@ -285,10 +286,10 @@ export class PageViewModel extends BaseViewModel {
285 return param; 286 return param;
286 } 287 }
287 288
288 - async getLivePreviewUrl(): Promise<PageInfoBean> {  
289 - return new Promise<PageInfoBean>((success, error) => { 289 + async getLiveReviewUrl(pageNum: number, pageSize: number): Promise<LiveReviewDTO> {
  290 + return new Promise<LiveReviewDTO>((success, error) => {
290 Logger.info(TAG, `getLivePreviewUrl pageInfo start`); 291 Logger.info(TAG, `getLivePreviewUrl pageInfo start`);
291 - PageRepository.fetchLivePreviewUrl().then((resDTO: ResponseDTO<PageInfoBean>) => { 292 + PageRepository.fetchLiveReviewUrl(pageNum, pageSize).then((resDTO: ResponseDTO<LiveReviewDTO>) => {
292 if (!resDTO || !resDTO.data) { 293 if (!resDTO || !resDTO.data) {
293 Logger.error(TAG, 'getLivePreviewUrl then navResDTO is empty'); 294 Logger.error(TAG, 'getLivePreviewUrl then navResDTO is empty');
294 error('resDTO is empty'); 295 error('resDTO is empty');