yuzhilin

增加金刚位聚合页

@@ -45,5 +45,9 @@ export class ContentConstants { @@ -45,5 +45,9 @@ export class ContentConstants {
45 */ 45 */
46 static readonly TYPE_FIFTEEN: string = "15"; 46 static readonly TYPE_FIFTEEN: string = "15";
47 47
  48 + /**
  49 + * 30:金刚位聚合页
  50 + */
  51 + static readonly TYPE_THIRTY: string = "30";
48 52
49 } 53 }
@@ -826,6 +826,12 @@ export class HttpUrlUtils { @@ -826,6 +826,12 @@ export class HttpUrlUtils {
826 return url 826 return url
827 } 827 }
828 828
  829 + //金刚位聚合页
  830 + static getThemeListUrl() {
  831 + let url = HttpUrlUtils._hostUrl + "/api/rmrb-bff-display-zh/display/zh/c/themeList";
  832 + return url;
  833 + }
  834 +
829 // static getYcgCommonHeaders(): HashMap<string, string> { 835 // static getYcgCommonHeaders(): HashMap<string, string> {
830 // let headers: HashMap<string, string> = new HashMap<string, string>() 836 // let headers: HashMap<string, string> = new HashMap<string, string>()
831 // 837 //
@@ -65,6 +65,8 @@ export function registerRouter() { @@ -65,6 +65,8 @@ export function registerRouter() {
65 return WDRouterPage.audioDetail 65 return WDRouterPage.audioDetail
66 } else if (action.params?.detailPageType == 18) { 66 } else if (action.params?.detailPageType == 18) {
67 return WDRouterPage.multiPictureListPage 67 return WDRouterPage.multiPictureListPage
  68 + }else if (action.params?.detailPageType == 30) {
  69 + return WDRouterPage.themeListPage
68 } 70 }
69 return WDRouterPage.detailPlayVodPage 71 return WDRouterPage.detailPlayVodPage
70 }) 72 })
@@ -118,4 +118,6 @@ export class WDRouterPage { @@ -118,4 +118,6 @@ export class WDRouterPage {
118 static liveMorePage = new WDRouterPage("wdComponent", "ets/components/page/LiveMorePage"); 118 static liveMorePage = new WDRouterPage("wdComponent", "ets/components/page/LiveMorePage");
119 //预约更多页 119 //预约更多页
120 static reserveMorePage = new WDRouterPage("wdComponent", "ets/components/page/ReserveMorePage"); 120 static reserveMorePage = new WDRouterPage("wdComponent", "ets/components/page/ReserveMorePage");
  121 + //金刚位聚合页
  122 + static themeListPage = new WDRouterPage("wdComponent", "ets/components/page/ThemeListPage");
121 } 123 }
@@ -65,6 +65,9 @@ export class ProcessUtils { @@ -65,6 +65,9 @@ export class ProcessUtils {
65 case ContentConstants.TYPE_FIFTEEN: 65 case ContentConstants.TYPE_FIFTEEN:
66 ProcessUtils.gotoDynamicDetailPage(content); 66 ProcessUtils.gotoDynamicDetailPage(content);
67 break; 67 break;
  68 + case ContentConstants.TYPE_THIRTY:
  69 + ProcessUtils.gotoThemeListPage(content)
  70 + break;
68 default: 71 default:
69 break; 72 break;
70 } 73 }
@@ -197,6 +200,26 @@ export class ProcessUtils { @@ -197,6 +200,26 @@ export class ProcessUtils {
197 } 200 }
198 201
199 /** 202 /**
  203 + * 金刚位聚合页
  204 + * @param content
  205 + * */
  206 + private static gotoThemeListPage(content: ContentDTO) {
  207 + let taskAction: Action = {
  208 + type: 'JUMP_DETAIL_PAGE',
  209 + params: {
  210 + detailPageType: 30,
  211 + contentID: content?.objectId,
  212 + extra: {
  213 + relType: content?.relType,
  214 + relId: content?.relId,
  215 + } as ExtraDTO
  216 + } as Params,
  217 + };
  218 + WDRouterRule.jumpWithAction(taskAction)
  219 + Logger.debug(TAG, `gotoAtlasDetailPage, ${content.objectId}`);
  220 + }
  221 +
  222 + /**
200 * 图片预览页 223 * 图片预览页
201 * @param content 224 * @param content
202 * */ 225 * */
@@ -37,7 +37,6 @@ export { @@ -37,7 +37,6 @@ export {
37 postExecuteCollectRecordParams, 37 postExecuteCollectRecordParams,
38 contentListParams, 38 contentListParams,
39 postInteractAccentionOperateParams, 39 postInteractAccentionOperateParams,
40 - postRecommendListParams,  
41 contentListItem 40 contentListItem
42 } from './src/main/ets/bean/detail/MultiPictureDetailPageDTO'; 41 } from './src/main/ets/bean/detail/MultiPictureDetailPageDTO';
43 42
@@ -127,6 +126,10 @@ export { ReserveBean } from './src/main/ets/bean/live/ReserveBean'; @@ -127,6 +126,10 @@ export { ReserveBean } from './src/main/ets/bean/live/ReserveBean';
127 126
128 export { LiveInfoDTO } from './src/main/ets/bean/detail/LiveInfoDTO'; 127 export { LiveInfoDTO } from './src/main/ets/bean/detail/LiveInfoDTO';
129 128
  129 +export { postRecommendListParams } from './src/main/ets/bean/detail/postRecommendListParams';
  130 +
  131 +export { postThemeListParams } from './src/main/ets/bean/detail/postThemeListParams';
  132 +
