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
liujian1_wd
2024-02-03 19:47:48 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d2b172398cf0f5e1023194bcc6bfcf9f3c09773f
d2b17239
1 parent
db6cab48
图文详情页面
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
21 deletions
sight_harmony/wdComponent/src/main/ets/components/page/CardView.ets
sight_harmony/wdComponent/src/main/ets/components/view/SingleImageCardComponent.ets
sight_harmony/wdComponent/src/main/ets/utils/ProcessUtils.ets
sight_harmony/wdDetailPlayApi/src/main/ets/request/ContentDetailRequest.ets
sight_harmony/wdDetailPlayShortVideo/src/main/ets/pages/DetailPlayShortVideoPage.ets
sight_harmony/wdDetailPlayShortVideo/src/main/ets/viewmodel/PlayViewModel.ets
sight_harmony/wdComponent/src/main/ets/components/page/CardView.ets
View file @
d2b1723
...
...
@@ -3,6 +3,8 @@ import { CommonConstants, ConfigConstants, ScreenType } from 'wdConstant';
import { Logger } from 'wdKit';
import { CompUtils } from '../../utils/CompUtils';
import { WDRouterRule } from 'wdRouter';
import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO';
import { ProcessUtils } from '../../utils/ProcessUtils';
const TAG: string = 'CardView';
...
...
@@ -71,22 +73,7 @@ export struct CarouselLayout01CardView {
.hoverEffect(HoverEffect.Scale)
.onClick((event: ClickEvent) => {
Logger.info(TAG, `BannerComponent onClick event index: ${this.index}`);
// let taskAction: Action = {
// type: 'JUMP_H5_BY_WEB_VIEW',
// params: {
// url: ConfigConstants.DETAIL_URL
// } as Params,
// };
// WDRouterRule.jumpWithAction(taskAction)
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
detailPageType: 7, // 沉浸式竖屏详情页
contentID: '863556812'
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
ProcessUtils.processPage(this.item)
})
}
}
...
...
sight_harmony/wdComponent/src/main/ets/components/view/SingleImageCardComponent.ets
View file @
d2b1723
import { CompDTO } from 'wdBean';
import { Action, CompDTO, Params } from 'wdBean';
import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO';
import { WDRouterRule } from 'wdRouter';
import { ProcessUtils } from '../../utils/ProcessUtils';
const TAG = 'SingleImageCardComponent';
...
...
sight_harmony/wdComponent/src/main/ets/utils/ProcessUtils.ets
View file @
d2b1723
...
...
@@ -30,7 +30,7 @@ export class ProcessUtils {
break;
case ContentConstants.TYPE_VOD:
Logger.debug(TAG, "processPage, nonsupport!!!");
// TODO 待对接更多页面
ProcessUtils.gotoVod(content)
break;
case ContentConstants.TYPE_TELETEXT:
// 图文详情,跳转h5
...
...
@@ -67,4 +67,20 @@ export class ProcessUtils {
WDRouterRule.jumpWithAction(taskAction)
Logger.debug(TAG, `gotoWeb, ${content.objectId}`);
}
private static gotoVod(content: ContentDTO) {
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
detailPageType: 7,
contentID: content?.objectId,
extra:{
relType: content?.relType,
relId: content?.relId,
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
Logger.debug(TAG, `gotoVod, ${content.objectId}`);
}
}
\ No newline at end of file
...
...
sight_harmony/wdDetailPlayApi/src/main/ets/request/ContentDetailRequest.ets
View file @
d2b1723
import { Logger, ResourcesUtils } from 'wdKit';
import { ResponseDTO, WDHttp } from 'wdNetwork'
import {
HttpUrlUtils,
ResponseDTO, WDHttp } from 'wdNetwork'
import { ContentDetailDTO } from 'wdBean'
import HashMap from '@ohos.util.HashMap';
const TAG = 'ContentDetailRequest';
...
...
@@ -40,6 +41,7 @@ export class ContentDetailRequest {
return ContentDetailRequest.getContentDetailDataMock(getContext());
}
let url = ContentDetailRequest.getContentDetailUrl(params.contentId, params.relId, params.relType)
return WDHttp.get<ResponseDTO<ContentDetailDTO[]>>(url)
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.get<ResponseDTO<ContentDetailDTO[]>>(url, headers)
}
}
\ No newline at end of file
...
...
sight_harmony/wdDetailPlayShortVideo/src/main/ets/pages/DetailPlayShortVideoPage.ets
View file @
d2b1723
...
...
@@ -19,6 +19,8 @@ const TAG = 'DetailPlayShortVideoPage';
@Component
export struct DetailPlayShortVideoPage {
private contentId?: string = undefined
private relId?:string = undefined
private relType?:string = undefined
private playerController: WDPlayerController = new WDPlayerController();
@Watch("urlChanged") @State url?: string = undefined
@Watch('changeContinue') @Provide nextContId?: string = '';
...
...
@@ -44,7 +46,12 @@ export struct DetailPlayShortVideoPage {
let action: Action = router.getParams() as Action
if (action) {
this.contentId = action.params?.contentID
if (action.params && action.params.extra){
this.relId = action.params.extra.relId
this.relType = action.params.extra.relType
}
}
// 设置播放地址
// this.url = 'https://media.w3.org/2010/05/sintel/trailer.mp4'
let listener = mediaquery.matchMediaSync('(orientation: landscape)');
...
...
@@ -77,7 +84,9 @@ export struct DetailPlayShortVideoPage {
WDPlayerRenderView({
playerController: this.playerController,
onLoad: async () => {
this.playVM.playWithContentId(this.contentId ?? "846899373")
// this.playVM.playWithContentId(this.contentId ?? "846899373")
this.playVM.playWithIds(this.contentId ?? "846899373",
this.relId ?? "500000301942", this.relType ?? "1")
}
})
.height('100%')
...
...
sight_harmony/wdDetailPlayShortVideo/src/main/ets/viewmodel/PlayViewModel.ets
View file @
d2b1723
...
...
@@ -31,6 +31,13 @@ export class PlayViewModel {
this.getContentDetailData() // 包括播放地址PlayUrl
}
playWithIds(contentId: string, relId: string, relType: string) {
this.contentId = contentId;
this.relId = relId;
this.relType = relType;
this.getContentDetailData() // 包括播放地址PlayUrl
}
getContentDetailData() {
ContentDetailRequest.getContentDetail({
contentId: this.contentId,
...
...
Please
register
or
login
to post a comment