Showing
6 changed files
with
25 additions
and
25 deletions
| @@ -46,10 +46,6 @@ export class HttpUrlUtils { | @@ -46,10 +46,6 @@ 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 | - /** | ||
| 53 | * 关注号主 | 49 | * 关注号主 |
| 54 | */ | 50 | */ |
| 55 | static readonly INTERACT_ACCENTION_OPERATION: string = "/api/rmrb-interact/interact/zh/c/attention/operation"; | 51 | 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 = {} as publishCommentModel | 41 | + @State publishCommentModel: publishCommentModel = new publishCommentModel() |
| 42 | 42 | ||
| 43 | build() { | 43 | build() { |
| 44 | Column() { | 44 | Column() { |
| @@ -142,7 +142,10 @@ export struct ImageAndTextPageComponent { | @@ -142,7 +142,10 @@ export struct ImageAndTextPageComponent { | ||
| 142 | 142 | ||
| 143 | //底部交互区 | 143 | //底部交互区 |
| 144 | if (this.contentDetailData?.length) { | 144 | if (this.contentDetailData?.length) { |
| 145 | - OperRowListView({ contentDetailData: this.contentDetailData[0] }) | 145 | + OperRowListView({ |
| 146 | + contentDetailData: this.contentDetailData[0], | ||
| 147 | + publishCommentModel: this.publishCommentModel | ||
| 148 | + }) | ||
| 146 | } | 149 | } |
| 147 | } | 150 | } |
| 148 | 151 |
| @@ -30,21 +30,21 @@ const TAG = 'OperRowListView'; | @@ -30,21 +30,21 @@ const TAG = 'OperRowListView'; | ||
| 30 | * comment--评论;like--点赞;collect--收藏;share--分享; | 30 | * comment--评论;like--点赞;collect--收藏;share--分享; |
| 31 | * | 31 | * |
| 32 | * 传值示例: | 32 | * 传值示例: |
| 33 | - OperRowListView({ | ||
| 34 | - contentDetailData: this.contentDetailData[0], | ||
| 35 | - operationButtonList: ['comment', 'like', 'collect', 'share'] | ||
| 36 | - }) | 33 | + OperRowListView({ |
| 34 | + contentDetailData: this.contentDetailData[0], | ||
| 35 | + operationButtonList: ['comment', 'like', 'collect', 'share'] | ||
| 36 | + }) | ||
| 37 | */ | 37 | */ |
| 38 | @Preview | 38 | @Preview |
| 39 | @Component | 39 | @Component |
| 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 | ||
| 43 | // @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO | 44 | // @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO |
| 44 | @State interactData: InteractDataDTO = {} as InteractDataDTO | 45 | @State interactData: InteractDataDTO = {} as InteractDataDTO |
| 45 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 | 46 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 |
| 46 | @State likeBean: Record<string, string> = {} | 47 | @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 + '' | ||
| 66 | - this.publishCommentModel.targetRelId = this.contentDetailData.reLInfo?.relId + '' | ||
| 67 | - this.publishCommentModel.targetTitle = this.contentDetailData.newsTitle + '' | ||
| 68 | - this.publishCommentModel.targetRelType = this.contentDetailData.reLInfo?.relType + '' | ||
| 69 | - this.publishCommentModel.targetRelObjectId = this.contentDetailData.reLInfo?.relObjectId + '' | ||
| 70 | - this.publishCommentModel.keyArticle = this.contentDetailData.keyArticle + '' | ||
| 71 | - this.publishCommentModel.targetType = this.contentDetailData.newsType + '' | 65 | + /* this.publishCommentModel.targetId = this.contentDetailData.newsId + '' |
| 66 | + this.publishCommentModel.targetRelId = this.contentDetailData.reLInfo?.relId + '' | ||
| 67 | + this.publishCommentModel.targetTitle = this.contentDetailData.newsTitle + '' | ||
| 68 | + this.publishCommentModel.targetRelType = this.contentDetailData.reLInfo?.relType + '' | ||
| 69 | + this.publishCommentModel.targetRelObjectId = this.contentDetailData.reLInfo?.relObjectId + '' | ||
| 70 | + this.publishCommentModel.keyArticle = this.contentDetailData.keyArticle + '' | ||
| 71 | + this.publishCommentModel.targetType = this.contentDetailData.newsType + ''*/ | ||
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | build() { | 74 | build() { |
| @@ -232,7 +232,6 @@ export struct OperRowListView { | @@ -232,7 +232,6 @@ export struct OperRowListView { | ||
| 232 | 232 | ||
| 233 | } | 233 | } |
| 234 | PageRepository.postExecuteCollectRecord(params).then(res => { | 234 | PageRepository.postExecuteCollectRecord(params).then(res => { |
| 235 | - // console.log(TAG, '收藏、取消收藏', 'toggleLikeStatus==',) | ||
| 236 | if (this.newsStatusOfUser) { | 235 | if (this.newsStatusOfUser) { |
| 237 | this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 | 236 | this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 |
| 238 | this.queryContentInteractCount() | 237 | this.queryContentInteractCount() |
| @@ -258,7 +257,9 @@ export struct OperRowListView { | @@ -258,7 +257,9 @@ export struct OperRowListView { | ||
| 258 | this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum) | 257 | this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum) |
| 259 | this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum) | 258 | this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum) |
| 260 | // 评论组件需要数据 | 259 | // 评论组件需要数据 |
| 261 | - this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' || '0' | 260 | + if (Number.parseInt(this.interactData.commentNum) > Number.parseInt(this.publishCommentModel.totalCommentNumer)) { |
| 261 | + this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' || '0' | ||
| 262 | + } | ||
| 262 | } | 263 | } |
| 263 | // console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res)) | 264 | // console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res)) |
| 264 | console.log(TAG, 'this.interactData', JSON.stringify(this.interactData)) | 265 | console.log(TAG, 'this.interactData', JSON.stringify(this.interactData)) |
| @@ -283,7 +283,7 @@ export class PageRepository { | @@ -283,7 +283,7 @@ export class PageRepository { | ||
| 283 | * @returns | 283 | * @returns |
| 284 | */ | 284 | */ |
| 285 | static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> { | 285 | static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> { |
| 286 | - let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD | 286 | + let url = HttpUrlUtils.getExecuteCollcetUrl() |
| 287 | return WDHttp.post(url, params) | 287 | return WDHttp.post(url, params) |
| 288 | } | 288 | } |
| 289 | 289 |
| @@ -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.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD | 291 | + let url = HttpUrlUtils.getExecuteCollcetUrl() |
| 292 | return WDHttp.post(url, params) | 292 | return WDHttp.post(url, params) |
| 293 | } | 293 | } |
| 294 | 294 |
-
Please register or login to post a comment