From 91bf7170706b996585dcdc170e4c7e64acacf553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyanghuaxuan=E2=80=9D?= <“646903573@qq.com”> Date: Fri, 15 Jan 2021 17:53:19 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E9=A1=B5=E9=9D=A2=E6=97=A0?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E5=AF=B9=E5=83=8F=E6=97=B6=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/android/app/build.gradle | 54 ++++++++++++------------- lib/pages/custom_page/custom_page.dart | 3 +- lib/pages/main_page/main_page.dart | 2 +- lib/pages/main_page/main_page_bloc.dart | 8 +++- 4 files changed, 36 insertions(+), 31 deletions(-) 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); } }