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
chenquansheng
2024-09-04 11:31:24 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
21bf8bde3a9edfe240e616565486f356a911505a
21bf8bde
1 parent
c46a31e2
fix |> 文章详情页点赞数和操作点赞接口调整
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
11 deletions
sight_harmony/features/wdBean/Index.ets
sight_harmony/features/wdBean/src/main/ets/bean/detail/MultiPictureDetailPageDTO.ts
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/repository/PageRepository.ets
sight_harmony/features/wdBean/Index.ets
View file @
21bf8bd
...
...
@@ -39,7 +39,8 @@ export {
postExecuteCollectRecordParams,
contentListParams,
postInteractAccentionOperateParams,
contentListItem
contentListItem,
contentInteractParams
} from './src/main/ets/bean/detail/MultiPictureDetailPageDTO';
export { InteractParam, ContentBean } from './src/main/ets/bean/content/InteractParam';
...
...
sight_harmony/features/wdBean/src/main/ets/bean/detail/MultiPictureDetailPageDTO.ts
View file @
21bf8bd
...
...
@@ -172,6 +172,17 @@ export interface contentListParams {
contentList
:
contentListItem
[];
}
export
interface
contentInteractParams
{
contentId
:
string
;
contentType
:
number
;
relType
?:
string
;
contentRelId
?:
string
;
channelId
?:
number
;
detail
:
number
;
readFlag
?:
number
;
rmhPlatform
:
number
;
}
export
interface
postInteractAccentionOperateParams
{
attentionUserType
:
string
;
attentionUserId
:
string
;
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
21bf8bd
...
...
@@ -17,6 +17,7 @@ import {
batchLikeAndCollectParams,
InteractDataDTO,
contentListParams,
contentInteractParams
} from 'wdBean';
import DetailViewModel from '../viewmodel/DetailViewModel';
import { ImageAndTextWebComponent } from './ImageAndTextWebComponent';
...
...
@@ -443,6 +444,10 @@ export struct ImageAndTextPageComponent {
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '',
relType:this.contentDetailData?.reLInfo?.relType || '' + '',
title:this.contentDetailData?.newsTitle,
userName:this.contentDetailData?.userInfo?.userName || '' + '',
channelId:String(this.contentDetailData?.reLInfo?.channelId) || '' + ''
}
console.log(TAG, '点赞、取消点赞params', JSON.stringify(params))
PageRepository.postExecuteLike(params).then(res => {
...
...
@@ -472,17 +477,22 @@ export struct ImageAndTextPageComponent {
*/
queryContentInteractCount() {
console.error(TAG, 'contentDetailData2222', JSON.stringify(this.contentDetailData))
const params: contentListParams = {
contentList: [{
const params: contentInteractParams = {
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType,
}]
}
PageRepository.getContentInteract(params).then(res => {
contentRelId:this.contentDetailData?.reLInfo?.relId,
relType:this.contentDetailData?.reLInfo?.relType,
channelId:this.contentDetailData?.reLInfo?.channelId,
rmhPlatform:this.contentDetailData?.rmhPlatform,
readFlag:this.contentDetailData?.readFlag,
detail:1
}
PageRepository.getImageAndTextInteract(params).then(res => {
console.error(TAG, 'queryContentInteractCount', JSON.stringify(res))
if (res.data) {
this.interactData = res.data[0]
this.likeNum = Number(res.data[0]?.likeNum) || 0
this.interactData = res.data
this.likeNum = Number(res.data?.likeNum) || 0
}
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/repository/PageRepository.ets
View file @
21bf8bd
...
...
@@ -25,7 +25,8 @@ import {
postExecuteCollectRecordParams,
postExecuteLikeParams,
postInteractAccentionOperateParams,
postRecommendListParams
postRecommendListParams,
contentInteractParams
} from 'wdBean';
import { PageUIReqBean } from '../components/page/bean/PageUIReqBean';
import { SpConstants } from 'wdConstant/Index';
...
...
@@ -146,8 +147,24 @@ export class PageRepository {
return url;
}
static getInteractDataUrl() {
static getInteractDataUrl(
params: contentInteractParams
) {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH;
url = url + "?contentId=" + params.contentId
+ "&contentType=" + params.contentType
if (!StringUtils.isEmpty(params.contentRelId)) {
url = url + "&contentRelId=" + params.contentRelId;
}
if (!StringUtils.isEmpty(params.relType)) {
url = url + "&relType=" + params.relType;
}
if (!StringUtils.isEmpty(params.channelId)) {
url = url + "&channelId=" + params.channelId;
}
if (params.contentType == 8){
url = url + "&readFlag=" + params.readFlag;
}
url = url + "&rmhPlatform=" + params.rmhPlatform;
url = url + "&detail=" + '1';
Logger.info(TAG, "getInteractDataUrl url = " + url)
return url;
}
...
...
@@ -305,7 +322,8 @@ export class PageRepository {
};
static fetchInteractData(param: object) {
let url = PageRepository.getInteractDataUrl()
// let url = PageRepository.getInteractDataUrl()
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH
return WDHttp.post<ResponseDTO<InteractDataDTO[]>>(url, param)
};
...
...
@@ -344,6 +362,15 @@ export class PageRepository {
return WDHttp.post(url, params)
}
/**
*文章详情页点赞数
* @returns
*/
static getImageAndTextInteract(params: contentInteractParams) {
let url = PageRepository.getInteractDataUrl(params)
return WDHttp.get<ResponseDTO<InteractDataDTO>>(url)
}
// 浏览历史新增、删除接口
static fetchInteractBrowsOperate(param: object) {
let url = PageRepository.getInteractBrowsOperateUrl()
...
...
Please
register
or
login
to post a comment