Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
1 changed file
with
28 additions
and
1 deletions
| 1 | import { CompDTO, ContentDTO, InteractDataDTO, LiveReviewDTO, LiveRoomDataBean, PageDTO, PageInfoDTO } from 'wdBean'; | 1 | import { CompDTO, ContentDTO, InteractDataDTO, LiveReviewDTO, LiveRoomDataBean, PageDTO, PageInfoDTO } from 'wdBean'; |
| 2 | -import { CompStyle, ViewType } from 'wdConstant/Index'; | 2 | +import { CompStyle, ContentConstants, ViewType } from 'wdConstant/Index'; |
| 3 | import { CollectionUtils, DateTimeUtils, LazyDataSource, Logger, NetworkUtil, StringUtils, ToastUtils } from 'wdKit'; | 3 | import { CollectionUtils, DateTimeUtils, LazyDataSource, Logger, NetworkUtil, StringUtils, ToastUtils } from 'wdKit'; |
| 4 | import { closeRefresh } from '../utils/PullDownRefresh'; | 4 | import { closeRefresh } from '../utils/PullDownRefresh'; |
| 5 | import PageModel from './PageModel'; | 5 | import PageModel from './PageModel'; |
| @@ -15,6 +15,7 @@ import { viewBlogInsightIntentShare, ActionMode } from '../utils/InsightIntentSh | @@ -15,6 +15,7 @@ import { viewBlogInsightIntentShare, ActionMode } from '../utils/InsightIntentSh | ||
| 15 | import { common } from '@kit.AbilityKit'; | 15 | import { common } from '@kit.AbilityKit'; |
| 16 | import { CacheData } from 'wdNetwork/Index'; | 16 | import { CacheData } from 'wdNetwork/Index'; |
| 17 | import { closeLoadMore } from '../utils/PullUpLoadMore'; | 17 | import { closeLoadMore } from '../utils/PullUpLoadMore'; |
| 18 | +import { webview } from '@kit.ArkWeb'; | ||
| 18 | 19 | ||
| 19 | const TAG = 'PageHelper'; | 20 | const TAG = 'PageHelper'; |
| 20 | 21 | ||
| @@ -258,6 +259,8 @@ export class PageHelper { | @@ -258,6 +259,8 @@ export class PageHelper { | ||
| 258 | 259 | ||
| 259 | // 批查互动数据 | 260 | // 批查互动数据 |
| 260 | this.allCompBatchRequest(pageInfo.oneRequestPageGroupCompList.convertToArray(), pageModel) | 261 | this.allCompBatchRequest(pageInfo.oneRequestPageGroupCompList.convertToArray(), pageModel) |
| 262 | + // 提前预加载H5专题 | ||
| 263 | + this.preloadH5Topic(pageInfo.oneRequestPageGroupCompList.convertToArray()) | ||
| 261 | // 记录第一页数量 | 264 | // 记录第一页数量 |
| 262 | this.saveFirstPageEndIndex(pageModel) | 265 | this.saveFirstPageEndIndex(pageModel) |
| 263 | if (!isCache) { | 266 | if (!isCache) { |
| @@ -349,6 +352,8 @@ export class PageHelper { | @@ -349,6 +352,8 @@ export class PageHelper { | ||
| 349 | this.loadMorePageComp(pageModel, data) | 352 | this.loadMorePageComp(pageModel, data) |
| 350 | // 参与批查 | 353 | // 参与批查 |
| 351 | this.allCompBatchRequest(data.compList, pageModel) | 354 | this.allCompBatchRequest(data.compList, pageModel) |
| 355 | + // 提前预加载H5专题 | ||
| 356 | + this.preloadH5Topic(data.compList) | ||
| 352 | } | 357 | } |
| 353 | }).catch((err: string | Resource) => { | 358 | }).catch((err: string | Resource) => { |
| 354 | promptAction.showToast({ message: err }); | 359 | promptAction.showToast({ message: err }); |
| @@ -489,6 +494,28 @@ export class PageHelper { | @@ -489,6 +494,28 @@ export class PageHelper { | ||
| 489 | } | 494 | } |
| 490 | 495 | ||
| 491 | /** | 496 | /** |
| 497 | + * 预加载H5专题 | ||
| 498 | + * @param compList | ||
| 499 | + */ | ||
| 500 | + private preloadH5Topic(compList: CompDTO[]) { | ||
| 501 | + | ||
| 502 | + compList.forEach((comp) => { | ||
| 503 | + comp.operDataList.forEach((program) => { | ||
| 504 | + if (program.objectType != ContentConstants.TYPE_SPECIAL_TOPIC) { | ||
| 505 | + return | ||
| 506 | + } | ||
| 507 | + if (program.objectLevel == "22" || program.objectLevel == "25") { // 音频专题 和 早晚报专题 | ||
| 508 | + return | ||
| 509 | + } | ||
| 510 | + if (program.linkUrl.length > 0) { | ||
| 511 | + Logger.debug(TAG, "预加载H5专题link: " + program.linkUrl) | ||
| 512 | + webview.WebviewController.prepareForPageLoad(program.linkUrl, true, 2) | ||
| 513 | + } | ||
| 514 | + }) | ||
| 515 | + }) | ||
| 516 | + } | ||
| 517 | + | ||
| 518 | + /** | ||
| 492 | * 直播回看的批查数据 | 519 | * 直播回看的批查数据 |
| 493 | * @param list | 520 | * @param list |
| 494 | * @param compList | 521 | * @param compList |
-
Please register or login to post a comment