Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: fix: 18091 健康频道>轮播图卡配置为投票活动交互问题 fix: 19530 【UI走查-卡片】折叠屏展开-人民号无图卡 fix: 动态详情点赞,返回信息流列表页,点赞效果未回显 fix |> 通过桌面组件进入早晚报详情页后返回上一级未能返回到早晚报专题页 fix |> 稿件详情页面,下方的推荐阅读和最新评论, 没有与内容左对齐 fix |> 桌面组件--早晚报中含有专题页内容时桌面组件无法跳转对应的专题页 ref |> 消息推送--uat环境app的消息数量阅读后数量一直不变 fix |> 稿件详情,热门评论与最新评论的分割线高度不够,较细 ref |> 修复点击文字直播进入直播详情提示内容不存在问题 fix: 进入动态视频详情页,播放视频,实际播放视频非对应动态的视频 fix |> 【8.0新需求】设备拉黑功能未实现;
Showing
21 changed files
with
176 additions
and
67 deletions
| @@ -14,6 +14,9 @@ export class AppUtils { | @@ -14,6 +14,9 @@ export class AppUtils { | ||
| 14 | AppUtils.buildVersion = BuildProfile.BUILD_VERSION; | 14 | AppUtils.buildVersion = BuildProfile.BUILD_VERSION; |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | + // 全局应用context | ||
| 18 | + public static gotApplicationContextFunc?: () => common.UIAbilityContext | ||
| 19 | + | ||
| 17 | /** | 20 | /** |
| 18 | * 获取应用名称 | 21 | * 获取应用名称 |
| 19 | * 即:人民日报 | 22 | * 即:人民日报 |
| @@ -6,6 +6,7 @@ import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' | @@ -6,6 +6,7 @@ import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' | ||
| 6 | import { Logger } from 'wdKit/Index' | 6 | import { Logger } from 'wdKit/Index' |
| 7 | import { ContentType } from '../common/ContentType' | 7 | import { ContentType } from '../common/ContentType' |
| 8 | import { WDRouterRule } from '../router/WDRouterRule' | 8 | import { WDRouterRule } from '../router/WDRouterRule' |
| 9 | +import HomeChannelUtils from './HomeChannelUtils' | ||
| 9 | import { ProcessUtils } from './ProcessUtils' | 10 | import { ProcessUtils } from './ProcessUtils' |
| 10 | 11 | ||
| 11 | const TAG = "AppInnerLink" | 12 | const TAG = "AppInnerLink" |
| @@ -123,8 +124,18 @@ export class AppInnerLink { | @@ -123,8 +124,18 @@ export class AppInnerLink { | ||
| 123 | WDRouterRule.jumpWithAction(taskAction) | 124 | WDRouterRule.jumpWithAction(taskAction) |
| 124 | } | 125 | } |
| 125 | 126 | ||
| 126 | - if (params.type == "channel") { | 127 | + if (params.type == "topic" && params.subType == "audio_news") { |
| 128 | + } | ||
| 129 | + if (params.type == "topic" && params.subType == "moring_evening_news") { | ||
| 130 | + ProcessUtils.gotoMorningEveningPaper() | ||
| 131 | + } | ||
| 127 | 132 | ||
| 133 | + if (params.type == "channel") { | ||
| 134 | + if (params.subType == "electronic_newspapers") { | ||
| 135 | + ProcessUtils.gotoENewsPaper(); | ||
| 136 | + return | ||
| 137 | + } | ||
| 138 | + HomeChannelUtils.jumpChannelTab(params.firstChannelId ?? "", params.pageId ?? "", "") | ||
| 128 | } | 139 | } |
| 129 | 140 | ||
| 130 | } | 141 | } |
| @@ -12,14 +12,16 @@ export class AppInnerLinkGenerator { | @@ -12,14 +12,16 @@ export class AppInnerLinkGenerator { | ||
| 12 | 12 | ||
| 13 | static generateDeepLinkWithProgram(content: ContentDTO) { | 13 | static generateDeepLinkWithProgram(content: ContentDTO) { |
| 14 | 14 | ||
| 15 | - return AppInnerLinkGenerator.generate(Number(content.objectType), content.objectId +'', content.relId, content.linkUrl) | 15 | + return AppInnerLinkGenerator.generate(Number(content.objectType), content.objectId +'', content.relId |
| 16 | + , content.linkUrl, content.pageId, Number(content.objectLevel)) | ||
| 16 | } | 17 | } |
| 17 | 18 | ||
| 18 | static generateDeepLinkWithFrontObjectLink(content: FrontLinkObject) { | 19 | static generateDeepLinkWithFrontObjectLink(content: FrontLinkObject) { |
| 19 | - return AppInnerLinkGenerator.generate(Number(content.newsType), content.newsId +'', content.newsRelId + '', content.linkUrl) | 20 | + return AppInnerLinkGenerator.generate(Number(content.newsType), content.newsId +'' |
| 21 | + , content.newsRelId + '', content.linkUrl, content.newsPageId, Number(content.newsLevel)) | ||
| 20 | } | 22 | } |
| 21 | 23 | ||
| 22 | - static generate(contentType: number, contentId?: string, relId?: string, link?: string): string { | 24 | + static generate(contentType: number, contentId?: string, relId?: string, link?: string, pageId?: string, objectLevel?: number): string { |
| 23 | let deeplink = AppInnerLinkGenerator.DEEP_LINK_PREFIX | 25 | let deeplink = AppInnerLinkGenerator.DEEP_LINK_PREFIX |
| 24 | 26 | ||
| 25 | let pubParam = `&contentId=${contentId ?? ""}&relId=${relId ?? ""}&skipType=1` | 27 | let pubParam = `&contentId=${contentId ?? ""}&relId=${relId ?? ""}&skipType=1` |
| @@ -55,6 +57,20 @@ export class AppInnerLinkGenerator { | @@ -55,6 +57,20 @@ export class AppInnerLinkGenerator { | ||
| 55 | case ContentType.Ask: | 57 | case ContentType.Ask: |
| 56 | deeplink += "?type=ask" | 58 | deeplink += "?type=ask" |
| 57 | break | 59 | break |
| 60 | + case ContentType.Subject: | ||
| 61 | + if (objectLevel && objectLevel == 25) { // 早晚报专题 | ||
| 62 | + deeplink += `?type=topic&subType=moring_evening_news&pageId=${pageId}&relId=${relId}&skipType=1` | ||
| 63 | + return deeplink | ||
| 64 | + } | ||
| 65 | + if (objectLevel && objectLevel == 22) { // 音频专题 | ||
| 66 | + deeplink += `?type=topic&subType=audio_news&pageId=${pageId}&relId=${relId}&skipType=1` | ||
| 67 | + return deeplink | ||
| 68 | + } | ||
| 69 | + if (link) { | ||
| 70 | + deeplink += `?type=topic&subType=h5&pageId=${pageId}&relId=&url=${encodeURIComponent(link)}&skipType=1` | ||
| 71 | + return deeplink | ||
| 72 | + } | ||
| 73 | + break | ||
| 58 | default: | 74 | default: |
| 59 | pubParam = "" | 75 | pubParam = "" |
| 60 | break; | 76 | break; |
| @@ -4,9 +4,9 @@ export interface FrontLinkObject { | @@ -4,9 +4,9 @@ export interface FrontLinkObject { | ||
| 4 | linkUrl: string; | 4 | linkUrl: string; |
| 5 | newsId: string; | 5 | newsId: string; |
| 6 | newsLevel: string; | 6 | newsLevel: string; |
| 7 | - // newsPageId?: any; | 7 | + newsPageId: string; |
| 8 | newsRelId: number; | 8 | newsRelId: number; |
| 9 | - // newsRelType?: any; | 9 | + newsRelType: string; |
| 10 | newsType: number; | 10 | newsType: number; |
| 11 | publishTime: string; | 11 | publishTime: string; |
| 12 | source: string; | 12 | source: string; |
| 1 | -import { SPHelper, Logger, ToastUtils } from 'wdKit'; | 1 | +import { SPHelper, Logger, ToastUtils, EmitterUtils, EmitterEventId } from 'wdKit'; |
| 2 | import { ContentDetailDTO, Action, ContentDTO, batchLikeAndCollectResult } from 'wdBean'; | 2 | import { ContentDetailDTO, Action, ContentDTO, batchLikeAndCollectResult } from 'wdBean'; |
| 3 | import { ProcessUtils } from 'wdRouter'; | 3 | import { ProcessUtils } from 'wdRouter'; |
| 4 | import router from '@ohos.router'; | 4 | import router from '@ohos.router'; |
| @@ -11,6 +11,11 @@ import { TrackConstants } from 'wdTracking/Index'; | @@ -11,6 +11,11 @@ import { TrackConstants } from 'wdTracking/Index'; | ||
| 11 | 11 | ||
| 12 | const TAG = 'CarderInteraction' | 12 | const TAG = 'CarderInteraction' |
| 13 | 13 | ||
| 14 | +interface parsedObj { | ||
| 15 | + contentId: string, | ||
| 16 | + likeStatus: string | ||
| 17 | +} | ||
| 18 | + | ||
| 14 | /** | 19 | /** |
| 15 | * 卡片 分享、评论、点赞公用组件 | 20 | * 卡片 分享、评论、点赞公用组件 |
| 16 | */ | 21 | */ |
| @@ -47,6 +52,25 @@ export struct CarderInteraction { | @@ -47,6 +52,25 @@ export struct CarderInteraction { | ||
| 47 | // console.log(TAG, 'this.isShowComment', this.isShowComment) | 52 | // console.log(TAG, 'this.isShowComment', this.isShowComment) |
| 48 | // console.log(TAG, 'this.isShowLike', this.isShowLike) | 53 | // console.log(TAG, 'this.isShowLike', this.isShowLike) |
| 49 | // console.log(TAG, 'router.getState().name', router.getState().name) | 54 | // console.log(TAG, 'router.getState().name', router.getState().name) |
| 55 | + EmitterUtils.receiveEvent(EmitterEventId.LIKE_CHANGE_STATUS, (val: string | undefined) => { | ||
| 56 | + // console.log(TAG,'val点赞', val) | ||
| 57 | + if (val === undefined) { | ||
| 58 | + console.error('Value is undefined'); | ||
| 59 | + return; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + try { | ||
| 63 | + const parsedVal: parsedObj = JSON.parse(val); | ||
| 64 | + if (parsedVal.contentId === this.contentDetailData.newsId + '') { | ||
| 65 | + // console.log(TAG,'params点赞状态', parsedVal.likeStatus) | ||
| 66 | + this.likeBean['likeStatus'] = parsedVal.likeStatus | ||
| 67 | + // console.log(TAG,'this.likeBean点赞状态', this.likeBean['likeStatus']) | ||
| 68 | + } | ||
| 69 | + } catch (error) { | ||
| 70 | + console.error('Error parsing JSON:', error); | ||
| 71 | + } | ||
| 72 | + }); | ||
| 73 | + | ||
| 50 | } | 74 | } |
| 51 | 75 | ||
| 52 | 76 |
| @@ -53,6 +53,11 @@ import { onlyWifiLoadImg } from '../utils/lazyloadImg'; | @@ -53,6 +53,11 @@ import { onlyWifiLoadImg } from '../utils/lazyloadImg'; | ||
| 53 | const TAG = 'DynamicDetailComponent' | 53 | const TAG = 'DynamicDetailComponent' |
| 54 | const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; | 54 | const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; |
| 55 | 55 | ||
| 56 | +interface parsedObj { | ||
| 57 | + contentId: string, | ||
| 58 | + likeStatus: string | ||
| 59 | +} | ||
| 60 | + | ||
| 56 | 61 | ||
| 57 | /** | 62 | /** |
| 58 | * 动态详情页UI | 63 | * 动态详情页UI |
| @@ -641,7 +646,7 @@ export struct DynamicDetailComponent { | @@ -641,7 +646,7 @@ export struct DynamicDetailComponent { | ||
| 641 | 646 | ||
| 642 | // 评论 | 647 | // 评论 |
| 643 | if (this.contentDetailData?.openComment) { | 648 | if (this.contentDetailData?.openComment) { |
| 644 | - Divider().strokeWidth(6).color('#f5f5f5').margin({ top: $r('app.float.margin_24') }) | 649 | + Divider().strokeWidth(8).color('#f5f5f5').margin({ top: $r('app.float.margin_24') }) |
| 645 | CommentComponent({ | 650 | CommentComponent({ |
| 646 | publishCommentModel: this.publishCommentModel | 651 | publishCommentModel: this.publishCommentModel |
| 647 | }) | 652 | }) |
| @@ -782,11 +787,11 @@ export struct DynamicDetailComponent { | @@ -782,11 +787,11 @@ export struct DynamicDetailComponent { | ||
| 782 | } | 787 | } |
| 783 | ] | 788 | ] |
| 784 | } | 789 | } |
| 785 | - console.error(TAG, JSON.stringify(this.contentDetailData)) | 790 | + // console.error(TAG,'CarderInteraction', JSON.stringify(params.contentList)) |
| 786 | let data = await MultiPictureDetailViewModel.getInteractDataStatus(params) | 791 | let data = await MultiPictureDetailViewModel.getInteractDataStatus(params) |
| 787 | - console.error(TAG, '查询用户对作品点赞、收藏状态', JSON.stringify(data)) | 792 | + // console.error(TAG, 'CarderInteraction 查询用户对作品点赞、收藏状态', JSON.stringify(data)) |
| 788 | this.newsStatusOfUser = data[0]; | 793 | this.newsStatusOfUser = data[0]; |
| 789 | - Logger.info(TAG, `newsStatusOfUser:${JSON.stringify(this.newsStatusOfUser)}`) | 794 | + // Logger.info(TAG, `newsStatusOfUser:${JSON.stringify(this.newsStatusOfUser)}`) |
| 790 | } catch (exception) { | 795 | } catch (exception) { |
| 791 | console.error(TAG, JSON.stringify(exception)) | 796 | console.error(TAG, JSON.stringify(exception)) |
| 792 | } | 797 | } |
| @@ -808,7 +813,7 @@ export struct DynamicDetailComponent { | @@ -808,7 +813,7 @@ export struct DynamicDetailComponent { | ||
| 808 | } | 813 | } |
| 809 | let data = await MultiPictureDetailViewModel.getBatchAttentionStatus(params) | 814 | let data = await MultiPictureDetailViewModel.getBatchAttentionStatus(params) |
| 810 | this.followStatus = data[0]?.status; | 815 | this.followStatus = data[0]?.status; |
| 811 | - Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`) | 816 | + // Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`) |
| 812 | } catch (exception) { | 817 | } catch (exception) { |
| 813 | this.followStatus = '0'; | 818 | this.followStatus = '0'; |
| 814 | } | 819 | } |
| @@ -882,7 +887,7 @@ export struct DynamicDetailComponent { | @@ -882,7 +887,7 @@ export struct DynamicDetailComponent { | ||
| 882 | status: this.followStatus == '0' ? 1 : 0, | 887 | status: this.followStatus == '0' ? 1 : 0, |
| 883 | } | 888 | } |
| 884 | ContentDetailRequest.postInteractAccentionOperate(params2).then(res => { | 889 | ContentDetailRequest.postInteractAccentionOperate(params2).then(res => { |
| 885 | - console.log('关注号主==', JSON.stringify(res.data)) | 890 | + // console.log('关注号主==', JSON.stringify(res.data)) |
| 886 | if (this.followStatus == '1') { | 891 | if (this.followStatus == '1') { |
| 887 | this.followStatus = '0' | 892 | this.followStatus = '0' |
| 888 | TrackingContent.follow(true,this.contentDetailData.rmhInfo == null ?"":this.contentDetailData.rmhInfo.rmhId,this.contentDetailData.rmhInfo == null ?"":this.contentDetailData.rmhInfo.rmhName,TrackConstants.PageName.DynamicDetail,TrackConstants.PageName.DynamicDetail,this.pageParam) | 893 | TrackingContent.follow(true,this.contentDetailData.rmhInfo == null ?"":this.contentDetailData.rmhInfo.rmhId,this.contentDetailData.rmhInfo == null ?"":this.contentDetailData.rmhInfo.rmhName,TrackConstants.PageName.DynamicDetail,TrackConstants.PageName.DynamicDetail,this.pageParam) |
| @@ -915,7 +920,14 @@ export struct DynamicDetailComponent { | @@ -915,7 +920,14 @@ export struct DynamicDetailComponent { | ||
| 915 | } else { | 920 | } else { |
| 916 | this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) - 1 | 921 | this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) - 1 |
| 917 | } | 922 | } |
| 918 | - console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactDataDTO?.likeNum) | 923 | + let parsedVal: parsedObj = { |
| 924 | + contentId: params.contentId, | ||
| 925 | + likeStatus: this.newsStatusOfUser.likeStatus | ||
| 926 | + } | ||
| 927 | + | ||
| 928 | + EmitterUtils.sendEvent(EmitterEventId.LIKE_CHANGE_STATUS, JSON.stringify(parsedVal)) | ||
| 929 | + // console.log(TAG, 'CarderInteraction 点赞parsedVal', JSON.stringify(parsedVal)) | ||
| 930 | + // console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactDataDTO?.likeNum) | ||
| 919 | 931 | ||
| 920 | //内容点赞、取消点赞Tracking 1点赞 0取消点赞 | 932 | //内容点赞、取消点赞Tracking 1点赞 0取消点赞 |
| 921 | TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.DynamicDetail, TrackConstants.PageName.DynamicDetail, | 933 | TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.DynamicDetail, TrackConstants.PageName.DynamicDetail, |
| @@ -190,12 +190,12 @@ export struct ImageAndTextPageComponent { | @@ -190,12 +190,12 @@ export struct ImageAndTextPageComponent { | ||
| 190 | .justifyContent(FlexAlign.Center) | 190 | .justifyContent(FlexAlign.Center) |
| 191 | } | 191 | } |
| 192 | if (this.recommendList.length > 0) { | 192 | if (this.recommendList.length > 0) { |
| 193 | - Divider().strokeWidth(6).color('#f5f5f5') | 193 | + Divider().strokeWidth(8).color('#f5f5f5') |
| 194 | RecommendList({ recommendList: this.recommendList }) | 194 | RecommendList({ recommendList: this.recommendList }) |
| 195 | } | 195 | } |
| 196 | // 评论 | 196 | // 评论 |
| 197 | if (this.contentDetailData?.openComment) { | 197 | if (this.contentDetailData?.openComment) { |
| 198 | - Divider().strokeWidth(6).color('#f5f5f5') | 198 | + Divider().strokeWidth(8).color('#f5f5f5') |
| 199 | CommentComponent({ | 199 | CommentComponent({ |
| 200 | publishCommentModel: this.publishCommentModel, | 200 | publishCommentModel: this.publishCommentModel, |
| 201 | fixedHeightMode: false, | 201 | fixedHeightMode: false, |
| @@ -440,10 +440,10 @@ export struct ImageAndTextPageComponent { | @@ -440,10 +440,10 @@ export struct ImageAndTextPageComponent { | ||
| 440 | userName:this.contentDetailData?.userInfo?.userName || '' + '', | 440 | userName:this.contentDetailData?.userInfo?.userName || '' + '', |
| 441 | channelId:String(this.contentDetailData?.reLInfo?.channelId) || '' + '' | 441 | channelId:String(this.contentDetailData?.reLInfo?.channelId) || '' + '' |
| 442 | } | 442 | } |
| 443 | - console.log(TAG, '点赞、取消点赞params', JSON.stringify(params)) | 443 | + // console.log(TAG, '点赞、取消点赞params', JSON.stringify(params)) |
| 444 | PageRepository.postExecuteLike(params).then(res => { | 444 | PageRepository.postExecuteLike(params).then(res => { |
| 445 | // console.log(TAG, '点赞、res', JSON.stringify(res)) | 445 | // console.log(TAG, '点赞、res', JSON.stringify(res)) |
| 446 | - console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) | 446 | + // console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) |
| 447 | if (this.newsStatusOfUser) { | 447 | if (this.newsStatusOfUser) { |
| 448 | //内容点赞、取消点赞Tracking 1点赞 0取消点赞 | 448 | //内容点赞、取消点赞Tracking 1点赞 0取消点赞 |
| 449 | this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' | 449 | this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' |
| @@ -452,7 +452,7 @@ export struct ImageAndTextPageComponent { | @@ -452,7 +452,7 @@ export struct ImageAndTextPageComponent { | ||
| 452 | } else { | 452 | } else { |
| 453 | this.likeNum = Number(this.likeNum) - 1 | 453 | this.likeNum = Number(this.likeNum) - 1 |
| 454 | } | 454 | } |
| 455 | - console.log(TAG, '点赞newsStatusOfUser.likeStatus ', this.newsStatusOfUser.likeStatus) | 455 | + // console.log(TAG, '点赞newsStatusOfUser.likeStatus ', this.newsStatusOfUser.likeStatus) |
| 456 | // this.queryContentInteractCount() | 456 | // this.queryContentInteractCount() |
| 457 | TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My) | 457 | TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My) |
| 458 | } else { | 458 | } else { |
| @@ -131,11 +131,11 @@ export struct RmhTitle { | @@ -131,11 +131,11 @@ export struct RmhTitle { | ||
| 131 | build() { | 131 | build() { |
| 132 | Flex() { | 132 | Flex() { |
| 133 | Stack() { | 133 | Stack() { |
| 134 | - Image(this.loadImg ? this.rmhInfo?.rmhHeadUrl : this.rmhInfo.userType == '1'?$r('app.media.default_head_userPage'):$r('app.media.comment_rmh_tag')) | ||
| 135 | - .alt(this.rmhInfo.userType == '1'?$r('app.media.default_head_userPage'):$r('app.media.comment_rmh_tag')) | 134 | + Image(this.loadImg ? this.rmhInfo?.rmhHeadUrl : this.rmhInfo.userType == '1'?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon')) |
| 135 | + .alt(this.rmhInfo.userType == '1'?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon')) | ||
| 136 | .width(36) | 136 | .width(36) |
| 137 | .height(36) | 137 | .height(36) |
| 138 | - .borderRadius(50) | 138 | + .borderRadius(18) |
| 139 | .border({ | 139 | .border({ |
| 140 | width: 0.5, | 140 | width: 0.5, |
| 141 | color: '#0D000000', // 5% 透明度的黑色 | 141 | color: '#0D000000', // 5% 透明度的黑色 |
| @@ -28,7 +28,7 @@ export struct Card19Component { | @@ -28,7 +28,7 @@ export struct Card19Component { | ||
| 28 | this.titleInit(); | 28 | this.titleInit(); |
| 29 | const curRouter = router.getState().name; | 29 | const curRouter = router.getState().name; |
| 30 | this.clicked = hasClicked(this.contentDTO.objectId, curRouter) | 30 | this.clicked = hasClicked(this.contentDTO.objectId, curRouter) |
| 31 | - console.log('card19',JSON.stringify(this.contentDTO)) | 31 | + // console.log('card19',JSON.stringify(this.contentDTO)) |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | titleInit() { | 34 | titleInit() { |
| @@ -132,7 +132,7 @@ export struct CommentComponent { | @@ -132,7 +132,7 @@ export struct CommentComponent { | ||
| 132 | Column() { | 132 | Column() { |
| 133 | if (showGapLine) { | 133 | if (showGapLine) { |
| 134 | Blank().height(12) | 134 | Blank().height(12) |
| 135 | - Divider().strokeWidth(6).color('#f5f5f5') | 135 | + Divider().strokeWidth(8).color('#f5f5f5') |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | Row() { | 138 | Row() { |
| @@ -427,7 +427,7 @@ struct ChildCommentItem { | @@ -427,7 +427,7 @@ struct ChildCommentItem { | ||
| 427 | @Link dialogController: CustomDialogController | null | 427 | @Link dialogController: CustomDialogController | null |
| 428 | @ObjectLink item: commentItemModel | 428 | @ObjectLink item: commentItemModel |
| 429 | @Consume contentDetailData: ContentDetailDTO | 429 | @Consume contentDetailData: ContentDetailDTO |
| 430 | - | 430 | + private leftGap: number = 95 + 4 |
| 431 | @Consume inDialog: boolean | 431 | @Consume inDialog: boolean |
| 432 | private dialogBeforeJumpOtherPageAction: () => void = () => {} | 432 | private dialogBeforeJumpOtherPageAction: () => void = () => {} |
| 433 | 433 | ||
| @@ -490,14 +490,14 @@ struct ChildCommentItem { | @@ -490,14 +490,14 @@ struct ChildCommentItem { | ||
| 490 | fontWeight: FontWeight.Regular, | 490 | fontWeight: FontWeight.Regular, |
| 491 | marginWidth: (95 + 16) | 491 | marginWidth: (95 + 16) |
| 492 | }) | 492 | }) |
| 493 | - .margin({ left: 95, right: 16, top: -15 }) | 493 | + .margin({ left: this.leftGap, right: 16, top: -15 }) |
| 494 | .onClick(() => { | 494 | .onClick(() => { |
| 495 | this.replyComment() | 495 | this.replyComment() |
| 496 | }) | 496 | }) |
| 497 | if (this.item.commentPics.length > 0) { | 497 | if (this.item.commentPics.length > 0) { |
| 498 | Image(this.item.commentPics) | 498 | Image(this.item.commentPics) |
| 499 | .width(88).height(88) | 499 | .width(88).height(88) |
| 500 | - .margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: 95}) | 500 | + .margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: this.leftGap}) |
| 501 | } | 501 | } |
| 502 | 502 | ||
| 503 | commentFooterView({ | 503 | commentFooterView({ |
| @@ -505,7 +505,7 @@ struct ChildCommentItem { | @@ -505,7 +505,7 @@ struct ChildCommentItem { | ||
| 505 | dialogController: this.dialogController, | 505 | dialogController: this.dialogController, |
| 506 | publishCommentModel: this.publishCommentModel, | 506 | publishCommentModel: this.publishCommentModel, |
| 507 | dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction | 507 | dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction |
| 508 | - }).margin({ left: 95, right: 16 }) | 508 | + }).margin({ left: this.leftGap, right: 16 }) |
| 509 | }.alignItems(HorizontalAlign.Start) | 509 | }.alignItems(HorizontalAlign.Start) |
| 510 | .width('100%') | 510 | .width('100%') |
| 511 | } | 511 | } |
| @@ -540,7 +540,7 @@ struct ChildCommentItem { | @@ -540,7 +540,7 @@ struct ChildCommentItem { | ||
| 540 | } | 540 | } |
| 541 | } | 541 | } |
| 542 | .width(48).height(48) | 542 | .width(48).height(48) |
| 543 | - .margin({ left: 47 }) | 543 | + .margin({ left: 47 + 4 }) |
| 544 | .alignContent(Alignment.Center) | 544 | .alignContent(Alignment.Center) |
| 545 | .onClick(() => { | 545 | .onClick(() => { |
| 546 | 546 | ||
| @@ -628,6 +628,7 @@ struct footerExpandedView { | @@ -628,6 +628,7 @@ struct footerExpandedView { | ||
| 628 | }.height(20) | 628 | }.height(20) |
| 629 | // .backgroundColor(Color.Green) | 629 | // .backgroundColor(Color.Green) |
| 630 | }.height(24) | 630 | }.height(24) |
| 631 | + .padding({left: 4}) | ||
| 631 | .alignItems(VerticalAlign.Top) | 632 | .alignItems(VerticalAlign.Top) |
| 632 | // .backgroundColor(Color.Gray) | 633 | // .backgroundColor(Color.Gray) |
| 633 | } | 634 | } |
| @@ -663,6 +664,7 @@ struct commentHeaderView { | @@ -663,6 +664,7 @@ struct commentHeaderView { | ||
| 663 | 664 | ||
| 664 | @Consume inDialog: boolean | 665 | @Consume inDialog: boolean |
| 665 | private dialogBeforeJumpOtherPageAction: () => void = () => {} | 666 | private dialogBeforeJumpOtherPageAction: () => void = () => {} |
| 667 | + private leftGap: number = 64 | ||
| 666 | 668 | ||
| 667 | build() { | 669 | build() { |
| 668 | Column() { | 670 | Column() { |
| @@ -712,7 +714,7 @@ struct commentHeaderView { | @@ -712,7 +714,7 @@ struct commentHeaderView { | ||
| 712 | fontWeight: FontWeight.Regular, | 714 | fontWeight: FontWeight.Regular, |
| 713 | marginWidth: (59 + 16) | 715 | marginWidth: (59 + 16) |
| 714 | }) | 716 | }) |
| 715 | - .margin({ left: 60, right: 16,top:-15 }) | 717 | + .margin({ left: this.leftGap, right: 16,top:-12 }) |
| 716 | .onClick(() => { | 718 | .onClick(() => { |
| 717 | this.replyComment() | 719 | this.replyComment() |
| 718 | }) | 720 | }) |
| @@ -720,7 +722,7 @@ struct commentHeaderView { | @@ -720,7 +722,7 @@ struct commentHeaderView { | ||
| 720 | if (this.item.commentPics.length > 0) { | 722 | if (this.item.commentPics.length > 0) { |
| 721 | Image(this.item.commentPics) | 723 | Image(this.item.commentPics) |
| 722 | .width(88).height(88) | 724 | .width(88).height(88) |
| 723 | - .margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: 60}) | 725 | + .margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: this.leftGap}) |
| 724 | } | 726 | } |
| 725 | 727 | ||
| 726 | commentFooterView({ | 728 | commentFooterView({ |
| @@ -728,7 +730,7 @@ struct commentHeaderView { | @@ -728,7 +730,7 @@ struct commentHeaderView { | ||
| 728 | dialogController: this.dialogController, | 730 | dialogController: this.dialogController, |
| 729 | publishCommentModel: this.publishCommentModel, | 731 | publishCommentModel: this.publishCommentModel, |
| 730 | dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction | 732 | dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction |
| 731 | - }).margin({ left: 60, right: 16 }) | 733 | + }).margin({ left: this.leftGap, right: 16 }) |
| 732 | }.alignItems(HorizontalAlign.Start) | 734 | }.alignItems(HorizontalAlign.Start) |
| 733 | .padding({bottom: 0}) | 735 | .padding({bottom: 0}) |
| 734 | } | 736 | } |
| @@ -763,7 +765,7 @@ struct commentHeaderView { | @@ -763,7 +765,7 @@ struct commentHeaderView { | ||
| 763 | } | 765 | } |
| 764 | } | 766 | } |
| 765 | .width(48).height(48) | 767 | .width(48).height(48) |
| 766 | - .margin({ left: 8 }) | 768 | + .margin({ left: 8 + 4 }) |
| 767 | .alignContent(Alignment.Center) | 769 | .alignContent(Alignment.Center) |
| 768 | .onClick(() => { | 770 | .onClick(() => { |
| 769 | 771 |
| @@ -65,7 +65,7 @@ export struct ZhCarouselLayout01 { | @@ -65,7 +65,7 @@ export struct ZhCarouselLayout01 { | ||
| 65 | Logger.info(TAG, | 65 | Logger.info(TAG, |
| 66 | `aboutToAppear, beanList:${this.compDTO?.operDataList?.length}, currentBreakpoint:${this.currentBreakpoint}`); | 66 | `aboutToAppear, beanList:${this.compDTO?.operDataList?.length}, currentBreakpoint:${this.currentBreakpoint}`); |
| 67 | let list: number[] = [] | 67 | let list: number[] = [] |
| 68 | - for (let i = 1; i <= this.compDTO?.operDataList?.length; i++) { | 68 | + for (let i = 1; i <= this.filterAtv()?.length; i++) { |
| 69 | list.push(i); | 69 | list.push(i); |
| 70 | } | 70 | } |
| 71 | this.data = new MyDataSource(list) | 71 | this.data = new MyDataSource(list) |
| @@ -84,17 +84,23 @@ export struct ZhCarouselLayout01 { | @@ -84,17 +84,23 @@ export struct ZhCarouselLayout01 { | ||
| 84 | } | 84 | } |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | + filterAtv() { | ||
| 88 | + return this.compDTO.operDataList.filter(((item: ContentDTO) => { | ||
| 89 | + return !item.linkUrl.includes('/h/atv') | ||
| 90 | + })) | ||
| 91 | + } | ||
| 92 | + | ||
| 87 | build() { | 93 | build() { |
| 88 | 94 | ||
| 89 | if (this.compDTO?.operDataList?.length) { | 95 | if (this.compDTO?.operDataList?.length) { |
| 90 | if (this.compDTO?.operDataList.length > 1) { | 96 | if (this.compDTO?.operDataList.length > 1) { |
| 91 | Stack() { | 97 | Stack() { |
| 92 | Swiper() { | 98 | Swiper() { |
| 93 | - ForEach(this.compDTO?.operDataList, (item: ContentDTO, index: number) => { | 99 | + ForEach(this.filterAtv(), (item: ContentDTO, index: number) => { |
| 94 | CarouselLayout01CardView({ | 100 | CarouselLayout01CardView({ |
| 95 | item: item, | 101 | item: item, |
| 96 | - length: this.compDTO.operDataList.length, | ||
| 97 | - showPicBorderRadius: this.compDTO.operDataList.length == 1 | 102 | + length: this.filterAtv().length, |
| 103 | + showPicBorderRadius: this.filterAtv().length == 1 | ||
| 98 | }) | 104 | }) |
| 99 | .onClick((event: ClickEvent) => { | 105 | .onClick((event: ClickEvent) => { |
| 100 | InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | 106 | InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) |
| @@ -172,13 +178,13 @@ export struct ZhCarouselLayout01 { | @@ -172,13 +178,13 @@ export struct ZhCarouselLayout01 { | ||
| 172 | .width(CommonConstants.FULL_WIDTH) | 178 | .width(CommonConstants.FULL_WIDTH) |
| 173 | } else { | 179 | } else { |
| 174 | CarouselLayout01CardView({ | 180 | CarouselLayout01CardView({ |
| 175 | - item: this.compDTO.operDataList[0], | 181 | + item: this.filterAtv()[0], |
| 176 | length: 1, | 182 | length: 1, |
| 177 | - showPicBorderRadius: this.compDTO.operDataList.length == 1 | 183 | + showPicBorderRadius: this.filterAtv().length == 1 |
| 178 | }) | 184 | }) |
| 179 | .onClick((event: ClickEvent) => { | 185 | .onClick((event: ClickEvent) => { |
| 180 | - InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[0], this.pageId, this.pageName) | ||
| 181 | - ProcessUtils.processPage(this.compDTO.operDataList[0]) | 186 | + InfomationCardClick.track(this.compDTO, this.filterAtv()[0], this.pageId, this.pageName) |
| 187 | + ProcessUtils.processPage(this.filterAtv()[0]) | ||
| 182 | }) | 188 | }) |
| 183 | .padding({ | 189 | .padding({ |
| 184 | left: 10, | 190 | left: 10, |
| @@ -19,6 +19,10 @@ interface ILikeStyleResp { | @@ -19,6 +19,10 @@ interface ILikeStyleResp { | ||
| 19 | url: Resource; | 19 | url: Resource; |
| 20 | name: string; | 20 | name: string; |
| 21 | } | 21 | } |
| 22 | +interface parsedObj { | ||
| 23 | + contentId: string, | ||
| 24 | + likeStatus: string | ||
| 25 | +} | ||
| 22 | 26 | ||
| 23 | @Component | 27 | @Component |
| 24 | export struct LikeComponent { | 28 | export struct LikeComponent { |
| @@ -59,18 +63,18 @@ export struct LikeComponent { | @@ -59,18 +63,18 @@ export struct LikeComponent { | ||
| 59 | this.likesStyle = this.contentDetailData.likesStyle | 63 | this.likesStyle = this.contentDetailData.likesStyle |
| 60 | this.openLikes = this.contentDetailData.openLikes == 1 ? true : false | 64 | this.openLikes = this.contentDetailData.openLikes == 1 ? true : false |
| 61 | } | 65 | } |
| 62 | - console.log(TAG, 'this.contentDetailData', JSON.stringify(this.contentDetailData)) | ||
| 63 | - console.log(TAG, 'this.componentType', this.componentType) | ||
| 64 | - console.log(TAG, 'this.likesStyle', this.likesStyle) | ||
| 65 | - console.log(TAG, 'this.openLikes', this.openLikes) | 66 | + // console.log(TAG, 'this.contentDetailData', JSON.stringify(this.contentDetailData)) |
| 67 | + // console.log(TAG, 'this.componentType', this.componentType) | ||
| 68 | + // console.log(TAG, 'this.likesStyle', this.likesStyle) | ||
| 69 | + // console.log(TAG, 'this.openLikes', this.openLikes) | ||
| 66 | this.onDataUpdated() | 70 | this.onDataUpdated() |
| 67 | this.contentTrackingDict() | 71 | this.contentTrackingDict() |
| 68 | } | 72 | } |
| 69 | 73 | ||
| 70 | onDataUpdated() { | 74 | onDataUpdated() { |
| 71 | - console.log(TAG, '点赞点击') | ||
| 72 | if (this.data) { | 75 | if (this.data) { |
| 73 | if (this.data['contentType'] !== undefined ) { | 76 | if (this.data['contentType'] !== undefined ) { |
| 77 | + console.log(TAG, 'CarderInteraction 点赞点击') | ||
| 74 | //获取点赞状态 | 78 | //获取点赞状态 |
| 75 | this.getLikeStatus() | 79 | this.getLikeStatus() |
| 76 | //获取点赞数 | 80 | //获取点赞数 |
| @@ -458,6 +462,7 @@ export struct LikeComponent { | @@ -458,6 +462,7 @@ export struct LikeComponent { | ||
| 458 | this.likeCount-- | 462 | this.likeCount-- |
| 459 | TrackingContent.like(false,this.pageId,this.pageName,this.pageParam) | 463 | TrackingContent.like(false,this.pageId,this.pageName,this.pageParam) |
| 460 | } | 464 | } |
| 465 | + | ||
| 461 | } | 466 | } |
| 462 | 467 | ||
| 463 | if (this.likeCount <= 0) { | 468 | if (this.likeCount <= 0) { |
| @@ -479,19 +484,25 @@ export struct LikeComponent { | @@ -479,19 +484,25 @@ export struct LikeComponent { | ||
| 479 | { | 484 | { |
| 480 | contentId: this.data['contentId'], | 485 | contentId: this.data['contentId'], |
| 481 | contentType: this.data['contentType'], | 486 | contentType: this.data['contentType'], |
| 482 | - contentRelId: this.data['contentRelId'] || '' + '', | 487 | + contentRelId: this.data['contentRelId'] == "0" ? '' : this.data['contentRelId'] || '' + '', |
| 483 | } | 488 | } |
| 484 | ] | 489 | ] |
| 485 | } | 490 | } |
| 486 | - console.log(TAG, "查询点赞状态params", JSON.stringify(params)) | 491 | + // console.log(TAG, "CarderInteraction 查询点赞状态params", JSON.stringify(params)) |
| 487 | ContentDetailRequest.postBatchLikeAndCollectStatus(params).then(res => { | 492 | ContentDetailRequest.postBatchLikeAndCollectStatus(params).then(res => { |
| 488 | - console.log(TAG, '查询点赞、收藏状态==', JSON.stringify(res.data)) | 493 | + // console.log(TAG, 'CarderInteraction 查询点赞、收藏状态==', JSON.stringify(res.data)) |
| 489 | if (res.data) { | 494 | if (res.data) { |
| 490 | if(res.data[0].likeStatus) { | 495 | if(res.data[0].likeStatus) { |
| 491 | this.likeStatus = res.data[0].likeStatus ? true : false | 496 | this.likeStatus = res.data[0].likeStatus ? true : false |
| 492 | } else { | 497 | } else { |
| 493 | this.likeStatus = false | 498 | this.likeStatus = false |
| 494 | } | 499 | } |
| 500 | + // CarderInteraction组件交互 | ||
| 501 | + if (this.data['likeStatus'] == "1") { | ||
| 502 | + this.likeStatus = true | ||
| 503 | + } else if (this.data['likeStatus'] == "0") { | ||
| 504 | + this.likeStatus = false | ||
| 505 | + } | ||
| 495 | } | 506 | } |
| 496 | }).catch(() => { | 507 | }).catch(() => { |
| 497 | this.likeStatus = false | 508 | this.likeStatus = false |
| @@ -30,7 +30,7 @@ export struct RecommendList { | @@ -30,7 +30,7 @@ export struct RecommendList { | ||
| 30 | ForEach(this.recommendList, (item: ContentDTO, index: number) => { | 30 | ForEach(this.recommendList, (item: ContentDTO, index: number) => { |
| 31 | Row() { | 31 | Row() { |
| 32 | CardParser({ compDTO:new CompDTO,contentDTO: item }); | 32 | CardParser({ compDTO:new CompDTO,contentDTO: item }); |
| 33 | - } | 33 | + }.padding({ left: 6, right: 6 }) |
| 34 | if (this.recommendList.length !== index + 1) { | 34 | if (this.recommendList.length !== index + 1) { |
| 35 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 35 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 36 | } | 36 | } |
| @@ -102,9 +102,10 @@ export struct DetailPlayLiveCommon { | @@ -102,9 +102,10 @@ export struct DetailPlayLiveCommon { | ||
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | const detailData = data[0]; | 104 | const detailData = data[0]; |
| 105 | - | 105 | + ///直播方式 0 视频直播 1 文字直播 |
| 106 | + const liveWay = detailData.liveInfo?.liveWay as number; | ||
| 106 | // 人民号类型单独获取直播地址 | 107 | // 人民号类型单独获取直播地址 |
| 107 | - if (detailData.rmhPlatform === 1 && detailData.liveInfo?.liveState === 'running') { | 108 | + if (detailData.rmhPlatform === 1 && detailData.liveInfo?.liveState === 'running' && liveWay == 0) { |
| 108 | const vliveId = detailData.liveInfo.vlive[0].vliveId as string; | 109 | const vliveId = detailData.liveInfo.vlive[0].vliveId as string; |
| 109 | const pullStreamAddressData = await this.liveViewModel.getLiveRoomPullAddress(vliveId) as GetPullAddressBean; | 110 | const pullStreamAddressData = await this.liveViewModel.getLiveRoomPullAddress(vliveId) as GetPullAddressBean; |
| 110 | 111 | ||
| @@ -135,13 +136,14 @@ export struct DetailPlayLiveCommon { | @@ -135,13 +136,14 @@ export struct DetailPlayLiveCommon { | ||
| 135 | publishCommentModel.commentContent = ''; | 136 | publishCommentModel.commentContent = ''; |
| 136 | this.liveStyle = detailData.liveInfo?.liveStyle; | 137 | this.liveStyle = detailData.liveInfo?.liveStyle; |
| 137 | 138 | ||
| 138 | - if (detailData.liveInfo?.liveState === 'end') { | 139 | + if (detailData.liveInfo?.liveState === 'end' && liveWay == 0) { |
| 139 | this.playUrl = detailData.liveInfo.vlive[0].replayUri; | 140 | this.playUrl = detailData.liveInfo.vlive[0].replayUri; |
| 140 | } | 141 | } |
| 141 | 142 | ||
| 142 | resolve(); | 143 | resolve(); |
| 143 | }) | 144 | }) |
| 144 | - .catch(() => { | 145 | + .catch((error:Error) => { |
| 146 | + Logger.debug(TAG + "error",error.message,error.name) | ||
| 145 | this.isHideLoading = true; | 147 | this.isHideLoading = true; |
| 146 | ToastUtils.shortToast('内容不存在'); | 148 | ToastUtils.shortToast('内容不存在'); |
| 147 | router.back(); | 149 | router.back(); |
| @@ -79,8 +79,9 @@ export class LiveDetailPageLogic { | @@ -79,8 +79,9 @@ export class LiveDetailPageLogic { | ||
| 79 | 79 | ||
| 80 | // 只有直播中的才会有垫片 | 80 | // 只有直播中的才会有垫片 |
| 81 | if(this.liveState === 'running'){ | 81 | if(this.liveState === 'running'){ |
| 82 | - | ||
| 83 | - this.showPad = this.contentDetailData.liveInfo.vlive[index].showPad | 82 | + if (this.contentDetailData.liveInfo.vlive.count > 0) { |
| 83 | + this.showPad = this.contentDetailData.liveInfo.vlive[index].showPad | ||
| 84 | + } | ||
| 84 | } | 85 | } |
| 85 | 86 | ||
| 86 | } | 87 | } |
| @@ -99,7 +99,7 @@ export struct DetailVideoListPage { | @@ -99,7 +99,7 @@ export struct DetailVideoListPage { | ||
| 99 | aboutToAppear() { | 99 | aboutToAppear() { |
| 100 | // 在视频详情页 | 100 | // 在视频详情页 |
| 101 | this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || ''; | 101 | this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || ''; |
| 102 | - // console.info(TAG, `cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`) | 102 | + console.info(TAG, `cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`) |
| 103 | if (this.peopleShipHomeCreatorId) { | 103 | if (this.peopleShipHomeCreatorId) { |
| 104 | // 从人民号号主传过来的 | 104 | // 从人民号号主传过来的 |
| 105 | this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId); | 105 | this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId); |
| @@ -120,13 +120,16 @@ export struct DetailVideoListPage { | @@ -120,13 +120,16 @@ export struct DetailVideoListPage { | ||
| 120 | if (action) { | 120 | if (action) { |
| 121 | this.contentId = action.params?.contentID || ''; | 121 | this.contentId = action.params?.contentID || ''; |
| 122 | if (action.params && action.params.extra) { | 122 | if (action.params && action.params.extra) { |
| 123 | - this.relId = action.params.extra.relId || ''; | ||
| 124 | - this.relType = action.params.extra.relType || ''; | 123 | + this.relId = action.params.extra.relId != "undefined" && action.params.extra.relId != '' ? action.params.extra.relId : ''; |
| 124 | + this.relType = action.params.extra.relType != "undefined" && action.params.extra.relType != '' ? action.params.extra.relType : ''; | ||
| 125 | } | 125 | } |
| 126 | // console.info(TAG, `cj2024 getPeopleShipHomeDetail contentId = ${this.contentId}`) | 126 | // console.info(TAG, `cj2024 getPeopleShipHomeDetail contentId = ${this.contentId}`) |
| 127 | + // console.info(TAG, `cj2024 getPeopleShipHomeDetail relId = ${this.relId}`) | ||
| 128 | + // console.info(TAG, `cj2024 getPeopleShipHomeDetail relType = ${this.relType}`) | ||
| 127 | await this.getRmhContentDetail(this.contentId, this.relId, this.relType) | 129 | await this.getRmhContentDetail(this.contentId, this.relId, this.relType) |
| 128 | this.getRmhPublishNexts(peopleShipHomeCreatorId, this.contentId, 1, 1, 10, systemDateTime.getTime(false)); | 130 | this.getRmhPublishNexts(peopleShipHomeCreatorId, this.contentId, 1, 1, 10, systemDateTime.getTime(false)); |
| 129 | } | 131 | } |
| 132 | + // console.log(TAG, 'aboutToAppear', JSON.stringify(action.params)) | ||
| 130 | } else { | 133 | } else { |
| 131 | // 无网络 | 134 | // 无网络 |
| 132 | this.netStatus = 1 | 135 | this.netStatus = 1 |
| @@ -71,6 +71,8 @@ export class GetuiPush { | @@ -71,6 +71,8 @@ export class GetuiPush { | ||
| 71 | Logger.error(TAG, "个推SDK初始化失败,error = " + error) | 71 | Logger.error(TAG, "个推SDK初始化失败,error = " + error) |
| 72 | } | 72 | } |
| 73 | }) | 73 | }) |
| 74 | + | ||
| 75 | + this.setBadgeNumber(0) | ||
| 74 | } | 76 | } |
| 75 | 77 | ||
| 76 | async requestEnableNotifications(context: common.UIAbilityContext) : Promise<boolean> { | 78 | async requestEnableNotifications(context: common.UIAbilityContext) : Promise<boolean> { |
| @@ -120,6 +122,9 @@ export class GetuiPush { | @@ -120,6 +122,9 @@ export class GetuiPush { | ||
| 120 | this.setAlias(false, this.currentUserId) | 122 | this.setAlias(false, this.currentUserId) |
| 121 | } | 123 | } |
| 122 | }) | 124 | }) |
| 125 | + EmitterUtils.receiveEvent(EmitterEventId.APP_ENTER_FOREGROUD, () => { | ||
| 126 | + this.setBadgeNumber(0) | ||
| 127 | + }) | ||
| 123 | 128 | ||
| 124 | PushManager.setPushCallback({ | 129 | PushManager.setPushCallback({ |
| 125 | // cid | 130 | // cid |
| @@ -387,6 +392,7 @@ export class GetuiPush { | @@ -387,6 +392,7 @@ export class GetuiPush { | ||
| 387 | }, | 392 | }, |
| 388 | notificationSlotType: notificationManager.SlotType.CONTENT_INFORMATION, | 393 | notificationSlotType: notificationManager.SlotType.CONTENT_INFORMATION, |
| 389 | wantAgent:want, | 394 | wantAgent:want, |
| 395 | + badgeNumber:1 | ||
| 390 | }; | 396 | }; |
| 391 | notificationManager.publish(notificationRequest).then(() => { | 397 | notificationManager.publish(notificationRequest).then(() => { |
| 392 | Logger.debug(TAG, "本地发送系统通知完成") | 398 | Logger.debug(TAG, "本地发送系统通知完成") |
| 1 | import { Logger } from 'wdKit/src/main/ets/utils/Logger' | 1 | import { Logger } from 'wdKit/src/main/ets/utils/Logger' |
| 2 | import { LoginModel } from './LoginModel' | 2 | import { LoginModel } from './LoginModel' |
| 3 | import { LoginBean } from './LoginBean' | 3 | import { LoginBean } from './LoginBean' |
| 4 | -import { EmitterEventId, EmitterUtils, SPHelper, StringUtils, UserDataLocal } from 'wdKit' | 4 | +import { AppUtils, EmitterEventId, EmitterUtils, SPHelper, StringUtils, UserDataLocal } from 'wdKit' |
| 5 | import { CheckVerifyBean } from './CheckVerifyBean' | 5 | import { CheckVerifyBean } from './CheckVerifyBean' |
| 6 | import cryptoFramework from '@ohos.security.cryptoFramework' | 6 | import cryptoFramework from '@ohos.security.cryptoFramework' |
| 7 | import buffer from '@ohos.buffer' | 7 | import buffer from '@ohos.buffer' |
| @@ -105,7 +105,7 @@ export class LoginViewModel { | @@ -105,7 +105,7 @@ export class LoginViewModel { | ||
| 105 | SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName ?? "") | 105 | SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName ?? "") |
| 106 | EmitterUtils.sendEmptyEvent(EmitterEventId.LOGIN_SUCCESS) | 106 | EmitterUtils.sendEmptyEvent(EmitterEventId.LOGIN_SUCCESS) |
| 107 | 107 | ||
| 108 | - LoginModule.reportDeviceInfo() | 108 | + LoginModule.reportDeviceInfo(AppUtils.gotApplicationContextFunc!()) |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | async appLoginByPassword(phone: string, loginType: number, password: string, oldPassword: string) { | 111 | async appLoginByPassword(phone: string, loginType: number, password: string, oldPassword: string) { |
| @@ -5,6 +5,8 @@ import { NewspaperWidgetCommon } from "../common/NewspaperWidgetCommon" | @@ -5,6 +5,8 @@ import { NewspaperWidgetCommon } from "../common/NewspaperWidgetCommon" | ||
| 5 | const TAG = "DailyNewspaperWidgetCard" | 5 | const TAG = "DailyNewspaperWidgetCard" |
| 6 | let storageWidgetImageUpdate = new LocalStorage(); | 6 | let storageWidgetImageUpdate = new LocalStorage(); |
| 7 | 7 | ||
| 8 | +const DAILY_NEWSPAPER_DEEP_LINK = "rmrbapp://rmrb.app/openwith?type=topic&subType=moring_evening_news&pageId=&relId=&skipType=1" | ||
| 9 | + | ||
| 8 | @Entry(storageWidgetImageUpdate) | 10 | @Entry(storageWidgetImageUpdate) |
| 9 | @Component | 11 | @Component |
| 10 | struct DailyNewspaperWidgetCard { | 12 | struct DailyNewspaperWidgetCard { |
| @@ -12,8 +14,6 @@ struct DailyNewspaperWidgetCard { | @@ -12,8 +14,6 @@ struct DailyNewspaperWidgetCard { | ||
| 12 | @LocalStorageProp('paperInfo') paperInfo: FormNewspaperPaperInfo = {} as FormNewspaperPaperInfo; | 14 | @LocalStorageProp('paperInfo') paperInfo: FormNewspaperPaperInfo = {} as FormNewspaperPaperInfo; |
| 13 | @LocalStorageProp('paperContents') paperContents: FormNewspaperPaperContent[] = []; | 15 | @LocalStorageProp('paperContents') paperContents: FormNewspaperPaperContent[] = []; |
| 14 | 16 | ||
| 15 | - private DAILY_NEWSPAPER_DEEP_LINK = "rmrbapp://rmrb.app/openwith?type=topic&subType=moring_evening_news&pageId=&relId=&skipType=1" | ||
| 16 | - | ||
| 17 | build() { | 17 | build() { |
| 18 | 18 | ||
| 19 | Column() { | 19 | Column() { |
| @@ -23,7 +23,7 @@ struct DailyNewspaperWidgetCard { | @@ -23,7 +23,7 @@ struct DailyNewspaperWidgetCard { | ||
| 23 | .width("100%").height(36) | 23 | .width("100%").height(36) |
| 24 | // .margin({top: 3}) | 24 | // .margin({top: 3}) |
| 25 | .onClick(() => { | 25 | .onClick(() => { |
| 26 | - jumpWithDeepLink(this.DAILY_NEWSPAPER_DEEP_LINK, this) | 26 | + jumpWithDeepLink(DAILY_NEWSPAPER_DEEP_LINK, this) |
| 27 | }) | 27 | }) |
| 28 | 28 | ||
| 29 | Row() { | 29 | Row() { |
| @@ -51,7 +51,8 @@ struct DailyNewspaperWidgetCard { | @@ -51,7 +51,8 @@ struct DailyNewspaperWidgetCard { | ||
| 51 | .autoResize(true) | 51 | .autoResize(true) |
| 52 | .borderRadius(6) | 52 | .borderRadius(6) |
| 53 | .onClick(() => { | 53 | .onClick(() => { |
| 54 | - jumpWithDeepLink(this.paperInfo.leftDeepLink || "", this) | 54 | + // jumpWithDeepLink(this.paperInfo.leftDeepLink || "", this) |
| 55 | + jumpWithDeepLink(DAILY_NEWSPAPER_DEEP_LINK, this) | ||
| 55 | }) | 56 | }) |
| 56 | 57 | ||
| 57 | Text(this.paperInfo.leftTitle) | 58 | Text(this.paperInfo.leftTitle) |
| @@ -123,7 +124,8 @@ struct ContentCellView { | @@ -123,7 +124,8 @@ struct ContentCellView { | ||
| 123 | } | 124 | } |
| 124 | .justifyContent(FlexAlign.Start) | 125 | .justifyContent(FlexAlign.Start) |
| 125 | .onClick(() => { | 126 | .onClick(() => { |
| 126 | - jumpWithDeepLink(this.content.deepLink || "", this) | 127 | + // jumpWithDeepLink(this.content.deepLink || "", this) |
| 128 | + jumpWithDeepLink(DAILY_NEWSPAPER_DEEP_LINK, this) | ||
| 127 | }) | 129 | }) |
| 128 | } | 130 | } |
| 129 | } | 131 | } |
| 1 | import { AbilityConstant, common, Want } from '@kit.AbilityKit' | 1 | import { AbilityConstant, common, Want } from '@kit.AbilityKit' |
| 2 | -import { DeviceUtil, | 2 | +import { |
| 3 | + AppUtils, | ||
| 4 | + DeviceUtil, | ||
| 3 | EmitterEventId, | 5 | EmitterEventId, |
| 4 | EmitterUtils, | 6 | EmitterUtils, |
| 5 | KVStoreHelper, | 7 | KVStoreHelper, |
| @@ -58,6 +60,11 @@ export class StartupManager { | @@ -58,6 +60,11 @@ export class StartupManager { | ||
| 58 | // 路由注册 | 60 | // 路由注册 |
| 59 | registerRouter(); | 61 | registerRouter(); |
| 60 | 62 | ||
| 63 | + // 设置全局context | ||
| 64 | + AppUtils.gotApplicationContextFunc = () => { | ||
| 65 | + return this.context! | ||
| 66 | + } | ||
| 67 | + | ||
| 61 | // 网络模块 | 68 | // 网络模块 |
| 62 | NetworkManager.getInstance().init() | 69 | NetworkManager.getInstance().init() |
| 63 | 70 |
-
Please register or login to post a comment