wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  长图提示png图片
  视频频道入口修改与接口调用
  卡片样式更新
  人民号三图卡,动态横长图和竖长图
  contentDTO新增isSearch自定义字段,区分搜索和主页数据
  desc:搜索结果展示
  关于页面整改
  卡片样式优化
  卡片样式优化
Showing 39 changed files with 1080 additions and 189 deletions
@@ -11,8 +11,8 @@ export class SpConstants{ @@ -11,8 +11,8 @@ export class SpConstants{
11 static USER_TEMP_TOKEN="tempToken" 11 static USER_TEMP_TOKEN="tempToken"
12 static USER_PHONE = "user_phone" 12 static USER_PHONE = "user_phone"
13 //协议相关 13 //协议相关
14 - static USER_PROTOCOL = "user_protocol" //用户协议  
15 - static PRIVATE_PROTOCOL = "private_protocol" //隐私协议 14 + static NET_SERVICE_PROTOCOL = "user_protocol" //人民日报客户端网络服务使用协议
  15 + static PRIVATE_PROTOCOL = "private_protocol" //人民日报客户端用户隐私协议
16 static LOGOUT_PROTOCOL = "logout_protocol" //人民日报客户端app注销协议 16 static LOGOUT_PROTOCOL = "logout_protocol" //人民日报客户端app注销协议
17 static MESSAGE_BOARD_USER_PROTOCOL = "message_board_user_protocol" //"留言板-用户协议" 17 static MESSAGE_BOARD_USER_PROTOCOL = "message_board_user_protocol" //"留言板-用户协议"
18 static MESSAGE_BOARD_NOTICE_PROTOCOL = "message_board_notice_protocol" //留言板-留言须知 18 static MESSAGE_BOARD_NOTICE_PROTOCOL = "message_board_notice_protocol" //留言板-留言须知
1 import window from '@ohos.window'; 1 import window from '@ohos.window';
2 -import { BusinessError } from '@ohos.base'; 2 +import { AsyncCallback, BusinessError } from '@ohos.base';
3 import deviceInfo from '@ohos.deviceInfo' 3 import deviceInfo from '@ohos.deviceInfo'
4 import display from '@ohos.display'; 4 import display from '@ohos.display';
5 5
  6 +
  7 +interface SystemBarProperties {
  8 + statusBarColor?: string;
  9 + isStatusBarLightIcon?: boolean;
  10 + statusBarContentColor?: string;
  11 + navigationBarColor?: string;
  12 + isNavigationBarLightIcon?: boolean;
  13 + navigationBarContentColor?: string;
  14 +}
  15 +
6 export class Size { 16 export class Size {
7 width: number = 0 17 width: number = 0
8 height: number = 0 18 height: number = 0
@@ -15,17 +25,23 @@ export class Size { @@ -15,17 +25,23 @@ export class Size {
15 25
16 export class WindowModel { 26 export class WindowModel {
17 private windowStage?: window.WindowStage; 27 private windowStage?: window.WindowStage;
  28 + private windowClass?: window.Window;
18 static shared: WindowModel = new WindowModel() 29 static shared: WindowModel = new WindowModel()
19 static TAG = "WindowModel"; 30 static TAG = "WindowModel";
20 31
21 setWindowStage(windowStage: window.WindowStage) { 32 setWindowStage(windowStage: window.WindowStage) {
22 this.windowStage = windowStage; 33 this.windowStage = windowStage;
  34 + this.windowClass = windowStage.getMainWindowSync();
23 } 35 }
24 36
25 getWindowStage(): window.WindowStage { 37 getWindowStage(): window.WindowStage {
26 return this.windowStage as window.WindowStage 38 return this.windowStage as window.WindowStage
27 } 39 }
28 40
  41 + getWindowClass(): window.Window {
  42 + return this.windowClass as window.Window
  43 + }
  44 +
29 setMainWindowFullScreen(fullScreen: boolean) { 45 setMainWindowFullScreen(fullScreen: boolean) {
30 if (deviceInfo.deviceType != "phone") { 46 if (deviceInfo.deviceType != "phone") {
31 return 47 return
@@ -103,5 +119,17 @@ export class WindowModel { @@ -103,5 +119,17 @@ export class WindowModel {
103 }); 119 });
104 }) 120 })
105 } 121 }
  122 +
  123 + /**
  124 + * 设置窗口全屏模式时窗口内导航栏、状态栏的属性,使用callback异步回调。
  125 + * @param systemBarProperties
  126 + * @param callback
  127 + */
  128 + setWindowSystemBarProperties(systemBarProperties: SystemBarProperties, callback?: AsyncCallback<void>): void {
  129 + this.windowClass?.setWindowSystemBarProperties(systemBarProperties, (err: BusinessError) => {
  130 + callback && callback(err)
  131 + })
  132 +
  133 + }
106 } 134 }
107 135
@@ -46,6 +46,10 @@ export class HttpUrlUtils { @@ -46,6 +46,10 @@ export class HttpUrlUtils {
46 * 批查接口,查询互动相关数据,如收藏数、评论数等 46 * 批查接口,查询互动相关数据,如收藏数、评论数等
47 */ 47 */
48 static readonly INTERACT_DATA_PATH: string = "/api/rmrb-contact/contact/zh/c/content/interactData"; 48 static readonly INTERACT_DATA_PATH: string = "/api/rmrb-contact/contact/zh/c/content/interactData";
  49 + /**
  50 + * 查询视频频道推荐楼层
  51 + */
  52 + static readonly DISPLAY_REC_COMPINFO: string = "/api/rmrb-bff-display-zh/display/zh/c/rec/compInfo";
49 // 多图(图集)详情页 53 // 多图(图集)详情页
50 /** 54 /**
51 * 批量查询内容当前用户点赞、收藏状态 55 * 批量查询内容当前用户点赞、收藏状态
@@ -196,7 +200,6 @@ export class HttpUrlUtils { @@ -196,7 +200,6 @@ export class HttpUrlUtils {
196 * 搜索联想词 200 * 搜索联想词
197 */ 201 */
198 static readonly RELATED_SEARCH_CONTENT_DATA_PATH: string = "/api/rmrb-search-api/zh/c/suggestions/"; 202 static readonly RELATED_SEARCH_CONTENT_DATA_PATH: string = "/api/rmrb-search-api/zh/c/suggestions/";
199 -  
200 /** 203 /**
201 * 直播详情 204 * 直播详情
202 */ 205 */
@@ -205,7 +208,6 @@ export class HttpUrlUtils { @@ -205,7 +208,6 @@ export class HttpUrlUtils {
205 * 直播详情-直播间列表 208 * 直播详情-直播间列表
206 */ 209 */
207 static readonly LIVE_LIST_PATH: string = "/api/live-center-message/zh/a/live/message/video/list"; 210 static readonly LIVE_LIST_PATH: string = "/api/live-center-message/zh/a/live/message/video/list";
208 -  
209 /** 211 /**
210 * 直播详情-大家聊列表 212 * 直播详情-大家聊列表
211 */ 213 */
@@ -215,7 +217,6 @@ export class HttpUrlUtils { @@ -215,7 +217,6 @@ export class HttpUrlUtils {
215 * 搜索结果 显示tab 数 217 * 搜索结果 显示tab 数
216 */ 218 */
217 static readonly SEARCH_RESULT_COUNT_DATA_PATH: string = "/api/rmrb-search-api/zh/c/count?keyword="; 219 static readonly SEARCH_RESULT_COUNT_DATA_PATH: string = "/api/rmrb-search-api/zh/c/count?keyword=";
218 -  
219 /** 220 /**
220 * 搜索结果 显示list 详情 221 * 搜索结果 显示list 详情
221 */ 222 */
@@ -662,6 +663,11 @@ export class HttpUrlUtils { @@ -662,6 +663,11 @@ export class HttpUrlUtils {
662 return url 663 return url
663 } 664 }
664 665
  666 + static getInteractListDataUrl() {
  667 + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.INTERACT_DATA_PATH
  668 + return url
  669 + }
  670 +
665 // static getYcgCommonHeaders(): HashMap<string, string> { 671 // static getYcgCommonHeaders(): HashMap<string, string> {
666 // let headers: HashMap<string, string> = new HashMap<string, string>() 672 // let headers: HashMap<string, string> = new HashMap<string, string>()
667 // 673 //
@@ -71,6 +71,6 @@ export interface ContentDTO { @@ -71,6 +71,6 @@ export interface ContentDTO {
71 photoNum: number; 71 photoNum: number;
72 corner: string; 72 corner: string;
73 rmhPlatform: number; 73 rmhPlatform: number;
74 - newTags: string  
75 - 74 + newTags: string;
  75 + isSearch?: boolean; // 是否是搜索的结果,区分搜索和主页的数据
76 } 76 }
@@ -10,56 +10,60 @@ import { DateTimeUtils } from 'wdKit/Index' @@ -10,56 +10,60 @@ import { DateTimeUtils } from 'wdKit/Index'
10 @Component 10 @Component
11 export struct CardMediaInfo { 11 export struct CardMediaInfo {
12 @State contentDTO: ContentDTO = {} as ContentDTO // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中 12 @State contentDTO: ContentDTO = {} as ContentDTO // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中
  13 +
13 // objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频, 14 // objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,
14 // 14动态图文,15动态视频16问政;100人民号,101标签 15 // 14动态图文,15动态视频16问政;100人民号,101标签
15 16
16 build() { 17 build() {
17 Row() { 18 Row() {
18 - if(this.contentDTO.objectType === '1' || this.contentDTO.objectType === '15' ) { 19 + if (this.contentDTO.objectType === '1' || this.contentDTO.objectType === '15') {
19 // 点播、动态视频 20 // 点播、动态视频
20 - Row(){  
21 - Image($r('app.media.videoTypeIcon')) 21 + Row() {
  22 + Image($r('app.media.card_play'))
22 .mediaLogo() 23 .mediaLogo()
23 Text(DateTimeUtils.getFormattedDuration(this.contentDTO.videoInfo.videoDuration * 1000)) 24 Text(DateTimeUtils.getFormattedDuration(this.contentDTO.videoInfo.videoDuration * 1000))
24 .mediaText() 25 .mediaText()
25 } 26 }
26 - .backgroundColor('#4d000000')  
27 - .borderRadius($r('app.float.button_border_radius'))  
28 - } else if(this.contentDTO.objectType === '2') { 27 + } else if (this.contentDTO.objectType === '2') {
29 // liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 28 // liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
30 // 显示直播信息 29 // 显示直播信息
31 - Row(){  
32 - if(this.contentDTO.liveInfo.liveState === 'running') {  
33 - Image($r('app.media.icon_live')) 30 + Row() {
  31 + if(this.contentDTO.liveInfo.liveState === 'wait') {
  32 + Image($r('app.media.card_wait'))
  33 + .mediaLogo()
  34 + Text('预约')
  35 + .mediaText()
  36 + } else if (this.contentDTO.liveInfo.liveState === 'running') {
  37 + Image($r('app.media.card_live'))
34 .mediaLogo() 38 .mediaLogo()
35 Text('直播中') 39 Text('直播中')
36 .mediaText() 40 .mediaText()
37 - } else if(this.contentDTO.liveInfo.liveState === 'end'){  
38 - Image($r('app.media.videoTypeIcon')) 41 + } else if (this.contentDTO.liveInfo.liveState === 'end' && this.contentDTO.liveInfo.replayUri) {
  42 + Image($r('app.media.card_play'))
39 .mediaLogo() 43 .mediaLogo()
40 Text('回看') 44 Text('回看')
41 .mediaText() 45 .mediaText()
  46 + } else if(this.contentDTO.liveInfo.liveState === 'end' && this.contentDTO.liveInfo
  47 + .replayUri) {
  48 + // Image($r('app.media.card_live'))
  49 + // .mediaLogo()
  50 + Text('直播结束')
  51 + .mediaText()
42 } 52 }
43 } 53 }
44 - .backgroundColor('#4d000000')  
45 - .borderRadius($r('app.float.button_border_radius'))  
46 - } else if(this.contentDTO.objectType === '9') { 54 + } else if (this.contentDTO.objectType === '9') {
47 // 显示组图;图片数量 55 // 显示组图;图片数量
48 - Row(){  
49 - Image($r('app.media.album_card_shape')) 56 + Row() {
  57 + Image($r('app.media.card_image'))
50 .mediaLogo() 58 .mediaLogo()
51 Text(`${this.contentDTO.photoNum}`) 59 Text(`${this.contentDTO.photoNum}`)
52 .mediaText() 60 .mediaText()
53 - .width(20)  
54 } 61 }
55 - .backgroundColor('#4d000000')  
56 - .borderRadius($r('app.float.button_border_radius'))  
57 - } else if(this.contentDTO.objectType === '13') { 62 + } else if (this.contentDTO.objectType === '13') {
58 // 显示音频信息 63 // 显示音频信息
59 - Row(){  
60 - Image($r('app.media.broadcast_listen'))  
61 - .height(14)  
62 - .borderRadius($r('app.float.button_border_radius')) 64 + Row() {
  65 + Image($r('app.media.card_audio'))
  66 + .mediaLogo()
63 Text(DateTimeUtils.getFormattedDuration(this.contentDTO.voiceInfo.voiceDuration * 1000)) 67 Text(DateTimeUtils.getFormattedDuration(this.contentDTO.voiceInfo.voiceDuration * 1000))
64 .mediaText() 68 .mediaText()
65 } 69 }
@@ -68,18 +72,27 @@ export struct CardMediaInfo { @@ -68,18 +72,27 @@ export struct CardMediaInfo {
68 .margin(6) 72 .margin(6)
69 } 73 }
70 74
71 - @Styles mediaLogo() {  
72 - .width(22)  
73 - .height(18)  
74 - .borderRadius($r('app.float.button_border_radius')) 75 + @Styles
  76 + mediaLogo() {
  77 + .width(14)
  78 + .height(14)
  79 + .margin({ right: 3 })
  80 + .shadow({
  81 + radius: 2,
  82 + color: 'rgba(0,0,0,0.3)',
  83 + offsetY: 2
  84 + })
75 } 85 }
76 } 86 }
77 87
78 -@Extend(Text) function mediaText() { 88 +@Extend(Text)
  89 +function mediaText() {
79 .fontColor($r('app.color.color_fff')) 90 .fontColor($r('app.color.color_fff'))
80 - .fontSize($r('app.float.font_size_12'))  
81 - .width(40)  
82 - .height(18)  
83 - .textAlign(TextAlign.Center)  
84 - .margin({ left: -3 }) 91 + .fontSize($r('app.float.font_size_14'))
  92 + .lineHeight(18)
  93 + .textShadow({
  94 + radius: 2,
  95 + color: 'rgba(0,0,0,0.3)',
  96 + offsetY: 2
  97 + })
85 } 98 }
@@ -28,16 +28,23 @@ export struct CardSourceInfo { @@ -28,16 +28,23 @@ export struct CardSourceInfo {
28 .fontColor($r("app.color.color_B0B0B0")) 28 .fontColor($r("app.color.color_B0B0B0"))
29 .maxLines(1) 29 .maxLines(1)
30 .textOverflow({overflow: TextOverflow.Ellipsis}) 30 .textOverflow({overflow: TextOverflow.Ellipsis})
  31 + }
  32 + // 新闻tab下的卡片,2天之前的不显示时间。但是如果是搜索情况下展示的卡片,显示时间
  33 + if(this.contentDTO.isSearch || !this.contentDTO.isSearch && DateTimeUtils.getCommentTime
  34 + (Number
  35 + .parseFloat(this
  36 + .contentDTO.publishTime))
  37 + .indexOf
  38 + ('-') === -1) {
31 Image($r("app.media.point")) 39 Image($r("app.media.point"))
32 .width(16) 40 .width(16)
33 .height(16) 41 .height(16)
34 - }  
35 - // TODO 这里还有个判断需要完善,依赖外部,新闻tab下的卡片,2天之前的不显示时间。但是如果是搜索情况下展示的卡片,显示时间  
36 Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) 42 Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)))
37 .fontSize($r("app.float.font_size_12")) 43 .fontSize($r("app.float.font_size_12"))
38 .fontColor($r("app.color.color_B0B0B0")) 44 .fontColor($r("app.color.color_B0B0B0"))
39 .margin({ right: 6 }) 45 .margin({ right: 6 })
40 .flexShrink(0) 46 .flexShrink(0)
  47 + }
41 if(this.contentDTO?.interactData?.commentNum) { 48 if(this.contentDTO?.interactData?.commentNum) {
42 Text(`${this.contentDTO.interactData.commentNum}评`) 49 Text(`${this.contentDTO.interactData.commentNum}评`)
43 .fontSize($r("app.float.font_size_12")) 50 .fontSize($r("app.float.font_size_12"))
@@ -3,46 +3,45 @@ import { RmhTitle } from '../cardCommon/RmhTitle' @@ -3,46 +3,45 @@ import { RmhTitle } from '../cardCommon/RmhTitle'
3 import { CardMediaInfo } from '../cardCommon/CardMediaInfo' 3 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
4 import { CommonConstants } from 'wdConstant/Index'; 4 import { CommonConstants } from 'wdConstant/Index';
5 5
6 -const TAG = 'Card12Component'; 6 +const TAG = 'Card14Component';
7 7
8 /** 8 /**
9 - * 人民号-动态---12:人民号无图卡; 9 + * 人民号-动态---14:人民号单图卡;
10 */ 10 */
11 -@Entry  
12 @Component 11 @Component
13 -export struct Card12Component { 12 +export struct Card14Component {
14 @State contentDTO: ContentDTO = { 13 @State contentDTO: ContentDTO = {
15 - appStyle: '20',  
16 - coverType: 1,  
17 - coverUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90',  
18 - fullColumnImgUrls: [  
19 - {  
20 - landscape: 1,  
21 - size: 1,  
22 - url: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90',  
23 - weight: 1600  
24 - }  
25 - ],  
26 - newsTitle: '好玩!》10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人',  
27 - rmhInfo: {  
28 - authIcon:  
29 - 'https://cdnjdphoto.aikan.pdnews.cn/creator-category/icon/auth/yellow.png',  
30 - authTitle: '10后音乐人王烁然个人人民号',  
31 - authTitle2: '10后音乐人王烁然个人人民号',  
32 - banControl: 0,  
33 - cnIsAttention: 1,  
34 - rmhDesc: '10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人',  
35 - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn/image/creator/rmh/20221031/3d3419e86a.jpeg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg',  
36 - rmhName: '王烁然',  
37 - userId: '522435359667845',  
38 - userType: '2'  
39 - },  
40 - objectType: '1',  
41 - videoInfo: {  
42 - firstFrameImageUri: '',  
43 - videoDuration: 37,  
44 - videoUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/mp4/202105/rmrb_GSNARt6P1622451310.mp4'  
45 - } 14 + // appStyle: '20',
  15 + // coverType: 1,
  16 + // coverUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90',
  17 + // fullColumnImgUrls: [
  18 + // {
  19 + // landscape: 1,
  20 + // size: 1,
  21 + // url: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90',
  22 + // weight: 1600
  23 + // }
  24 + // ],
  25 + // newsTitle: '好玩!》10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人',
  26 + // rmhInfo: {
  27 + // authIcon:
  28 + // 'https://cdnjdphoto.aikan.pdnews.cn/creator-category/icon/auth/yellow.png',
  29 + // authTitle: '10后音乐人王烁然个人人民号',
  30 + // authTitle2: '10后音乐人王烁然个人人民号',
  31 + // banControl: 0,
  32 + // cnIsAttention: 1,
  33 + // rmhDesc: '10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人',
  34 + // rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn/image/creator/rmh/20221031/3d3419e86a.jpeg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg',
  35 + // rmhName: '王烁然',
  36 + // userId: '522435359667845',
  37 + // userType: '2'
  38 + // },
  39 + // objectType: '1',
  40 + // videoInfo: {
  41 + // firstFrameImageUri: '',
  42 + // videoDuration: 37,
  43 + // videoUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/mp4/202105/rmrb_GSNARt6P1622451310.mp4'
  44 + // }
46 } as ContentDTO; 45 } as ContentDTO;
47 46
48 aboutToAppear(): void { 47 aboutToAppear(): void {
  1 +import { ContentDTO } from 'wdBean';
  2 +import { RmhTitle } from '../cardCommon/RmhTitle'
  3 +import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
  4 +import { CommonConstants } from 'wdConstant/Index';
  5 +
  6 +const TAG = 'Card16Component';
  7 +
  8 +/**
  9 + * 人民号-动态---16:人民号三图卡;
  10 + */
  11 +@Component
  12 +export struct Card16Component {
  13 + @State contentDTO: ContentDTO = {
  14 + appStyle: '20',
  15 + coverType: 1,
  16 + coverUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90;https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90;https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90',
  17 + fullColumnImgUrls: [
  18 + {
  19 + landscape: 1,
  20 + size: 1,
  21 + url: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90',
  22 + weight: 1600
  23 + }
  24 + ],
  25 + newsTitle: '好玩!》10后音乐人王烁然个人人民号10后音乐人王烁然个人人民号10后音乐人王烁然个人人民号10后音乐人王烁然个人人民号10后音乐人王烁然个人人民号10后音乐人王烁然个人人民号',
  26 + rmhInfo: {
  27 + authIcon:
  28 + 'https://cdnjdphoto.aikan.pdnews.cn/creator-category/icon/auth/yellow.png',
  29 + authTitle: '10后音乐人王烁然个人人民号',
  30 + authTitle2: '10后音乐人王烁然个人人民号',
  31 + banControl: 0,
  32 + cnIsAttention: 1,
  33 + rmhDesc: '10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人',
  34 + rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn/image/creator/rmh/20221031/3d3419e86a.jpeg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg',
  35 + rmhName: '王烁然',
  36 + userId: '522435359667845',
  37 + userType: '2'
  38 + },
  39 + objectType: '1',
  40 + videoInfo: {
  41 + firstFrameImageUri: '',
  42 + videoDuration: 37,
  43 + videoUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/mp4/202105/rmrb_GSNARt6P1622451310.mp4'
  44 + }
  45 + } as ContentDTO;
  46 +
  47 + aboutToAppear(): void {
  48 + }
  49 +
  50 + build() {
  51 + Column() {
  52 + // rmh信息
  53 + RmhTitle({ rmhInfo: this.contentDTO.rmhInfo })
  54 + // 标题
  55 + if (this.contentDTO.newsTitle) {
  56 + Text(this.contentDTO.newsTitle)
  57 + .fontSize($r('app.float.font_size_17'))
  58 + .fontColor($r('app.color.color_222222'))
  59 + .width(CommonConstants.FULL_WIDTH)
  60 + .textOverflowStyle(2)
  61 + .margin({ bottom: 8 })
  62 + .lineHeight(25)
  63 + }
  64 + if (this.contentDTO.coverUrl) {
  65 + Flex() {
  66 + ForEach(this.contentDTO.coverUrl?.split(';'), (item: string) => {
  67 + Image(item).flexBasis(113).height(75).margin({right: 2})
  68 + })
  69 + }
  70 + }
  71 + //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
  72 + }
  73 + .padding({
  74 + left: $r('app.float.card_comp_pagePadding_lf'),
  75 + right: $r('app.float.card_comp_pagePadding_lf'),
  76 + top: $r('app.float.card_comp_pagePadding_tb'),
  77 + bottom: $r('app.float.card_comp_pagePadding_tb')
  78 + })
  79 + }
  80 +}
  81 +
  82 +interface radiusType {
  83 + topLeft: number | Resource;
  84 + topRight: number | Resource;
  85 + bottomLeft: number | Resource;
  86 + bottomRight: number | Resource;
  87 +}
  88 +
  89 +@Component
  90 +struct createImg {
  91 + @Prop contentDTO: ContentDTO
  92 +
  93 + build() {
  94 + GridRow() {
  95 + if (this.contentDTO.fullColumnImgUrls[0].landscape === 1) {
  96 + // 横屏
  97 + GridCol({
  98 + span: { xs: 12 }
  99 + }) {
  100 + Stack() {
  101 + Image(this.contentDTO.coverUrl)
  102 + .width(CommonConstants.FULL_WIDTH)
  103 + .aspectRatio(16 / 9)
  104 + .borderRadius($r('app.float.image_border_radius'))
  105 + CardMediaInfo({ contentDTO: this.contentDTO })
  106 + }
  107 + .align(Alignment.BottomEnd)
  108 + }
  109 + } else {
  110 + // 竖图显示,宽度占50%,高度自适应
  111 + GridCol({
  112 + span: { xs: 6 }
  113 + }) {
  114 + Stack() {
  115 + Image(this.contentDTO.coverUrl)
  116 + .width(CommonConstants.FULL_WIDTH)
  117 + .borderRadius($r('app.float.image_border_radius'))
  118 + CardMediaInfo({ contentDTO: this.contentDTO })
  119 + }
  120 + .align(Alignment.BottomEnd)
  121 + }
  122 + }
  123 + }
  124 + }
  125 +}
  126 +
  127 +
  128 +@Extend(Text)
  129 +function textOverflowStyle(maxLine: number) {
  130 + .maxLines(maxLine)
  131 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  132 +}
@@ -13,7 +13,7 @@ export struct Card19Component { @@ -13,7 +13,7 @@ export struct Card19Component {
13 // coverUrl: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994160362418176.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg', 13 // coverUrl: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994160362418176.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg',
14 // fullColumnImgUrls: [ 14 // fullColumnImgUrls: [
15 // { 15 // {
16 - // fullUrl: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994160362418176.png?x-oss-process=image/quality,q_90/auto-orient,1', 16 + // fullUrl: 'https://rmrbcmsonline.peopleapp.com/upload/ueditor/image/20240323/a_955994155727712256.png?x-oss-process=image/quality,q_90/auto-orient,1',
17 // height: 1500, 17 // height: 1500,
18 // landscape: 1, 18 // landscape: 1,
19 // size: 1, 19 // size: 1,
@@ -107,6 +107,8 @@ interface radiusType { @@ -107,6 +107,8 @@ interface radiusType {
107 @Component 107 @Component
108 struct createImg { 108 struct createImg {
109 @Prop fullColumnImgUrls: FullColumnImgUrlDTO[] 109 @Prop fullColumnImgUrls: FullColumnImgUrlDTO[]
  110 + @State picWidth: number = 0;
  111 + @State picHeight: number = 0;
110 aboutToAppear(): void { 112 aboutToAppear(): void {
111 if(this.fullColumnImgUrls.length === 4) { // 为了使用栅格布局以便于占用三分之二的宽度,加一个占位 113 if(this.fullColumnImgUrls.length === 4) { // 为了使用栅格布局以便于占用三分之二的宽度,加一个占位
112 this.fullColumnImgUrls.splice(2,0, { 114 this.fullColumnImgUrls.splice(2,0, {
@@ -137,18 +139,77 @@ struct createImg { @@ -137,18 +139,77 @@ struct createImg {
137 return radius 139 return radius
138 } 140 }
139 141
  142 + getPicType(){
  143 + if (this.picWidth && this.picWidth) {
  144 + if (this.picWidth / this.picHeight > 343/172) {
  145 + return 1; //横长图
  146 + } else if (this.picHeight / this.picWidth > 305/228) {
  147 + return 2; //竖长图
  148 + } else {
  149 + return 3
  150 + }
  151 + } else {
  152 + return 3; //普通图
  153 + }
  154 + }
  155 +
  156 +
140 build() { 157 build() {
141 GridRow({ 158 GridRow({
142 gutter: { x: 2, y: 2 } 159 gutter: { x: 2, y: 2 }
143 }) { 160 }) {
144 ForEach(this.fullColumnImgUrls, (item: FullColumnImgUrlDTO, index: number) => { 161 ForEach(this.fullColumnImgUrls, (item: FullColumnImgUrlDTO, index: number) => {
145 if (this.fullColumnImgUrls.length === 1) { 162 if (this.fullColumnImgUrls.length === 1) {
  163 + if (this.getPicType() !== 3) {
  164 + GridCol({
  165 + span: this.getPicType() === 1 ? 12 : 8
  166 + }){
  167 + Stack({
  168 + alignContent: Alignment.BottomEnd
  169 + }) {
  170 + if (this.getPicType() === 1) {
  171 + Image(item.fullUrl)
  172 + .width('100%')
  173 + .height(172)
  174 + .autoResize(true)
  175 + .borderRadius(this.caclImageRadius(index))
  176 + } else if (this.getPicType() === 2) {
  177 + Image(item.fullUrl)
  178 + .width('100%')
  179 + .height(305)
  180 + .autoResize(true)
  181 + .borderRadius(this.caclImageRadius(index))
  182 + }
  183 + Flex({ direction: FlexDirection.Row }) {
  184 + Image($r('app.media.icon_long_pic'))
  185 + .width(14)
  186 + .height(14)
  187 + .margin({right: 4})
  188 + Text('长图')
  189 + .fontSize(12)
  190 + .fontWeight(400)
  191 + .fontColor(0xffffff)
  192 + .fontFamily('PingFang SC')
  193 + }
  194 + .width(48)
  195 + .padding({bottom: 9})
  196 +
  197 + }
  198 + }
  199 + } else {
146 GridCol({ 200 GridCol({
147 span: { xs: 8 } 201 span: { xs: 8 }
148 }) { 202 }) {
149 Image(item.fullUrl) 203 Image(item.fullUrl)
150 .width('100%') 204 .width('100%')
151 .borderRadius(this.caclImageRadius(index)) 205 .borderRadius(this.caclImageRadius(index))
  206 + .autoResize(true)
  207 + .opacity(!this.picWidth && !this.picHeight ? 0 : 1)
  208 + .onComplete(callback => {
  209 + this.picWidth = callback?.width || 0;
  210 + this.picHeight = callback?.height || 0;
  211 + })
  212 + }
152 } 213 }
153 } else if (this.fullColumnImgUrls.length === 4) { 214 } else if (this.fullColumnImgUrls.length === 4) {
154 GridCol({ 215 GridCol({
@@ -104,7 +104,7 @@ export struct Card9Component { @@ -104,7 +104,7 @@ export struct Card9Component {
104 Column() { 104 Column() {
105 Row() { 105 Row() {
106 // 标题 106 // 标题
107 - Image($r("app.media.point_icon")) 107 + Image($r("app.media.timeline_rect"))
108 .width(9) 108 .width(9)
109 .height(9) 109 .height(9)
110 .margin({ right: 5 }) 110 .margin({ right: 5 })
@@ -157,11 +157,11 @@ struct CreatorItem { @@ -157,11 +157,11 @@ struct CreatorItem {
157 .width(44) 157 .width(44)
158 .height(44) 158 .height(44)
159 if (this.isSelected) { 159 if (this.isSelected) {
160 - Image($r('app.media.MyCollection_selected_icon')) 160 + Image($r('app.media.rmh_selected'))
161 .width(16) 161 .width(16)
162 .height(16) 162 .height(16)
163 } else { 163 } else {
164 - Image($r('app.media.ic_succeed_refresh')) 164 + Image($r('app.media.rmh_unselected'))
165 .width(16) 165 .width(16)
166 .height(16) 166 .height(16)
167 } 167 }
@@ -90,6 +90,7 @@ export struct OtherHomePageBottomCommentComponent{ @@ -90,6 +90,7 @@ export struct OtherHomePageBottomCommentComponent{
90 MinePageDatasModel.getOtherCommentListData(object,getContext(this)).then((value)=>{ 90 MinePageDatasModel.getOtherCommentListData(object,getContext(this)).then((value)=>{
91 if (!this.data_comment || value.list.length == 0){ 91 if (!this.data_comment || value.list.length == 0){
92 this.hasMore = false 92 this.hasMore = false
  93 + this.isLoading = false
93 }else{ 94 }else{
94 this.getCommentListStatus(value) 95 this.getCommentListStatus(value)
95 } 96 }
@@ -60,6 +60,7 @@ export struct BottomNavigationComponent { @@ -60,6 +60,7 @@ export struct BottomNavigationComponent {
60 MinePageComponent() 60 MinePageComponent()
61 } else { 61 } else {
62 TopNavigationComponent({ 62 TopNavigationComponent({
  63 + groupId: navItem.id,
63 topNavList: navItem.topNavChannelList, 64 topNavList: navItem.topNavChannelList,
64 _currentNavIndex: this.currentNavIndex, 65 _currentNavIndex: this.currentNavIndex,
65 changeBarBackgroundColor: (color: Color) => { 66 changeBarBackgroundColor: (color: Color) => {
@@ -12,7 +12,6 @@ import LoadMoreLayout from './LoadMoreLayout'; @@ -12,7 +12,6 @@ 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 { GroupInfoDTO } from 'wdBean/src/main/ets/bean/navigation/PageInfoDTO'; 14 import { GroupInfoDTO } from 'wdBean/src/main/ets/bean/navigation/PageInfoDTO';
15 -import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index';  
16 import { CompDTO, LiveReviewDTO, PageDTO, PageInfoBean } from 'wdBean'; 15 import { CompDTO, LiveReviewDTO, PageDTO, PageInfoBean } from 'wdBean';
17 16
18 17
@@ -40,7 +39,6 @@ export struct PageComponent { @@ -40,7 +39,6 @@ export struct PageComponent {
40 totalCount: 0, 39 totalCount: 0,
41 list: [] 40 list: []
42 }; 41 };
43 - name: string = "";  
44 @Link @Watch('onChange') currentTopNavSelectedIndex: number 42 @Link @Watch('onChange') currentTopNavSelectedIndex: number
45 43
46 build() { 44 build() {
@@ -71,7 +69,7 @@ export struct PageComponent { @@ -71,7 +69,7 @@ export struct PageComponent {
71 @Builder 69 @Builder
72 ListLayout() { 70 ListLayout() {
73 List() { 71 List() {
74 - if (this.name !== '视频') { 72 +
75 // 下拉刷新 73 // 下拉刷新
76 ListItem() { 74 ListItem() {
77 RefreshLayout({ 75 RefreshLayout({
@@ -79,11 +77,7 @@ export struct PageComponent { @@ -79,11 +77,7 @@ export struct PageComponent {
79 this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight) 77 this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight)
80 }) 78 })
81 } 79 }
82 - }  
83 80
84 - if (this.name === '视频') {  
85 - VideoChannelDetail()  
86 - } else {  
87 LazyForEach(this.pageModel.compList, (compDTO: CompDTO, compIndex: number) => { 81 LazyForEach(this.pageModel.compList, (compDTO: CompDTO, compIndex: number) => {
88 ListItem() { 82 ListItem() {
89 Column() { 83 Column() {
@@ -93,9 +87,7 @@ export struct PageComponent { @@ -93,9 +87,7 @@ export struct PageComponent {
93 }, 87 },
94 (compDTO: CompDTO, compIndex: number) => compDTO.id + compIndex.toString() + this.pageModel.timestamp 88 (compDTO: CompDTO, compIndex: number) => compDTO.id + compIndex.toString() + this.pageModel.timestamp
95 ) 89 )
96 - }  
97 90
98 - if (this.name !== '视频') {  
99 // 加载更多 91 // 加载更多
100 ListItem() { 92 ListItem() {
101 if (this.pageModel.hasMore) { 93 if (this.pageModel.hasMore) {
@@ -107,7 +99,6 @@ export struct PageComponent { @@ -107,7 +99,6 @@ export struct PageComponent {
107 NoMoreLayout() 99 NoMoreLayout()
108 } 100 }
109 } 101 }
110 - }  
111 102
112 } 103 }
113 .scrollBar(BarState.Off) 104 .scrollBar(BarState.Off)
@@ -6,6 +6,7 @@ import { ChannelSubscriptionLayout } from './ChannelSubscriptionLayout'; @@ -6,6 +6,7 @@ import { ChannelSubscriptionLayout } from './ChannelSubscriptionLayout';
6 import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent'; 6 import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent';
7 import window from '@ohos.window'; 7 import window from '@ohos.window';
8 import { WindowModel } from 'wdKit'; 8 import { WindowModel } from 'wdKit';
  9 +import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index';
9 10
10 const TAG = 'TopNavigationComponent'; 11 const TAG = 'TopNavigationComponent';
11 12
@@ -20,6 +21,7 @@ const storage = LocalStorage.getShared(); @@ -20,6 +21,7 @@ const storage = LocalStorage.getShared();
20 @Entry(storage) 21 @Entry(storage)
21 @Component 22 @Component
22 export struct TopNavigationComponent { 23 export struct TopNavigationComponent {
  24 + private groupId: number = 0
23 private tabsController: TabsController = new TabsController() 25 private tabsController: TabsController = new TabsController()
24 private changeBarBackgroundColor: (color: Color) => void = () => { 26 private changeBarBackgroundColor: (color: Color) => void = () => {
25 } 27 }
@@ -236,13 +238,21 @@ export struct TopNavigationComponent { @@ -236,13 +238,21 @@ export struct TopNavigationComponent {
236 Tabs({ index: this.currentTopNavSelectedIndex, controller: this.tabsController }) { 238 Tabs({ index: this.currentTopNavSelectedIndex, controller: this.tabsController }) {
237 ForEach(this._currentNavIndex === 0 ? this.myChannelList : this.topNavList, (navItem: TopNavDTO, index: number) => { 239 ForEach(this._currentNavIndex === 0 ? this.myChannelList : this.topNavList, (navItem: TopNavDTO, index: number) => {
238 TabContent() { 240 TabContent() {
  241 + if (this._currentNavIndex === 2 && navItem.name === '视频') {
  242 + VideoChannelDetail({
  243 + bottomNavIndex: this._currentNavIndex,
  244 + topNavIndex: this.currentTopNavSelectedIndex,
  245 + groupId: this.groupId + '',
  246 + pageId: navItem.pageId + '',
  247 + channelId: navItem.channelId + '',
  248 + })
  249 + } else
239 if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) { 250 if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) {
240 PageComponent({ 251 PageComponent({
241 currentTopNavSelectedIndex: $currentTopNavSelectedIndex, 252 currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
242 navIndex: index, 253 navIndex: index,
243 pageId: navItem.pageId + '', 254 pageId: navItem.pageId + '',
244 channelId: navItem.channelId + '', 255 channelId: navItem.channelId + '',
245 - name: navItem.name  
246 }) 256 })
247 } 257 }
248 } 258 }
1 -import { ContentDTO, FullColumnImgUrlDTO, InteractDataDTO, RmhInfoDTO, VideoInfoDTO } from 'wdBean/Index' 1 +import { ContentDTO,
  2 + contentListParams,
  3 + FullColumnImgUrlDTO, InteractDataDTO, RmhInfoDTO, VideoInfoDTO } from 'wdBean/Index'
2 import { LiveInfoDTO } from 'wdBean/src/main/ets/bean/detail/LiveInfoDTO' 4 import { LiveInfoDTO } from 'wdBean/src/main/ets/bean/detail/LiveInfoDTO'
3 import { VoiceInfoDTO } from 'wdBean/src/main/ets/bean/detail/VoiceInfoDTO' 5 import { VoiceInfoDTO } from 'wdBean/src/main/ets/bean/detail/VoiceInfoDTO'
4 import { LazyDataSource, StringUtils } from 'wdKit/Index' 6 import { LazyDataSource, StringUtils } from 'wdKit/Index'
5 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' 7 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
  8 +import { SearchResultContentData } from '../../viewmodel/SearchResultContentData'
  9 +import { SearchRmhDescription } from '../../viewmodel/SearchResultContentItem'
6 import { CardParser } from '../CardParser' 10 import { CardParser } from '../CardParser'
7 import { ListHasNoMoreDataUI } from '../reusable/ListHasNoMoreDataUI' 11 import { ListHasNoMoreDataUI } from '../reusable/ListHasNoMoreDataUI'
8 12
@@ -13,6 +17,7 @@ export struct SearchResultContentComponent{ @@ -13,6 +17,7 @@ export struct SearchResultContentComponent{
13 @State keywords:string = "" 17 @State keywords:string = ""
14 @State searchType:string = "" 18 @State searchType:string = ""
15 @State data: LazyDataSource<ContentDTO> = new LazyDataSource(); 19 @State data: LazyDataSource<ContentDTO> = new LazyDataSource();
  20 + @State data_rmh: SearchRmhDescription[] = []
16 @State count:number = 0; 21 @State count:number = 0;
17 @State isLoading:boolean = false 22 @State isLoading:boolean = false
18 @State hasMore:boolean = true 23 @State hasMore:boolean = true
@@ -42,9 +47,51 @@ export struct SearchResultContentComponent{ @@ -42,9 +47,51 @@ export struct SearchResultContentComponent{
42 SearcherAboutDataModel.getSearchResultListData("20",`${this.curPageNum}`,this.searchType,this.keywords,getContext(this)).then((value)=>{ 47 SearcherAboutDataModel.getSearchResultListData("20",`${this.curPageNum}`,this.searchType,this.keywords,getContext(this)).then((value)=>{
43 if (!this.data || value.list.length == 0){ 48 if (!this.data || value.list.length == 0){
44 this.hasMore = false 49 this.hasMore = false
  50 + this.isLoading = false
45 }else{ 51 }else{
46 - value.list.forEach((value)=>{ 52 + if(value.list[0].dataList!=null){
  53 + this.data_rmh = value.list[0].dataList
  54 + //TODO 查询创作者详情接口
  55 +
  56 + }
  57 + this.getInteractData(value)
  58 + }
  59 + }).catch((err:Error)=>{
  60 + console.log(TAG,JSON.stringify(err))
  61 + this.isLoading = false
  62 + })
  63 + }
  64 + }
  65 +
  66 + getInteractData(resultData:SearchResultContentData){
  67 + if(resultData.list[0].dataList!=null){
  68 + resultData.list.splice(0,1)
  69 + }
47 70
  71 + let data : contentListParams = {
  72 + contentList: []
  73 + }
  74 + resultData.list.forEach((item)=>{
  75 + data.contentList.push({
  76 + contentId: item.data.id + '',
  77 + contentType: Number.parseInt(item.data.type)
  78 + })
  79 + })
  80 +
  81 + SearcherAboutDataModel.getInteractListData(data,getContext(this)).then((newValue)=>{
  82 + newValue.forEach((item)=>{
  83 + resultData.list.forEach((data)=>{
  84 + if (item.contentId == data.data.id) {
  85 + data.data.collectNum = item.collectNum+""
  86 + data.data.commentNum = item.commentNum+""
  87 + data.data.likeNum = item.likeNum+""
  88 + data.data.readNum = item.readNum+""
  89 + data.data.shareNum = item.shareNum+""
  90 + }
  91 + })
  92 + })
  93 +
  94 + resultData.list.forEach((value)=>{
48 let photos:FullColumnImgUrlDTO[] = [] 95 let photos:FullColumnImgUrlDTO[] = []
49 if(value.data.appStyle === 4){ 96 if(value.data.appStyle === 4){
50 value.data.appStyleImages.split("&&").forEach((value)=>{ 97 value.data.appStyleImages.split("&&").forEach((value)=>{
@@ -111,37 +158,78 @@ export struct SearchResultContentComponent{ @@ -111,37 +158,78 @@ export struct SearchResultContentComponent{
111 interactData: {} as InteractDataDTO, 158 interactData: {} as InteractDataDTO,
112 corner: '', 159 corner: '',
113 rmhPlatform: 0, 160 rmhPlatform: 0,
114 - newTags: '' 161 + newTags: '',
  162 + isSearch: true
115 } 163 }
116 164
117 this.data.push(contentDTO) 165 this.data.push(contentDTO)
118 }) 166 })
119 this.data.notifyDataReload() 167 this.data.notifyDataReload()
120 this.count = this.data.totalCount() 168 this.count = this.data.totalCount()
121 - if (this.data.totalCount() < value.totalCount) { 169 + if (this.data.totalCount() < resultData.totalCount) {
122 this.curPageNum++ 170 this.curPageNum++
123 }else { 171 }else {
124 this.hasMore = false 172 this.hasMore = false
125 } 173 }
126 - } 174 + this.isLoading = false
127 }).catch((err:Error)=>{ 175 }).catch((err:Error)=>{
128 - console.log(TAG,JSON.stringify(err))  
129 - })  
130 - } 176 + console.log(TAG,"请求失败")
131 this.isLoading = false 177 this.isLoading = false
  178 + })
132 } 179 }
133 180
134 -  
135 build() { 181 build() {
136 Column() { 182 Column() {
137 if(this.count == 0){ 183 if(this.count == 0){
138 ListHasNoMoreDataUI({style:2}) 184 ListHasNoMoreDataUI({style:2})
139 }else{ 185 }else{
  186 + Column(){
  187 + if (this.data_rmh!=null && this.data_rmh.length > 0) {
  188 + //List
  189 + List() {
  190 + ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => {
  191 + ListItem() {
  192 + Column(){
  193 + Image($r('app.media.default_head'))
  194 + .width('84lpx')
  195 + .height('84lpx')
  196 + .margin({bottom:'15lpx'})
  197 + Text(item.creatorName)
  198 + .fontSize('20lpx')
  199 + }.alignItems(HorizontalAlign.Center)
  200 +
  201 + }.onClick(()=>{
  202 + //TODO 跳转
  203 + })
  204 + .width('150lpx')
  205 + })
  206 + }
  207 + .cachedCount(6)
  208 + .edgeEffect(EdgeEffect.None)
  209 + .scrollBar(BarState.Off)
  210 + .listDirection(Axis.Horizontal)
  211 + .width('100%')
  212 + .height('150lpx')
  213 + .onReachEnd(()=>{
  214 + if(!this.isLoading){
  215 + //进入更多关注页
  216 + }
  217 + })
  218 + }
140 //List 219 //List
141 List({ space: '6lpx' }) { 220 List({ space: '6lpx' }) {
142 LazyForEach(this.data, (item: ContentDTO, index: number) => { 221 LazyForEach(this.data, (item: ContentDTO, index: number) => {
143 ListItem() { 222 ListItem() {
  223 + Column(){
144 CardParser({contentDTO:item}) 224 CardParser({contentDTO:item})
  225 + if(index != this.data.totalCount()-1 ){
  226 + Divider()
  227 + .width('100%')
  228 + .height('1lpx')
  229 + .color($r('app.color.color_F5F5F5'))
  230 + .strokeWidth('1lpx')
  231 + }
  232 + }
145 } 233 }
146 .onClick(()=>{ 234 .onClick(()=>{
147 //TODO 跳转 235 //TODO 跳转
@@ -154,7 +242,8 @@ export struct SearchResultContentComponent{ @@ -154,7 +242,8 @@ export struct SearchResultContentComponent{
154 ListHasNoMoreDataUI() 242 ListHasNoMoreDataUI()
155 } 243 }
156 } 244 }
157 - }.cachedCount(4) 245 + }.cachedCount(6)
  246 + .edgeEffect(EdgeEffect.None)
158 .scrollBar(BarState.Off) 247 .scrollBar(BarState.Off)
159 .margin({top:'23lpx',left:'23lpx',right:'23lpx'}) 248 .margin({top:'23lpx',left:'23lpx',right:'23lpx'})
160 .layoutWeight(1) 249 .layoutWeight(1)
@@ -167,6 +256,7 @@ export struct SearchResultContentComponent{ @@ -167,6 +256,7 @@ export struct SearchResultContentComponent{
167 }) 256 })
168 } 257 }
169 } 258 }
  259 + }
170 .backgroundColor($r('app.color.white')) 260 .backgroundColor($r('app.color.white'))
171 .height('100%') 261 .height('100%')
172 .width('100%') 262 .width('100%')
@@ -67,10 +67,10 @@ export struct AboutPageUI { @@ -67,10 +67,10 @@ export struct AboutPageUI {
67 this.getArrowCell(item, index) 67 this.getArrowCell(item, index)
68 }.onClick(() => { 68 }.onClick(() => {
69 if (index == 0) { 69 if (index == 0) {
70 - let bean = { contentId: "1", pageID: "" } as Params 70 + let bean = { contentID: "2", pageID: "" } as Params
71 WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) 71 WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
72 } else { 72 } else {
73 - let bean = { contentId: "2", pageID: "" } as Params 73 + let bean = { contentID: "1", pageID: "" } as Params
74 WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) 74 WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
75 } 75 }
76 }) 76 })
@@ -52,8 +52,7 @@ export struct BannerComponent { @@ -52,8 +52,7 @@ export struct BannerComponent {
52 .borderRadius($r('app.float.image_border_radius')) 52 .borderRadius($r('app.float.image_border_radius'))
53 .displayCount(this.buildDisplayCount()) // 仅展示1个图片 53 .displayCount(this.buildDisplayCount()) // 仅展示1个图片
54 .cachedCount(2) 54 .cachedCount(2)
55 - .index(1) // The default index of Swiper.  
56 - .autoPlay(true) 55 + .index(0) // The default index of Swiper.
57 .indicator(Indicator.dot() 56 .indicator(Indicator.dot()
58 .right(5) 57 .right(5)
59 .itemWidth(4) 58 .itemWidth(4)
@@ -6,6 +6,7 @@ import { SearchHistoryItem } from '../viewmodel/SearchHistoryItem'; @@ -6,6 +6,7 @@ import { SearchHistoryItem } from '../viewmodel/SearchHistoryItem';
6 import { SearchHotContentItem } from '../viewmodel/SearchHotContentItem'; 6 import { SearchHotContentItem } from '../viewmodel/SearchHotContentItem';
7 import { SearchResultCountItem } from '../viewmodel/SearchResultCountItem'; 7 import { SearchResultCountItem } from '../viewmodel/SearchResultCountItem';
8 import { SearchResultContentData } from '../viewmodel/SearchResultContentData'; 8 import { SearchResultContentData } from '../viewmodel/SearchResultContentData';
  9 +import { contentListParams, InteractDataDTO } from 'wdBean/Index';
9 10
10 const TAG = "SearcherAboutDataModel" 11 const TAG = "SearcherAboutDataModel"
11 12
@@ -82,6 +83,8 @@ class SearcherAboutDataModel{ @@ -82,6 +83,8 @@ class SearcherAboutDataModel{
82 if(this.searchHistoryData.length>10){ 83 if(this.searchHistoryData.length>10){
83 this.searchHistoryData.splice(10,this.searchHistoryData.length - 10) 84 this.searchHistoryData.splice(10,this.searchHistoryData.length - 10)
84 } 85 }
  86 + // this.putSearchHistoryData("大家")
  87 + // this.putSearchHistoryData("人民")
85 88
86 return this.searchHistoryData 89 return this.searchHistoryData
87 } 90 }
@@ -278,6 +281,44 @@ class SearcherAboutDataModel{ @@ -278,6 +281,44 @@ class SearcherAboutDataModel{
278 return compRes.data 281 return compRes.data
279 } 282 }
280 283
  284 + /**
  285 + * 搜索结果 展示列表(交互详情 评论收藏点赞分享数量)
  286 + */
  287 + getInteractListData(data : contentListParams,context: Context): Promise<InteractDataDTO[]> {
  288 + return new Promise<InteractDataDTO[]>((success, error) => {
  289 + Logger.info(TAG, `getInteractListData start`);
  290 + this.fetchInteractListData(data).then((navResDTO: ResponseDTO<InteractDataDTO[]>) => {
  291 + if (!navResDTO || navResDTO.code != 0) {
  292 + success(this.getInteractListDataLocal(context))
  293 + return
  294 + }
  295 + Logger.info(TAG, "getInteractListData then,SearchResultListResDTO.timeStamp:" + navResDTO.timestamp);
  296 + let navigationBean = navResDTO.data as InteractDataDTO[]
  297 + success(navigationBean);
  298 + }).catch((err: Error) => {
  299 + Logger.error(TAG, `getInteractListData catch, error.name : ${err.name}, error.message:${err.message}`);
  300 + success(this.getInteractListDataLocal(context))
  301 + })
  302 + })
  303 + }
  304 +
  305 + fetchInteractListData(data : contentListParams) {
  306 + let url = HttpUrlUtils.getInteractListDataUrl()
  307 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  308 + return WDHttp.post<ResponseDTO<InteractDataDTO[]>>(url,data, headers)
  309 + };
  310 +
  311 + async getInteractListDataLocal(context: Context): Promise<InteractDataDTO[]> {
  312 + Logger.info(TAG, `getInteractListDataLocal start`);
  313 + let compRes: ResponseDTO<InteractDataDTO[]> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<InteractDataDTO[]>>(context,'search_result_interact_list_data.json' );
  314 + if (!compRes || !compRes.data) {
  315 + Logger.info(TAG, `getInteractListDataLocal compRes is empty`);
  316 + return []
  317 + }
  318 + Logger.info(TAG, `getInteractListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);
  319 + return compRes.data
  320 + }
  321 +
281 322
282 } 323 }
283 324
@@ -4,6 +4,7 @@ import { SearchResultContentItem } from './SearchResultContentItem' @@ -4,6 +4,7 @@ import { SearchResultContentItem } from './SearchResultContentItem'
4 export class SearchResultContentData{ 4 export class SearchResultContentData{
5 list:SearchResultContentItem[] = [] 5 list:SearchResultContentItem[] = []
6 6
  7 +
7 keyword:string = "" 8 keyword:string = ""
8 pageNum: number = 0 9 pageNum: number = 0
9 pageSize: number = 20 10 pageSize: number = 20
1 1
2 export class SearchResultContentItem{ 2 export class SearchResultContentItem{
3 data:SearchDescription = new SearchDescription() 3 data:SearchDescription = new SearchDescription()
  4 + dataList:SearchRmhDescription[] = []
4 resultType:string = "" 5 resultType:string = ""
5 } 6 }
6 7
@@ -172,6 +173,180 @@ class SearchDescription{ @@ -172,6 +173,180 @@ class SearchDescription{
172 sourceName: string = "" 173 sourceName: string = ""
173 shareImageBucket: string = "" 174 shareImageBucket: string = ""
174 landscape: string = "" 175 landscape: string = ""
  176 + collectNum: string = ""
  177 + commentNum: string = ""
  178 + likeNum: string= ""
  179 + readNum: string= ""
  180 + shareNum: string= ""
175 181
  182 +}
176 183
  184 +export class SearchRmhDescription{
  185 + likeEnable: string= ""
  186 + previewUri: string= ""
  187 + firstFrameImageBucket: string= ""
  188 + appImg: string= ""
  189 + onlineStatus: string= ""
  190 + createUserName: string= ""
  191 + contentCheck: string= ""
  192 + type: string= ""
  193 + titleOsst: string= ""
  194 + coverHImageBucket: string= ""
  195 + shareImageUri: string= ""
  196 + searchTypeInt: string= ""
  197 + authIcon: string= ""
  198 + id: string= ""
  199 + newOld: string= ""
  200 + seoTags: string= ""
  201 + publishTime: string= ""
  202 + feedControl: string= ""
  203 + saveType: string= ""
  204 + userTypeInt: string= ""
  205 + userOrigin: string= ""
  206 + creatorType: string= ""
  207 + planStartTime: string= ""
  208 + waresSwitch: string= ""
  209 + introductionLiteral: string= ""
  210 + topicType: string= ""
  211 + hotFlag: string= ""
  212 + coverUrl: string= ""
  213 + itemId: string= ""
  214 + titleEn: string= ""
  215 + matrixId: string= ""
  216 + tplId: string= ""
  217 + joinActivity: string= ""
  218 + status: string= ""
  219 + headerPhotoUrl: string= ""
  220 + zhSearch: string= ""
  221 + activityControl: string= ""
  222 + city: string= ""
  223 + showTitleIng: string= ""
  224 + shareFlag: string= ""
  225 + creatorName: string= ""
  226 + className: string= ""
  227 + showTitleNo: string= ""
  228 + liveSwitch: string= ""
  229 + likesStyle: string= ""
  230 + dataKey: string= ""
  231 + search: string= ""
  232 + puserId: string= ""
  233 + top: string= ""
  234 + titleLiteral: string= ""
  235 + countryCode: string= ""
  236 + startTime: string= ""
  237 + shareDescription: string= ""
  238 + channelId: string= ""
  239 + openComment: string= ""
  240 + creatorClassify: string= ""
  241 + previewBucket: string= ""
  242 + picCount: string= ""
  243 + recommendControl: string= ""
  244 + creatorNameLiteral: string= ""
  245 + subjects: string= ""
  246 + updateUser: string= ""
  247 + i: string= ""
  248 + updateTime: string= ""
  249 + userId: string= ""
  250 + showTitleEd: string= ""
  251 + authTo: string= ""
  252 + rmhPlatformInt: string= ""
  253 + giftEnable: string= ""
  254 + titleEnosst: string= ""
  255 + shareCoverUrl: string= ""
  256 + deleted: string= ""
  257 + zhOperateFlag: string= ""
  258 + shareTitle: string= ""
  259 + scrollUpdated: string= ""
  260 + createTime: string= ""
  261 + creatorBan: string= ""
  262 + publishTimeInt: string= ""
  263 + organization: string= ""
  264 + channelName: string= ""
  265 + createUser: string= ""
  266 + currentPoliticsFlag: string= ""
  267 + endTime: string= ""
  268 + sourceId: string= ""
  269 + country: string= ""
  270 + secondClassify: string= ""
  271 + createUserId: string= ""
  272 + firstFrameImageUri: string= ""
  273 + pubTime: string= ""
  274 + openLikes: string= ""
  275 + contentText: string= ""
  276 + relType: string= ""
  277 + authImg: string= ""
  278 + roomId: string= ""
  279 + nameLiteral: string= ""
  280 + mainControl: string= ""
  281 + coverVImageBucket: string= ""
  282 + linkUrl: string= ""
  283 + openDownload: string= ""
  284 + zhChannelPageImg: string= ""
  285 + appStandImg: string= ""
  286 + shareSummary: string= ""
  287 + firstPublishTimeInt: string= ""
  288 + rmhPlatform: string= ""
  289 + creatorNameOsst: string= ""
  290 + searchType: string= ""
  291 + author: string= ""
  292 + askAnswerFlag: string= ""
  293 + seoTagName: string= ""
  294 + weight: string= ""
  295 + pageId: string= ""
  296 + firstPublishTime: string= ""
  297 + coverVImageUri: string= ""
  298 + publishType: string= ""
  299 + isVr: string= ""
  300 + name: string= ""
  301 + shareUrl: string= ""
  302 + userType: string= ""
  303 + firstProcessTime: string= ""
  304 + hasRecord: string= ""
  305 + shareTitleOsst: string= ""
  306 + classify: string= ""
  307 + itemType: string= ""
  308 + nameOsst: string= ""
  309 + districtCode: string= ""
  310 + hidden: string= ""
  311 + cityCode: string= ""
  312 + liveType: string= ""
  313 + appStyleImages: string= ""
  314 + titleShow: string= ""
  315 + cornerMark: string= ""
  316 + creatorId: string= ""
  317 + levelScore: string= ""
  318 + description: string= ""
  319 + liveStartTime: string= ""
  320 + likeStyle: string= ""
  321 + title: string= ""
  322 + content: string= ""
  323 + platform: string= ""
  324 + duration: string= ""
  325 + shareDescriptionLiteral: string= ""
  326 + createTimeInt: string= ""
  327 + liveEndTime: string= ""
  328 + topicTemplate: string= ""
  329 + barrageEnable: string= ""
  330 + introduction: string= ""
  331 + notice: string= ""
  332 + shareTitleLiteral: string= ""
  333 + coverHImageUri: string= ""
  334 + relId: string= ""
  335 + classCode: string= ""
  336 + grayScale: string= ""
  337 + appStyle: string= ""
  338 + authTitle: string= ""
  339 + provinceCode: string= ""
  340 + tenancy: string= ""
  341 + platformId: string= ""
  342 + classSubName: string= ""
  343 + recommended: string= ""
  344 + descriptionLiteral: string= ""
  345 + banControl: string= ""
  346 + auditingStatus: string= ""
  347 + planEndTime: string= ""
  348 + speakControl: string= ""
  349 + sourceName: string= ""
  350 + shareImageBucket: string= ""
  351 + landscape: string= ""
177 } 352 }
@@ -2,6 +2,7 @@ import { Logger, ResourcesUtils } from 'wdKit'; @@ -2,6 +2,7 @@ import { Logger, ResourcesUtils } from 'wdKit';
2 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; 2 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
3 import { ContentDetailDTO, InteractDataDTO } from 'wdBean'; 3 import { ContentDetailDTO, InteractDataDTO } from 'wdBean';
4 import HashMap from '@ohos.util.HashMap'; 4 import HashMap from '@ohos.util.HashMap';
  5 +import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
5 6
6 const TAG = 'ContentDetailRequest'; 7 const TAG = 'ContentDetailRequest';
7 8
@@ -13,6 +14,18 @@ export interface ContentDetailRequestParams { @@ -13,6 +14,18 @@ export interface ContentDetailRequestParams {
13 relType: string 14 relType: string
14 } 15 }
15 16
  17 +export interface contentsItem {
  18 + contentId: string;
  19 + contentRelId: string;
  20 + contentType: number;
  21 + relId: string;
  22 + relType: string;
  23 +}
  24 +
  25 +export interface batchContentDetailParams {
  26 + contents: contentsItem[]
  27 +}
  28 +
16 export interface recommentVideoListParams { 29 export interface recommentVideoListParams {
17 pageSize: number; 30 pageSize: number;
18 refreshCnt: number; 31 refreshCnt: number;
@@ -27,6 +40,47 @@ export interface contentListParams { @@ -27,6 +40,47 @@ export interface contentListParams {
27 contentList: contentListItem[]; 40 contentList: contentListItem[];
28 } 41 }
29 42
  43 +export interface getRecCompInfoParams {
  44 + groupId: string;
  45 + pageId: string;
  46 + channelId: string;
  47 + loadStrategy: string;
  48 + channelStrategy: string;
  49 + pageNum: number;
  50 + pageSize: number;
  51 + refreshTime: number;
  52 +}
  53 +
  54 +
  55 +// 为空的值不声明,需要时再加
  56 +export interface operDataListItem {
  57 + objectId: string;
  58 + objectType: string;
  59 + relId: string;
  60 + relType: string;
  61 + channelId: string;
  62 +}
  63 +
  64 +export interface compListItem {
  65 + compStyle: string;
  66 + compType: string;
  67 + hasMore: number;
  68 + recommend: number;
  69 + operDataList: operDataListItem[];
  70 +}
  71 +
  72 +export interface getRecCompInfoResult {
  73 + blockDesc: string;
  74 + id: number;
  75 + name: string;
  76 + pageId: string;
  77 + pageNum: number;
  78 + pageSize: number;
  79 + recommend: number;
  80 + totalCount: number;
  81 + compList: compListItem[]
  82 +}
  83 +
30 export interface IStatusContentList { 84 export interface IStatusContentList {
31 contentId: string; 85 contentId: string;
32 86
@@ -159,7 +213,33 @@ export class ContentDetailRequest { @@ -159,7 +213,33 @@ export class ContentDetailRequest {
159 } 213 }
160 214
161 /** 215 /**
162 - * 216 + * 查询沉浸式视频频道推荐楼层数据
  217 + * @returns
  218 + */
  219 + static getRecCompInfo(params: getRecCompInfoParams): Promise<ResponseDTO<getRecCompInfoResult>> {
  220 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.DISPLAY_REC_COMPINFO
  221 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  222 + return WDHttp.request({ url, method: 'GET', params, headers: HttpRequest.buildHeaderWithGlobalHeader(headers) })
  223 + }
  224 +
  225 + /**
  226 + * 批量查询沉浸式视频详情
  227 + * @returns
  228 + */
  229 + static batchContentDetail(params: batchContentDetailParams): Promise<ResponseDTO<ContentDetailDTO[]>> {
  230 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.DETAIL_PATH
  231 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  232 + return WDHttp.request({
  233 + url,
  234 + method: 'POST',
  235 + data: params,
  236 + headers: HttpRequest.buildHeaderWithGlobalHeader(headers)
  237 + })
  238 + }
  239 +
  240 +
  241 + /**
  242 + * 批量查询作品点赞、收藏、分享、阅读、评论数量
163 * @returns 243 * @returns
164 */ 244 */
165 static getContentInteract(params: contentListParams): Promise<ResponseDTO<InteractDataDTO[]>> { 245 static getContentInteract(params: contentListParams): Promise<ResponseDTO<InteractDataDTO[]>> {
@@ -5,104 +5,164 @@ import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage' @@ -5,104 +5,164 @@ import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage'
5 import { Test } from './Test' 5 import { Test } from './Test'
6 import router from '@ohos.router'; 6 import router from '@ohos.router';
7 import window from '@ohos.window'; 7 import window from '@ohos.window';
8 -import { contentListParams } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; 8 +import {
  9 + batchContentDetailParams,
  10 + compListItem,
  11 + contentListParams,
  12 + contentsItem,
  13 + getRecCompInfoParams
  14 +} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
  15 +import { WindowModel } from 'wdKit/Index';
  16 +import { BusinessError } from '@kit.BasicServicesKit';
  17 +
  18 +interface loadMoreData {
  19 + pageNum: number;
  20 + refreshTime: number;
  21 + loadStrategy: string;
  22 +}
9 23
10 @Entry 24 @Entry
11 @Component 25 @Component
12 export struct VideoChannelDetail { 26 export struct VideoChannelDetail {
13 - private contentId: string = ''  
14 - private relId: string = ''  
15 - private relType: string = '' 27 + private groupId: string = '' // 楼层id
  28 + private pageId: string = '' //页面id
  29 + private pageNum: number = 1
  30 + private pageSize: number = 10
  31 + private loadStrategy: string = 'first_load' // 首次加载: first_load, 上推刷新: push_up, 下拉刷新: pull_down
  32 + private refreshTime: number = new Date().getTime() // 第一页刷新时间,用于频道分页排序时过滤,查询时携带【首刷、下拉取当前最新时间;其他的都使用首刷的时间】
  33 + private channelId: string = '' // 频道id
  34 + private channelStrategy: string = '1' // 频道策略 1-推荐;2-时间线
  35 + // private topicId?: string = '' // 专题id
  36 + // private recommend?: string = '' // 0.非推荐,1.推荐;
  37 + @State @Watch('navIndexChange') bottomNavIndex: number = 0
  38 + @State @Watch('navIndexChange') topNavIndex: number = 0
16 private swiperController: SwiperController = new SwiperController() 39 private swiperController: SwiperController = new SwiperController()
17 @Provide showComment: boolean = false 40 @Provide showComment: boolean = false
18 @State data: ContentDetailDTO[] = [] 41 @State data: ContentDetailDTO[] = []
19 @State currentIndex: number = 0 42 @State currentIndex: number = 0
20 @State interactDataList: InteractDataDTO[] = [] 43 @State interactDataList: InteractDataDTO[] = []
  44 + @State totalCount: number = 0
21 45
22 - async aboutToAppear(): Promise<void> {  
23 - // let data: ContentDetailDTO[] = []  
24 - // let action: Action = router.getParams() as Action  
25 - // if (action) {  
26 - // this.contentId = action.params?.contentID || ''  
27 - // if (action.params && action.params.extra) {  
28 - // this.relId = action.params.extra.relId || ''  
29 - // this.relType = action.params.extra.relType || ''  
30 - // }  
31 - // await ContentDetailRequest.getContentDetail({  
32 - // contentId: this.contentId,  
33 - // relId: this.relId,  
34 - // relType: this.relType  
35 - // }).then((resDTO: ResponseDTO<ContentDetailDTO[]>) => {  
36 - // console.error('resDTO==', JSON.stringify(resDTO.data))  
37 - // if (resDTO.data) {  
38 - // this.data.push(resDTO.data[0])  
39 - // }  
40 - //  
41 - // })  
42 - // }  
43 -  
44 - await this.queryVideoList()  
45 -  
46 - // await ContentDetailRequest.postRecommendVideoList({  
47 - // pageSize: 5,  
48 - // refreshCnt: 1  
49 - // }).then(res => {  
50 - // if (res.data) {  
51 - // data = data.concat(res.data)  
52 - // }  
53 - // console.log('res1===', JSON.stringify(res))  
54 - // console.log('res==' + this.data)  
55 - // })  
56 -  
57 -  
58 - if (this.data.length > 0) {  
59 - const params: contentListParams = {  
60 - contentList: [] 46 + /**
  47 + * 监听视频频道激活或失活
  48 + */
  49 + navIndexChange() {
  50 + if (this.bottomNavIndex === 2 && this.topNavIndex === 0) {
  51 + // 如果视频在暂停则播放视频
  52 + } else {
  53 + // 如果视频在播放则暂停视频
61 } 54 }
62 - this.data.map(item => {  
63 - params.contentList.push({  
64 - contentId: item.newsId + '',  
65 - contentType: item.newsType  
66 - })  
67 - })  
68 - // 批量查询内容当前用户点赞、收藏状态  
69 - await ContentDetailRequest.getContentInteract(params).then(res => {  
70 - if (res.data) {  
71 - this.interactDataList = res.data || []  
72 } 55 }
73 - console.log('获取互动点赞等数据===', JSON.stringify(res))  
74 - })  
75 - // 查询各类型内容动态数据接口V2  
76 56
  57 + async aboutToAppear(): Promise<void> {
  58 + const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage
  59 + const windowClass: window.Window = windowStage.getMainWindowSync();
  60 + windowClass.setWindowSystemBarProperties({
  61 + statusBarContentColor: '#ffffff',
  62 + })
  63 + console.error('aboutToAppear groupId', this.groupId)
  64 + console.error('aboutToAppear pageId', this.pageId)
  65 + console.error('aboutToAppear channelId', this.channelId)
  66 + // 根据视频频道传参查询视频楼层信息
  67 + this.getRecCompInfo()
77 } 68 }
78 69
79 - // this.data = data  
80 - console.error('aboutToAppear===', this.data.length) 70 + aboutToDisappear(): void {
  71 + const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage
  72 + const windowClass: window.Window = windowStage.getMainWindowSync();
  73 + windowClass.setWindowSystemBarProperties({
  74 + statusBarContentColor: '#000000',
  75 + })
  76 + console.error('aboutToDisappear videoChanel')
  77 + }
81 78
  79 + onPageHide(): void {
  80 + console.error('onPageHide videoChanel')
  81 + }
82 82
  83 + onPageShow(): void {
  84 + console.error('onPageShow videoChanel')
83 } 85 }
84 86
85 /** 87 /**
86 - * 查询视频列表用于翻页 88 + * 根据视频频道传参查询视频楼层信息
87 */ 89 */
88 - async queryVideoList() {  
89 - await ContentDetailRequest.postRecommendVideoList({  
90 - pageSize: 5,  
91 - refreshCnt: 1  
92 - }).then(res => {  
93 - if (res.data) {  
94 - this.data = this.data.concat(res.data)  
95 - }  
96 - console.log('queryVideoList===', JSON.stringify(this.data)) 90 + async getRecCompInfo() {
  91 + if (this.data.length > 0 && this.data.length === this.totalCount) {
  92 + AlertDialog.show({ message: '没有更多视频了~' })
  93 + return
  94 + }
  95 +
  96 + const params: getRecCompInfoParams = {
  97 + groupId: this.groupId,
  98 + pageId: this.pageId,
  99 + channelId: this.channelId,
  100 + loadStrategy: this.loadStrategy,
  101 + channelStrategy: this.channelStrategy,
  102 + pageNum: this.pageNum,
  103 + pageSize: this.pageSize,
  104 + refreshTime: this.refreshTime,
  105 + }
  106 +
  107 + await ContentDetailRequest.getRecCompInfo(params).then(res => {
  108 + console.log('根据视频频道传参查询视频楼层信息', res.data?.totalCount)
  109 + console.log('根据视频频道传参查询视频楼层信息', JSON.stringify(res.data?.compList))
  110 +
  111 + this.totalCount = res.data?.totalCount || 0
  112 + const list1: batchContentDetailParams = {
  113 + contents: []
  114 + }
  115 + const list2: contentListParams = {
  116 + contentList: []
  117 + }
  118 +
  119 + if (res.data?.compList.length) {
  120 + res.data?.compList.map((item: compListItem) => {
  121 + list1.contents.push({
  122 + contentId: item.operDataList[0].objectId,
  123 + contentRelId: item.operDataList[0].relId,
  124 + contentType: Number(item.operDataList[0].objectType),
  125 + relId: item.operDataList[0].relId,
  126 + relType: item.operDataList[0].relType,
  127 + })
  128 +
  129 + list2.contentList.push({
  130 + contentId: item.operDataList[0].objectId,
  131 + contentType: Number(item.operDataList[0].objectType),
  132 + })
97 }) 133 })
98 } 134 }
99 135
100 - aboutToDisappear(): void { 136 + this.batchContentDetail(list1)
  137 + this.getContentInteract(list2)
101 138
  139 + }).catch((e: BusinessError) => {
  140 + console.error('eeeeeeeeeeeeee', e)
  141 + })
102 } 142 }
103 143
104 - onPageHide(): void { 144 + /**
  145 + * 根据视频楼层信息批量查询视频列表
  146 + */
  147 + async batchContentDetail(list: batchContentDetailParams) {
  148 + if (list.contents.length > 0) {
  149 + await ContentDetailRequest.batchContentDetail(list).then(res => {
  150 + console.log('根据视频楼层信息批量查询视频列表', JSON.stringify(res.data))
  151 + this.data = this.data.concat(res.data as [])
  152 + })
  153 + }
  154 + }
105 155
  156 + /**
  157 + * 根据视频信息批量查询点赞、收藏状态
  158 + */
  159 + async getContentInteract(list: contentListParams) {
  160 + if (list.contentList.length > 0) {
  161 + await ContentDetailRequest.getContentInteract(list).then(res => {
  162 + this.interactDataList = res.data || []
  163 + console.log('根据视频信息批量查询点赞、收藏状态', JSON.stringify(res))
  164 + })
  165 + }
106 } 166 }
107 167
108 build() { 168 build() {
@@ -133,7 +193,10 @@ export struct VideoChannelDetail { @@ -133,7 +193,10 @@ export struct VideoChannelDetail {
133 console.info('onChange==', index.toString()) 193 console.info('onChange==', index.toString())
134 194
135 if (this.currentIndex === this.data.length - 1) { 195 if (this.currentIndex === this.data.length - 1) {
136 - this.queryVideoList() 196 + this.pageNum++
  197 + this.refreshTime = new Date().getTime()
  198 + this.loadStrategy = 'push_up'
  199 + this.getRecCompInfo()
137 } 200 }
138 }) 201 })
139 202
@@ -144,7 +144,7 @@ export struct PlayerTitleComment { @@ -144,7 +144,7 @@ export struct PlayerTitleComment {
144 Column() { 144 Column() {
145 Slider({ 145 Slider({
146 value: this.progressVal, 146 value: this.progressVal,
147 - step: 1, 147 + step: 0.01,
148 // style: SliderStyle.OutSet 148 // style: SliderStyle.OutSet
149 }) 149 })
150 .blockColor(this.status === PlayerConstants.STATUS_START ? Color.Transparent : $r('app.color.play_block_color')) 150 .blockColor(this.status === PlayerConstants.STATUS_START ? Color.Transparent : $r('app.color.play_block_color'))
@@ -159,7 +159,7 @@ export struct PlayerTitleComment { @@ -159,7 +159,7 @@ export struct PlayerTitleComment {
159 .width('100%') 159 .width('100%')
160 .height(19) 160 .height(19)
161 .onChange((value: number, mode: SliderChangeMode) => { 161 .onChange((value: number, mode: SliderChangeMode) => {
162 - this.playerController?.setSeekTime(value, mode); 162 + this.playerController?.setSeekTime(Math.floor(value), mode);
163 }) 163 })
164 164
165 if (this.showComment) { 165 if (this.showComment) {
@@ -20,11 +20,11 @@ struct LoginProtocolWebview { @@ -20,11 +20,11 @@ struct LoginProtocolWebview {
20 if (router.getParams()) { 20 if (router.getParams()) {
21 let params = router.getParams() as Params 21 let params = router.getParams() as Params
22 Logger.info(TAG, 'params.contentID:' + params.contentID); 22 Logger.info(TAG, 'params.contentID:' + params.contentID);
23 - if (params.contentID == "1") { //用户协议  
24 - this.webUrl = await SPHelper.default.get(SpConstants.USER_PROTOCOL, this.userProtocol) as string 23 + if (params.contentID == "1") { //"人民日报客户端网络服务使用协议"
  24 + this.webUrl = await SPHelper.default.get(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string
25 this.webviewController.loadUrl(this.webUrl) 25 this.webviewController.loadUrl(this.webUrl)
26 26
27 - } else if(params.contentID == "2"){ //隐私协议 27 + } else if(params.contentID == "2"){ //"人民日报客户端用户隐私协议"
28 this.webUrl = await SPHelper.default.get(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string 28 this.webUrl = await SPHelper.default.get(SpConstants.PRIVATE_PROTOCOL, this.privateProtocol) as string
29 this.webviewController.loadUrl(this.webUrl) 29 this.webviewController.loadUrl(this.webUrl)
30 }else if(params.contentID == "3"){ //注销协议 30 }else if(params.contentID == "3"){ //注销协议
@@ -120,6 +120,9 @@ export class WDPlayerController { @@ -120,6 +120,9 @@ export class WDPlayerController {
120 this.avPlayer?.on(Events.ERROR, (error) => { 120 this.avPlayer?.on(Events.ERROR, (error) => {
121 this.playError(error.message); 121 this.playError(error.message);
122 }) 122 })
  123 + this.avPlayer?.on('seekDone', (time: number) => {
  124 + this.initProgress(time);
  125 + })
123 this.avPlayer?.on(Events.VIDEO_SIZE_CHANGE, (width: number, height: number) => { 126 this.avPlayer?.on(Events.VIDEO_SIZE_CHANGE, (width: number, height: number) => {
124 if (this.onVideoSizeChange) { 127 if (this.onVideoSizeChange) {
125 this.onVideoSizeChange(width, height); 128 this.onVideoSizeChange(width, height);
@@ -248,8 +251,8 @@ export class WDPlayerController { @@ -248,8 +251,8 @@ export class WDPlayerController {
248 // 100 / 1000)); 251 // 100 / 1000));
249 } 252 }
250 if (mode === SliderChangeMode.End) { 253 if (mode === SliderChangeMode.End) {
251 - this.seekTime = value * this.duration;  
252 - this.avPlayer?.seek(this.seekTime, media.SeekMode.SEEK_PREV_SYNC); 254 + this.seekTime = Math.floor(value * this.duration / 100);
  255 + this.avPlayer?.seek(this.seekTime);
253 } 256 }
254 } 257 }
255 258
@@ -269,7 +272,7 @@ export class WDPlayerController { @@ -269,7 +272,7 @@ export class WDPlayerController {
269 let nowSeconds = Math.floor(time / 1000); 272 let nowSeconds = Math.floor(time / 1000);
270 let totalSeconds = Math.floor(this.duration / 1000); 273 let totalSeconds = Math.floor(this.duration / 1000);
271 if (this.onTimeUpdate) { 274 if (this.onTimeUpdate) {
272 - this.onTimeUpdate(nowSeconds, totalSeconds); 275 + this.onTimeUpdate(time, this.duration);
273 } 276 }
274 } 277 }
275 278
@@ -23,7 +23,7 @@ export class LaunchModel { @@ -23,7 +23,7 @@ export class LaunchModel {
23 //保存数据 23 //保存数据
24 for (let i = 0; i < data.data.length; i++) { 24 for (let i = 0; i < data.data.length; i++) {
25 if (data.data[i].type == 1) { 25 if (data.data[i].type == 1) {
26 - SPHelper.default.save(SpConstants.USER_PROTOCOL, data.data[i].linkUrl) 26 + SPHelper.default.save(SpConstants.NET_SERVICE_PROTOCOL, data.data[i].linkUrl)
27 } else if (data.data[i].type == 2) { 27 } else if (data.data[i].type == 2) {
28 SPHelper.default.save(SpConstants.PRIVATE_PROTOCOL, data.data[i].linkUrl) 28 SPHelper.default.save(SpConstants.PRIVATE_PROTOCOL, data.data[i].linkUrl)
29 }else if (data.data[i].type == 4) { 29 }else if (data.data[i].type == 4) {
  1 +{
  2 + "code": "0",
  3 + "data": [
  4 + {
  5 + "collectNum": 1,
  6 + "commentNum": 1,
  7 + "contentId": "30044118767",
  8 + "contentType": 8,
  9 + "likeNum": 20,
  10 + "readNum": 7839,
  11 + "shareNum": 1
  12 + },
  13 + {
  14 + "collectNum": 0,
  15 + "commentNum": 0,
  16 + "contentId": "30043914123",
  17 + "contentType": 8,
  18 + "likeNum": 20,
  19 + "readNum": 4986,
  20 + "shareNum": 2
  21 + },
  22 + {
  23 + "collectNum": 0,
  24 + "commentNum": 0,
  25 + "contentId": "30044329241",
  26 + "contentType": 8,
  27 + "likeNum": 0,
  28 + "readNum": 416,
  29 + "shareNum": 0
  30 + },
  31 + {
  32 + "collectNum": 0,
  33 + "commentNum": 2,
  34 + "contentId": "30044323528",
  35 + "contentType": 8,
  36 + "likeNum": 3,
  37 + "readNum": 1139,
  38 + "shareNum": 4
  39 + },
  40 + {
  41 + "collectNum": 0,
  42 + "commentNum": 0,
  43 + "contentId": "30044318896",
  44 + "contentType": 8,
  45 + "likeNum": 0,
  46 + "readNum": 1266,
  47 + "shareNum": 1
  48 + },
  49 + {
  50 + "collectNum": 11,
  51 + "commentNum": 13,
  52 + "contentId": "30044318735",
  53 + "contentType": 8,
  54 + "likeNum": 12,
  55 + "readNum": 3842,
  56 + "shareNum": 0
  57 + },
  58 + {
  59 + "collectNum": 0,
  60 + "commentNum": 0,
  61 + "contentId": "30044303875",
  62 + "contentType": 8,
  63 + "likeNum": 0,
  64 + "readNum": 2689,
  65 + "shareNum": 0
  66 + },
  67 + {
  68 + "collectNum": 0,
  69 + "commentNum": 0,
  70 + "contentId": "30044210715",
  71 + "contentType": 8,
  72 + "likeNum": 0,
  73 + "readNum": 173,
  74 + "shareNum": 0
  75 + },
  76 + {
  77 + "collectNum": 0,
  78 + "commentNum": 0,
  79 + "contentId": "30002401426",
  80 + "contentType": 8,
  81 + "likeNum": 0,
  82 + "readNum": 9002,
  83 + "shareNum": 1
  84 + },
  85 + {
  86 + "collectNum": 0,
  87 + "commentNum": 0,
  88 + "contentId": "30044297214",
  89 + "contentType": 8,
  90 + "likeNum": 20,
  91 + "readNum": 3079,
  92 + "shareNum": 6
  93 + },
  94 + {
  95 + "collectNum": 0,
  96 + "commentNum": 0,
  97 + "contentId": "30002735426",
  98 + "contentType": 8,
  99 + "likeNum": 0,
  100 + "readNum": 3816,
  101 + "shareNum": 0
  102 + },
  103 + {
  104 + "collectNum": 5,
  105 + "commentNum": 1,
  106 + "contentId": "30002891779",
  107 + "contentType": 8,
  108 + "likeNum": 2,
  109 + "readNum": 30474,
  110 + "shareNum": 4
  111 + },
  112 + {
  113 + "collectNum": 0,
  114 + "commentNum": 4,
  115 + "contentId": "30044242849",
  116 + "contentType": 8,
  117 + "likeNum": 4,
  118 + "readNum": 1099,
  119 + "shareNum": 4
  120 + },
  121 + {
  122 + "collectNum": 0,
  123 + "commentNum": 0,
  124 + "contentId": "30044064967",
  125 + "contentType": 8,
  126 + "likeNum": 9,
  127 + "readNum": 63139,
  128 + "shareNum": 5
  129 + },
  130 + {
  131 + "collectNum": 0,
  132 + "commentNum": 0,
  133 + "contentId": "30044214313",
  134 + "contentType": 8,
  135 + "likeNum": 1,
  136 + "readNum": 5966,
  137 + "shareNum": 1
  138 + },
  139 + {
  140 + "collectNum": 0,
  141 + "commentNum": 0,
  142 + "contentId": "30044174144",
  143 + "contentType": 8,
  144 + "likeNum": 20,
  145 + "readNum": 5150,
  146 + "shareNum": 0
  147 + },
  148 + {
  149 + "collectNum": 0,
  150 + "commentNum": 0,
  151 + "contentId": "30044036728",
  152 + "contentType": 8,
  153 + "likeNum": 20,
  154 + "readNum": 4217,
  155 + "shareNum": 0
  156 + },
  157 + {
  158 + "collectNum": 3,
  159 + "commentNum": 0,
  160 + "contentId": "30044123091",
  161 + "contentType": 8,
  162 + "likeNum": 20,
  163 + "readNum": 16697,
  164 + "shareNum": 0
  165 + },
  166 + {
  167 + "collectNum": 0,
  168 + "commentNum": 0,
  169 + "contentId": "30044055254",
  170 + "contentType": 8,
  171 + "likeNum": 20,
  172 + "readNum": 11551,
  173 + "shareNum": 0
  174 + },
  175 + {
  176 + "collectNum": 0,
  177 + "commentNum": 0,
  178 + "contentId": "30043994115",
  179 + "contentType": 8,
  180 + "likeNum": 0,
  181 + "readNum": 2370,
  182 + "shareNum": 3
  183 + }
  184 + ],
  185 + "message": "Success",
  186 + "meta": null,
  187 + "requestId": "",
  188 + "success": true,
  189 + "timestamp": 1712889166521
  190 +}