陈剑华

Merge remote-tracking branch 'origin/main'

Showing 22 changed files with 182 additions and 141 deletions
@@ -5,6 +5,7 @@ import { @@ -5,6 +5,7 @@ import {
5 EmitterUtils, 5 EmitterUtils,
6 EmitterEventId, 6 EmitterEventId,
7 NetworkUtil, 7 NetworkUtil,
  8 + ToastUtils,
8 } from 'wdKit'; 9 } from 'wdKit';
9 import { 10 import {
10 Action, 11 Action,
@@ -242,7 +243,7 @@ export struct H5NewsWebPageComponent { @@ -242,7 +243,7 @@ export struct H5NewsWebPageComponent {
242 PageRepository.postExecuteLike(params).then(res => { 243 PageRepository.postExecuteLike(params).then(res => {
243 // console.log(TAG, '点赞、res', JSON.stringify(res)) 244 // console.log(TAG, '点赞、res', JSON.stringify(res))
244 console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) 245 console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
245 - if (this.newsStatusOfUser) { 246 + if (this.newsStatusOfUser && res.code == 0) {
246 //内容点赞、取消点赞Tracking 1点赞 0取消点赞 247 //内容点赞、取消点赞Tracking 1点赞 0取消点赞
247 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' 248 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
248 if (this.newsStatusOfUser.likeStatus === '1') { 249 if (this.newsStatusOfUser.likeStatus === '1') {
@@ -257,7 +258,6 @@ export struct H5NewsWebPageComponent { @@ -257,7 +258,6 @@ export struct H5NewsWebPageComponent {
257 // 初次进入详情页偶现获取失败,重新获取newsStatusOfUser对象 258 // 初次进入详情页偶现获取失败,重新获取newsStatusOfUser对象
258 this.getInteractDataStatus() 259 this.getInteractDataStatus()
259 } 260 }
260 -  
261 }) 261 })
262 } 262 }
263 263
@@ -450,24 +450,20 @@ export struct ImageAndTextPageComponent { @@ -450,24 +450,20 @@ export struct ImageAndTextPageComponent {
450 PageRepository.postExecuteLike(params).then(res => { 450 PageRepository.postExecuteLike(params).then(res => {
451 // console.log(TAG, '点赞、res', JSON.stringify(res)) 451 // console.log(TAG, '点赞、res', JSON.stringify(res))
452 // console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) 452 // console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
453 - if (res.code != 0){  
454 - ToastUtils.showToast(res.message, 1000);  
455 - }else {  
456 - if (this.newsStatusOfUser) {  
457 - //内容点赞、取消点赞Tracking 1点赞 0取消点赞  
458 - this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'  
459 - if (this.newsStatusOfUser.likeStatus === '1') {  
460 - this.likeNum = Number(this.likeNum) + 1  
461 - } else {  
462 - this.likeNum = Number(this.likeNum) - 1  
463 - }  
464 - // console.log(TAG, '点赞newsStatusOfUser.likeStatus ', this.newsStatusOfUser.likeStatus)  
465 - // this.queryContentInteractCount()  
466 - TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My) 453 + if (this.newsStatusOfUser && res.code == 0) {
  454 + //内容点赞、取消点赞Tracking 1点赞 0取消点赞
  455 + this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
  456 + if (this.newsStatusOfUser.likeStatus === '1') {
  457 + this.likeNum = Number(this.likeNum) + 1
467 } else { 458 } else {
468 - // 初次进入详情页偶现获取失败,重新获取newsStatusOfUser对象  
469 - this.getInteractDataStatus() 459 + this.likeNum = Number(this.likeNum) - 1
470 } 460 }
  461 + // console.log(TAG, '点赞newsStatusOfUser.likeStatus ', this.newsStatusOfUser.likeStatus)
  462 + // this.queryContentInteractCount()
  463 + TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My)
  464 + } else {
  465 + // 初次进入详情页偶现获取失败,重新获取newsStatusOfUser对象
  466 + this.getInteractDataStatus()
471 } 467 }
472 }) 468 })
473 } 469 }
@@ -249,8 +249,7 @@ export struct MorningEveningPaperComponent { @@ -249,8 +249,7 @@ export struct MorningEveningPaperComponent {
249 // 图片转换为PixelMap对象 249 // 图片转换为PixelMap对象
250 // const pixelMap: image.PixelMap = await image2PixelMap(item.icon); 250 // const pixelMap: image.PixelMap = await image2PixelMap(item.icon);
251 // console.log(TAG, "compInfoBean compStyle = " + imageUrl) 251 // console.log(TAG, "compInfoBean compStyle = " + imageUrl)
252 -  
253 - if (this.pageInfoBean.backgroundColor.length > 0){ 252 + if (this.pageInfoBean.backgroundColor.length > 0 && this.pageInfoBean.topicInfo?.frontLinkObject != undefined){
254 let colorDatas = ColorUtils.hexColorValueToRGB(this.pageInfoBean.backgroundColor) 253 let colorDatas = ColorUtils.hexColorValueToRGB(this.pageInfoBean.backgroundColor)
255 let color = ColorUtils.getMorningEveningPaperRgb({red:colorDatas[0],green:colorDatas[1],blue:colorDatas[2],alpha:1}) 254 let color = ColorUtils.getMorningEveningPaperRgb({red:colorDatas[0],green:colorDatas[1],blue:colorDatas[2],alpha:1})
256 this.mixedBgColor = "#ff" + color.red.toString(16).padStart(2,'0') + color.green.toString(16).padStart(2,'0') + color.blue.toString(16).padStart(2,'0'); 255 this.mixedBgColor = "#ff" + color.red.toString(16).padStart(2,'0') + color.green.toString(16).padStart(2,'0') + color.blue.toString(16).padStart(2,'0');
@@ -258,6 +257,7 @@ export struct MorningEveningPaperComponent { @@ -258,6 +257,7 @@ export struct MorningEveningPaperComponent {
258 } 257 }
259 258
260 if (imageUrl.length > 0 && this.pageInfoBean.topicInfo.frontFlag === 1) { 259 if (imageUrl.length > 0 && this.pageInfoBean.topicInfo.frontFlag === 1) {
  260 +
261 const imageSource: image.ImageSource | undefined = await getPicture(imageUrl) 261 const imageSource: image.ImageSource | undefined = await getPicture(imageUrl)
262 this.pickColor(imageSource) 262 this.pickColor(imageSource)
263 } else { 263 } else {
@@ -146,6 +146,7 @@ export struct CommentTabComponent { @@ -146,6 +146,7 @@ export struct CommentTabComponent {
146 this.publishCommentModel.rootCommentId = '-1'; 146 this.publishCommentModel.rootCommentId = '-1';
147 this.publishCommentModel.parentId = '-1'; 147 this.publishCommentModel.parentId = '-1';
148 this.publishCommentModel.placeHolderText = "说两句..." 148 this.publishCommentModel.placeHolderText = "说两句..."
  149 + this.publishCommentModel.visitorComment = String(this.contentDetail?.visitorComment || '')
149 if (this.contentDetail.bestNoticer === 1) { 150 if (this.contentDetail.bestNoticer === 1) {
150 this.publishCommentModel.placeHolderText = "优质评论会获得最佳评论人的称号" 151 this.publishCommentModel.placeHolderText = "优质评论会获得最佳评论人的称号"
151 } 152 }
@@ -113,7 +113,7 @@ export default struct MinePageUserSimpleInfoUI { @@ -113,7 +113,7 @@ export default struct MinePageUserSimpleInfoUI {
113 .margin({ left: 0,top:8 }) 113 .margin({ left: 0,top:8 })
114 .backgroundImage($r("app.media.mine_grade_bg")) 114 .backgroundImage($r("app.media.mine_grade_bg"))
115 .backgroundImageSize(ImageSize.FILL) 115 .backgroundImageSize(ImageSize.FILL)
116 - .padding({left: 6,right: 6}) 116 + .padding({left: 9,right: 9})
117 .height(16) 117 .height(16)
118 } 118 }
119 } 119 }
@@ -45,7 +45,7 @@ export struct ChildCommentComponent { @@ -45,7 +45,7 @@ export struct ChildCommentComponent {
45 .fontColor($r('app.color.color_222222')) 45 .fontColor($r('app.color.color_222222'))
46 .margin({ bottom: 1 }) 46 .margin({ bottom: 1 })
47 .maxLines(1) 47 .maxLines(1)
48 - Text(DateTimeUtils.getCommentTime(DateTimeUtils.getDateTimestamp(this.data.createTime))) 48 + Text(`${this.data.createTime}`)
49 .fontColor($r('app.color.color_B0B0B0')) 49 .fontColor($r('app.color.color_B0B0B0'))
50 .fontSize(12) 50 .fontSize(12)
51 .lineHeight(16) 51 .lineHeight(16)
@@ -626,7 +626,7 @@ export struct PaperSingleColumn999CardView { @@ -626,7 +626,7 @@ export struct PaperSingleColumn999CardView {
626 } 626 }
627 627
628 async aboutToAppear(): Promise<void> { 628 async aboutToAppear(): Promise<void> {
629 - // this.loadImg = await onlyWifiLoadImg(); 629 + this.loadImg = await onlyWifiLoadImg();
630 this.onChangeCommentList() 630 this.onChangeCommentList()
631 this.isRead = hasClicked(this.item.objectId, '') 631 this.isRead = hasClicked(this.item.objectId, '')
632 } 632 }
@@ -137,19 +137,13 @@ export struct PeopleShipHomeArticleListComponent { @@ -137,19 +137,13 @@ export struct PeopleShipHomeArticleListComponent {
137 } 137 }
138 138
139 aboutToAppear() { 139 aboutToAppear() {
140 - console.log(TAG, 'cj2024 aboutToAppear')  
141 - AppStorage.setOrCreate<string>('peopleShipHomeCreatorId', this.creatorId) 140 + // console.log(TAG, 'cj2024 aboutToAppear')
142 if (this.currentIndex == this.currentTopSelectedIndex) { 141 if (this.currentIndex == this.currentTopSelectedIndex) {
143 this.currentPage = 1 142 this.currentPage = 1
144 this.getPeopleShipPageArticleList() 143 this.getPeopleShipPageArticleList()
145 } 144 }
146 } 145 }
147 146
148 - aboutToDisappear(): void {  
149 - console.log(TAG, 'cj2024 aboutToDisappear')  
150 - AppStorage.setOrCreate<string>('peopleShipHomeCreatorId', '') //清空人民号动态等过来的数据  
151 - }  
152 -  
153 onChange() { 147 onChange() {
154 if (this.currentIndex == this.currentTopSelectedIndex && this.arr.length == 0) { 148 if (this.currentIndex == this.currentTopSelectedIndex && this.arr.length == 0) {
155 this.currentPage = 1 149 this.currentPage = 1
@@ -159,7 +153,7 @@ export struct PeopleShipHomeArticleListComponent { @@ -159,7 +153,7 @@ export struct PeopleShipHomeArticleListComponent {
159 153
160 154
161 private async getPeopleShipPageArticleList(resolve?: (value: string | PromiseLike<string>) => void) { 155 private async getPeopleShipPageArticleList(resolve?: (value: string | PromiseLike<string>) => void) {
162 - Logger.info(`获取页面信息PeopleShipHomeArticleListComponent${this.typeModel.type}`) 156 + // Logger.info(`获取页面信息PeopleShipHomeArticleListComponent${this.typeModel.type}`)
163 if (this.isLoading) { 157 if (this.isLoading) {
164 if (resolve) { 158 if (resolve) {
165 resolve('') 159 resolve('')
@@ -169,8 +163,8 @@ export struct PeopleShipHomeArticleListComponent { @@ -169,8 +163,8 @@ export struct PeopleShipHomeArticleListComponent {
169 try { 163 try {
170 this.isLoading = true 164 this.isLoading = true
171 let listData: ArticleListData = await PeopleShipHomePageDataModel.getPeopleShipHomePageArticleListData(this.creatorId, this.currentPage, 20, this.typeModel.type) 165 let listData: ArticleListData = await PeopleShipHomePageDataModel.getPeopleShipHomePageArticleListData(this.creatorId, this.currentPage, 20, this.typeModel.type)
172 - Logger.debug(TAG, `获取页面信息, ${JSON.stringify(listData.list)}`);  
173 - Logger.debug(TAG, `已更新值最新, ${this.currentPage}`); 166 + // Logger.debug(TAG, `获取页面信息, ${JSON.stringify(listData.list)}`);
  167 + // Logger.debug(TAG, `已更新值最新, ${this.currentPage}`);
174 168
175 if (resolve ) { 169 if (resolve ) {
176 if (this.currentPage == 1) { 170 if (this.currentPage == 1) {
@@ -196,7 +190,7 @@ export struct PeopleShipHomeArticleListComponent { @@ -196,7 +190,7 @@ export struct PeopleShipHomeArticleListComponent {
196 if (listData.totalCount === 0) { 190 if (listData.totalCount === 0) {
197 this.viewType = 4 191 this.viewType = 4
198 } 192 }
199 - Logger.debug(TAG, '展示的总数'+`${this.arr.length}`) 193 + // Logger.debug(TAG, '展示的总数'+`${this.arr.length}`)
200 }catch (exception) { 194 }catch (exception) {
201 if (resolve) { 195 if (resolve) {
202 resolve('') 196 resolve('')
@@ -6,6 +6,13 @@ import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout' @@ -6,6 +6,13 @@ import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout'
6 import { EmptyComponent } from '../view/EmptyComponent'; 6 import { EmptyComponent } from '../view/EmptyComponent';
7 import { RefreshLayoutBean } from '../page/RefreshLayoutBean' 7 import { RefreshLayoutBean } from '../page/RefreshLayoutBean'
8 8
  9 +const TAG = 'PeopleShipHomeListComponent'
  10 +
  11 +interface peopleParams {
  12 + creatorId: string,
  13 + tabName: string
  14 +}
  15 +
9 @Component 16 @Component
10 export struct PeopleShipHomeListComponent { 17 export struct PeopleShipHomeListComponent {
11 private controller: TabsController = new TabsController() 18 private controller: TabsController = new TabsController()
@@ -139,6 +146,12 @@ export struct PeopleShipHomeListComponent { @@ -139,6 +146,12 @@ export struct PeopleShipHomeListComponent {
139 .onClick(() => { 146 .onClick(() => {
140 this.controller.changeIndex(index) 147 this.controller.changeIndex(index)
141 this.currentIndex = index 148 this.currentIndex = index
  149 + console.log(TAG, 'name', name)
  150 + const params: peopleParams = {
  151 + creatorId: this.creatorId,
  152 + tabName: name
  153 + }
  154 + AppStorage.setOrCreate<string>('peopleShipHomeCreatorId', JSON.stringify(params))
142 }) 155 })
143 } 156 }
144 157
@@ -147,7 +160,7 @@ export struct PeopleShipHomeListComponent { @@ -147,7 +160,7 @@ export struct PeopleShipHomeListComponent {
147 this.isLoading = true 160 this.isLoading = true
148 // 1:点播(视频),2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件 13:音频 14:动态图文 15:动态视频 161 // 1:点播(视频),2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件 13:音频 14:动态图文 15:动态视频
149 let articleModel = await PeopleShipHomePageDataModel.getPeopleShipHomePageArticleCountData(1, this.creatorId) 162 let articleModel = await PeopleShipHomePageDataModel.getPeopleShipHomePageArticleCountData(1, this.creatorId)
150 - Logger.debug('PeopleShipHomeListComponent', '获取页面信息', `${JSON.stringify(articleModel)}`) 163 + // Logger.debug('PeopleShipHomeListComponent', '获取页面信息', `${JSON.stringify(articleModel)}`)
151 this.updateTopBarData(articleModel) 164 this.updateTopBarData(articleModel)
152 this.isLoading = false 165 this.isLoading = false
153 } catch (exception) { 166 } catch (exception) {
@@ -155,6 +168,11 @@ export struct PeopleShipHomeListComponent { @@ -155,6 +168,11 @@ export struct PeopleShipHomeListComponent {
155 } 168 }
156 } 169 }
157 170
  171 + aboutToDisappear(): void {
  172 + // console.log(TAG, 'cj2024 aboutToDisappear')
  173 + AppStorage.setOrCreate<string>('peopleShipHomeCreatorId', '') //清空人民号动态等过来的数据
  174 + }
  175 +
158 // 设置顶部数据 176 // 设置顶部数据
159 updateTopBarData(articleModel: ArticleCountData) { 177 updateTopBarData(articleModel: ArticleCountData) {
160 if (articleModel) { 178 if (articleModel) {
@@ -159,7 +159,7 @@ export struct EmptyComponent { @@ -159,7 +159,7 @@ export struct EmptyComponent {
159 .opacity(this.TEXT_OPACITY) 159 .opacity(this.TEXT_OPACITY)
160 .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP }) 160 .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP })
161 // .fontColor(this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment1 ? '#999999' : '#666666') 161 // .fontColor(this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment1 ? '#999999' : '#666666')
162 - .fontColor('#666666') 162 + .fontColor(this.isBlack ? '#FFFFFF' :'#666666')
163 .onClick((event: ClickEvent) => { 163 .onClick((event: ClickEvent) => {
164 Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`); 164 Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`);
165 }) 165 })
@@ -432,7 +432,7 @@ export struct LiveOperRowListView { @@ -432,7 +432,7 @@ export struct LiveOperRowListView {
432 } 432 }
433 console.log(TAG, '收藏点击', JSON.stringify(params)) 433 console.log(TAG, '收藏点击', JSON.stringify(params))
434 PageRepository.postExecuteCollectRecord(params).then(res => { 434 PageRepository.postExecuteCollectRecord(params).then(res => {
435 - if (this.newsStatusOfUser) { 435 + if (this.newsStatusOfUser && res.code == 0) {
436 this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 436 this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
437 if (this.newsStatusOfUser.collectStatus === 1) { 437 if (this.newsStatusOfUser.collectStatus === 1) {
438 promptAction.showToast({ message: '收藏成功' }) 438 promptAction.showToast({ message: '收藏成功' })
@@ -526,23 +526,18 @@ export struct OperRowListView { @@ -526,23 +526,18 @@ export struct OperRowListView {
526 526
527 console.log(TAG, '收藏点击', JSON.stringify(params)) 527 console.log(TAG, '收藏点击', JSON.stringify(params))
528 PageRepository.postExecuteCollectRecord(params).then(res => { 528 PageRepository.postExecuteCollectRecord(params).then(res => {
529 - if (res.code != 0){  
530 - ToastUtils.showToast(res.message, 1000);  
531 - }else {  
532 - if (this.newsStatusOfUser) {  
533 - this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1  
534 - if (this.newsStatusOfUser.collectStatus === 1) {  
535 - promptAction.showToast({ message: '收藏成功' })  
536 - TrackingContent.collect(true,this.pageId,this.pageName,this.pageParam)  
537 - } else {  
538 - TrackingContent.collect(false,this.pageId,this.pageName,this.pageParam)  
539 - }  
540 - this.queryContentInteractCount() 529 + if (this.newsStatusOfUser && res.code == 0) {
  530 + this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
  531 + if (this.newsStatusOfUser.collectStatus === 1) {
  532 + promptAction.showToast({ message: '收藏成功' })
  533 + TrackingContent.collect(true,this.pageId,this.pageName,this.pageParam)
  534 + } else {
  535 + TrackingContent.collect(false,this.pageId,this.pageName,this.pageParam)
541 } 536 }
  537 + this.queryContentInteractCount()
542 } 538 }
543 console.log(TAG, '收藏点击 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) 539 console.log(TAG, '收藏点击 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
544 }) 540 })
545 -  
546 } 541 }
547 542
548 /** 543 /**
@@ -200,6 +200,7 @@ export class PageHelper { @@ -200,6 +200,7 @@ export class PageHelper {
200 if (isCache) { 200 if (isCache) {
201 pageDto = await PageViewModel.getPageGroupCacheData(pageModel.bizCopy()) as PageDTO 201 pageDto = await PageViewModel.getPageGroupCacheData(pageModel.bizCopy()) as PageDTO
202 pageModel.displayGroupInfoMd5 = pageDto.md5 202 pageModel.displayGroupInfoMd5 = pageDto.md5
  203 + pageModel.currentPage = 2
203 } else { 204 } else {
204 pageDto = await PageViewModel.getPageGroupCompData(pageModel.bizCopy()) as PageDTO 205 pageDto = await PageViewModel.getPageGroupCompData(pageModel.bizCopy()) as PageDTO
205 //增加楼层数据异常判断条件 206 //增加楼层数据异常判断条件
1 import { Logger, ResourcesUtils, EmitterUtils, EmitterEventId } from 'wdKit'; 1 import { Logger, ResourcesUtils, EmitterUtils, EmitterEventId } from 'wdKit';
2 -import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; 2 +import { HttpBizUtil, HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
3 import { ContentDetailDTO, GetPullAddressBean, InteractDataDTO, PeopleShipNextListDTO } from 'wdBean'; 3 import { ContentDetailDTO, GetPullAddressBean, InteractDataDTO, PeopleShipNextListDTO } from 'wdBean';
4 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; 4 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
5 5
@@ -338,7 +338,7 @@ export class ContentDetailRequest { @@ -338,7 +338,7 @@ export class ContentDetailRequest {
338 */ 338 */
339 static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> { 339 static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> {
340 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE 340 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE
341 - return WDHttp.post(url, params) 341 + return HttpBizUtil.post(url, params)
342 } 342 }
343 343
344 /** 344 /**
@@ -348,7 +348,7 @@ export class ContentDetailRequest { @@ -348,7 +348,7 @@ export class ContentDetailRequest {
348 */ 348 */
349 static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> { 349 static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> {
350 let url = HttpUrlUtils.getExecuteCollcetUrl() 350 let url = HttpUrlUtils.getExecuteCollcetUrl()
351 - return WDHttp.post(url, params) 351 + return HttpBizUtil.post(url, params)
352 } 352 }
353 353
354 /** 354 /**
@@ -10,54 +10,57 @@ export struct ChatItemComponent { @@ -10,54 +10,57 @@ export struct ChatItemComponent {
10 } 10 }
11 11
12 build() { 12 build() {
13 - Row() {  
14 - Text() {  
15 - if (this.item.role == LiveMessageRole.host) {  
16 - Span(' 主持人 ')  
17 - .fontSize(11)  
18 - // .lineHeight(16)  
19 - .textBackgroundStyle({ color: "#70FFC63F", radius: 2 })  
20 - .fontColor('#FFFFFFFF')  
21 - .fontFamily('PingFang SC-Regular')  
22 - .fontWeight(400)  
23 - Span(' ')  
24 - }  
25 - if (this.item.role == LiveMessageRole.guest) {  
26 - Span(' 嘉宾 ')  
27 - .fontSize(11)  
28 - // .lineHeight(16)  
29 - .textBackgroundStyle({ color: "#70FFC63F", radius: 2 }) 13 + Row(){
  14 + Row() {
  15 + Text() {
  16 + if (this.item.role == LiveMessageRole.host) {
  17 + Span(' 主持人 ')
  18 + .fontSize(11)
  19 + // .lineHeight(16)
  20 + .textBackgroundStyle({ color: "#70FFC63F", radius: 2 })
  21 + .fontColor('#FFFFFFFF')
  22 + .fontFamily('PingFang SC-Regular')
  23 + .fontWeight(400)
  24 + Span(' ')
  25 + }
  26 + if (this.item.role == LiveMessageRole.guest) {
  27 + Span(' 嘉宾 ')
  28 + .fontSize(11)
  29 + // .lineHeight(16)
  30 + .textBackgroundStyle({ color: "#70FFC63F", radius: 2 })
  31 + .fontColor('#FFFFFFFF')
  32 + .fontFamily('PingFang SC-Regular')
  33 + .fontWeight(400)
  34 + Span(' ')
  35 + }
  36 + Span(this.item.senderUserName + ': ')
  37 + .fontSize(14)
  38 + .lineHeight(22)
  39 + .fontColor('#FFFFC63F')
  40 + .padding({ right: 118 })
  41 + .fontFamily('PingFang SC-Semibold')
  42 + .fontWeight(600)
  43 +
  44 + Span(this.item.text)
  45 + .fontSize(14)
  46 + .lineHeight(22)
30 .fontColor('#FFFFFFFF') 47 .fontColor('#FFFFFFFF')
31 - .fontFamily('PingFang SC-Regular')  
32 - .fontWeight(400)  
33 - Span(' ') 48 + .fontFamily('PingFang SC-Semibold')
  49 + .fontWeight(600)
34 } 50 }
35 - Span(this.item.senderUserName + ': ')  
36 - .fontSize(14)  
37 - .lineHeight(22)  
38 - .fontColor('#FFFFC63F')  
39 - .padding({ right: 118 })  
40 - .fontFamily('PingFang SC-Semibold')  
41 - .fontWeight(600) 51 + .textShadow({ offsetX: 1, offsetY: 1, color: '#4D000000', radius: 1 })
42 52
43 - Span(this.item.text)  
44 - .fontSize(14)  
45 - .lineHeight(22)  
46 - .fontColor('#FFFFFFFF')  
47 - .fontFamily('PingFang SC-Semibold')  
48 - .fontWeight(600)  
49 } 53 }
50 - .textShadow({ offsetX: 1, offsetY: 1, color: '#4D000000', radius: 1 })  
51 -  
52 - }  
53 - .backgroundColor('#4D000000')  
54 - .borderRadius(3)  
55 - .padding({  
56 - top: 6,  
57 - bottom: 6,  
58 - left: 8,  
59 - right: 8  
60 - })  
61 - .margin({ left: 16, bottom: 4 }) 54 + .backgroundColor('#4D000000')
  55 + .borderRadius(3)
  56 + .padding({
  57 + top: 6,
  58 + bottom: 6,
  59 + left: 8,
  60 + right: 8
  61 + })
  62 + .margin({ left: 16, bottom: 4 })
  63 + }.width("100%")
  64 + .backgroundColor(Color.Transparent)
62 } 65 }
63 } 66 }
@@ -100,16 +100,22 @@ export struct PlayerCommentComponent { @@ -100,16 +100,22 @@ export struct PlayerCommentComponent {
100 ForEach(this.liveChatList, (item: LiveRoomItemBean) => { 100 ForEach(this.liveChatList, (item: LiveRoomItemBean) => {
101 ListItem() { 101 ListItem() {
102 ChatItemComponent({ item: item }) 102 ChatItemComponent({ item: item })
103 - } 103 + }.blendMode(BlendMode.SRC_IN, BlendApplyType.OFFSCREEN)
104 }) 104 })
105 } 105 }
106 - .width('80%') 106 + .width('100%')
107 .scrollBar(BarState.Off) 107 .scrollBar(BarState.Off)
  108 + .edgeEffect(EdgeEffect.None)
108 109
109 } 110 }
110 .constraintSize({ 111 .constraintSize({
111 maxHeight: 280 112 maxHeight: 280
  113 + }).width("80%")
  114 + .linearGradient({ angle: 0,
  115 + colors: [[0xff000000, 0.85], [0x01000000, 1.0]]
112 }) 116 })
  117 + .blendMode(BlendMode.SRC_OVER, BlendApplyType.OFFSCREEN)
  118 +
113 119
114 // 收藏、分享、点赞是否需要根据字段显隐 120 // 收藏、分享、点赞是否需要根据字段显隐
115 LiveOperRowListView({ 121 LiveOperRowListView({
1 -import { Action, ContentDetailDTO, ContentDTO, InteractDataDTO, PeopleShipNextListDTO } from 'wdBean/Index'; 1 +import { Action,
  2 + ContentDetailDTO, ContentDTO, InteractDataDTO, PeopleShipNextListDTO } from 'wdBean/Index';
2 import { NetworkUtil, WindowModel } from 'wdKit'; 3 import { NetworkUtil, WindowModel } from 'wdKit';
3 import { ContentDetailRequest } from 'wdDetailPlayApi/Index' 4 import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
4 import { ResponseDTO } from 'wdNetwork/Index'; 5 import { ResponseDTO } from 'wdNetwork/Index';
@@ -16,10 +17,16 @@ import { BusinessError, systemDateTime } from '@kit.BasicServicesKit'; @@ -16,10 +17,16 @@ import { BusinessError, systemDateTime } from '@kit.BasicServicesKit';
16 const storage = LocalStorage.getShared(); 17 const storage = LocalStorage.getShared();
17 const TAG = 'DetailVideoListPage' 18 const TAG = 'DetailVideoListPage'
18 19
  20 +interface peopleParams {
  21 + creatorId: string,
  22 + tabName: string
  23 +}
  24 +
19 @Entry(storage) 25 @Entry(storage)
20 @Component 26 @Component
21 export struct DetailVideoListPage { 27 export struct DetailVideoListPage {
22 @State peopleShipHomeCreatorId: string = ''; 28 @State peopleShipHomeCreatorId: string = '';
  29 + @State tabName: string = ''; // 人民好主页全部、文章、视频、动态等name
23 private contentId: string = '' 30 private contentId: string = ''
24 private relId: string = '' 31 private relId: string = ''
25 private relType: string = '' 32 private relType: string = ''
@@ -101,6 +108,10 @@ export struct DetailVideoListPage { @@ -101,6 +108,10 @@ export struct DetailVideoListPage {
101 this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || ''; 108 this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || '';
102 // console.info(TAG, `cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`) 109 // console.info(TAG, `cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`)
103 if (this.peopleShipHomeCreatorId) { 110 if (this.peopleShipHomeCreatorId) {
  111 + const params: peopleParams = JSON.parse(this.peopleShipHomeCreatorId);
  112 + this.tabName = params.tabName;
  113 + this.peopleShipHomeCreatorId = params.creatorId;
  114 + // console.info(TAG, `cj2024 tabName = ${this.tabName}`)
104 // 从人民号号主传过来的 115 // 从人民号号主传过来的
105 this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId); 116 this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId);
106 } else { 117 } else {
@@ -129,7 +140,6 @@ export struct DetailVideoListPage { @@ -129,7 +140,6 @@ export struct DetailVideoListPage {
129 // console.info(TAG, `cj2024 getPeopleShipHomeDetail relId = ${this.relId}`) 140 // console.info(TAG, `cj2024 getPeopleShipHomeDetail relId = ${this.relId}`)
130 // console.info(TAG, `cj2024 getPeopleShipHomeDetail relType = ${this.relType}`) 141 // console.info(TAG, `cj2024 getPeopleShipHomeDetail relType = ${this.relType}`)
131 await this.getRmhContentDetail(this.contentId, this.relId, this.relType) 142 await this.getRmhContentDetail(this.contentId, this.relId, this.relType)
132 - this.getRmhPublishNexts(peopleShipHomeCreatorId, this.contentId, 1, 1, 10, systemDateTime.getTime(false));  
133 } 143 }
134 // console.log(TAG, 'aboutToAppear', JSON.stringify(action.params)) 144 // console.log(TAG, 'aboutToAppear', JSON.stringify(action.params))
135 } else { 145 } else {
@@ -276,7 +286,7 @@ export struct DetailVideoListPage { @@ -276,7 +286,7 @@ export struct DetailVideoListPage {
276 relId: relId, 286 relId: relId,
277 relType: relType 287 relType: relType
278 }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { 288 }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
279 - // console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data)) 289 + // console.log(TAG, 'getRmhContentDetail:', JSON.stringify(resDTO.data))
280 // this.isOffLine = resDTO.data == null ? true : false 290 // this.isOffLine = resDTO.data == null ? true : false
281 if (resDTO.data) { 291 if (resDTO.data) {
282 const params: contentListParams = { 292 const params: contentListParams = {
@@ -293,6 +303,12 @@ export struct DetailVideoListPage { @@ -293,6 +303,12 @@ export struct DetailVideoListPage {
293 // console.log('获取互动点赞等数据===', JSON.stringify(res)) 303 // console.log('获取互动点赞等数据===', JSON.stringify(res))
294 }) 304 })
295 this.data.push(resDTO.data[0]) 305 this.data.push(resDTO.data[0])
  306 +
  307 + if(this.tabName == '全部' || this.tabName == '视频') { // 全部和视频查询号主关联视频
  308 + await this.getRmhPublishNexts(this.peopleShipHomeCreatorId, this.contentId, 1, 1, 10, systemDateTime.getTime(false));
  309 + } else { // 目前动态是查询随机视频
  310 + await this.queryVideoList()
  311 + }
296 } 312 }
297 }) 313 })
298 } 314 }
@@ -307,6 +323,7 @@ export struct DetailVideoListPage { @@ -307,6 +323,7 @@ export struct DetailVideoListPage {
307 refreshTime 1694073009294 323 refreshTime 1694073009294
308 * */ 324 * */
309 async getRmhPublishNexts(creatorId: string, contentId: string, contentType: number,nextFlag: number,pageSize: number,refreshTime:number) { 325 async getRmhPublishNexts(creatorId: string, contentId: string, contentType: number,nextFlag: number,pageSize: number,refreshTime:number) {
  326 + // console.log(TAG, 'cj2024 getRmhPublishNexts:')
310 await ContentDetailRequest.getRmhPublishNexts({ 327 await ContentDetailRequest.getRmhPublishNexts({
311 creatorId: creatorId, 328 creatorId: creatorId,
312 contentId: contentId, 329 contentId: contentId,
@@ -395,7 +412,7 @@ export struct DetailVideoListPage { @@ -395,7 +412,7 @@ export struct DetailVideoListPage {
395 }) 412 })
396 } else if (this.isOffLine) { 413 } else if (this.isOffLine) {
397 EmptyComponent({ 414 EmptyComponent({
398 - emptyType: 15, emptyButton: true, retry: () => { 415 + emptyType: 15, emptyButton: true, isBlack: true, retry: () => {
399 this.getDetail() 416 this.getDetail()
400 } 417 }
401 }) 418 })
@@ -13,17 +13,19 @@ export struct DetailDialog { @@ -13,17 +13,19 @@ export struct DetailDialog {
13 build() { 13 build() {
14 14
15 Column() { 15 Column() {
  16 + Column() {
  17 + if (this.name) {
  18 + Text(`@${this.name}`)
  19 + .fontColor(Color.White)
  20 + .fontSize(14)
  21 + .fontWeight(600)
  22 + .lineHeight(17)
  23 + .margin({ top: 8 })
  24 + }
  25 + }
  26 + .alignItems(HorizontalAlign.Start)
16 Scroll() { 27 Scroll() {
17 Column() { 28 Column() {
18 - if (this.name) {  
19 - Text(`@${this.name}`)  
20 - .fontColor(Color.White)  
21 - .fontSize(14)  
22 - .fontWeight(600)  
23 - .lineHeight(17)  
24 - .margin({ top: 8 })  
25 - }  
26 -  
27 if (this.title) { 29 if (this.title) {
28 Text(this.title) 30 Text(this.title)
29 .fontColor(Color.White) 31 .fontColor(Color.White)
@@ -55,7 +57,9 @@ export struct DetailDialog { @@ -55,7 +57,9 @@ export struct DetailDialog {
55 57
56 } 58 }
57 .scrollBar(BarState.Off) //安卓不显示滚动条 59 .scrollBar(BarState.Off) //安卓不显示滚动条
58 - .height(200) 60 + .constraintSize({
  61 + maxHeight: 200
  62 + })
59 63
60 Row() { 64 Row() {
61 Image($r("app.media.icon_arrow_left_white")) 65 Image($r("app.media.icon_arrow_left_white"))
@@ -80,8 +80,7 @@ export struct OperationListView { @@ -80,8 +80,7 @@ export struct OperationListView {
80 contentType: this.contentDetailData?.newsType + '', 80 contentType: this.contentDetailData?.newsType + '',
81 } 81 }
82 ContentDetailRequest.postExecuteLike(params).then(res => { 82 ContentDetailRequest.postExecuteLike(params).then(res => {
83 -  
84 - if (this.newsStatusOfUser) { 83 + if (this.newsStatusOfUser && res.code == 0) {
85 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1' 84 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1'
86 if (this.newsStatusOfUser.likeStatus === '1') { 85 if (this.newsStatusOfUser.likeStatus === '1') {
87 this.interactData.likeNum = Number(this.interactData.likeNum) + 1 86 this.interactData.likeNum = Number(this.interactData.likeNum) + 1
@@ -91,7 +90,6 @@ export struct OperationListView { @@ -91,7 +90,6 @@ export struct OperationListView {
91 // console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum) 90 // console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum)
92 // this.queryContentInteractCount() 91 // this.queryContentInteractCount()
93 } 92 }
94 -  
95 }) 93 })
96 } 94 }
97 95
@@ -116,7 +114,7 @@ export struct OperationListView { @@ -116,7 +114,7 @@ export struct OperationListView {
116 114
117 } 115 }
118 ContentDetailRequest.postExecuteCollectRecord(params).then(res => { 116 ContentDetailRequest.postExecuteCollectRecord(params).then(res => {
119 - if (this.newsStatusOfUser) { 117 + if (this.newsStatusOfUser && res.code == 0) {
120 this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 118 this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
121 // this.queryContentInteractCount() 119 // this.queryContentInteractCount()
122 if (this.newsStatusOfUser.collectStatus === 1) { 120 if (this.newsStatusOfUser.collectStatus === 1) {
@@ -35,10 +35,12 @@ export struct PlayerFullScreenView { @@ -35,10 +35,12 @@ export struct PlayerFullScreenView {
35 35
36 share() { 36 share() {
37 this.playerController?.switchPlayOrPause() 37 this.playerController?.switchPlayOrPause()
38 - WDShare.shareContent(this.contentDetailData)  
39 - // WDShare.shareContent(this.contentDetailData).then(() => {  
40 - // this.playerController?.switchPlayOrPause()  
41 - // }) 38 + WDShare.shareContent(this.contentDetailData).then((res) => {
  39 + // console.log(TAG, "分享弹框关闭", res);
  40 + if(res == 'dismiss') {
  41 + this.playerController?.switchPlayOrPause()
  42 + }
  43 + })
42 } 44 }
43 45
44 updateProgress() { 46 updateProgress() {
@@ -103,7 +105,7 @@ export struct PlayerFullScreenView { @@ -103,7 +105,7 @@ export struct PlayerFullScreenView {
103 Text(this.getTitle()) 105 Text(this.getTitle())
104 .fontSize(18) 106 .fontSize(18)
105 .lineHeight(24) 107 .lineHeight(24)
106 - .fontWeight(600) 108 + // .fontWeight(600)
107 .fontColor(Color.White) 109 .fontColor(Color.White)
108 .maxLines(1) 110 .maxLines(1)
109 .textOverflow({ overflow: TextOverflow.Ellipsis }) 111 .textOverflow({ overflow: TextOverflow.Ellipsis })
@@ -99,7 +99,7 @@ export struct PlayerRightView { @@ -99,7 +99,7 @@ export struct PlayerRightView {
99 // console.log(TAG, '点赞params', JSON.stringify(params)) 99 // console.log(TAG, '点赞params', JSON.stringify(params))
100 ContentDetailRequest.postExecuteLike(params).then(res => { 100 ContentDetailRequest.postExecuteLike(params).then(res => {
101 // console.log(TAG, '点赞this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) 101 // console.log(TAG, '点赞this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
102 - if (this.newsStatusOfUser) { 102 + if (this.newsStatusOfUser && res.code == 0) {
103 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' 103 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
104 if (this.newsStatusOfUser.likeStatus == '1') { 104 if (this.newsStatusOfUser.likeStatus == '1') {
105 this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1 105 this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1
@@ -138,7 +138,7 @@ export struct PlayerRightView { @@ -138,7 +138,7 @@ export struct PlayerRightView {
138 138
139 } 139 }
140 ContentDetailRequest.postExecuteCollectRecord(params).then(res => { 140 ContentDetailRequest.postExecuteCollectRecord(params).then(res => {
141 - if (this.newsStatusOfUser) { 141 + if (this.newsStatusOfUser && res.code == 0) {
142 this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 142 this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
143 // this.queryContentInteractCount() 143 // this.queryContentInteractCount()
144 if (this.newsStatusOfUser.collectStatus === 1) { 144 if (this.newsStatusOfUser.collectStatus === 1) {
@@ -9,22 +9,28 @@ import { AppInnerLinkGenerator } from 'wdRouter'; @@ -9,22 +9,28 @@ import { AppInnerLinkGenerator } from 'wdRouter';
9 9
10 export class WDShare { 10 export class WDShare {
11 11
12 - static shareContent(content: ContentDetailDTO, pageName: string ="", pageId: string = "") {  
13 -  
14 - //TODO: 处理分享弹框交互和 海报逻辑  
15 -  
16 - WDShareBase.getInstance().share({  
17 - to: ShareType.System,  
18 - scene: ShareScene.System,  
19 - type: ShareContentType.Link,  
20 - obj: {  
21 - title: content.shareInfo.shareTitle,  
22 - desc: content.shareInfo.shareSummary,  
23 - link: content.shareInfo.shareUrl,  
24 - deeplink:AppInnerLinkGenerator.generateDeepLinkWithConent(content),  
25 - posterImg:$r("app.media.test_share_poster"),  
26 - }  
27 - }) 12 + static shareContent(content: ContentDetailDTO, pageName: string = "", pageId: string = ""): Promise<string> {
  13 + return new Promise((resolve, reject) => {
  14 + // 处理分享弹框交互和海报逻辑
  15 + WDShareBase.getInstance().share({
  16 + to: ShareType.System,
  17 + scene: ShareScene.System,
  18 + type: ShareContentType.Link,
  19 + obj: {
  20 + title: content.shareInfo.shareTitle,
  21 + desc: content.shareInfo.shareSummary,
  22 + link: content.shareInfo.shareUrl,
  23 + deeplink: AppInnerLinkGenerator.generateDeepLinkWithConent(content),
  24 + posterImg: $r("app.media.test_share_poster"),
  25 + }
  26 + })?.then((res) => {
  27 + // console.log("分享成功", res);
  28 + resolve(res);
  29 + }).catch((() => {
  30 + // console.error("分享失败");
  31 + reject("error");
  32 + }))
  33 + });
28 } 34 }
29 35
30 static shareProgram(program: ContentDTO, pageName: string ="", pageId: string = "") { 36 static shareProgram(program: ContentDTO, pageName: string ="", pageId: string = "") {