130 export { LiveDTO } from './src/main/ets/bean/peoples/LiveDTO'; 133 export { LiveDTO } from './src/main/ets/bean/peoples/LiveDTO';
131 134
132 export { contentVideosDTO } from './src/main/ets/bean/content/contentVideosDTO'; 135 export { contentVideosDTO } from './src/main/ets/bean/content/contentVideosDTO';
@@ -178,13 +178,3 @@ export interface postInteractAccentionOperateParams { @@ -178,13 +178,3 @@ export interface postInteractAccentionOperateParams {
178 // userId: string; 178 // userId: string;
179 status: number; 179 status: number;
180 } 180 }
181 -  
182 -export interface postRecommendListParams {  
183 - imei: string;  
184 - userId ?: string;  
185 - contentId ?: string;  
186 - relId ?: string;  
187 - contentType ?: number;  
188 - recType: number;  
189 - channelId ? : string  
190 -}  
  1 +export interface postRecommendListParams {
  2 + imei: string;
  3 + userId ?: string;
  4 + contentId ?: string;
  5 + relId ?: string;
  6 + contentType ?: number;
  7 + recType: number;
  8 + channelId ? : string
  9 +}
  1 +export interface postThemeListParams {
  2 + sort: number;
  3 + pageNum: number;
  4 + pageSize: number;
  5 +}
  1 +import { ContentDTO } from 'wdBean';
  2 +import { CommonConstants ,ViewType} from 'wdConstant';
  3 +import PageViewModel from '../../viewmodel/PageViewModel';
  4 +import RefreshLayout from '../page/RefreshLayout';
  5 +import { RefreshLayoutBean } from '../page/RefreshLayoutBean';
  6 +import PageModel from '../../viewmodel/PageModel';
  7 +import { DateTimeUtils, LazyDataSource } from 'wdKit/Index';
  8 +import router from '@ohos.router';
  9 +import { CardParser } from '../CardParser';
  10 +import { channelSkeleton } from '../skeleton/channelSkeleton'
  11 +import { ErrorComponent } from '../view/ErrorComponent';
  12 +import { EmptyComponent } from '../view/EmptyComponent';
  13 +
  14 +const TAG: string = 'ThemeListPage';
  15 +
  16 +@Entry
  17 +@Component
  18 +struct ThemeListPage {
  19 + @State private pageModel: PageModel = new PageModel();
  20 + @State data: LazyDataSource<ContentDTO> = new LazyDataSource();
  21 + sort: number = 1;
  22 + currentPage: number = 1;
  23 + pageSize: number = 20;
  24 + title: string = '金刚位聚合页'
  25 +
  26 + aboutToAppear(): void {
  27 + PageViewModel.postThemeList(this.sort, this.currentPage, this.pageSize).then((liveReviewDTO) => {
  28 + console.log(`postThemeList${JSON.stringify(liveReviewDTO)}`)
  29 + this.data.push(...liveReviewDTO.list)
  30 + if(this.data.getDataArray().length > 0){
  31 + this.pageModel.viewType = ViewType.LOADED;
  32 + }else{
  33 + this.pageModel.viewType = ViewType.EMPTY
  34 + }
  35 + })
  36 + }
  37 +
  38 + build() {
  39 + Column() {
  40 + this.TabbarNormal()
  41 + if (this.pageModel.viewType == ViewType.LOADING) {
  42 + this.LoadingLayout()
  43 + } else if (this.pageModel.viewType == ViewType.ERROR) {
  44 + ErrorComponent()
  45 + } else if (this.pageModel.viewType == ViewType.EMPTY) {
  46 + EmptyComponent()
  47 + } else {
  48 + this.ListLayout()
  49 + }
  50 + }
  51 + .padding({
  52 + bottom: $r('app.float.card_comp_pagePadding_tb')
  53 + })
  54 + }
  55 + @Builder
  56 + LoadingLayout() {
  57 + channelSkeleton()
  58 + }
  59 + /*导航栏*/
  60 + @Builder
  61 + TabbarNormal() {
  62 + RelativeContainer() {
  63 + //标题栏目
  64 + Image($r('app.media.icon_arrow_left'))
  65 + .width(24)
  66 + .height(24)
  67 + .objectFit(ImageFit.Auto)
  68 + .id("back_icon")
  69 + .alignRules({
  70 + center: { anchor: "__container__", align: VerticalAlign.Center },
  71 + left: { anchor: "__container__", align: HorizontalAlign.Start }
  72 + })
  73 + .onClick(() => {
  74 + router.back()
  75 + })
  76 +
  77 + Text(this.title)// .height('42lpx')
  78 + .maxLines(1)
  79 + .id("title")
  80 + .fontSize('35lpx')
  81 + .fontWeight(400)
  82 + .fontColor($r('app.color.color_222222'))
  83 + .lineHeight('42lpx')
  84 + .alignRules({
  85 + center: { anchor: "__container__", align: VerticalAlign.Center },
  86 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  87 + })
  88 + }
  89 + .height(44)
  90 + .width('100%')
  91 + .padding({
  92 + left: $r('app.float.card_comp_pagePadding_lf'),
  93 + right: $r('app.float.card_comp_pagePadding_lf'),
  94 + })
  95 + }
  96 +
  97 + @Builder
  98 + ListLayout() {
  99 + List() {
  100 + // 下拉刷新
  101 + ListItem() {
  102 + RefreshLayout({
  103 + refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.pullDownRefreshImage,
  104 + this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight)
  105 + })
  106 + }
  107 +
  108 + LazyForEach(this.data, (contentDTO: ContentDTO, contentIndex: number) => {
  109 + ListItem() {
  110 + Column() {
  111 + CardParser({ contentDTO });
  112 + }
  113 + }
  114 + },
  115 + (contentDTO: ContentDTO, contentIndex: number) => contentDTO.pageId + contentIndex.toString()
  116 + )
  117 + }
  118 + .scrollBar(BarState.Off)
  119 + .cachedCount(8)
  120 + .height(CommonConstants.FULL_PARENT)
  121 + .onScrollIndex((start: number, end: number) => {
  122 + this.pageModel.startIndex = start;
  123 + this.pageModel.endIndex = end;
  124 + })
  125 + }
  126 +}
