Showing
3 changed files
with
14 additions
and
5 deletions
| @@ -6,6 +6,7 @@ import { HttpUrlUtils, WDHttp } from '../../../../Index'; | @@ -6,6 +6,7 @@ import { HttpUrlUtils, WDHttp } from '../../../../Index'; | ||
| 6 | import { RefreshTokenRes } from '../bean/RefreshTokenRes'; | 6 | import { RefreshTokenRes } from '../bean/RefreshTokenRes'; |
| 7 | import { ResposeError } from '../bean/ResposeError'; | 7 | import { ResposeError } from '../bean/ResposeError'; |
| 8 | import { HttpUtils } from '../utils/HttpUtils'; | 8 | import { HttpUtils } from '../utils/HttpUtils'; |
| 9 | +// import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 9 | 10 | ||
| 10 | const TAG: string = 'HttpBizUtil' | 11 | const TAG: string = 'HttpBizUtil' |
| 11 | 12 |
| @@ -404,9 +404,17 @@ export struct ImageAndTextPageComponent { | @@ -404,9 +404,17 @@ export struct ImageAndTextPageComponent { | ||
| 404 | if (this.newsStatusOfUser) { | 404 | if (this.newsStatusOfUser) { |
| 405 | //内容点赞、取消点赞Tracking 1点赞 0取消点赞 | 405 | //内容点赞、取消点赞Tracking 1点赞 0取消点赞 |
| 406 | this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' | 406 | this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' |
| 407 | + if (this.newsStatusOfUser.likeStatus === '1') { | ||
| 408 | + this.likeNum = Number(this.likeNum) + 1 | ||
| 409 | + } else { | ||
| 410 | + this.likeNum = Number(this.likeNum) - 1 | ||
| 411 | + } | ||
| 407 | console.log(TAG, '点赞newsStatusOfUser.likeStatus ', this.newsStatusOfUser.likeStatus) | 412 | console.log(TAG, '点赞newsStatusOfUser.likeStatus ', this.newsStatusOfUser.likeStatus) |
| 408 | - this.queryContentInteractCount() | 413 | + // this.queryContentInteractCount() |
| 409 | TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My) | 414 | TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My) |
| 415 | + } else { | ||
| 416 | + // 初次进入详情页偶现获取失败,重新获取newsStatusOfUser对象 | ||
| 417 | + this.getInteractDataStatus() | ||
| 410 | } | 418 | } |
| 411 | 419 | ||
| 412 | }) | 420 | }) |
| 1 | -import { HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork'; | 1 | +import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork'; |
| 2 | import { DateTimeUtils, EmitterEventId, EmitterUtils, Logger, SPHelper, StringUtils } from 'wdKit'; | 2 | import { DateTimeUtils, EmitterEventId, EmitterUtils, Logger, SPHelper, StringUtils } from 'wdKit'; |
| 3 | 3 | ||
| 4 | import { | 4 | import { |
| @@ -322,7 +322,7 @@ export class PageRepository { | @@ -322,7 +322,7 @@ export class PageRepository { | ||
| 322 | */ | 322 | */ |
| 323 | static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> { | 323 | static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> { |
| 324 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE | 324 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE |
| 325 | - return WDHttp.post(url, params) | 325 | + return HttpBizUtil.post(url, params) |
| 326 | } | 326 | } |
| 327 | 327 | ||
| 328 | /** | 328 | /** |
| @@ -332,7 +332,7 @@ export class PageRepository { | @@ -332,7 +332,7 @@ export class PageRepository { | ||
| 332 | */ | 332 | */ |
| 333 | static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> { | 333 | static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> { |
| 334 | let url = HttpUrlUtils.getExecuteCollcetUrl() | 334 | let url = HttpUrlUtils.getExecuteCollcetUrl() |
| 335 | - return WDHttp.post(url, params) | 335 | + return HttpBizUtil.post(url, params) |
| 336 | } | 336 | } |
| 337 | 337 | ||
| 338 | /** | 338 | /** |
| @@ -364,7 +364,7 @@ export class PageRepository { | @@ -364,7 +364,7 @@ export class PageRepository { | ||
| 364 | */ | 364 | */ |
| 365 | private static postInteractAccentionOperateInfo(params: postInteractAccentionOperateParams): Promise<ResponseDTO> { | 365 | private static postInteractAccentionOperateInfo(params: postInteractAccentionOperateParams): Promise<ResponseDTO> { |
| 366 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_ACCENTION_OPERATION | 366 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_ACCENTION_OPERATION |
| 367 | - return WDHttp.post(url, params) | 367 | + return HttpBizUtil.post(url, params) |
| 368 | } | 368 | } |
| 369 | 369 | ||
| 370 | /** | 370 | /** |
-
Please register or login to post a comment