Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
yuzhilin
2024-04-23 18:48:32 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3d21a7d7497b89c266d26c18b35ee906e8800b42
3d21a7d7
1 parent
36c5e1fe
增加金刚位聚合页
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
223 additions
and
14 deletions
sight_harmony/commons/wdConstant/src/main/ets/constants/ContentConstants.ets
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
sight_harmony/commons/wdRouter/src/main/ets/router/Action2Page.ets
sight_harmony/commons/wdRouter/src/main/ets/router/WDRouterPage.ets
sight_harmony/commons/wdRouter/src/main/ets/utils/ProcessUtils.ets
sight_harmony/features/wdBean/Index.ets
sight_harmony/features/wdBean/src/main/ets/bean/detail/MultiPictureDetailPageDTO.ts
sight_harmony/features/wdBean/src/main/ets/bean/detail/postRecommendListParams.ets
sight_harmony/features/wdBean/src/main/ets/bean/detail/postThemeListParams.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/ThemeListPage.ets
sight_harmony/features/wdComponent/src/main/ets/repository/PageRepository.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageViewModel.ets
sight_harmony/features/wdComponent/src/main/resources/base/profile/main_pages.json
sight_harmony/commons/wdConstant/src/main/ets/constants/ContentConstants.ets
View file @
3d21a7d
...
...
@@ -45,5 +45,9 @@ export class ContentConstants {
*/
static readonly TYPE_FIFTEEN: string = "15";
/**
* 30:金刚位聚合页
*/
static readonly TYPE_THIRTY: string = "30";
}
\ No newline at end of file
...
...
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
View file @
3d21a7d
...
...
@@ -826,6 +826,12 @@ export class HttpUrlUtils {
return url
}
//金刚位聚合页
static getThemeListUrl() {
let url = HttpUrlUtils._hostUrl + "/api/rmrb-bff-display-zh/display/zh/c/themeList";
return url;
}
// static getYcgCommonHeaders(): HashMap<string, string> {
// let headers: HashMap<string, string> = new HashMap<string, string>()
//
...
...
sight_harmony/commons/wdRouter/src/main/ets/router/Action2Page.ets
View file @
3d21a7d
...
...
@@ -65,6 +65,8 @@ export function registerRouter() {
return WDRouterPage.audioDetail
} else if (action.params?.detailPageType == 18) {
return WDRouterPage.multiPictureListPage
}else if (action.params?.detailPageType == 30) {
return WDRouterPage.themeListPage
}
return WDRouterPage.detailPlayVodPage
})
...
...
sight_harmony/commons/wdRouter/src/main/ets/router/WDRouterPage.ets
View file @
3d21a7d
...
...
@@ -118,4 +118,6 @@ export class WDRouterPage {
static liveMorePage = new WDRouterPage("wdComponent", "ets/components/page/LiveMorePage");
//预约更多页
static reserveMorePage = new WDRouterPage("wdComponent", "ets/components/page/ReserveMorePage");
//金刚位聚合页
static themeListPage = new WDRouterPage("wdComponent", "ets/components/page/ThemeListPage");
}
...
...
sight_harmony/commons/wdRouter/src/main/ets/utils/ProcessUtils.ets
View file @
3d21a7d
...
...
@@ -65,6 +65,9 @@ export class ProcessUtils {
case ContentConstants.TYPE_FIFTEEN:
ProcessUtils.gotoDynamicDetailPage(content);
break;
case ContentConstants.TYPE_THIRTY:
ProcessUtils.gotoThemeListPage(content)
break;
default:
break;
}
...
...
@@ -197,6 +200,26 @@ export class ProcessUtils {
}
/**
* 金刚位聚合页
* @param content
* */
private static gotoThemeListPage(content: ContentDTO) {
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
detailPageType: 30,
contentID: content?.objectId,
extra: {
relType: content?.relType,
relId: content?.relId,
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
Logger.debug(TAG, `gotoAtlasDetailPage, ${content.objectId}`);
}
/**
* 图片预览页
* @param content
* */
...
...
sight_harmony/features/wdBean/Index.ets
View file @
3d21a7d
...
...
@@ -37,7 +37,6 @@ export {
postExecuteCollectRecordParams,
contentListParams,
postInteractAccentionOperateParams,
postRecommendListParams,
contentListItem
} from './src/main/ets/bean/detail/MultiPictureDetailPageDTO';
...
...
@@ -127,6 +126,10 @@ export { ReserveBean } from './src/main/ets/bean/live/ReserveBean';
export { LiveInfoDTO } from './src/main/ets/bean/detail/LiveInfoDTO';
export { postRecommendListParams } from './src/main/ets/bean/detail/postRecommendListParams';
export { postThemeListParams } from './src/main/ets/bean/detail/postThemeListParams';
export { LiveDTO } from './src/main/ets/bean/peoples/LiveDTO';
export { contentVideosDTO } from './src/main/ets/bean/content/contentVideosDTO';
...
...
sight_harmony/features/wdBean/src/main/ets/bean/detail/MultiPictureDetailPageDTO.ts
View file @
3d21a7d
...
...
@@ -177,14 +177,4 @@ export interface postInteractAccentionOperateParams {
// userType: number;
// userId: string;
status
:
number
;
}
export
interface
postRecommendListParams
{
imei
:
string
;
userId
?:
string
;
contentId
?:
string
;
relId
?:
string
;
contentType
?:
number
;
recType
:
number
;
channelId
?
:
string
}
\ No newline at end of file
...
...
sight_harmony/features/wdBean/src/main/ets/bean/detail/postRecommendListParams.ets
0 → 100644
View file @
3d21a7d
export interface postRecommendListParams {
imei: string;
userId ?: string;
contentId ?: string;
relId ?: string;
contentType ?: number;
recType: number;
channelId ? : string
}
\ No newline at end of file
...
...
sight_harmony/features/wdBean/src/main/ets/bean/detail/postThemeListParams.ets
0 → 100644
View file @
3d21a7d
export interface postThemeListParams {
sort: number;
pageNum: number;
pageSize: number;
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/ThemeListPage.ets
0 → 100644
View file @
3d21a7d
import { ContentDTO } from 'wdBean';
import { CommonConstants ,ViewType} from 'wdConstant';
import PageViewModel from '../../viewmodel/PageViewModel';
import RefreshLayout from '../page/RefreshLayout';
import { RefreshLayoutBean } from '../page/RefreshLayoutBean';
import PageModel from '../../viewmodel/PageModel';
import { DateTimeUtils, LazyDataSource } from 'wdKit/Index';
import router from '@ohos.router';
import { CardParser } from '../CardParser';
import { channelSkeleton } from '../skeleton/channelSkeleton'
import { ErrorComponent } from '../view/ErrorComponent';
import { EmptyComponent } from '../view/EmptyComponent';
const TAG: string = 'ThemeListPage';
@Entry
@Component
struct ThemeListPage {
@State private pageModel: PageModel = new PageModel();
@State data: LazyDataSource<ContentDTO> = new LazyDataSource();
sort: number = 1;
currentPage: number = 1;
pageSize: number = 20;
title: string = '金刚位聚合页'
aboutToAppear(): void {
PageViewModel.postThemeList(this.sort, this.currentPage, this.pageSize).then((liveReviewDTO) => {
console.log(`postThemeList${JSON.stringify(liveReviewDTO)}`)
this.data.push(...liveReviewDTO.list)
if(this.data.getDataArray().length > 0){
this.pageModel.viewType = ViewType.LOADED;
}else{
this.pageModel.viewType = ViewType.EMPTY
}
})
}
build() {
Column() {
this.TabbarNormal()
if (this.pageModel.viewType == ViewType.LOADING) {
this.LoadingLayout()
} else if (this.pageModel.viewType == ViewType.ERROR) {
ErrorComponent()
} else if (this.pageModel.viewType == ViewType.EMPTY) {
EmptyComponent()
} else {
this.ListLayout()
}
}
.padding({
bottom: $r('app.float.card_comp_pagePadding_tb')
})
}
@Builder
LoadingLayout() {
channelSkeleton()
}
/*导航栏*/
@Builder
TabbarNormal() {
RelativeContainer() {
//标题栏目
Image($r('app.media.icon_arrow_left'))
.width(24)
.height(24)
.objectFit(ImageFit.Auto)
.id("back_icon")
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.onClick(() => {
router.back()
})
Text(this.title)// .height('42lpx')
.maxLines(1)
.id("title")
.fontSize('35lpx')
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.lineHeight('42lpx')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
}
.height(44)
.width('100%')
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
})
}
@Builder
ListLayout() {
List() {
// 下拉刷新
ListItem() {
RefreshLayout({
refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.pullDownRefreshImage,
this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight)
})
}
LazyForEach(this.data, (contentDTO: ContentDTO, contentIndex: number) => {
ListItem() {
Column() {
CardParser({ contentDTO });
}
}
},
(contentDTO: ContentDTO, contentIndex: number) => contentDTO.pageId + contentIndex.toString()
)
}
.scrollBar(BarState.Off)
.cachedCount(8)
.height(CommonConstants.FULL_PARENT)
.onScrollIndex((start: number, end: number) => {
this.pageModel.startIndex = start;
this.pageModel.endIndex = end;
})
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/repository/PageRepository.ets
View file @
3d21a7d
...
...
@@ -21,7 +21,8 @@ import {
postExecuteCollectRecordParams,
postExecuteLikeParams,
postInteractAccentionOperateParams,
postRecommendListParams
postRecommendListParams,
postThemeListParams
} from 'wdBean';
import { PageUIReqBean } from '../components/page/bean/PageUIReqBean';
...
...
@@ -422,4 +423,17 @@ export class PageRepository {
Logger.info(TAG, "getPageUrl url = " + url)
return url;
}
/**
* 获取金刚位聚合页列表
* https://pdapis.pdnews.cn/api/display/zh/c/themeList
* @param params
* @returns
* */
static postThemeList(params: postThemeListParams) {
let url = HttpUrlUtils.getThemeListUrl()
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
Logger.info(TAG, "postThemeList url = " + url + JSON.stringify(params))
return WDHttp.post<ResponseDTO<LiveReviewDTO>>(url, params, headers)
};
}
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageViewModel.ets
View file @
3d21a7d
...
...
@@ -358,7 +358,7 @@ export class PageViewModel extends BaseViewModel {
async getLiveMoreUrl(type: number, pageNum: number, pageSize: number): Promise<LiveReviewDTO> {
return new Promise<LiveReviewDTO>((success, error) => {
Logger.info(TAG, `getLiveMoreUrl pageInfo start`);
PageRepository.fetchLiveMoreUrl(type,pageNum, pageSize).then((resDTO: ResponseDTO<LiveReviewDTO>) => {
PageRepository.fetchLiveMoreUrl(type,
pageNum, pageSize).then((resDTO: ResponseDTO<LiveReviewDTO>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'getLiveMoreUrl then navResDTO is empty');
error('resDTO is empty');
...
...
@@ -378,6 +378,30 @@ export class PageViewModel extends BaseViewModel {
})
})
}
async postThemeList(sort: number, pageNum: number, pageSize: number) : Promise<LiveReviewDTO> {
return new Promise<LiveReviewDTO>((success, error) => {
Logger.info(TAG, `postThemeList pageInfo start`);
PageRepository.postThemeList({ sort, pageNum, pageSize }).then((resDTO) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'postThemeList then navResDTO is empty');
error('resDTO is empty');
return
}
if (resDTO.code != 0) {
Logger.error(TAG, `postThemeList then code:${resDTO.code}, message:${resDTO.message}`);
error('resDTO Response Code is failure');
return
}
// let navResStr = JSON.stringify(navResDTO);
Logger.info(TAG, "postThemeList then,navResDTO.timestamp:" + resDTO.timestamp, `${JSON.stringify(resDTO)}}`);
success(resDTO.data);
}).catch((err: Error) => {
Logger.error(TAG, `postThemeList catch, error.name : ${err.name}, error.message:${err.message}`);
error(err);
})
})
}
}
...
...
sight_harmony/features/wdComponent/src/main/resources/base/profile/main_pages.json
View file @
3d21a7d
...
...
@@ -19,6 +19,7 @@
"components/page/PeopleShipHomePage"
,
"pages/MultiPictureListPage"
,
"components/page/LiveMorePage"
,
"components/page/ReserveMorePage"
"components/page/ReserveMorePage"
,
"components/page/ThemeListPage"
]
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment