Showing
1 changed file
with
8 additions
and
2 deletions
| @@ -12,6 +12,7 @@ import { StartupManager } from '../startupmanager/StartupManager'; | @@ -12,6 +12,7 @@ import { StartupManager } from '../startupmanager/StartupManager'; | ||
| 12 | import { BusinessError } from '@kit.BasicServicesKit'; | 12 | import { BusinessError } from '@kit.BasicServicesKit'; |
| 13 | import { BottomNavigationComponent } from './view/BottomNavigationComponent'; | 13 | import { BottomNavigationComponent } from './view/BottomNavigationComponent'; |
| 14 | import LaunchDataModel from './viewModel/LaunchDataModel'; | 14 | import LaunchDataModel from './viewModel/LaunchDataModel'; |
| 15 | +import { LaunchPageModel } from './viewModel/LaunchPageModel'; | ||
| 15 | 16 | ||
| 16 | const TAG = 'MainPage'; | 17 | const TAG = 'MainPage'; |
| 17 | 18 | ||
| @@ -44,7 +45,13 @@ struct MainPage { | @@ -44,7 +45,13 @@ struct MainPage { | ||
| 44 | }) | 45 | }) |
| 45 | 46 | ||
| 46 | let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,'') as string | 47 | let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,'') as string |
| 47 | - if (dataModelStr) { | 48 | + if (!dataModelStr) { |
| 49 | + //请求启动页相关接口数据并保存 | ||
| 50 | + let launchPageModel = new LaunchPageModel() | ||
| 51 | + launchPageModel.getLaunchPageData() | ||
| 52 | + dataModelStr = SPHelper.default.getSync(SpConstants.APP_LAUNCH_PAGE_DATA_MODEL,'') as string | ||
| 53 | + | ||
| 54 | + } | ||
| 48 | let dataModel : LaunchDataModel = JSON.parse(dataModelStr) | 55 | let dataModel : LaunchDataModel = JSON.parse(dataModelStr) |
| 49 | console.log(dataModelStr) | 56 | console.log(dataModelStr) |
| 50 | // 处理国殇模式数据 | 57 | // 处理国殇模式数据 |
| @@ -53,7 +60,6 @@ struct MainPage { | @@ -53,7 +60,6 @@ struct MainPage { | ||
| 53 | GrayManage.setMourning(mourns) | 60 | GrayManage.setMourning(mourns) |
| 54 | AppStorage.setOrCreate('GrayManage', GrayManage) | 61 | AppStorage.setOrCreate('GrayManage', GrayManage) |
| 55 | } | 62 | } |
| 56 | - } | ||
| 57 | 63 | ||
| 58 | pageTransition() { | 64 | pageTransition() { |
| 59 | PageTransitionEnter({ type: RouteType.None, duration: 0 }) | 65 | PageTransitionEnter({ type: RouteType.None, duration: 0 }) |
-
Please register or login to post a comment