Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: (24 commits) fix:17496 话题专题/投票专题详情页,点击投票,触发登录,登录成功后,点击投票,循环触发登录 fix: 17541 功能缺陷-页面加载-信息流图片加载,手机打开仅wifi加载图片控制,视频直播-直播预告图片和android显示不一致 fix: 17540 功能缺陷-页面加载-信息流图片加载,手机打开仅wifi加载图片控制,人民号推荐账号图标显示了 fix: 17369 UI还原问题--无图卡的字体行距鸿蒙版与安卓不一致 早晚报-详情图片下载图标优化;点赞后展示效果优化 早晚报-详情图片下载图标优化;点赞后展示效果优化 fix: 17369 UI还原问题--无图卡的字体行距鸿蒙版与安卓不一致 fix: 标题过长省略 fix: 17537 功能缺陷-页面加载-信息流图片加载,手机打开仅wifi加载图片控制,精品评论图片显示了 缺少文件 fix: float.json添加 fix: 17650 早晚报>专题类型稿件详情页_互动区和详情区域缺少分割线 fix: 标题过长省略 fix: 17646 稿件详情页-顶部分割线较细 fix: 17643 早晚报>文章类型稿件详情页_互动区域布局与安卓不一致 修改模块引入 fix:17681 早晚报:视频类型稿件详情页-调整右侧互动图标位置 fix:17680 早晚报:视频类型稿件详情页-查看详情时全屏观看按钮隐藏 feat(信息流):整理多个楼层 获取数据,统一绘制页面,pageinfor对象记录 请求数据和广告数据 fix: 标题过长省略 ...
Showing
43 changed files
with
564 additions
and
397 deletions
| @@ -2,6 +2,8 @@ | @@ -2,6 +2,8 @@ | ||
| 2 | * page接口返回的Page数据DTO | 2 | * page接口返回的Page数据DTO |
| 3 | */ | 3 | */ |
| 4 | import { AdvRuleBean, CompAdvBean } from '../adv/AdvsRuleBean'; | 4 | import { AdvRuleBean, CompAdvBean } from '../adv/AdvsRuleBean'; |
| 5 | +import { ArrayList } from '@kit.ArkTS'; | ||
| 6 | +import { CompDTO } from '../component/CompDTO'; | ||
| 5 | 7 | ||
| 6 | export interface PageInfoDTO { | 8 | export interface PageInfoDTO { |
| 7 | pageId: string; // 页面id | 9 | pageId: string; // 页面id |
| @@ -27,6 +29,18 @@ export interface PageInfoDTO { | @@ -27,6 +29,18 @@ export interface PageInfoDTO { | ||
| 27 | */ | 29 | */ |
| 28 | cornersAdv2: CompAdvBean[] | 30 | cornersAdv2: CompAdvBean[] |
| 29 | 31 | ||
| 32 | + | ||
| 33 | + // 本地字段 | ||
| 34 | + /* | ||
| 35 | + 记录一次请求获取到的楼层comp数据,如 完成一次刷新到结束,获取所有楼层的稿件数据 | ||
| 36 | + */ | ||
| 37 | + oneRequestPageGroupCompList: ArrayList<CompDTO> | ||
| 38 | + | ||
| 39 | + /* | ||
| 40 | + 记录页面楼层所有的信息流广告数据 | ||
| 41 | + */ | ||
| 42 | + pageAdList:CompAdvBean[] | ||
| 43 | + | ||
| 30 | } | 44 | } |
| 31 | 45 | ||
| 32 | export interface ChannelInfoDTO { | 46 | export interface ChannelInfoDTO { |
| @@ -44,7 +44,7 @@ export struct CardParser { | @@ -44,7 +44,7 @@ export struct CardParser { | ||
| 44 | } else if (contentDTO.appStyle === CompStyle.Card_04) { | 44 | } else if (contentDTO.appStyle === CompStyle.Card_04) { |
| 45 | Card4Component({ compDTO: this.compDTO, contentDTO }) | 45 | Card4Component({ compDTO: this.compDTO, contentDTO }) |
| 46 | } else if (contentDTO.appStyle === CompStyle.Card_05) { | 46 | } else if (contentDTO.appStyle === CompStyle.Card_05) { |
| 47 | - Card5Component({ contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy }) | 47 | + Card5Component({ contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy, compDTO: this.compDTO }) |
| 48 | } else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle | 48 | } else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle |
| 49 | .Card_13) { | 49 | .Card_13) { |
| 50 | Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO }) | 50 | Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO }) |
| @@ -103,7 +103,7 @@ export struct DynamicDetailComponent { | @@ -103,7 +103,7 @@ export struct DynamicDetailComponent { | ||
| 103 | //分割线 | 103 | //分割线 |
| 104 | Image($r('app.media.ic_news_detail_division')) | 104 | Image($r('app.media.ic_news_detail_division')) |
| 105 | .width('100%') | 105 | .width('100%') |
| 106 | - .height($r('app.float.margin_7')) | 106 | + .height($r('app.float.margin_12')) |
| 107 | .padding({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') }) | 107 | .padding({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') }) |
| 108 | Stack({ alignContent: Alignment.Bottom }) { | 108 | Stack({ alignContent: Alignment.Bottom }) { |
| 109 | if (!this.isNetConnected) { | 109 | if (!this.isNetConnected) { |
| @@ -25,6 +25,7 @@ export struct ImageDownloadComponent { | @@ -25,6 +25,7 @@ export struct ImageDownloadComponent { | ||
| 25 | build() { | 25 | build() { |
| 26 | Column() { | 26 | Column() { |
| 27 | SaveButton({ icon: SaveIconStyle.LINES }) | 27 | SaveButton({ icon: SaveIconStyle.LINES }) |
| 28 | + .iconSize(24) | ||
| 28 | .iconColor(Color.White) | 29 | .iconColor(Color.White) |
| 29 | .onClick(async () => { | 30 | .onClick(async () => { |
| 30 | console.info(`cj2024 onClick ${this.imageBuffer}`) | 31 | console.info(`cj2024 onClick ${this.imageBuffer}`) |
| @@ -20,7 +20,7 @@ export struct SpacialTopicPageComponent { | @@ -20,7 +20,7 @@ export struct SpacialTopicPageComponent { | ||
| 20 | action: Action = {} as Action | 20 | action: Action = {} as Action |
| 21 | @State webUrl: string = ''; | 21 | @State webUrl: string = ''; |
| 22 | @State isPageEnd: boolean = false | 22 | @State isPageEnd: boolean = false |
| 23 | - @State reload: number = 0; | 23 | + @Prop reload: number = 0; |
| 24 | @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO | 24 | @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO |
| 25 | private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean | 25 | private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean |
| 26 | private webPrepared = false; | 26 | private webPrepared = false; |
| @@ -134,13 +134,6 @@ export struct SpacialTopicPageComponent { | @@ -134,13 +134,6 @@ export struct SpacialTopicPageComponent { | ||
| 134 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) | 134 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | - onPageShow() { | ||
| 138 | - if (!this.action?.params?.backVisibility) { | ||
| 139 | - WindowModel.shared.setWindowLayoutFullScreen(true) | ||
| 140 | - } | ||
| 141 | - this.reload++ | ||
| 142 | - } | ||
| 143 | - | ||
| 144 | aboutToAppear() { | 137 | aboutToAppear() { |
| 145 | if (!this.action?.params?.backVisibility) { | 138 | if (!this.action?.params?.backVisibility) { |
| 146 | WindowModel.shared.setWindowLayoutFullScreen(true) | 139 | WindowModel.shared.setWindowLayoutFullScreen(true) |
| @@ -149,12 +142,6 @@ export struct SpacialTopicPageComponent { | @@ -149,12 +142,6 @@ export struct SpacialTopicPageComponent { | ||
| 149 | this.getDetail() | 142 | this.getDetail() |
| 150 | } | 143 | } |
| 151 | 144 | ||
| 152 | - onPageHide() { | ||
| 153 | - if (!this.action?.params?.backVisibility) { | ||
| 154 | - WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 155 | - } | ||
| 156 | - } | ||
| 157 | - | ||
| 158 | aboutToDisappear() { | 145 | aboutToDisappear() { |
| 159 | if (!this.action?.params?.backVisibility) { | 146 | if (!this.action?.params?.backVisibility) { |
| 160 | WindowModel.shared.setWindowLayoutFullScreen(false) | 147 | WindowModel.shared.setWindowLayoutFullScreen(false) |
| @@ -11,19 +11,19 @@ export struct CardSourceInfo { | @@ -11,19 +11,19 @@ export struct CardSourceInfo { | ||
| 11 | Flex() { | 11 | Flex() { |
| 12 | if (this.contentDTO.corner) { | 12 | if (this.contentDTO.corner) { |
| 13 | Text(this.contentDTO.corner) | 13 | Text(this.contentDTO.corner) |
| 14 | - .fontSize($r("app.float.font_size_12")) | 14 | + .fontSize($r("app.float.font_size_11")) |
| 15 | .fontColor($r("app.color.color_ED2800")) | 15 | .fontColor($r("app.color.color_ED2800")) |
| 16 | .margin({ right: 2 }) | 16 | .margin({ right: 2 }) |
| 17 | } | 17 | } |
| 18 | if (this.contentDTO.rmhPlatform === 1) { | 18 | if (this.contentDTO.rmhPlatform === 1) { |
| 19 | Text(this.contentDTO.rmhInfo?.rmhName) | 19 | Text(this.contentDTO.rmhInfo?.rmhName) |
| 20 | - .fontSize($r("app.float.font_size_12")) | 20 | + .fontSize($r("app.float.font_size_11")) |
| 21 | .fontColor($r("app.color.color_B0B0B0")) | 21 | .fontColor($r("app.color.color_B0B0B0")) |
| 22 | .maxLines(1) | 22 | .maxLines(1) |
| 23 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 23 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 24 | } else if (this.contentDTO.source) { | 24 | } else if (this.contentDTO.source) { |
| 25 | Text(`${this.contentDTO.source}`) | 25 | Text(`${this.contentDTO.source}`) |
| 26 | - .fontSize($r("app.float.font_size_12")) | 26 | + .fontSize($r("app.float.font_size_11")) |
| 27 | .fontColor($r("app.color.color_B0B0B0")) | 27 | .fontColor($r("app.color.color_B0B0B0")) |
| 28 | .maxLines(1) | 28 | .maxLines(1) |
| 29 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 29 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| @@ -43,13 +43,13 @@ export struct CardSourceInfo { | @@ -43,13 +43,13 @@ export struct CardSourceInfo { | ||
| 43 | .height(16) | 43 | .height(16) |
| 44 | } | 44 | } |
| 45 | Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) | 45 | Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) |
| 46 | - .fontSize($r("app.float.font_size_12")) | 46 | + .fontSize($r("app.float.font_size_11")) |
| 47 | .fontColor($r("app.color.color_B0B0B0")) | 47 | .fontColor($r("app.color.color_B0B0B0")) |
| 48 | .flexShrink(0) | 48 | .flexShrink(0) |
| 49 | } | 49 | } |
| 50 | if (this.getContentDtoBean()?.interactData?.commentNum) { | 50 | if (this.getContentDtoBean()?.interactData?.commentNum) { |
| 51 | Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`) | 51 | Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`) |
| 52 | - .fontSize($r("app.float.font_size_12")) | 52 | + .fontSize($r("app.float.font_size_11")) |
| 53 | .fontColor($r("app.color.color_B0B0B0")) | 53 | .fontColor($r("app.color.color_B0B0B0")) |
| 54 | .flexShrink(0) | 54 | .flexShrink(0) |
| 55 | .margin({ left: 6 }) | 55 | .margin({ left: 6 }) |
| @@ -13,11 +13,13 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | @@ -13,11 +13,13 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 13 | import router from '@ohos.router' | 13 | import router from '@ohos.router' |
| 14 | import { postBatchAttentionStatusParams } from 'wdBean/Index'; | 14 | import { postBatchAttentionStatusParams } from 'wdBean/Index'; |
| 15 | import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel' | 15 | import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel' |
| 16 | +import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 16 | 17 | ||
| 17 | @Component | 18 | @Component |
| 18 | export struct RmhTitle { | 19 | export struct RmhTitle { |
| 19 | @Prop rmhInfo: RmhInfoDTO | 20 | @Prop rmhInfo: RmhInfoDTO |
| 20 | @Prop publishTime: string | undefined | 21 | @Prop publishTime: string | undefined |
| 22 | + @State loadImg: boolean = false; | ||
| 21 | /** | 23 | /** |
| 22 | * 是否需要隐藏发布时间超过2天的时间展示,默认不隐藏 | 24 | * 是否需要隐藏发布时间超过2天的时间展示,默认不隐藏 |
| 23 | */ | 25 | */ |
| @@ -76,13 +78,15 @@ export struct RmhTitle { | @@ -76,13 +78,15 @@ export struct RmhTitle { | ||
| 76 | } | 78 | } |
| 77 | } | 79 | } |
| 78 | 80 | ||
| 79 | - aboutToAppear(): void { | 81 | + async aboutToAppear(): Promise<void> { |
| 80 | this.getBatchAttentionStatus() | 82 | this.getBatchAttentionStatus() |
| 81 | 83 | ||
| 82 | let page = router.getState(); | 84 | let page = router.getState(); |
| 83 | if (page.path.includes('/page/PeopleShipHomePage') || page.path.includes('/pages/MainPage')) { | 85 | if (page.path.includes('/page/PeopleShipHomePage') || page.path.includes('/pages/MainPage')) { |
| 84 | this.hideTime = true; | 86 | this.hideTime = true; |
| 85 | } | 87 | } |
| 88 | + | ||
| 89 | + this.loadImg = await onlyWifiLoadImg(); | ||
| 86 | } | 90 | } |
| 87 | 91 | ||
| 88 | getDaysBetweenDates(date: number) { | 92 | getDaysBetweenDates(date: number) { |
| @@ -96,7 +100,7 @@ export struct RmhTitle { | @@ -96,7 +100,7 @@ export struct RmhTitle { | ||
| 96 | build() { | 100 | build() { |
| 97 | Flex() { | 101 | Flex() { |
| 98 | Stack() { | 102 | Stack() { |
| 99 | - Image(this.rmhInfo?.rmhHeadUrl) | 103 | + Image(this.loadImg ? this.rmhInfo?.rmhHeadUrl : $r('app.media.comment_rmh_tag')) |
| 100 | .width(36) | 104 | .width(36) |
| 101 | .height(36).borderRadius(50) | 105 | .height(36).borderRadius(50) |
| 102 | Image(this.rmhInfo?.authIcon) | 106 | Image(this.rmhInfo?.authIcon) |
| @@ -51,7 +51,7 @@ export struct Card10Component { | @@ -51,7 +51,7 @@ export struct Card10Component { | ||
| 51 | } | 51 | } |
| 52 | } | 52 | } |
| 53 | .width(CommonConstants.FULL_WIDTH) | 53 | .width(CommonConstants.FULL_WIDTH) |
| 54 | - .fontSize($r('app.float.font_size_17')) | 54 | + .fontSize($r('app.float.font_size_18')) |
| 55 | .fontWeight(600) | 55 | .fontWeight(600) |
| 56 | .maxLines(2) | 56 | .maxLines(2) |
| 57 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 57 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| @@ -52,7 +52,7 @@ export struct Card11Component { | @@ -52,7 +52,7 @@ export struct Card11Component { | ||
| 52 | Span(this.contentDTO.newsTitle) | 52 | Span(this.contentDTO.newsTitle) |
| 53 | } | 53 | } |
| 54 | } | 54 | } |
| 55 | - .fontSize($r("app.float.font_size_16")) | 55 | + .fontSize($r("app.float.font_size_18")) |
| 56 | .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) | 56 | .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) |
| 57 | .maxLines(3) | 57 | .maxLines(3) |
| 58 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 58 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| @@ -50,7 +50,7 @@ export struct Card12Component { | @@ -50,7 +50,7 @@ export struct Card12Component { | ||
| 50 | Span(this.contentDTO.newsTitle) | 50 | Span(this.contentDTO.newsTitle) |
| 51 | } | 51 | } |
| 52 | } | 52 | } |
| 53 | - .fontSize($r('app.float.font_size_17')) | 53 | + .fontSize($r('app.float.font_size_18')) |
| 54 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 54 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 55 | .width(CommonConstants.FULL_WIDTH) | 55 | .width(CommonConstants.FULL_WIDTH) |
| 56 | .textOverflowStyle(3) | 56 | .textOverflowStyle(3) |
| @@ -54,7 +54,7 @@ export struct Card14Component { | @@ -54,7 +54,7 @@ export struct Card14Component { | ||
| 54 | Span(this.contentDTO.newsTitle) | 54 | Span(this.contentDTO.newsTitle) |
| 55 | } | 55 | } |
| 56 | } | 56 | } |
| 57 | - .fontSize($r('app.float.font_size_17')) | 57 | + .fontSize($r('app.float.font_size_18')) |
| 58 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 58 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 59 | .textOverflowStyle(3) | 59 | .textOverflowStyle(3) |
| 60 | .lineHeight(25) | 60 | .lineHeight(25) |
| @@ -55,7 +55,7 @@ export struct Card15Component { | @@ -55,7 +55,7 @@ export struct Card15Component { | ||
| 55 | Span(this.contentDTO.newsTitle) | 55 | Span(this.contentDTO.newsTitle) |
| 56 | } | 56 | } |
| 57 | } | 57 | } |
| 58 | - .fontSize($r('app.float.font_size_17')) | 58 | + .fontSize($r('app.float.font_size_18')) |
| 59 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 59 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 60 | .width(CommonConstants.FULL_WIDTH) | 60 | .width(CommonConstants.FULL_WIDTH) |
| 61 | .textOverflowStyle(2) | 61 | .textOverflowStyle(2) |
| @@ -58,7 +58,7 @@ export struct Card16Component { | @@ -58,7 +58,7 @@ export struct Card16Component { | ||
| 58 | Span(this.contentDTO.newsTitle) | 58 | Span(this.contentDTO.newsTitle) |
| 59 | } | 59 | } |
| 60 | } | 60 | } |
| 61 | - .fontSize($r('app.float.font_size_17')) | 61 | + .fontSize($r('app.float.font_size_18')) |
| 62 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 62 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 63 | .width(CommonConstants.FULL_WIDTH) | 63 | .width(CommonConstants.FULL_WIDTH) |
| 64 | .textOverflowStyle(2) | 64 | .textOverflowStyle(2) |
| @@ -49,7 +49,7 @@ export struct Card17Component { | @@ -49,7 +49,7 @@ export struct Card17Component { | ||
| 49 | } | 49 | } |
| 50 | } | 50 | } |
| 51 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 51 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 52 | - .fontSize($r('app.float.font_size_17')) | 52 | + .fontSize($r('app.float.font_size_18')) |
| 53 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 53 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 54 | .lineHeight(25) | 54 | .lineHeight(25) |
| 55 | .maxLines(3) | 55 | .maxLines(3) |
| @@ -49,12 +49,12 @@ export struct Card19Component { | @@ -49,12 +49,12 @@ export struct Card19Component { | ||
| 49 | Span(this.contentDTO.newsTitle) | 49 | Span(this.contentDTO.newsTitle) |
| 50 | } | 50 | } |
| 51 | } | 51 | } |
| 52 | - .fontSize($r('app.float.font_size_17')) | 52 | + .fontSize($r('app.float.font_size_18')) |
| 53 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 53 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 54 | .textOverflowStyle(3) | 54 | .textOverflowStyle(3) |
| 55 | .margin({ bottom: 8 }) | 55 | .margin({ bottom: 8 }) |
| 56 | .width(CommonConstants.FULL_WIDTH) | 56 | .width(CommonConstants.FULL_WIDTH) |
| 57 | - .lineHeight(22) | 57 | + .lineHeight(25) |
| 58 | .onClick((event: ClickEvent) => { | 58 | .onClick((event: ClickEvent) => { |
| 59 | this.clicked = true; | 59 | this.clicked = true; |
| 60 | ProcessUtils.processPage(this.contentDTO) | 60 | ProcessUtils.processPage(this.contentDTO) |
| @@ -50,7 +50,7 @@ export struct Card20Component { | @@ -50,7 +50,7 @@ export struct Card20Component { | ||
| 50 | Span(this.contentDTO.newsTitle) | 50 | Span(this.contentDTO.newsTitle) |
| 51 | } | 51 | } |
| 52 | } | 52 | } |
| 53 | - .fontSize($r('app.float.font_size_17')) | 53 | + .fontSize($r('app.float.font_size_18')) |
| 54 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 54 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 55 | .width(CommonConstants.FULL_WIDTH) | 55 | .width(CommonConstants.FULL_WIDTH) |
| 56 | .textOverflowStyle(3) | 56 | .textOverflowStyle(3) |
| @@ -52,7 +52,7 @@ export struct Card21Component { | @@ -52,7 +52,7 @@ export struct Card21Component { | ||
| 52 | Span(this.contentDTO.newsTitle) | 52 | Span(this.contentDTO.newsTitle) |
| 53 | } | 53 | } |
| 54 | } | 54 | } |
| 55 | - .fontSize($r('app.float.selected_text_size')) | 55 | + .fontSize(18) |
| 56 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 56 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 57 | .width(CommonConstants.FULL_WIDTH) | 57 | .width(CommonConstants.FULL_WIDTH) |
| 58 | .maxLines(4) | 58 | .maxLines(4) |
| @@ -7,8 +7,6 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | @@ -7,8 +7,6 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | ||
| 7 | import { Notes } from './notes'; | 7 | import { Notes } from './notes'; |
| 8 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 8 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 9 | // import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 9 | // import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 10 | -import { viewBlogInsightIntentShare, ActionMode } from '../../utils/InsightIntentShare' | ||
| 11 | -import { common } from '@kit.AbilityKit'; | ||
| 12 | const TAG: string = 'Card2Component'; | 10 | const TAG: string = 'Card2Component'; |
| 13 | 11 | ||
| 14 | /** | 12 | /** |
| @@ -49,8 +47,10 @@ export struct Card2Component { | @@ -49,8 +47,10 @@ export struct Card2Component { | ||
| 49 | Column() { | 47 | Column() { |
| 50 | Stack() { | 48 | Stack() { |
| 51 | //新闻标题 | 49 | //新闻标题 |
| 52 | - if (this.contentDTO.objectType == '5') { | ||
| 53 | - Notes({ objectType: this.contentDTO.objectType }) | 50 | + if (this.contentDTO.newTags) { |
| 51 | + Notes({ newTags: this.contentDTO.newTags }) | ||
| 52 | + } else if (this.contentDTO.objectType == '5') { | ||
| 53 | + Notes({ objectType: this.contentDTO.objectType }) | ||
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | Text() { | 56 | Text() { |
| @@ -63,14 +63,18 @@ export struct Card2Component { | @@ -63,14 +63,18 @@ export struct Card2Component { | ||
| 63 | Span(this.contentDTO.newsTitle) | 63 | Span(this.contentDTO.newsTitle) |
| 64 | } | 64 | } |
| 65 | } | 65 | } |
| 66 | - .fontSize($r('app.float.font_size_17')) | 66 | + .fontSize($r('app.float.font_size_18')) |
| 67 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 67 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 68 | .maxLines(2) | 68 | .maxLines(2) |
| 69 | .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | 69 | .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 |
| 70 | .align(Alignment.Start) | 70 | .align(Alignment.Start) |
| 71 | - .textIndent(this.contentDTO.objectType == '5' ? 35 : 0) | ||
| 72 | - } | ||
| 73 | - .alignContent(Alignment.TopStart) | 71 | + .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : |
| 72 | + (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) || | ||
| 73 | + this.contentDTO.objectType == '5' ? 30 : 0) | ||
| 74 | + }.alignContent(Alignment.TopStart) | ||
| 75 | + //.textIndent(this.contentDTO.objectType == '5' ? 35 : 0) | ||
| 76 | + // } | ||
| 77 | + // .alignContent(Alignment.TopStart) | ||
| 74 | 78 | ||
| 75 | //大图 | 79 | //大图 |
| 76 | Stack() { | 80 | Stack() { |
| @@ -105,11 +109,6 @@ export struct Card2Component { | @@ -105,11 +109,6 @@ export struct Card2Component { | ||
| 105 | this.clicked = true; | 109 | this.clicked = true; |
| 106 | // persistentStorage(this.contentDTO.objectId); | 110 | // persistentStorage(this.contentDTO.objectId); |
| 107 | ProcessUtils.processPage(this.contentDTO) | 111 | ProcessUtils.processPage(this.contentDTO) |
| 108 | - | ||
| 109 | - if (this.contentDTO?.channelId === '2001' || this.contentDTO?.channelId === '2002') { | ||
| 110 | - let context = getContext(this) as common.UIAbilityContext; | ||
| 111 | - viewBlogInsightIntentShare(context, this.contentDTO?.channelId, [this.compDTO], ActionMode.EXECUTED) | ||
| 112 | - } | ||
| 113 | }) | 112 | }) |
| 114 | } | 113 | } |
| 115 | } | 114 | } |
| @@ -50,7 +50,8 @@ export struct Card3Component { | @@ -50,7 +50,8 @@ export struct Card3Component { | ||
| 50 | Span(this.contentDTO.newsTitle) | 50 | Span(this.contentDTO.newsTitle) |
| 51 | } | 51 | } |
| 52 | } | 52 | } |
| 53 | - .fontSize($r("app.float.font_size_16")) | 53 | + .lineHeight(27) |
| 54 | + .fontSize($r("app.float.font_size_18")) | ||
| 54 | .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) | 55 | .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) |
| 55 | .width(CommonConstants.FULL_WIDTH) | 56 | .width(CommonConstants.FULL_WIDTH) |
| 56 | .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : | 57 | .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : |
| @@ -4,7 +4,7 @@ import { ProcessUtils } from 'wdRouter'; | @@ -4,7 +4,7 @@ import { ProcessUtils } from 'wdRouter'; | ||
| 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' |
| 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 7 | - | 7 | +import { Notes } from './notes'; |
| 8 | const TAG: string = 'Card4Component'; | 8 | const TAG: string = 'Card4Component'; |
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| @@ -44,6 +44,11 @@ export struct Card4Component { | @@ -44,6 +44,11 @@ export struct Card4Component { | ||
| 44 | //body | 44 | //body |
| 45 | Column() { | 45 | Column() { |
| 46 | //新闻标题 | 46 | //新闻标题 |
| 47 | + if (this.contentDTO.newTags) { | ||
| 48 | + Notes({ newTags: this.contentDTO.newTags }) | ||
| 49 | + } else if (this.contentDTO.objectType == '5') { | ||
| 50 | + Notes({ objectType: this.contentDTO.objectType }) | ||
| 51 | + } | ||
| 47 | Text() { | 52 | Text() { |
| 48 | if (this.titleMarked) { | 53 | if (this.titleMarked) { |
| 49 | Span(this.str01) | 54 | Span(this.str01) |
| @@ -54,10 +59,12 @@ export struct Card4Component { | @@ -54,10 +59,12 @@ export struct Card4Component { | ||
| 54 | Span(this.contentDTO.newsTitle) | 59 | Span(this.contentDTO.newsTitle) |
| 55 | } | 60 | } |
| 56 | } | 61 | } |
| 57 | - .fontSize($r('app.float.font_size_17')) | 62 | + .fontSize($r('app.float.font_size_18')) |
| 58 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 63 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 59 | .maxLines(3) | 64 | .maxLines(3) |
| 60 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | 65 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 |
| 66 | + | ||
| 67 | + | ||
| 61 | //三图 | 68 | //三图 |
| 62 | Stack(){ | 69 | Stack(){ |
| 63 | Row() { | 70 | Row() { |
| 1 | -import { ContentDTO } from 'wdBean'; | 1 | +import { ContentDTO, CompDTO } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant'; | 2 | import { CommonConstants } from 'wdConstant'; |
| 3 | import { ProcessUtils } from 'wdRouter'; | 3 | import { ProcessUtils } from 'wdRouter'; |
| 4 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 4 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 5 | import { Notes } from './notes'; | 5 | import { Notes } from './notes'; |
| 6 | +import { viewBlogInsightIntentShare, ActionMode } from '../../utils/InsightIntentShare' | ||
| 7 | +import { common } from '@kit.AbilityKit'; | ||
| 6 | 8 | ||
| 7 | const TAG: string = 'Card5Component'; | 9 | const TAG: string = 'Card5Component'; |
| 8 | 10 | ||
| @@ -13,6 +15,7 @@ const TAG: string = 'Card5Component'; | @@ -13,6 +15,7 @@ const TAG: string = 'Card5Component'; | ||
| 13 | export struct Card5Component { | 15 | export struct Card5Component { |
| 14 | @State contentDTO: ContentDTO = new ContentDTO(); | 16 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 15 | @Prop titleShowPolicy: number | string | 17 | @Prop titleShowPolicy: number | string |
| 18 | + @Prop compDTO: CompDTO = {} as CompDTO | ||
| 16 | @State loadImg: boolean = false; | 19 | @State loadImg: boolean = false; |
| 17 | @State clicked: boolean = false; | 20 | @State clicked: boolean = false; |
| 18 | @State titleMarked: boolean = false; | 21 | @State titleMarked: boolean = false; |
| @@ -71,10 +74,11 @@ export struct Card5Component { | @@ -71,10 +74,11 @@ export struct Card5Component { | ||
| 71 | } | 74 | } |
| 72 | .width(CommonConstants.FULL_WIDTH) | 75 | .width(CommonConstants.FULL_WIDTH) |
| 73 | .fontColor(Color.White) | 76 | .fontColor(Color.White) |
| 74 | - .fontSize($r('app.float.font_size_17')) | 77 | + .fontSize($r('app.float.font_size_18')) |
| 75 | .fontWeight(FontWeight.Bold) | 78 | .fontWeight(FontWeight.Bold) |
| 76 | .maxLines(2) | 79 | .maxLines(2) |
| 77 | .align(Alignment.TopStart) | 80 | .align(Alignment.TopStart) |
| 81 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | ||
| 78 | .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : | 82 | .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 : |
| 79 | (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) || | 83 | (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) || |
| 80 | this.contentDTO.objectType == '5' ? 30 : 0) | 84 | this.contentDTO.objectType == '5' ? 30 : 0) |
| @@ -96,6 +100,8 @@ export struct Card5Component { | @@ -96,6 +100,8 @@ export struct Card5Component { | ||
| 96 | .onClick((event: ClickEvent) => { | 100 | .onClick((event: ClickEvent) => { |
| 97 | this.clicked = true; | 101 | this.clicked = true; |
| 98 | ProcessUtils.processPage(this.contentDTO) | 102 | ProcessUtils.processPage(this.contentDTO) |
| 103 | + let context = getContext(this) as common.UIAbilityContext; | ||
| 104 | + viewBlogInsightIntentShare(context, this.contentDTO?.channelId, [this.compDTO], ActionMode.EXECUTED) | ||
| 99 | }) | 105 | }) |
| 100 | 106 | ||
| 101 | } | 107 | } |
| @@ -70,8 +70,8 @@ export struct Card6Component { | @@ -70,8 +70,8 @@ export struct Card6Component { | ||
| 70 | } | 70 | } |
| 71 | } | 71 | } |
| 72 | .fontColor(this.clicked ? 0x848484 : 0x222222) | 72 | .fontColor(this.clicked ? 0x848484 : 0x222222) |
| 73 | - .fontSize(16) | ||
| 74 | - .lineHeight(24) | 73 | + .fontSize(18) |
| 74 | + .lineHeight(27) | ||
| 75 | .fontWeight(FontWeight.Normal) | 75 | .fontWeight(FontWeight.Normal) |
| 76 | .maxLines(3) | 76 | .maxLines(3) |
| 77 | .alignSelf(ItemAlign.Start) | 77 | .alignSelf(ItemAlign.Start) |
| @@ -50,7 +50,7 @@ export struct Card9Component { | @@ -50,7 +50,7 @@ export struct Card9Component { | ||
| 50 | } | 50 | } |
| 51 | .fontColor(this.clicked ? 0x848484 : 0x222222) | 51 | .fontColor(this.clicked ? 0x848484 : 0x222222) |
| 52 | .width(CommonConstants.FULL_WIDTH) | 52 | .width(CommonConstants.FULL_WIDTH) |
| 53 | - .fontSize($r('app.float.font_size_17')) | 53 | + .fontSize($r('app.float.font_size_18')) |
| 54 | .fontWeight(600) | 54 | .fontWeight(600) |
| 55 | .maxLines(2) | 55 | .maxLines(2) |
| 56 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 56 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| @@ -36,7 +36,7 @@ export struct SearchContentComponent { | @@ -36,7 +36,7 @@ export struct SearchContentComponent { | ||
| 36 | Column() { | 36 | Column() { |
| 37 | //新闻标题 | 37 | //新闻标题 |
| 38 | Text(this.contentDTO.newsTitle) | 38 | Text(this.contentDTO.newsTitle) |
| 39 | - .fontSize($r('app.float.font_size_17')) | 39 | + .fontSize($r('app.float.font_size_18')) |
| 40 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 40 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 41 | .maxLines(3) | 41 | .maxLines(3) |
| 42 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | 42 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 |
| @@ -156,7 +156,7 @@ export struct CommentIconComponent { | @@ -156,7 +156,7 @@ export struct CommentIconComponent { | ||
| 156 | // Stack({alignContent:Alignment.Start}) { | 156 | // Stack({alignContent:Alignment.Start}) { |
| 157 | if (Number.parseInt(this.publishCommentModel.totalCommentNumer) != 0) { | 157 | if (Number.parseInt(this.publishCommentModel.totalCommentNumer) != 0) { |
| 158 | RelativeContainer() { | 158 | RelativeContainer() { |
| 159 | - Image($r('app.media.comment_icon_number_bg')) | 159 | + Image(this.styleType == 1 ? $r('app.media.comment_icon_number_bg'):$r('app.media.ic_like_back_Select')) |
| 160 | .objectFit(ImageFit.Fill) | 160 | .objectFit(ImageFit.Fill) |
| 161 | .resizable({ | 161 | .resizable({ |
| 162 | slice: { | 162 | slice: { |
| @@ -208,7 +208,7 @@ struct CarouselLayout01CardView { | @@ -208,7 +208,7 @@ struct CarouselLayout01CardView { | ||
| 208 | Text(`${this.item.corner}${this.item.newsTitle}`) | 208 | Text(`${this.item.corner}${this.item.newsTitle}`) |
| 209 | .width(CommonConstants.FULL_PARENT) | 209 | .width(CommonConstants.FULL_PARENT) |
| 210 | .fontColor(Color.White) | 210 | .fontColor(Color.White) |
| 211 | - .fontSize($r('app.float.font_size_16')) | 211 | + .fontSize($r('app.float.font_size_18')) |
| 212 | .fontWeight(FontWeight.Medium) | 212 | .fontWeight(FontWeight.Medium) |
| 213 | .textAlign(TextAlign.Start) | 213 | .textAlign(TextAlign.Start) |
| 214 | .align(Alignment.Bottom) | 214 | .align(Alignment.Bottom) |
| @@ -57,7 +57,7 @@ export struct ZhSingleColumn04 { | @@ -57,7 +57,7 @@ export struct ZhSingleColumn04 { | ||
| 57 | .width(12) | 57 | .width(12) |
| 58 | .margin({ left: 12, right: 8 }) | 58 | .margin({ left: 12, right: 8 }) |
| 59 | Text(item.newsTitle) | 59 | Text(item.newsTitle) |
| 60 | - .fontSizeColorWeight($r('app.float.font_size_17'), $r('app.color.color_222222'), 400) | 60 | + .fontSizeColorWeight($r('app.float.font_size_18'), $r('app.color.color_222222'), 400) |
| 61 | .maxLines(1) | 61 | .maxLines(1) |
| 62 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 62 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 63 | .layoutWeight(1) | 63 | .layoutWeight(1) |
| @@ -40,7 +40,6 @@ export struct ZhSingleRow03 { | @@ -40,7 +40,6 @@ export struct ZhSingleRow03 { | ||
| 40 | 40 | ||
| 41 | // 请求所有预约状态 | 41 | // 请求所有预约状态 |
| 42 | async getReserveState() { | 42 | async getReserveState() { |
| 43 | - this.reservedIds = [] | ||
| 44 | const reserveBean: reserveReqItem[] = this.compDTO.operDataList.map((item: ContentDTO) => { | 43 | const reserveBean: reserveReqItem[] = this.compDTO.operDataList.map((item: ContentDTO) => { |
| 45 | const reqItem: reserveReqItem = { | 44 | const reqItem: reserveReqItem = { |
| 46 | liveId: item.objectId.toString(), | 45 | liveId: item.objectId.toString(), |
| @@ -49,6 +48,7 @@ export struct ZhSingleRow03 { | @@ -49,6 +48,7 @@ export struct ZhSingleRow03 { | ||
| 49 | return reqItem; | 48 | return reqItem; |
| 50 | }) | 49 | }) |
| 51 | const res = await LiveModel.getAppointmentStatus(reserveBean); | 50 | const res = await LiveModel.getAppointmentStatus(reserveBean); |
| 51 | + this.reservedIds = [] | ||
| 52 | // this.reserveStatus = res; | 52 | // this.reserveStatus = res; |
| 53 | Logger.debug(TAG, '数据信息:' + `${JSON.stringify(res)}`) | 53 | Logger.debug(TAG, '数据信息:' + `${JSON.stringify(res)}`) |
| 54 | res.map((item: ReserveItemBean) => { | 54 | res.map((item: ReserveItemBean) => { |
| @@ -280,6 +280,8 @@ struct CreatorItem { | @@ -280,6 +280,8 @@ struct CreatorItem { | ||
| 280 | .backgroundColor(0xf5f5f5) | 280 | .backgroundColor(0xf5f5f5) |
| 281 | .width(156) | 281 | .width(156) |
| 282 | .height(208) | 282 | .height(208) |
| 283 | + .border({width: 1}) | ||
| 284 | + .borderRadius(3) | ||
| 283 | Row() | 285 | Row() |
| 284 | .width(156) | 286 | .width(156) |
| 285 | .height(80) | 287 | .height(80) |
| @@ -101,7 +101,7 @@ struct localCard { | @@ -101,7 +101,7 @@ struct localCard { | ||
| 101 | Text(this.operDataListItem.newsTitle) | 101 | Text(this.operDataListItem.newsTitle) |
| 102 | .width(CommonConstants.FULL_PARENT) | 102 | .width(CommonConstants.FULL_PARENT) |
| 103 | .height(CommonConstants.FULL_PARENT) | 103 | .height(CommonConstants.FULL_PARENT) |
| 104 | - .fontSize($r('app.float.font_size_16')) | 104 | + .fontSize($r('app.float.font_size_18')) |
| 105 | .fontColor('#000000') | 105 | .fontColor('#000000') |
| 106 | .align(Alignment.TopStart) | 106 | .align(Alignment.TopStart) |
| 107 | .maxLines(3) | 107 | .maxLines(3) |
| @@ -168,7 +168,7 @@ export struct ZhSingleRow06 { | @@ -168,7 +168,7 @@ export struct ZhSingleRow06 { | ||
| 168 | ? item.operDataList[0]?.commentInfo?.userHeaderUrl | 168 | ? item.operDataList[0]?.commentInfo?.userHeaderUrl |
| 169 | ? item.operDataList[0].commentInfo.userHeaderUrl | 169 | ? item.operDataList[0].commentInfo.userHeaderUrl |
| 170 | : $r('app.media.default_head') | 170 | : $r('app.media.default_head') |
| 171 | - : '') | 171 | + : $r('app.media.comment_rmh_tag')) |
| 172 | .width(32) | 172 | .width(32) |
| 173 | .height(32) | 173 | .height(32) |
| 174 | .borderRadius(16) | 174 | .borderRadius(16) |
| 1 | -import { Logger, NumberFormatterUtils } from 'wdKit/Index' | 1 | +import { DisplayUtils,Logger, NumberFormatterUtils } from 'wdKit/Index' |
| 2 | import { LikeViewModel } from '../../viewmodel/LikeViewModel' | 2 | import { LikeViewModel } from '../../viewmodel/LikeViewModel' |
| 3 | import { SPHelper } from 'wdKit'; | 3 | import { SPHelper } from 'wdKit'; |
| 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 5 | import { SpConstants } from 'wdConstant/Index'; | 5 | import { SpConstants } from 'wdConstant/Index'; |
| 6 | import { ContentDetailDTO } from 'wdBean/Index'; | 6 | import { ContentDetailDTO } from 'wdBean/Index'; |
| 7 | - | 7 | +import measure from '@ohos.measure' |
| 8 | 8 | ||
| 9 | const TAG = 'LikeComponent'; | 9 | const TAG = 'LikeComponent'; |
| 10 | 10 | ||
| @@ -168,30 +168,74 @@ export struct LikeComponent { | @@ -168,30 +168,74 @@ export struct LikeComponent { | ||
| 168 | likeCompStyle5() { | 168 | likeCompStyle5() { |
| 169 | //1: 底部栏目样式 默认样式 | 169 | //1: 底部栏目样式 默认样式 |
| 170 | Stack({ alignContent: Alignment.Bottom }) { | 170 | Stack({ alignContent: Alignment.Bottom }) { |
| 171 | - Column() { | ||
| 172 | - // Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default')) | ||
| 173 | - Image(this.transLikeStyle().url) | ||
| 174 | - .width(24) | ||
| 175 | - .height(24) | ||
| 176 | - .onClick(() => { | ||
| 177 | - this.clickButtonEvent() | 171 | + Image(this.transLikeStyle().url) |
| 172 | + .width(24) | ||
| 173 | + .height(24) | ||
| 174 | + if (this.likeCount > 0){ | ||
| 175 | + RelativeContainer() { | ||
| 176 | + Image(this.likeStatus ? $r('app.media.ic_like_back_Select') : $r('app.media.ic_like_back')) | ||
| 177 | + .objectFit(ImageFit.Fill) | ||
| 178 | + .resizable({ | ||
| 179 | + slice: { | ||
| 180 | + top: 1, | ||
| 181 | + left: 20, | ||
| 182 | + right: 1, | ||
| 183 | + bottom: 1 | ||
| 184 | + } | ||
| 178 | }) | 185 | }) |
| 179 | - } | 186 | + .alignRules({ |
| 187 | + top: { anchor: "Text", align: VerticalAlign.Top }, | ||
| 188 | + left: { anchor: "Text", align: HorizontalAlign.Start }, | ||
| 189 | + right: { anchor: "Text", align: HorizontalAlign.End }, | ||
| 190 | + bottom: { anchor: "Text", align: VerticalAlign.Bottom }, | ||
| 191 | + }) | ||
| 192 | + .id("Image") | ||
| 180 | 193 | ||
| 181 | - Row() { | ||
| 182 | - Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) | 194 | + Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || ''))// Text("44444444") |
| 183 | .fontSize(8) | 195 | .fontSize(8) |
| 184 | - .fontColor(Color.White) | ||
| 185 | - .padding({ left: 4, right: 2 }) | 196 | + .fontColor('#ffffff')// .backgroundColor('#ED2800') |
| 197 | + .height(12) | ||
| 198 | + .textAlign(TextAlign.Center) | ||
| 199 | + .alignRules({ | ||
| 200 | + top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 201 | + left: { anchor: "__container__", align: HorizontalAlign.Start } | ||
| 202 | + })/*动态计算文字宽度*/ | ||
| 203 | + .width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) + | ||
| 204 | + 12)// .backgroundColor(Color.Green) | ||
| 205 | + .id("Text") | ||
| 206 | + .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden) | ||
| 186 | } | 207 | } |
| 187 | - .height(12) | ||
| 188 | - .alignItems(VerticalAlign.Center) | ||
| 189 | - .position({ x: '100%', }) | ||
| 190 | - .markAnchor({ x: '100%' }) | ||
| 191 | - .backgroundImage(this.likeStatus ? $r('app.media.ic_like_back_Select') : $r('app.media.ic_like_back')) | ||
| 192 | - .backgroundImageSize(ImageSize.Auto) | ||
| 193 | - .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden) | ||
| 194 | - }.width(24).height(24) | 208 | + .offset({ |
| 209 | + x: 12 | ||
| 210 | + }) | ||
| 211 | + } | ||
| 212 | + | ||
| 213 | + // Column() { | ||
| 214 | + // // Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default')) | ||
| 215 | + // Image(this.transLikeStyle().url) | ||
| 216 | + // .width(24) | ||
| 217 | + // .height(24) | ||
| 218 | + // .onClick(() => { | ||
| 219 | + // this.clickButtonEvent() | ||
| 220 | + // }) | ||
| 221 | + // } | ||
| 222 | + // | ||
| 223 | + // Row() { | ||
| 224 | + // Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) | ||
| 225 | + // .fontSize(8) | ||
| 226 | + // .fontColor(Color.White) | ||
| 227 | + // .padding({ left: 4, right: 2 }) | ||
| 228 | + // } | ||
| 229 | + // .height(12) | ||
| 230 | + // .alignItems(VerticalAlign.Center) | ||
| 231 | + // .position({ x: '100%', }) | ||
| 232 | + // .markAnchor({ x: '100%' }) | ||
| 233 | + // .backgroundImage(this.likeStatus ? $r('app.media.ic_like_back_Select') : $r('app.media.ic_like_back')) | ||
| 234 | + // .backgroundImageSize(ImageSize.Auto) | ||
| 235 | + // .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden) | ||
| 236 | + }.width(24).height(24).onClick(() => { | ||
| 237 | + this.clickButtonEvent() | ||
| 238 | + }) | ||
| 195 | } | 239 | } |
| 196 | 240 | ||
| 197 | @Builder | 241 | @Builder |
| @@ -210,8 +254,6 @@ export struct LikeComponent { | @@ -210,8 +254,6 @@ export struct LikeComponent { | ||
| 210 | .height(36) | 254 | .height(36) |
| 211 | .borderRadius(18) | 255 | .borderRadius(18) |
| 212 | .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : '#FFF5F5F5') | 256 | .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : '#FFF5F5F5') |
| 213 | - | ||
| 214 | - | ||
| 215 | Row() { | 257 | Row() { |
| 216 | Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) | 258 | Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) |
| 217 | .fontSize(8) | 259 | .fontSize(8) |
| @@ -306,4 +348,14 @@ export struct LikeComponent { | @@ -306,4 +348,14 @@ export struct LikeComponent { | ||
| 306 | this.likeCount = 0 | 348 | this.likeCount = 0 |
| 307 | }) | 349 | }) |
| 308 | } | 350 | } |
| 351 | + private getMeasureText(text: string) { | ||
| 352 | + let width = measure.measureText({ | ||
| 353 | + textContent: text, | ||
| 354 | + fontSize: 8, | ||
| 355 | + lineHeight: 12, | ||
| 356 | + constraintWidth: DisplayUtils.getDeviceWidth(), | ||
| 357 | + }) | ||
| 358 | + width = px2vp(width) | ||
| 359 | + return width | ||
| 360 | + } | ||
| 309 | } | 361 | } |
| @@ -132,54 +132,61 @@ export struct OperRowListView { | @@ -132,54 +132,61 @@ export struct OperRowListView { | ||
| 132 | build() { | 132 | build() { |
| 133 | // 视频详情页 | 133 | // 视频详情页 |
| 134 | 134 | ||
| 135 | - Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { | ||
| 136 | - // AudioDialog() | ||
| 137 | - Row() { | ||
| 138 | - Column() { | ||
| 139 | - Image(this.styleType == 1 ? $r('app.media.icon_arrow_left') : | ||
| 140 | - $r('app.media.icon_arrow_left_white')) | ||
| 141 | - .width(24) | ||
| 142 | - .height(24) | ||
| 143 | - .aspectRatio(1) | ||
| 144 | - .interpolation(ImageInterpolation.High) | ||
| 145 | - } | ||
| 146 | - .hoverEffect(HoverEffect.Scale) | ||
| 147 | - .onClick(() => { | ||
| 148 | - if (this.onBack) { | ||
| 149 | - this.onBack() | ||
| 150 | - } | ||
| 151 | - router.back(); | ||
| 152 | - }) | ||
| 153 | - .width(42) | 135 | + Column() { |
| 136 | + Image($r('app.media.ic_news_detail_division')) | ||
| 137 | + .width('100%') | ||
| 138 | + .height($r('app.float.margin_1')) | ||
| 139 | + .margin({bottom: -2}) | ||
| 154 | 140 | ||
| 155 | - if (this.contentDetailData?.newsId) { | ||
| 156 | - ForEach(this.operationButtonList, (item: string, index: number) => { | ||
| 157 | - if (item == 'comment') { | ||
| 158 | - this.builderComment() | ||
| 159 | - } else if (item == 'like' && this.needLike) { | ||
| 160 | - this.builderLike() | ||
| 161 | - } else if (item == 'collect') { | ||
| 162 | - this.builderCollect() | ||
| 163 | - } else if (item == 'listen') { | ||
| 164 | - this.builderListen() | ||
| 165 | - } else if (item == 'share') { | ||
| 166 | - this.builderShare() | ||
| 167 | - } else { | 141 | + Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { |
| 142 | + // AudioDialog() | ||
| 143 | + Row() { | ||
| 144 | + Column() { | ||
| 145 | + Image(this.styleType == 1 ? $r('app.media.icon_arrow_left') : | ||
| 146 | + $r('app.media.icon_arrow_left_white')) | ||
| 147 | + .width(24) | ||
| 148 | + .height(24) | ||
| 149 | + .aspectRatio(1) | ||
| 150 | + .interpolation(ImageInterpolation.High) | ||
| 151 | + } | ||
| 152 | + .hoverEffect(HoverEffect.Scale) | ||
| 153 | + .onClick(() => { | ||
| 154 | + if (this.onBack) { | ||
| 155 | + this.onBack() | ||
| 168 | } | 156 | } |
| 157 | + router.back(); | ||
| 169 | }) | 158 | }) |
| 159 | + .width(48) | ||
| 160 | + | ||
| 161 | + if (this.contentDetailData?.newsId) { | ||
| 162 | + ForEach(this.operationButtonList, (item: string, index: number) => { | ||
| 163 | + if (item == 'comment') { | ||
| 164 | + this.builderComment() | ||
| 165 | + } else if (item == 'like' && this.needLike) { | ||
| 166 | + this.builderLike() | ||
| 167 | + } else if (item == 'collect') { | ||
| 168 | + this.builderCollect() | ||
| 169 | + } else if (item == 'listen') { | ||
| 170 | + this.builderListen() | ||
| 171 | + } else if (item == 'share') { | ||
| 172 | + this.builderShare() | ||
| 173 | + } else { | ||
| 174 | + } | ||
| 175 | + }) | ||
| 176 | + } | ||
| 170 | } | 177 | } |
| 178 | + .width('100%') | ||
| 179 | + .justifyContent(FlexAlign.Start) | ||
| 171 | } | 180 | } |
| 172 | .width('100%') | 181 | .width('100%') |
| 173 | - .justifyContent(FlexAlign.Start) | 182 | + .backgroundColor(this.bgColor) |
| 183 | + .padding({ | ||
| 184 | + top: 10, | ||
| 185 | + // bottom: 10 | ||
| 186 | + bottom: `${this.bottomSafeHeight}px` | ||
| 187 | + // bottom: 50 | ||
| 188 | + }) | ||
| 174 | } | 189 | } |
| 175 | - .width('100%') | ||
| 176 | - .backgroundColor(this.bgColor) | ||
| 177 | - .padding({ | ||
| 178 | - top: 10, | ||
| 179 | - // bottom: 10 | ||
| 180 | - bottom: `${this.bottomSafeHeight}px` | ||
| 181 | - // bottom: 50 | ||
| 182 | - }) | ||
| 183 | 190 | ||
| 184 | } | 191 | } |
| 185 | 192 | ||
| @@ -200,7 +207,7 @@ export struct OperRowListView { | @@ -200,7 +207,7 @@ export struct OperRowListView { | ||
| 200 | } | 207 | } |
| 201 | .layoutWeight(1) | 208 | .layoutWeight(1) |
| 202 | .margin({ | 209 | .margin({ |
| 203 | - right: this.pageComponentType === 1 ? 16 : 0, | 210 | + right: this.pageComponentType === 1 ? 22 : 0, |
| 204 | }) | 211 | }) |
| 205 | 212 | ||
| 206 | if (this.showCommentIcon) { | 213 | if (this.showCommentIcon) { |
| @@ -212,7 +219,7 @@ export struct OperRowListView { | @@ -212,7 +219,7 @@ export struct OperRowListView { | ||
| 212 | }) | 219 | }) |
| 213 | } | 220 | } |
| 214 | } | 221 | } |
| 215 | - .width(46) | 222 | + .width(48) |
| 216 | } | 223 | } |
| 217 | 224 | ||
| 218 | } | 225 | } |
| @@ -233,7 +240,7 @@ export struct OperRowListView { | @@ -233,7 +240,7 @@ export struct OperRowListView { | ||
| 233 | }) | 240 | }) |
| 234 | // } | 241 | // } |
| 235 | } | 242 | } |
| 236 | - .width(42) | 243 | + .width(48) |
| 237 | .visibility(this.likesStyle !== 4 ? Visibility.Visible : Visibility.None) | 244 | .visibility(this.likesStyle !== 4 ? Visibility.Visible : Visibility.None) |
| 238 | } | 245 | } |
| 239 | 246 | ||
| @@ -261,7 +268,7 @@ export struct OperRowListView { | @@ -261,7 +268,7 @@ export struct OperRowListView { | ||
| 261 | })*/ | 268 | })*/ |
| 262 | } | 269 | } |
| 263 | .height(36) | 270 | .height(36) |
| 264 | - .width(36) | 271 | + .width(48) |
| 265 | .borderRadius(18) | 272 | .borderRadius(18) |
| 266 | .backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent) | 273 | .backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent) |
| 267 | .onClick(() => { | 274 | .onClick(() => { |
| @@ -289,7 +296,7 @@ export struct OperRowListView { | @@ -289,7 +296,7 @@ export struct OperRowListView { | ||
| 289 | }) | 296 | }) |
| 290 | } | 297 | } |
| 291 | .height(36) | 298 | .height(36) |
| 292 | - .width(36) | 299 | + .width(48) |
| 293 | .justifyContent(FlexAlign.Center) | 300 | .justifyContent(FlexAlign.Center) |
| 294 | } | 301 | } |
| 295 | 302 | ||
| @@ -312,7 +319,7 @@ export struct OperRowListView { | @@ -312,7 +319,7 @@ export struct OperRowListView { | ||
| 312 | } | 319 | } |
| 313 | .justifyContent(FlexAlign.Center) | 320 | .justifyContent(FlexAlign.Center) |
| 314 | .height(36) | 321 | .height(36) |
| 315 | - .width(36) | 322 | + .width(48) |
| 316 | .borderRadius(18) | 323 | .borderRadius(18) |
| 317 | .backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent) | 324 | .backgroundColor(this.pageComponentType === 2 ? '#4D000000' : Color.Transparent) |
| 318 | } | 325 | } |
| 1 | import { common } from '@kit.AbilityKit'; | 1 | import { common } from '@kit.AbilityKit'; |
| 2 | import { insightIntent } from '@kit.IntentsKit'; | 2 | import { insightIntent } from '@kit.IntentsKit'; |
| 3 | +import { BusinessError } from '@kit.BasicServicesKit'; | ||
| 3 | import { CompDTO, CompList, ContentDTO, PageInfoBean } from 'wdBean'; | 4 | import { CompDTO, CompList, ContentDTO, PageInfoBean } from 'wdBean'; |
| 4 | 5 | ||
| 5 | -function generateUniqueId() { | ||
| 6 | - // 生成当前时间戳 | ||
| 7 | - let timestamp = new Date().getTime(); | ||
| 8 | - | ||
| 9 | - // 将时间戳转换成16进制字符串 | ||
| 10 | - let hexString = timestamp.toString(16); | ||
| 11 | - | ||
| 12 | - // 确保字符串长度为16位,不足的话在前面补0 | ||
| 13 | - while (hexString.length < 16) { | ||
| 14 | - hexString = '0' + hexString; | ||
| 15 | - } | ||
| 16 | - | ||
| 17 | - // 格式化为UUID样式 | ||
| 18 | - let uuid = hexString.substring(0, 8) + '-' + | ||
| 19 | - hexString.substring(8, 12) + '-' + | ||
| 20 | - hexString.substring(12, 16) + '-' + | ||
| 21 | - hexString.substring(16, 20) + '-' + | ||
| 22 | - hexString.substring(20); | ||
| 23 | - | 6 | +function generateUUID() { |
| 7 | + let dt = new Date().getTime(); // 获取当前时间的时间戳(毫秒) | ||
| 8 | + let uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => { | ||
| 9 | + let r = (dt + Math.random() * 16) % 16 | 0; | ||
| 10 | + dt = Math.floor(dt / 16); | ||
| 11 | + return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16); | ||
| 12 | + }); | ||
| 24 | return uuid; | 13 | return uuid; |
| 25 | } | 14 | } |
| 26 | 15 | ||
| @@ -34,15 +23,16 @@ export const enum ActionMode { | @@ -34,15 +23,16 @@ export const enum ActionMode { | ||
| 34 | //ViewBlog意图共享-频道列表 | 23 | //ViewBlog意图共享-频道列表 |
| 35 | export function viewBlogInsightIntentShare(context: common.UIAbilityContext, entityGroupId: string, | 24 | export function viewBlogInsightIntentShare(context: common.UIAbilityContext, entityGroupId: string, |
| 36 | compList: CompDTO[] | CompList[], actionMode: ActionMode) { | 25 | compList: CompDTO[] | CompList[], actionMode: ActionMode) { |
| 37 | - console.log('viewBlogInsightIntentShare',actionMode) | 26 | + console.log('viewBlogInsightIntentShare', actionMode) |
| 38 | let insightIntentArray: insightIntent.InsightIntent [] = [] | 27 | let insightIntentArray: insightIntent.InsightIntent [] = [] |
| 28 | + let identifier = generateUUID() | ||
| 39 | if (compList?.length > 0) { | 29 | if (compList?.length > 0) { |
| 40 | compList?.forEach((item: CompDTO | CompList) => { | 30 | compList?.forEach((item: CompDTO | CompList) => { |
| 41 | item.operDataList.forEach((_item: ContentDTO) => { | 31 | item.operDataList.forEach((_item: ContentDTO) => { |
| 42 | let viewBlogInsightIntentItem: insightIntent.InsightIntent = { | 32 | let viewBlogInsightIntentItem: insightIntent.InsightIntent = { |
| 43 | intentName: 'ViewBlog', | 33 | intentName: 'ViewBlog', |
| 44 | intentVersion: '1.0.1', | 34 | intentVersion: '1.0.1', |
| 45 | - identifier: generateUniqueId(), | 35 | + identifier, |
| 46 | intentActionInfo: { | 36 | intentActionInfo: { |
| 47 | actionMode, | 37 | actionMode, |
| 48 | currentPercentage: 50, | 38 | currentPercentage: 50, |
| @@ -67,7 +57,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | @@ -67,7 +57,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | ||
| 67 | _item?.newsSummary.substring(0, 20) : _item?.newsSummary, | 57 | _item?.newsSummary.substring(0, 20) : _item?.newsSummary, |
| 68 | blogAuthor: _item?.source, | 58 | blogAuthor: _item?.source, |
| 69 | blogPublishTime: _item?.publishTimestamp, | 59 | blogPublishTime: _item?.publishTimestamp, |
| 70 | - tag: _item?.newTags, | 60 | + tag: _item?.newTags.split(','), |
| 71 | likeCount: _item?.interactData?.likeNum || 0, | 61 | likeCount: _item?.interactData?.likeNum || 0, |
| 72 | forwardCount: _item?.interactData?.shareNum || 0, | 62 | forwardCount: _item?.interactData?.shareNum || 0, |
| 73 | commentCount: _item?.interactData?.commentNum || 0, | 63 | commentCount: _item?.interactData?.commentNum || 0, |
| @@ -82,21 +72,13 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | @@ -82,21 +72,13 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | ||
| 82 | 72 | ||
| 83 | }) | 73 | }) |
| 84 | console.log('yzl', JSON.stringify(insightIntentArray[0])) | 74 | console.log('yzl', JSON.stringify(insightIntentArray[0])) |
| 85 | - try { | ||
| 86 | - // 共享数据 | ||
| 87 | - insightIntent.shareIntent(context, insightIntentArray, (error) => { | ||
| 88 | - if (error?.code) { | ||
| 89 | - // 处理业务逻辑错误 | ||
| 90 | - console.error(`shareIntent failed, error.code: ${error?.code}, error.message: ${error?.message}`); | ||
| 91 | - return; | ||
| 92 | - } | ||
| 93 | - // 执行正常业务 | ||
| 94 | - console.log('shareIntent succeed'); | ||
| 95 | - }); | ||
| 96 | - } catch (error) { | ||
| 97 | - // 处理异常 | ||
| 98 | - console.error(`error.code: ${error?.code}, error.message: ${error?.message}`); | ||
| 99 | - } | 75 | + // 共享数据 |
| 76 | + insightIntent.shareIntent(context, insightIntentArray).then(() => { | ||
| 77 | + console.log('yzl shareIntent success'); | ||
| 78 | + }).catch((err: BusinessError) => { | ||
| 79 | + console.error(`yzl failed because ${err?.message}`); | ||
| 80 | + }); | ||
| 81 | + | ||
| 100 | } | 82 | } |
| 101 | } | 83 | } |
| 102 | 84 | ||
| @@ -108,7 +90,7 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en | @@ -108,7 +90,7 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en | ||
| 108 | let viewBlogInsightIntentItem: insightIntent.InsightIntent = { | 90 | let viewBlogInsightIntentItem: insightIntent.InsightIntent = { |
| 109 | intentName: 'ViewColumn', | 91 | intentName: 'ViewColumn', |
| 110 | intentVersion: '1.0.1', | 92 | intentVersion: '1.0.1', |
| 111 | - identifier: generateUniqueId(), | 93 | + identifier: generateUUID(), |
| 112 | intentActionInfo: { | 94 | intentActionInfo: { |
| 113 | actionMode: ActionMode.EXECUTED, | 95 | actionMode: ActionMode.EXECUTED, |
| 114 | currentPercentage: 50, | 96 | currentPercentage: 50, |
| @@ -116,30 +98,22 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en | @@ -116,30 +98,22 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en | ||
| 116 | intentEntityInfo: { | 98 | intentEntityInfo: { |
| 117 | entityName: 'Column', | 99 | entityName: 'Column', |
| 118 | entityId, | 100 | entityId, |
| 119 | - displayName:pageInfoBean?.topicInfo?.title, | 101 | + displayName: pageInfoBean?.topicInfo?.title, |
| 120 | description: pageInfoBean?.shareSummary, | 102 | description: pageInfoBean?.shareSummary, |
| 121 | - logoURL:pageInfoBean?.shareCoverUrl, | ||
| 122 | - activityType:['RecentViews'], | 103 | + logoURL: pageInfoBean?.shareCoverUrl, |
| 104 | + activityType: ['RecentViews'], | ||
| 123 | columnTitle: pageInfoBean?.topicInfo?.title, | 105 | columnTitle: pageInfoBean?.topicInfo?.title, |
| 124 | columnSubTitle: pageInfoBean?.shareSummary, | 106 | columnSubTitle: pageInfoBean?.shareSummary, |
| 125 | rankingHint: 99, | 107 | rankingHint: 99, |
| 126 | isPublicData: true | 108 | isPublicData: true |
| 127 | } | 109 | } |
| 128 | } | 110 | } |
| 111 | + console.log('yzl viewColumInsightIntentShare', JSON.stringify(viewBlogInsightIntentItem)) | ||
| 129 | 112 | ||
| 130 | - try { | ||
| 131 | - // 共享数据 | ||
| 132 | - insightIntent.shareIntent(context, [viewBlogInsightIntentItem], (error) => { | ||
| 133 | - if (error?.code) { | ||
| 134 | - // 处理业务逻辑错误 | ||
| 135 | - console.error(`shareIntent failed, error.code: ${error?.code}, error.message: ${error?.message}`); | ||
| 136 | - return; | ||
| 137 | - } | ||
| 138 | - // 执行正常业务 | ||
| 139 | - console.log('shareIntent succeed'); | ||
| 140 | - }); | ||
| 141 | - } catch (error) { | ||
| 142 | - // 处理异常 | ||
| 143 | - console.error(`error.code: ${error?.code}, error.message: ${error?.message}`); | ||
| 144 | - } | 113 | + // 共享数据 |
| 114 | + insightIntent.shareIntent(context, [viewBlogInsightIntentItem]).then(() => { | ||
| 115 | + console.log('yzl shareIntent success'); | ||
| 116 | + }).catch((err: BusinessError) => { | ||
| 117 | + console.error(`yzl failed because ${err?.message}`); | ||
| 118 | + }); | ||
| 145 | } | 119 | } |
| 1 | -import { CompDTO, ContentDTO, InteractDataDTO, PageDTO, PageInfoDTO } from 'wdBean'; | 1 | +import { CompDTO, ContentDTO, InteractDataDTO, LiveReviewDTO, PageDTO, PageInfoDTO } from 'wdBean'; |
| 2 | import { CompStyle, ViewType } from 'wdConstant/Index'; | 2 | import { CompStyle, ViewType } from 'wdConstant/Index'; |
| 3 | import { CollectionUtils, DateTimeUtils, LazyDataSource, Logger, NetworkUtil, StringUtils } from 'wdKit'; | 3 | import { CollectionUtils, DateTimeUtils, LazyDataSource, Logger, NetworkUtil, StringUtils } from 'wdKit'; |
| 4 | import { closeRefresh } from '../utils/PullDownRefresh'; | 4 | import { closeRefresh } from '../utils/PullDownRefresh'; |
| @@ -13,6 +13,7 @@ import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean | @@ -13,6 +13,7 @@ import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean | ||
| 13 | import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO'; | 13 | import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO'; |
| 14 | import { viewBlogInsightIntentShare, ActionMode } from '../utils/InsightIntentShare' | 14 | import { viewBlogInsightIntentShare, ActionMode } from '../utils/InsightIntentShare' |
| 15 | import { common } from '@kit.AbilityKit'; | 15 | import { common } from '@kit.AbilityKit'; |
| 16 | + | ||
| 16 | const TAG = 'PageHelper'; | 17 | const TAG = 'PageHelper'; |
| 17 | 18 | ||
| 18 | /** | 19 | /** |
| @@ -75,7 +76,7 @@ export class PageHelper { | @@ -75,7 +76,7 @@ export class PageHelper { | ||
| 75 | return; | 76 | return; |
| 76 | } | 77 | } |
| 77 | pageModel.pageInfo = pageInfo; | 78 | pageModel.pageInfo = pageInfo; |
| 78 | - //解析广告资源 | 79 | + //解析页面挂角广告资源 |
| 79 | pageAdvModel.analysisAdvSource(pageInfo); | 80 | pageAdvModel.analysisAdvSource(pageInfo); |
| 80 | this.parseGroup(pageModel) | 81 | this.parseGroup(pageModel) |
| 81 | }).catch(() => { | 82 | }).catch(() => { |
| @@ -86,10 +87,17 @@ export class PageHelper { | @@ -86,10 +87,17 @@ export class PageHelper { | ||
| 86 | } | 87 | } |
| 87 | 88 | ||
| 88 | 89 | ||
| 90 | + /** | ||
| 91 | + * 解析信息流页面楼层数据 | ||
| 92 | + * @param pageModel | ||
| 93 | + */ | ||
| 89 | async parseGroup(pageModel: PageModel) { | 94 | async parseGroup(pageModel: PageModel) { |
| 90 | let pageInfo: PageInfoDTO = pageModel.pageInfo | 95 | let pageInfo: PageInfoDTO = pageModel.pageInfo |
| 91 | pageModel.groupList = [] | 96 | pageModel.groupList = [] |
| 97 | + pageInfo.pageAdList = [] | ||
| 98 | + pageInfo.oneRequestPageGroupCompList = new ArrayList() | ||
| 92 | pageModel.groupList.push(...pageInfo.groups) | 99 | pageModel.groupList.push(...pageInfo.groups) |
| 100 | + Logger.error("ZZZXXXXX", 'parseGroup----1-----'); | ||
| 93 | for (const group of pageInfo.groups) { | 101 | for (const group of pageInfo.groups) { |
| 94 | pageModel.isRecGroup = group.groupStrategy === 1; | 102 | pageModel.isRecGroup = group.groupStrategy === 1; |
| 95 | pageModel.groupId = group.id; | 103 | pageModel.groupId = group.id; |
| @@ -99,17 +107,40 @@ export class PageHelper { | @@ -99,17 +107,40 @@ export class PageHelper { | ||
| 99 | pageModel.pageSize = 20 | 107 | pageModel.pageSize = 20 |
| 100 | } | 108 | } |
| 101 | pageModel.groupData = group | 109 | pageModel.groupData = group |
| 110 | + | ||
| 111 | + Logger.error("ZZZXXXXX", '楼层id-start--》' + pageModel.groupId); | ||
| 102 | // await,确保groups接口顺序执行 | 112 | // await,确保groups接口顺序执行 |
| 103 | - let pageDto = await PageViewModel.getPageData(pageModel.bizCopy()) as PageDTO | 113 | + let pageDto = await PageViewModel.getPageGroupCompData(pageModel.bizCopy()) as PageDTO |
| 104 | let index = pageInfo.groups.indexOf(group) | 114 | let index = pageInfo.groups.indexOf(group) |
| 105 | if (index == 0) { | 115 | if (index == 0) { |
| 106 | // 清空comp列表 | 116 | // 清空comp列表 |
| 107 | - pageModel.compList.clearAllData() | 117 | + pageModel.compList.clear() |
| 108 | } | 118 | } |
| 109 | - this.getGroupData(pageModel, pageDto, index == pageInfo.groups.length - 1) | 119 | + this.analysisPageGroupCompData(pageModel,pageDto, pageInfo, index == pageInfo.groups.length - 1) |
| 120 | + Logger.error("ZZZXXXXX", '楼层id-end--》' + pageModel.groupId + ' 楼层 comp数量=' + pageDto.compList.length); | ||
| 121 | + } | ||
| 110 | 122 | ||
| 123 | + /* | ||
| 124 | + 收集页面所有楼层的组件信息,同步完成广告投放计算,异步完成稿件批查, | ||
| 125 | + */ | ||
| 126 | + pageModel.pageTotalCompSize = pageInfo.oneRequestPageGroupCompList.length + pageModel.pageTotalCompSize | ||
| 127 | + // 处理页面广告数据,投放到页面的位置 | ||
| 128 | + this.handlePageCompAdvPostion(pageInfo.oneRequestPageGroupCompList, pageModel, pageInfo.pageAdList); | ||
| 111 | 129 | ||
| 130 | + //遍历所有组件和稿件数据 push到页面 | ||
| 131 | + for (let element of pageInfo.oneRequestPageGroupCompList) { | ||
| 132 | + pageModel.compList.push(CompDTO.createNewsBean(element)) | ||
| 112 | } | 133 | } |
| 134 | + | ||
| 135 | + // 批查互动数据 | ||
| 136 | + this.allCompBatchRequest(pageInfo.oneRequestPageGroupCompList.convertToArray(), pageModel) | ||
| 137 | + | ||
| 138 | + // | ||
| 139 | + pageModel.currentPage++ | ||
| 140 | + pageModel.viewType = ViewType.LOADED | ||
| 141 | + closeRefresh(pageModel, true) | ||
| 142 | + | ||
| 143 | + Logger.error("ZZZXXXXX", 'parseGroup----3----->' + pageInfo.oneRequestPageGroupCompList.length); | ||
| 113 | if (pageModel.compList.isEmpty()) { | 144 | if (pageModel.compList.isEmpty()) { |
| 114 | // 没数据,展示空页面 | 145 | // 没数据,展示空页面 |
| 115 | Logger.debug(TAG, 'aboutToAppear, data response page ' + pageModel.pageId + ', comp list is empty.'); | 146 | Logger.debug(TAG, 'aboutToAppear, data response page ' + pageModel.pageId + ', comp list is empty.'); |
| @@ -119,39 +150,197 @@ export class PageHelper { | @@ -119,39 +150,197 @@ export class PageHelper { | ||
| 119 | } | 150 | } |
| 120 | } | 151 | } |
| 121 | 152 | ||
| 122 | - private async getGroupData(pageModel: PageModel, pageDto: PageDTO, isLastGroup: boolean) { | 153 | + /** |
| 154 | + * 解析页面的楼层数据 | ||
| 155 | + * @param pageDto 楼层的组件信息 | ||
| 156 | + * @param pageInfo 信息流页面信息 | ||
| 157 | + * @param isLastGroup pageDto信息是不是最后一个楼层 | ||
| 158 | + */ | ||
| 159 | + private async analysisPageGroupCompData(pageModel: PageModel,pageDto: PageDTO, pageInfo: PageInfoDTO, isLastGroup: boolean) { | ||
| 160 | + | ||
| 123 | if (pageDto && pageDto.compList && pageDto.compList.length > 0) { | 161 | if (pageDto && pageDto.compList && pageDto.compList.length > 0) { |
| 124 | - pageModel.viewType = ViewType.LOADED; | ||
| 125 | - if (isLastGroup) { | ||
| 126 | - // 认为分页只会在最后一个group里 | ||
| 127 | - pageModel.currentPage++; | ||
| 128 | - } | ||
| 129 | - // pageModel.currentPage++; | ||
| 130 | - pageModel.hasMore = true; | ||
| 131 | 162 | ||
| 132 | - //移除音频 和 活动 | ||
| 133 | - this.collectPageComp(pageModel, pageDto) | 163 | + let pageCompList: ArrayList<CompDTO> = new ArrayList() // 收集楼层组件、稿件和本地组件容器 |
| 164 | + // 遍历楼层的组件数据 | ||
| 165 | + pageDto.compList.forEach((element: CompDTO) => { | ||
| 166 | + let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0); | ||
| 167 | + //移除音频 和 活动 | ||
| 168 | + if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) { | ||
| 169 | + Logger.debug(TAG, 'getGroupData 移除音频 和 活动'); | ||
| 170 | + } else { | ||
| 171 | + // 暂时屏蔽活动和音频详情入口 | ||
| 172 | + if (element.operDataList[0]?.objectType === '3' || element.operDataList[0]?.objectType === '13') { | ||
| 173 | + } else { | ||
| 174 | + pageCompList.add(element) | ||
| 175 | + } | ||
| 176 | + } | ||
| 177 | + }) | ||
| 134 | 178 | ||
| 135 | - // TODO 暂时去掉互动数据,待优化。(主要是互动数据返回,如何渲染到ui上) | ||
| 136 | - // TODO updateItems(sizeBefore, data),这里可能有时序问题,导致覆盖别的group数据,需要优化,考虑精准替换 | ||
| 137 | - // 二次请求,批查互动数据 | ||
| 138 | - this.allCompBatchRequest(pageDto.compList, pageModel) | 179 | + // pageInfor 记录 |
| 180 | + pageCompList.forEach((comp: CompDTO) => { | ||
| 181 | + pageInfo.oneRequestPageGroupCompList.add(comp) | ||
| 182 | + }) | ||
| 139 | 183 | ||
| 184 | + // pageInfor 记录广告 | ||
| 185 | + if (pageDto.compAdList != null) { | ||
| 186 | + pageInfo.pageAdList.push(...pageDto.compAdList) | ||
| 187 | + } | ||
| 140 | 188 | ||
| 141 | - // content级别的展现加载丢给comp自己,这里只需要处理屏蔽分页加载,pageModel.pageScroll | 189 | + // 检测最后一个楼层是否有一行两图卡 |
| 142 | if (isLastGroup) { | 190 | if (isLastGroup) { |
| 143 | - closeRefresh(pageModel, true); | ||
| 144 | // 最后一个楼层,特殊处理 | 191 | // 最后一个楼层,特殊处理 |
| 145 | // 检测楼层最后一个组件业务数据是否需要通过访问接口获取 | 192 | // 检测楼层最后一个组件业务数据是否需要通过访问接口获取 |
| 146 | let comp: CompDTO = pageDto.compList[pageDto.compList.length - 1] | 193 | let comp: CompDTO = pageDto.compList[pageDto.compList.length - 1] |
| 147 | - let compSize = CollectionUtils.getListSize(comp.operDataList) | ||
| 148 | // 直播回放,需要二次请求数据 | 194 | // 直播回放,需要二次请求数据 |
| 149 | - if (compSize <= 0 && comp.compStyle == CompStyle.Zh_Grid_Layout_02) { | 195 | + if ( comp.compStyle == CompStyle.Zh_Grid_Layout_02) { |
| 150 | // 这个comp,数据自己二次请求,自己分页处理,这里加flag,将page层滑动及loadmore ui去掉 | 196 | // 这个comp,数据自己二次请求,自己分页处理,这里加flag,将page层滑动及loadmore ui去掉 |
| 151 | pageModel.contentNeedScroll = true | 197 | pageModel.contentNeedScroll = true |
| 198 | + | ||
| 199 | + //this.getLiveReviewData(pageInfo,comp) | ||
| 200 | + } | ||
| 201 | + } | ||
| 202 | + } | ||
| 203 | + | ||
| 204 | + } | ||
| 205 | + | ||
| 206 | + | ||
| 207 | + /** | ||
| 208 | + * comp加载更多,分页加载 | ||
| 209 | + */ | ||
| 210 | + private compLoadMore(pageModel: PageModel) { | ||
| 211 | + //聚合页 | ||
| 212 | + if (pageModel.pageType == 1) { | ||
| 213 | + PageViewModel.postThemeList(pageModel.currentPage, pageModel.pageSize, pageModel.extra).then((liveReviewDTO) => { | ||
| 214 | + if (liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0) { | ||
| 215 | + pageModel.hasMore = false; | ||
| 216 | + return; | ||
| 217 | + } else { | ||
| 218 | + //更新数据 | ||
| 219 | + pageModel.compList.addItems(liveReviewDTO.list); | ||
| 220 | + // 直接认为有分页,一直加载分页。直到没有数据,再停止 | ||
| 221 | + pageModel.currentPage++; | ||
| 222 | + pageModel.hasMore = true; | ||
| 223 | + pageModel.pageTotalCompSize = liveReviewDTO.list.length + pageModel.pageTotalCompSize | ||
| 224 | + } | ||
| 225 | + }).catch((err: string | Resource) => { | ||
| 226 | + promptAction.showToast({ message: err }); | ||
| 227 | + }) | ||
| 228 | + } else { | ||
| 229 | + PageViewModel.getPageGroupCompData(pageModel.bizCopy()) | ||
| 230 | + .then((data: PageDTO) => { | ||
| 231 | + if (data == null || data.compList == null || data.compList.length == 0) { | ||
| 232 | + pageModel.hasMore = false; | ||
| 233 | + } else { | ||
| 234 | + // 直接认为有分页,一直加载分页。直到没有数据,再停止 | ||
| 235 | + pageModel.currentPage++; | ||
| 236 | + pageModel.hasMore = true; | ||
| 237 | + | ||
| 238 | + //移除音频 和 活动 | ||
| 239 | + this.loadMorePageComp(pageModel, data) | ||
| 240 | + // 参与批查 | ||
| 241 | + this.allCompBatchRequest(data.compList, pageModel) | ||
| 242 | + } | ||
| 243 | + }).catch((err: string | Resource) => { | ||
| 244 | + promptAction.showToast({ message: err }); | ||
| 245 | + }) | ||
| 246 | + } | ||
| 247 | + } | ||
| 248 | + | ||
| 249 | + | ||
| 250 | + /** | ||
| 251 | + * 加载更多页面组件和稿件信息 | ||
| 252 | + */ | ||
| 253 | + private loadMorePageComp(pageModel: PageModel, pageDto: PageDTO) { | ||
| 254 | + | ||
| 255 | + let pageCompList: ArrayList<CompDTO> = new ArrayList() // 收集页面组件、稿件和本地组件容器 | ||
| 256 | + | ||
| 257 | + pageDto.compList.forEach((element: CompDTO) => { | ||
| 258 | + let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0); | ||
| 259 | + //移除音频 和 活动 | ||
| 260 | + if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) { | ||
| 261 | + Logger.debug(TAG, 'getGroupData 移除音频 和 活动'); | ||
| 262 | + } else { | ||
| 263 | + // 暂时屏蔽活动和音频详情入口 | ||
| 264 | + if (element.operDataList[0]?.objectType === '3' || element.operDataList[0]?.objectType === '13') { | ||
| 265 | + } else { | ||
| 266 | + pageCompList.add(element) | ||
| 152 | } | 267 | } |
| 153 | } | 268 | } |
| 269 | + | ||
| 270 | + }) | ||
| 271 | + | ||
| 272 | + // 记录 | ||
| 273 | + pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize | ||
| 274 | + // 处理页面广告数据,投放到页面的位置 | ||
| 275 | + this.handlePageCompAdvPostion(pageCompList, pageModel, pageDto.compAdList); | ||
| 276 | + | ||
| 277 | + //遍历所有组件和稿件数据 push到页面 | ||
| 278 | + for (let element of pageCompList) { | ||
| 279 | + pageModel.compList.push(CompDTO.createNewsBean(element)) | ||
| 280 | + } | ||
| 281 | + | ||
| 282 | + } | ||
| 283 | + | ||
| 284 | + /** | ||
| 285 | + * 信息流页面,所有稿件需要参与批查,如 批查评论、批查关注状态等接口 | ||
| 286 | + * @param compList | ||
| 287 | + * @param pageModel | ||
| 288 | + */ | ||
| 289 | + private allCompBatchRequest(compList: CompDTO[], pageModel: PageModel) { | ||
| 290 | + PageViewModel.getInteractData(compList).then((data: InteractDataDTO[]) => { | ||
| 291 | + // 刷新,替换所有数据 | ||
| 292 | + this.resetInteract(data, pageModel.compList) | ||
| 293 | + if (pageModel?.channelId === '2001' || pageModel?.channelId === '2002') { | ||
| 294 | + //早晚报意图上报 | ||
| 295 | + let context = getContext(this) as common.UIAbilityContext; | ||
| 296 | + viewBlogInsightIntentShare(context, pageModel?.channelId, compList, ActionMode.EXPECTED) | ||
| 297 | + } | ||
| 298 | + }) | ||
| 299 | + | ||
| 300 | + // 测试数据 | ||
| 301 | + // setTimeout(() => { | ||
| 302 | + // let index = 1 | ||
| 303 | + // let comp = pageModel.compList.getData(index) as CompDTO | ||
| 304 | + // comp.hasMore = 0 | ||
| 305 | + // //comp.operDataList[0].newsTitle = '测试111' | ||
| 306 | + // let con :InteractDataDTO = new InteractDataDTO; | ||
| 307 | + // con.commentNum=1000 | ||
| 308 | + // comp.operDataList[0].interactData = con | ||
| 309 | + // Logger.debug("ZZZXXXXX", | ||
| 310 | + // "-----setTimeout--------->" + comp.hasMore) | ||
| 311 | + // }, 4 * 1000) | ||
| 312 | + } | ||
| 313 | + | ||
| 314 | + /** | ||
| 315 | + * 刷新互动数据到compList | ||
| 316 | + * @param interact 批查互动数据结果 | ||
| 317 | + * @param compList comp list | ||
| 318 | + */ | ||
| 319 | + private resetInteract(interact: InteractDataDTO[], compList: LazyDataSource<BaseDTO>) { | ||
| 320 | + if (interact == null || interact.length == 0) { | ||
| 321 | + return | ||
| 154 | } | 322 | } |
| 323 | + let time = DateTimeUtils.getTimeStamp().toString() | ||
| 324 | + interact.forEach((interactData) => { | ||
| 325 | + let id = interactData.contentId; | ||
| 326 | + outer: for (let i = 0; i < compList.totalCount(); i++) { | ||
| 327 | + let comp = compList.getData(i) as CompDTO; | ||
| 328 | + if (comp == null || comp.operDataList == null || comp.operDataList.length == 0) { | ||
| 329 | + continue; | ||
| 330 | + } | ||
| 331 | + for (let j = 0; j < comp.operDataList.length; j++) { | ||
| 332 | + let content = comp.operDataList[j]; | ||
| 333 | + if (content == null) { | ||
| 334 | + continue; | ||
| 335 | + } | ||
| 336 | + if (id == content.objectId) { | ||
| 337 | + content.interactData = interactData; | ||
| 338 | + comp.timestamp = time | ||
| 339 | + break outer; | ||
| 340 | + } | ||
| 341 | + } | ||
| 342 | + } | ||
| 343 | + }) | ||
| 155 | } | 344 | } |
| 156 | 345 | ||
| 157 | 346 | ||
| @@ -159,9 +348,9 @@ export class PageHelper { | @@ -159,9 +348,9 @@ export class PageHelper { | ||
| 159 | * 处理页面中的广告组件信息 | 348 | * 处理页面中的广告组件信息 |
| 160 | * @param pageDto | 349 | * @param pageDto |
| 161 | */ | 350 | */ |
| 162 | - private handlePageCompAdvPostion(pageCompList: ArrayList<CompDTO>, pageModel: PageModel, pageDto: PageDTO) { | 351 | + private handlePageCompAdvPostion(pageCompList: ArrayList<CompDTO>, pageModel: PageModel, compAdList: CompAdvBean[]) { |
| 163 | 352 | ||
| 164 | - let compAdvList = pageDto.compAdList | 353 | + let compAdvList = compAdList |
| 165 | 354 | ||
| 166 | let flag = true; | 355 | let flag = true; |
| 167 | if (compAdvList == null) { | 356 | if (compAdvList == null) { |
| @@ -283,7 +472,7 @@ export class PageHelper { | @@ -283,7 +472,7 @@ export class PageHelper { | ||
| 283 | } else { | 472 | } else { |
| 284 | pageCompList.insert(advComp, b + layoutAdvIndex) | 473 | pageCompList.insert(advComp, b + layoutAdvIndex) |
| 285 | } | 474 | } |
| 286 | - matInfo.originalPostion = pageCompList.getIndexOf(advComp) | 475 | + matInfo.originalPostion = pageCompList.getIndexOf(advComp) |
| 287 | 476 | ||
| 288 | layoutAdvIndex = layoutAdvIndex + 1; | 477 | layoutAdvIndex = layoutAdvIndex + 1; |
| 289 | 478 | ||
| @@ -300,143 +489,16 @@ export class PageHelper { | @@ -300,143 +489,16 @@ export class PageHelper { | ||
| 300 | 489 | ||
| 301 | 490 | ||
| 302 | /** | 491 | /** |
| 303 | - * comp加载更多,分页加载 | ||
| 304 | - */ | ||
| 305 | - private compLoadMore(pageModel: PageModel) { | ||
| 306 | - //聚合页 | ||
| 307 | - if (pageModel.pageType == 1) { | ||
| 308 | - PageViewModel.postThemeList(pageModel.currentPage, pageModel.pageSize, pageModel.extra).then((liveReviewDTO) => { | ||
| 309 | - if (liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0) { | ||
| 310 | - pageModel.hasMore = false; | ||
| 311 | - return; | ||
| 312 | - } else { | ||
| 313 | - //更新数据 | ||
| 314 | - pageModel.compList.addItems(liveReviewDTO.list); | ||
| 315 | - // 直接认为有分页,一直加载分页。直到没有数据,再停止 | ||
| 316 | - pageModel.currentPage++; | ||
| 317 | - pageModel.hasMore = true; | ||
| 318 | - pageModel.pageTotalCompSize = liveReviewDTO.list.length + pageModel.pageTotalCompSize | ||
| 319 | - } | ||
| 320 | - }).catch((err: string | Resource) => { | ||
| 321 | - promptAction.showToast({ message: err }); | ||
| 322 | - }) | ||
| 323 | - } else { | ||
| 324 | - PageViewModel.getPageData(pageModel.bizCopy()) | ||
| 325 | - .then((data: PageDTO) => { | ||
| 326 | - if (data == null || data.compList == null || data.compList.length == 0) { | ||
| 327 | - pageModel.hasMore = false; | ||
| 328 | - } else { | ||
| 329 | - // 直接认为有分页,一直加载分页。直到没有数据,再停止 | ||
| 330 | - pageModel.currentPage++; | ||
| 331 | - pageModel.hasMore = true; | ||
| 332 | - | ||
| 333 | - //移除音频 和 活动 | ||
| 334 | - this.collectPageComp(pageModel, data) | ||
| 335 | - // 参与批查 | ||
| 336 | - this.allCompBatchRequest(data.compList, pageModel) | ||
| 337 | - } | ||
| 338 | - }).catch((err: string | Resource) => { | ||
| 339 | - promptAction.showToast({ message: err }); | ||
| 340 | - }) | ||
| 341 | - } | ||
| 342 | - } | ||
| 343 | - | ||
| 344 | - /** | ||
| 345 | - * 信息流页面,所有稿件需要参与批查,如 批查评论、批查关注状态等接口 | ||
| 346 | - * @param compList | ||
| 347 | - * @param pageModel | ||
| 348 | - */ | ||
| 349 | - private allCompBatchRequest(compList: CompDTO[], pageModel: PageModel) { | ||
| 350 | - PageViewModel.getInteractData(compList).then((data: InteractDataDTO[]) => { | ||
| 351 | - // 刷新,替换所有数据 | ||
| 352 | - this.resetInteract(data, pageModel.compList) | ||
| 353 | - if(pageModel?.channelId === '2001' || pageModel?.channelId === '2002'){ | ||
| 354 | - //早晚报意图上报 | ||
| 355 | - let context = getContext(this) as common.UIAbilityContext; | ||
| 356 | - viewBlogInsightIntentShare(context, pageModel?.channelId, compList, ActionMode.EXPECTED) | ||
| 357 | - } | ||
| 358 | - }) | ||
| 359 | - | ||
| 360 | - // 测试数据 | ||
| 361 | - // setTimeout(() => { | ||
| 362 | - // let index = 1 | ||
| 363 | - // let comp = pageModel.compList.getData(index) as CompDTO | ||
| 364 | - // comp.hasMore = 0 | ||
| 365 | - // //comp.operDataList[0].newsTitle = '测试111' | ||
| 366 | - // let con :InteractDataDTO = new InteractDataDTO; | ||
| 367 | - // con.commentNum=1000 | ||
| 368 | - // comp.operDataList[0].interactData = con | ||
| 369 | - // Logger.debug("ZZZXXXXX", | ||
| 370 | - // "-----setTimeout--------->" + comp.hasMore) | ||
| 371 | - // }, 4 * 1000) | ||
| 372 | - } | ||
| 373 | - | ||
| 374 | - /** | ||
| 375 | - * 移除comp | 492 | + * 获取直播回看数据 |
| 376 | */ | 493 | */ |
| 377 | - private collectPageComp(pageModel: PageModel, pageDto: PageDTO) { | ||
| 378 | - | ||
| 379 | - let pageCompList: ArrayList<CompDTO> = new ArrayList() // 收集页面组件、稿件和本地组件容器 | ||
| 380 | - | ||
| 381 | - pageDto.compList.forEach((element: CompDTO) => { | ||
| 382 | - let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0); | ||
| 383 | - //移除音频 和 活动 | ||
| 384 | - if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) { | ||
| 385 | - Logger.debug(TAG, 'getGroupData 移除音频 和 活动'); | ||
| 386 | - } else { | ||
| 387 | - // 暂时屏蔽活动和音频详情入口 | ||
| 388 | - if (element.operDataList[0]?.objectType === '3' || element.operDataList[0]?.objectType === '13') { | ||
| 389 | - } else { | ||
| 390 | - pageCompList.add(element) | ||
| 391 | - } | ||
| 392 | - } | ||
| 393 | - | ||
| 394 | - }) | ||
| 395 | - | ||
| 396 | - // 记录 | ||
| 397 | - pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize | ||
| 398 | - | ||
| 399 | - // 处理页面广告数据,投放到页面的位置 | ||
| 400 | - this.handlePageCompAdvPostion(pageCompList, pageModel, pageDto); | 494 | + private async getLiveReviewData(pageInfo: PageInfoDTO,comp: CompDTO) { |
| 401 | 495 | ||
| 402 | - //遍历所有组件和稿件数据 push到页面 | ||
| 403 | - for (let element of pageCompList) { | ||
| 404 | - pageModel.compList.push(CompDTO.createNewsBean(element)) | ||
| 405 | - } | 496 | + let currentPage = 1 |
| 497 | + let pageSize = 20 | ||
| 498 | + let listReviewDtoBean = await PageViewModel.getLiveReviewUrl(currentPage, pageSize) as LiveReviewDTO | ||
| 499 | + Logger.error("ZZZXXXXX", 'getLiveReviewData---------'+listReviewDtoBean.list.length); | ||
| 406 | 500 | ||
| 407 | } | 501 | } |
| 408 | - | ||
| 409 | - /** | ||
| 410 | - * 刷新互动数据到compList | ||
| 411 | - * @param interact 批查互动数据结果 | ||
| 412 | - * @param compList comp list | ||
| 413 | - */ | ||
| 414 | - private resetInteract(interact: InteractDataDTO[], compList: LazyDataSource<BaseDTO>) { | ||
| 415 | - if (interact == null || interact.length == 0) { | ||
| 416 | - return | ||
| 417 | - } | ||
| 418 | - let time = DateTimeUtils.getTimeStamp().toString() | ||
| 419 | - interact.forEach((interactData) => { | ||
| 420 | - let id = interactData.contentId; | ||
| 421 | - outer: for (let i = 0; i < compList.totalCount(); i++) { | ||
| 422 | - let comp = compList.getData(i) as CompDTO; | ||
| 423 | - if (comp == null || comp.operDataList == null || comp.operDataList.length == 0) { | ||
| 424 | - continue; | ||
| 425 | - } | ||
| 426 | - for (let j = 0; j < comp.operDataList.length; j++) { | ||
| 427 | - let content = comp.operDataList[j]; | ||
| 428 | - if (content == null) { | ||
| 429 | - continue; | ||
| 430 | - } | ||
| 431 | - if (id == content.objectId) { | ||
| 432 | - content.interactData = interactData; | ||
| 433 | - comp.timestamp = time | ||
| 434 | - break outer; | ||
| 435 | - } | ||
| 436 | - } | ||
| 437 | - } | ||
| 438 | - }) | ||
| 439 | - } | ||
| 440 | } | 502 | } |
| 441 | 503 | ||
| 442 | 504 |
| @@ -178,7 +178,12 @@ export class PageViewModel extends BaseViewModel { | @@ -178,7 +178,12 @@ export class PageViewModel extends BaseViewModel { | ||
| 178 | return compRes.data | 178 | return compRes.data |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | - async getPageData(pageModel: PageUIReqBean): Promise<PageDTO> { | 181 | + /** |
| 182 | + * 获取页面楼层的组件信息 | ||
| 183 | + * @param pageModel | ||
| 184 | + * @returns | ||
| 185 | + */ | ||
| 186 | + async getPageGroupCompData(pageModel: PageUIReqBean): Promise<PageDTO> { | ||
| 182 | Logger.debug(TAG, 'getPageData pageId: ' + pageModel.pageId); | 187 | Logger.debug(TAG, 'getPageData pageId: ' + pageModel.pageId); |
| 183 | if (pageModel.isRecGroup) { | 188 | if (pageModel.isRecGroup) { |
| 184 | return this.parseComp(PageRepository.fetchRecCompData(pageModel)) | 189 | return this.parseComp(PageRepository.fetchRecCompData(pageModel)) |
| @@ -65,14 +65,26 @@ | @@ -65,14 +65,26 @@ | ||
| 65 | "value": "14vp" | 65 | "value": "14vp" |
| 66 | }, | 66 | }, |
| 67 | { | 67 | { |
| 68 | + "name": "margin_4", | ||
| 69 | + "value": "4vp" | ||
| 70 | + }, | ||
| 71 | + { | ||
| 68 | "name": "margin_8", | 72 | "name": "margin_8", |
| 69 | "value": "8vp" | 73 | "value": "8vp" |
| 70 | }, | 74 | }, |
| 71 | { | 75 | { |
| 76 | + "name": "margin_9", | ||
| 77 | + "value": "9vp" | ||
| 78 | + }, | ||
| 79 | + { | ||
| 72 | "name": "label_margin_top", | 80 | "name": "label_margin_top", |
| 73 | "value": "10vp" | 81 | "value": "10vp" |
| 74 | }, | 82 | }, |
| 75 | { | 83 | { |
| 84 | + "name": "margin_12", | ||
| 85 | + "value": "12vp" | ||
| 86 | + }, | ||
| 87 | + { | ||
| 76 | "name": "margin_bottom_16", | 88 | "name": "margin_bottom_16", |
| 77 | "value": "16vp" | 89 | "value": "16vp" |
| 78 | }, | 90 | }, |
496 Bytes
| @@ -273,7 +273,8 @@ export struct DetailPlayShortVideoPage { | @@ -273,7 +273,8 @@ export struct DetailPlayShortVideoPage { | ||
| 273 | this.playerCoverBuilder() | 273 | this.playerCoverBuilder() |
| 274 | 274 | ||
| 275 | // 横屏-全屏观看 | 275 | // 横屏-全屏观看 |
| 276 | - if (this.videoLandScape === 1) { | 276 | + // 点击查看详情 不展示 |
| 277 | + if (this.videoLandScape === 1 && !this.isOpenDetail) { | ||
| 277 | this.playerFullscreenBuilder() | 278 | this.playerFullscreenBuilder() |
| 278 | } | 279 | } |
| 279 | } | 280 | } |
| 1 | import { Action, ContentDetailDTO, InteractDataDTO } from 'wdBean/Index'; | 1 | import { Action, ContentDetailDTO, InteractDataDTO } from 'wdBean/Index'; |
| 2 | +import { NetworkUtil, Logger, NetworkType, SPHelper, WindowModel, StringUtils } from 'wdKit'; | ||
| 2 | import { ContentDetailRequest } from 'wdDetailPlayApi/Index' | 3 | import { ContentDetailRequest } from 'wdDetailPlayApi/Index' |
| 3 | import { ResponseDTO } from 'wdNetwork/Index'; | 4 | import { ResponseDTO } from 'wdNetwork/Index'; |
| 4 | import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage' | 5 | import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage' |
| 5 | import router from '@ohos.router'; | 6 | import router from '@ohos.router'; |
| 6 | import { contentListParams } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; | 7 | import { contentListParams } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; |
| 7 | -import { WindowModel } from 'wdKit'; | ||
| 8 | import { DisplayDirection } from 'wdConstant/Index'; | 8 | import { DisplayDirection } from 'wdConstant/Index'; |
| 9 | import { window } from '@kit.ArkUI'; | 9 | import { window } from '@kit.ArkUI'; |
| 10 | +import { EmptyComponent } from '../../../../../wdComponent/src/main/ets/components/view/EmptyComponent'; | ||
| 10 | 11 | ||
| 11 | const storage = LocalStorage.getShared(); | 12 | const storage = LocalStorage.getShared(); |
| 12 | const TAG = 'DetailVideoListPage' | 13 | const TAG = 'DetailVideoListPage' |
| @@ -29,22 +30,31 @@ export struct DetailVideoListPage { | @@ -29,22 +30,31 @@ export struct DetailVideoListPage { | ||
| 29 | @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL | 30 | @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL |
| 30 | @State data: ContentDetailDTO[] = [] | 31 | @State data: ContentDetailDTO[] = [] |
| 31 | @State currentIndex: number = 0 | 32 | @State currentIndex: number = 0 |
| 33 | + @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 | ||
| 32 | @State interactDataList: InteractDataDTO[] = [] | 34 | @State interactDataList: InteractDataDTO[] = [] |
| 33 | 35 | ||
| 34 | async aboutToAppear(): Promise<void> { | 36 | async aboutToAppear(): Promise<void> { |
| 35 | - this.openFullScreen() | ||
| 36 | - | ||
| 37 | - const action: Action = router.getParams() as Action | ||
| 38 | - if (action) { | ||
| 39 | - this.contentId = action.params?.contentID || '' | ||
| 40 | - if (action.params && action.params.extra) { | ||
| 41 | - this.relId = action.params.extra.relId || '' | ||
| 42 | - this.relType = action.params.extra.relType || '' | 37 | + // 注册监听网络连接 |
| 38 | + let netStatus = NetworkUtil.isNetConnected() | ||
| 39 | + if (netStatus) { | ||
| 40 | + this.openFullScreen() | ||
| 41 | + const action: Action = router.getParams() as Action | ||
| 42 | + if (action) { | ||
| 43 | + this.contentId = action.params?.contentID || '' | ||
| 44 | + if (action.params && action.params.extra) { | ||
| 45 | + this.relId = action.params.extra.relId || '' | ||
| 46 | + this.relType = action.params.extra.relType || '' | ||
| 47 | + } | ||
| 48 | + await this.getContentDetail(this.contentId, this.relId, this.relType) | ||
| 43 | } | 49 | } |
| 44 | - await this.getContentDetail(this.contentId, this.relId, this.relType) | 50 | + await this.queryVideoList() |
| 51 | + console.log(TAG, 'aboutToAppear', JSON.stringify(action.params)) | ||
| 52 | + | ||
| 53 | + } else { | ||
| 54 | + // 无网络 | ||
| 55 | + this.netStatus = 1 | ||
| 45 | } | 56 | } |
| 46 | - await this.queryVideoList() | ||
| 47 | - console.log(TAG, 'aboutToAppear', JSON.stringify(action.params)) | 57 | + |
| 48 | } | 58 | } |
| 49 | 59 | ||
| 50 | aboutToDisappear(): void { | 60 | aboutToDisappear(): void { |
| @@ -163,39 +173,53 @@ export struct DetailVideoListPage { | @@ -163,39 +173,53 @@ export struct DetailVideoListPage { | ||
| 163 | } | 173 | } |
| 164 | 174 | ||
| 165 | build() { | 175 | build() { |
| 166 | - Column() { | ||
| 167 | - Swiper(this.swiperController) { | ||
| 168 | - ForEach(this.data, (item: ContentDetailDTO, index: number) => { | ||
| 169 | - DetailPlayShortVideoPage({ | ||
| 170 | - contentDetailData: item, | ||
| 171 | - currentIndex: this.currentIndex, | ||
| 172 | - index: index, | ||
| 173 | - interactData: this.interactDataList[index] | ||
| 174 | - }) | ||
| 175 | - }, (item: ContentDetailDTO) => item.newsId + '') | 176 | + if (this.netStatus !== undefined) { |
| 177 | + EmptyComponent({ | ||
| 178 | + emptyType: this.netStatus, emptyButton: true, retry: () => { | ||
| 179 | + this.getContentDetail(this.contentId, this.relId, this.relType) | ||
| 180 | + } | ||
| 181 | + }) | ||
| 182 | + .id('e_empty_content') | ||
| 183 | + .alignRules({ | ||
| 184 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 185 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 186 | + }) | ||
| 187 | + } else { | ||
| 188 | + | ||
| 189 | + Column() { | ||
| 190 | + Swiper(this.swiperController) { | ||
| 191 | + ForEach(this.data, (item: ContentDetailDTO, index: number) => { | ||
| 192 | + DetailPlayShortVideoPage({ | ||
| 193 | + contentDetailData: item, | ||
| 194 | + currentIndex: this.currentIndex, | ||
| 195 | + index: index, | ||
| 196 | + interactData: this.interactDataList[index] | ||
| 197 | + }) | ||
| 198 | + }, (item: ContentDetailDTO) => item.newsId + '') | ||
| 199 | + } | ||
| 200 | + .disableSwipe(this.displayDirection === DisplayDirection.VERTICAL || !this.showComment ? false : true) | ||
| 201 | + .indicator(false) | ||
| 202 | + .vertical(true) | ||
| 203 | + .loop(false) | ||
| 204 | + .width('100%') | ||
| 205 | + .height('100%') | ||
| 206 | + .displayCount(1, true) | ||
| 207 | + .onChange((index: number) => { | ||
| 208 | + this.currentIndex = index | ||
| 209 | + if (this.currentIndex === this.data.length - 1) { | ||
| 210 | + // TODO:下拉刷新“努力加载中” | ||
| 211 | + this.queryVideoList() | ||
| 212 | + } | ||
| 213 | + }) | ||
| 176 | } | 214 | } |
| 177 | - .disableSwipe(this.displayDirection === DisplayDirection.VERTICAL || !this.showComment ? false : true) | ||
| 178 | - .indicator(false) | ||
| 179 | - .vertical(true) | ||
| 180 | - .loop(false) | ||
| 181 | .width('100%') | 215 | .width('100%') |
| 182 | .height('100%') | 216 | .height('100%') |
| 183 | - .displayCount(1, true) | ||
| 184 | - .onChange((index: number) => { | ||
| 185 | - this.currentIndex = index | ||
| 186 | - if (this.currentIndex === this.data.length - 1) { | ||
| 187 | - // TODO:下拉刷新“努力加载中” | ||
| 188 | - this.queryVideoList() | ||
| 189 | - } | ||
| 190 | - }) | 217 | + .backgroundColor(Color.Black) |
| 218 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 219 | + | ||
| 220 | + // .padding({ | ||
| 221 | + // bottom: this.bottomSafeHeight + 'px' | ||
| 222 | + // }) | ||
| 191 | } | 223 | } |
| 192 | - .width('100%') | ||
| 193 | - .height('100%') | ||
| 194 | - .backgroundColor(Color.Black) | ||
| 195 | - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 196 | - | ||
| 197 | - // .padding({ | ||
| 198 | - // bottom: this.bottomSafeHeight + 'px' | ||
| 199 | - // }) | ||
| 200 | } | 224 | } |
| 201 | } | 225 | } |
| @@ -178,7 +178,7 @@ export struct PlayerRightView { | @@ -178,7 +178,7 @@ export struct PlayerRightView { | ||
| 178 | .width(58) | 178 | .width(58) |
| 179 | .position({ x: '100%', y: '100%' }) | 179 | .position({ x: '100%', y: '100%' }) |
| 180 | .markAnchor({ x: '100%', y: '100%' }) | 180 | .markAnchor({ x: '100%', y: '100%' }) |
| 181 | - .padding({ bottom: 10, right: 10 }) | 181 | + .padding({ bottom: 7, right: 10 }) |
| 182 | .visibility(this.isOpenDetail || this.isDragging || this.displayDirection === DisplayDirection.VIDEO_HORIZONTAL ? | 182 | .visibility(this.isOpenDetail || this.isDragging || this.displayDirection === DisplayDirection.VIDEO_HORIZONTAL ? |
| 183 | Visibility.None : Visibility.Visible) | 183 | Visibility.None : Visibility.Visible) |
| 184 | 184 |
No preview for this file type
| @@ -9,11 +9,12 @@ const TAG = 'SpacialTopicPage'; | @@ -9,11 +9,12 @@ const TAG = 'SpacialTopicPage'; | ||
| 9 | @Entry | 9 | @Entry |
| 10 | @Component | 10 | @Component |
| 11 | struct SpacialTopicPage { | 11 | struct SpacialTopicPage { |
| 12 | - action: Action = {} as Action | ||
| 13 | - | 12 | + @State action: Action = {} as Action |
| 13 | + @State reload: number = 0 | ||
| 14 | + @State count: number = 0 | ||
| 14 | build() { | 15 | build() { |
| 15 | Column() { | 16 | Column() { |
| 16 | - SpacialTopicPageComponent({ action: this.action }) | 17 | + SpacialTopicPageComponent({ action: this.action ,reload:this.reload }) |
| 17 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) | 18 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) |
| 18 | } | 19 | } |
| 19 | 20 | ||
| @@ -30,8 +31,12 @@ struct SpacialTopicPage { | @@ -30,8 +31,12 @@ struct SpacialTopicPage { | ||
| 30 | } | 31 | } |
| 31 | 32 | ||
| 32 | aboutToAppear() { | 33 | aboutToAppear() { |
| 33 | - Logger.info(TAG, 'aboutToAppear'); | 34 | + Logger.info(TAG, `aboutToAppearcount:${this.reload}`); |
| 34 | let action: Action = router.getParams() as Action | 35 | let action: Action = router.getParams() as Action |
| 35 | this.action = action | 36 | this.action = action |
| 36 | } | 37 | } |
| 38 | + onPageShow() { | ||
| 39 | + this.reload = this.reload + 1 | ||
| 40 | + Logger.info(TAG, `onPageShowcount:${this.reload}`); | ||
| 41 | + } | ||
| 37 | } | 42 | } |
-
Please register or login to post a comment