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
zhangbo1_wd
2024-05-18 15:37:43 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
71ae0550c8da3d8f77191953e9ff02d1e62b7ec5
71ae0550
1 parent
5a6316f4
首页下拉、上拉,添加断网toast
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 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 @
71ae055
import { CompDTO, ContentDTO, InteractDataDTO, LiveReviewDTO, LiveRoomDataBean, PageDTO, PageInfoDTO } from 'wdBean';
import { CompStyle, ViewType } from 'wdConstant/Index';
import { CollectionUtils, DateTimeUtils, LazyDataSource, Logger, NetworkUtil, StringUtils } from 'wdKit';
import { CollectionUtils, DateTimeUtils, LazyDataSource, Logger, NetworkUtil, StringUtils
, ToastUtils
} from 'wdKit';
import { closeRefresh } from '../utils/PullDownRefresh';
import PageModel from './PageModel';
import PageViewModel from './PageViewModel';
...
...
@@ -33,6 +33,14 @@ export class PageHelper {
* 刷新数据
*/
async refreshUI(pageModel: PageModel, pageAdvModel: PageAdModel) {
let netStatus = NetworkUtil.isNetConnected()
if (!netStatus) {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
setTimeout(() => {
closeRefresh(pageModel, false)
}, 500)
return
}
pageModel.loadStrategy = 2
pageModel.pageTotalCompSize = 0;
this.getPageInfo(pageModel, pageAdvModel)
...
...
@@ -42,6 +50,11 @@ export class PageHelper {
* 分页加载
*/
async loadMore(pageModel: PageModel) {
let netStatus = NetworkUtil.isNetConnected()
if (!netStatus) {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
return
}
pageModel.loadStrategy = 3
// 暂只支持comp分页加载,节目分页加载的得完善框架(如直播回看节目数据分页)
this.compLoadMore(pageModel)
...
...
Please
register
or
login
to post a comment