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-05-08 15:30:11 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
149d81814b8b1d2d40a80e35f3fb873c0350eca0
149d8181
2 parents
255c552b
66f7ab01
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
161 additions
and
56 deletions
sight_harmony/commons/wdWebComponent/src/main/ets/pages/JsBridgeBiz.ets
sight_harmony/features/wdComponent/oh-package.json5
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/BottomNavigationComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchHotsComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLiveCommon.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayVLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/viewModel/LiveModel.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/viewModel/LiveViewModel.ets
sight_harmony/commons/wdWebComponent/src/main/ets/pages/JsBridgeBiz.ets
View file @
149d818
...
...
@@ -38,6 +38,17 @@ class AppLoginAuthInfo {
Authorization: string = ''
}
interface IDataJson {
jumpType:number
jumpUrl:string
newsId:string
newsObjectLevel:string
newsObjectType:number
newsRelId:string
newsTitle:string
pageId:string
}
/**
* h5调用native代码
* @param data
...
...
@@ -121,6 +132,16 @@ function handleJsCallReceiveH5Data(data: Message) {
case '5':
ProcessUtils.processPage(JSON.parse(data?.data?.dataJson || '{}'))
break;
case '6':
let contentJson: IDataJson = JSON.parse(data?.data?.dataJson || '{}')
let content: ContentDTO = {
objectId: contentJson?.newsId,
relId: contentJson?.newsRelId,
pageId: contentJson?.pageId,
objectType: String(contentJson?.newsObjectType)
} as ContentDTO
ProcessUtils.processPage(content)
break;
default:
break;
}
...
...
@@ -134,7 +155,8 @@ function handleJsCallAppInnerLinkMethod(data: Message) {
relId: urlParams.get('relId') || '',
relType: urlParams.get('relType') || '',
pageId: urlParams.get('pageId') || '',
objectType: ''
objectType: '',
linkUrl: urlParams.get('url') || ''
} as ContentDTO
if (urlParams.get('skipType') === '1') {
...
...
sight_harmony/features/wdComponent/oh-package.json5
View file @
149d818
...
...
@@ -18,7 +18,8 @@
"wdRouter"
:
"file:../../commons/wdRouter"
,
"wdNetwork"
:
"file:../../commons/wdNetwork"
,
"wdJsBridge"
:
"file:../../commons/wdJsBridge"
,
"wdDetailPlayApi"
:
"file:../../features/wdDetailPlayApi"
,
"wdHwAbility"
:
"file:../../features/wdHwAbility"
"wdDetailPlayApi"
:
"file:../../features/wdDetailPlayApi"
,
"wdHwAbility"
:
"file:../../features/wdHwAbility"
,
"wdShare"
:
"file:../../features/wdShare"
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
149d818
...
...
@@ -105,13 +105,13 @@ export struct ImageAndTextPageComponent {
$r('app.media.icon_candle')))
.width(24)
.height(24)
.margin({ right: 5 })
}
if (this.interactData?.likeNum
>
0) {
if (this.interactData?.likeNum
!=
0) {
Text(NumberFormatterUtils.formatNumberWithWan(this.interactData?.likeNum))
.fontSize(16)
.fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999')
.fontWeight(500)
.margin({ left: 5 })
}
}
.width(154)
...
...
@@ -303,7 +303,7 @@ export struct ImageAndTextPageComponent {
}
PageRepository.getContentInteract(params).then(res => {
if (res.data) {
this.interactData
=res.data[0]
this.interactData
.likeNum = res.data[0]?.likeNum
}
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/BottomNavigationComponent.ets
View file @
149d818
...
...
@@ -115,15 +115,6 @@ export struct BottomNavigationComponent {
.height(CommonConstants.FULL_PARENT)
.padding({ bottom: 15, left: 10, right: 10, top: 2 })
.aspectRatio(this.ASPECT_RATIO_1_1)
.gesture(
TapGesture({ count: 2 })
.onAction((event: GestureEvent) => {
if (this.currentNavIndex === index) {
// 当前tab,双击事件
this.autoRefresh++
}
})
)
Text(navItem.name)
.margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') })
...
...
@@ -140,7 +131,13 @@ export struct BottomNavigationComponent {
this.barBackgroundColor = Color.White
this.currentBottomNavInfo = {} as BottomNavDTO
} else {
this.currentBottomNavInfo = navItem
if (this.currentNavIndex === index) {
// 当前tab,单击事件
this.autoRefresh++
} else {
// 切换tab
this.currentBottomNavInfo = navItem
}
}
this.currentNavIndex = index;
...
...
@@ -186,21 +183,4 @@ export struct BottomNavigationComponent {
this.assignChannel.bottomNavId = assignChannel.bottomNavId
}, 20)
}
/**
* 双击实现
*/
// doubleClickTime: number = 0
/**
* 双击实现
*/
// private doubleClick(fun: () => void) {
// let now = DateTimeUtils.getTimeStamp()
// if (now - this.doubleClickTime < 200) {
// fun()
// } else {
// this.doubleClickTime = now
// }
// }
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchHotsComponent.ets
View file @
149d818
...
...
@@ -31,24 +31,26 @@ export struct SearchHotsComponent{
build(){
Column(){
Row() {
Image($r('app.media.search_hot_icon'))
.width('46lpx')
.height('46lpx')
.objectFit(ImageFit.Auto)
.margin({right:'8lpx'})
.interpolation(ImageInterpolation.Medium)
if(this.searchHotsData.length>0){
Row() {
Image($r('app.media.search_hot_icon'))
.width('46lpx')
.height('46lpx')
.objectFit(ImageFit.Auto)
.margin({right:'8lpx'})
.interpolation(ImageInterpolation.Medium)
Text("热门搜索")
.textAlign(TextAlign.Center)
.fontWeight(FontWeight.Bold)
.fontSize('33lpx')
.lineHeight('46lpx')
.fontColor($r('app.color.color_222222'))
.height('46lpx')
Text("热门搜索")
.textAlign(TextAlign.Center)
.fontWeight(FontWeight.Bold)
.fontSize('33lpx')
.lineHeight('46lpx')
.fontColor($r('app.color.color_222222'))
.height('46lpx')
}
.width('100%')
.margin({bottom:"15lpx"})
}
.width('100%')
.margin({bottom:"15lpx"})
List(){
ForEach(this.searchHotsData,(item:SearchHotContentItem,index:number)=>{
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLiveCommon.ets
View file @
149d818
...
...
@@ -43,6 +43,8 @@ export struct DetailPlayLiveCommon {
}
.height('100%')
.width('100%')
.backgroundColor(Color.Black)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
getLiveDetails() {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
View file @
149d818
import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index';
import {
ContentDetailDTO,
LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index';
import { LiveViewModel } from '../viewModel/LiveViewModel';
import { TabComponent } from '../widgets/details/TabComponent';
import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet';
...
...
@@ -9,6 +9,9 @@ import { router, window } from '@kit.ArkUI';
import { devicePLSensorManager } from 'wdDetailPlayApi/Index';
import { LiveCommentComponent } from 'wdComponent/Index';
import { WDPlayerController } from 'wdPlayer/Index';
import { OperRowListView } from 'wdComponent/src/main/ets/components/view/OperRowListView';
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
import { ResponseDTO } from 'wdNetwork/Index';
let TAG: string = 'DetailPlayLivePage';
...
...
@@ -29,6 +32,8 @@ export struct DetailPlayLivePage {
@Consume @Watch('onPageShowCus') pageShow: number
@Consume @Watch('onPageHideCus') pageHide: number
@Consume @Watch('onBackPressCus') pageBackPress: number
@State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@State publishCommentModel: publishCommentModel = new publishCommentModel()
aboutToAppear(): void {
Logger.info(TAG, `wyj-aboutToAppear`)
...
...
@@ -43,6 +48,7 @@ export struct DetailPlayLivePage {
})
this.getLiveDetails()
this.getLiveRoomData()
this.getContentDetail()
}
build() {
...
...
@@ -52,8 +58,17 @@ export struct DetailPlayLivePage {
TabComponent({ tabs: this.tabs })
.layoutWeight(503)
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum })
OperRowListView({
operationButtonList: ['comment', 'collect', 'share', 'like'],
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
})
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
// LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum })
// .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
}
.height('100%')
.width('100%')
...
...
@@ -91,6 +106,28 @@ export struct DetailPlayLivePage {
return true
}
/**
* 查询视频详情用于评论展示
*/
getContentDetail() {
this.liveViewModel.getContentDetail(this.contentId, this.relId, this.relType)
.then((data: Array<ContentDetailDTO>) => {
console.log(TAG, 'getContentDetail:', JSON.stringify(data))
if (data) {
this.contentDetailData = data?.[0];
if (this.contentDetailData?.openComment) {
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId)
this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)
this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)
this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)
this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)
}
}
})
}
getLiveDetails() {
this.liveViewModel.getLiveDetails(this.contentId, this.relId, this.relType)
.then(
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayVLivePage.ets
View file @
149d818
...
...
@@ -34,7 +34,7 @@ export struct DetailPlayVLivePage {
aboutToAppear(): void {
console.log(TAG, 'aboutToAppear')
WindowModel.shared.setWindowLayoutFullScreen(true)
//
WindowModel.shared.setWindowLayoutFullScreen(true)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
//https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/content/zh/c/content/detail?relId=500005302448&relType=1&contentId=20000016340
...
...
@@ -48,7 +48,7 @@ export struct DetailPlayVLivePage {
}
aboutToDisappear(): void {
WindowModel.shared.setWindowLayoutFullScreen(false)
//
WindowModel.shared.setWindowLayoutFullScreen(false)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}
...
...
@@ -107,7 +107,8 @@ export struct DetailPlayVLivePage {
(data) => {
if (data.length > 0) {
this.liveDetailsBean = data[0]
this.liveState = this.liveDetailsBean.liveInfo?.liveState //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
this.liveState =
this.liveDetailsBean.liveInfo?.liveState //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) {
this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url
}
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/viewModel/LiveModel.ets
View file @
149d818
import { HttpUrlUtils, ResponseDTO } from 'wdNetwork';
import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
import { Logger, ToastUtils } from 'wdKit';
import { LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index';
import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index';
import { ContentDetailRequest } from 'wdDetailPlayApi/Index';
const TAG = 'LiveModel'
export class LiveModel {
getContentDetail(contentId: string, relId: string, relType: string) {
return new Promise<Array<ContentDetailDTO>>((success, fail) => {
ContentDetailRequest.getContentDetail({
contentId: contentId,
relId: relId,
relType: relType
}).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
if (resDTO.data) {
success(resDTO.data)
}
}).catch(() => {
fail("数据为空")
})
})
}
/**
* 直播内容详情
* @param contentId
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/viewModel/LiveViewModel.ets
View file @
149d818
import { LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index'
import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index'
import { ResponseDTO } from 'wdNetwork/Index'
import { LiveModel } from './LiveModel'
...
...
@@ -11,6 +12,45 @@ export class LiveViewModel {
this.liveModel = new LiveModel()
}
// 视频信息
getContentDetail(contentId: string, relId: string, relType: string) {
return new Promise<Array<ContentDetailDTO>>((success, fail) => {
this.liveModel.getContentDetail(contentId, relId, relType).then((data) => {
success(data)
}).catch((message: string) => {
fail(message)
})
})
}
// async getContentDetail(contentId: string, relId: string, relType: string) {
// return ContentDetailRequest.getContentDetail({
// contentId: contentId,
// relId: relId,
// relType: relType
// }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
// console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
// if (resDTO.data) {
//
// this.contentDetailData = resDTO.data?.[0];
//
// if (this.contentDetailData?.openComment) {
// this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
// this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId)
// this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
// this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)
// this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)
// this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)
// this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)
// }
//
//
// }
// })
// }
//直播详情
getLiveDetails(contentId: string, relId: string, relType: string) {
return new Promise<Array<LiveDetailsBean>>((success, fail) => {
...
...
Please
register
or
login
to post a comment