@@ -21,7 +21,8 @@ import { @@ -21,7 +21,8 @@ import {
21 postExecuteCollectRecordParams, 21 postExecuteCollectRecordParams,
22 postExecuteLikeParams, 22 postExecuteLikeParams,
23 postInteractAccentionOperateParams, 23 postInteractAccentionOperateParams,
24 - postRecommendListParams 24 + postRecommendListParams,
  25 + postThemeListParams
25 } from 'wdBean'; 26 } from 'wdBean';
26 import { PageUIReqBean } from '../components/page/bean/PageUIReqBean'; 27 import { PageUIReqBean } from '../components/page/bean/PageUIReqBean';
27 28
@@ -422,4 +423,17 @@ export class PageRepository { @@ -422,4 +423,17 @@ export class PageRepository {
422 Logger.info(TAG, "getPageUrl url = " + url) 423 Logger.info(TAG, "getPageUrl url = " + url)
423 return url; 424 return url;
424 } 425 }
  426 +
  427 + /**
  428 + * 获取金刚位聚合页列表
  429 + * https://pdapis.pdnews.cn/api/display/zh/c/themeList
  430 + * @param params
  431 + * @returns
  432 + * */
  433 + static postThemeList(params: postThemeListParams) {
  434 + let url = HttpUrlUtils.getThemeListUrl()
  435 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  436 + Logger.info(TAG, "postThemeList url = " + url + JSON.stringify(params))
  437 + return WDHttp.post<ResponseDTO<LiveReviewDTO>>(url, params, headers)
  438 + };
