Showing
4 changed files
with
60 additions
and
11 deletions
| @@ -39,7 +39,8 @@ export { | @@ -39,7 +39,8 @@ export { | ||
| 39 | postExecuteCollectRecordParams, | 39 | postExecuteCollectRecordParams, |
| 40 | contentListParams, | 40 | contentListParams, |
| 41 | postInteractAccentionOperateParams, | 41 | postInteractAccentionOperateParams, |
| 42 | - contentListItem | 42 | + contentListItem, |
| 43 | + contentInteractParams | ||
| 43 | } from './src/main/ets/bean/detail/MultiPictureDetailPageDTO'; | 44 | } from './src/main/ets/bean/detail/MultiPictureDetailPageDTO'; |
| 44 | 45 | ||
| 45 | export { InteractParam, ContentBean } from './src/main/ets/bean/content/InteractParam'; | 46 | export { InteractParam, ContentBean } from './src/main/ets/bean/content/InteractParam'; |
| @@ -172,6 +172,17 @@ export interface contentListParams { | @@ -172,6 +172,17 @@ export interface contentListParams { | ||
| 172 | contentList: contentListItem[]; | 172 | contentList: contentListItem[]; |
| 173 | } | 173 | } |
| 174 | 174 | ||
| 175 | +export interface contentInteractParams { | ||
| 176 | + contentId: string; | ||
| 177 | + contentType: number; | ||
| 178 | + relType?: string; | ||
| 179 | + contentRelId?: string; | ||
| 180 | + channelId?: number; | ||
| 181 | + detail:number; | ||
| 182 | + readFlag?:number; | ||
| 183 | + rmhPlatform:number; | ||
| 184 | +} | ||
| 185 | + | ||
| 175 | export interface postInteractAccentionOperateParams { | 186 | export interface postInteractAccentionOperateParams { |
| 176 | attentionUserType: string; | 187 | attentionUserType: string; |
| 177 | attentionUserId: string; | 188 | attentionUserId: string; |
| @@ -17,6 +17,7 @@ import { | @@ -17,6 +17,7 @@ import { | ||
| 17 | batchLikeAndCollectParams, | 17 | batchLikeAndCollectParams, |
| 18 | InteractDataDTO, | 18 | InteractDataDTO, |
| 19 | contentListParams, | 19 | contentListParams, |
| 20 | + contentInteractParams | ||
| 20 | } from 'wdBean'; | 21 | } from 'wdBean'; |
| 21 | import DetailViewModel from '../viewmodel/DetailViewModel'; | 22 | import DetailViewModel from '../viewmodel/DetailViewModel'; |
| 22 | import { ImageAndTextWebComponent } from './ImageAndTextWebComponent'; | 23 | import { ImageAndTextWebComponent } from './ImageAndTextWebComponent'; |
| @@ -443,6 +444,10 @@ export struct ImageAndTextPageComponent { | @@ -443,6 +444,10 @@ export struct ImageAndTextPageComponent { | ||
| 443 | contentId: this.contentDetailData?.newsId + '', | 444 | contentId: this.contentDetailData?.newsId + '', |
| 444 | contentType: this.contentDetailData?.newsType + '', | 445 | contentType: this.contentDetailData?.newsType + '', |
| 445 | contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '', | 446 | contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '', |
| 447 | + relType:this.contentDetailData?.reLInfo?.relType || '' + '', | ||
| 448 | + title:this.contentDetailData?.newsTitle, | ||
| 449 | + userName:this.contentDetailData?.userInfo?.userName || '' + '', | ||
| 450 | + channelId:String(this.contentDetailData?.reLInfo?.channelId) || '' + '' | ||
| 446 | } | 451 | } |
| 447 | console.log(TAG, '点赞、取消点赞params', JSON.stringify(params)) | 452 | console.log(TAG, '点赞、取消点赞params', JSON.stringify(params)) |
| 448 | PageRepository.postExecuteLike(params).then(res => { | 453 | PageRepository.postExecuteLike(params).then(res => { |
| @@ -472,17 +477,22 @@ export struct ImageAndTextPageComponent { | @@ -472,17 +477,22 @@ export struct ImageAndTextPageComponent { | ||
| 472 | */ | 477 | */ |
| 473 | queryContentInteractCount() { | 478 | queryContentInteractCount() { |
| 474 | console.error(TAG, 'contentDetailData2222', JSON.stringify(this.contentDetailData)) | 479 | console.error(TAG, 'contentDetailData2222', JSON.stringify(this.contentDetailData)) |
| 475 | - const params: contentListParams = { | ||
| 476 | - contentList: [{ | 480 | + |
| 481 | + const params: contentInteractParams = { | ||
| 477 | contentId: this.contentDetailData?.newsId + '', | 482 | contentId: this.contentDetailData?.newsId + '', |
| 478 | contentType: this.contentDetailData?.newsType, | 483 | contentType: this.contentDetailData?.newsType, |
| 479 | - }] | ||
| 480 | - } | ||
| 481 | - PageRepository.getContentInteract(params).then(res => { | 484 | + contentRelId:this.contentDetailData?.reLInfo?.relId, |
| 485 | + relType:this.contentDetailData?.reLInfo?.relType, | ||
| 486 | + channelId:this.contentDetailData?.reLInfo?.channelId, | ||
| 487 | + rmhPlatform:this.contentDetailData?.rmhPlatform, | ||
| 488 | + readFlag:this.contentDetailData?.readFlag, | ||
| 489 | + detail:1 | ||
| 490 | + } | ||
| 491 | + PageRepository.getImageAndTextInteract(params).then(res => { | ||
| 482 | console.error(TAG, 'queryContentInteractCount', JSON.stringify(res)) | 492 | console.error(TAG, 'queryContentInteractCount', JSON.stringify(res)) |
| 483 | if (res.data) { | 493 | if (res.data) { |
| 484 | - this.interactData = res.data[0] | ||
| 485 | - this.likeNum = Number(res.data[0]?.likeNum) || 0 | 494 | + this.interactData = res.data |
| 495 | + this.likeNum = Number(res.data?.likeNum) || 0 | ||
| 486 | } | 496 | } |
| 487 | }) | 497 | }) |
| 488 | } | 498 | } |
| @@ -25,7 +25,8 @@ import { | @@ -25,7 +25,8 @@ import { | ||
| 25 | postExecuteCollectRecordParams, | 25 | postExecuteCollectRecordParams, |
| 26 | postExecuteLikeParams, | 26 | postExecuteLikeParams, |
| 27 | postInteractAccentionOperateParams, | 27 | postInteractAccentionOperateParams, |
| 28 | - postRecommendListParams | 28 | + postRecommendListParams, |
| 29 | + contentInteractParams | ||
| 29 | } from 'wdBean'; | 30 | } from 'wdBean'; |
| 30 | import { PageUIReqBean } from '../components/page/bean/PageUIReqBean'; | 31 | import { PageUIReqBean } from '../components/page/bean/PageUIReqBean'; |
| 31 | import { SpConstants } from 'wdConstant/Index'; | 32 | import { SpConstants } from 'wdConstant/Index'; |
| @@ -146,8 +147,24 @@ export class PageRepository { | @@ -146,8 +147,24 @@ export class PageRepository { | ||
| 146 | return url; | 147 | return url; |
| 147 | } | 148 | } |
| 148 | 149 | ||
| 149 | - static getInteractDataUrl() { | 150 | + static getInteractDataUrl(params: contentInteractParams) { |
| 150 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH; | 151 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH; |
| 152 | + url = url + "?contentId=" + params.contentId | ||
| 153 | + + "&contentType=" + params.contentType | ||
| 154 | + if (!StringUtils.isEmpty(params.contentRelId)) { | ||
| 155 | + url = url + "&contentRelId=" + params.contentRelId; | ||
| 156 | + } | ||
| 157 | + if (!StringUtils.isEmpty(params.relType)) { | ||
| 158 | + url = url + "&relType=" + params.relType; | ||
| 159 | + } | ||
| 160 | + if (!StringUtils.isEmpty(params.channelId)) { | ||
| 161 | + url = url + "&channelId=" + params.channelId; | ||
| 162 | + } | ||
| 163 | + if (params.contentType == 8){ | ||
| 164 | + url = url + "&readFlag=" + params.readFlag; | ||
| 165 | + } | ||
| 166 | + url = url + "&rmhPlatform=" + params.rmhPlatform; | ||
| 167 | + url = url + "&detail=" + '1'; | ||
| 151 | Logger.info(TAG, "getInteractDataUrl url = " + url) | 168 | Logger.info(TAG, "getInteractDataUrl url = " + url) |
| 152 | return url; | 169 | return url; |
| 153 | } | 170 | } |
| @@ -305,7 +322,8 @@ export class PageRepository { | @@ -305,7 +322,8 @@ export class PageRepository { | ||
| 305 | }; | 322 | }; |
| 306 | 323 | ||
| 307 | static fetchInteractData(param: object) { | 324 | static fetchInteractData(param: object) { |
| 308 | - let url = PageRepository.getInteractDataUrl() | 325 | + // let url = PageRepository.getInteractDataUrl() |
| 326 | + let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH | ||
| 309 | return WDHttp.post<ResponseDTO<InteractDataDTO[]>>(url, param) | 327 | return WDHttp.post<ResponseDTO<InteractDataDTO[]>>(url, param) |
| 310 | }; | 328 | }; |
| 311 | 329 | ||
| @@ -344,6 +362,15 @@ export class PageRepository { | @@ -344,6 +362,15 @@ export class PageRepository { | ||
| 344 | return WDHttp.post(url, params) | 362 | return WDHttp.post(url, params) |
| 345 | } | 363 | } |
| 346 | 364 | ||
| 365 | + /** | ||
| 366 | + *文章详情页点赞数 | ||
| 367 | + * @returns | ||
| 368 | + */ | ||
| 369 | + static getImageAndTextInteract(params: contentInteractParams) { | ||
| 370 | + let url = PageRepository.getInteractDataUrl(params) | ||
| 371 | + return WDHttp.get<ResponseDTO<InteractDataDTO>>(url) | ||
| 372 | + } | ||
| 373 | + | ||
| 347 | // 浏览历史新增、删除接口 | 374 | // 浏览历史新增、删除接口 |
| 348 | static fetchInteractBrowsOperate(param: object) { | 375 | static fetchInteractBrowsOperate(param: object) { |
| 349 | let url = PageRepository.getInteractBrowsOperateUrl() | 376 | let url = PageRepository.getInteractBrowsOperateUrl() |
-
Please register or login to post a comment