Showing
15 changed files
with
41 additions
and
42 deletions
| 1 | 1 | ||
| 2 | export { PageViewModel } from "./viewmodel/PageViewModel" | 2 | export { PageViewModel } from "./viewmodel/PageViewModel" |
| 3 | 3 | ||
| 4 | -export { EmptyComponent } from "./components/EmptyComponent" | 4 | +export { EmptyComponent } from "./components/view/EmptyComponent" |
| 5 | 5 | ||
| 6 | -export { ErrorComponent } from "./components/ErrorComponent" | 6 | +export { ErrorComponent } from "./components/view/ErrorComponent" |
| 7 | 7 | ||
| 8 | -export { LoadingComponent } from "./components/LoadingComponent" | 8 | +export { LoadingComponent } from "./components/view/LoadingComponent" |
| 9 | 9 | ||
| 10 | -export { PageComponent } from "./components/PageComponent" | 10 | +export { PageComponent } from "./components/page/PageComponent" |
| 11 | 11 | ||
| 12 | -export { BottomNavigationComponent } from "./components/BottomNavigationComponent" | 12 | +export { BottomNavigationComponent } from "./components/view/BottomNavigationComponent" |
| 13 | 13 | ||
| 14 | -export { TopNavigationComponent } from "./components/TopNavigationComponent" | 14 | +export { TopNavigationComponent } from "./components/view/TopNavigationComponent" |
| 15 | 15 | ||
| 16 | -export { LabelComponent } from "./components/LabelComponent" | 16 | +export { LabelComponent } from "./components/view/LabelComponent" |
| 17 | 17 | ||
| 18 | -export { SmallVideoCardComponent } from "./components/SmallVideoCardComponent" | 18 | +export { SmallVideoCardComponent } from "./components/view/SmallVideoCardComponent" |
| 19 | 19 | ||
| 20 | -export { BannerComponent } from "./components/BannerComponent" | 20 | +export { BannerComponent } from "./components/view/BannerComponent" |
| 21 | 21 |
| 1 | import { CommonConstants, CompStyle } from 'wdConstant'; | 1 | import { CommonConstants, CompStyle } from 'wdConstant'; |
| 2 | import { CompDTO } from '../repository/bean/CompDTO'; | 2 | import { CompDTO } from '../repository/bean/CompDTO'; |
| 3 | -import { BannerComponent } from './BannerComponent'; | ||
| 4 | -import { LabelComponent } from './LabelComponent'; | ||
| 5 | -import { TitleAbbrComponent } from './TitleAbbrComponent'; | ||
| 6 | -import { TitleAllComponent } from './TitleAllComponent'; | 3 | +import { BannerComponent } from './view/BannerComponent'; |
| 4 | +import { LabelComponent } from './view/LabelComponent'; | ||
| 5 | +import { TitleAbbrComponent } from './view/TitleAbbrComponent'; | ||
| 6 | +import { TitleAllComponent } from './view/TitleAllComponent'; | ||
| 7 | 7 | ||
| 8 | /** | 8 | /** |
| 9 | * comp适配器. | 9 | * comp适配器. |
| 1 | import { CommonConstants, ViewType } from 'wdConstant'; | 1 | import { CommonConstants, ViewType } from 'wdConstant'; |
| 2 | import { Logger } from 'wdKit'; | 2 | import { Logger } from 'wdKit'; |
| 3 | -import { CompDTO } from '../repository/bean/CompDTO'; | ||
| 4 | -import PageViewModel from '../viewmodel/PageViewModel'; | ||
| 5 | -import { EmptyComponent } from './EmptyComponent'; | ||
| 6 | -import { ErrorComponent } from './ErrorComponent'; | ||
| 7 | -import PageModel from '../viewmodel/PageModel'; | ||
| 8 | -import { listTouchEvent } from '../utils/PullDownRefresh'; | ||
| 9 | -import RefreshLayout from './page/RefreshLayout'; | ||
| 10 | -import { RefreshLayoutBean } from './page/RefreshLayoutBean'; | ||
| 11 | -import NoMoreLayout from './page/NoMoreLayout'; | ||
| 12 | -import LoadMoreLayout from './page/LoadMoreLayout'; | ||
| 13 | -import CustomRefreshLoadLayout from './page/CustomRefreshLoadLayout'; | ||
| 14 | -import { CompParser } from './CompParser'; | 3 | +import { CompDTO } from '../../repository/bean/CompDTO'; |
| 4 | +import PageViewModel from '../../viewmodel/PageViewModel'; | ||
| 5 | +import { EmptyComponent } from '../view/EmptyComponent'; | ||
| 6 | +import { ErrorComponent } from '../view/ErrorComponent'; | ||
| 7 | +import PageModel from '../../viewmodel/PageModel'; | ||
| 8 | +import { listTouchEvent } from '../../utils/PullDownRefresh'; | ||
| 9 | +import RefreshLayout from './RefreshLayout'; | ||
| 10 | +import { RefreshLayoutBean } from './RefreshLayoutBean'; | ||
| 11 | +import NoMoreLayout from './NoMoreLayout'; | ||
| 12 | +import LoadMoreLayout from './LoadMoreLayout'; | ||
| 13 | +import CustomRefreshLoadLayout from './CustomRefreshLoadLayout'; | ||
| 14 | +import { CompParser } from '../CompParser'; | ||
| 15 | 15 | ||
| 16 | const TAG = 'PageComponent'; | 16 | const TAG = 'PageComponent'; |
| 17 | 17 | ||
| 18 | @Component | 18 | @Component |
| 19 | export struct PageComponent { | 19 | export struct PageComponent { |
| 20 | - // @State viewType: number = ViewType.LOADING; | ||
| 21 | - // Group数据及子组件数据 | ||
| 22 | - // @State compList: LazyDataSource<CompDTO> = new LazyDataSource(); | ||
| 23 | @State private pageModel: PageModel = new PageModel(); | 20 | @State private pageModel: PageModel = new PageModel(); |
| 24 | navIndex: number = 0; | 21 | navIndex: number = 0; |
| 25 | pageId: string = ""; | 22 | pageId: string = ""; |
| @@ -6,9 +6,9 @@ | @@ -6,9 +6,9 @@ | ||
| 6 | 6 | ||
| 7 | import { CommonConstants } from 'wdConstant'; | 7 | import { CommonConstants } from 'wdConstant'; |
| 8 | import colorSpaceManager from '@ohos.graphics.colorSpaceManager'; | 8 | import colorSpaceManager from '@ohos.graphics.colorSpaceManager'; |
| 9 | -import { CompDTO } from '../repository/bean/CompDTO'; | ||
| 10 | -import { CompUtils } from '../utils/CompUtils'; | ||
| 11 | -import { ContentDTO } from '../repository/bean/ContentDTO'; | 9 | +import { CompDTO } from '../../repository/bean/CompDTO'; |
| 10 | +import { CompUtils } from '../../utils/CompUtils'; | ||
| 11 | +import { ContentDTO } from '../../repository/bean/ContentDTO'; | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | const TAG = 'BannerComponent'; | 14 | const TAG = 'BannerComponent'; |
| 1 | import { BottomNavi, CommonConstants } from 'wdConstant'; | 1 | import { BottomNavi, CommonConstants } from 'wdConstant'; |
| 2 | import { Logger } from 'wdKit'; | 2 | import { Logger } from 'wdKit'; |
| 3 | import { TopNavigationComponent } from './TopNavigationComponent'; | 3 | import { TopNavigationComponent } from './TopNavigationComponent'; |
| 4 | -import { BottomNavDTO } from '../repository/bean/BottomNavDTO'; | ||
| 5 | -import { UIUtils } from '../repository/UIUtils'; | ||
| 6 | -import { MinePageComponent } from './MinePageComponent'; | ||
| 7 | -import PageViewModel from '../viewmodel/PageViewModel'; | 4 | +import { BottomNavDTO } from '../../repository/bean/BottomNavDTO'; |
| 5 | +import { UIUtils } from '../../repository/UIUtils'; | ||
| 6 | +import { MinePageComponent } from '../page/MinePageComponent'; | ||
| 7 | +import PageViewModel from '../../viewmodel/PageViewModel'; | ||
| 8 | 8 | ||
| 9 | const TAG = 'BottomNavigationComponent'; | 9 | const TAG = 'BottomNavigationComponent'; |
| 10 | 10 |
| 1 | import { CommonConstants } from 'wdConstant'; | 1 | import { CommonConstants } from 'wdConstant'; |
| 2 | -import { CompDTO } from '../repository/bean/CompDTO'; | ||
| 3 | -import { CompUtils } from '../utils/CompUtils'; | 2 | +import { CompDTO } from '../../repository/bean/CompDTO'; |
| 3 | +import { CompUtils } from '../../utils/CompUtils'; | ||
| 4 | 4 | ||
| 5 | const TAG = 'LabelComponent'; | 5 | const TAG = 'LabelComponent'; |
| 6 | 6 |
| 1 | //缩略标题 | 1 | //缩略标题 |
| 2 | import { CommonConstants } from 'wdConstant' | 2 | import { CommonConstants } from 'wdConstant' |
| 3 | -import { CompDTO } from '../repository/bean/CompDTO' | 3 | +import { CompDTO } from '../../repository/bean/CompDTO' |
| 4 | 4 | ||
| 5 | @Component | 5 | @Component |
| 6 | export struct TitleAbbrComponent { | 6 | export struct TitleAbbrComponent { |
| 1 | //全标题 "compStyle":"3", | 1 | //全标题 "compStyle":"3", |
| 2 | import { CommonConstants } from 'wdConstant' | 2 | import { CommonConstants } from 'wdConstant' |
| 3 | -import { CompDTO } from '../repository/bean/CompDTO' | 3 | +import { CompDTO } from '../../repository/bean/CompDTO' |
| 4 | 4 | ||
| 5 | @Component | 5 | @Component |
| 6 | export struct TitleAllComponent { | 6 | export struct TitleAllComponent { |
| 1 | import { LazyDataSource, Logger } from 'wdKit'; | 1 | import { LazyDataSource, Logger } from 'wdKit'; |
| 2 | -import { CompDTO } from '../repository/bean/CompDTO'; | ||
| 3 | -import { TopNavDTO } from '../repository/bean/TopNavDTO'; | ||
| 4 | -import { PageComponent } from './PageComponent'; | 2 | +import { CompDTO } from '../../repository/bean/CompDTO'; |
| 3 | +import { TopNavDTO } from '../../repository/bean/TopNavDTO'; | ||
| 4 | +import { PageComponent } from '../page/PageComponent'; | ||
| 5 | 5 | ||
| 6 | const TAG = 'TopNavigationComponent'; | 6 | const TAG = 'TopNavigationComponent'; |
| 7 | 7 |
| @@ -4,10 +4,12 @@ import { CompDTO } from '../repository/bean/CompDTO'; | @@ -4,10 +4,12 @@ import { CompDTO } from '../repository/bean/CompDTO'; | ||
| 4 | import { RefreshConstants as Const } from '../utils/RefreshConstants'; | 4 | import { RefreshConstants as Const } from '../utils/RefreshConstants'; |
| 5 | 5 | ||
| 6 | export default class PageModel { | 6 | export default class PageModel { |
| 7 | + // 页面数据 | ||
| 7 | pageId: string = ""; | 8 | pageId: string = ""; |
| 8 | groupId: string = ""; | 9 | groupId: string = ""; |
| 9 | channelId: string = ""; | 10 | channelId: string = ""; |
| 10 | compList: LazyDataSource<CompDTO> = new LazyDataSource(); | 11 | compList: LazyDataSource<CompDTO> = new LazyDataSource(); |
| 12 | + // 页面状态,刷新、加载更多等 | ||
| 11 | currentPage: number = 1; | 13 | currentPage: number = 1; |
| 12 | pageSize: number = Const.PAGE_SIZE; | 14 | pageSize: number = Const.PAGE_SIZE; |
| 13 | pullDownRefreshText: Resource = $r('app.string.pull_down_refresh_text'); | 15 | pullDownRefreshText: Resource = $r('app.string.pull_down_refresh_text'); |
-
Please register or login to post a comment