liyubing

Merge remote-tracking branch 'origin/main'

1 export interface commentInfo { 1 export interface commentInfo {
2 commentTitle: string, 2 commentTitle: string,
3 newsTitle: string, 3 newsTitle: string,
4 - userName: string,  
5 - userHeaderUrl: string, 4 + userId?: string,
  5 + userName?: string,
  6 + userHeaderUrl?: string,
6 publishTime: number, 7 publishTime: number,
7 commentId: string, 8 commentId: string,
8 newsId: string, 9 newsId: string,
9 relId: string; 10 relId: string;
10 relType: string; 11 relType: string;
11 - userId: string;  
12 - newsType?: string 12 + newsType?: string,
  13 + objectType?: string,
13 } 14 }
@@ -5,13 +5,10 @@ import { ProcessUtils } from 'wdRouter'; @@ -5,13 +5,10 @@ import { ProcessUtils } from 'wdRouter';
5 import { SpConstants } from 'wdConstant/Index' 5 import { SpConstants } from 'wdConstant/Index'
6 import { 6 import {
7 batchLikeAndCollectParams, 7 batchLikeAndCollectParams,
8 - ContentDetailRequest,  
9 - contentListParams,  
10 - postExecuteCollectRecordParams,  
11 - postExecuteLikeParams,  
12 - postInteractAccentionOperateParams  
13 } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; 8 } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
14 import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'; 9 import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel';
  10 +import commentViewModel from '../../components/comment/viewmodel/CommentViewModel';
  11 +import { commentItemModel } from '../../components/comment/model/CommentModel'
15 12
16 /** 13 /**
17 * 精选评论卡 14 * 精选评论卡
@@ -40,13 +37,19 @@ export struct ZhSingleRow06 { @@ -40,13 +37,19 @@ export struct ZhSingleRow06 {
40 WDRouterRule.jumpWithPage(WDRouterPage.loginPage) 37 WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
41 return 38 return
42 } 39 }
43 - const params: postExecuteLikeParams = {  
44 - status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1',  
45 - contentId: this.compDTO.operDataList[0]?.commentInfo?.newsId + '',  
46 - contentType: this.compDTO.operDataList[0]?.commentInfo?.newsType + '',  
47 - }  
48 - ContentDetailRequest.postExecuteLike(params).then(res => {  
49 - this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1' 40 +
  41 + const commentInfo = this.compDTO.operDataList[0]?.commentInfo as commentInfo;
  42 + // commentLikeChange(this.item)
  43 + this.newsStatusOfUser.likeStatus = this.newsStatusOfUser.likeStatus === '1' ? '0' : '1';
  44 + const commentLikeParam = {
  45 + targetId: commentInfo.newsId || '',
  46 + id: commentInfo.commentId,
  47 + targetType: commentInfo?.objectType || '',
  48 + api_status: this.newsStatusOfUser?.likeStatus == '1' ? false : true
  49 + } as commentItemModel;
  50 + commentViewModel.commentLike(commentLikeParam).then(() => {
  51 + }).catch(() => {
  52 + this.newsStatusOfUser.likeStatus = this.newsStatusOfUser.likeStatus === '1' ? '0' : '1';
50 }) 53 })
51 } 54 }
52 55
@@ -67,7 +70,7 @@ export struct ZhSingleRow06 { @@ -67,7 +70,7 @@ export struct ZhSingleRow06 {
67 ] 70 ]
68 } 71 }
69 let data = await MultiPictureDetailViewModel.getInteractDataStatus(params) 72 let data = await MultiPictureDetailViewModel.getInteractDataStatus(params)
70 - console.error(TAG, 'ZhSingleRow06-data', JSON.stringify(data)) 73 + Logger.info(TAG, 'ZhSingleRow06-data', JSON.stringify(data))
71 this.newsStatusOfUser = data[0]; 74 this.newsStatusOfUser = data[0];
72 Logger.info(TAG, `ZhSingleRow06-newsStatusOfUser:${JSON.stringify(this.newsStatusOfUser)}`) 75 Logger.info(TAG, `ZhSingleRow06-newsStatusOfUser:${JSON.stringify(this.newsStatusOfUser)}`)
73 } catch (exception) { 76 } catch (exception) {
@@ -126,7 +129,7 @@ export struct ZhSingleRow06 { @@ -126,7 +129,7 @@ export struct ZhSingleRow06 {
126 .fontColor(0x999999) 129 .fontColor(0x999999)
127 130
128 Row(){ 131 Row(){
129 - Image(this.newsStatusOfUser?.likeStatus == '1' ? $r('app.media.icon_like_select') : $r('app.media.icon_like')) 132 + Image(Number(this.newsStatusOfUser?.likeStatus) == 1 ? $r('app.media.icon_like_select') : $r('app.media.icon_like'))
130 .width(16) 133 .width(16)
131 .height(16) 134 .height(16)
132 .margin({right: 3}) 135 .margin({right: 3})
@@ -49,9 +49,6 @@ export class LiveModel { @@ -49,9 +49,6 @@ export class LiveModel {
49 params['relationId'] = relationId 49 params['relationId'] = relationId
50 params['liveId'] = liveId 50 params['liveId'] = liveId
51 params['isSubscribe'] = `${isSubscribe}` 51 params['isSubscribe'] = `${isSubscribe}`
52 - Logger.info('relationId', relationId)  
53 - Logger.info('liveId', liveId)  
54 - Logger.info('isSubscribe', typeof isSubscribe)  
55 return new Promise<ResponseDTO<string>>((success, fail) => { 52 return new Promise<ResponseDTO<string>>((success, fail) => {
56 HttpRequest.post<ResponseDTO<string>>( 53 HttpRequest.post<ResponseDTO<string>>(
57 HttpUrlUtils.getLiveAppointmentUrl(), 54 HttpUrlUtils.getLiveAppointmentUrl(),