陈剑华

Merge remote-tracking branch 'origin/main'

@@ -38,6 +38,17 @@ class AppLoginAuthInfo { @@ -38,6 +38,17 @@ class AppLoginAuthInfo {
38 Authorization: string = '' 38 Authorization: string = ''
39 } 39 }
40 40
  41 +interface IDataJson {
  42 + jumpType:number
  43 + jumpUrl:string
  44 + newsId:string
  45 + newsObjectLevel:string
  46 + newsObjectType:number
  47 + newsRelId:string
  48 + newsTitle:string
  49 + pageId:string
  50 +}
  51 +
41 /** 52 /**
42 * h5调用native代码 53 * h5调用native代码
43 * @param data 54 * @param data
@@ -121,6 +132,16 @@ function handleJsCallReceiveH5Data(data: Message) { @@ -121,6 +132,16 @@ function handleJsCallReceiveH5Data(data: Message) {
121 case '5': 132 case '5':
122 ProcessUtils.processPage(JSON.parse(data?.data?.dataJson || '{}')) 133 ProcessUtils.processPage(JSON.parse(data?.data?.dataJson || '{}'))
123 break; 134 break;
  135 + case '6':
  136 + let contentJson: IDataJson = JSON.parse(data?.data?.dataJson || '{}')
  137 + let content: ContentDTO = {
  138 + objectId: contentJson?.newsId,
  139 + relId: contentJson?.newsRelId,
  140 + pageId: contentJson?.pageId,
  141 + objectType: String(contentJson?.newsObjectType)
  142 + } as ContentDTO
  143 + ProcessUtils.processPage(content)
  144 + break;
124 default: 145 default:
125 break; 146 break;
126 } 147 }
@@ -134,7 +155,8 @@ function handleJsCallAppInnerLinkMethod(data: Message) { @@ -134,7 +155,8 @@ function handleJsCallAppInnerLinkMethod(data: Message) {
134 relId: urlParams.get('relId') || '', 155 relId: urlParams.get('relId') || '',
135 relType: urlParams.get('relType') || '', 156 relType: urlParams.get('relType') || '',
136 pageId: urlParams.get('pageId') || '', 157 pageId: urlParams.get('pageId') || '',
137 - objectType: '' 158 + objectType: '',
  159 + linkUrl: urlParams.get('url') || ''
138 } as ContentDTO 160 } as ContentDTO
139 if (urlParams.get('skipType') === '1') { 161 if (urlParams.get('skipType') === '1') {
140 162
@@ -18,7 +18,8 @@ @@ -18,7 +18,8 @@
18 "wdRouter": "file:../../commons/wdRouter", 18 "wdRouter": "file:../../commons/wdRouter",
19 "wdNetwork": "file:../../commons/wdNetwork", 19 "wdNetwork": "file:../../commons/wdNetwork",
20 "wdJsBridge": "file:../../commons/wdJsBridge", 20 "wdJsBridge": "file:../../commons/wdJsBridge",
21 - "wdDetailPlayApi":"file:../../features/wdDetailPlayApi",  
22 - "wdHwAbility": "file:../../features/wdHwAbility" 21 + "wdDetailPlayApi": "file:../../features/wdDetailPlayApi",
  22 + "wdHwAbility": "file:../../features/wdHwAbility",
  23 + "wdShare": "file:../../features/wdShare"
23 } 24 }
24 } 25 }
@@ -105,13 +105,13 @@ export struct ImageAndTextPageComponent { @@ -105,13 +105,13 @@ export struct ImageAndTextPageComponent {
105 $r('app.media.icon_candle'))) 105 $r('app.media.icon_candle')))
106 .width(24) 106 .width(24)
107 .height(24) 107 .height(24)
108 - .margin({ right: 5 })  
109 } 108 }
110 - if (this.interactData?.likeNum > 0) { 109 + if (this.interactData?.likeNum != 0) {
111 Text(NumberFormatterUtils.formatNumberWithWan(this.interactData?.likeNum)) 110 Text(NumberFormatterUtils.formatNumberWithWan(this.interactData?.likeNum))
112 .fontSize(16) 111 .fontSize(16)
113 .fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999') 112 .fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999')
114 .fontWeight(500) 113 .fontWeight(500)
  114 + .margin({ left: 5 })
115 } 115 }
116 } 116 }
117 .width(154) 117 .width(154)
@@ -303,7 +303,7 @@ export struct ImageAndTextPageComponent { @@ -303,7 +303,7 @@ export struct ImageAndTextPageComponent {
303 } 303 }
304 PageRepository.getContentInteract(params).then(res => { 304 PageRepository.getContentInteract(params).then(res => {
305 if (res.data) { 305 if (res.data) {
306 - this.interactData =res.data[0] 306 + this.interactData.likeNum = res.data[0]?.likeNum
307 } 307 }
308 }) 308 })
309 } 309 }
@@ -115,15 +115,6 @@ export struct BottomNavigationComponent { @@ -115,15 +115,6 @@ export struct BottomNavigationComponent {
115 .height(CommonConstants.FULL_PARENT) 115 .height(CommonConstants.FULL_PARENT)
116 .padding({ bottom: 15, left: 10, right: 10, top: 2 }) 116 .padding({ bottom: 15, left: 10, right: 10, top: 2 })
117 .aspectRatio(this.ASPECT_RATIO_1_1) 117 .aspectRatio(this.ASPECT_RATIO_1_1)
118 - .gesture(  
119 - TapGesture({ count: 2 })  
120 - .onAction((event: GestureEvent) => {  
121 - if (this.currentNavIndex === index) {  
122 - // 当前tab,双击事件  
123 - this.autoRefresh++  
124 - }  
125 - })  
126 - )  
127 118
128 Text(navItem.name) 119 Text(navItem.name)
129 .margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') }) 120 .margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') })
@@ -140,7 +131,13 @@ export struct BottomNavigationComponent { @@ -140,7 +131,13 @@ export struct BottomNavigationComponent {
140 this.barBackgroundColor = Color.White 131 this.barBackgroundColor = Color.White
141 this.currentBottomNavInfo = {} as BottomNavDTO 132 this.currentBottomNavInfo = {} as BottomNavDTO
142 } else { 133 } else {
143 - this.currentBottomNavInfo = navItem 134 + if (this.currentNavIndex === index) {
  135 + // 当前tab,单击事件
  136 + this.autoRefresh++
  137 + } else {
  138 + // 切换tab
  139 + this.currentBottomNavInfo = navItem
  140 + }
144 } 141 }
145 142
146 this.currentNavIndex = index; 143 this.currentNavIndex = index;
@@ -186,21 +183,4 @@ export struct BottomNavigationComponent { @@ -186,21 +183,4 @@ export struct BottomNavigationComponent {
186 this.assignChannel.bottomNavId = assignChannel.bottomNavId 183 this.assignChannel.bottomNavId = assignChannel.bottomNavId
187 }, 20) 184 }, 20)
188 } 185 }
189 -  
190 - /**  
191 - * 双击实现  
192 - */  
193 - // doubleClickTime: number = 0  
194 -  
195 - /**  
196 - * 双击实现  
197 - */  
198 - // private doubleClick(fun: () => void) {  
199 - // let now = DateTimeUtils.getTimeStamp()  
200 - // if (now - this.doubleClickTime < 200) {  
201 - // fun()  
202 - // } else {  
203 - // this.doubleClickTime = now  
204 - // }  
205 - // }  
206 } 186 }
@@ -31,24 +31,26 @@ export struct SearchHotsComponent{ @@ -31,24 +31,26 @@ export struct SearchHotsComponent{
31 31
32 build(){ 32 build(){
33 Column(){ 33 Column(){
34 - Row() {  
35 - Image($r('app.media.search_hot_icon'))  
36 - .width('46lpx')  
37 - .height('46lpx')  
38 - .objectFit(ImageFit.Auto)  
39 - .margin({right:'8lpx'})  
40 - .interpolation(ImageInterpolation.Medium) 34 + if(this.searchHotsData.length>0){
  35 + Row() {
  36 + Image($r('app.media.search_hot_icon'))
  37 + .width('46lpx')
  38 + .height('46lpx')
  39 + .objectFit(ImageFit.Auto)
  40 + .margin({right:'8lpx'})
  41 + .interpolation(ImageInterpolation.Medium)
41 42
42 - Text("热门搜索")  
43 - .textAlign(TextAlign.Center)  
44 - .fontWeight(FontWeight.Bold)  
45 - .fontSize('33lpx')  
46 - .lineHeight('46lpx')  
47 - .fontColor($r('app.color.color_222222'))  
48 - .height('46lpx') 43 + Text("热门搜索")
  44 + .textAlign(TextAlign.Center)
  45 + .fontWeight(FontWeight.Bold)
  46 + .fontSize('33lpx')
  47 + .lineHeight('46lpx')
  48 + .fontColor($r('app.color.color_222222'))
  49 + .height('46lpx')
  50 + }
  51 + .width('100%')
  52 + .margin({bottom:"15lpx"})
49 } 53 }
50 - .width('100%')  
51 - .margin({bottom:"15lpx"})  
52 54
53 List(){ 55 List(){
54 ForEach(this.searchHotsData,(item:SearchHotContentItem,index:number)=>{ 56 ForEach(this.searchHotsData,(item:SearchHotContentItem,index:number)=>{
@@ -43,6 +43,8 @@ export struct DetailPlayLiveCommon { @@ -43,6 +43,8 @@ export struct DetailPlayLiveCommon {
43 } 43 }
44 .height('100%') 44 .height('100%')
45 .width('100%') 45 .width('100%')
  46 + .backgroundColor(Color.Black)
  47 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
46 } 48 }
47 49
48 getLiveDetails() { 50 getLiveDetails() {
1 -import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'; 1 +import { ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index';
2 import { LiveViewModel } from '../viewModel/LiveViewModel'; 2 import { LiveViewModel } from '../viewModel/LiveViewModel';
3 import { TabComponent } from '../widgets/details/TabComponent'; 3 import { TabComponent } from '../widgets/details/TabComponent';
4 import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet'; 4 import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet';
@@ -9,6 +9,9 @@ import { router, window } from '@kit.ArkUI'; @@ -9,6 +9,9 @@ import { router, window } from '@kit.ArkUI';
9 import { devicePLSensorManager } from 'wdDetailPlayApi/Index'; 9 import { devicePLSensorManager } from 'wdDetailPlayApi/Index';
10 import { LiveCommentComponent } from 'wdComponent/Index'; 10 import { LiveCommentComponent } from 'wdComponent/Index';
11 import { WDPlayerController } from 'wdPlayer/Index'; 11 import { WDPlayerController } from 'wdPlayer/Index';
  12 +import { OperRowListView } from 'wdComponent/src/main/ets/components/view/OperRowListView';
  13 +import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
  14 +import { ResponseDTO } from 'wdNetwork/Index';
12 15
13 let TAG: string = 'DetailPlayLivePage'; 16 let TAG: string = 'DetailPlayLivePage';
14 17
@@ -29,6 +32,8 @@ export struct DetailPlayLivePage { @@ -29,6 +32,8 @@ export struct DetailPlayLivePage {
29 @Consume @Watch('onPageShowCus') pageShow: number 32 @Consume @Watch('onPageShowCus') pageShow: number
30 @Consume @Watch('onPageHideCus') pageHide: number 33 @Consume @Watch('onPageHideCus') pageHide: number
31 @Consume @Watch('onBackPressCus') pageBackPress: number 34 @Consume @Watch('onBackPressCus') pageBackPress: number
  35 + @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
  36 + @State publishCommentModel: publishCommentModel = new publishCommentModel()
32 37
33 aboutToAppear(): void { 38 aboutToAppear(): void {
34 Logger.info(TAG, `wyj-aboutToAppear`) 39 Logger.info(TAG, `wyj-aboutToAppear`)
@@ -43,6 +48,7 @@ export struct DetailPlayLivePage { @@ -43,6 +48,7 @@ export struct DetailPlayLivePage {
43 }) 48 })
44 this.getLiveDetails() 49 this.getLiveDetails()
45 this.getLiveRoomData() 50 this.getLiveRoomData()
  51 + this.getContentDetail()
46 } 52 }
47 53
48 build() { 54 build() {
@@ -52,8 +58,17 @@ export struct DetailPlayLivePage { @@ -52,8 +58,17 @@ export struct DetailPlayLivePage {
52 TabComponent({ tabs: this.tabs }) 58 TabComponent({ tabs: this.tabs })
53 .layoutWeight(503) 59 .layoutWeight(503)
54 .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) 60 .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
55 - LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum }) 61 +
  62 + OperRowListView({
  63 + operationButtonList: ['comment', 'collect', 'share', 'like'],
  64 + contentDetailData: this.contentDetailData,
  65 + publishCommentModel: this.publishCommentModel,
  66 + })
56 .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) 67 .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
  68 +
  69 +
  70 + // LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum })
  71 + // .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
57 } 72 }
58 .height('100%') 73 .height('100%')
59 .width('100%') 74 .width('100%')
@@ -91,6 +106,28 @@ export struct DetailPlayLivePage { @@ -91,6 +106,28 @@ export struct DetailPlayLivePage {
91 return true 106 return true
92 } 107 }
93 108
  109 + /**
  110 + * 查询视频详情用于评论展示
  111 + */
  112 + getContentDetail() {
  113 + this.liveViewModel.getContentDetail(this.contentId, this.relId, this.relType)
  114 + .then((data: Array<ContentDetailDTO>) => {
  115 + console.log(TAG, 'getContentDetail:', JSON.stringify(data))
  116 + if (data) {
  117 + this.contentDetailData = data?.[0];
  118 + if (this.contentDetailData?.openComment) {
  119 + this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
  120 + this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId)
  121 + this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
  122 + this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)
  123 + this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)
  124 + this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)
  125 + this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)
  126 + }
  127 + }
  128 + })
  129 + }
  130 +
94 getLiveDetails() { 131 getLiveDetails() {
95 this.liveViewModel.getLiveDetails(this.contentId, this.relId, this.relType) 132 this.liveViewModel.getLiveDetails(this.contentId, this.relId, this.relType)
96 .then( 133 .then(
@@ -34,7 +34,7 @@ export struct DetailPlayVLivePage { @@ -34,7 +34,7 @@ export struct DetailPlayVLivePage {
34 34
35 aboutToAppear(): void { 35 aboutToAppear(): void {
36 console.log(TAG, 'aboutToAppear') 36 console.log(TAG, 'aboutToAppear')
37 - WindowModel.shared.setWindowLayoutFullScreen(true) 37 + // WindowModel.shared.setWindowLayoutFullScreen(true)
38 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) 38 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
39 39
40 //https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/content/zh/c/content/detail?relId=500005302448&relType=1&contentId=20000016340 40 //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 { @@ -48,7 +48,7 @@ export struct DetailPlayVLivePage {
48 } 48 }
49 49
50 aboutToDisappear(): void { 50 aboutToDisappear(): void {
51 - WindowModel.shared.setWindowLayoutFullScreen(false) 51 + // WindowModel.shared.setWindowLayoutFullScreen(false)
52 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) 52 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
53 } 53 }
54 54
@@ -107,7 +107,8 @@ export struct DetailPlayVLivePage { @@ -107,7 +107,8 @@ export struct DetailPlayVLivePage {
107 (data) => { 107 (data) => {
108 if (data.length > 0) { 108 if (data.length > 0) {
109 this.liveDetailsBean = data[0] 109 this.liveDetailsBean = data[0]
110 - this.liveState = this.liveDetailsBean.liveInfo?.liveState //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 110 + this.liveState =
  111 + this.liveDetailsBean.liveInfo?.liveState //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
111 if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) { 112 if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) {
112 this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url 113 this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url
113 } 114 }
1 import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; 1 import { HttpUrlUtils, ResponseDTO } from 'wdNetwork';
2 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; 2 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
3 import { Logger, ToastUtils } from 'wdKit'; 3 import { Logger, ToastUtils } from 'wdKit';
4 -import { LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index'; 4 +import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index';
  5 +import { ContentDetailRequest } from 'wdDetailPlayApi/Index';
5 6
6 const TAG = 'LiveModel' 7 const TAG = 'LiveModel'
7 8
8 export class LiveModel { 9 export class LiveModel {
  10 + getContentDetail(contentId: string, relId: string, relType: string) {
  11 + return new Promise<Array<ContentDetailDTO>>((success, fail) => {
  12 + ContentDetailRequest.getContentDetail({
  13 + contentId: contentId,
  14 + relId: relId,
  15 + relType: relType
  16 + }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
  17 + console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
  18 + if (resDTO.data) {
  19 + success(resDTO.data)
  20 + }
  21 + }).catch(() => {
  22 + fail("数据为空")
  23 + })
  24 +
  25 + })
  26 +
  27 + }
  28 +
9 /** 29 /**
10 * 直播内容详情 30 * 直播内容详情
11 * @param contentId 31 * @param contentId
1 -import { LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index' 1 +import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index'
  2 +
2 import { ResponseDTO } from 'wdNetwork/Index' 3 import { ResponseDTO } from 'wdNetwork/Index'
3 import { LiveModel } from './LiveModel' 4 import { LiveModel } from './LiveModel'
4 5
@@ -11,6 +12,45 @@ export class LiveViewModel { @@ -11,6 +12,45 @@ export class LiveViewModel {
11 this.liveModel = new LiveModel() 12 this.liveModel = new LiveModel()
12 } 13 }
13 14
  15 + // 视频信息
  16 + getContentDetail(contentId: string, relId: string, relType: string) {
  17 + return new Promise<Array<ContentDetailDTO>>((success, fail) => {
  18 + this.liveModel.getContentDetail(contentId, relId, relType).then((data) => {
  19 + success(data)
  20 + }).catch((message: string) => {
  21 + fail(message)
  22 + })
  23 + })
  24 +
  25 + }
  26 +
  27 +
  28 + // async getContentDetail(contentId: string, relId: string, relType: string) {
  29 + // return ContentDetailRequest.getContentDetail({
  30 + // contentId: contentId,
  31 + // relId: relId,
  32 + // relType: relType
  33 + // }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
  34 + // console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
  35 + // if (resDTO.data) {
  36 + //
  37 + // this.contentDetailData = resDTO.data?.[0];
  38 + //
  39 + // if (this.contentDetailData?.openComment) {
  40 + // this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
  41 + // this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId)
  42 + // this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
  43 + // this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)
  44 + // this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)
  45 + // this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)
  46 + // this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)
  47 + // }
  48 + //
  49 + //
  50 + // }
  51 + // })
  52 + // }
  53 +
14 //直播详情 54 //直播详情
15 getLiveDetails(contentId: string, relId: string, relType: string) { 55 getLiveDetails(contentId: string, relId: string, relType: string) {
16 return new Promise<Array<LiveDetailsBean>>((success, fail) => { 56 return new Promise<Array<LiveDetailsBean>>((success, fail) => {