Showing
1 changed file
with
14 additions
and
8 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,15 +45,20 @@ struct MainPage { | @@ -44,15 +45,20 @@ 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 | - let dataModel : LaunchDataModel = JSON.parse(dataModelStr) | ||
| 49 | - console.log(dataModelStr) | ||
| 50 | - // 处理国殇模式数据 | ||
| 51 | - let mourns: mournsInfoModel = dataModel.mourns as mournsInfoModel | ||
| 52 | - let GrayManage = new GrayManageModel() | ||
| 53 | - GrayManage.setMourning(mourns) | ||
| 54 | - AppStorage.setOrCreate('GrayManage', GrayManage) | 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 | + | ||
| 55 | } | 54 | } |
| 55 | + let dataModel : LaunchDataModel = JSON.parse(dataModelStr) | ||
| 56 | + console.log(dataModelStr) | ||
| 57 | + // 处理国殇模式数据 | ||
| 58 | + let mourns: mournsInfoModel = dataModel.mourns as mournsInfoModel | ||
| 59 | + let GrayManage = new GrayManageModel() | ||
| 60 | + GrayManage.setMourning(mourns) | ||
| 61 | + AppStorage.setOrCreate('GrayManage', GrayManage) | ||
| 56 | } | 62 | } |
| 57 | 63 | ||
| 58 | pageTransition() { | 64 | pageTransition() { |
-
Please register or login to post a comment