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
王士厅
2024-04-01 17:34:36 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
e6127b79c1cfac21277df8af5ff6e41a9f8b8a75
e6127b79
2 parents
f13c4f62
f4f05ea1
Merge branch 'main' of
http://192.168.1.42/developOne/harmonyPool
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
99 additions
and
19 deletions
sight_harmony/features/wdBean/src/main/ets/bean/detail/InteractDataDTO.ts
sight_harmony/features/wdDetailPlayApi/src/main/ets/request/ContentDetailRequest.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailPlayShortVideoPage.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailVideoListPage.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/OperationListView.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/ic_add.png
sight_harmony/features/wdBean/src/main/ets/bean/detail/InteractDataDTO.ts
0 → 100644
View file @
e6127b7
/**
* 点赞、已读、分享数量
*/
export
interface
InteractDataDTO
{
collectNum
:
number
;
commentNum
:
number
;
contentType
:
number
;
likeNum
:
number
;
readNum
:
number
;
shareNum
:
number
;
contentId
:
string
;
}
...
...
sight_harmony/features/wdDetailPlayApi/src/main/ets/request/ContentDetailRequest.ets
View file @
e6127b7
import { Logger, ResourcesUtils } from 'wdKit';
import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
import { ContentDetailDTO } from 'wdBean';
import { ContentDetailDTO
, InteractDataDTO
} from 'wdBean';
import HashMap from '@ohos.util.HashMap';
const TAG = 'ContentDetailRequest';
...
...
@@ -18,6 +18,15 @@ export interface recommentVideoListParame {
refreshCnt: number;
}
interface contentListItem {
contentId: string;
contentType: number;
}
export interface contentListParams {
contentList: contentListItem[];
}
export class ContentDetailRequest {
static getContentDetailDataMock(context: Context): Promise<ResponseDTO<ContentDetailDTO[]>> {
...
...
@@ -55,10 +64,10 @@ export class ContentDetailRequest {
*
* @returns
*/
static getContentInteract(
)
{
static getContentInteract(
params: contentListParams): Promise<ResponseDTO<InteractDataDTO[]>>
{
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.
get(url
, headers)
return WDHttp.
post0(url, params
, headers)
}
/**
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailPlayShortVideoPage.ets
View file @
e6127b7
import router from '@ohos.router';
import mediaquery from '@ohos.mediaquery';
import window from '@ohos.window';
import { Action, ContentDetailDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean';
import { Action, ContentDetailDTO,
InteractDataDTO,
RmhInfoDTO, UserInfoDTO } from 'wdBean';
import { Logger, SPHelper, WindowModel } from 'wdKit';
import { PlayerConstants, WDPlayerController, WDPlayerRenderView } from 'wdPlayer';
import { devicePLSensorManager } from 'wdDetailPlayApi';
...
...
@@ -22,6 +22,7 @@ export struct DetailPlayShortVideoPage {
private relId?: string = undefined
private relType?: string = undefined
private contentDetailData: ContentDetailDTO | undefined = undefined
@Provide interactData: InteractDataDTO | undefined = undefined
@Prop @Watch('currentIndexChange') currentIndex: number = 0
private index: number = 0
private playerController: WDPlayerController = new WDPlayerController();
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailVideoListPage.ets
View file @
e6127b7
import { Action, ContentDetailDTO } from 'wdBean/Index';
import { Action, ContentDetailDTO
, InteractDataDTO
} from 'wdBean/Index';
import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
import { ResponseDTO } from 'wdNetwork/Index';
import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage'
import { Test } from './Test'
import router from '@ohos.router';
import window from '@ohos.window';
import { contentListParams } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
@Entry
@Component
...
...
@@ -16,6 +18,7 @@ export struct DetailVideoListPage {
@State data: ContentDetailDTO[] = []
@State testData: string[] = ['111', '222', '333']
@State currentIndex: number = 0
@State interactDataList: InteractDataDTO[] = []
async aboutToAppear(): Promise<void> {
console.error('=================',)
...
...
@@ -47,11 +50,32 @@ export struct DetailVideoListPage {
if (res.data) {
data = data.concat(res.data)
}
// this.data = res.data || []
console.log('res1===', JSON.stringify(res))
console.log('res==' + this.data)
})
if (data.length > 0) {
const params: contentListParams = {
contentList: []
}
data.map(item => {
params.contentList.push({
contentId: item.newsId + '',
contentType: item.newsType
})
})
// 批量查询内容当前用户点赞、收藏状态
await ContentDetailRequest.getContentInteract(params).then(res => {
if (res.data) {
this.interactDataList = res.data || []
}
console.log('获取互动点赞等数据===', JSON.stringify(res))
})
// 查询各类型内容动态数据接口V2
}
this.data = data
console.error('aboutToAppear===', this.data.length)
...
...
@@ -67,7 +91,8 @@ export struct DetailVideoListPage {
DetailPlayShortVideoPage({
contentDetailData: item,
currentIndex: this.currentIndex,
index: index
index: index,
interactData: this.interactDataList[index]
})
}.width('100%')
.height('100%')
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/OperationListView.ets
View file @
e6127b7
import { RmhInfoDTO, UserInfoDTO } from 'wdBean/Index';
import {
InteractDataDTO,
RmhInfoDTO, UserInfoDTO } from 'wdBean/Index';
import { ToastUtils } from 'wdKit';
export interface OperationItem {
...
...
@@ -13,25 +13,27 @@ const FULL_PARENT: string = '100%';
const TAG = 'OperationListView';
@Preview
@Component
export struct OperationListView {
@Consume rmhInfo?: RmhInfoDTO
@Consume userInfo?: UserInfoDTO
@Consume interactData: InteractDataDTO
@State operationList: OperationItem[] = [
{
icon: $r('app.media.ic_like_uncheck'),
text: "赞",
num: 6622
//
num: 6622
},
{
icon: $r('app.media.ic_collect_uncheck'),
text: "收藏",
num: 662,
//
num: 662,
},
{
icon: $r('app.media.ic_comment'),
text: "评论",
num: 500,
text: "抢首评",
// num: 500,
},
{
icon: $r('app.media.ic_share'),
...
...
@@ -76,11 +78,12 @@ export struct OperationListView {
buildUserComp() {
Column() {
Image(this.rmhInfo?.rmhHeadUrl || this.userInfo?.userHeadUrl)
.width(
48
)
.width(
'100%'
)
.borderRadius(24)
.aspectRatio(1)
// .margin(18)
}
.border({ width: 1, color: Color.White, style: BorderStyle.Solid })
.margin({ bottom: 30 })
}.width(48)
}
/**
...
...
@@ -92,20 +95,50 @@ export struct OperationListView {
buildOperationItem(item: OperationItem, index: number) {
Column() {
Image(item.icon)
.width(
'100%'
)
.width(
32
)
.aspectRatio(1)
// .borderRadius(6)
if (item.text === '赞') {
Text(this.interactData.likeNum ? (this.interactData.likeNum + '') : item.text)
.width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
.fontWeight(500)
.textAlign(TextAlign.Center)
.fontSize(13)
.fontColor('#FFFFFF')
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
} else if (item.text === '收藏') {
Text(this.interactData.collectNum ? (this.interactData.collectNum + '') : item.text)
.width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
.fontWeight(500)
.textAlign(TextAlign.Center)
.fontSize(13)
.fontColor('#FFFFFF')
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
} else if (item.text === '抢首评') {
Text(this.interactData.commentNum ? (this.interactData.commentNum + '') : item.text)
.width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
.fontWeight(500)
.textAlign(TextAlign.Center)
.fontSize(13)
.fontColor('#FFFFFF')
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
} else {
Text(item.text)
.width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
.fontWeight(FontWeight.Normal
)
.fontWeight(500
)
.textAlign(TextAlign.Center)
.fontSize(13)
.fontColor('#FFFFFF')
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}
.margin(5)
}
.width(32)
.margin({ bottom: 20 })
// .backgroundColor(Color.Black)
.alignItems(HorizontalAlign.Center)
.hoverEffect(HoverEffect.Scale)
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/ic_add.png
0 → 100644
View file @
e6127b7
2.17 KB
Please
register
or
login
to post a comment