Showing
1 changed file
with
23 additions
and
31 deletions
| @@ -44,6 +44,7 @@ export struct MultiPictureDetailPageComponent { | @@ -44,6 +44,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 44 | private swiperController: SwiperController = new SwiperController() | 44 | private swiperController: SwiperController = new SwiperController() |
| 45 | @State swiperIndex: number = 0; | 45 | @State swiperIndex: number = 0; |
| 46 | @Provide followStatus: string | undefined = '0' // 关注状态 | 46 | @Provide followStatus: string | undefined = '0' // 关注状态 |
| 47 | + @State isShowButton: boolean = false // 展示关注按钮,默认不展示 | ||
| 47 | @Provide showCommentList: boolean = false | 48 | @Provide showCommentList: boolean = false |
| 48 | private scroller: Scroller = new Scroller() | 49 | private scroller: Scroller = new Scroller() |
| 49 | private listScroller: ListScroller = new ListScroller() | 50 | private listScroller: ListScroller = new ListScroller() |
| @@ -261,7 +262,7 @@ export struct MultiPictureDetailPageComponent { | @@ -261,7 +262,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 261 | .height(24) | 262 | .height(24) |
| 262 | .onClick(() => { | 263 | .onClick(() => { |
| 263 | this.handleAccention() | 264 | this.handleAccention() |
| 264 | - }) | 265 | + }).visibility(this.isShowButton ? Visibility.Visible : Visibility.None) |
| 265 | } else { | 266 | } else { |
| 266 | Button({ type: ButtonType.Normal, stateEffect: true }) { | 267 | Button({ type: ButtonType.Normal, stateEffect: true }) { |
| 267 | Row() { | 268 | Row() { |
| @@ -274,7 +275,7 @@ export struct MultiPictureDetailPageComponent { | @@ -274,7 +275,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 274 | .height(24) | 275 | .height(24) |
| 275 | .onClick(() => { | 276 | .onClick(() => { |
| 276 | this.handleAccention() | 277 | this.handleAccention() |
| 277 | - }) | 278 | + }).visibility(this.isShowButton ? Visibility.Visible : Visibility.None) |
| 278 | } | 279 | } |
| 279 | 280 | ||
| 280 | } | 281 | } |
| @@ -536,11 +537,11 @@ export struct MultiPictureDetailPageComponent { | @@ -536,11 +537,11 @@ export struct MultiPictureDetailPageComponent { | ||
| 536 | .then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { | 537 | .then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { |
| 537 | this.isOffLine = resDTO.data == null ? true : false | 538 | this.isOffLine = resDTO.data == null ? true : false |
| 538 | if (!resDTO || !resDTO.data) { | 539 | if (!resDTO || !resDTO.data) { |
| 539 | - Logger.error(TAG, 'fetchDetailData is empty'); | 540 | + // Logger.error(TAG, 'fetchDetailData is empty'); |
| 540 | return | 541 | return |
| 541 | } | 542 | } |
| 542 | if (resDTO.code != 0) { | 543 | if (resDTO.code != 0) { |
| 543 | - Logger.error(TAG, `fetchDetailData then code:${resDTO.code}, message:${resDTO.message}`); | 544 | + // Logger.error(TAG, `fetchDetailData then code:${resDTO.code}, message:${resDTO.message}`); |
| 544 | return | 545 | return |
| 545 | } | 546 | } |
| 546 | this.netStatus = undefined | 547 | this.netStatus = undefined |
| @@ -565,9 +566,9 @@ export struct MultiPictureDetailPageComponent { | @@ -565,9 +566,9 @@ export struct MultiPictureDetailPageComponent { | ||
| 565 | // 暂无内容 | 566 | // 暂无内容 |
| 566 | this.netStatus = 0 | 567 | this.netStatus = 0 |
| 567 | this.operationButtonList = [] | 568 | this.operationButtonList = [] |
| 568 | - Logger.info(TAG, `this.netStatus:${JSON.stringify(this.netStatus)}`) | 569 | + // Logger.info(TAG, `this.netStatus:${JSON.stringify(this.netStatus)}`) |
| 569 | } | 570 | } |
| 570 | - Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`) | 571 | + // Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`) |
| 571 | // 未登录,跳转登录 | 572 | // 未登录,跳转登录 |
| 572 | const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') | 573 | const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') |
| 573 | if (user_id) { | 574 | if (user_id) { |
| @@ -576,7 +577,7 @@ export struct MultiPictureDetailPageComponent { | @@ -576,7 +577,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 576 | } | 577 | } |
| 577 | }) | 578 | }) |
| 578 | .catch((err: Error) => { | 579 | .catch((err: Error) => { |
| 579 | - console.log(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`); | 580 | + // console.log(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`); |
| 580 | // 内容获取失败 | 581 | // 内容获取失败 |
| 581 | this.netStatus = 9 | 582 | this.netStatus = 9 |
| 582 | this.operationButtonList = [] | 583 | this.operationButtonList = [] |
| @@ -592,35 +593,26 @@ export struct MultiPictureDetailPageComponent { | @@ -592,35 +593,26 @@ export struct MultiPictureDetailPageComponent { | ||
| 592 | 593 | ||
| 593 | // 记录浏览历史 | 594 | // 记录浏览历史 |
| 594 | private getInteractBrowsOperate() { | 595 | private getInteractBrowsOperate() { |
| 595 | - try { | ||
| 596 | - const params: postInteractBrowsOperateParams = { | ||
| 597 | - delStatus: 0, | ||
| 598 | - contentList: [{ | ||
| 599 | - browseTime: DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN), | ||
| 600 | - contentId: this.contentDetailData?.newsId + '', | ||
| 601 | - contentType: this.contentDetailData?.newsType || 0, | ||
| 602 | - }] | ||
| 603 | - } | ||
| 604 | - MultiPictureDetailViewModel.getInteractBrowsOperate(params).then(res => { | ||
| 605 | - console.log(TAG, '记录浏览历史==', JSON.stringify(res.data)) | ||
| 606 | - }) | ||
| 607 | - } catch (exception) { | ||
| 608 | - | 596 | + const params: postInteractBrowsOperateParams = { |
| 597 | + delStatus: 0, | ||
| 598 | + contentList: [{ | ||
| 599 | + browseTime: DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN), | ||
| 600 | + contentId: this.contentDetailData?.newsId + '', | ||
| 601 | + contentType: this.contentDetailData?.newsType || 0, | ||
| 602 | + }] | ||
| 609 | } | 603 | } |
| 604 | + MultiPictureDetailViewModel.getInteractBrowsOperate(params) | ||
| 610 | } | 605 | } |
| 611 | 606 | ||
| 612 | // 已登录->批量查作品是否被号主关注 | 607 | // 已登录->批量查作品是否被号主关注 |
| 613 | private async getBatchAttentionStatus() { | 608 | private async getBatchAttentionStatus() { |
| 614 | - try { | ||
| 615 | - const params: postBatchAttentionStatusParams = { | ||
| 616 | - creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }] | ||
| 617 | - } | ||
| 618 | - let data = await MultiPictureDetailViewModel.getBatchAttentionStatus(params) | ||
| 619 | - this.followStatus = data[0]?.status; | ||
| 620 | - Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`) | ||
| 621 | - } catch (exception) { | ||
| 622 | - | 609 | + const params: postBatchAttentionStatusParams = { |
| 610 | + creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }] | ||
| 623 | } | 611 | } |
| 612 | + let data = await MultiPictureDetailViewModel.getBatchAttentionStatus(params) | ||
| 613 | + this.followStatus = data[0]?.status; | ||
| 614 | + this.isShowButton = true | ||
| 615 | + // Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`) | ||
| 624 | } | 616 | } |
| 625 | 617 | ||
| 626 | /** | 618 | /** |
| @@ -643,7 +635,7 @@ export struct MultiPictureDetailPageComponent { | @@ -643,7 +635,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 643 | status: this.followStatus == '1' ? 0 : 1, | 635 | status: this.followStatus == '1' ? 0 : 1, |
| 644 | } | 636 | } |
| 645 | PageRepository.postInteractAccentionOperate(params).then(res => { | 637 | PageRepository.postInteractAccentionOperate(params).then(res => { |
| 646 | - console.log(TAG, '关注号主==', JSON.stringify(res.data)) | 638 | + // console.log(TAG, '关注号主==', JSON.stringify(res.data)) |
| 647 | if (this.followStatus == '1') { | 639 | if (this.followStatus == '1') { |
| 648 | this.followStatus = '0' | 640 | this.followStatus = '0' |
| 649 | TrackingContent.follow(true,this.followUserId,this.followUserName,TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,this.pageParam) | 641 | TrackingContent.follow(true,this.followUserId,this.followUserName,TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,this.pageParam) |
-
Please register or login to post a comment