Showing
6 changed files
with
16 additions
and
16 deletions
| @@ -46,6 +46,10 @@ export class HttpUrlUtils { | @@ -46,6 +46,10 @@ export class HttpUrlUtils { | ||
| 46 | */ | 46 | */ |
| 47 | static readonly INTERACT_EXECUTELIKE: string = "/api/rmrb-interact/interact/zh/c/like/executeLike"; | 47 | static readonly INTERACT_EXECUTELIKE: string = "/api/rmrb-interact/interact/zh/c/like/executeLike"; |
| 48 | /** | 48 | /** |
| 49 | + * 收藏、取消收藏 | ||
| 50 | + */ | ||
| 51 | + static readonly INTERACT_EXECUTECOLLECTRECORD: string = "/api/rmrb-interact/interact/zh/c/collect/executeCollcetRecord"; | ||
| 52 | + /** | ||
| 49 | * 关注号主 | 53 | * 关注号主 |
| 50 | */ | 54 | */ |
| 51 | static readonly INTERACT_ACCENTION_OPERATION: string = "/api/rmrb-interact/interact/zh/c/attention/operation"; | 55 | static readonly INTERACT_ACCENTION_OPERATION: string = "/api/rmrb-interact/interact/zh/c/attention/operation"; |
| @@ -2,11 +2,11 @@ | @@ -2,11 +2,11 @@ | ||
| 2 | * 批查接口查询互动相关数据,返回数据bean | 2 | * 批查接口查询互动相关数据,返回数据bean |
| 3 | */ | 3 | */ |
| 4 | export interface InteractDataDTO { | 4 | export interface InteractDataDTO { |
| 5 | - collectNum: number | string; | ||
| 6 | - commentNum: number | string; | 5 | + collectNum: number | String; |
| 6 | + commentNum: number | String; | ||
| 7 | contentId: string; | 7 | contentId: string; |
| 8 | contentType: number; | 8 | contentType: number; |
| 9 | - likeNum: number | string; | 9 | + likeNum: number | String; |
| 10 | readNum: number; | 10 | readNum: number; |
| 11 | shareNum: number; | 11 | shareNum: number; |
| 12 | } | 12 | } |
| @@ -38,7 +38,7 @@ export struct ImageAndTextPageComponent { | @@ -38,7 +38,7 @@ export struct ImageAndTextPageComponent { | ||
| 38 | @State interactData: InteractDataDTO = {} as InteractDataDTO | 38 | @State interactData: InteractDataDTO = {} as InteractDataDTO |
| 39 | @State isPageEnd: boolean = false | 39 | @State isPageEnd: boolean = false |
| 40 | @State publishTime: string = '' | 40 | @State publishTime: string = '' |
| 41 | - @State publishCommentModel: publishCommentModel = new publishCommentModel() | 41 | + @State publishCommentModel: publishCommentModel = {} as publishCommentModel |
| 42 | 42 | ||
| 43 | build() { | 43 | build() { |
| 44 | Column() { | 44 | Column() { |
| @@ -142,10 +142,7 @@ export struct ImageAndTextPageComponent { | @@ -142,10 +142,7 @@ export struct ImageAndTextPageComponent { | ||
| 142 | 142 | ||
| 143 | //底部交互区 | 143 | //底部交互区 |
| 144 | if (this.contentDetailData?.length) { | 144 | if (this.contentDetailData?.length) { |
| 145 | - OperRowListView({ | ||
| 146 | - contentDetailData: this.contentDetailData[0], | ||
| 147 | - publishCommentModel: this.publishCommentModel | ||
| 148 | - }) | 145 | + OperRowListView({ contentDetailData: this.contentDetailData[0] }) |
| 149 | } | 146 | } |
| 150 | } | 147 | } |
| 151 | 148 |
| @@ -40,11 +40,11 @@ const TAG = 'OperRowListView'; | @@ -40,11 +40,11 @@ const TAG = 'OperRowListView'; | ||
| 40 | export struct OperRowListView { | 40 | export struct OperRowListView { |
| 41 | @Prop contentDetailData: ContentDetailDTO // 稿件详情 | 41 | @Prop contentDetailData: ContentDetailDTO // 稿件详情 |
| 42 | @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] // 组件展示条件 | 42 | @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] // 组件展示条件 |
| 43 | - @Prop publishCommentModel: publishCommentModel | ||
| 44 | // @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO | 43 | // @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO |
| 45 | @State interactData: InteractDataDTO = {} as InteractDataDTO | 44 | @State interactData: InteractDataDTO = {} as InteractDataDTO |
| 46 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 | 45 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 |
| 47 | @State likeBean: Record<string, string> = {} | 46 | @State likeBean: Record<string, string> = {} |
| 47 | + @State publishCommentModel: publishCommentModel = new publishCommentModel() | ||
| 48 | 48 | ||
| 49 | async aboutToAppear() { | 49 | async aboutToAppear() { |
| 50 | const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') | 50 | const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') |
| @@ -62,13 +62,13 @@ export struct OperRowListView { | @@ -62,13 +62,13 @@ export struct OperRowListView { | ||
| 62 | console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData)) | 62 | console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData)) |
| 63 | console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean)) | 63 | console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean)) |
| 64 | // 评论需要数据 | 64 | // 评论需要数据 |
| 65 | - /* this.publishCommentModel.targetId = this.contentDetailData.newsId + '' | 65 | + this.publishCommentModel.targetId = this.contentDetailData.newsId + '' |
| 66 | this.publishCommentModel.targetRelId = this.contentDetailData.reLInfo?.relId + '' | 66 | this.publishCommentModel.targetRelId = this.contentDetailData.reLInfo?.relId + '' |
| 67 | this.publishCommentModel.targetTitle = this.contentDetailData.newsTitle + '' | 67 | this.publishCommentModel.targetTitle = this.contentDetailData.newsTitle + '' |
| 68 | this.publishCommentModel.targetRelType = this.contentDetailData.reLInfo?.relType + '' | 68 | this.publishCommentModel.targetRelType = this.contentDetailData.reLInfo?.relType + '' |
| 69 | this.publishCommentModel.targetRelObjectId = this.contentDetailData.reLInfo?.relObjectId + '' | 69 | this.publishCommentModel.targetRelObjectId = this.contentDetailData.reLInfo?.relObjectId + '' |
| 70 | this.publishCommentModel.keyArticle = this.contentDetailData.keyArticle + '' | 70 | this.publishCommentModel.keyArticle = this.contentDetailData.keyArticle + '' |
| 71 | - this.publishCommentModel.targetType = this.contentDetailData.newsType + ''*/ | 71 | + this.publishCommentModel.targetType = this.contentDetailData.newsType + '' |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | build() { | 74 | build() { |
| @@ -232,6 +232,7 @@ export struct OperRowListView { | @@ -232,6 +232,7 @@ export struct OperRowListView { | ||
| 232 | 232 | ||
| 233 | } | 233 | } |
| 234 | PageRepository.postExecuteCollectRecord(params).then(res => { | 234 | PageRepository.postExecuteCollectRecord(params).then(res => { |
| 235 | + // console.log(TAG, '收藏、取消收藏', 'toggleLikeStatus==',) | ||
| 235 | if (this.newsStatusOfUser) { | 236 | if (this.newsStatusOfUser) { |
| 236 | this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 | 237 | this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 |
| 237 | this.queryContentInteractCount() | 238 | this.queryContentInteractCount() |
| @@ -257,9 +258,7 @@ export struct OperRowListView { | @@ -257,9 +258,7 @@ export struct OperRowListView { | ||
| 257 | this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum) | 258 | this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum) |
| 258 | this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum) | 259 | this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum) |
| 259 | // 评论组件需要数据 | 260 | // 评论组件需要数据 |
| 260 | - if (Number.parseInt(this.interactData.commentNum) > Number.parseInt(this.publishCommentModel.totalCommentNumer)) { | ||
| 261 | - this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' || '0' | ||
| 262 | - } | 261 | + this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' || '0' |
| 263 | } | 262 | } |
| 264 | // console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res)) | 263 | // console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res)) |
| 265 | console.log(TAG, 'this.interactData', JSON.stringify(this.interactData)) | 264 | console.log(TAG, 'this.interactData', JSON.stringify(this.interactData)) |
| @@ -282,7 +282,7 @@ export class PageRepository { | @@ -282,7 +282,7 @@ export class PageRepository { | ||
| 282 | * @returns | 282 | * @returns |
| 283 | */ | 283 | */ |
| 284 | static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> { | 284 | static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> { |
| 285 | - let url = HttpUrlUtils.getExecuteCollcetUrl() | 285 | + let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD |
| 286 | return WDHttp.post(url, params) | 286 | return WDHttp.post(url, params) |
| 287 | } | 287 | } |
| 288 | 288 |
| @@ -288,7 +288,7 @@ export class ContentDetailRequest { | @@ -288,7 +288,7 @@ export class ContentDetailRequest { | ||
| 288 | * @returns | 288 | * @returns |
| 289 | */ | 289 | */ |
| 290 | static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> { | 290 | static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> { |
| 291 | - let url = HttpUrlUtils.getExecuteCollcetUrl() | 291 | + let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD |
| 292 | return WDHttp.post(url, params) | 292 | return WDHttp.post(url, params) |
| 293 | } | 293 | } |
| 294 | 294 |
-
Please register or login to post a comment