425 } 439 }
@@ -358,7 +358,7 @@ export class PageViewModel extends BaseViewModel { @@ -358,7 +358,7 @@ export class PageViewModel extends BaseViewModel {
358 async getLiveMoreUrl(type: number, pageNum: number, pageSize: number): Promise<LiveReviewDTO> { 358 async getLiveMoreUrl(type: number, pageNum: number, pageSize: number): Promise<LiveReviewDTO> {
359 return new Promise<LiveReviewDTO>((success, error) => { 359 return new Promise<LiveReviewDTO>((success, error) => {
360 Logger.info(TAG, `getLiveMoreUrl pageInfo start`); 360 Logger.info(TAG, `getLiveMoreUrl pageInfo start`);
361 - PageRepository.fetchLiveMoreUrl(type,pageNum, pageSize).then((resDTO: ResponseDTO<LiveReviewDTO>) => { 361 + PageRepository.fetchLiveMoreUrl(type, pageNum, pageSize).then((resDTO: ResponseDTO<LiveReviewDTO>) => {
362 if (!resDTO || !resDTO.data) { 362 if (!resDTO || !resDTO.data) {
363 Logger.error(TAG, 'getLiveMoreUrl then navResDTO is empty'); 363 Logger.error(TAG, 'getLiveMoreUrl then navResDTO is empty');
364 error('resDTO is empty'); 364 error('resDTO is empty');
@@ -378,6 +378,30 @@ export class PageViewModel extends BaseViewModel { @@ -378,6 +378,30 @@ export class PageViewModel extends BaseViewModel {
378 }) 378 })
379 }) 379 })
380 } 380 }
  381 +
  382 + async postThemeList(sort: number, pageNum: number, pageSize: number) : Promise<LiveReviewDTO> {
  383 + return new Promise<LiveReviewDTO>((success, error) => {
  384 + Logger.info(TAG, `postThemeList pageInfo start`);
  385 + PageRepository.postThemeList({ sort, pageNum, pageSize }).then((resDTO) => {
  386 + if (!resDTO || !resDTO.data) {
  387 + Logger.error(TAG, 'postThemeList then navResDTO is empty');
  388 + error('resDTO is empty');
  389 + return
  390 + }
  391 + if (resDTO.code != 0) {
  392 + Logger.error(TAG, `postThemeList then code:${resDTO.code}, message:${resDTO.message}`);
  393 + error('resDTO Response Code is failure');
  394 + return
  395 + }
  396 + // let navResStr = JSON.stringify(navResDTO);
  397 + Logger.info(TAG, "postThemeList then,navResDTO.timestamp:" + resDTO.timestamp, `${JSON.stringify(resDTO)}}`);
  398 + success(resDTO.data);
  399 + }).catch((err: Error) => {
  400 + Logger.error(TAG, `postThemeList catch, error.name : ${err.name}, error.message:${err.message}`);
  401 + error(err);
  402 + })
  403 + })
  404 + }
381 } 405 }
382 406
383 407
@@ -19,6 +19,7 @@ @@ -19,6 +19,7 @@
19 "components/page/PeopleShipHomePage", 19 "components/page/PeopleShipHomePage",
20 "pages/MultiPictureListPage", 20 "pages/MultiPictureListPage",
21 "components/page/LiveMorePage", 21 "components/page/LiveMorePage",
22 - "components/page/ReserveMorePage" 22 + "components/page/ReserveMorePage",
  23 + "components/page/ThemeListPage"
23 ] 24 ]
24 } 25 }