Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: (34 commits) fix: 更多跳转,分割线 ref |> 增加热门评论接口数据展示 fix: 图集使用taskpool任务池优化图片加载、下载逻辑 全文字体和箭头颜色 全文字体和箭头颜色 全文右对齐 fix: 19768 内容找不到了默认缺省页,顶部缺少分割线,左下角缺少返回按钮,见截图 fix: 19768 内容找不到了默认缺省页,顶部缺少分割线,左下角缺少返回按钮,见截图 fix: 地方精选卡左侧边距去除,可滑动到左侧 fix: 轮播卡下面不需要粗分割线,应该是细分割线 fix: 19927 3:2横划卡-后台配置1个运营位,跳转设置--不跳转,鸿蒙端不应展示更多按钮 fix: 音频悬浮窗跳转稿件详情开发部分,注释log代码 fix: 音频悬浮窗跳转稿件详情开发部分,注释log代码 fix |> 修复搜索结果2条调查标识,展开更多后第二条数据仍显示专题问题 fix: 号主图集页,已关注按钮背景颜色 ref |> 修复折叠屏上直播详情直播间tab消息被裁剪问题 fix: 号主图集页,已关注按钮背景颜色 fix |> 修复首次启动通知弹窗选择允许通知后,在设置页推送开关没有开启 19899 我的-关注列表页面,底部文字“已显示全部内容”与导航条太近 fix: 18748 功能缺陷-【uat】进入文章详情页,点击收藏按钮,多次点击,点赞数会消失,并且动画生硬 ...
Showing
47 changed files
with
961 additions
and
413 deletions
| @@ -44,6 +44,12 @@ export class SpConstants{ | @@ -44,6 +44,12 @@ export class SpConstants{ | ||
| 44 | //启动页数据存储key | 44 | //启动页数据存储key |
| 45 | static APP_LAUNCH_PAGE_DATA_MODEL = 'app_launch_page_data_model' | 45 | static APP_LAUNCH_PAGE_DATA_MODEL = 'app_launch_page_data_model' |
| 46 | 46 | ||
| 47 | + //国殇模式数据存储key | ||
| 48 | + static APP_MOURNS_INFO_DATA_MODEL = 'app_mourns_info_model' | ||
| 49 | + | ||
| 50 | + //稿件详情音频播放跳转存储key | ||
| 51 | + static APP_NEWS_INFO_DATA_MODEL = 'app_news_info_model' | ||
| 52 | + | ||
| 47 | //频道信息流页面左右挂角 | 53 | //频道信息流页面左右挂角 |
| 48 | static APP_PAGE_CORNER_ADV = 'app_page_corner_adv_' | 54 | static APP_PAGE_CORNER_ADV = 'app_page_corner_adv_' |
| 49 | 55 |
| @@ -28,12 +28,10 @@ export class WDRouterRule { | @@ -28,12 +28,10 @@ export class WDRouterRule { | ||
| 28 | } | 28 | } |
| 29 | if (params) { | 29 | if (params) { |
| 30 | // router.pushUrl({ url: 'pages/routerpage2', , params: params }) | 30 | // router.pushUrl({ url: 'pages/routerpage2', , params: params }) |
| 31 | - console.log('page.url()==',page.url(),JSON.stringify(params)) | 31 | + // console.log('page.url()==',page.url(),JSON.stringify(params)) |
| 32 | router.pushUrl({ url: page.url(), params: params }) | 32 | router.pushUrl({ url: page.url(), params: params }) |
| 33 | } else { | 33 | } else { |
| 34 | - router.pushUrl({ url: page.url() }, mode).catch((error: Error) => { | ||
| 35 | - console.log("err", JSON.stringify(error)) //100002 uri is not exist | ||
| 36 | - }) | 34 | + router.pushUrl({ url: page.url() }, mode) |
| 37 | } | 35 | } |
| 38 | } else { | 36 | } else { |
| 39 | ToastUtils.showToast("功能开发中", 1000); | 37 | ToastUtils.showToast("功能开发中", 1000); |
| @@ -50,9 +48,7 @@ export class WDRouterRule { | @@ -50,9 +48,7 @@ export class WDRouterRule { | ||
| 50 | // router.pushUrl({ url: 'pages/routerpage2', , params: params }) | 48 | // router.pushUrl({ url: 'pages/routerpage2', , params: params }) |
| 51 | router.replaceUrl({ url: page.url(), params: params }) | 49 | router.replaceUrl({ url: page.url(), params: params }) |
| 52 | } else { | 50 | } else { |
| 53 | - router.replaceUrl({ url: page.url() }).catch((error:Error)=>{ | ||
| 54 | - console.log("err",JSON.stringify(error))//100002 uri is not exist | ||
| 55 | - }) | 51 | + router.replaceUrl({ url: page.url() }) |
| 56 | } | 52 | } |
| 57 | } else { | 53 | } else { |
| 58 | ToastUtils.showToast("功能开发中", 1000); | 54 | ToastUtils.showToast("功能开发中", 1000); |
| @@ -170,11 +170,11 @@ export class ProcessUtils { | @@ -170,11 +170,11 @@ export class ProcessUtils { | ||
| 170 | */ | 170 | */ |
| 171 | static processPage(content: ContentDTO) { | 171 | static processPage(content: ContentDTO) { |
| 172 | if (content == null) { | 172 | if (content == null) { |
| 173 | - Logger.error(TAG, "processPage, content is null"); | 173 | + // Logger.error(TAG, "processPage, content is null"); |
| 174 | return; | 174 | return; |
| 175 | } | 175 | } |
| 176 | if (StringUtils.isEmpty(content.objectType)) { | 176 | if (StringUtils.isEmpty(content.objectType)) { |
| 177 | - Logger.error(TAG, "processPage, objectType is empty"); | 177 | + // Logger.error(TAG, "processPage, objectType is empty"); |
| 178 | return; | 178 | return; |
| 179 | } | 179 | } |
| 180 | // 网络出小差了,请检查网络后重试 | 180 | // 网络出小差了,请检查网络后重试 |
| @@ -189,13 +189,13 @@ export class ProcessUtils { | @@ -189,13 +189,13 @@ export class ProcessUtils { | ||
| 189 | if (typeof type == "number") { | 189 | if (typeof type == "number") { |
| 190 | type = `${type}` | 190 | type = `${type}` |
| 191 | } | 191 | } |
| 192 | - console.log(TAG, 'objectType', `${JSON.stringify(content)}`); | 192 | + // console.log(TAG, 'objectType', `${JSON.stringify(content)}`); |
| 193 | switch (type) { | 193 | switch (type) { |
| 194 | case ContentConstants.TYPE_NONE: | 194 | case ContentConstants.TYPE_NONE: |
| 195 | - Logger.debug(TAG, "processPage, do nothing"); | 195 | + // Logger.debug(TAG, "processPage, do nothing"); |
| 196 | break; | 196 | break; |
| 197 | case ContentConstants.TYPE_VOD: | 197 | case ContentConstants.TYPE_VOD: |
| 198 | - Logger.debug(TAG, "processPage, nonsupport!!!"); | 198 | + // Logger.debug(TAG, "processPage, nonsupport!!!"); |
| 199 | ProcessUtils.gotoVod(content) | 199 | ProcessUtils.gotoVod(content) |
| 200 | break; | 200 | break; |
| 201 | case ContentConstants.TYPE_LIVE: | 201 | case ContentConstants.TYPE_LIVE: |
| @@ -432,7 +432,7 @@ export class ProcessUtils { | @@ -432,7 +432,7 @@ export class ProcessUtils { | ||
| 432 | } as Params, | 432 | } as Params, |
| 433 | }; | 433 | }; |
| 434 | WDRouterRule.jumpWithAction(taskAction) | 434 | WDRouterRule.jumpWithAction(taskAction) |
| 435 | - Logger.debug(TAG, `gotoH5NewsWeb, ${content.objectId}`); | 435 | + // Logger.debug(TAG, `gotoH5NewsWeb, ${content.objectId}`); |
| 436 | } | 436 | } |
| 437 | 437 | ||
| 438 | public static gotoWeb(content: ContentDTO) { | 438 | public static gotoWeb(content: ContentDTO) { |
| @@ -454,7 +454,7 @@ export class ProcessUtils { | @@ -454,7 +454,7 @@ export class ProcessUtils { | ||
| 454 | } as Params, | 454 | } as Params, |
| 455 | }; | 455 | }; |
| 456 | WDRouterRule.jumpWithAction(taskAction) | 456 | WDRouterRule.jumpWithAction(taskAction) |
| 457 | - Logger.debug(TAG, `gotoWeb, ${content.objectId}`); | 457 | + // Logger.debug(TAG, `gotoWeb, ${content.objectId}`); |
| 458 | } | 458 | } |
| 459 | 459 | ||
| 460 | public static gotoVod(content: ContentDTO) { | 460 | public static gotoVod(content: ContentDTO) { |
| @@ -473,7 +473,7 @@ export class ProcessUtils { | @@ -473,7 +473,7 @@ export class ProcessUtils { | ||
| 473 | } as Params, | 473 | } as Params, |
| 474 | }; | 474 | }; |
| 475 | WDRouterRule.jumpWithAction(taskAction) | 475 | WDRouterRule.jumpWithAction(taskAction) |
| 476 | - Logger.debug(TAG, `gotoVod, ${content.objectId}`); | 476 | + // Logger.debug(TAG, `gotoVod, ${content.objectId}`); |
| 477 | } | 477 | } |
| 478 | 478 | ||
| 479 | /** | 479 | /** |
| @@ -495,7 +495,7 @@ export class ProcessUtils { | @@ -495,7 +495,7 @@ export class ProcessUtils { | ||
| 495 | } as Params, | 495 | } as Params, |
| 496 | }; | 496 | }; |
| 497 | WDRouterRule.jumpWithAction(taskAction) | 497 | WDRouterRule.jumpWithAction(taskAction) |
| 498 | - Logger.debug(TAG, `gotoLive, ${content.objectId}`); | 498 | + // Logger.debug(TAG, `gotoLive, ${content.objectId}`); |
| 499 | } | 499 | } |
| 500 | 500 | ||
| 501 | //音频详情页 | 501 | //音频详情页 |
| @@ -514,7 +514,7 @@ export class ProcessUtils { | @@ -514,7 +514,7 @@ export class ProcessUtils { | ||
| 514 | // } as Params, | 514 | // } as Params, |
| 515 | // }; | 515 | // }; |
| 516 | // WDRouterRule.jumpWithAction(taskAction) | 516 | // WDRouterRule.jumpWithAction(taskAction) |
| 517 | - Logger.debug(TAG, `gotoAudio, ${content.objectId}`); | 517 | + // Logger.debug(TAG, `gotoAudio, ${content.objectId}`); |
| 518 | } | 518 | } |
| 519 | 519 | ||
| 520 | /** | 520 | /** |
| @@ -538,7 +538,7 @@ export class ProcessUtils { | @@ -538,7 +538,7 @@ export class ProcessUtils { | ||
| 538 | } as Params, | 538 | } as Params, |
| 539 | }; | 539 | }; |
| 540 | WDRouterRule.jumpWithAction(taskAction) | 540 | WDRouterRule.jumpWithAction(taskAction) |
| 541 | - Logger.debug(TAG, `gotoAtlasDetailPage, ${content.objectId}`); | 541 | + // Logger.debug(TAG, `gotoAtlasDetailPage, ${content.objectId}`); |
| 542 | } | 542 | } |
| 543 | 543 | ||
| 544 | /** | 544 | /** |
| @@ -561,7 +561,7 @@ export class ProcessUtils { | @@ -561,7 +561,7 @@ export class ProcessUtils { | ||
| 561 | } as Params, | 561 | } as Params, |
| 562 | }; | 562 | }; |
| 563 | WDRouterRule.jumpWithAction(taskAction) | 563 | WDRouterRule.jumpWithAction(taskAction) |
| 564 | - Logger.debug(TAG, `gotoAtlasDetailPage, ${content.objectId}`); | 564 | + // Logger.debug(TAG, `gotoAtlasDetailPage, ${content.objectId}`); |
| 565 | } | 565 | } |
| 566 | 566 | ||
| 567 | /** | 567 | /** |
| @@ -575,11 +575,12 @@ export class ProcessUtils { | @@ -575,11 +575,12 @@ export class ProcessUtils { | ||
| 575 | entities: ['entity.system.browsable'], | 575 | entities: ['entity.system.browsable'], |
| 576 | uri: url | 576 | uri: url |
| 577 | } | 577 | } |
| 578 | - context.startAbility(wantInfo).then(() => { | ||
| 579 | - Logger.debug(TAG, 'jumpExternalWebPage success') | ||
| 580 | - }).catch((err: BusinessError) => { | ||
| 581 | - Logger.error(TAG, 'jumpExternalWebPage success, error: ' + JSON.stringify(err)) | ||
| 582 | - }) | 578 | + context.startAbility(wantInfo) |
| 579 | + // .then(() => { | ||
| 580 | + // Logger.debug(TAG, 'jumpExternalWebPage success') | ||
| 581 | + // }).catch((err: BusinessError) => { | ||
| 582 | + // Logger.error(TAG, 'jumpExternalWebPage success, error: ' + JSON.stringify(err)) | ||
| 583 | + // }) | ||
| 583 | } | 584 | } |
| 584 | 585 | ||
| 585 | /** | 586 | /** |
| 1 | import { TopicInfo } from '../morningevening/TopicInfo'; | 1 | import { TopicInfo } from '../morningevening/TopicInfo'; |
| 2 | import { ArrayList } from '@kit.ArkTS'; | 2 | import { ArrayList } from '@kit.ArkTS'; |
| 3 | +import { AdvRuleBean, CompAdvBean } from '../adv/AdvsRuleBean'; | ||
| 3 | 4 | ||
| 4 | export interface GroupItem { | 5 | export interface GroupItem { |
| 5 | id: number; | 6 | id: number; |
| @@ -15,7 +16,6 @@ export interface TopicDetailData { | @@ -15,7 +16,6 @@ export interface TopicDetailData { | ||
| 15 | shareSummary: string; | 16 | shareSummary: string; |
| 16 | id: number; | 17 | id: number; |
| 17 | baselineCopywriting: string; | 18 | baselineCopywriting: string; |
| 18 | - cornersAdv: string; | ||
| 19 | backgroundImgUrl: string; | 19 | backgroundImgUrl: string; |
| 20 | description: string; | 20 | description: string; |
| 21 | imgSize: string; | 21 | imgSize: string; |
| @@ -38,4 +38,12 @@ export interface TopicDetailData { | @@ -38,4 +38,12 @@ export interface TopicDetailData { | ||
| 38 | topicInfo: TopicInfo; | 38 | topicInfo: TopicInfo; |
| 39 | baselineColor: string; | 39 | baselineColor: string; |
| 40 | groups: ArrayList<GroupItem>; | 40 | groups: ArrayList<GroupItem>; |
| 41 | + /** | ||
| 42 | + * 挂角广告数据 | ||
| 43 | + */ | ||
| 44 | + cornersAdv: AdvRuleBean; | ||
| 45 | + /** | ||
| 46 | + * 广告中心-挂角广告信息 | ||
| 47 | + */ | ||
| 48 | + cornersAdv2: CompAdvBean[]; | ||
| 41 | } | 49 | } |
| @@ -77,14 +77,71 @@ export struct CompParser { | @@ -77,14 +77,71 @@ export struct CompParser { | ||
| 77 | this.componentBuilder(); | 77 | this.componentBuilder(); |
| 78 | } | 78 | } |
| 79 | .margin({ | 79 | .margin({ |
| 80 | - left: 6, | 80 | + left: this.compDTO.compStyle === CompStyle.Zh_Single_Row_04 ? 0 : 6, |
| 81 | right: (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05 || this.compDTO.compStyle === CompStyle.Zh_Single_Row_02 || | 81 | right: (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05 || this.compDTO.compStyle === CompStyle.Zh_Single_Row_02 || |
| 82 | this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) ? 0 : 6 | 82 | this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) ? 0 : 6 |
| 83 | }) | 83 | }) |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | @Builder | 86 | @Builder |
| 87 | + beforeDevider() { | ||
| 88 | + if ( | ||
| 89 | + this.compDTO.compStyle === CompStyle.Card_09 || | ||
| 90 | + this.compDTO.compStyle === CompStyle.Zh_Single_Column_09 || | ||
| 91 | + this.compDTO.compStyle === CompStyle.Zh_Single_Row_04 || | ||
| 92 | + this.compDTO.compStyle === CompStyle.Zh_Single_Row_06 | ||
| 93 | + ) { | ||
| 94 | + if (this.compDTO.compStyle === this.nextCompDTO.compStyle) { | ||
| 95 | + Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 }) | ||
| 96 | + } else { | ||
| 97 | + Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6}) | ||
| 98 | + } | ||
| 99 | + } | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + @Builder | ||
| 103 | + behindDevider() { | ||
| 104 | + if ( | ||
| 105 | + this.compDTO.compStyle === CompStyle.Card_09 || | ||
| 106 | + this.compDTO.compStyle === CompStyle.Zh_Single_Column_09 || | ||
| 107 | + this.compDTO.compStyle === CompStyle.Zh_Single_Row_04 || | ||
| 108 | + this.compDTO.compStyle === CompStyle.Zh_Single_Row_06 | ||
| 109 | + ) { | ||
| 110 | + if (this.compDTO.compStyle === this.nextCompDTO.compStyle) { | ||
| 111 | + Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 }) | ||
| 112 | + } else { | ||
| 113 | + Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6}) | ||
| 114 | + } | ||
| 115 | + } else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { | ||
| 116 | + Divider().strokeWidth(1).color('#f5f5f5').width('120%').margin({left: -6}) | ||
| 117 | + } else if (this.compDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) { | ||
| 118 | + // 大专题 | ||
| 119 | + if (this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) { | ||
| 120 | + Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 }) | ||
| 121 | + } else { | ||
| 122 | + Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6}) | ||
| 123 | + } | ||
| 124 | + } else if (this.compDTO.compType === 'appStyle' || this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 || this.compDTO.compStyle === CompStyle.Zh_Single_Row_03 || this.compDTO.compStyle === CompStyle.Card_Comp_Adv || this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) { | ||
| 125 | + if ( | ||
| 126 | + this.nextCompDTO.compStyle === CompStyle.Card_09 || | ||
| 127 | + this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10 || | ||
| 128 | + this.nextCompDTO.compStyle === CompStyle.Zh_Single_Column_09 || | ||
| 129 | + this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_04 || | ||
| 130 | + this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_06 || | ||
| 131 | + this.nextCompDTO.compStyle === CompStyle.Zh_Single_Column_12 | ||
| 132 | + ) { | ||
| 133 | + Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6}) | ||
| 134 | + } else { | ||
| 135 | + Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 }) | ||
| 136 | + } | ||
| 137 | + } else { | ||
| 138 | + // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | ||
| 139 | + } | ||
| 140 | + } | ||
| 141 | + | ||
| 142 | + @Builder | ||
| 87 | componentBuilder() { | 143 | componentBuilder() { |
| 144 | + this.beforeDevider(); | ||
| 88 | 145 | ||
| 89 | if (this.compDTO.operDataList[0]?.objectType !== '3' && | 146 | if (this.compDTO.operDataList[0]?.objectType !== '3' && |
| 90 | this.compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 | 147 | this.compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 |
| @@ -208,43 +265,7 @@ export struct CompParser { | @@ -208,43 +265,7 @@ export struct CompParser { | ||
| 208 | // }) | 265 | // }) |
| 209 | } | 266 | } |
| 210 | 267 | ||
| 211 | - if ( | ||
| 212 | - this.compDTO.compStyle === CompStyle.Card_09 || | ||
| 213 | - this.compDTO.compStyle === CompStyle.Zh_Single_Column_09 || | ||
| 214 | - this.compDTO.compStyle === CompStyle.Zh_Single_Row_04 || | ||
| 215 | - this.compDTO.compStyle === CompStyle.Zh_Single_Row_06 | ||
| 216 | - ) { | ||
| 217 | - if (this.compDTO.compStyle === this.nextCompDTO.compStyle) { | ||
| 218 | - Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 }) | ||
| 219 | - } else { | ||
| 220 | - Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6}) | ||
| 221 | - } | ||
| 222 | - } else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { | ||
| 223 | - // Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 }) | ||
| 224 | - Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6}) | ||
| 225 | - } else if (this.compDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) { | ||
| 226 | - // 大专题 | ||
| 227 | - if (this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10) { | ||
| 228 | - Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 }) | ||
| 229 | - } else { | ||
| 230 | - Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6}) | ||
| 231 | - } | ||
| 232 | - } else if (this.compDTO.compType === 'appStyle' || this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 || this.compDTO.compStyle === CompStyle.Zh_Single_Row_03 || this.compDTO.compStyle === CompStyle.Card_Comp_Adv || this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) { | ||
| 233 | - if ( | ||
| 234 | - this.nextCompDTO.compStyle === CompStyle.Card_09 || | ||
| 235 | - this.nextCompDTO?.operDataList?.[0]?.appStyle === CompStyle.Card_10 || | ||
| 236 | - this.nextCompDTO.compStyle === CompStyle.Zh_Single_Column_09 || | ||
| 237 | - this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_04 || | ||
| 238 | - this.nextCompDTO.compStyle === CompStyle.Zh_Single_Row_06 || | ||
| 239 | - this.nextCompDTO.compStyle === CompStyle.Zh_Single_Column_12 | ||
| 240 | - ) { | ||
| 241 | - Divider().strokeWidth(5).color('#f5f5f5').width('120%').margin({left: -6}) | ||
| 242 | - } else { | ||
| 243 | - Divider().strokeWidth(1).color('#f5f5f5').width(CommonConstants.FULL_WIDTH).padding({ left: 10, right: 10 }) | ||
| 244 | - } | ||
| 245 | - } else { | ||
| 246 | - // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | ||
| 247 | - } | 268 | + this.behindDevider() |
| 248 | } | 269 | } |
| 249 | 270 | ||
| 250 | 271 |
| @@ -79,7 +79,7 @@ export struct ENewspaperItemComponent { | @@ -79,7 +79,7 @@ export struct ENewspaperItemComponent { | ||
| 79 | this.startX = x; | 79 | this.startX = x; |
| 80 | this.startY = y; | 80 | this.startY = y; |
| 81 | let points: number[][] = this.getArea(x, y, this.newspaperListItemBean.items); | 81 | let points: number[][] = this.getArea(x, y, this.newspaperListItemBean.items); |
| 82 | - console.log("event.points", JSON.stringify(points)) | 82 | + // console.log("event.points", JSON.stringify(points)) |
| 83 | if (points && points.length > 2) { | 83 | if (points && points.length > 2) { |
| 84 | let path = new Path2D(); | 84 | let path = new Path2D(); |
| 85 | path.moveTo(px2vp(points[0][0]), px2vp(points[0][1])); | 85 | path.moveTo(px2vp(points[0][0]), px2vp(points[0][1])); |
| @@ -35,6 +35,7 @@ import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' | @@ -35,6 +35,7 @@ import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' | ||
| 35 | import { common } from '@kit.AbilityKit'; | 35 | import { common } from '@kit.AbilityKit'; |
| 36 | import { componentUtils } from '@kit.ArkUI'; | 36 | import { componentUtils } from '@kit.ArkUI'; |
| 37 | import { TrackConstants, TrackingContent, TrackingPageBrowse } from 'wdTracking/Index'; | 37 | import { TrackConstants, TrackingContent, TrackingPageBrowse } from 'wdTracking/Index'; |
| 38 | +import { LottieView } from '../components/lottie/LottieView'; | ||
| 38 | 39 | ||
| 39 | const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; | 40 | const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; |
| 40 | 41 | ||
| @@ -73,6 +74,7 @@ export struct ImageAndTextPageComponent { | @@ -73,6 +74,7 @@ export struct ImageAndTextPageComponent { | ||
| 73 | pageShowTime:number = 0; | 74 | pageShowTime:number = 0; |
| 74 | pageHideTime:number = 0; | 75 | pageHideTime:number = 0; |
| 75 | lastTimeoutId?: number | 76 | lastTimeoutId?: number |
| 77 | + @State needAnimation: boolean = false; | ||
| 76 | 78 | ||
| 77 | @Consume @Watch('pageShowForUpdateData') pageShow :number | 79 | @Consume @Watch('pageShowForUpdateData') pageShow :number |
| 78 | @Consume @Watch('pageHideForUpdateData') pageHide :number | 80 | @Consume @Watch('pageHideForUpdateData') pageHide :number |
| @@ -106,13 +108,43 @@ export struct ImageAndTextPageComponent { | @@ -106,13 +108,43 @@ export struct ImageAndTextPageComponent { | ||
| 106 | Row() { | 108 | Row() { |
| 107 | Row() { | 109 | Row() { |
| 108 | if (this.newsStatusOfUser?.likeStatus == '1') { | 110 | if (this.newsStatusOfUser?.likeStatus == '1') { |
| 109 | - Image(this.contentDetailData?.likesStyle === 1 ? $r('app.media.ic_like_check') : | ||
| 110 | - (this.contentDetailData?.likesStyle === 2 ? $r('app.media.icon_prayer_active') : | ||
| 111 | - $r('app.media.icon_candle_active'))) | 111 | + if (this.contentDetailData?.likesStyle === 1) { |
| 112 | + if (this.needAnimation) { | ||
| 113 | + Row() { | ||
| 114 | + LottieView({ | ||
| 115 | + name: 'articleLike', | ||
| 116 | + path: 'lottie/article_like.json', | ||
| 117 | + lottieWidth: 40, | ||
| 118 | + lottieHeight: 40, | ||
| 119 | + autoplay: true, | ||
| 120 | + loop: false, | ||
| 121 | + }) | ||
| 122 | + .position({ | ||
| 123 | + left: -6, | ||
| 124 | + top: -8 | ||
| 125 | + }) | ||
| 126 | + } | ||
| 127 | + .width(24) | ||
| 128 | + .height(24) | ||
| 129 | + .margin({ right: 3 }) | ||
| 130 | + } else { | ||
| 131 | + Image($r('app.media.icon_like_select')) | ||
| 132 | + .width(24) | ||
| 133 | + .height(24) | ||
| 134 | + .margin({ right: 5 }) | ||
| 135 | + } | ||
| 136 | + } else if (this.contentDetailData?.likesStyle === 2) { | ||
| 137 | + Image($r('app.media.icon_prayer_active')) | ||
| 112 | .width(24) | 138 | .width(24) |
| 113 | .height(24) | 139 | .height(24) |
| 114 | .margin({ right: 5 }) | 140 | .margin({ right: 5 }) |
| 115 | } else { | 141 | } else { |
| 142 | + Image($r('app.media.icon_candle_active')) | ||
| 143 | + .width(24) | ||
| 144 | + .height(24) | ||
| 145 | + .margin({ right: 5 }) | ||
| 146 | + } | ||
| 147 | + } else { | ||
| 116 | Image(this.contentDetailData?.likesStyle === 1 ? $r('app.media.icon_like') : | 148 | Image(this.contentDetailData?.likesStyle === 1 ? $r('app.media.icon_like') : |
| 117 | (this.contentDetailData?.likesStyle === 2 ? $r('app.media.icon_prayer') : | 149 | (this.contentDetailData?.likesStyle === 2 ? $r('app.media.icon_prayer') : |
| 118 | $r('app.media.icon_candle'))) | 150 | $r('app.media.icon_candle'))) |
| @@ -464,9 +496,24 @@ export struct ImageAndTextPageComponent { | @@ -464,9 +496,24 @@ export struct ImageAndTextPageComponent { | ||
| 464 | }) | 496 | }) |
| 465 | } | 497 | } |
| 466 | 498 | ||
| 499 | + initAnimationConfig() { | ||
| 500 | + if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle !== 4) { | ||
| 501 | + if (this.newsStatusOfUser?.likeStatus == '1') { | ||
| 502 | + if (this.contentDetailData?.likesStyle === 1) { | ||
| 503 | + this.needAnimation = false; | ||
| 504 | + } else { | ||
| 505 | + this.needAnimation = true; | ||
| 506 | + } | ||
| 507 | + } | ||
| 508 | + } else { | ||
| 509 | + this.needAnimation = true; | ||
| 510 | + } | ||
| 511 | + } | ||
| 512 | + | ||
| 467 | aboutToAppear() { | 513 | aboutToAppear() { |
| 468 | this.getDetail() | 514 | this.getDetail() |
| 469 | this.screenHeight = DisplayUtils.getDeviceHeight() | 515 | this.screenHeight = DisplayUtils.getDeviceHeight() |
| 516 | + this.initAnimationConfig(); | ||
| 470 | //注册通知,来自别的组件的评论成功通知 | 517 | //注册通知,来自别的组件的评论成功通知 |
| 471 | EmitterUtils.receiveEvent(EmitterEventId.COMMENT_PUBLISH, (targetId?: string) => { | 518 | EmitterUtils.receiveEvent(EmitterEventId.COMMENT_PUBLISH, (targetId?: string) => { |
| 472 | if (targetId) { | 519 | if (targetId) { |
| @@ -11,6 +11,8 @@ import { TrackConstants, TrackingButton } from 'wdTracking'; | @@ -11,6 +11,8 @@ import { TrackConstants, TrackingButton } from 'wdTracking'; | ||
| 11 | import { faceDetector } from '@kit.CoreVisionKit'; | 11 | import { faceDetector } from '@kit.CoreVisionKit'; |
| 12 | import mediaLibrary from '@ohos.multimedia.mediaLibrary'; | 12 | import mediaLibrary from '@ohos.multimedia.mediaLibrary'; |
| 13 | import fileIo from '@ohos.file.fs'; | 13 | import fileIo from '@ohos.file.fs'; |
| 14 | +import { httpRequest } from '../utils/httpRequest'; | ||
| 15 | +import { taskpool } from '@kit.ArkTS'; | ||
| 14 | 16 | ||
| 15 | const PERMISSIONS: Array<Permissions> = [ | 17 | const PERMISSIONS: Array<Permissions> = [ |
| 16 | 'ohos.permission.READ_IMAGEVIDEO', | 18 | 'ohos.permission.READ_IMAGEVIDEO', |
| @@ -21,6 +23,23 @@ const PERMISSIONS: Array<Permissions> = [ | @@ -21,6 +23,23 @@ const PERMISSIONS: Array<Permissions> = [ | ||
| 21 | * saveButton参考文档 | 23 | * saveButton参考文档 |
| 22 | * https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/savebutton-0000001820999677 | 24 | * https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/savebutton-0000001820999677 |
| 23 | * */ | 25 | * */ |
| 26 | +@Concurrent | ||
| 27 | +async function getPicture(imageUrl: string): Promise<ArrayBuffer> { | ||
| 28 | + let ret: ArrayBuffer = await new Promise((resolve, reject) => { | ||
| 29 | + httpRequest.httpRequestInStream(imageUrl, (res: ArrayBuffer) => { | ||
| 30 | + resolve(res); // 成功时解析Promise | ||
| 31 | + }, () => { | ||
| 32 | + // 下载失败时弹窗提示检查网络 | ||
| 33 | + promptAction.showToast({ | ||
| 34 | + message: $r('app.string.image_request_fail'), | ||
| 35 | + duration: 2000 | ||
| 36 | + }); | ||
| 37 | + reject(new Error('Image download failed')); // 失败时拒绝Promise | ||
| 38 | + }); | ||
| 39 | + }); | ||
| 40 | + return ret | ||
| 41 | +} | ||
| 42 | + | ||
| 24 | @Component | 43 | @Component |
| 25 | export struct ImageDownloadComponent { | 44 | export struct ImageDownloadComponent { |
| 26 | @State image: PixelMap | undefined = undefined; | 45 | @State image: PixelMap | undefined = undefined; |
| @@ -79,61 +98,12 @@ export struct ImageDownloadComponent { | @@ -79,61 +98,12 @@ export struct ImageDownloadComponent { | ||
| 79 | const context = getContext(this) as common.UIAbilityContext; | 98 | const context = getContext(this) as common.UIAbilityContext; |
| 80 | const atManager = abilityAccessCtrl.createAtManager(); | 99 | const atManager = abilityAccessCtrl.createAtManager(); |
| 81 | await atManager.requestPermissionsFromUser(context, PERMISSIONS); | 100 | await atManager.requestPermissionsFromUser(context, PERMISSIONS); |
| 82 | - this.getPicture(); | ||
| 83 | - } | ||
| 84 | - | ||
| 85 | - /** | ||
| 86 | - * 通过http的request方法从网络下载图片资源 | ||
| 87 | - */ | ||
| 88 | - async getPicture() { | ||
| 89 | - // 每一个httpRequest对应一个HTTP请求任务,不可复用 | ||
| 90 | - let httpRequest = http.createHttp(); | ||
| 91 | - // 用于订阅HTTP响应头事件 | ||
| 92 | - httpRequest.on('headersReceive', (header: Object) => { | ||
| 93 | - //console.info('header: ' + JSON.stringify(header)); | ||
| 94 | - }); | ||
| 95 | - // 用于订阅HTTP流式响应数据接收事件 | ||
| 96 | - let res = new ArrayBuffer(0); | ||
| 97 | - httpRequest.on('dataReceive', (data: ArrayBuffer) => { | ||
| 98 | - const newRes = new ArrayBuffer(res.byteLength + data.byteLength); | ||
| 99 | - const resView = new Uint8Array(newRes); | ||
| 100 | - resView.set(new Uint8Array(res)); | ||
| 101 | - resView.set(new Uint8Array(data), res.byteLength); | ||
| 102 | - res = newRes; | ||
| 103 | - // //console.info('dataReceive res length: ' + res.byteLength); | ||
| 104 | - }); | ||
| 105 | - // 用于订阅HTTP流式响应数据接收完毕事件 | ||
| 106 | - httpRequest.on('dataEnd', () => { | ||
| 107 | - this.transcodePixelMap(res); | ||
| 108 | - // 判断网络获取到的资源是否为ArrayBuffer类型 | ||
| 109 | - //console.info(`dataEnd getPicture ${res}`) | ||
| 110 | - if (res instanceof ArrayBuffer) { | ||
| 111 | - //console.info(`dataEnd getPicture`) | ||
| 112 | - this.imageBuffer = res as ArrayBuffer; | ||
| 113 | - } | ||
| 114 | - //console.info('No more data in response, data receive end'); | ||
| 115 | - }); | ||
| 116 | - httpRequest.requestInStream(this.url, | ||
| 117 | - (error: BusinessError, data: number) => { | ||
| 118 | - if (error) { | ||
| 119 | - // 下载失败时弹窗提示检查网络,不执行后续逻辑 | ||
| 120 | - promptAction.showToast({ | ||
| 121 | - message: $r('app.string.image_request_fail'), | ||
| 122 | - duration: 2000 | 101 | + // 通过任务池(taskpool)从网络下载图片资源 |
| 102 | + taskpool.execute(getPicture, this.url).then((res) => { | ||
| 103 | + const imgBuffer = res as ArrayBuffer | ||
| 104 | + this.imageBuffer = imgBuffer; | ||
| 105 | + this.transcodePixelMap(imgBuffer); | ||
| 123 | }) | 106 | }) |
| 124 | - //console.error(`http reqeust failed with. Code: ${error.code}, message: ${error.message}`); | ||
| 125 | - return; | ||
| 126 | - } | ||
| 127 | - // 取消订阅HTTP响应头事件 | ||
| 128 | - httpRequest.off('headersReceive'); | ||
| 129 | - // 取消订阅HTTP流式响应数据接收事件 | ||
| 130 | - httpRequest.off('dataReceive'); | ||
| 131 | - // 取消订阅HTTP流式响应数据接收完毕事件 | ||
| 132 | - httpRequest.off('dataEnd'); | ||
| 133 | - // 当该请求使用完毕时,调用destroy方法主动销毁 | ||
| 134 | - httpRequest.destroy(); | ||
| 135 | - } | ||
| 136 | - ) | ||
| 137 | } | 107 | } |
| 138 | 108 | ||
| 139 | /** | 109 | /** |
| @@ -27,6 +27,7 @@ import { common } from '@kit.AbilityKit'; | @@ -27,6 +27,7 @@ import { common } from '@kit.AbilityKit'; | ||
| 27 | import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent'; | 27 | import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent'; |
| 28 | import { EmitterEventId, EmitterUtils } from 'wdKit/Index' | 28 | import { EmitterEventId, EmitterUtils } from 'wdKit/Index' |
| 29 | import { ColorUtils } from '../../utils/ColorUtils'; | 29 | import { ColorUtils } from '../../utils/ColorUtils'; |
| 30 | +import { SpConstants } from 'wdConstant'; | ||
| 30 | 31 | ||
| 31 | 32 | ||
| 32 | const TAG = 'MorningEveningPaperComponent'; | 33 | const TAG = 'MorningEveningPaperComponent'; |
| @@ -35,7 +36,7 @@ const TAG = 'MorningEveningPaperComponent'; | @@ -35,7 +36,7 @@ const TAG = 'MorningEveningPaperComponent'; | ||
| 35 | @Component | 36 | @Component |
| 36 | export struct MorningEveningPaperComponent { | 37 | export struct MorningEveningPaperComponent { |
| 37 | @State pageInfoBean: PageInfoBean = {} as PageInfoBean | 38 | @State pageInfoBean: PageInfoBean = {} as PageInfoBean |
| 38 | - // @State compInfoBean: CompInfoBean = {} as CompInfoBean | 39 | + @State compInfoBean: CompInfoBean = {} as CompInfoBean |
| 39 | @State compListItem: CompList = {} as CompList | 40 | @State compListItem: CompList = {} as CompList |
| 40 | @Provide commentList: InteractDataDTO[] = [] | 41 | @Provide commentList: InteractDataDTO[] = [] |
| 41 | @State audioPlayUrl: string = "" | 42 | @State audioPlayUrl: string = "" |
| @@ -96,14 +97,14 @@ export struct MorningEveningPaperComponent { | @@ -96,14 +97,14 @@ export struct MorningEveningPaperComponent { | ||
| 96 | private AudioSuspension = new AudioSuspensionModel() | 97 | private AudioSuspension = new AudioSuspensionModel() |
| 97 | 98 | ||
| 98 | onCancel() { | 99 | onCancel() { |
| 99 | - console.log(TAG, "cj2024 onCancel = ") | 100 | + // console.log(TAG, "cj2024 onCancel = ") |
| 100 | } | 101 | } |
| 101 | 102 | ||
| 102 | /** | 103 | /** |
| 103 | * 回调无用 | 104 | * 回调无用 |
| 104 | **/ | 105 | **/ |
| 105 | onConfirm() { | 106 | onConfirm() { |
| 106 | - console.log(TAG, "cj2024 onConfirm = ") | 107 | + // console.log(TAG, "cj2024 onConfirm = ") |
| 107 | // if (this.playerController != undefined) { | 108 | // if (this.playerController != undefined) { |
| 108 | // | 109 | // |
| 109 | // } | 110 | // } |
| @@ -113,10 +114,10 @@ export struct MorningEveningPaperComponent { | @@ -113,10 +114,10 @@ export struct MorningEveningPaperComponent { | ||
| 113 | 114 | ||
| 114 | // 续播判断 | 115 | // 续播判断 |
| 115 | changeContinue() { | 116 | changeContinue() { |
| 116 | - console.log(TAG, "cj2024 changeContinue = 1") | 117 | + // console.log(TAG, "cj2024 changeContinue = 1") |
| 117 | // if (this.nextContId) { | 118 | // if (this.nextContId) { |
| 118 | this.playerController.continue = () => { | 119 | this.playerController.continue = () => { |
| 119 | - console.log(TAG, "cj2024 changeContinue = 2") | 120 | + // console.log(TAG, "cj2024 changeContinue = 2") |
| 120 | this.playerController?.stop(); | 121 | this.playerController?.stop(); |
| 121 | // this.playVM.playWithContentId(this.nextContId ?? ''); | 122 | // this.playVM.playWithContentId(this.nextContId ?? ''); |
| 122 | } | 123 | } |
| @@ -128,10 +129,10 @@ export struct MorningEveningPaperComponent { | @@ -128,10 +129,10 @@ export struct MorningEveningPaperComponent { | ||
| 128 | async aboutToAppear() { | 129 | async aboutToAppear() { |
| 129 | this.dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as string | 130 | this.dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as string |
| 130 | 131 | ||
| 131 | - console.info(TAG, `aboutToAppear = ` + this.dailyPaperTopicPageId) | 132 | + // console.info(TAG, `aboutToAppear = ` + this.dailyPaperTopicPageId) |
| 132 | const currentTime = new Date().getTime() | 133 | const currentTime = new Date().getTime() |
| 133 | - console.log(TAG, "currentTime = " + currentTime) | ||
| 134 | - console.log(TAG, `currentTime = ${currentTime}`) | 134 | + // console.log(TAG, "currentTime = " + currentTime) |
| 135 | + // console.log(TAG, `currentTime = ${currentTime}`) | ||
| 135 | try { | 136 | try { |
| 136 | 137 | ||
| 137 | // let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId) | 138 | // let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId) |
| @@ -144,46 +145,44 @@ export struct MorningEveningPaperComponent { | @@ -144,46 +145,44 @@ export struct MorningEveningPaperComponent { | ||
| 144 | let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN) | 145 | let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN) |
| 145 | const dateShow = new Date(dateTime) | 146 | const dateShow = new Date(dateTime) |
| 146 | this.subTitle = `${dateShow.getFullYear()}年\n${(dateShow.getMonth() + 1)}月${dateShow.getDate()}日` | 147 | this.subTitle = `${dateShow.getFullYear()}年\n${(dateShow.getMonth() + 1)}月${dateShow.getDate()}日` |
| 147 | - console.log(TAG, "pageInfoBean topicDate = " + this.pageInfoBean?.topicInfo?.topicDate) | ||
| 148 | - console.log(TAG, "pageInfoBean title = " + this.pageInfoBean?.topicInfo?.title) | ||
| 149 | - | ||
| 150 | - console.log(TAG, "pageInfoBean dateTime = " + dateTime) | ||
| 151 | - console.log(TAG, "pageInfoBean subTitle = " + this.subTitle) | ||
| 152 | - | ||
| 153 | - console.log(TAG, "this.pageInfoBean = " + JSON.stringify(this.pageInfoBean)) | 148 | + // console.log(TAG, "pageInfoBean topicDate = " + this.pageInfoBean?.topicInfo?.topicDate) |
| 149 | + // console.log(TAG, "pageInfoBean title = " + this.pageInfoBean?.topicInfo?.title) | ||
| 150 | + // | ||
| 151 | + // console.log(TAG, "pageInfoBean dateTime = " + dateTime) | ||
| 152 | + // console.log(TAG, "pageInfoBean subTitle = " + this.subTitle) | ||
| 153 | + // | ||
| 154 | + // console.log(TAG, "this.pageInfoBean = " + JSON.stringify(this.pageInfoBean)) | ||
| 154 | 155 | ||
| 155 | this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false | 156 | this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false |
| 156 | let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :'' | 157 | let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :'' |
| 157 | this.setComponentBgColor(coverUrl) | 158 | this.setComponentBgColor(coverUrl) |
| 158 | 159 | ||
| 159 | - // this.compInfoBean = compInfoBean | ||
| 160 | //信息流缓存 | 160 | //信息流缓存 |
| 161 | let BeanString = SPHelper.default.getSync('MorningEveningComp'+this.dailyPaperTopicPageId,'') as string | 161 | let BeanString = SPHelper.default.getSync('MorningEveningComp'+this.dailyPaperTopicPageId,'') as string |
| 162 | let compInfoBean = {} as CompInfoBean | 162 | let compInfoBean = {} as CompInfoBean |
| 163 | if (BeanString.length > 0) { | 163 | if (BeanString.length > 0) { |
| 164 | compInfoBean = JSON.parse(BeanString) | 164 | compInfoBean = JSON.parse(BeanString) |
| 165 | - }else { | 165 | + } else { |
| 166 | SPHelper.default.delete('MorningEveningComp'+this.dailyPaperTopicPageId) | 166 | SPHelper.default.delete('MorningEveningComp'+this.dailyPaperTopicPageId) |
| 167 | compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) | 167 | compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) |
| 168 | SPHelper.default.saveSync('MorningEveningComp'+this.dailyPaperTopicPageId,JSON.stringify(compInfoBean)) | 168 | SPHelper.default.saveSync('MorningEveningComp'+this.dailyPaperTopicPageId,JSON.stringify(compInfoBean)) |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | - console.log(TAG, "compInfoBean = " + JSON.stringify(compInfoBean)) | ||
| 172 | if (compInfoBean?.compList[0]) { | 171 | if (compInfoBean?.compList[0]) { |
| 173 | this.compListItem = compInfoBean?.compList[0] | 172 | this.compListItem = compInfoBean?.compList[0] |
| 174 | - console.log(TAG, '获取评论数据' + `${this.compListItem.operDataList.length}`) | 173 | + // console.log(TAG, '获取评论数据' + `${this.compListItem.operDataList.length}`) |
| 175 | if (this.compListItem.operDataList && this.compListItem.operDataList.length > 0) { | 174 | if (this.compListItem.operDataList && this.compListItem.operDataList.length > 0) { |
| 176 | this.getAllContentInteractData(this.compListItem.operDataList) | 175 | this.getAllContentInteractData(this.compListItem.operDataList) |
| 177 | } | 176 | } |
| 178 | - console.log(TAG, 'compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList)) | 177 | + // console.log(TAG, 'compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList)) |
| 179 | if (compInfoBean?.compList[0].audioDataList.length > 0) { | 178 | if (compInfoBean?.compList[0].audioDataList.length > 0) { |
| 180 | this.audioPlayUrl = compInfoBean?.compList[0].audioDataList[0]?.audioUrl | 179 | this.audioPlayUrl = compInfoBean?.compList[0].audioDataList[0]?.audioUrl |
| 181 | this.audioTitle = compInfoBean?.compList[0].audioDataList[0]?.title | 180 | this.audioTitle = compInfoBean?.compList[0].audioDataList[0]?.title |
| 182 | - console.log(TAG, 'this.audioPlayUrl', this.audioPlayUrl) | 181 | + // console.log(TAG, 'this.audioPlayUrl', this.audioPlayUrl) |
| 183 | } | 182 | } |
| 184 | } | 183 | } |
| 185 | 184 | ||
| 186 | - console.log(TAG, "compInfoBean compStyle = " + compInfoBean.compList[0].compStyle) | 185 | + // console.log(TAG, "compInfoBean compStyle = " + compInfoBean.compList[0].compStyle) |
| 187 | this.playerController.onTimeUpdate = (position, duration) => { | 186 | this.playerController.onTimeUpdate = (position, duration) => { |
| 188 | this.currentTime = DateFormatUtil.secondToTime(position); | 187 | this.currentTime = DateFormatUtil.secondToTime(position); |
| 189 | this.totalTime = DateFormatUtil.secondToTime(duration); | 188 | this.totalTime = DateFormatUtil.secondToTime(duration); |
| @@ -195,6 +194,11 @@ export struct MorningEveningPaperComponent { | @@ -195,6 +194,11 @@ export struct MorningEveningPaperComponent { | ||
| 195 | compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) | 194 | compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) |
| 196 | SPHelper.default.saveSync('MorningEveningComp'+this.dailyPaperTopicPageId,JSON.stringify(compInfoBean)) | 195 | SPHelper.default.saveSync('MorningEveningComp'+this.dailyPaperTopicPageId,JSON.stringify(compInfoBean)) |
| 197 | } | 196 | } |
| 197 | + // 音频悬浮窗跳转数据 | ||
| 198 | + this.compInfoBean = compInfoBean | ||
| 199 | + | ||
| 200 | + // console.log('AudioSuspensionModel', "compInfoBean = " + JSON.stringify(compInfoBean)) | ||
| 201 | + // console.log('AudioSuspensionModel', "compInfoBean11 = " + JSON.stringify(this.compInfoBean)) | ||
| 198 | } catch (exception) { | 202 | } catch (exception) { |
| 199 | this.isContentFailed = true | 203 | this.isContentFailed = true |
| 200 | 204 | ||
| @@ -219,10 +223,10 @@ export struct MorningEveningPaperComponent { | @@ -219,10 +223,10 @@ export struct MorningEveningPaperComponent { | ||
| 219 | contentType: Number(item.objectType ?? '1') | 223 | contentType: Number(item.objectType ?? '1') |
| 220 | }) | 224 | }) |
| 221 | }) | 225 | }) |
| 222 | - console.log(TAG, '获取评论数据' + `${JSON.stringify(params)}`) | 226 | + // console.log(TAG, '获取评论数据' + `${JSON.stringify(params)}`) |
| 223 | 227 | ||
| 224 | this.commentList = await PeopleShipMainViewModel.getContentInteractInfo(params) | 228 | this.commentList = await PeopleShipMainViewModel.getContentInteractInfo(params) |
| 225 | - console.log(TAG, '获取评论数据' + `${JSON.stringify(this.commentList)}`) | 229 | + // console.log(TAG, '获取评论数据' + `${JSON.stringify(this.commentList)}`) |
| 226 | 230 | ||
| 227 | } catch (exception) { | 231 | } catch (exception) { |
| 228 | 232 | ||
| @@ -232,7 +236,7 @@ export struct MorningEveningPaperComponent { | @@ -232,7 +236,7 @@ export struct MorningEveningPaperComponent { | ||
| 232 | async setComponentBgColor(imageUrl: string) { | 236 | async setComponentBgColor(imageUrl: string) { |
| 233 | // 图片转换为PixelMap对象 | 237 | // 图片转换为PixelMap对象 |
| 234 | // const pixelMap: image.PixelMap = await image2PixelMap(item.icon); | 238 | // const pixelMap: image.PixelMap = await image2PixelMap(item.icon); |
| 235 | - console.log(TAG, "compInfoBean compStyle = " + imageUrl) | 239 | + // console.log(TAG, "compInfoBean compStyle = " + imageUrl) |
| 236 | 240 | ||
| 237 | if (this.pageInfoBean.backgroundColor.length > 0){ | 241 | if (this.pageInfoBean.backgroundColor.length > 0){ |
| 238 | let colorDatas = ColorUtils.hexColorValueToRGB(this.pageInfoBean.backgroundColor) | 242 | let colorDatas = ColorUtils.hexColorValueToRGB(this.pageInfoBean.backgroundColor) |
| @@ -270,11 +274,11 @@ export struct MorningEveningPaperComponent { | @@ -270,11 +274,11 @@ export struct MorningEveningPaperComponent { | ||
| 270 | const pixelMap: image.PixelMap = await imageNet2PixelMap(imageSource); | 274 | const pixelMap: image.PixelMap = await imageNet2PixelMap(imageSource); |
| 271 | effectKit.createColorPicker(pixelMap, (err, colorPicker) => { | 275 | effectKit.createColorPicker(pixelMap, (err, colorPicker) => { |
| 272 | let color = colorPicker.getLargestProportionColor(); | 276 | let color = colorPicker.getLargestProportionColor(); |
| 273 | - console.log(TAG, "compInfoBean compStyle = " + color) | 277 | + // console.log(TAG, "compInfoBean compStyle = " + color) |
| 274 | color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha}) | 278 | color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha}) |
| 275 | // 将取色器选取的color示例转换为十六进制颜色代码 | 279 | // 将取色器选取的color示例转换为十六进制颜色代码 |
| 276 | this.mixedBgColor = "#ff" + color.alpha.toString(16) + color.red.toString(16).padStart(2,'0') + color.green.toString(16).padStart(2,'0') + color.blue.toString(16).padStart(2,'0'); | 280 | this.mixedBgColor = "#ff" + color.alpha.toString(16) + color.red.toString(16).padStart(2,'0') + color.green.toString(16).padStart(2,'0') + color.blue.toString(16).padStart(2,'0'); |
| 277 | - console.log(TAG, "compInfoBean compStyle = " + this.mixedBgColor) | 281 | + // console.log(TAG, "compInfoBean compStyle = " + this.mixedBgColor) |
| 278 | }); | 282 | }); |
| 279 | } | 283 | } |
| 280 | } | 284 | } |
| @@ -398,12 +402,13 @@ export struct MorningEveningPaperComponent { | @@ -398,12 +402,13 @@ export struct MorningEveningPaperComponent { | ||
| 398 | .margin({ left: this.currentStatus === PlayerConstants.STATUS_START ?6:9 })// .alignSelf(ItemAlign.Center) | 402 | .margin({ left: this.currentStatus === PlayerConstants.STATUS_START ?6:9 })// .alignSelf(ItemAlign.Center) |
| 399 | .objectFit(ImageFit.Contain) | 403 | .objectFit(ImageFit.Contain) |
| 400 | .onClick(() => { | 404 | .onClick(() => { |
| 401 | - console.log("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying) | 405 | + // console.log("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying) |
| 402 | // dialog.open() | 406 | // dialog.open() |
| 403 | // this.playerController.firstPlay(this.audioPlayUrl, this.audioTitle) | 407 | // this.playerController.firstPlay(this.audioPlayUrl, this.audioTitle) |
| 408 | + // SPHelper.default.save(SpConstants.APP_NEWS_INFO_DATA_MODEL, JSON.stringify(this.compInfoBean)) | ||
| 404 | this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle) | 409 | this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle) |
| 405 | - console.log(TAG, "this.audioPlayUrl = " + this.audioPlayUrl) | ||
| 406 | - console.log("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying) | 410 | + // console.log(TAG, "this.audioPlayUrl = " + this.audioPlayUrl) |
| 411 | + // console.log("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying) | ||
| 407 | }) | 412 | }) |
| 408 | } | 413 | } |
| 409 | .height('100%') | 414 | .height('100%') |
| @@ -6,11 +6,29 @@ import { OffsetModel } from '../model/OffsetModel'; | @@ -6,11 +6,29 @@ import { OffsetModel } from '../model/OffsetModel'; | ||
| 6 | import { WindowSizeManager } from '../utils/Managers'; | 6 | import { WindowSizeManager } from '../utils/Managers'; |
| 7 | import { runWithAnimation } from '../utils/FuncUtils'; | 7 | import { runWithAnimation } from '../utils/FuncUtils'; |
| 8 | import { PhotoListBean } from 'wdBean/Index'; | 8 | import { PhotoListBean } from 'wdBean/Index'; |
| 9 | -import { http } from '@kit.NetworkKit'; | ||
| 10 | import { router } from '@kit.ArkUI'; | 9 | import { router } from '@kit.ArkUI'; |
| 10 | +import { taskpool } from '@kit.ArkTS'; | ||
| 11 | +import { httpRequest } from '../utils/httpRequest'; | ||
| 11 | 12 | ||
| 12 | const TAG = 'MultiPictureDetailItemComponent'; | 13 | const TAG = 'MultiPictureDetailItemComponent'; |
| 13 | 14 | ||
| 15 | +@Concurrent | ||
| 16 | +async function getPicture(imageUrl: string): Promise<ArrayBuffer> { | ||
| 17 | + let ret: ArrayBuffer = await new Promise((resolve, reject) => { | ||
| 18 | + httpRequest.httpRequestInStream(imageUrl, (res: ArrayBuffer) => { | ||
| 19 | + resolve(res); // 成功时解析Promise | ||
| 20 | + }, () => { | ||
| 21 | + // 下载失败时弹窗提示检查网络 | ||
| 22 | + promptAction.showToast({ | ||
| 23 | + message: $r('app.string.image_request_fail'), | ||
| 24 | + duration: 2000 | ||
| 25 | + }); | ||
| 26 | + reject(new Error('Image download failed')); // 失败时拒绝Promise | ||
| 27 | + }); | ||
| 28 | + }); | ||
| 29 | + return ret | ||
| 30 | +} | ||
| 31 | + | ||
| 14 | @Reusable | 32 | @Reusable |
| 15 | @Component | 33 | @Component |
| 16 | export struct MultiPictureDetailItemComponent { | 34 | export struct MultiPictureDetailItemComponent { |
| @@ -34,65 +52,17 @@ export struct MultiPictureDetailItemComponent { | @@ -34,65 +52,17 @@ export struct MultiPictureDetailItemComponent { | ||
| 34 | windowSizeManager: WindowSizeManager = new WindowSizeManager(); | 52 | windowSizeManager: WindowSizeManager = new WindowSizeManager(); |
| 35 | 53 | ||
| 36 | 54 | ||
| 37 | - async aboutToAppear() { | 55 | + aboutToAppear() { |
| 38 | this.imageUri = this.MultiPictureDetailItem.picPath | 56 | this.imageUri = this.MultiPictureDetailItem.picPath |
| 39 | - this.getPicture() | ||
| 40 | - } | ||
| 41 | - | ||
| 42 | - /** | ||
| 43 | - * 通过http的request方法从网络下载图片资源 | ||
| 44 | - */ | ||
| 45 | - async getPicture() { | ||
| 46 | - // 每一个httpRequest对应一个HTTP请求任务,不可复用 | ||
| 47 | - let httpRequest = http.createHttp(); | ||
| 48 | - // 用于订阅HTTP响应头事件 | ||
| 49 | - httpRequest.on('headersReceive', (header: Object) => { | ||
| 50 | - console.info('header: ' + JSON.stringify(header)); | ||
| 51 | - }); | ||
| 52 | - // 用于订阅HTTP流式响应数据接收事件 | ||
| 53 | - let res = new ArrayBuffer(0); | ||
| 54 | - httpRequest.on('dataReceive', (data: ArrayBuffer) => { | ||
| 55 | - const newRes = new ArrayBuffer(res.byteLength + data.byteLength); | ||
| 56 | - const resView = new Uint8Array(newRes); | ||
| 57 | - resView.set(new Uint8Array(res)); | ||
| 58 | - resView.set(new Uint8Array(data), res.byteLength); | ||
| 59 | - res = newRes; | ||
| 60 | - // console.info('dataReceive res length: ' + res.byteLength); | ||
| 61 | - }); | ||
| 62 | - // 用于订阅HTTP流式响应数据接收完毕事件 | ||
| 63 | - httpRequest.on('dataEnd', () => { | ||
| 64 | - this.transcodePixelMap(res); | ||
| 65 | - // 判断网络获取到的资源是否为ArrayBuffer类型 | ||
| 66 | - console.info(`dataEnd getPicture ${res}`) | ||
| 67 | - if (res instanceof ArrayBuffer) { | ||
| 68 | - console.info(`dataEnd getPicture`) | ||
| 69 | - this.imageBuffer = res as ArrayBuffer; | ||
| 70 | - } | ||
| 71 | - console.info('No more data in response, data receive end'); | ||
| 72 | - }); | ||
| 73 | - httpRequest.requestInStream(this.imageUri, | ||
| 74 | - (error: BusinessError, data: number) => { | ||
| 75 | - if (error) { | ||
| 76 | - // 下载失败时弹窗提示检查网络,不执行后续逻辑 | ||
| 77 | - promptAction.showToast({ | ||
| 78 | - message: $r('app.string.image_request_fail'), | ||
| 79 | - duration: 2000 | 57 | + // 通过任务池(taskpool)从网络下载图片资源 |
| 58 | + taskpool.execute(getPicture, this.imageUri).then((res) => { | ||
| 59 | + const imgBuffer = res as ArrayBuffer | ||
| 60 | + this.imageBuffer = imgBuffer; | ||
| 61 | + this.transcodePixelMap(imgBuffer); | ||
| 80 | }) | 62 | }) |
| 81 | - console.error(`http reqeust failed with. Code: ${error.code}, message: ${error.message}`); | ||
| 82 | - return; | ||
| 83 | - } | ||
| 84 | - // 取消订阅HTTP响应头事件 | ||
| 85 | - httpRequest.off('headersReceive'); | ||
| 86 | - // 取消订阅HTTP流式响应数据接收事件 | ||
| 87 | - httpRequest.off('dataReceive'); | ||
| 88 | - // 取消订阅HTTP流式响应数据接收完毕事件 | ||
| 89 | - httpRequest.off('dataEnd'); | ||
| 90 | - // 当该请求使用完毕时,调用destroy方法主动销毁 | ||
| 91 | - httpRequest.destroy(); | ||
| 92 | - } | ||
| 93 | - ) | ||
| 94 | } | 63 | } |
| 95 | 64 | ||
| 65 | + | ||
| 96 | /** | 66 | /** |
| 97 | * 使用createPixelMap将ArrayBuffer类型的图片装换为PixelMap类型 | 67 | * 使用createPixelMap将ArrayBuffer类型的图片装换为PixelMap类型 |
| 98 | * @param data:网络获取到的资源 | 68 | * @param data:网络获取到的资源 |
| @@ -22,6 +22,10 @@ import { PageRepository } from '../repository/PageRepository'; | @@ -22,6 +22,10 @@ import { PageRepository } from '../repository/PageRepository'; | ||
| 22 | import { CommentDialogView } from './CommentDialogView'; | 22 | import { CommentDialogView } from './CommentDialogView'; |
| 23 | import { faceDetector } from '@kit.CoreVisionKit'; | 23 | import { faceDetector } from '@kit.CoreVisionKit'; |
| 24 | import { channelSkeleton } from './skeleton/channelSkeleton'; | 24 | import { channelSkeleton } from './skeleton/channelSkeleton'; |
| 25 | +import PageAdModel from '../viewmodel/PageAdvModel'; | ||
| 26 | +import { ProcessUtils } from 'wdRouter/Index'; | ||
| 27 | +import { GrayManageModel } from '../viewmodel/GrayManageModel'; | ||
| 28 | +import router from '@ohos.router'; | ||
| 25 | 29 | ||
| 26 | const TAG: string = 'SpacialTopicPageComponent' | 30 | const TAG: string = 'SpacialTopicPageComponent' |
| 27 | 31 | ||
| @@ -51,10 +55,14 @@ export struct SpacialTopicPageComponent { | @@ -51,10 +55,14 @@ export struct SpacialTopicPageComponent { | ||
| 51 | @State showComment: boolean = false | 55 | @State showComment: boolean = false |
| 52 | @State topicInfo: TopicInfo = {} as TopicInfo | 56 | @State topicInfo: TopicInfo = {} as TopicInfo |
| 53 | @State topicDetail: TopicDetailData = {} as TopicDetailData | 57 | @State topicDetail: TopicDetailData = {} as TopicDetailData |
| 58 | + @State private pageAdvModel: PageAdModel = new PageAdModel(); | ||
| 54 | @State shareInfo: ShareInfoDTO = {} as ShareInfoDTO | 59 | @State shareInfo: ShareInfoDTO = {} as ShareInfoDTO |
| 55 | @State showBottomView: boolean = false; | 60 | @State showBottomView: boolean = false; |
| 56 | @State executedStartTime: number = new Date().getTime() | 61 | @State executedStartTime: number = new Date().getTime() |
| 57 | 62 | ||
| 63 | + // 国殇灰度管理 | ||
| 64 | + GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage') | ||
| 65 | + | ||
| 58 | private trySendData2H5() { | 66 | private trySendData2H5() { |
| 59 | if (!this.webPrepared) { | 67 | if (!this.webPrepared) { |
| 60 | return | 68 | return |
| @@ -85,7 +93,7 @@ export struct SpacialTopicPageComponent { | @@ -85,7 +93,7 @@ export struct SpacialTopicPageComponent { | ||
| 85 | 93 | ||
| 86 | this.topicDetail = JSON.parse(dataString); | 94 | this.topicDetail = JSON.parse(dataString); |
| 87 | this.topicInfo = this.topicDetail.topicInfo; | 95 | this.topicInfo = this.topicDetail.topicInfo; |
| 88 | - | 96 | + this.pageAdvModel.analysisTopicAdvSource(this.topicDetail) |
| 89 | if (this.topicInfo) { | 97 | if (this.topicInfo) { |
| 90 | // 转换详情数据 | 98 | // 转换详情数据 |
| 91 | this.contentDetailData.openComment = Number(this.topicInfo.commentFlag) | 99 | this.contentDetailData.openComment = Number(this.topicInfo.commentFlag) |
| @@ -105,7 +113,6 @@ export struct SpacialTopicPageComponent { | @@ -105,7 +113,6 @@ export struct SpacialTopicPageComponent { | ||
| 105 | this.shareInfo.shareUrl = this.topicInfo.shareUrl | 113 | this.shareInfo.shareUrl = this.topicInfo.shareUrl |
| 106 | this.contentDetailData.shareInfo = this.shareInfo | 114 | this.contentDetailData.shareInfo = this.shareInfo |
| 107 | 115 | ||
| 108 | - console.log('contentDetailData111', JSON.stringify(this.contentDetailData)) | ||
| 109 | // if(this.topicInfo.shareOpen === 1){ | 116 | // if(this.topicInfo.shareOpen === 1){ |
| 110 | // if (!this.operationButtonList.includes('share')) { | 117 | // if (!this.operationButtonList.includes('share')) { |
| 111 | // this.operationButtonList.push('share'); | 118 | // this.operationButtonList.push('share'); |
| @@ -161,15 +168,45 @@ export struct SpacialTopicPageComponent { | @@ -161,15 +168,45 @@ export struct SpacialTopicPageComponent { | ||
| 161 | .height(CommonConstants.FULL_HEIGHT) | 168 | .height(CommonConstants.FULL_HEIGHT) |
| 162 | .padding({ bottom: this.action?.params?.backVisibility ? 115 : 75 }) | 169 | .padding({ bottom: this.action?.params?.backVisibility ? 115 : 75 }) |
| 163 | 170 | ||
| 171 | + RelativeContainer() { | ||
| 172 | + // 挂角广告 | ||
| 173 | + this.pageHornAd() | ||
| 174 | + } | ||
| 175 | + | ||
| 164 | if (!this.isNetConnected) { | 176 | if (!this.isNetConnected) { |
| 177 | + Column() { | ||
| 178 | + Image($r('app.media.line')) | ||
| 179 | + .width('calc(100% - 36vp)') | ||
| 180 | + .height(7) | ||
| 181 | + .position({ | ||
| 182 | + top: 92, | ||
| 183 | + left: 18 | ||
| 184 | + }) | ||
| 165 | EmptyComponent({ | 185 | EmptyComponent({ |
| 186 | + emptyHeight: 'calc(100% - 55vp)', | ||
| 166 | emptyType: 1, | 187 | emptyType: 1, |
| 167 | emptyButton: true, | 188 | emptyButton: true, |
| 168 | retry: () => { | 189 | retry: () => { |
| 169 | // this.getDetail() | 190 | // this.getDetail() |
| 170 | this.reload++ | 191 | this.reload++ |
| 171 | } | 192 | } |
| 172 | - }).padding({ bottom: 200 }) | 193 | + }).padding({ bottom: 200, top: 48 }) |
| 194 | + | ||
| 195 | + Image($r("app.media.back_icon")) | ||
| 196 | + .width(24) | ||
| 197 | + .height(24) | ||
| 198 | + .onClick(() => { | ||
| 199 | + router.back(); | ||
| 200 | + }) | ||
| 201 | + .position({ | ||
| 202 | + bottom: 15, | ||
| 203 | + left: 16 | ||
| 204 | + }) | ||
| 205 | + } | ||
| 206 | + .width('100%') | ||
| 207 | + .height('100%') | ||
| 208 | + .layoutWeight(1) | ||
| 209 | + .backgroundColor(0xffffff) | ||
| 173 | } else { | 210 | } else { |
| 174 | if (!this.isPageEnd) { | 211 | if (!this.isPageEnd) { |
| 175 | channelSkeleton().padding({ top: `${this.topSafeHeight}px`, bottom: this.bottomSafeHeight }) | 212 | channelSkeleton().padding({ top: `${this.topSafeHeight}px`, bottom: this.bottomSafeHeight }) |
| @@ -200,6 +237,102 @@ export struct SpacialTopicPageComponent { | @@ -200,6 +237,102 @@ export struct SpacialTopicPageComponent { | ||
| 200 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) | 237 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) |
| 201 | } | 238 | } |
| 202 | 239 | ||
| 240 | + /** | ||
| 241 | + * 页面挂角广告 | ||
| 242 | + */ | ||
| 243 | + @Builder | ||
| 244 | + pageHornAd() { | ||
| 245 | + | ||
| 246 | + if (this.pageAdvModel.isShowAds) { | ||
| 247 | + if (this.pageAdvModel.pageCornerAdv.matInfo != null && this.pageAdvModel.pageCornerAdv.matInfo.linkType != '2') { | ||
| 248 | + // 广告中心的挂角广告 | ||
| 249 | + this.drawPageCornerAdvView(1, 1 == this.pageAdvModel.isRightAdv) | ||
| 250 | + } else if (this.pageAdvModel.pageCornerContentInfo.advert != null ) { | ||
| 251 | + // 展现中心的挂角广告业务 | ||
| 252 | + this.drawPageCornerAdvView(2, 1 == this.pageAdvModel.isRightAdv) | ||
| 253 | + } | ||
| 254 | + } | ||
| 255 | + } | ||
| 256 | + | ||
| 257 | + /** | ||
| 258 | + * 绘制页面挂角 | ||
| 259 | + * | ||
| 260 | + * @param type 1:广告中心的挂角广告;2:展现中心的挂角广告 | ||
| 261 | + * @param isRightCorne true:右挂角;false:左挂角 | ||
| 262 | + */ | ||
| 263 | + @Builder | ||
| 264 | + drawPageCornerAdvView(type: number, isRightCorne: boolean) { | ||
| 265 | + // 页面左挂角 | ||
| 266 | + Image(type === 1 ? this.pageAdvModel.pageCornerAdv.matInfo.matImageUrl[0] | ||
| 267 | + : this.pageAdvModel.pageCornerContentInfo.advert.displayUrl) | ||
| 268 | + .width($r('app.float.vp_80')) | ||
| 269 | + .height($r('app.float.vp_80')) | ||
| 270 | + .id("left_iv") | ||
| 271 | + .alignRules({ | ||
| 272 | + bottom: { anchor: '__container__', align: VerticalAlign.Bottom }, | ||
| 273 | + left: { anchor: isRightCorne ? "" : '__container__', align: HorizontalAlign.Start }, | ||
| 274 | + right: { anchor: isRightCorne ? '__container__' : "", align: HorizontalAlign.End }, | ||
| 275 | + }) | ||
| 276 | + .margin({ | ||
| 277 | + bottom: "105vp", | ||
| 278 | + left: isRightCorne ? 0 : $r('app.float.card_comp_pagePadding_lf'), | ||
| 279 | + right: isRightCorne ? $r('app.float.card_comp_pagePadding_lf') : 0, | ||
| 280 | + | ||
| 281 | + }) | ||
| 282 | + .onClick(() => { | ||
| 283 | + if (type === 1) { | ||
| 284 | + // 广告业务跳转 | ||
| 285 | + ProcessUtils.openAdvDetail(this.pageAdvModel.pageCornerAdv.matInfo); | ||
| 286 | + } else { | ||
| 287 | + // 展现中心的业务跳转 | ||
| 288 | + ProcessUtils.advJumpMainPage(this.pageAdvModel.pageCornerContentInfo.advert) | ||
| 289 | + } | ||
| 290 | + }) | ||
| 291 | + .grayscale(this.GrayManage.get().isMourning() ? 1 : 0) | ||
| 292 | + // 关闭按钮 | ||
| 293 | + Image($r('app.media.icon_adv_horn_close')) | ||
| 294 | + .id('left_close') | ||
| 295 | + .width($r('app.float.vp_16')) | ||
| 296 | + .alignRules({ | ||
| 297 | + top: { anchor: 'left_iv', align: VerticalAlign.Top }, | ||
| 298 | + left: { anchor: isRightCorne ? '' : 'left_iv', align: HorizontalAlign.Start }, | ||
| 299 | + right: { anchor: isRightCorne ? 'left_iv' : '', align: HorizontalAlign.End }, | ||
| 300 | + }) | ||
| 301 | + .offset({ | ||
| 302 | + x: isRightCorne ? 10 : -10, | ||
| 303 | + y: isRightCorne ? -10 : -10 | ||
| 304 | + }) | ||
| 305 | + .onClick(() => { | ||
| 306 | + // 关闭挂角广告 | ||
| 307 | + this.pageAdvModel.isShowAds = false; | ||
| 308 | + | ||
| 309 | + }) | ||
| 310 | + .grayscale(this.GrayManage.get().isMourning() ? 1 : 0) | ||
| 311 | + | ||
| 312 | + if (type == 1) { | ||
| 313 | + Text($r('app.string.comp_advertisement')) | ||
| 314 | + .width($r('app.float.vp_28')) | ||
| 315 | + .height($r('app.float.vp_16')) | ||
| 316 | + .fontSize($r('app.float.font_size_10')) | ||
| 317 | + .fontColor(Color.White) | ||
| 318 | + .id('left_tag') | ||
| 319 | + .alignRules({ | ||
| 320 | + bottom: { anchor: 'left_iv', align: VerticalAlign.Bottom }, | ||
| 321 | + left: { anchor: isRightCorne ? '' : 'left_iv', align: HorizontalAlign.Start }, | ||
| 322 | + right: { anchor: isRightCorne ? 'left_iv' : '', align: HorizontalAlign.End }, | ||
| 323 | + }) | ||
| 324 | + .textAlign(TextAlign.Center) | ||
| 325 | + .backgroundColor($r('app.color.res_color_general_000000_30')) | ||
| 326 | + .borderRadius({ | ||
| 327 | + topLeft: $r('app.float.vp_2'), | ||
| 328 | + topRight: $r('app.float.vp_2'), | ||
| 329 | + bottomLeft: $r('app.float.vp_2'), | ||
| 330 | + bottomRight: $r('app.float.vp_2') | ||
| 331 | + }) | ||
| 332 | + .grayscale(this.GrayManage.get().isMourning() ? 1 : 0) | ||
| 333 | + } | ||
| 334 | + } | ||
| 335 | + | ||
| 203 | aboutToAppear() { | 336 | aboutToAppear() { |
| 204 | if (!this.action?.params?.backVisibility) { | 337 | if (!this.action?.params?.backVisibility) { |
| 205 | // WindowModel.shared.setWindowLayoutFullScreen(true) | 338 | // WindowModel.shared.setWindowLayoutFullScreen(true) |
| @@ -68,9 +68,9 @@ export struct Card10Component { | @@ -68,9 +68,9 @@ export struct Card10Component { | ||
| 68 | 68 | ||
| 69 | initHideDetail() { | 69 | initHideDetail() { |
| 70 | const curRouter = router.getState().name; | 70 | const curRouter = router.getState().name; |
| 71 | - if (curRouter === 'MyCollectionListPage') { | ||
| 72 | - this.hideDetail = true; | ||
| 73 | - } | 71 | + // if (curRouter === 'MyCollectionListPage') { |
| 72 | + // this.hideDetail = true; | ||
| 73 | + // } | ||
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | titleInit() { | 76 | titleInit() { |
| @@ -154,7 +154,6 @@ export struct Card10Component { | @@ -154,7 +154,6 @@ export struct Card10Component { | ||
| 154 | .height(40) | 154 | .height(40) |
| 155 | .borderRadius($r('app.float.button_border_radius')) | 155 | .borderRadius($r('app.float.button_border_radius')) |
| 156 | .justifyContent(FlexAlign.Center) | 156 | .justifyContent(FlexAlign.Center) |
| 157 | - .margin({ top: 5 }) | ||
| 158 | .onClick((event: ClickEvent) => { | 157 | .onClick((event: ClickEvent) => { |
| 159 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 158 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 160 | ProcessUtils.processPage(this.contentDTO) | 159 | ProcessUtils.processPage(this.contentDTO) |
| @@ -35,9 +35,9 @@ export struct Card9Component { | @@ -35,9 +35,9 @@ export struct Card9Component { | ||
| 35 | 35 | ||
| 36 | initHideDetail() { | 36 | initHideDetail() { |
| 37 | const curRouter = router.getState().name; | 37 | const curRouter = router.getState().name; |
| 38 | - if (curRouter === 'MyCollectionListPage') { | ||
| 39 | - this.hideDetail = true; | ||
| 40 | - } | 38 | + // if (curRouter === 'MyCollectionListPage') { |
| 39 | + // this.hideDetail = true; | ||
| 40 | + // } | ||
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | //内容浏览Tracking | 43 | //内容浏览Tracking |
| @@ -35,6 +35,8 @@ export class commentListModel extends PageModel { | @@ -35,6 +35,8 @@ export class commentListModel extends PageModel { | ||
| 35 | totalCommentNum: string = '0' | 35 | totalCommentNum: string = '0' |
| 36 | hasNext: number = 0 | 36 | hasNext: number = 0 |
| 37 | list: commentItemModel[] = [] | 37 | list: commentItemModel[] = [] |
| 38 | + hotList: commentItemModel[] = [] // 仅第一页存在 | ||
| 39 | + hotIds: string[] = [] // 仅第一页存在 | ||
| 38 | // constructor(pageNum:number, pageSize:number, totalCount: number, hasNext: number, list: commentItemModel[]) { | 40 | // constructor(pageNum:number, pageSize:number, totalCount: number, hasNext: number, list: commentItemModel[]) { |
| 39 | // super() | 41 | // super() |
| 40 | // this.pageNum = pageNum | 42 | // this.pageNum = pageNum |
| @@ -45,9 +47,16 @@ export class commentListModel extends PageModel { | @@ -45,9 +47,16 @@ export class commentListModel extends PageModel { | ||
| 45 | // } | 47 | // } |
| 46 | } | 48 | } |
| 47 | 49 | ||
| 50 | +export enum CommentItemCustomType { | ||
| 51 | + comment = 0, | ||
| 52 | + newTitle = 1, // 最新评论标题 | ||
| 53 | + hotTitle = 2, // 热门评论标题 | ||
| 54 | + hotComment = 3, | ||
| 55 | +} | ||
| 48 | 56 | ||
| 49 | @Observed | 57 | @Observed |
| 50 | export class commentItemModel { | 58 | export class commentItemModel { |
| 59 | + api_customType: CommentItemCustomType = CommentItemCustomType.comment | ||
| 51 | authorLike: string = '' | 60 | authorLike: string = '' |
| 52 | avatarFrame: string = '' | 61 | avatarFrame: string = '' |
| 53 | checkStatus: string = '' | 62 | checkStatus: string = '' |
| 1 | import { DateTimeUtils, EmitterEventId, EmitterUtils, LazyDataSource, | 1 | import { DateTimeUtils, EmitterEventId, EmitterUtils, LazyDataSource, |
| 2 | PublicDialogManager, | 2 | PublicDialogManager, |
| 3 | StringUtils } from 'wdKit/Index'; | 3 | StringUtils } from 'wdKit/Index'; |
| 4 | -import { commentItemModel, WDPublicUserType } from '../model/CommentModel'; | 4 | +import { CommentItemCustomType, commentItemModel, WDPublicUserType } from '../model/CommentModel'; |
| 5 | import commentViewModel from '../viewmodel/CommentViewModel'; | 5 | import commentViewModel from '../viewmodel/CommentViewModel'; |
| 6 | import { CommentText } from './CommentText'; | 6 | import { CommentText } from './CommentText'; |
| 7 | import { CommentCustomDialog } from './CommentCustomDialog'; | 7 | import { CommentCustomDialog } from './CommentCustomDialog'; |
| @@ -37,6 +37,7 @@ export struct CommentComponent { | @@ -37,6 +37,7 @@ export struct CommentComponent { | ||
| 37 | listScroller: ListScroller = new ListScroller(); // scroller控制器 | 37 | listScroller: ListScroller = new ListScroller(); // scroller控制器 |
| 38 | historyOffset: number = 0; // 上次浏览到列表距离顶端的偏移量offset | 38 | historyOffset: number = 0; // 上次浏览到列表距离顶端的偏移量offset |
| 39 | @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); | 39 | @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); |
| 40 | + firstPageHotIds: string = '' | ||
| 40 | @State dialogController: CustomDialogController | null = null; | 41 | @State dialogController: CustomDialogController | null = null; |
| 41 | // @State private browSingModel: commentListModel = new commentListModel() | 42 | // @State private browSingModel: commentListModel = new commentListModel() |
| 42 | 43 | ||
| @@ -49,6 +50,7 @@ export struct CommentComponent { | @@ -49,6 +50,7 @@ export struct CommentComponent { | ||
| 49 | // 是否在弹框中 | 50 | // 是否在弹框中 |
| 50 | @Provide inDialog: boolean = false | 51 | @Provide inDialog: boolean = false |
| 51 | private dialogBeforeJumpOtherPageAction: () => void = () => {} | 52 | private dialogBeforeJumpOtherPageAction: () => void = () => {} |
| 53 | + private dialogUpdateTitle: (title: string) => void = () => {} | ||
| 52 | 54 | ||
| 53 | // 在自定义组件即将析构销毁时将dialogControlle置空 | 55 | // 在自定义组件即将析构销毁时将dialogControlle置空 |
| 54 | aboutToDisappear() { | 56 | aboutToDisappear() { |
| @@ -99,7 +101,16 @@ export struct CommentComponent { | @@ -99,7 +101,16 @@ export struct CommentComponent { | ||
| 99 | /*一级评论*/ | 101 | /*一级评论*/ |
| 100 | // if (this.publishCommentModel.lastCommentModel) | 102 | // if (this.publishCommentModel.lastCommentModel) |
| 101 | if (this.publishCommentModel.lastCommentModel.parentId == '-1') { | 103 | if (this.publishCommentModel.lastCommentModel.parentId == '-1') { |
| 102 | - this.allDatas.addFirstItem(model) | 104 | + |
| 105 | + let newCommentHeaderIndex = this.indexOfNewCommentHeaderTitle() | ||
| 106 | + if (newCommentHeaderIndex === -1) { | ||
| 107 | + let newCommentTitle = new commentItemModel() | ||
| 108 | + newCommentTitle.api_customType = CommentItemCustomType.newTitle | ||
| 109 | + this.allDatas.addItems([newCommentTitle, model]) | ||
| 110 | + } else { | ||
| 111 | + this.allDatas.addItem(model, newCommentHeaderIndex + 1) | ||
| 112 | + } | ||
| 113 | + | ||
| 103 | } else { | 114 | } else { |
| 104 | //二级评论 | 115 | //二级评论 |
| 105 | this.allDatas.getDataArray().forEach(element => { | 116 | this.allDatas.getDataArray().forEach(element => { |
| @@ -116,14 +127,19 @@ export struct CommentComponent { | @@ -116,14 +127,19 @@ export struct CommentComponent { | ||
| 116 | 127 | ||
| 117 | /*标题:全部评论*/ | 128 | /*标题:全部评论*/ |
| 118 | @Builder | 129 | @Builder |
| 119 | - titleHeader() { | 130 | + titleHeader(title: string = "最新评论", showGapLine: boolean = false) { |
| 131 | + | ||
| 132 | + Column() { | ||
| 133 | + if (showGapLine) { | ||
| 134 | + Divider().strokeWidth(6).color('#f5f5f5') | ||
| 135 | + } | ||
| 120 | 136 | ||
| 121 | Row() { | 137 | Row() { |
| 122 | Row() { | 138 | Row() { |
| 123 | Image($r('app.media.redLine')) | 139 | Image($r('app.media.redLine')) |
| 124 | .height(16) | 140 | .height(16) |
| 125 | .width(3) | 141 | .width(3) |
| 126 | - Text('全部评论') | 142 | + Text(title) |
| 127 | .fontSize(16)// .fontColor('#222222') | 143 | .fontSize(16)// .fontColor('#222222') |
| 128 | .fontColor($r('app.color.color_222222')) | 144 | .fontColor($r('app.color.color_222222')) |
| 129 | .fontWeight(FontWeight.Medium) | 145 | .fontWeight(FontWeight.Medium) |
| @@ -145,12 +161,7 @@ export struct CommentComponent { | @@ -145,12 +161,7 @@ export struct CommentComponent { | ||
| 145 | .height(44) | 161 | .height(44) |
| 146 | .width('100%') | 162 | .width('100%') |
| 147 | .justifyContent(FlexAlign.SpaceBetween) | 163 | .justifyContent(FlexAlign.SpaceBetween) |
| 148 | - .onClick(() => { | ||
| 149 | - // this.allDatas.push(new commentItemModel()) | ||
| 150 | - // this.allDatas.addFirstItem(new commentItemModel()) | ||
| 151 | - // this.allDatas.reloadData(); | ||
| 152 | - }) | ||
| 153 | - | 164 | + } |
| 154 | } | 165 | } |
| 155 | 166 | ||
| 156 | /*1级评论作为titleHeader*/ | 167 | /*1级评论作为titleHeader*/ |
| @@ -177,16 +188,29 @@ export struct CommentComponent { | @@ -177,16 +188,29 @@ export struct CommentComponent { | ||
| 177 | build() { | 188 | build() { |
| 178 | Column() { | 189 | Column() { |
| 179 | List({ scroller: this.listScroller }) { | 190 | List({ scroller: this.listScroller }) { |
| 191 | + if (!this.isComments) { | ||
| 180 | if (this.showTitleComponent) { | 192 | if (this.showTitleComponent) { |
| 181 | ListItemGroup({ header: this.titleHeader() }) | 193 | ListItemGroup({ header: this.titleHeader() }) |
| 182 | } | 194 | } |
| 183 | - | ||
| 184 | - if (!this.isComments) { | ||
| 185 | EmptyComponent({ emptyType: 17 }) | 195 | EmptyComponent({ emptyType: 17 }) |
| 186 | .height(300) | 196 | .height(300) |
| 187 | } else { | 197 | } else { |
| 188 | LazyForEach(this.allDatas, (item: commentItemModel, index: number) => { | 198 | LazyForEach(this.allDatas, (item: commentItemModel, index: number) => { |
| 189 | - if (item.hasMore) { | 199 | + if (item.api_customType === CommentItemCustomType.newTitle) { |
| 200 | + if (this.inDialog && index === 0) { | ||
| 201 | + ListItemGroup() | ||
| 202 | + } else { | ||
| 203 | + ListItemGroup({ header: this.titleHeader("最新评论", index !== 0) }) | ||
| 204 | + } | ||
| 205 | + } | ||
| 206 | + else if (item.api_customType === CommentItemCustomType.hotTitle) { | ||
| 207 | + if (this.inDialog && index === 0) { | ||
| 208 | + ListItemGroup() | ||
| 209 | + } else { | ||
| 210 | + ListItemGroup({ header: this.titleHeader("热门评论") }) | ||
| 211 | + } | ||
| 212 | + } | ||
| 213 | + else if (item.hasMore) { | ||
| 190 | ListItemGroup({ | 214 | ListItemGroup({ |
| 191 | header: this.CommentHeaderItem(item, index), | 215 | header: this.CommentHeaderItem(item, index), |
| 192 | footer: this.GroupFooterView(item, index) | 216 | footer: this.GroupFooterView(item, index) |
| @@ -234,6 +258,9 @@ export struct CommentComponent { | @@ -234,6 +258,9 @@ export struct CommentComponent { | ||
| 234 | } | 258 | } |
| 235 | .scrollBar(BarState.Off) | 259 | .scrollBar(BarState.Off) |
| 236 | .margin({ bottom: 10 }) | 260 | .margin({ bottom: 10 }) |
| 261 | + .onScrollIndex((start) => { | ||
| 262 | + this.updateDialogTitleWithStartIndex(start) | ||
| 263 | + }) | ||
| 237 | .onReachEnd(() => { | 264 | .onReachEnd(() => { |
| 238 | if (!this.fixedHeightMode) { | 265 | if (!this.fixedHeightMode) { |
| 239 | return | 266 | return |
| @@ -252,6 +279,30 @@ export struct CommentComponent { | @@ -252,6 +279,30 @@ export struct CommentComponent { | ||
| 252 | 279 | ||
| 253 | } | 280 | } |
| 254 | 281 | ||
| 282 | + updateDialogTitleWithStartIndex(start: number) { | ||
| 283 | + if (!this.inDialog) { | ||
| 284 | + return | ||
| 285 | + } | ||
| 286 | + if (this.allDatas.size() === 0) { | ||
| 287 | + this.dialogUpdateTitle("评论") | ||
| 288 | + return | ||
| 289 | + } | ||
| 290 | + if (this.allDatas.getFirst().api_customType !== CommentItemCustomType.hotTitle) { | ||
| 291 | + this.dialogUpdateTitle("最新评论") | ||
| 292 | + return | ||
| 293 | + } | ||
| 294 | + let newCommentHeaderIndex = this.indexOfNewCommentHeaderTitle() | ||
| 295 | + if (newCommentHeaderIndex == -1) { | ||
| 296 | + this.dialogUpdateTitle("热门评论") | ||
| 297 | + return | ||
| 298 | + } | ||
| 299 | + if (start < newCommentHeaderIndex + 1) { | ||
| 300 | + this.dialogUpdateTitle("热门评论") | ||
| 301 | + } else { | ||
| 302 | + this.dialogUpdateTitle("最新评论") | ||
| 303 | + } | ||
| 304 | + } | ||
| 305 | + | ||
| 255 | parentOnReachEnd() { | 306 | parentOnReachEnd() { |
| 256 | if (this.fixedHeightMode) { | 307 | if (this.fixedHeightMode) { |
| 257 | return | 308 | return |
| @@ -268,11 +319,41 @@ export struct CommentComponent { | @@ -268,11 +319,41 @@ export struct CommentComponent { | ||
| 268 | //获取数据 | 319 | //获取数据 |
| 269 | async getData() { | 320 | async getData() { |
| 270 | let pageIndex = this.currentPage | 321 | let pageIndex = this.currentPage |
| 271 | - commentViewModel.fetchContentCommentList(pageIndex + '', this.publishCommentModel.targetId, | ||
| 272 | - this.publishCommentModel.targetType) | 322 | + commentViewModel.fetchContentCommentList(pageIndex + '' |
| 323 | + ,this.publishCommentModel.targetId | ||
| 324 | + ,this.publishCommentModel.targetType | ||
| 325 | + ,this.firstPageHotIds) | ||
| 273 | .then(commentListModel => { | 326 | .then(commentListModel => { |
| 274 | console.log('评论:', JSON.stringify(commentListModel.list)) | 327 | console.log('评论:', JSON.stringify(commentListModel.list)) |
| 275 | 328 | ||
| 329 | + if (pageIndex == 1) { | ||
| 330 | + // 保存第一页热门评论ids | ||
| 331 | + if (commentListModel.hotIds.length > 0) { | ||
| 332 | + this.firstPageHotIds = commentListModel.hotIds.join(",") | ||
| 333 | + } | ||
| 334 | + if (commentListModel.list.length > 0) { // 热门评论增加头部 | ||
| 335 | + let newCommentTitle = new commentItemModel() | ||
| 336 | + newCommentTitle.api_customType = CommentItemCustomType.newTitle | ||
| 337 | + let newArray = [newCommentTitle] | ||
| 338 | + commentListModel.list = newArray.concat(commentListModel.list) | ||
| 339 | + } | ||
| 340 | + if (commentListModel.hotList.length > 0) { // 最新评论增加头部 | ||
| 341 | + let hotCommentTitle = new commentItemModel() | ||
| 342 | + hotCommentTitle.api_customType = CommentItemCustomType.hotTitle | ||
| 343 | + let newArray = [hotCommentTitle] | ||
| 344 | + commentListModel.hotList = newArray.concat(commentListModel.hotList) | ||
| 345 | + | ||
| 346 | + commentListModel.list = commentListModel.hotList.concat(commentListModel.list) | ||
| 347 | + } | ||
| 348 | + } else { // 非首页数据 | ||
| 349 | + if (commentListModel.list.length > 0 && !this.hasNewCommentHeaderTitle()) { // 如果之前仅存在热门评论,这里需要补下数据 | ||
| 350 | + let newCommentTitle = new commentItemModel() | ||
| 351 | + newCommentTitle.api_customType = CommentItemCustomType.newTitle | ||
| 352 | + let newArray = [newCommentTitle] | ||
| 353 | + commentListModel.list = newArray.concat(commentListModel.list) | ||
| 354 | + } | ||
| 355 | + } | ||
| 356 | + | ||
| 276 | // 这里需要先赋值,否则下次UI刷新可能重复进入第1页两次 | 357 | // 这里需要先赋值,否则下次UI刷新可能重复进入第1页两次 |
| 277 | this.currentPage = pageIndex + 1 | 358 | this.currentPage = pageIndex + 1 |
| 278 | 359 | ||
| @@ -313,6 +394,29 @@ export struct CommentComponent { | @@ -313,6 +394,29 @@ export struct CommentComponent { | ||
| 313 | } | 394 | } |
| 314 | }) | 395 | }) |
| 315 | } | 396 | } |
| 397 | + | ||
| 398 | + hasNewCommentHeaderTitle() { | ||
| 399 | + let hasNewCommentHeader = false | ||
| 400 | + this.allDatas.getDataArray().forEach((comment) => { | ||
| 401 | + if (comment.api_customType === CommentItemCustomType.newTitle) { | ||
| 402 | + hasNewCommentHeader = true | ||
| 403 | + } | ||
| 404 | + }) | ||
| 405 | + return hasNewCommentHeader | ||
| 406 | + } | ||
| 407 | + | ||
| 408 | + indexOfNewCommentHeaderTitle() { | ||
| 409 | + let resultIndex = -1; | ||
| 410 | + const array = this.allDatas.getDataArray() | ||
| 411 | + for (let index = 0; index < array.length; index++) { | ||
| 412 | + if (array[index].api_customType === CommentItemCustomType.newTitle) { | ||
| 413 | + resultIndex = index; | ||
| 414 | + break | ||
| 415 | + } | ||
| 416 | + } | ||
| 417 | + return resultIndex | ||
| 418 | + } | ||
| 419 | + | ||
| 316 | } | 420 | } |
| 317 | 421 | ||
| 318 | 422 |
| @@ -74,6 +74,7 @@ struct CommentListDialog { | @@ -74,6 +74,7 @@ struct CommentListDialog { | ||
| 74 | /// 内部使用 | 74 | /// 内部使用 |
| 75 | @Link publishCommentModel: publishCommentModel | 75 | @Link publishCommentModel: publishCommentModel |
| 76 | @State private operationButtonList: string[] = [] | 76 | @State private operationButtonList: string[] = [] |
| 77 | + @State title: string = "评论" | ||
| 77 | 78 | ||
| 78 | /// 外部初始化 | 79 | /// 外部初始化 |
| 79 | @Link contentDetailData: ContentDetailDTO // 详情页传 | 80 | @Link contentDetailData: ContentDetailDTO // 详情页传 |
| @@ -122,6 +123,9 @@ struct CommentListDialog { | @@ -122,6 +123,9 @@ struct CommentListDialog { | ||
| 122 | if (this.onClose) { | 123 | if (this.onClose) { |
| 123 | this.onClose() | 124 | this.onClose() |
| 124 | } | 125 | } |
| 126 | + }, | ||
| 127 | + dialogUpdateTitle: (title) => { | ||
| 128 | + this.title = title | ||
| 125 | } | 129 | } |
| 126 | }).layoutWeight(1) | 130 | }).layoutWeight(1) |
| 127 | 131 | ||
| @@ -153,7 +157,7 @@ struct CommentListDialog { | @@ -153,7 +157,7 @@ struct CommentListDialog { | ||
| 153 | Image($r('app.media.redLine')) | 157 | Image($r('app.media.redLine')) |
| 154 | .height(16) | 158 | .height(16) |
| 155 | .width(3) | 159 | .width(3) |
| 156 | - Text('全部评论') | 160 | + Text(this.title) |
| 157 | .fontSize(16)// .fontColor('#222222') | 161 | .fontSize(16)// .fontColor('#222222') |
| 158 | .fontColor($r('app.color.color_222222')) | 162 | .fontColor($r('app.color.color_222222')) |
| 159 | .fontWeight(FontWeight.Medium) | 163 | .fontWeight(FontWeight.Medium) |
| @@ -8,6 +8,7 @@ import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; | @@ -8,6 +8,7 @@ import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; | ||
| 8 | import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 8 | import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 9 | import { TrackConstants, TrackingContent } from 'wdTracking/Index'; | 9 | import { TrackConstants, TrackingContent } from 'wdTracking/Index'; |
| 10 | import { | 10 | import { |
| 11 | + CommentItemCustomType, | ||
| 11 | commentItemModel, | 12 | commentItemModel, |
| 12 | commentListModel, | 13 | commentListModel, |
| 13 | commentStatusListModel, | 14 | commentStatusListModel, |
| @@ -33,9 +34,13 @@ class CommentViewModel { | @@ -33,9 +34,13 @@ class CommentViewModel { | ||
| 33 | } | 34 | } |
| 34 | 35 | ||
| 35 | /*获取所有评论*/ | 36 | /*获取所有评论*/ |
| 36 | - fetchContentCommentList(pageNum: string, contentId: string, contentType: string): Promise<commentListModel> { | 37 | + fetchContentCommentList(pageNum: string, contentId: string, contentType: string, firstPageHotIds: string = ''): Promise<commentListModel> { |
| 37 | 38 | ||
| 38 | let url = HttpUrlUtils.getContentCommentListDataUrl() + `?&pageSize=${10}&pageNum=${pageNum}&contentId=${contentId}&contentType=${contentType}&deviceId=${HttpUtils.getDeviceId()}&userId=${HttpUtils.getUserId()}&userType=${HttpUtils.getUserType()}&time=${DateTimeUtils.getCurTime(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)}` | 39 | let url = HttpUrlUtils.getContentCommentListDataUrl() + `?&pageSize=${10}&pageNum=${pageNum}&contentId=${contentId}&contentType=${contentType}&deviceId=${HttpUtils.getDeviceId()}&userId=${HttpUtils.getUserId()}&userType=${HttpUtils.getUserType()}&time=${DateTimeUtils.getCurTime(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)}` |
| 40 | + url = url + "&hotComment=1" | ||
| 41 | + if (pageNum !== "1" && firstPageHotIds.length > 0) { | ||
| 42 | + url = url + `&hotIds=` + firstPageHotIds | ||
| 43 | + } | ||
| 39 | url = url.replace(' ', '%20') | 44 | url = url.replace(' ', '%20') |
| 40 | 45 | ||
| 41 | return new Promise<commentListModel>((success, fail) => { | 46 | return new Promise<commentListModel>((success, fail) => { |
| @@ -49,10 +54,24 @@ class CommentViewModel { | @@ -49,10 +54,24 @@ class CommentViewModel { | ||
| 49 | return | 54 | return |
| 50 | } | 55 | } |
| 51 | let listData = data.data as commentListModel | 56 | let listData = data.data as commentListModel |
| 52 | - this.fetchCommentStatusAndConfigAuthIcon(listData).then((commentListModel) => { | 57 | + this.fetchCommentStatusAndConfigAuthIcon(listData, false).then((commentListModel) => { |
| 53 | console.log(TAG, 'fetchCommentStatusAndConfigAuthIcon完成') | 58 | console.log(TAG, 'fetchCommentStatusAndConfigAuthIcon完成') |
| 59 | + | ||
| 60 | + if (pageNum !== "1") { | ||
| 61 | + success(commentListModel) | ||
| 62 | + return | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + // 热门评论批查 | ||
| 66 | + this.fetchCommentStatusAndConfigAuthIcon(listData, true).then((commentListModel) => { | ||
| 67 | + console.log(TAG, 'hot comment fetchCommentStatusAndConfigAuthIcon完成') | ||
| 68 | + | ||
| 69 | + listData.hotList.forEach((item) => { | ||
| 70 | + item.api_customType = CommentItemCustomType.hotComment | ||
| 71 | + }) | ||
| 54 | success(commentListModel) | 72 | success(commentListModel) |
| 55 | }) | 73 | }) |
| 74 | + }) | ||
| 56 | 75 | ||
| 57 | }, (error: Error) => { | 76 | }, (error: Error) => { |
| 58 | fail(error.message) | 77 | fail(error.message) |
| @@ -213,7 +232,7 @@ class CommentViewModel { | @@ -213,7 +232,7 @@ class CommentViewModel { | ||
| 213 | } | 232 | } |
| 214 | 233 | ||
| 215 | /*多接口批查*/ | 234 | /*多接口批查*/ |
| 216 | - fetchCommentStatusAndConfigAuthIcon(model: commentListModel): Promise<commentListModel> { | 235 | + fetchCommentStatusAndConfigAuthIcon(model: commentListModel, hot: boolean = false): Promise<commentListModel> { |
| 217 | 236 | ||
| 218 | let commentIDs: string[] = []; | 237 | let commentIDs: string[] = []; |
| 219 | 238 | ||
| @@ -222,7 +241,7 @@ class CommentViewModel { | @@ -222,7 +241,7 @@ class CommentViewModel { | ||
| 222 | let creatorIDs: string[] = []; | 241 | let creatorIDs: string[] = []; |
| 223 | 242 | ||
| 224 | //主评论 | 243 | //主评论 |
| 225 | - for (const element of model.list) { | 244 | + for (const element of (hot ? model.hotList : model.list)) { |
| 226 | if ((element.id + '').length > 0) { | 245 | if ((element.id + '').length > 0) { |
| 227 | commentIDs.push(element.id + '') | 246 | commentIDs.push(element.id + '') |
| 228 | } | 247 | } |
| @@ -277,7 +296,7 @@ class CommentViewModel { | @@ -277,7 +296,7 @@ class CommentViewModel { | ||
| 277 | let listData = data.data as commentStatusModel[] | 296 | let listData = data.data as commentStatusModel[] |
| 278 | //点赞 | 297 | //点赞 |
| 279 | for (const element of listData) { | 298 | for (const element of listData) { |
| 280 | - for (const commentModel of model.list) { | 299 | + for (const commentModel of (hot ? model.hotList : model.list)) { |
| 281 | if (element.commentId == commentModel.id) { | 300 | if (element.commentId == commentModel.id) { |
| 282 | commentModel.api_status = element.status | 301 | commentModel.api_status = element.status |
| 283 | } | 302 | } |
| @@ -319,7 +338,7 @@ class CommentViewModel { | @@ -319,7 +338,7 @@ class CommentViewModel { | ||
| 319 | let listData = data.data as commentStatusModel[] | 338 | let listData = data.data as commentStatusModel[] |
| 320 | 339 | ||
| 321 | for (const element of listData) { | 340 | for (const element of listData) { |
| 322 | - for (const commentModel of model.list) { | 341 | + for (const commentModel of (hot ? model.hotList : model.list)) { |
| 323 | if (element.userId == commentModel.fromUserId) { | 342 | if (element.userId == commentModel.fromUserId) { |
| 324 | commentModel.api_levelHead = element.levelHead | 343 | commentModel.api_levelHead = element.levelHead |
| 325 | } | 344 | } |
| @@ -364,7 +383,7 @@ class CommentViewModel { | @@ -364,7 +383,7 @@ class CommentViewModel { | ||
| 364 | let listData = data.data as commentStatusModel[] | 383 | let listData = data.data as commentStatusModel[] |
| 365 | 384 | ||
| 366 | for (const element of listData) { | 385 | for (const element of listData) { |
| 367 | - for (const commentModel of model.list) { | 386 | + for (const commentModel of (hot ? model.hotList : model.list)) { |
| 368 | if (element.creatorId == commentModel.fromCreatorId) { | 387 | if (element.creatorId == commentModel.fromCreatorId) { |
| 369 | commentModel.api_authIcon = element.authIcon | 388 | commentModel.api_authIcon = element.authIcon |
| 370 | } | 389 | } |
| @@ -400,6 +419,7 @@ class CommentViewModel { | @@ -400,6 +419,7 @@ class CommentViewModel { | ||
| 400 | deepCopyCommentItemModel(model: commentItemModel) { | 419 | deepCopyCommentItemModel(model: commentItemModel) { |
| 401 | let newModel = new commentItemModel() | 420 | let newModel = new commentItemModel() |
| 402 | 421 | ||
| 422 | + newModel.api_customType = model.api_customType | ||
| 403 | newModel.authorLike = model.authorLike | 423 | newModel.authorLike = model.authorLike |
| 404 | newModel.avatarFrame = model.avatarFrame | 424 | newModel.avatarFrame = model.avatarFrame |
| 405 | newModel.checkStatus = model.checkStatus | 425 | newModel.checkStatus = model.checkStatus |
| @@ -214,8 +214,9 @@ struct CarouselLayout01CardView { | @@ -214,8 +214,9 @@ struct CarouselLayout01CardView { | ||
| 214 | colors: [[0x7508111A, 0.0], [0x7508111A, 0.3], [Color.Transparent, 1.0]] | 214 | colors: [[0x7508111A, 0.0], [0x7508111A, 0.3], [Color.Transparent, 1.0]] |
| 215 | }) | 215 | }) |
| 216 | .position({ | 216 | .position({ |
| 217 | - bottom: 10 | 217 | + bottom: 0 |
| 218 | }) | 218 | }) |
| 219 | + .borderRadius($r('app.float.image_border_radius')) | ||
| 219 | } | 220 | } |
| 220 | .width(CommonConstants.FULL_PARENT) | 221 | .width(CommonConstants.FULL_PARENT) |
| 221 | .height(CommonConstants.FULL_PARENT) | 222 | .height(CommonConstants.FULL_PARENT) |
| @@ -14,7 +14,7 @@ const TAG = 'Zh_Single_Column-09' | @@ -14,7 +14,7 @@ const TAG = 'Zh_Single_Column-09' | ||
| 14 | @Entry | 14 | @Entry |
| 15 | @Component | 15 | @Component |
| 16 | export struct ZhSingleColumn09 { | 16 | export struct ZhSingleColumn09 { |
| 17 | - @State fullyTraversed: boolean = false; | 17 | + @State fullyTraversed: boolean = false; //换一换置灰标记 |
| 18 | @State private pageModel: PageModel = new PageModel(); | 18 | @State private pageModel: PageModel = new PageModel(); |
| 19 | @State pageId: string = ''; | 19 | @State pageId: string = ''; |
| 20 | @State pageName: string = ''; | 20 | @State pageName: string = ''; |
| @@ -26,11 +26,46 @@ export struct ZhSingleColumn09 { | @@ -26,11 +26,46 @@ export struct ZhSingleColumn09 { | ||
| 26 | @State compIndex: number = 0; | 26 | @State compIndex: number = 0; |
| 27 | @State currentOperDataListIndex: number = 0; //记录换一换点击次数 | 27 | @State currentOperDataListIndex: number = 0; //记录换一换点击次数 |
| 28 | @State visitedIndices: Set<number> = new Set<number>(); | 28 | @State visitedIndices: Set<number> = new Set<number>(); |
| 29 | + private currentIndex: number = 0; | ||
| 30 | + @State currentDataList: ContentDTO[] = [] | ||
| 29 | 31 | ||
| 30 | async aboutToAppear(): Promise<void> { | 32 | async aboutToAppear(): Promise<void> { |
| 31 | this.loadImg = await onlyWifiLoadImg(); | 33 | this.loadImg = await onlyWifiLoadImg(); |
| 32 | - this.operDataList = this.shuffleArray(this.compDTO?.operDataList) | 34 | + // this.operDataList = this.shuffleArray(this.compDTO?.operDataList) |
| 35 | + this.operDataList = this.padData(this.compDTO?.operDataList) | ||
| 33 | this.currentOperDataListIndex = this.compDTO?.operDataList.length | 36 | this.currentOperDataListIndex = this.compDTO?.operDataList.length |
| 37 | + this.currentDataList = this.getNextBatch() | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * 若数据不满足8个以上直接返回 | ||
| 42 | + * 若最后一屏不够补齐至8个 | ||
| 43 | + * */ | ||
| 44 | + private padData(data: ContentDTO[]): ContentDTO[] { | ||
| 45 | + if (data.length < 9) { | ||
| 46 | + return data | ||
| 47 | + } | ||
| 48 | + const remainder = data.length % 8; | ||
| 49 | + if (remainder === 0) { | ||
| 50 | + return data; | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + const paddingCount = 8 - remainder; | ||
| 54 | + const padding = data.slice(0, paddingCount); | ||
| 55 | + | ||
| 56 | + return [...data, ...padding]; | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + /** | ||
| 60 | + * 换一换切换数据 | ||
| 61 | + * */ | ||
| 62 | + public getNextBatch(): ContentDTO[] { | ||
| 63 | + const batch = this.operDataList.slice(this.currentIndex, this.currentIndex + 8); | ||
| 64 | + this.currentIndex += 8; | ||
| 65 | + if (this.currentIndex >= this.operDataList.length) { | ||
| 66 | + this.fullyTraversed = true //数据展现完毕,置灰标记 | ||
| 67 | + } | ||
| 68 | + return batch; | ||
| 34 | } | 69 | } |
| 35 | 70 | ||
| 36 | trackClick(type: 'close_interest_card_click' | 'interest_card_selecting_click') { | 71 | trackClick(type: 'close_interest_card_click' | 'interest_card_selecting_click') { |
| @@ -142,8 +177,8 @@ export struct ZhSingleColumn09 { | @@ -142,8 +177,8 @@ export struct ZhSingleColumn09 { | ||
| 142 | .justifyContent(FlexAlign.SpaceBetween) | 177 | .justifyContent(FlexAlign.SpaceBetween) |
| 143 | .width('100%') | 178 | .width('100%') |
| 144 | 179 | ||
| 145 | - Flex({wrap: FlexWrap.Wrap}) { | ||
| 146 | - ForEach(this.operDataList.slice(0, 8), (item: ContentDTO, index: number) => { | 180 | + Flex({ wrap: FlexWrap.Wrap }) { |
| 181 | + ForEach(this.currentDataList, (item: ContentDTO, index: number) => { | ||
| 147 | Row() { | 182 | Row() { |
| 148 | Stack({ alignContent: Alignment.TopEnd }) { | 183 | Stack({ alignContent: Alignment.TopEnd }) { |
| 149 | Image(this.loadImg ? item.coverUrl : '') | 184 | Image(this.loadImg ? item.coverUrl : '') |
| @@ -156,7 +191,7 @@ export struct ZhSingleColumn09 { | @@ -156,7 +191,7 @@ export struct ZhSingleColumn09 { | ||
| 156 | .width('100%') | 191 | .width('100%') |
| 157 | .height('100%') | 192 | .height('100%') |
| 158 | .backgroundColor('rgba(0, 0, 0, 1)') | 193 | .backgroundColor('rgba(0, 0, 0, 1)') |
| 159 | - .opacity(0.4) | 194 | + .opacity(this.activeIndexs.includes(index) ? 0.8 : 0.4) |
| 160 | .borderRadius(3) | 195 | .borderRadius(3) |
| 161 | 196 | ||
| 162 | Text(item.newsTitle) | 197 | Text(item.newsTitle) |
| @@ -204,10 +239,14 @@ export struct ZhSingleColumn09 { | @@ -204,10 +239,14 @@ export struct ZhSingleColumn09 { | ||
| 204 | return | 239 | return |
| 205 | } | 240 | } |
| 206 | if (this.compDTO?.operDataList.length > 8) { | 241 | if (this.compDTO?.operDataList.length > 8) { |
| 207 | - this.operDataList = this.shuffleArray(this.operDataList) | 242 | + // this.operDataList = this.shuffleArray(this.operDataList) |
| 208 | // if (this.pageModel) { | 243 | // if (this.pageModel) { |
| 209 | // this.pageModel.compList.deleteItem(this.compIndex) | 244 | // this.pageModel.compList.deleteItem(this.compIndex) |
| 210 | // } | 245 | // } |
| 246 | + if (this.fullyTraversed) { | ||
| 247 | + return; // 所有数据已取完 | ||
| 248 | + } | ||
| 249 | + this.currentDataList = this.getNextBatch() | ||
| 211 | this.activeIndexs = []; | 250 | this.activeIndexs = []; |
| 212 | } | 251 | } |
| 213 | }) | 252 | }) |
| @@ -60,17 +60,19 @@ export struct ZhSingleRow02 { | @@ -60,17 +60,19 @@ export struct ZhSingleRow02 { | ||
| 60 | 60 | ||
| 61 | toMore() { | 61 | toMore() { |
| 62 | if (this.moreWidth > this.initMoreWidth * 2) { | 62 | if (this.moreWidth > this.initMoreWidth * 2) { |
| 63 | - if (this.compDTO?.objectType === '11') { | ||
| 64 | - ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle) | ||
| 65 | - } else { | ||
| 66 | - const contentDTO: ContentDTO = { | ||
| 67 | - objectId: this.compDTO.objectId, | ||
| 68 | - objectType: this.compDTO.objectType, | ||
| 69 | - linkUrl: this.compDTO.linkUrl, | ||
| 70 | - pageId: this.compDTO.pageId | ||
| 71 | - } as ContentDTO | ||
| 72 | - ProcessUtils.processPage(contentDTO) | ||
| 73 | - } | 63 | + |
| 64 | + ProcessUtils.compJumpPage(this.compDTO) | ||
| 65 | + // if (this.compDTO?.objectType === '11') { | ||
| 66 | + // ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle) | ||
| 67 | + // } else { | ||
| 68 | + // const contentDTO: ContentDTO = { | ||
| 69 | + // objectId: this.compDTO.objectId, | ||
| 70 | + // objectType: this.compDTO.objectType, | ||
| 71 | + // linkUrl: this.compDTO.linkUrl, | ||
| 72 | + // pageId: this.compDTO.pageId | ||
| 73 | + // } as ContentDTO | ||
| 74 | + // ProcessUtils.processPage(contentDTO) | ||
| 75 | + // } | ||
| 74 | } | 76 | } |
| 75 | } | 77 | } |
| 76 | 78 |
| @@ -372,7 +372,7 @@ export struct ZhSingleRow03 { | @@ -372,7 +372,7 @@ export struct ZhSingleRow03 { | ||
| 372 | }) | 372 | }) |
| 373 | 373 | ||
| 374 | Text(item.newsTitle) | 374 | Text(item.newsTitle) |
| 375 | - .width(201) | 375 | + .width('calc(100% - 106vp - 12vp)') |
| 376 | .height(60) | 376 | .height(60) |
| 377 | .maxLines(3) | 377 | .maxLines(3) |
| 378 | .textOverflow({overflow: TextOverflow.Ellipsis}) | 378 | .textOverflow({overflow: TextOverflow.Ellipsis}) |
| @@ -380,6 +380,7 @@ export struct ZhSingleRow03 { | @@ -380,6 +380,7 @@ export struct ZhSingleRow03 { | ||
| 380 | } | 380 | } |
| 381 | .margin({bottom: 16}) | 381 | .margin({bottom: 16}) |
| 382 | .justifyContent(FlexAlign.Start) | 382 | .justifyContent(FlexAlign.Start) |
| 383 | + .width('100%') | ||
| 383 | 384 | ||
| 384 | Row() { | 385 | Row() { |
| 385 | Flex({justifyContent: FlexAlign.SpaceBetween}){ | 386 | Flex({justifyContent: FlexAlign.SpaceBetween}){ |
| @@ -474,17 +475,19 @@ export struct ZhSingleRow03 { | @@ -474,17 +475,19 @@ export struct ZhSingleRow03 { | ||
| 474 | } | 475 | } |
| 475 | 476 | ||
| 476 | private jumpToMore() { | 477 | private jumpToMore() { |
| 477 | - if (this.compDTO.linkUrl) { | ||
| 478 | - let taskAction: Action = { | ||
| 479 | - type: 'JUMP_H5_BY_WEB_VIEW', | ||
| 480 | - params: { | ||
| 481 | - url: this.compDTO.linkUrl | ||
| 482 | - } as Params, | ||
| 483 | - }; | ||
| 484 | - WDRouterRule.jumpWithAction(taskAction) | ||
| 485 | - } else { | ||
| 486 | - this.jumpToLiveMorePage() | ||
| 487 | - } | 478 | + ProcessUtils.compJumpPage(this.compDTO) |
| 479 | + return; | ||
| 480 | + // if (this.compDTO.linkUrl) { | ||
| 481 | + // let taskAction: Action = { | ||
| 482 | + // type: 'JUMP_H5_BY_WEB_VIEW', | ||
| 483 | + // params: { | ||
| 484 | + // url: this.compDTO.linkUrl | ||
| 485 | + // } as Params, | ||
| 486 | + // }; | ||
| 487 | + // WDRouterRule.jumpWithAction(taskAction) | ||
| 488 | + // } else { | ||
| 489 | + // this.jumpToLiveMorePage() | ||
| 490 | + // } | ||
| 488 | } | 491 | } |
| 489 | 492 | ||
| 490 | } | 493 | } |
| @@ -60,7 +60,8 @@ export struct ZhSingleRow04 { | @@ -60,7 +60,8 @@ export struct ZhSingleRow04 { | ||
| 60 | .margin({ bottom: 8 }) | 60 | .margin({ bottom: 8 }) |
| 61 | .width('100%') | 61 | .width('100%') |
| 62 | .padding({ | 62 | .padding({ |
| 63 | - right: 10 | 63 | + left: 16, |
| 64 | + right: 16 | ||
| 64 | }) | 65 | }) |
| 65 | 66 | ||
| 66 | // 列表内容 | 67 | // 列表内容 |
| @@ -74,7 +75,7 @@ export struct ZhSingleRow04 { | @@ -74,7 +75,7 @@ export struct ZhSingleRow04 { | ||
| 74 | ) | 75 | ) |
| 75 | .margin({ | 76 | .margin({ |
| 76 | right: index === this.compDTO.operDataList.length - 1 ? 26 : 0, | 77 | right: index === this.compDTO.operDataList.length - 1 ? 26 : 0, |
| 77 | - left: index === 0 ? 2 : 0, | 78 | + left: index === 0 ? 16 : 0, |
| 78 | top: 6 | 79 | top: 6 |
| 79 | }) | 80 | }) |
| 80 | .onClick(() => { | 81 | .onClick(() => { |
| @@ -92,7 +93,7 @@ export struct ZhSingleRow04 { | @@ -92,7 +93,7 @@ export struct ZhSingleRow04 { | ||
| 92 | } | 93 | } |
| 93 | .width(CommonConstants.FULL_WIDTH) | 94 | .width(CommonConstants.FULL_WIDTH) |
| 94 | .padding({ | 95 | .padding({ |
| 95 | - left: 10, | 96 | + left: 0, |
| 96 | right: 0, | 97 | right: 0, |
| 97 | top: $r('app.float.card_comp_pagePadding_tb'), | 98 | top: $r('app.float.card_comp_pagePadding_tb'), |
| 98 | bottom: $r('app.float.card_comp_pagePadding_tb') | 99 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| @@ -37,6 +37,6 @@ struct FollowListPage { | @@ -37,6 +37,6 @@ struct FollowListPage { | ||
| 37 | .width('100%') | 37 | .width('100%') |
| 38 | }.width("100%") | 38 | }.width("100%") |
| 39 | .height("100%") | 39 | .height("100%") |
| 40 | - .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)}) | 40 | + .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)+10}) |
| 41 | } | 41 | } |
| 42 | } | 42 | } |
| 1 | import { PeopleShipRecommendComponent } from './PeopleShipRecommendComponent'; | 1 | import { PeopleShipRecommendComponent } from './PeopleShipRecommendComponent'; |
| 2 | import { PeopleShipMainViewModel } from '../../viewmodel/PeopleShipMainViewModel'; | 2 | import { PeopleShipMainViewModel } from '../../viewmodel/PeopleShipMainViewModel'; |
| 3 | import { HttpUtils } from 'wdNetwork/Index'; | 3 | import { HttpUtils } from 'wdNetwork/Index'; |
| 4 | -import { Logger, DateTimeUtils, EmitterEventId, EmitterUtils } from 'wdKit'; | 4 | +import { Logger, DateTimeUtils, EmitterEventId, EmitterUtils, ToastUtils } from 'wdKit'; |
| 5 | import { autoRefresh, onActionEnd, onActionStart, onActionUpdate,closeRefresh } from '../../utils/NewPullDownRefresh'; | 5 | import { autoRefresh, onActionEnd, onActionStart, onActionUpdate,closeRefresh } from '../../utils/NewPullDownRefresh'; |
| 6 | 6 | ||
| 7 | import { | 7 | import { |
| @@ -88,27 +88,31 @@ export struct PeopleShipMainComponent { | @@ -88,27 +88,31 @@ export struct PeopleShipMainComponent { | ||
| 88 | Column(){ | 88 | Column(){ |
| 89 | if (this.viewType == ViewType.LOADING) { | 89 | if (this.viewType == ViewType.LOADING) { |
| 90 | this.LoadingLayout() | 90 | this.LoadingLayout() |
| 91 | - } else if (this.viewType == ViewType.ERROR) { | ||
| 92 | - //缺省页 | ||
| 93 | - EmptyComponent({ | ||
| 94 | - emptyType: this.pageModel.emptyType, | ||
| 95 | - emptyButton: true, | ||
| 96 | - retry: () => { | ||
| 97 | - this.getData() | ||
| 98 | - } | ||
| 99 | - }) | ||
| 100 | - .grayscale(this.GrayManage.get().isRmhMourning(`${this.channelId}`) ? 1 : 0) | ||
| 101 | - } else if (this.viewType == ViewType.EMPTY) { | ||
| 102 | - //缺省页 | ||
| 103 | - EmptyComponent({ | ||
| 104 | - emptyType: this.pageModel.emptyType, | ||
| 105 | - emptyButton: true, | ||
| 106 | - retry: () => { | ||
| 107 | - this.getData() | ||
| 108 | } | 91 | } |
| 109 | - }) | ||
| 110 | - .grayscale(this.GrayManage.get().isRmhMourning(`${this.channelId}`) ? 1 : 0) | ||
| 111 | - }else { | 92 | + // else if (this.viewType == ViewType.ERROR) { |
| 93 | + // //缺省页 | ||
| 94 | + // // EmptyComponent({ | ||
| 95 | + // // emptyType: this.pageModel.emptyType, | ||
| 96 | + // // emptyButton: true, | ||
| 97 | + // // retry: () => { | ||
| 98 | + // // this.getData() | ||
| 99 | + // // } | ||
| 100 | + // // }) | ||
| 101 | + // // .grayscale(this.GrayManage.get().isRmhMourning(`${this.channelId}`) ? 1 : 0) | ||
| 102 | + // | ||
| 103 | + // } else if (this.viewType == ViewType.EMPTY) { | ||
| 104 | + // // //缺省页 | ||
| 105 | + // // EmptyComponent({ | ||
| 106 | + // // emptyType: this.pageModel.emptyType, | ||
| 107 | + // // emptyButton: true, | ||
| 108 | + // // retry: () => { | ||
| 109 | + // // this.getData() | ||
| 110 | + // // } | ||
| 111 | + // // }) | ||
| 112 | + // // .grayscale(this.GrayManage.get().isRmhMourning(`${this.channelId}`) ? 1 : 0) | ||
| 113 | + // | ||
| 114 | + // } | ||
| 115 | + else { | ||
| 112 | if (this.followList.length == 0) { | 116 | if (this.followList.length == 0) { |
| 113 | this.ListLayout() | 117 | this.ListLayout() |
| 114 | } else { | 118 | } else { |
| @@ -328,7 +332,7 @@ export struct PeopleShipMainComponent { | @@ -328,7 +332,7 @@ export struct PeopleShipMainComponent { | ||
| 328 | // 获取用户关注人数 | 332 | // 获取用户关注人数 |
| 329 | let object = new FollowListDetailRequestItem(-1, 20, 1) | 333 | let object = new FollowListDetailRequestItem(-1, 20, 1) |
| 330 | let followInfo = await MinePageDatasModel.getMineFollowListData(object, getContext(this)) | 334 | let followInfo = await MinePageDatasModel.getMineFollowListData(object, getContext(this)) |
| 331 | - Logger.debug('PeopleShipMainComponent', '获取页面信息' + `${JSON.stringify(followInfo)}`) | 335 | + // Logger.debug('PeopleShipMainComponent', '获取页面信息' + `${JSON.stringify(followInfo)}`) |
| 332 | 336 | ||
| 333 | if (followInfo.list.length == 0) { | 337 | if (followInfo.list.length == 0) { |
| 334 | this.followList = [] | 338 | this.followList = [] |
| @@ -347,6 +351,7 @@ export struct PeopleShipMainComponent { | @@ -347,6 +351,7 @@ export struct PeopleShipMainComponent { | ||
| 347 | } catch (exception) { | 351 | } catch (exception) { |
| 348 | this.viewType = ViewType.ERROR | 352 | this.viewType = ViewType.ERROR |
| 349 | this.isLoading = false | 353 | this.isLoading = false |
| 354 | + ToastUtils.shortToast('加载失败,请稍后重试') | ||
| 350 | } | 355 | } |
| 351 | } | 356 | } |
| 352 | 357 | ||
| @@ -362,11 +367,14 @@ export struct PeopleShipMainComponent { | @@ -362,11 +367,14 @@ export struct PeopleShipMainComponent { | ||
| 362 | this.viewType = ViewType.LOADED | 367 | this.viewType = ViewType.LOADED |
| 363 | this.changeButton = false | 368 | this.changeButton = false |
| 364 | this.isLoading = false | 369 | this.isLoading = false |
| 365 | - Logger.debug('PeopleShipMainComponent', 'getRmhRecommendInfo' + `${JSON.stringify(this.rmhList)}`) | 370 | + // Logger.debug('PeopleShipMainComponent', 'getRmhRecommendInfo' + `${JSON.stringify(this.rmhList)}`) |
| 366 | if (resolve) { | 371 | if (resolve) { |
| 367 | resolve('已更新至最新') | 372 | resolve('已更新至最新') |
| 368 | } | 373 | } |
| 369 | this.closeRefresh(true) | 374 | this.closeRefresh(true) |
| 375 | + if(this.rmhList?.length! === 0) { | ||
| 376 | + ToastUtils.shortToast('加载失败,请稍后重试') | ||
| 377 | + } | ||
| 370 | } catch (exception) { | 378 | } catch (exception) { |
| 371 | if (resolve) { | 379 | if (resolve) { |
| 372 | resolve('') | 380 | resolve('') |
| @@ -375,6 +383,7 @@ export struct PeopleShipMainComponent { | @@ -375,6 +383,7 @@ export struct PeopleShipMainComponent { | ||
| 375 | this.viewType = ViewType.ERROR | 383 | this.viewType = ViewType.ERROR |
| 376 | this.changeButton = false | 384 | this.changeButton = false |
| 377 | this.isLoading = false | 385 | this.isLoading = false |
| 386 | + ToastUtils.shortToast('加载失败,请稍后重试') | ||
| 378 | } | 387 | } |
| 379 | } | 388 | } |
| 380 | 389 | ||
| @@ -390,7 +399,7 @@ export struct PeopleShipMainComponent { | @@ -390,7 +399,7 @@ export struct PeopleShipMainComponent { | ||
| 390 | try { | 399 | try { |
| 391 | // 获取列表数据 | 400 | // 获取列表数据 |
| 392 | let listData = await PeopleShipMainViewModel.getAttentionContentListInfo(this.currentPage, 20, this.loadTime) | 401 | let listData = await PeopleShipMainViewModel.getAttentionContentListInfo(this.currentPage, 20, this.loadTime) |
| 393 | - Logger.debug('PeopleShipMainComponent', '获取页面信息' + `${JSON.stringify(listData)}`) | 402 | + // Logger.debug('PeopleShipMainComponent', '获取页面信息' + `${JSON.stringify(listData)}`) |
| 394 | if (listData && listData.list && listData.list.length > 0) { | 403 | if (listData && listData.list && listData.list.length > 0) { |
| 395 | if (listData.list.length === 20) { | 404 | if (listData.list.length === 20) { |
| 396 | this.hasMore = true; | 405 | this.hasMore = true; |
| @@ -429,7 +438,7 @@ export struct PeopleShipMainComponent { | @@ -429,7 +438,7 @@ export struct PeopleShipMainComponent { | ||
| 429 | }) | 438 | }) |
| 430 | 439 | ||
| 431 | let listData = await PeopleShipMainViewModel.getContentInteractInfo(params) | 440 | let listData = await PeopleShipMainViewModel.getContentInteractInfo(params) |
| 432 | - Logger.debug('PeopleShipMainComponent', '获取页面信息' + `${JSON.stringify(listData)}`) | 441 | + // Logger.debug('PeopleShipMainComponent', '获取页面信息' + `${JSON.stringify(listData)}`) |
| 433 | this.resolveEnd(true, resolve) | 442 | this.resolveEnd(true, resolve) |
| 434 | 443 | ||
| 435 | if (this.currentPage == 1) { | 444 | if (this.currentPage == 1) { |
| @@ -481,6 +490,7 @@ export struct PeopleShipMainComponent { | @@ -481,6 +490,7 @@ export struct PeopleShipMainComponent { | ||
| 481 | } | 490 | } |
| 482 | if (this.currentPage == 1 && !isTop) { | 491 | if (this.currentPage == 1 && !isTop) { |
| 483 | this.viewType = ViewType.ERROR | 492 | this.viewType = ViewType.ERROR |
| 493 | + ToastUtils.shortToast('加载失败,请稍后重试') | ||
| 484 | } else { | 494 | } else { |
| 485 | this.viewType = ViewType.LOADED | 495 | this.viewType = ViewType.LOADED |
| 486 | } | 496 | } |
| @@ -489,8 +499,8 @@ export struct PeopleShipMainComponent { | @@ -489,8 +499,8 @@ export struct PeopleShipMainComponent { | ||
| 489 | 499 | ||
| 490 | // 说是首页必须要调用 | 500 | // 说是首页必须要调用 |
| 491 | async getInitData() { | 501 | async getInitData() { |
| 492 | - Logger.debug('PeopleShipMainComponent', | ||
| 493 | - `getData id: ${this.pageId} , ${this.channelId} , navIndex: ${this.currentTopNavSelectedIndex}`); | 502 | + // Logger.debug('PeopleShipMainComponent', |
| 503 | + // `getData id: ${this.pageId} , ${this.channelId} , navIndex: ${this.currentTopNavSelectedIndex}`); | ||
| 494 | this.pageModel.pageId = this.pageId; | 504 | this.pageModel.pageId = this.pageId; |
| 495 | this.pageModel.groupId = this.pageId; | 505 | this.pageModel.groupId = this.pageId; |
| 496 | this.pageModel.channelId = this.channelId; | 506 | this.pageModel.channelId = this.channelId; |
| @@ -526,7 +536,7 @@ export struct PeopleShipMainComponent { | @@ -526,7 +536,7 @@ export struct PeopleShipMainComponent { | ||
| 526 | objects.creators.push(creator) | 536 | objects.creators.push(creator) |
| 527 | } | 537 | } |
| 528 | }) | 538 | }) |
| 529 | - Logger.debug('PeopleShipMainComponent', `一键关注接口参数: ${JSON.stringify(objects)}`); | 539 | + // Logger.debug('PeopleShipMainComponent', `一键关注接口参数: ${JSON.stringify(objects)}`); |
| 530 | let batchInfo = await PeopleShipMainViewModel.getAttentionBatchInfo(objects) | 540 | let batchInfo = await PeopleShipMainViewModel.getAttentionBatchInfo(objects) |
| 531 | this.oneKeyFollow = false | 541 | this.oneKeyFollow = false |
| 532 | if (batchInfo.code === 0 || batchInfo.code.toString() === "0") { | 542 | if (batchInfo.code === 0 || batchInfo.code.toString() === "0") { |
| @@ -556,7 +566,7 @@ export struct PeopleShipMainComponent { | @@ -556,7 +566,7 @@ export struct PeopleShipMainComponent { | ||
| 556 | return | 566 | return |
| 557 | } | 567 | } |
| 558 | // 当前页面,自动刷新数据 | 568 | // 当前页面,自动刷新数据 |
| 559 | - Logger.debug(TAG, 'page onAutoRefresh ' + this.autoRefresh) | 569 | + // Logger.debug(TAG, 'page onAutoRefresh ' + this.autoRefresh) |
| 560 | this.listScroller.scrollToIndex(0) | 570 | this.listScroller.scrollToIndex(0) |
| 561 | autoRefresh(this.pageModel,this.onRefresh) | 571 | autoRefresh(this.pageModel,this.onRefresh) |
| 562 | } | 572 | } |
| @@ -475,7 +475,7 @@ export struct SearchResultContentComponent { | @@ -475,7 +475,7 @@ export struct SearchResultContentComponent { | ||
| 475 | contentDTO.coverSize = "" | 475 | contentDTO.coverSize = "" |
| 476 | contentDTO.coverType = value.data.type == "5" ? 1 : -1 | 476 | contentDTO.coverType = value.data.type == "5" ? 1 : -1 |
| 477 | contentDTO.coverUrl = | 477 | contentDTO.coverUrl = |
| 478 | - this.searchType == "activity" ? value.data.zhChannelPageImg : value.data.appStyleImages.split("&&")[0]; | 478 | + this.searchType == "activity" ? value.data.zhChannelPageImg : value.data.appStyleImages.split("&&")[0].split('?')[0]; |
| 479 | contentDTO.description = value.data.description | 479 | contentDTO.description = value.data.description |
| 480 | contentDTO.districtCode = value.data.districtCode | 480 | contentDTO.districtCode = value.data.districtCode |
| 481 | contentDTO.endTime = value.data.endTime | 481 | contentDTO.endTime = value.data.endTime |
| @@ -515,7 +515,7 @@ export struct SearchResultContentComponent { | @@ -515,7 +515,7 @@ export struct SearchResultContentComponent { | ||
| 515 | contentDTO.visitorComment = -1 | 515 | contentDTO.visitorComment = -1 |
| 516 | contentDTO.fullColumnImgUrls = photos | 516 | contentDTO.fullColumnImgUrls = photos |
| 517 | contentDTO.newsSummary = "" | 517 | contentDTO.newsSummary = "" |
| 518 | - contentDTO.hasMore = -1 | 518 | + contentDTO.hasMore = this.hasMore ? 1 : -1 |
| 519 | contentDTO.slideShows = [] | 519 | contentDTO.slideShows = [] |
| 520 | contentDTO.voiceInfo = {} as VoiceInfoDTO | 520 | contentDTO.voiceInfo = {} as VoiceInfoDTO |
| 521 | contentDTO.tagWord = -1 | 521 | contentDTO.tagWord = -1 |
| @@ -74,7 +74,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { | @@ -74,7 +74,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { | ||
| 74 | .onClick(() => { | 74 | .onClick(() => { |
| 75 | InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[0], this.pageId, this.pageName) | 75 | InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[0], this.pageId, this.pageName) |
| 76 | this.clicked = true; | 76 | this.clicked = true; |
| 77 | - ProcessUtils.gotoLive(this.compDTO?.operDataList[0]) | 77 | + ProcessUtils.processPage(this.compDTO?.operDataList[0]) |
| 78 | }) | 78 | }) |
| 79 | } | 79 | } |
| 80 | 80 |
| @@ -65,11 +65,9 @@ export struct LiveHorizontalCardComponent { | @@ -65,11 +65,9 @@ export struct LiveHorizontalCardComponent { | ||
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | liveToMore() { | 67 | liveToMore() { |
| 68 | + ProcessUtils.compJumpPage(this.compDTO) | ||
| 69 | + return; | ||
| 68 | if (!!this.compDTO.dataSourceType) { | 70 | if (!!this.compDTO.dataSourceType) { |
| 69 | - // if (this.compDTO.dataSourceType === 'OBJECT_POS') { | ||
| 70 | - // ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle) | ||
| 71 | - // return; | ||
| 72 | - // } | ||
| 73 | if (this.compDTO.linkUrl) { | 71 | if (this.compDTO.linkUrl) { |
| 74 | let taskAction: Action = { | 72 | let taskAction: Action = { |
| 75 | type: 'JUMP_INNER_NEW_PAGE', | 73 | type: 'JUMP_INNER_NEW_PAGE', |
| @@ -84,14 +82,8 @@ export struct LiveHorizontalCardComponent { | @@ -84,14 +82,8 @@ export struct LiveHorizontalCardComponent { | ||
| 84 | } | 82 | } |
| 85 | } as Params, | 83 | } as Params, |
| 86 | }; | 84 | }; |
| 87 | - // this.compDTO.operDataList = [] | ||
| 88 | - // console.log('LiveHorizontalCardComponent', JSON.stringify(this.compDTO)) | ||
| 89 | - // console.log('LiveHorizontalCardComponent', this.compDTO.relId) | ||
| 90 | - // console.log('LiveHorizontalCardComponent', this.compDTO.relType) | ||
| 91 | - // console.log('LiveHorizontalCardComponent', JSON.stringify(taskAction)) | ||
| 92 | WDRouterRule.jumpWithAction(taskAction) | 85 | WDRouterRule.jumpWithAction(taskAction) |
| 93 | } else { | 86 | } else { |
| 94 | - // console.log('LiveHorizontalCardComponent', 'jumpToLiveMorePage') | ||
| 95 | this.jumpToLiveMorePage() | 87 | this.jumpToLiveMorePage() |
| 96 | } | 88 | } |
| 97 | } else { | 89 | } else { |
| @@ -103,7 +95,6 @@ export struct LiveHorizontalCardComponent { | @@ -103,7 +95,6 @@ export struct LiveHorizontalCardComponent { | ||
| 103 | linkUrl: this.compDTO.linkUrl, | 95 | linkUrl: this.compDTO.linkUrl, |
| 104 | pageId: this.compDTO.pageId | 96 | pageId: this.compDTO.pageId |
| 105 | } as ContentDTO | 97 | } as ContentDTO |
| 106 | - // console.log('LiveHorizontalCardComponent', 'ProcessUtils.processPage') | ||
| 107 | ProcessUtils.processPage(contentDTO) | 98 | ProcessUtils.processPage(contentDTO) |
| 108 | } | 99 | } |
| 109 | } | 100 | } |
| @@ -242,7 +242,7 @@ export struct LiveOperRowListView { | @@ -242,7 +242,7 @@ export struct LiveOperRowListView { | ||
| 242 | } | 242 | } |
| 243 | .padding({top:10}) | 243 | .padding({top:10}) |
| 244 | .layoutWeight(1) | 244 | .layoutWeight(1) |
| 245 | - .margin({ left: 16 }) | 245 | + .margin({ left: 0 }) |
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | /** | 248 | /** |
| @@ -815,6 +815,7 @@ class MinePageDatasModel{ | @@ -815,6 +815,7 @@ class MinePageDatasModel{ | ||
| 815 | contentDTO.source = StringUtils.isEmpty(value.creatorName) ? value.sourceName : value.creatorName | 815 | contentDTO.source = StringUtils.isEmpty(value.creatorName) ? value.sourceName : value.creatorName |
| 816 | contentDTO.objectId = value.id | 816 | contentDTO.objectId = value.id |
| 817 | contentDTO.objectType = value.type | 817 | contentDTO.objectType = value.type |
| 818 | + contentDTO.objectLevel = value.topicType | ||
| 818 | contentDTO.channelId = value.channelId | 819 | contentDTO.channelId = value.channelId |
| 819 | contentDTO.relId = value.relId | 820 | contentDTO.relId = value.relId |
| 820 | contentDTO.relType = value.relType | 821 | contentDTO.relType = value.relType |
| 1 | +import { http } from '@kit.NetworkKit'; | ||
| 2 | + | ||
| 3 | +const TAG = 'httpRequestInStream' | ||
| 4 | +export class httpRequest { | ||
| 5 | + // 大于5M的下载请求,使用流下载 | ||
| 6 | + /** | ||
| 7 | + * 发起HTTP请求以下载图片资源 | ||
| 8 | + * @param {string} imageUrl 图片的URL | ||
| 9 | + * @param {Function} onSuccess 成功回调函数 | ||
| 10 | + * @param {Function} onError 失败回调函数 | ||
| 11 | + */ | ||
| 12 | + public static httpRequestInStream(imageUrl:string, onSuccess:Function, onError:Function) { | ||
| 13 | + // 每一个httpRequest对应一个HTTP请求任务,不可复用 | ||
| 14 | + const httpRequest = http.createHttp(); | ||
| 15 | + | ||
| 16 | + // 订阅HTTP响应头事件 | ||
| 17 | + httpRequest.on('headersReceive', (header) => { | ||
| 18 | + // console.info('header: ' + JSON.stringify(header)); | ||
| 19 | + }); | ||
| 20 | + | ||
| 21 | + // 用于订阅HTTP流式响应数据接收事件 | ||
| 22 | + let res = new ArrayBuffer(0); | ||
| 23 | + | ||
| 24 | + httpRequest.on('dataReceive', (data) => { | ||
| 25 | + const newRes = new ArrayBuffer(res.byteLength + data.byteLength); | ||
| 26 | + const resView = new Uint8Array(newRes); | ||
| 27 | + resView.set(new Uint8Array(res)); | ||
| 28 | + resView.set(new Uint8Array(data), res.byteLength); | ||
| 29 | + res = newRes; | ||
| 30 | + // console.info(TAG, 'dataReceive res length: ' + res.byteLength); | ||
| 31 | + }); | ||
| 32 | + | ||
| 33 | + // 用于订阅HTTP流式响应数据接收完毕事件 | ||
| 34 | + httpRequest.on('dataEnd', () => { | ||
| 35 | + if (res instanceof ArrayBuffer) { | ||
| 36 | + // 如果成功,调用onSuccess回调 | ||
| 37 | + // console.info(TAG, 'Success in response, data receive end'); | ||
| 38 | + onSuccess(res); | ||
| 39 | + } else { | ||
| 40 | + // 如果数据不是ArrayBuffer类型,可以在这里处理异常 | ||
| 41 | + // console.error(TAG, 'Unexpected data type:', res); | ||
| 42 | + onError(new Error('Data is not an ArrayBuffer')); | ||
| 43 | + } | ||
| 44 | + // console.info(TAG, 'No more data in response, data receive end'); | ||
| 45 | + }); | ||
| 46 | + | ||
| 47 | + httpRequest.requestInStream(imageUrl, (error, data) => { | ||
| 48 | + if (error) { | ||
| 49 | + // 如果发生错误,取消订阅事件并销毁请求对象 | ||
| 50 | + httpRequest.off('headersReceive'); | ||
| 51 | + httpRequest.off('dataReceive'); | ||
| 52 | + httpRequest.off('dataEnd'); | ||
| 53 | + httpRequest.destroy(); | ||
| 54 | + // console.error(`http request failed with. Code: ${error.code}, message: ${error.message}`); | ||
| 55 | + // 调用onError回调 | ||
| 56 | + onError(error); | ||
| 57 | + return; | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + // 取消订阅事件 | ||
| 61 | + httpRequest.off('headersReceive'); | ||
| 62 | + httpRequest.off('dataReceive'); | ||
| 63 | + httpRequest.off('dataEnd'); | ||
| 64 | + | ||
| 65 | + // 销毁请求对象 | ||
| 66 | + httpRequest.destroy(); | ||
| 67 | + }); | ||
| 68 | + } | ||
| 69 | +} |
| 1 | -import { PageInfoDTO } from 'wdBean/Index'; | 1 | +import { PageInfoDTO,TopicDetailData } from 'wdBean/Index'; |
| 2 | import { AdvRuleBean, CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean'; | 2 | import { AdvRuleBean, CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean'; |
| 3 | import { DateTimeUtils, SPHelper } from 'wdKit/Index'; | 3 | import { DateTimeUtils, SPHelper } from 'wdKit/Index'; |
| 4 | import { ArrayList } from '@kit.ArkTS'; | 4 | import { ArrayList } from '@kit.ArkTS'; |
| @@ -21,15 +21,23 @@ export default class PageAdModel { | @@ -21,15 +21,23 @@ export default class PageAdModel { | ||
| 21 | // 1:右边;2:左边 -> 默认右边 | 21 | // 1:右边;2:左边 -> 默认右边 |
| 22 | pageCornerContentInfo: AdvRuleBean = {} as AdvRuleBean | 22 | pageCornerContentInfo: AdvRuleBean = {} as AdvRuleBean |
| 23 | 23 | ||
| 24 | + | ||
| 25 | + analysisAdvSource(pageInfo: PageInfoDTO) { | ||
| 26 | + this.analysisAllAdvSource(pageInfo.hasAdInfo,pageInfo.cornersAdv,pageInfo.cornersAdv2,pageInfo.id) | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + analysisTopicAdvSource(topicDetail: TopicDetailData) { | ||
| 30 | + this.analysisAllAdvSource(topicDetail.hasAdInfo,topicDetail.cornersAdv,topicDetail.cornersAdv2,topicDetail.id) | ||
| 31 | + } | ||
| 32 | + | ||
| 24 | /** | 33 | /** |
| 25 | * 解析广告资源 | 34 | * 解析广告资源 |
| 26 | * @param pageInfo | 35 | * @param pageInfo |
| 27 | */ | 36 | */ |
| 28 | - async analysisAdvSource(pageInfo: PageInfoDTO) { | ||
| 29 | - | ||
| 30 | - if (pageInfo.hasAdInfo === 1 && pageInfo.cornersAdv != null) { | 37 | + private async analysisAllAdvSource(hasAdInfo: number,cornersAd: AdvRuleBean,cornersAd2: CompAdvBean[],id: number) { |
| 38 | + if (hasAdInfo === 1 && cornersAd != null) { | ||
| 31 | // 优先展示展现中心广告 | 39 | // 优先展示展现中心广告 |
| 32 | - let cornersAdv = pageInfo.cornersAdv | 40 | + let cornersAdv = cornersAd |
| 33 | 41 | ||
| 34 | if (cornersAdv == null) { | 42 | if (cornersAdv == null) { |
| 35 | return | 43 | return |
| @@ -50,9 +58,9 @@ export default class PageAdModel { | @@ -50,9 +58,9 @@ export default class PageAdModel { | ||
| 50 | this.pageCornerContentInfo = cornersAdv; | 58 | this.pageCornerContentInfo = cornersAdv; |
| 51 | this.isShowAds = true | 59 | this.isShowAds = true |
| 52 | 60 | ||
| 53 | - } else if (pageInfo.cornersAdv2 != null && pageInfo.cornersAdv2.length > 0) { | 61 | + } else if (cornersAd2 != null && cornersAd2.length > 0) { |
| 54 | // 广告中心-挂角广告信息 | 62 | // 广告中心-挂角广告信息 |
| 55 | - let cornersAdv2 = pageInfo.cornersAdv2 | 63 | + let cornersAdv2 = cornersAd2 |
| 56 | 64 | ||
| 57 | if (cornersAdv2.length == 0) { | 65 | if (cornersAdv2.length == 0) { |
| 58 | return | 66 | return |
| @@ -61,7 +69,7 @@ export default class PageAdModel { | @@ -61,7 +69,7 @@ export default class PageAdModel { | ||
| 61 | let pageCoreAdvArray = this.treatPageInfoAdsData(cornersAdv2); | 69 | let pageCoreAdvArray = this.treatPageInfoAdsData(cornersAdv2); |
| 62 | 70 | ||
| 63 | let advLength = pageCoreAdvArray.length; | 71 | let advLength = pageCoreAdvArray.length; |
| 64 | - let pageId = pageInfo.id.toString(); | 72 | + let pageId = id.toString(); |
| 65 | let a = 0; | 73 | let a = 0; |
| 66 | if (advLength > 1) { | 74 | if (advLength > 1) { |
| 67 | a = await this.calPageAdvIndex(pageId,advLength) | 75 | a = await this.calPageAdvIndex(pageId,advLength) |
| @@ -86,8 +94,8 @@ export default class PageAdModel { | @@ -86,8 +94,8 @@ export default class PageAdModel { | ||
| 86 | this.pageCornerAdv = showCompAdvBean | 94 | this.pageCornerAdv = showCompAdvBean |
| 87 | this.isShowAds = true | 95 | this.isShowAds = true |
| 88 | } | 96 | } |
| 89 | - | ||
| 90 | } | 97 | } |
| 98 | + | ||
| 91 | /** | 99 | /** |
| 92 | * 计算投放广告的序列号 | 100 | * 计算投放广告的序列号 |
| 93 | * @param pageId | 101 | * @param pageId |
| @@ -148,12 +148,20 @@ export struct DetailPlayVLivePage { | @@ -148,12 +148,20 @@ export struct DetailPlayVLivePage { | ||
| 148 | .width('100%') | 148 | .width('100%') |
| 149 | .blur(100) | 149 | .blur(100) |
| 150 | .renderFit(RenderFit.RESIZE_COVER) | 150 | .renderFit(RenderFit.RESIZE_COVER) |
| 151 | + RelativeContainer() | ||
| 152 | + .backgroundColor(Color.Black) | ||
| 153 | + .visibility(this.isPlayerError ? Visibility.Visible : | ||
| 154 | + Visibility.None) | ||
| 155 | + | ||
| 151 | // 直播结束且无回看 | 156 | // 直播结束且无回看 |
| 152 | if (this.liveState === 'end' && StringUtils.isEmpty(this.playUrl)) { | 157 | if (this.liveState === 'end' && StringUtils.isEmpty(this.playUrl)) { |
| 153 | PlayerEndView() | 158 | PlayerEndView() |
| 154 | } else { | 159 | } else { |
| 155 | // 直播暂停,仍然可以评论 | 160 | // 直播暂停,仍然可以评论 |
| 156 | if (this.liveState === 'pause') { | 161 | if (this.liveState === 'pause') { |
| 162 | + RelativeContainer() | ||
| 163 | + .backgroundColor('#000000') | ||
| 164 | + .opacity(0.5) | ||
| 157 | LiveEmptyComponent({ | 165 | LiveEmptyComponent({ |
| 158 | emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend | 166 | emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend |
| 159 | }) | 167 | }) |
| @@ -168,6 +176,9 @@ export struct DetailPlayVLivePage { | @@ -168,6 +176,9 @@ export struct DetailPlayVLivePage { | ||
| 168 | 176 | ||
| 169 | } else { | 177 | } else { |
| 170 | // 没有配置垫片资源 | 178 | // 没有配置垫片资源 |
| 179 | + RelativeContainer() | ||
| 180 | + .backgroundColor('#000000') | ||
| 181 | + .opacity(0.5) | ||
| 171 | LiveEmptyComponent({ | 182 | LiveEmptyComponent({ |
| 172 | emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend | 183 | emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend |
| 173 | }) | 184 | }) |
| @@ -98,11 +98,10 @@ export struct TabComponent { | @@ -98,11 +98,10 @@ export struct TabComponent { | ||
| 98 | .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) | 98 | .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) |
| 99 | .fontSize('18vp') | 99 | .fontSize('18vp') |
| 100 | .fontWeight(this.currentIndex === index ? 600 : 400) | 100 | .fontWeight(this.currentIndex === index ? 600 : 400) |
| 101 | - Divider() | ||
| 102 | - .strokeWidth(2) | 101 | + Image($r('app.media.icon_tab_indictor_line')) |
| 103 | .margin({ top: 6 }) | 102 | .margin({ top: 6 }) |
| 104 | - .width(15) | ||
| 105 | - .color('#CB0000') | 103 | + .width(18) |
| 104 | + .height(2) | ||
| 106 | .visibility(this.currentIndex === index ? Visibility.Visible : Visibility.Hidden) | 105 | .visibility(this.currentIndex === index ? Visibility.Visible : Visibility.Hidden) |
| 107 | }.justifyContent(FlexAlign.Center) | 106 | }.justifyContent(FlexAlign.Center) |
| 108 | .constraintSize({ minWidth: 35 }) | 107 | .constraintSize({ minWidth: 35 }) |
| @@ -124,7 +124,6 @@ export struct TabLiveItemComponent { | @@ -124,7 +124,6 @@ export struct TabLiveItemComponent { | ||
| 124 | RelativeContainer() { | 124 | RelativeContainer() { |
| 125 | Image(this.item.transcodeImageUrl) | 125 | Image(this.item.transcodeImageUrl) |
| 126 | .width('100%') | 126 | .width('100%') |
| 127 | - .height(174) | ||
| 128 | .objectFit(ImageFit.Cover) | 127 | .objectFit(ImageFit.Cover) |
| 129 | .borderRadius(4) | 128 | .borderRadius(4) |
| 130 | .id('iv_id') | 129 | .id('iv_id') |
| @@ -160,7 +159,7 @@ export struct TabLiveItemComponent { | @@ -160,7 +159,7 @@ export struct TabLiveItemComponent { | ||
| 160 | .margin({ | 159 | .margin({ |
| 161 | top: 8, | 160 | top: 8, |
| 162 | }) | 161 | }) |
| 163 | - .height(174) | 162 | + .height('auto') |
| 164 | .onClick(() => { | 163 | .onClick(() => { |
| 165 | this.gotoVideoPlayPage() | 164 | this.gotoVideoPlayPage() |
| 166 | }) | 165 | }) |
sight_harmony/features/wdDetailPlayLive/src/main/resources/base/media/icon_tab_indictor_line.png
0 → 100644
188 Bytes
| @@ -98,7 +98,7 @@ export struct DetailPlayShortVideoPage { | @@ -98,7 +98,7 @@ export struct DetailPlayShortVideoPage { | ||
| 98 | this.imageVisible = false | 98 | this.imageVisible = false |
| 99 | }) | 99 | }) |
| 100 | } else { | 100 | } else { |
| 101 | - this.playerController.pause() | 101 | + this.playerController.stop() |
| 102 | } | 102 | } |
| 103 | } | 103 | } |
| 104 | } | 104 | } |
| @@ -189,6 +189,7 @@ export struct DetailPlayShortVideoPage { | @@ -189,6 +189,7 @@ export struct DetailPlayShortVideoPage { | ||
| 189 | } | 189 | } |
| 190 | 190 | ||
| 191 | async aboutToAppear() { | 191 | async aboutToAppear() { |
| 192 | + this.isPlay = true | ||
| 192 | if (!this.onlyWifiLoadVideo) { | 193 | if (!this.onlyWifiLoadVideo) { |
| 193 | this.onlyWifiLoadVideo = await onlyWifiLoadVideo() | 194 | this.onlyWifiLoadVideo = await onlyWifiLoadVideo() |
| 194 | this.toastTextVisible = this.onlyWifiLoadVideo ? false : true | 195 | this.toastTextVisible = this.onlyWifiLoadVideo ? false : true |
| @@ -88,7 +88,7 @@ export struct OperationListView { | @@ -88,7 +88,7 @@ export struct OperationListView { | ||
| 88 | } else { | 88 | } else { |
| 89 | this.interactData.likeNum = Number(this.interactData.likeNum) - 1 | 89 | this.interactData.likeNum = Number(this.interactData.likeNum) - 1 |
| 90 | } | 90 | } |
| 91 | - console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum) | 91 | + // console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum) |
| 92 | // this.queryContentInteractCount() | 92 | // this.queryContentInteractCount() |
| 93 | } | 93 | } |
| 94 | 94 | ||
| @@ -124,7 +124,7 @@ export struct OperationListView { | @@ -124,7 +124,7 @@ export struct OperationListView { | ||
| 124 | } else { | 124 | } else { |
| 125 | this.interactData.collectNum = Number(this.interactData.collectNum) - 1 | 125 | this.interactData.collectNum = Number(this.interactData.collectNum) - 1 |
| 126 | } | 126 | } |
| 127 | - console.log('收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum) | 127 | + // console.log('收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum) |
| 128 | } | 128 | } |
| 129 | }) | 129 | }) |
| 130 | 130 | ||
| @@ -146,7 +146,7 @@ export struct OperationListView { | @@ -146,7 +146,7 @@ export struct OperationListView { | ||
| 146 | this.interactData.collectNum = res.data[0]?.collectNum | 146 | this.interactData.collectNum = res.data[0]?.collectNum |
| 147 | this.interactData.commentNum = res.data[0]?.commentNum | 147 | this.interactData.commentNum = res.data[0]?.commentNum |
| 148 | } | 148 | } |
| 149 | - console.log('获取互动点赞等数据===', JSON.stringify(res)) | 149 | + // console.log('获取互动点赞等数据===', JSON.stringify(res)) |
| 150 | }) | 150 | }) |
| 151 | } | 151 | } |
| 152 | 152 | ||
| @@ -174,7 +174,7 @@ export struct OperationListView { | @@ -174,7 +174,7 @@ export struct OperationListView { | ||
| 174 | status: 1, | 174 | status: 1, |
| 175 | } | 175 | } |
| 176 | ContentDetailRequest.postInteractAccentionOperate(params2).then(res => { | 176 | ContentDetailRequest.postInteractAccentionOperate(params2).then(res => { |
| 177 | - console.log('关注号主==', JSON.stringify(res.data)) | 177 | + // console.log('关注号主==', JSON.stringify(res.data)) |
| 178 | if (this.followStatus == '1') { | 178 | if (this.followStatus == '1') { |
| 179 | this.followStatus = '0' | 179 | this.followStatus = '0' |
| 180 | } else { | 180 | } else { |
| @@ -87,21 +87,21 @@ export struct PlayerRightView { | @@ -87,21 +87,21 @@ export struct PlayerRightView { | ||
| 87 | relType: this.contentDetailData?.reLInfo?.relType || '' + '', | 87 | relType: this.contentDetailData?.reLInfo?.relType || '' + '', |
| 88 | userHeaderUrl: this.contentDetailData?.userInfo?.headPhotoUrl || '' + '', | 88 | userHeaderUrl: this.contentDetailData?.userInfo?.headPhotoUrl || '' + '', |
| 89 | } | 89 | } |
| 90 | - console.log(TAG, '点赞params', JSON.stringify(params)) | 90 | + // console.log(TAG, '点赞params', JSON.stringify(params)) |
| 91 | ContentDetailRequest.postExecuteLike(params).then(res => { | 91 | ContentDetailRequest.postExecuteLike(params).then(res => { |
| 92 | - console.log(TAG, '点赞this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) | 92 | + // console.log(TAG, '点赞this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) |
| 93 | if (this.newsStatusOfUser) { | 93 | if (this.newsStatusOfUser) { |
| 94 | this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' | 94 | this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' |
| 95 | if (this.newsStatusOfUser.likeStatus == '1') { | 95 | if (this.newsStatusOfUser.likeStatus == '1') { |
| 96 | this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1 | 96 | this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1 |
| 97 | TrackingContent.like(true, this.pageId, this.pageName, this.pageParam) | 97 | TrackingContent.like(true, this.pageId, this.pageName, this.pageParam) |
| 98 | - console.log(TAG, '点赞') | 98 | + // console.log(TAG, '点赞') |
| 99 | } else { | 99 | } else { |
| 100 | this.interactData.likeNum = Math.max(0, Number(this.interactData.likeNum || 0) - 1) | 100 | this.interactData.likeNum = Math.max(0, Number(this.interactData.likeNum || 0) - 1) |
| 101 | TrackingContent.like(false, this.pageId, this.pageName, this.pageParam) | 101 | TrackingContent.like(false, this.pageId, this.pageName, this.pageParam) |
| 102 | - console.log(TAG, '取消点赞') | 102 | + // console.log(TAG, '取消点赞') |
| 103 | } | 103 | } |
| 104 | - console.log(TAG, '点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum) | 104 | + // console.log(TAG, '点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum) |
| 105 | // this.queryContentInteractCount() | 105 | // this.queryContentInteractCount() |
| 106 | } | 106 | } |
| 107 | 107 | ||
| @@ -135,13 +135,13 @@ export struct PlayerRightView { | @@ -135,13 +135,13 @@ export struct PlayerRightView { | ||
| 135 | if (this.newsStatusOfUser.collectStatus === 1) { | 135 | if (this.newsStatusOfUser.collectStatus === 1) { |
| 136 | this.interactData.collectNum = Number(this.interactData.collectNum || 0) + 1 | 136 | this.interactData.collectNum = Number(this.interactData.collectNum || 0) + 1 |
| 137 | TrackingContent.collect(true, this.pageId, this.pageName, this.pageParam) | 137 | TrackingContent.collect(true, this.pageId, this.pageName, this.pageParam) |
| 138 | - console.log(TAG, '收藏') | 138 | + // console.log(TAG, '收藏') |
| 139 | } else { | 139 | } else { |
| 140 | this.interactData.collectNum = Math.max(0, Number(this.interactData.collectNum || 0) - 1) | 140 | this.interactData.collectNum = Math.max(0, Number(this.interactData.collectNum || 0) - 1) |
| 141 | TrackingContent.collect(false, this.pageId, this.pageName, this.pageParam) | 141 | TrackingContent.collect(false, this.pageId, this.pageName, this.pageParam) |
| 142 | - console.log(TAG, '取消收藏') | 142 | + // console.log(TAG, '取消收藏') |
| 143 | } | 143 | } |
| 144 | - console.log(TAG, '收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum) | 144 | + // console.log(TAG, '收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum) |
| 145 | } | 145 | } |
| 146 | }) | 146 | }) |
| 147 | 147 | ||
| @@ -163,7 +163,7 @@ export struct PlayerRightView { | @@ -163,7 +163,7 @@ export struct PlayerRightView { | ||
| 163 | this.interactData.collectNum = res.data[0]?.collectNum || 0 | 163 | this.interactData.collectNum = res.data[0]?.collectNum || 0 |
| 164 | this.interactData.commentNum = res.data[0]?.commentNum || 0 | 164 | this.interactData.commentNum = res.data[0]?.commentNum || 0 |
| 165 | } | 165 | } |
| 166 | - console.log('获取互动点赞等数据===', JSON.stringify(res)) | 166 | + // console.log('获取互动点赞等数据===', JSON.stringify(res)) |
| 167 | }) | 167 | }) |
| 168 | } | 168 | } |
| 169 | 169 | ||
| @@ -191,17 +191,18 @@ export struct PlayerRightView { | @@ -191,17 +191,18 @@ export struct PlayerRightView { | ||
| 191 | status: 1, | 191 | status: 1, |
| 192 | } | 192 | } |
| 193 | ContentDetailRequest.postInteractAccentionOperate(params2).then(res => { | 193 | ContentDetailRequest.postInteractAccentionOperate(params2).then(res => { |
| 194 | - console.log(TAG, '关注号主==', JSON.stringify(res.data)) | 194 | + // console.log(TAG, '关注号主==', JSON.stringify(res.data)) |
| 195 | if (this.followStatus == '1') { | 195 | if (this.followStatus == '1') { |
| 196 | this.followStatus = '0' | 196 | this.followStatus = '0' |
| 197 | } else { | 197 | } else { |
| 198 | this.followStatus = '1' | 198 | this.followStatus = '1' |
| 199 | - ContentDetailRequest.postPointLevelOperate({ operateType: 6 }).then((res) => { | ||
| 200 | - if (res.data?.showToast) { | ||
| 201 | - ToastUtils.showToast(res.data.ruleName + '+' + res.data.rulePoint + '积分', 1000); | ||
| 202 | - } | ||
| 203 | - }) | ||
| 204 | - console.log(TAG, '关注号主') | 199 | + ContentDetailRequest.postPointLevelOperate({ operateType: 6 }) |
| 200 | + // .then((res) => { | ||
| 201 | + // if (res.data?.showToast) { | ||
| 202 | + // ToastUtils.showToast(res.data.ruleName + '+' + res.data.rulePoint + '积分', 1000); | ||
| 203 | + // } | ||
| 204 | + // }) | ||
| 205 | + // console.log(TAG, '关注号主') | ||
| 205 | TrackingContent.follow(true, this.followUserId, this.followUserName, this.pageId, this.pageName, this.pageParam) | 206 | TrackingContent.follow(true, this.followUserId, this.followUserName, this.pageId, this.pageName, this.pageParam) |
| 206 | } | 207 | } |
| 207 | }) | 208 | }) |
| @@ -302,8 +303,7 @@ export struct PlayerRightView { | @@ -302,8 +303,7 @@ export struct PlayerRightView { | ||
| 302 | } | 303 | } |
| 303 | 304 | ||
| 304 | transNum2String(name: 'likeNum' | 'collectNum' | 'commentNum') { | 305 | transNum2String(name: 'likeNum' | 'collectNum' | 'commentNum') { |
| 305 | - console.log(TAG, 'transNum2String', this.interactData.likeNum, this.interactData.collectNum, | ||
| 306 | - this.interactData.commentNum) | 306 | + // console.log(TAG, 'transNum2String', this.interactData.likeNum, this.interactData.collectNum,this.interactData.commentNum) |
| 307 | if (name === 'likeNum') { | 307 | if (name === 'likeNum') { |
| 308 | return this.interactData.likeNum != 0 ? | 308 | return this.interactData.likeNum != 0 ? |
| 309 | NumberFormatterUtils.formatNumberWithWan(this.interactData.likeNum || '') : '' | 309 | NumberFormatterUtils.formatNumberWithWan(this.interactData.likeNum || '') : '' |
| @@ -94,7 +94,8 @@ export struct PlayerTitleView { | @@ -94,7 +94,8 @@ export struct PlayerTitleView { | ||
| 94 | } | 94 | } |
| 95 | clipStr += strArr[i] | 95 | clipStr += strArr[i] |
| 96 | } | 96 | } |
| 97 | - console.log(TAG, 'clipStr:', clipStr) | 97 | + clipStr += this.isOverLines ? '...' : ''; |
| 98 | + console.log(TAG, 'clipStr2:', clipStr) | ||
| 98 | return clipStr | 99 | return clipStr |
| 99 | } | 100 | } |
| 100 | 101 | ||
| @@ -130,7 +131,8 @@ export struct PlayerTitleView { | @@ -130,7 +131,8 @@ export struct PlayerTitleView { | ||
| 130 | } | 131 | } |
| 131 | clipStr += strArr[i] | 132 | clipStr += strArr[i] |
| 132 | } | 133 | } |
| 133 | - console.log(TAG, 'clipTitleText clipStr:', clipStr) | 134 | + console.log(TAG, 'clipTitleText clipStr1:', clipStr) |
| 135 | + clipStr += this.isTitleOverLines ? '...' : ''; | ||
| 134 | return clipStr | 136 | return clipStr |
| 135 | } | 137 | } |
| 136 | 138 | ||
| @@ -217,7 +219,54 @@ export struct PlayerTitleView { | @@ -217,7 +219,54 @@ export struct PlayerTitleView { | ||
| 217 | // }) | 219 | // }) |
| 218 | // } | 220 | // } |
| 219 | // } else { | 221 | // } else { |
| 222 | + this.detailDesc() | ||
| 223 | + // } | ||
| 224 | + Text(DateTimeUtils.formatDate(new Date(this.contentDetailData?.publishTime).getTime(), | ||
| 225 | + DateTimeUtils.PATTERN_DATE_TIME_HYPHEN_MM)) | ||
| 226 | + .fontSize(12) | ||
| 227 | + .fontColor(Color.White) | ||
| 228 | + .opacity(0.7) | ||
| 229 | + .lineHeight(16) | ||
| 230 | + .fontWeight(400) | ||
| 231 | + .fontFamily('PingFang SC-Regular') | ||
| 232 | + .margin({ top: 8, bottom: 8 }) | ||
| 233 | + | ||
| 234 | + } | ||
| 235 | + .width(this.windowWidth - 150 + 'px') | ||
| 236 | + .padding({ left: 16, right: 22 }) | ||
| 237 | + .alignItems(HorizontalAlign.Start) | ||
| 238 | + .visibility(this.isOpenDetail || this.isDragging ? Visibility.None : Visibility.Visible) | ||
| 239 | + } | ||
| 240 | + | ||
| 241 | + @Builder | ||
| 242 | + detailDesc() { | ||
| 243 | + /** | ||
| 244 | + * 标题大于三行或存在简介显示查看详情按钮 | ||
| 245 | + */ | ||
| 246 | + // if (this.rmhPlatform == 1) { | ||
| 247 | + // if (this.titleHeight > 200 || this.summary) { | ||
| 248 | + // Text('查看详情 > ') | ||
| 249 | + // .padding({ | ||
| 250 | + // left: 6, | ||
| 251 | + // right: 6, | ||
| 252 | + // top: 4, | ||
| 253 | + // bottom: 4 | ||
| 254 | + // }) | ||
| 255 | + // .borderRadius(2) | ||
| 256 | + // .backgroundColor('#99636363') | ||
| 257 | + // .fontFamily('PingFang SC-Regular') | ||
| 258 | + // .fontColor(Color.White) | ||
| 259 | + // .fontSize(12) | ||
| 260 | + // .lineHeight(14) | ||
| 261 | + // .fontWeight(400) | ||
| 262 | + // .onClick(() => { | ||
| 263 | + // this.isOpenDetail = true | ||
| 264 | + // this.dialogController?.open() | ||
| 265 | + // }) | ||
| 266 | + // } | ||
| 267 | + // } else { | ||
| 220 | if (this.summary && this.titleLines < 4) { | 268 | if (this.summary && this.titleLines < 4) { |
| 269 | + Stack({ alignContent: Alignment.TopStart }) { | ||
| 221 | Text() { | 270 | Text() { |
| 222 | Span(this.clipText(this.summary, 14, this.summaryLines, this.windowWidth - 150 - vp2px(50))) | 271 | Span(this.clipText(this.summary, 14, this.summaryLines, this.windowWidth - 150 - vp2px(50))) |
| 223 | .fontSize(14) | 272 | .fontSize(14) |
| @@ -229,9 +278,18 @@ export struct PlayerTitleView { | @@ -229,9 +278,18 @@ export struct PlayerTitleView { | ||
| 229 | this.isOpenDetail = true | 278 | this.isOpenDetail = true |
| 230 | this.dialogController?.open() | 279 | this.dialogController?.open() |
| 231 | }) | 280 | }) |
| 281 | + } | ||
| 282 | + // .position({ x: 0, y: 0 }) | ||
| 283 | + .padding({ | ||
| 284 | + left: 0, | ||
| 285 | + right: 6, | ||
| 286 | + top: 0, | ||
| 287 | + bottom: 8 | ||
| 288 | + }) | ||
| 232 | if (this.isOverLines) { | 289 | if (this.isOverLines) { |
| 233 | - Span('... 全文') | ||
| 234 | - .fontColor('#888888') | 290 | + Text() { |
| 291 | + Span('全文') | ||
| 292 | + .fontColor('#99FFFFFF') | ||
| 235 | .fontWeight(400) | 293 | .fontWeight(400) |
| 236 | .fontFamily('PingFang SC-Regular') | 294 | .fontFamily('PingFang SC-Regular') |
| 237 | .fontSize(12) | 295 | .fontSize(12) |
| @@ -251,37 +309,31 @@ export struct PlayerTitleView { | @@ -251,37 +309,31 @@ export struct PlayerTitleView { | ||
| 251 | this.isOpenDetail = true | 309 | this.isOpenDetail = true |
| 252 | this.dialogController?.open() | 310 | this.dialogController?.open() |
| 253 | }) | 311 | }) |
| 254 | - | ||
| 255 | - } | ||
| 256 | } | 312 | } |
| 313 | + .textAlign(TextAlign.Center) | ||
| 314 | + // .width('100%') | ||
| 315 | + .position({ x: '100%', y: this.summaryLines*23 }) //行高+margin | ||
| 316 | + .translate({ x: '-100%', y: '-100%' }) | ||
| 317 | + // .markAnchor({ x: '100%', y: '100%' }) | ||
| 257 | .padding({ | 318 | .padding({ |
| 258 | - left: 0, //6 | 319 | + left: 0, |
| 259 | right: 6, | 320 | right: 6, |
| 260 | - top: 0, //4 | ||
| 261 | - bottom: 8 | 321 | + top: 0, |
| 322 | + bottom: 6 | ||
| 262 | }) | 323 | }) |
| 263 | - | ||
| 264 | } | 324 | } |
| 265 | - // } | ||
| 266 | - Text(DateTimeUtils.formatDate(new Date(this.contentDetailData?.publishTime).getTime(), | ||
| 267 | - DateTimeUtils.PATTERN_DATE_TIME_HYPHEN_MM)) | ||
| 268 | - .fontSize(12) | ||
| 269 | - .fontColor(Color.White) | ||
| 270 | - .opacity(0.7) | ||
| 271 | - .lineHeight(16) | ||
| 272 | - .fontWeight(400) | ||
| 273 | - .fontFamily('PingFang SC-Regular') | ||
| 274 | - .margin({ top: 8, bottom: 8 }) | ||
| 275 | - | ||
| 276 | } | 325 | } |
| 277 | - .width(this.windowWidth - 150 + 'px') | ||
| 278 | - .padding({ left: 16, right: 22 }) | ||
| 279 | - .alignItems(HorizontalAlign.Start) | ||
| 280 | - .visibility(this.isOpenDetail || this.isDragging ? Visibility.None : Visibility.Visible) | 326 | + .width('100%') |
| 327 | + } | ||
| 281 | } | 328 | } |
| 282 | 329 | ||
| 330 | + /** | ||
| 331 | + * 标题 | ||
| 332 | + * */ | ||
| 283 | @Builder | 333 | @Builder |
| 284 | titleBuilder() { | 334 | titleBuilder() { |
| 335 | + // Stack({ alignContent: this.isTitleOverLines ? Alignment.BottomEnd : Alignment.Start }) { | ||
| 336 | + Stack({ alignContent: Alignment.TopStart }) { | ||
| 285 | Text() { | 337 | Text() { |
| 286 | Span(this.clipTitleText(this.getTitle(), 16, 4, this.windowWidth - 234 - vp2px(50))) | 338 | Span(this.clipTitleText(this.getTitle(), 16, 4, this.windowWidth - 234 - vp2px(50))) |
| 287 | .fontSize(16) | 339 | .fontSize(16) |
| @@ -289,9 +341,28 @@ export struct PlayerTitleView { | @@ -289,9 +341,28 @@ export struct PlayerTitleView { | ||
| 289 | .lineHeight(22) | 341 | .lineHeight(22) |
| 290 | .fontWeight(600) | 342 | .fontWeight(600) |
| 291 | .fontFamily('PingFang SC-Regular') | 343 | .fontFamily('PingFang SC-Regular') |
| 344 | + | ||
| 345 | + } | ||
| 346 | + // .position({ x: 0, y: 0 }) | ||
| 347 | + .onAreaChange((oldArea: Area, newArea: Area) => { | ||
| 348 | + //console.info(`cj2024 titleLines = ${newArea.height as number} line = ${(newArea.height as number) / 20}`) | ||
| 349 | + this.titleLines = Math.floor((newArea.height as number) / 22) // 22是行高 | ||
| 350 | + //console.info(`cj2024 titleLines = ${this.titleLines}`) | ||
| 351 | + this.updateSummaryLines() | ||
| 352 | + }) | ||
| 353 | + .maxLines(4) | ||
| 354 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 355 | + .padding({ | ||
| 356 | + left: 0, //6 | ||
| 357 | + right: 6, | ||
| 358 | + top: 0, //4 | ||
| 359 | + bottom: 8 | ||
| 360 | + }) | ||
| 361 | + | ||
| 362 | + Text() { | ||
| 292 | if (this.isTitleOverLines) { | 363 | if (this.isTitleOverLines) { |
| 293 | - Span('... 全文') | ||
| 294 | - .fontColor(Color.White) | 364 | + Span('全文') |
| 365 | + .fontColor('#99FFFFFF') | ||
| 295 | .fontWeight(600) | 366 | .fontWeight(600) |
| 296 | .fontFamily('PingFang SC-Regular') | 367 | .fontFamily('PingFang SC-Regular') |
| 297 | .fontSize(12) | 368 | .fontSize(12) |
| @@ -311,15 +382,14 @@ export struct PlayerTitleView { | @@ -311,15 +382,14 @@ export struct PlayerTitleView { | ||
| 311 | this.isOpenDetail = true | 382 | this.isOpenDetail = true |
| 312 | this.dialogController?.open() | 383 | this.dialogController?.open() |
| 313 | }) | 384 | }) |
| 314 | - | ||
| 315 | } | 385 | } |
| 316 | } | 386 | } |
| 317 | - .onAreaChange((oldArea: Area, newArea: Area) => { | ||
| 318 | - //console.info(`cj2024 titleLines = ${newArea.height as number} line = ${(newArea.height as number) / 20}`) | ||
| 319 | - this.titleLines = Math.floor((newArea.height as number) / 22) // 22是行高 | ||
| 320 | - //console.info(`cj2024 titleLines = ${this.titleLines}`) | ||
| 321 | - this.updateSummaryLines() | ||
| 322 | - }) | 387 | + .textAlign(TextAlign.Center) |
| 388 | + // .width('100%') | ||
| 389 | + .position({ x: '100%', y: this.titleLines*23 }) //行高+margin | ||
| 390 | + .translate({ x: '-100%', y: '-100%' }) | ||
| 391 | + // .position({ x: '100%', y: '100%' }) | ||
| 392 | + // .markAnchor({ x: '100%', y: '100%' }) | ||
| 323 | .padding({ | 393 | .padding({ |
| 324 | left: 0, //6 | 394 | left: 0, //6 |
| 325 | right: 6, | 395 | right: 6, |
| @@ -327,4 +397,6 @@ export struct PlayerTitleView { | @@ -327,4 +397,6 @@ export struct PlayerTitleView { | ||
| 327 | bottom: 8 | 397 | bottom: 8 |
| 328 | }) | 398 | }) |
| 329 | } | 399 | } |
| 400 | + .width('100%') | ||
| 401 | + } | ||
| 330 | } | 402 | } |
| 1 | -<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><g transform="matrix(0,-1,1,0,-16,16)"><g><path d="M10.303455641479491,17.960819560243227L4.363755241479492,23.900515460243227Q4.324434578479492,23.939835460243224,4.324704443879492,23.995445460243225Q4.324434578479492,24.051055460243226,4.363755241479492,24.090375460243223L10.303455641479491,30.030075460243225Q10.342505641479491,30.069075460243226,10.397735641479493,30.069075460243226Q10.452965641479492,30.069075460243226,10.492015641479492,30.030075460243225L11.387685641479493,29.134375460243227Q11.406435641479492,29.115675460243224,11.416585641479493,29.091175460243225Q11.426735641479493,29.066675460243225,11.426735641479493,29.040075460243223Q11.426735641479493,29.013575460243224,11.416585641479493,28.989075460243225Q11.406435641479492,28.964575460243225,11.387685641479493,28.945875460243226L6.437285641479493,23.995445460243225L11.387685641479493,19.045045460243227Q11.406435641479492,19.026295460243226,11.416585641479493,19.001795460243226Q11.426735641479493,18.977295460243226,11.426735641479493,18.950765460243225Q11.426735641479493,18.924245460243224,11.416585641479493,18.899744460243227Q11.406435641479492,18.875241460243224,11.387685641479493,18.856488460243224L10.492015641479492,17.960819560243227Q10.452965641479492,17.921767119783226,10.397735641479493,17.921767119783226Q10.342505641479491,17.921767119783226,10.303455641479491,17.960819560243227Z" fill-rule="evenodd" fill="#888888" fill-opacity="1"/></g></g></svg> | ||
| 1 | +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><g transform="matrix(0,-1,1,0,-16,16)"><g><path d="M10.303455641479491,17.960819560243227L4.363755241479492,23.900515460243227Q4.324434578479492,23.939835460243224,4.324704443879492,23.995445460243225Q4.324434578479492,24.051055460243226,4.363755241479492,24.090375460243223L10.303455641479491,30.030075460243225Q10.342505641479491,30.069075460243226,10.397735641479493,30.069075460243226Q10.452965641479492,30.069075460243226,10.492015641479492,30.030075460243225L11.387685641479493,29.134375460243227Q11.406435641479492,29.115675460243224,11.416585641479493,29.091175460243225Q11.426735641479493,29.066675460243225,11.426735641479493,29.040075460243223Q11.426735641479493,29.013575460243224,11.416585641479493,28.989075460243225Q11.406435641479492,28.964575460243225,11.387685641479493,28.945875460243226L6.437285641479493,23.995445460243225L11.387685641479493,19.045045460243227Q11.406435641479492,19.026295460243226,11.416585641479493,19.001795460243226Q11.426735641479493,18.977295460243226,11.426735641479493,18.950765460243225Q11.426735641479493,18.924245460243224,11.416585641479493,18.899744460243227Q11.406435641479492,18.875241460243224,11.387685641479493,18.856488460243224L10.492015641479492,17.960819560243227Q10.452965641479492,17.921767119783226,10.397735641479493,17.921767119783226Q10.342505641479491,17.921767119783226,10.303455641479491,17.960819560243227Z" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="0.6"/></g></g></svg> |
| 1 | +{"v":"5.6.10","fr":60,"ip":0,"op":30,"w":120,"h":120,"nm":"动态稿件卡-点赞-18*18","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":3,"nm":"空 23","sr":1,"ks":{"o":{"a":0,"k":0,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[45,45,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[75,75,100],"ix":6}},"ao":0,"ip":0,"op":30,"st":-8,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"圆 6","parent":1,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":7,"s":[10]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":9,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":11,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":22,"s":[100]},{"t":24,"s":[0]}],"ix":11},"r":{"a":0,"k":300,"ix":10},"p":{"a":0,"k":[20,20,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[80,80,100],"ix":6}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":1,"k":[{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":7,"s":[0,0]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":9,"s":[4,4]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":11,"s":[6,6]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":13,"s":[8,8]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":18,"s":[10,10]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":20,"s":[8,8]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":22,"s":[8,8]},{"t":24,"s":[8,8]}],"ix":2},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":7,"s":[0,-8],"to":[0,-5.333],"ti":[0,6.667]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":9,"s":[0,-40],"to":[0,-6.667],"ti":[0,2.667]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":11,"s":[0,-48],"to":[0,-2.667],"ti":[0,7]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":13,"s":[0,-56],"to":[0,-7],"ti":[0,6.667]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":18,"s":[0,-90],"to":[0,-1.958],"ti":[0,0.799]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":22,"s":[0,-88],"to":[0,-1.921],"ti":[0,0.706]},{"t":24,"s":[0,-100]}],"ix":3},"nm":"椭圆路径 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.929411764706,0.156862745098,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":30,"st":-8,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"圆 5","parent":1,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":7,"s":[10]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":9,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":11,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":22,"s":[100]},{"t":24,"s":[0]}],"ix":11},"r":{"a":0,"k":240,"ix":10},"p":{"a":0,"k":[20,20,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[80,80,100],"ix":6}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":1,"k":[{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":7,"s":[0,0]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":9,"s":[4,4]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":11,"s":[6,6]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":13,"s":[8,8]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":18,"s":[10,10]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":20,"s":[8,8]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":22,"s":[8,8]},{"t":24,"s":[8,8]}],"ix":2},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":7,"s":[0,-8],"to":[0,-5.333],"ti":[0,6.667]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":9,"s":[0,-40],"to":[0,-6.667],"ti":[0,2.667]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":11,"s":[0,-48],"to":[0,-2.667],"ti":[0,7]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":13,"s":[0,-56],"to":[0,-7],"ti":[0,6.667]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":18,"s":[0,-90],"to":[0,-1.958],"ti":[0,0.799]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":22,"s":[0,-88],"to":[0,-1.921],"ti":[0,0.706]},{"t":24,"s":[0,-100]}],"ix":3},"nm":"椭圆路径 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.929411764706,0.156862745098,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":30,"st":-8,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"圆 4","parent":1,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":7,"s":[10]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":9,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":11,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":22,"s":[100]},{"t":24,"s":[0]}],"ix":11},"r":{"a":0,"k":180,"ix":10},"p":{"a":0,"k":[20,20,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[80,80,100],"ix":6}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":1,"k":[{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":7,"s":[0,0]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":9,"s":[4,4]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":11,"s":[6,6]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":13,"s":[8,8]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":18,"s":[10,10]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":20,"s":[8,8]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":22,"s":[8,8]},{"t":24,"s":[8,8]}],"ix":2},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":7,"s":[0,-8],"to":[0,-5.333],"ti":[0,6.667]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":9,"s":[0,-40],"to":[0,-6.667],"ti":[0,2.667]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":11,"s":[0,-48],"to":[0,-2.667],"ti":[0,7]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":13,"s":[0,-56],"to":[0,-7],"ti":[0,6.667]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":18,"s":[0,-90],"to":[0,-1.958],"ti":[0,0.799]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":22,"s":[0,-88],"to":[0,-1.921],"ti":[0,0.706]},{"t":24,"s":[0,-100]}],"ix":3},"nm":"椭圆路径 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.929411764706,0.156862745098,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":30,"st":-8,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"圆 2","parent":1,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":7,"s":[10]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":9,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":11,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":22,"s":[100]},{"t":24,"s":[0]}],"ix":11},"r":{"a":0,"k":60,"ix":10},"p":{"a":0,"k":[20,20,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[80,80,100],"ix":6}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":1,"k":[{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":7,"s":[0,0]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":9,"s":[4,4]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":11,"s":[6,6]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":13,"s":[8,8]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":18,"s":[10,10]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":20,"s":[8,8]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":22,"s":[8,8]},{"t":24,"s":[8,8]}],"ix":2},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":7,"s":[0,-8],"to":[0,-5.333],"ti":[0,6.667]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":9,"s":[0,-40],"to":[0,-6.667],"ti":[0,2.667]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":11,"s":[0,-48],"to":[0,-2.667],"ti":[0,7]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":13,"s":[0,-56],"to":[0,-7],"ti":[0,6.667]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":18,"s":[0,-90],"to":[0,-1.958],"ti":[0,0.799]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":22,"s":[0,-88],"to":[0,-1.921],"ti":[0,0.706]},{"t":24,"s":[0,-100]}],"ix":3},"nm":"椭圆路径 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.929411764706,0.156862745098,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":30,"st":-8,"bm":0},{"ddd":0,"ind":6,"ty":4,"nm":"圆","parent":1,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":7,"s":[10]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":9,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":11,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":22,"s":[100]},{"t":24,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[20,20,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[80,80,100],"ix":6}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":1,"k":[{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":7,"s":[0,0]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":9,"s":[4,4]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":11,"s":[6,6]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":13,"s":[8,8]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":18,"s":[10,10]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":20,"s":[8,8]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":22,"s":[8,8]},{"t":24,"s":[8,8]}],"ix":2},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":7,"s":[0,-8],"to":[0,-5.333],"ti":[0,6.667]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":9,"s":[0,-40],"to":[0,-6.667],"ti":[0,2.667]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":11,"s":[0,-48],"to":[0,-2.667],"ti":[0,7]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":13,"s":[0,-56],"to":[0,-7],"ti":[0,6.667]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":18,"s":[0,-90],"to":[0,-1.958],"ti":[0,0.799]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":22,"s":[0,-88],"to":[0,-1.921],"ti":[0,0.706]},{"t":24,"s":[0,-100]}],"ix":3},"nm":"椭圆路径 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.929411764706,0.156862745098,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":30,"st":-8,"bm":0},{"ddd":0,"ind":7,"ty":4,"nm":"圆 3","parent":1,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":7,"s":[10]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":9,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":11,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":22,"s":[100]},{"t":24,"s":[0]}],"ix":11},"r":{"a":0,"k":120,"ix":10},"p":{"a":0,"k":[20,20,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[80,80,100],"ix":6}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":1,"k":[{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":7,"s":[0,0]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":9,"s":[4,4]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":11,"s":[6,6]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":13,"s":[8,8]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":18,"s":[10,10]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":20,"s":[8,8]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":22,"s":[8,8]},{"t":24,"s":[8,8]}],"ix":2},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":7,"s":[0,-8],"to":[0,-5.333],"ti":[0,6.667]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":9,"s":[0,-40],"to":[0,-6.667],"ti":[0,2.667]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":11,"s":[0,-48],"to":[0,-2.667],"ti":[0,7]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":13,"s":[0,-56],"to":[0,-7],"ti":[0,6.667]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":18,"s":[0,-90],"to":[0,-1.958],"ti":[0,0.799]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":22,"s":[0,-88],"to":[0,-1.921],"ti":[0,0.706]},{"t":24,"s":[0,-100]}],"ix":3},"nm":"椭圆路径 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.929411764706,0.156862745098,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":30,"st":-8,"bm":0},{"ddd":0,"ind":8,"ty":4,"nm":"圈","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[20,20,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[80,80,100],"ix":6}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":1,"k":[{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":7,"s":[0,0]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":9,"s":[60,60]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":11,"s":[76,76]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":13,"s":[84,84]},{"i":{"x":[0.833,0.833],"y":[0.833,0.833]},"o":{"x":[0.167,0.167],"y":[0.167,0.167]},"t":17,"s":[140,140]},{"t":20,"s":[144,144]}],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"椭圆路径 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"op","nm":"位移路径 1","a":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":7,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":9,"s":[-5]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":11,"s":[-16]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":13,"s":[-10]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":18,"s":[-1]},{"t":23,"s":[0]}],"ix":1},"lj":1,"ml":{"a":0,"k":5,"ix":3},"ix":2,"mn":"ADBE Vector Filter - Offset","hd":false},{"ty":"st","c":{"a":0,"k":[0.929411764706,0.156862745098,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":7,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":9,"s":[10]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":11,"s":[32]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":13,"s":[20]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":18,"s":[1]},{"t":23,"s":[0]}],"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"描边 1","mn":"ADBE Vector Graphic - Stroke","hd":false}],"ip":0,"op":30,"st":-8,"bm":0},{"ddd":0,"ind":9,"ty":4,"nm":"“图层 1”轮廓","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[20,19.999,0],"ix":2},"a":{"a":0,"k":[12,12,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":2,"s":[400,400,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":7,"s":[20,20,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":18,"s":[440,440,100]},{"t":23,"s":[400,400,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[2.148,-2.148],[-2.148,-2.148],[0,0],[0,0],[0,0],[-0.195,0.195],[0,0],[2.148,2.148],[2.148,-2.148],[0,0]],"o":[[-2.148,-2.148],[-2.148,2.148],[0,0],[0,0],[0,0],[0.195,0.195],[0,0],[2.148,-2.148],[-2.148,-2.148],[0,0],[0,0]],"v":[[-1.061,-7.156],[-8.839,-7.156],[-8.839,0.622],[-7.778,1.684],[-0.354,9.107],[-0.353,9.109],[0.354,9.109],[8.839,0.622],[8.839,-7.156],[1.061,-7.156],[0,-6.094]],"c":true},"ix":2},"nm":"路径 2","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":2,"s":[{"i":[[0,0],[0,0],[0,0],[1.374,-1.233],[0,0],[-1.366,-1.367],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[1.233,1.374],[0,0],[1.367,-1.367],[0,0],[0,0]],"o":[[0,0],[0,0],[-1.321,-1.321],[0,0],[-1.366,1.367],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[1.321,-1.321],[0,0],[-1.367,-1.367],[0,0],[0,0],[0,0]],"v":[[-1.414,-4.68],[-1.414,-4.68],[-2.475,-5.742],[-7.285,-5.874],[-7.425,-5.742],[-7.425,-0.792],[-6.364,0.27],[-6.362,0.268],[-4.749,1.889],[-4.747,1.887],[0,6.633],[4.95,1.684],[4.948,1.682],[6.362,0.266],[6.364,0.27],[7.425,-0.792],[7.557,-5.602],[7.425,-5.742],[2.475,-5.742],[1.682,-4.949],[-0.002,-3.275]],"c":true}]},{"t":7,"s":[{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[0.012,0.237],[0.059,0.187],[0.021,0.223],[0.09,0.22],[0.059,0.204],[0.075,0.177],[0.042,0.207],[0.044,0.205],[0.063,0.201],[0.066,0.199],[0.031,0.226],[0.044,0.215],[0.042,0.213],[0.049,0.235],[0.032,0.234],[0.034,0.24],[0.057,0.148],[0.011,0.235],[0.026,0.2],[0.088,0.176],[0.029,0.163]],"c":true}]}],"ix":2},"nm":"路径 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":3,"nm":"合并路径 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":7,"s":[0.40000000596,0.40000000596,0.40000000596,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":8,"s":[0.929411768913,0.156862750649,0,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":11,"s":[0.929411768913,0.156862750649,0,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":13,"s":[0.929411764706,0.156862745098,0,1]},{"t":20,"s":[0.929411764706,0.156862745098,0,1]}],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[12,11.756],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"组 1","np":4,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":30,"st":-8,"bm":0}],"markers":[]} |
| @@ -32,7 +32,7 @@ struct MainPage { | @@ -32,7 +32,7 @@ struct MainPage { | ||
| 32 | upgradeDialogController?: CustomDialogController | 32 | upgradeDialogController?: CustomDialogController |
| 33 | 33 | ||
| 34 | watchCurrentBreakpoint() { | 34 | watchCurrentBreakpoint() { |
| 35 | - Logger.info(TAG, `watchCurrentBreakpoint, this.currentBreakpoint: ${this.currentBreakpoint}`); | 35 | + // Logger.info(TAG, `watchCurrentBreakpoint, this.currentBreakpoint: ${this.currentBreakpoint}`); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | aboutToAppear() { | 38 | aboutToAppear() { |
| @@ -41,14 +41,14 @@ struct MainPage { | @@ -41,14 +41,14 @@ struct MainPage { | ||
| 41 | 41 | ||
| 42 | this.breakpointSystem.register() | 42 | this.breakpointSystem.register() |
| 43 | 43 | ||
| 44 | - Logger.info(TAG, `aboutToAppear `); | 44 | + // Logger.info(TAG, `aboutToAppear `); |
| 45 | EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => { | 45 | EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => { |
| 46 | LogoutViewModel.clearLoginInfo() | 46 | LogoutViewModel.clearLoginInfo() |
| 47 | }) | 47 | }) |
| 48 | 48 | ||
| 49 | - let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,'') as string | 49 | + let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_MOURNS_INFO_DATA_MODEL,'') as string |
| 50 | let dataModel : LaunchDataModel = JSON.parse(dataModelStr) | 50 | let dataModel : LaunchDataModel = JSON.parse(dataModelStr) |
| 51 | - console.log(dataModelStr) | 51 | + // console.log(dataModelStr) |
| 52 | // 处理国殇模式数据 | 52 | // 处理国殇模式数据 |
| 53 | let mourns: mournsInfoModel = dataModel.mourns as mournsInfoModel | 53 | let mourns: mournsInfoModel = dataModel.mourns as mournsInfoModel |
| 54 | let GrayManage = new GrayManageModel() | 54 | let GrayManage = new GrayManageModel() |
| @@ -63,22 +63,22 @@ struct MainPage { | @@ -63,22 +63,22 @@ struct MainPage { | ||
| 63 | 63 | ||
| 64 | aboutToDisappear() { | 64 | aboutToDisappear() { |
| 65 | this.breakpointSystem.unregister() | 65 | this.breakpointSystem.unregister() |
| 66 | - Logger.info(TAG, 'aboutToDisappear'); | 66 | + // Logger.info(TAG, 'aboutToDisappear'); |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | onPageHide() { | 69 | onPageHide() { |
| 70 | - Logger.info(TAG, 'onPageHide'); | 70 | + // Logger.info(TAG, 'onPageHide'); |
| 71 | this.pageHide = Math.random() | 71 | this.pageHide = Math.random() |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | onPageShow() { | 74 | onPageShow() { |
| 75 | - Logger.info(TAG, 'onPageShow'); | 75 | + // Logger.info(TAG, 'onPageShow'); |
| 76 | this.pageShow = Math.random() | 76 | this.pageShow = Math.random() |
| 77 | 77 | ||
| 78 | // 升级检查 | 78 | // 升级检查 |
| 79 | // this.upgradeCheck() | 79 | // this.upgradeCheck() |
| 80 | 80 | ||
| 81 | - Logger.debug('setBarBackgroundColor','Top onPageShow ') | 81 | + // Logger.debug('setBarBackgroundColor','Top onPageShow ') |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | upgradeCheck() { | 84 | upgradeCheck() { |
| @@ -104,8 +104,6 @@ struct MainPage { | @@ -104,8 +104,6 @@ struct MainPage { | ||
| 104 | }) | 104 | }) |
| 105 | this.upgradeDialogController?.open() | 105 | this.upgradeDialogController?.open() |
| 106 | } | 106 | } |
| 107 | - }).catch(() => { | ||
| 108 | - | ||
| 109 | }) | 107 | }) |
| 110 | } | 108 | } |
| 111 | 109 | ||
| @@ -115,13 +113,13 @@ struct MainPage { | @@ -115,13 +113,13 @@ struct MainPage { | ||
| 115 | // 拦截返回键,切到后台 | 113 | // 拦截返回键,切到后台 |
| 116 | const windowClass = WindowModel.shared.getWindowClass() as window.Window | 114 | const windowClass = WindowModel.shared.getWindowClass() as window.Window |
| 117 | windowClass.minimize().then(() => { | 115 | windowClass.minimize().then(() => { |
| 118 | - Logger.debug(TAG, 'Succeeded in minimizing the window.'); | 116 | + // Logger.debug(TAG, 'Succeeded in minimizing the window.'); |
| 119 | }).catch((err: BusinessError) => { | 117 | }).catch((err: BusinessError) => { |
| 120 | - Logger.error(TAG, 'Failed to minimize the window. Cause: ' + JSON.stringify(err)); | 118 | + // Logger.error(TAG, 'Failed to minimize the window. Cause: ' + JSON.stringify(err)); |
| 121 | return false | 119 | return false |
| 122 | }); | 120 | }); |
| 123 | } catch (err) { | 121 | } catch (err) { |
| 124 | - Logger.error(TAG, 'Failed to minimize: ' + JSON.stringify(err)); | 122 | + // Logger.error(TAG, 'Failed to minimize: ' + JSON.stringify(err)); |
| 125 | return false | 123 | return false |
| 126 | } | 124 | } |
| 127 | return true | 125 | return true |
| @@ -105,16 +105,13 @@ struct LaunchPage { | @@ -105,16 +105,13 @@ struct LaunchPage { | ||
| 105 | 105 | ||
| 106 | let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,'') as string | 106 | let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,'') as string |
| 107 | if (!dataModelStr) { | 107 | if (!dataModelStr) { |
| 108 | - this.requestLaunchPageData() | ||
| 109 | //直接跳转首页 | 108 | //直接跳转首页 |
| 110 | WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) | 109 | WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) |
| 111 | return | 110 | return |
| 112 | } | 111 | } |
| 113 | 112 | ||
| 114 | let dataModel : LaunchDataModel = JSON.parse(dataModelStr) | 113 | let dataModel : LaunchDataModel = JSON.parse(dataModelStr) |
| 115 | - console.log(dataModelStr) | ||
| 116 | - //同意隐私协议后每次启动app请求启动页相关数据,并更新数据 | ||
| 117 | - this.requestLaunchPageData(); | 114 | + // console.log(dataModelStr) |
| 118 | 115 | ||
| 119 | if (dataModel.launchPageInfo || dataModel.launchAdInfo.length) { | 116 | if (dataModel.launchPageInfo || dataModel.launchAdInfo.length) { |
| 120 | //跳转广告页 | 117 | //跳转广告页 |
| @@ -126,6 +123,8 @@ struct LaunchPage { | @@ -126,6 +123,8 @@ struct LaunchPage { | ||
| 126 | //直接跳转首页 | 123 | //直接跳转首页 |
| 127 | WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) | 124 | WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) |
| 128 | } | 125 | } |
| 126 | + //同意隐私协议后每次启动app请求启动页相关数据,并更新数据 | ||
| 127 | + this.requestLaunchPageData(); | ||
| 129 | } | 128 | } |
| 130 | }); | 129 | }); |
| 131 | }); | 130 | }); |
| @@ -194,8 +193,15 @@ struct LaunchPage { | @@ -194,8 +193,15 @@ struct LaunchPage { | ||
| 194 | launchPageModel.getLaunchPageData() | 193 | launchPageModel.getLaunchPageData() |
| 195 | } | 194 | } |
| 196 | 195 | ||
| 196 | + requestMournsInfoData() { | ||
| 197 | + //请求国殇模式数据并保存 | ||
| 198 | + let launchPageModel = new LaunchPageModel() | ||
| 199 | + launchPageModel.getMournsInfoData() | ||
| 200 | + } | ||
| 201 | + | ||
| 197 | aboutToAppear(): void { | 202 | aboutToAppear(): void { |
| 198 | this.requestAgreement() | 203 | this.requestAgreement() |
| 204 | + this.requestMournsInfoData() | ||
| 199 | } | 205 | } |
| 200 | 206 | ||
| 201 | 207 |
| 1 | import { AudioSuspensionModel } from 'wdComponent' | 1 | import { AudioSuspensionModel } from 'wdComponent' |
| 2 | import { PlayerConstants, DateFormatUtil } from 'wdPlayer' | 2 | import { PlayerConstants, DateFormatUtil } from 'wdPlayer' |
| 3 | -import { EmitterEventId, EmitterUtils } from 'wdKit/Index' | 3 | +import { EmitterEventId, EmitterUtils, SPHelper } from 'wdKit/Index' |
| 4 | import window from '@ohos.window'; | 4 | import window from '@ohos.window'; |
| 5 | import lottie from '@ohos/lottie'; | 5 | import lottie from '@ohos/lottie'; |
| 6 | import { LottieView } from 'wdComponent/Index' | 6 | import { LottieView } from 'wdComponent/Index' |
| 7 | +// import { ProcessUtils } from 'wdRouter'; | ||
| 8 | +// import { CompInfoBean, ContentDTO } from 'wdBean'; | ||
| 9 | +// import { SpConstants } from 'wdConstant'; | ||
| 7 | 10 | ||
| 8 | const TAG = 'AudioSuspensionModel' | 11 | const TAG = 'AudioSuspensionModel' |
| 9 | 12 | ||
| @@ -153,6 +156,19 @@ struct Index { | @@ -153,6 +156,19 @@ struct Index { | ||
| 153 | .width(243) | 156 | .width(243) |
| 154 | .height(60) | 157 | .height(60) |
| 155 | .justifyContent(FlexAlign.Start) | 158 | .justifyContent(FlexAlign.Start) |
| 159 | + // .onClick(() => { | ||
| 160 | + // let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_NEWS_INFO_DATA_MODEL,'') as string | ||
| 161 | + // console.log(TAG, dataModelStr) | ||
| 162 | + // let dataModel : CompInfoBean = JSON.parse(dataModelStr) | ||
| 163 | + // //公共跳转 | ||
| 164 | + // let content: ContentDTO = { | ||
| 165 | + // objectId: this.itemBeanClicked.newsId + '', | ||
| 166 | + // objectType: this.itemBeanClicked.newsType + '', | ||
| 167 | + // relId: this.itemBeanClicked.relId + '', | ||
| 168 | + // relType: this.itemBeanClicked.relType ?? '0' | ||
| 169 | + // } as ContentDTO | ||
| 170 | + // ProcessUtils.processPage(content) | ||
| 171 | + // }) | ||
| 156 | 172 | ||
| 157 | Row() { | 173 | Row() { |
| 158 | Image(this.currentStatus === PlayerConstants.STATUS_START ? $r("app.media.icon_audio_pause_svg") : $r("app.media.icon_audio_playing_svg")) | 174 | Image(this.currentStatus === PlayerConstants.STATUS_START ? $r("app.media.icon_audio_pause_svg") : $r("app.media.icon_audio_playing_svg")) |
| @@ -276,7 +276,7 @@ export struct MultiPictureDetailPageComponent { | @@ -276,7 +276,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 276 | }.alignItems(VerticalAlign.Center) | 276 | }.alignItems(VerticalAlign.Center) |
| 277 | } | 277 | } |
| 278 | .borderRadius(4) | 278 | .borderRadius(4) |
| 279 | - .backgroundColor('#333333') | 279 | + .backgroundColor('#33FFFFFF') |
| 280 | .width(54) | 280 | .width(54) |
| 281 | .height(24) | 281 | .height(24) |
| 282 | .onClick(() => { | 282 | .onClick(() => { |
| @@ -20,15 +20,41 @@ export class LaunchPageModel { | @@ -20,15 +20,41 @@ export class LaunchPageModel { | ||
| 20 | fail(data.message) | 20 | fail(data.message) |
| 21 | return | 21 | return |
| 22 | } | 22 | } |
| 23 | - Logger.debug("LaunchPageModel获取启动相关数据获取成功:success ", JSON.stringify(data)) | 23 | + // Logger.debug("LaunchPageModel获取启动相关数据获取成功:success ", JSON.stringify(data)) |
| 24 | success(data.data); | 24 | success(data.data); |
| 25 | //存储数据 | 25 | //存储数据 |
| 26 | let obj : string = JSON.stringify(data.data) | 26 | let obj : string = JSON.stringify(data.data) |
| 27 | - console.log(obj) | 27 | + // console.log(obj) |
| 28 | SPHelper.default.saveSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,obj) | 28 | SPHelper.default.saveSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,obj) |
| 29 | 29 | ||
| 30 | }, (error: Error) => { | 30 | }, (error: Error) => { |
| 31 | - Logger.debug("LaunchPageModel获取启动相关数据获取失败:error ", error.toString()) | 31 | + // Logger.debug("LaunchPageModel获取启动相关数据获取失败:error ", error.toString()) |
| 32 | + fail(error.message) | ||
| 33 | + }) | ||
| 34 | + }) | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + getMournsInfoData(): Promise<LaunchDataModel> { | ||
| 38 | + return new Promise<LaunchDataModel>((success, fail) => { | ||
| 39 | + HttpRequest.get<ResponseDTO<LaunchDataModel>>(HttpUrlUtils.getLaunchPageDataUrl()).then((data: ResponseDTO<LaunchDataModel>) => { | ||
| 40 | + if (!data || !data.data) { | ||
| 41 | + fail("数据为空") | ||
| 42 | + return | ||
| 43 | + } | ||
| 44 | + if (data.code != 0) { | ||
| 45 | + fail(data.message) | ||
| 46 | + return | ||
| 47 | + } | ||
| 48 | + // Logger.debug("LaunchPageModel获取启动相关数据获取成功:success ", JSON.stringify(data)) | ||
| 49 | + // 处理国殇模式数据 | ||
| 50 | + success(data.data); | ||
| 51 | + //存储数据 | ||
| 52 | + let obj : string = JSON.stringify(data.data) | ||
| 53 | + // console.log(obj) | ||
| 54 | + SPHelper.default.saveSync(SpConstants.APP_MOURNS_INFO_DATA_MODEL,obj) | ||
| 55 | + | ||
| 56 | + }, (error: Error) => { | ||
| 57 | + // Logger.debug("LaunchPageModel获取启动相关数据获取失败:error ", error.toString()) | ||
| 32 | fail(error.message) | 58 | fail(error.message) |
| 33 | }) | 59 | }) |
| 34 | }) | 60 | }) |
| @@ -141,6 +141,7 @@ export class StartupManager { | @@ -141,6 +141,7 @@ export class StartupManager { | ||
| 141 | 141 | ||
| 142 | GetuiPush.sharedInstance().requestEnableNotifications(this.context!).then((enabled) => { | 142 | GetuiPush.sharedInstance().requestEnableNotifications(this.context!).then((enabled) => { |
| 143 | HWLocationUtils.startLocationService() | 143 | HWLocationUtils.startLocationService() |
| 144 | + SPHelper.default.save(SpConstants.SETTING_PUSH_SWITCH,enabled) | ||
| 144 | }) | 145 | }) |
| 145 | 146 | ||
| 146 | GetuiPush.sharedInstance().onReachMainPage() | 147 | GetuiPush.sharedInstance().onReachMainPage() |
-
Please register or login to post a comment