diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 07706a4..5f0544e 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -108,33 +108,33 @@ android { // 应用信息配置 -// productFlavors { -// // 智夜生活 -// zhiying { -// applicationId "cn.zhios.zhiying" -// versionCode 28 -// dimension "app" -// versionName '1.2.28' -// // 签名信息 -// signingConfig signingConfigs.zhiying -// } -// } -// -// // 打包脚本 -// android.applicationVariants.all { variant -> -// if (variant.buildType.name != "debug") { -// variant.getPackageApplicationProvider().get().outputDirectory = new File(project.rootDir.absolutePath + "/app/build/outputs/apk") -// } -// -// variant.outputs.all { output -> -// def outputFile = output.outputFile -// if (outputFile != null && outputFile.name.endsWith('.apk')) { -// //这里修改apk文件名 -// def fileName = "${variant.productFlavors[0].name}_${releaseTime()}01_&V${variant.productFlavors[0].versionCode}.apk" -// outputFileName = fileName -// } -// } -// } + productFlavors { + // 智夜生活 + zhiying { + applicationId "cn.zhios.zhiying" + versionCode 28 + dimension "app" + versionName '1.2.28' + // 签名信息 + signingConfig signingConfigs.zhiying + } + } + + // 打包脚本 + android.applicationVariants.all { variant -> + if (variant.buildType.name != "debug") { + variant.getPackageApplicationProvider().get().outputDirectory = new File(project.rootDir.absolutePath + "/app/build/outputs/apk") + } + + variant.outputs.all { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.apk')) { + //这里修改apk文件名 + def fileName = "${variant.productFlavors[0].name}_${releaseTime()}01_&V${variant.productFlavors[0].versionCode}.apk" + outputFileName = fileName + } + } + } configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> diff --git a/lib/pages/custom_page/custom_page.dart b/lib/pages/custom_page/custom_page.dart index f1a76c5..213a6ac 100644 --- a/lib/pages/custom_page/custom_page.dart +++ b/lib/pages/custom_page/custom_page.dart @@ -411,8 +411,7 @@ class __CommonPageContainerState extends State<_CommonPageContainer> with Single ///监听页面滚动 _listenScroller(double offset) { - print(offset.toString()); - if (offset > 0) { + if (offset >= 0) { backgroundTopMargin = -offset; if (backgroundTopMargin > -500) { backgroundBloc.streamController.add(""); diff --git a/lib/pages/main_page/main_page.dart b/lib/pages/main_page/main_page.dart index 210e276..8631da6 100644 --- a/lib/pages/main_page/main_page.dart +++ b/lib/pages/main_page/main_page.dart @@ -218,7 +218,7 @@ class _MainPageContainerState extends State<_MainPageContainer> { if (_bloc.backgroundModel != null) { var headerBg = _bloc.backgroundModel.headerBg; return Container( - height: double.tryParse(_bloc?.backgroundModel?.headerBg?.height)?? 0, + height: double.tryParse(_bloc?.backgroundModel?.headerBg?.height)?? 0, decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.topCenter, diff --git a/lib/pages/main_page/main_page_bloc.dart b/lib/pages/main_page/main_page_bloc.dart index cb6f9be..997a15b 100644 --- a/lib/pages/main_page/main_page_bloc.dart +++ b/lib/pages/main_page/main_page_bloc.dart @@ -38,7 +38,13 @@ class MainPageBloc extends BlocBase { _pageData = list.map((item) { return Map.from(item); }).toList(); - backgroundModel=BackgroundModel.fromJson(Con.json.decode(json['out_data'])); + try{ + backgroundModel=BackgroundModel.fromJson(Con.json.decode(json['out_data'])); + }catch(e,s){ + print(e); + print(s); + } + _mainController.add(_pageData); } }