From db32e98c40bdf5ff489b988f86352ea91f29028c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyanghuaxuan=E2=80=9D?= <“646903573@qq.com”> Date: Thu, 8 Apr 2021 17:07:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.=E4=BC=98=E5=8C=96ios=E4=BE=A7=E8=BE=B9?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/android/app/build.gradle | 58 +++++++++---------- .../MainActivity.java | 14 ++--- lib/pages/home_page/home_page.dart | 24 +++++--- 3 files changed, 51 insertions(+), 45 deletions(-) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 717c98b..290c9a5 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -53,8 +53,8 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" ndk { //选择要添加的对应cpu类型的.so库。 - // abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a' - abiFilters 'armeabi-v7a','x86_64' + abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a' + // abiFilters 'armeabi-v7a','x86_64' } } @@ -109,33 +109,33 @@ android { // 应用信息配置 - productFlavors { - // 智夜生活 - zhiying { - applicationId "cn.zhios.zhiying" - versionCode 60 - dimension "app" - versionName '1.3.20' - // 签名信息 - 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 60 +// dimension "app" +// versionName '1.3.20' +// // 签名信息 +// 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/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java b/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java index 32365c6..d29c59e 100644 --- a/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java +++ b/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java @@ -154,15 +154,15 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN @Override public Map getSetting() { Map map = new HashMap(); -// ///测试 -// map.put("domain", "http://inapi.izhyin.cn/");//"http://120.76.175.204:8989");http://47.114.51.254:80 http://inapi.izhyin.cn/ -// map.put("master_id", "123456"); -// map.put("secret_key", "123456"); + ///测试 + map.put("domain", "http://inapi.izhyin.cn/");//"http://120.76.175.204:8989");http://47.114.51.254:80 http://inapi.izhyin.cn/ + map.put("master_id", "123456"); + map.put("secret_key", "123456"); ///正式 - map.put("domain", "http://api.zhios.cn/");//45678910,api.zhios.cn84198689 - map.put("master_id", "99813608"); - map.put("secret_key", "123456"); +// map.put("domain", "http://api.zhios.cn/");//45678910,api.zhios.cn84198689 +// map.put("master_id", "99813608"); +// map.put("secret_key", "123456"); //客户测试 // map.put("domain", "http://api.zhios.cn/");//45678910,api.zhios.cn84198689 diff --git a/lib/pages/home_page/home_page.dart b/lib/pages/home_page/home_page.dart index f7dbbe6..53b8f77 100644 --- a/lib/pages/home_page/home_page.dart +++ b/lib/pages/home_page/home_page.dart @@ -59,7 +59,7 @@ class HomePage extends StatefulWidget { _HomePageState createState() => _HomePageState(); } -class _HomePageState extends LifeState with WidgetsBindingObserver, TickerProviderStateMixin { +class _HomePageState extends LifeState with WidgetsBindingObserver, TickerProviderStateMixin, AutomaticKeepAliveClientMixin { int _currentIndex = 0; List> _data = List(); static const EventChannel _eventChannel = const EventChannel('JAVA_TO_FLUTTER'); @@ -70,7 +70,7 @@ class _HomePageState extends LifeState with WidgetsBindingObserver, Ti StreamSubscription logOutSubscription; StreamSubscription loginSubscription; - StreamSubscription eventChannelSubscription; + StreamSubscription eventChannelSubscription; @override void initState() { @@ -126,7 +126,7 @@ class _HomePageState extends LifeState with WidgetsBindingObserver, Ti //app后台杀死时候的还原 Moblink.restoreScene(_restore); // 监听开始(传递监听到原生端,用户监听场景还原的数据回传回来) - eventChannelSubscription= _eventChannel.receiveBroadcastStream().listen(_onEvent, onError: _onError); + eventChannelSubscription = _eventChannel.receiveBroadcastStream().listen(_onEvent, onError: _onError); MobPushUtil.addPushReceiver(); aliasSubscription = EventUtil.instance.on().listen((event) async { @@ -153,13 +153,10 @@ class _HomePageState extends LifeState with WidgetsBindingObserver, Ti MobPushUtil.setAlias(masterId + "_" + userInfo.userId); } }); - - } catch (e, s) { print(e); print(s); } - } initBaseSet() { @@ -194,6 +191,11 @@ class _HomePageState extends LifeState with WidgetsBindingObserver, Ti super.didChangeAppLifecycleState(state); } + @override + void didUpdateWidget(covariant HomePage oldWidget) { + super.didUpdateWidget(oldWidget); + } + @override Widget build(BuildContext context) { ScreenUtil.init(context, width: 750, height: 1334); @@ -401,12 +403,15 @@ class _HomePageState extends LifeState with WidgetsBindingObserver, Ti print("首页调用可见"); IntellectCreate.setCheck(true); } + + @override + // TODO: implement wantKeepAlive + bool get wantKeepAlive => true; } final RouteObserver lifeObserver = RouteObserver(); -abstract class LifeState extends State - with RouteAware { +abstract class LifeState extends State with RouteAware { @override void initState() { super.initState(); @@ -424,13 +429,14 @@ abstract class LifeState extends State super.dispose(); } - void didPop() { onPaused(); } void didPopNext() { onResume(); + print("回到首页"); + setState(() {}); } void didPush() { From d1282d6972b4c96f9ad77fe43c48c750c2bf06c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyanghuaxuan=E2=80=9D?= <“646903573@qq.com”> Date: Thu, 8 Apr 2021 17:41:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E5=AE=9D=E7=BB=91=E5=AE=9A=E9=AA=8C=E8=AF=81=E7=A0=81=E4=BD=8D?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../security_bind_alipay/security_bind_alipay_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/security_page/security_bind_alipay/security_bind_alipay_page.dart b/lib/pages/security_page/security_bind_alipay/security_bind_alipay_page.dart index 6653791..abd19ab 100644 --- a/lib/pages/security_page/security_bind_alipay/security_bind_alipay_page.dart +++ b/lib/pages/security_page/security_bind_alipay/security_bind_alipay_page.dart @@ -80,7 +80,7 @@ class _SecurityBindAlipayContainerState void _verifiy() { bool canConfirm = _nameController.text.length > 0 && _accountController.text.length > 0 && - _codeController.text.length >= 4 && _codeController.text.length <= 4; + _codeController.text.length >= 4 && _codeController.text.length <= 6; if (canConfirm != _canConfirm) { setState(() { _canConfirm = canConfirm;