From f6fba1498cc33799e1543ed15f614c339309a66e Mon Sep 17 00:00:00 2001 From: Daisy <> Date: Tue, 30 Apr 2024 16:31:40 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=80=89=E4=B8=AD=E9=82=AE=E7=AE=B1=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=9B=BE=E7=89=87=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= =?UTF-8?q?bugID=E4=B8=BA=EF=BC=9AID1001493?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- star_lock/images/icon_login_email.png | Bin 0 -> 1529 bytes .../register/starLock_register_page.dart | 135 +++++++++--------- 2 files changed, 71 insertions(+), 64 deletions(-) create mode 100644 star_lock/images/icon_login_email.png diff --git a/star_lock/images/icon_login_email.png b/star_lock/images/icon_login_email.png new file mode 100644 index 0000000000000000000000000000000000000000..7e11d815409756ab45d68a925d3081c852b7592d GIT binary patch literal 1529 zcmV zuo4a&JeWw~vd1~Bi6na9;Du!8xbeaQHNk{~i3r8kYE2I%vWb{p)`GN@LW7B|e=3$b zY4@4-YY*jzS1OeWtJOM0D^5>OUnY@Ar1imr2bXC(SgqC}rBayy!0&4} z<)t7h5{a}D0NB{rXq}mv>7(sfW;jXI%*;$*Bob)_0J5`(w8yFZE zB7_JySR79X5e5bZs3^PL-kXa8@?pRZZf!2iJ>_&d&B0*MfC7^Sg~ej&1fZALNB{Qi z+t;yJjMUfHFJ~86mQ9^FapFlJ5cm^?6srqeqX-fk427!ZV@yVqgHE zkHuo5IF@C<3XWlzk+WydilSClR*FFZGGM?C?%lh0sWWHJtYjBhmQ5W$e%uob27f?_ zIEG2|x3 zPN#pD(8~lF11*N?*$-We`!@Yd@5)8wjy}jL&UC`-taR9>} zj|Zt#N=fM)PY4m(+uNzAr%#`@?EwV<*b58*@bTlvpK055I$d0+(_NdIn))pki|v}B zuq?aO*Vp%_Seu_ee^%|aUweV^b#-+fv)O!4YNrgq@AsUaz;M*ap2`Z_DE1V*lvq=q*~kv$J#h z)TvV*$i&Hk@fwY0p}V_V6qQUSRRB1j&v#{he!d{i>-Dzye7-9HI6)AOis3F?xNxto zu1*%N*yk8uQ&Y1bwoI3e+S#Pv+}zxXMx&&mp<$VJjKkru`2GH#>|;`?)ZZ^&yy$3Y zX>sN5-_+Ff&*tXlPw(Hq4;RtjdFJ-*+kZfMiB;F8ItYHVz5m{#oS>YCDMGz*Zp=fq%qRaMpVo}L~mYGPtyKT(-T;x1mi zI9XFuBZ{NJc(q#XlR_mDiTy@pB8jtDETXtv7_U~VeZ9TCf6*E`U{odran;q;&yj=6 zJ7Z!fo6UCp5Kx(L$z)PBK0bbfR-}ysc`(}gz0GF3{^`>vH4gW461Tm*%}z{Ao z%@aZdiP=Fpgl8B=NT<`(H*~QVO)iy6?Q_5O98T=}IZ*nGX4&UE>|4us*teGdEi5zK fm&1QJzH0sj|AWbA8!cls00000NkvXXu0mjf`nc>} literal 0 HcmV?d00001 diff --git a/star_lock/lib/login/register/starLock_register_page.dart b/star_lock/lib/login/register/starLock_register_page.dart index b23883c5..dd2d5bbe 100644 --- a/star_lock/lib/login/register/starLock_register_page.dart +++ b/star_lock/lib/login/register/starLock_register_page.dart @@ -78,7 +78,8 @@ class _StarLockRegisterPageState extends State { // color: Colors.red, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(30.h)), - border: Border.all(width: 1.0, color: AppColors.greyLineColor)), + border: + Border.all(width: 1.0, color: AppColors.greyLineColor)), child: Row( children: [ GestureDetector( @@ -146,40 +147,42 @@ class _StarLockRegisterPageState extends State { state.countryCode.value = result['code']; state.countryName.value = result['countryName']; } - AppLog.log("路由返回值: $result, countryCode:${logic.state.countryCode}"); + AppLog.log( + "路由返回值: $result, countryCode:${logic.state.countryCode}"); }, child: Obx(() => SizedBox( - height: 70.h, - child: Row( - children: [ - SizedBox(width: 5.w), - Expanded( - child: Text("${"你所在的".tr}${TranslationLoader.lanKeys!.countryAndRegion!.tr}", - style: TextStyle( - fontSize: 26.sp, color: AppColors.blackColor))), - SizedBox(width: 20.w), - Row( - mainAxisAlignment: MainAxisAlignment.end, + height: 70.h, + child: Row( children: [ - Text( - state.isIphoneType.value - ? '${state.countryName.value} +${state.countryCode.value}' - : state.countryName.value, - textAlign: TextAlign.end, - style: TextStyle( - fontSize: 26.sp, color: AppColors.blackColor), - ) + SizedBox(width: 5.w), + Expanded( + child: Text( + "${"你所在的".tr}${TranslationLoader.lanKeys!.countryAndRegion!.tr}", + style: TextStyle( + fontSize: 26.sp, color: AppColors.blackColor))), + SizedBox(width: 20.w), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text( + state.isIphoneType.value + ? '${state.countryName.value} +${state.countryCode.value}' + : state.countryName.value, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 26.sp, color: AppColors.blackColor), + ) + ], + ), + SizedBox(width: 5.w), + Image.asset( + 'images/icon_right.png', + width: 50.w, + height: 50.w, + ), ], ), - SizedBox(width: 5.w), - Image.asset( - 'images/icon_right.png', - width: 50.w, - height: 50.w, - ), - ], - ), - )), + )), ), Container( height: 0.5.h, @@ -193,26 +196,29 @@ class _StarLockRegisterPageState extends State { return Column( children: [ Obx(() => LoginInput( - controller: state.phoneOrEmailController, - onchangeAction: (v) { - logic.checkNext(state.phoneOrEmailController); - }, - leftWidget: - // Image.asset('images/icon_login_account.png', width: 30.w, height: 30.w,), - Padding( - padding: EdgeInsets.only(right: 10.w, left: 5.w), - child: Image.asset( - 'images/icon_login_account.png', - width: 30.w, - height: 30.w, - ), - ), - hintText: "${TranslationLoader.lanKeys!.pleaseEnter!.tr}${state.isIphoneType.value ? "手机号".tr : TranslationLoader.lanKeys!.email!.tr}", - keyboardType: TextInputType.number, - inputFormatters: [ - // FilteringTextInputFormatter.allow(RegExp('[0-9]')), - LengthLimitingTextInputFormatter(30), - ])), + controller: state.phoneOrEmailController, + onchangeAction: (v) { + logic.checkNext(state.phoneOrEmailController); + }, + leftWidget: + // Image.asset('images/icon_login_account.png', width: 30.w, height: 30.w,), + Padding( + padding: EdgeInsets.only(right: 10.w, left: 5.w), + child: Image.asset( + state.isIphoneType.value + ? 'images/icon_login_account.png' + : "images/icon_login_email.png", + width: 30.w, + height: 30.w, + ), + ), + hintText: + "${TranslationLoader.lanKeys!.pleaseEnter!.tr}${state.isIphoneType.value ? "手机号".tr : TranslationLoader.lanKeys!.email!.tr}", + keyboardType: TextInputType.number, + inputFormatters: [ + // FilteringTextInputFormatter.allow(RegExp('[0-9]')), + LengthLimitingTextInputFormatter(30), + ])), SizedBox(height: 10.w), LoginInput( controller: state.pwdController, @@ -285,20 +291,21 @@ class _StarLockRegisterPageState extends State { width: 20.w, ), Obx(() => GestureDetector( - onTap: state.phoneOrEmailStrIsOK.value && state.canResend.value - ? () async { - // Navigator.pushNamed(context, Routers.safetyVerificationPage, arguments: {"countryCode":"+86", "account":state.phoneOrEmailStr.value}); - var result = await Navigator.pushNamed( - context, Routers.safetyVerificationPage, - arguments: { - "countryCode": state.countryCode, - "account": state.phoneOrEmailStr.value - }); - state.xWidth.value = - (result as Map)['xWidth']; - logic.sendValidationCode(); - } - : null, + onTap: + state.phoneOrEmailStrIsOK.value && state.canResend.value + ? () async { + // Navigator.pushNamed(context, Routers.safetyVerificationPage, arguments: {"countryCode":"+86", "account":state.phoneOrEmailStr.value}); + var result = await Navigator.pushNamed( + context, Routers.safetyVerificationPage, + arguments: { + "countryCode": state.countryCode, + "account": state.phoneOrEmailStr.value + }); + state.xWidth.value = + (result as Map)['xWidth']; + logic.sendValidationCode(); + } + : null, child: Container( width: 180.w, // height: 60.h, From f49f7712b711d0d451897c20fff77e20d65a4e1b Mon Sep 17 00:00:00 2001 From: anfe <448468458@qq.com> Date: Fri, 3 May 2024 09:21:08 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=E9=91=AB=E6=B3=93?= =?UTF-8?q?=E4=BD=B3=E9=A6=96=E9=A1=B5=E4=BA=8C=E6=AC=A1=E9=80=80=E5=87=BA?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- star_lock/ios/Podfile.lock | 2 +- star_lock/lib/flavors.dart | 2 ++ .../lockMain/xhj/lockMain_xhj_logic.dart | 2 ++ .../lockMain/xhj/lockMain_xhj_page.dart | 1 + star_lock/lib/mine/mall/lockMall_logic.dart | 30 +++++++++++++++---- 5 files changed, 31 insertions(+), 6 deletions(-) diff --git a/star_lock/ios/Podfile.lock b/star_lock/ios/Podfile.lock index e962a17c..c1b43709 100644 --- a/star_lock/ios/Podfile.lock +++ b/star_lock/ios/Podfile.lock @@ -316,7 +316,7 @@ SPEC CHECKSUMS: flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907 flutter_pcm_sound: de0572ca4f99091cc2abfcc31601b8a4ddd33c0e flutter_voice_processor: 2b89b93d69b02227ae3fd58589ee0bcfa3ca2a82 - fluttertoast: 9f2f8e81bb5ce18facb9748d7855bf5a756fe3db + fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265 fluwx: daa284756ce53442b3d0417ceeda66e981906811 google_maps_flutter_ios: d1318b4ff711612cab16862d7a87e31a7403d458 GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4 diff --git a/star_lock/lib/flavors.dart b/star_lock/lib/flavors.dart index 3f1e4d38..9d350755 100644 --- a/star_lock/lib/flavors.dart +++ b/star_lock/lib/flavors.dart @@ -28,6 +28,8 @@ class F { static String get name => appFlavor?.name ?? ''; + static bool get isXHJ => appFlavor == Flavor.xhj; + //便捷判断并返回值 static dynamic sw( {required fCallFunction defaultCall, fCallFunction? xhjCall}) { diff --git a/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_logic.dart b/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_logic.dart index 3d01639f..0e28f379 100644 --- a/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_logic.dart +++ b/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_logic.dart @@ -15,6 +15,8 @@ class LockMainXHJLogic extends BaseGetXController { update(); } + bool get isMall => state.index ==1; + //打开设备弹窗 void openEquipment() { showModalBottomSheet( diff --git a/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart b/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart index 8f604e46..4cf3cd43 100644 --- a/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart +++ b/star_lock/lib/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart @@ -25,6 +25,7 @@ class StarLockMainXHJPage extends StatefulWidget { class _StarLockMainXHJPageState extends State with BaseWidget { + @override void initState() { super.initState(); diff --git a/star_lock/lib/mine/mall/lockMall_logic.dart b/star_lock/lib/mine/mall/lockMall_logic.dart index 1532c65e..5f7741e3 100644 --- a/star_lock/lib/mine/mall/lockMall_logic.dart +++ b/star_lock/lib/mine/mall/lockMall_logic.dart @@ -1,8 +1,12 @@ import 'dart:convert'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:fluttertoast/fluttertoast.dart'; import 'package:fluwx/fluwx.dart'; import 'package:get/get.dart'; +import 'package:star_lock/flavors.dart'; +import 'package:star_lock/main/lockMian/lockMain/xhj/lockMain_xhj_logic.dart'; import 'package:star_lock/mine/mall/lockMall_entity.dart'; import 'package:star_lock/mine/mall/lockMall_state.dart'; import 'package:star_lock/network/api_repository.dart'; @@ -16,8 +20,10 @@ import '../../tools/baseGetXController.dart'; class LockMallLogic extends BaseGetXController { late LockMallState state; + DateTime? _lastPressedAt; // 记录上一次按下返回键的时间 + LockMallLogic({required bool allowReturn}) - : state = LockMallState(allowReturn: allowReturn ); + : state = LockMallState(allowReturn: allowReturn); //获取商城跳转地址 Future getMallURLRequest() async { @@ -98,19 +104,33 @@ class LockMallLogic extends BaseGetXController { //判断webview 是否可以有路由可以回退,无则退出当前页面 Future canGoBack(bool didPop) async { bool canGoBack = await state.mallWebView.canGoBack(); - if (canGoBack) { + bool isMall = true; + if (Get.isRegistered() && F.isXHJ) { + isMall = Get.find().isMall; + } + if (canGoBack && isMall) { await state.mallWebView.goBack(); - } else if (state.allowReturn) { + } else if (state.allowReturn && isMall) { Get.back(); + } else { + if (_lastPressedAt == null || + DateTime.now().difference(_lastPressedAt!) > Duration(seconds: 2)) { + // 如果两次返回键时间间隔大于 2 秒,则提示再次按下返回键退出 + _lastPressedAt = DateTime.now(); + showToast('再返回一次退出${F.title}'); + return false; // 阻止返回操作 + } + SystemNavigator.pop(); + return true; } refreshGoBack(); return false; } //刷新当前路由状态 - void refreshGoBack(){ + void refreshGoBack() { //如果属于一直返回按钮,则根据是否有路由可以回退刷新 - if(state.allowReturn){ + if (state.allowReturn) { return; } state.mallWebView.canGoBack().then((value) { From ac9024e499c35870f156448652a1f32f6d3c5acf Mon Sep 17 00:00:00 2001 From: anfe <448468458@qq.com> Date: Fri, 3 May 2024 09:22:36 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=E6=89=93=E5=8C=85=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- star_lock/pubspec.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/star_lock/pubspec.yaml b/star_lock/pubspec.yaml index 8616ddd8..71d1dd87 100644 --- a/star_lock/pubspec.yaml +++ b/star_lock/pubspec.yaml @@ -38,8 +38,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # 1.0.28+2024042601 打包鑫锁提审华为 # 1.0.29+2024042901 打包给欧阳测试 # 1.0.30+2024043001 打包鑫锁提审ios +# 1.0.31+2024050301 打包鑫锁提审华为 -version: 1.0.30+2024043001 +version: 1.0.31+2024050301 environment: sdk: '>=2.12.0 <3.0.0'