Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
xugenyuan
2024-09-12 14:46:47 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a6bf1c051ac15105c281db7722b637062d2eec5a
a6bf1c05
1 parent
f58c756f
ref |> 使用web控件提前预加载H5专题
Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletions
sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageHelper.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageHelper.ets
View file @
a6bf1c0
import { CompDTO, ContentDTO, InteractDataDTO, LiveReviewDTO, LiveRoomDataBean, PageDTO, PageInfoDTO } from 'wdBean';
import { CompStyle, ViewType } from 'wdConstant/Index';
import { CompStyle,
ContentConstants,
ViewType } from 'wdConstant/Index';
import { CollectionUtils, DateTimeUtils, LazyDataSource, Logger, NetworkUtil, StringUtils, ToastUtils } from 'wdKit';
import { closeRefresh } from '../utils/PullDownRefresh';
import PageModel from './PageModel';
...
...
@@ -15,6 +15,7 @@ import { viewBlogInsightIntentShare, ActionMode } from '../utils/InsightIntentSh
import { common } from '@kit.AbilityKit';
import { CacheData } from 'wdNetwork/Index';
import { closeLoadMore } from '../utils/PullUpLoadMore';
import { webview } from '@kit.ArkWeb';
const TAG = 'PageHelper';
...
...
@@ -258,6 +259,8 @@ export class PageHelper {
// 批查互动数据
this.allCompBatchRequest(pageInfo.oneRequestPageGroupCompList.convertToArray(), pageModel)
// 提前预加载H5专题
this.preloadH5Topic(pageInfo.oneRequestPageGroupCompList.convertToArray())
// 记录第一页数量
this.saveFirstPageEndIndex(pageModel)
if (!isCache) {
...
...
@@ -349,6 +352,8 @@ export class PageHelper {
this.loadMorePageComp(pageModel, data)
// 参与批查
this.allCompBatchRequest(data.compList, pageModel)
// 提前预加载H5专题
this.preloadH5Topic(data.compList)
}
}).catch((err: string | Resource) => {
promptAction.showToast({ message: err });
...
...
@@ -489,6 +494,28 @@ export class PageHelper {
}
/**
* 预加载H5专题
* @param compList
*/
private preloadH5Topic(compList: CompDTO[]) {
compList.forEach((comp) => {
comp.operDataList.forEach((program) => {
if (program.objectType != ContentConstants.TYPE_SPECIAL_TOPIC) {
return
}
if (program.objectLevel == "22" || program.objectLevel == "25") { // 音频专题 和 早晚报专题
return
}
if (program.linkUrl.length > 0) {
Logger.debug(TAG, "预加载H5专题link: " + program.linkUrl)
webview.WebviewController.prepareForPageLoad(program.linkUrl, true, 2)
}
})
})
}
/**
* 直播回看的批查数据
* @param list
* @param compList
...
...
Please
register
or
login
to post a comment