From 2178a622db91d63c7e7e2da8fbceee6bcd41af08 Mon Sep 17 00:00:00 2001 From: anfe <448468458@qq.com> Date: Mon, 29 Apr 2024 15:11:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=20feat:=E8=A1=A5=E5=85=85=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- star_lock/images/lan/lan_en.json | 3 ++- star_lock/images/lan/lan_keys.json | 3 ++- star_lock/images/lan/lan_zh.json | 3 ++- star_lock/lib/blue/blue_manage.dart | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/star_lock/images/lan/lan_en.json b/star_lock/images/lan/lan_en.json index aa38c480..0a123b0c 100644 --- a/star_lock/images/lan/lan_en.json +++ b/star_lock/images/lan/lan_en.json @@ -802,5 +802,6 @@ "的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。": "The entire content of. By clicking \"Agree\", you agree and accept all terms. If you choose not to agree, you will not be able to use our products and services and will exit the application.", "不同意":"Disagree", "同意":"agree", - "常用程序":"Common Programs" + "常用程序":"Common Programs", + "该锁已被重置":"The lock has been reset" } diff --git a/star_lock/images/lan/lan_keys.json b/star_lock/images/lan/lan_keys.json index 7e0ecda3..2f59836b 100644 --- a/star_lock/images/lan/lan_keys.json +++ b/star_lock/images/lan/lan_keys.json @@ -801,5 +801,6 @@ "的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。": "的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。", "不同意":"不同意", "同意":"同意", - "常用程序":"常用程序" + "常用程序":"常用程序", + "该锁已被重置":"该锁已被重置" } diff --git a/star_lock/images/lan/lan_zh.json b/star_lock/images/lan/lan_zh.json index c49440be..7af243f2 100644 --- a/star_lock/images/lan/lan_zh.json +++ b/star_lock/images/lan/lan_zh.json @@ -804,7 +804,8 @@ "的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。": "的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。", "不同意":"不同意", "同意":"同意", - "常用程序":"常用程序" + "常用程序":"常用程序", + "该锁已被重置":"该锁已被重置" } diff --git a/star_lock/lib/blue/blue_manage.dart b/star_lock/lib/blue/blue_manage.dart index 40f196c7..0c34dd25 100644 --- a/star_lock/lib/blue/blue_manage.dart +++ b/star_lock/lib/blue/blue_manage.dart @@ -391,7 +391,7 @@ class BlueManage { if ((scanResult!.advertisementData.serviceUuids[0].toString()[31] == "0") && isAddEquipment == false) { connectStateCallBack(BluetoothConnectionState.disconnected); - EasyLoading.showToast("该锁已被重置", duration: 2000.milliseconds); + EasyLoading.showToast("该锁已被重置".tr, duration: 2000.milliseconds); return; } From dd87cb6243f473a32fd339502d2af7db6ef7e008 Mon Sep 17 00:00:00 2001 From: anfe <448468458@qq.com> Date: Mon, 29 Apr 2024 15:13:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=20fix:=E4=BF=AE=E5=A4=8D=E9=91=AB=E6=B3=93?= =?UTF-8?q?=E4=BD=B3=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../login/login/starLock_login_xhj_page.dart | 210 +++++++++--------- .../minePersonInfo_page.dart | 88 ++++---- 2 files changed, 156 insertions(+), 142 deletions(-) diff --git a/star_lock/lib/login/login/starLock_login_xhj_page.dart b/star_lock/lib/login/login/starLock_login_xhj_page.dart index 15ac2e42..14f7b99a 100644 --- a/star_lock/lib/login/login/starLock_login_xhj_page.dart +++ b/star_lock/lib/login/login/starLock_login_xhj_page.dart @@ -23,7 +23,9 @@ class StarLockLoginXHJPage extends StatefulWidget { class _StarLockLoginPageState extends State { final logic = Get.put(StarLockLoginLogic()); - final state = Get.find().state; + final state = Get + .find() + .state; @override Widget build(BuildContext context) { @@ -65,11 +67,14 @@ class _StarLockLoginPageState extends State { SizedBox( width: 40.w, ), - Text( - '${state.countryName.value} +${state.countryCode.value}', - style: TextStyle( - fontSize: 22.sp, color: AppColors.mainColor), - ) + Obx(() { + return Text( + '${state.countryName.value} +${state.countryCode + .value}', + style: TextStyle( + fontSize: 22.sp, color: AppColors.mainColor), + ); + }) ], ), ), @@ -109,7 +114,8 @@ class _StarLockLoginPageState extends State { ), ), label: - "${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.password!.tr}", + "${TranslationLoader.lanKeys!.pleaseEnter! + .tr}${TranslationLoader.lanKeys!.password!.tr}", inputFormatters: [ LengthLimitingTextInputFormatter(20), ]), @@ -125,83 +131,90 @@ class _StarLockLoginPageState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ Obx( - () => Container( - padding: EdgeInsets.only( - left: 5.w, - right: 10.w, - ), - child: Image.asset( - state.agree.value - ? 'images/icon_round_select.png' - : 'images/icon_round_unSelect.png', - width: 20.w, - height: 20.w, - ), - ), + () => + Container( + padding: EdgeInsets.only( + left: 5.w, + right: 10.w, + ), + child: Image.asset( + state.agree.value + ? 'images/icon_round_select.png' + : 'images/icon_round_unSelect.png', + width: 20.w, + height: 20.w, + ), + ), ), Flexible( child: RichText( text: TextSpan( - text: TranslationLoader.lanKeys!.readAndAgree!.tr, - style: TextStyle( - color: const Color(0xff333333), fontSize: 20.sp), - children: [ - WidgetSpan( - alignment: PlaceholderAlignment.middle, - child: GestureDetector( - child: Text( - '《${TranslationLoader.lanKeys!.userAgreement!.tr}》', - style: TextStyle( - color: AppColors.mainColor, - fontSize: 20.sp)), - onTap: () { - Get.toNamed(Routers.webviewShowPage, - arguments: { - "url": XSConstantMacro.userAgreementURL, - "title": '用户协议'.tr - }); - }, - )), - WidgetSpan( - alignment: PlaceholderAlignment.middle, - child: GestureDetector( - child: Text( - '《${TranslationLoader.lanKeys!.privacyPolicy!.tr}》', - style: TextStyle( - color: AppColors.mainColor, - fontSize: 20.sp)), - onTap: () { - Get.toNamed(Routers.webviewShowPage, - arguments: { - "url": XSConstantMacro.privacyPolicyURL, - "title": '隐私政策'.tr - }); - }, - )), - ], - )), + text: TranslationLoader.lanKeys!.readAndAgree!.tr, + style: TextStyle( + color: const Color(0xff333333), + fontSize: 20.sp), + children: [ + WidgetSpan( + alignment: PlaceholderAlignment.middle, + child: GestureDetector( + child: Text( + '《${TranslationLoader.lanKeys! + .userAgreement!.tr}》', + style: TextStyle( + color: AppColors.mainColor, + fontSize: 20.sp)), + onTap: () { + Get.toNamed(Routers.webviewShowPage, + arguments: { + "url": XSConstantMacro + .userAgreementURL, + "title": '用户协议'.tr + }); + }, + )), + WidgetSpan( + alignment: PlaceholderAlignment.middle, + child: GestureDetector( + child: Text( + '《${TranslationLoader.lanKeys! + .privacyPolicy!.tr}》', + style: TextStyle( + color: AppColors.mainColor, + fontSize: 20.sp)), + onTap: () { + Get.toNamed(Routers.webviewShowPage, + arguments: { + "url": XSConstantMacro + .privacyPolicyURL, + "title": '隐私政策'.tr + }); + }, + )), + ], + )), ) ], ), ), ), SizedBox(height: 15.w), - Obx(() => SubmitBtn( - btnName: TranslationLoader.lanKeys!.login!.tr, - fontSize: 28.sp, - borderRadius: 20.w, - padding: EdgeInsets.only(top: 25.w, bottom: 25.w), - isDisabled: state.canNext.value, - onClick: state.canNext.value - ? () { - if (state.agree.value == false) { - logic.showToast('请先同意用户协议及隐私政策'.tr); - return; - } else { - logic.login(); - } + Obx(() => + SubmitBtn( + btnName: TranslationLoader.lanKeys!.login!.tr, + fontSize: 28.sp, + borderRadius: 20.w, + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + isDisabled: state.canNext.value, + onClick: state.canNext.value + ? () { + if (state.agree.value == false) { + logic.showToast('请先同意用户协议及隐私政策'.tr); + return; + } else { + logic.login(); } - : null)), + } + : null)), SizedBox(height: 10.h), ElevatedButton( onPressed: () async { @@ -243,41 +256,40 @@ class _StarLockLoginPageState extends State { ), Expanded( child: SizedBox( - width: 10.sp, - )), + width: 10.sp, + )), F.isLite ? Container() : GestureDetector( - child: SizedBox( - // width: 150.w, - height: 50.h, - // color: Colors.red, - child: Center( - child: Text('演示模式'.tr, - style: TextStyle( - fontSize: 22.sp, - color: AppColors.mainColor)), - ), - ), - onTap: () { - Get.toNamed(Routers.demoModeLockDetailPage); - }, - ) + child: SizedBox( + // width: 150.w, + height: 50.h, + // color: Colors.red, + child: Center( + child: Text('演示模式'.tr, + style: TextStyle( + fontSize: 22.sp, + color: AppColors.mainColor)), + ), + ), + onTap: () { + Get.toNamed(Routers.demoModeLockDetailPage); + }, + ) ], ), ], )); } - Widget loginInput( - {TextEditingController? controller, - List? inputFormatters, - String? hintText, - bool? isHaveLeftWidget, - Widget? leftWidget, - String? label, - bool? isPwd, - BlockStrCallback? onchangeAction}) { + Widget loginInput({TextEditingController? controller, + List? inputFormatters, + String? hintText, + bool? isHaveLeftWidget, + Widget? leftWidget, + String? label, + bool? isPwd, + BlockStrCallback? onchangeAction}) { return Container( width: 1.sp, child: Column( diff --git a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart index b61e14f1..e47dba72 100644 --- a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart +++ b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart @@ -39,49 +39,51 @@ class _MinePersonInfoPageState extends State { : null, body: Column( children: [ - Container( - width: 1.sw, - height: 0.2.sw, - margin: EdgeInsets.symmetric(horizontal: 15.w), - padding: EdgeInsets.symmetric(horizontal: 25.w), - decoration: BoxDecoration( - image: const DecorationImage( - image: AssetImage('images/xhj_main_bg.jpg'), - fit: BoxFit.cover, - ), - borderRadius: BorderRadius.circular(20.r), - boxShadow: [ - BoxShadow( - color: Colors.black.withOpacity(0.15), - offset: const Offset(0, 0), - blurRadius: 10.r, - spreadRadius: 0, - ), - ], - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - '系统设置', - style: TextStyle( - color: AppColors.blackColor, - fontSize: 28.sp, - fontWeight: FontWeight.w600, - ), - ), - Text( - '系统的全局配置在此项内进行设置', - style: TextStyle( - color: AppColors.blackColor.withOpacity(0.6), - fontSize: 20.sp, - fontWeight: FontWeight.w600, - ), - ), - ], - ), - ), + F.sw( + defaultCall: () => SizedBox(), + xhjCall: () => Container( + width: 1.sw, + height: 0.2.sw, + margin: EdgeInsets.symmetric(horizontal: 15.w), + padding: EdgeInsets.symmetric(horizontal: 25.w), + decoration: BoxDecoration( + image: const DecorationImage( + image: AssetImage('images/xhj_main_bg.jpg'), + fit: BoxFit.cover, + ), + borderRadius: BorderRadius.circular(20.r), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.15), + offset: const Offset(0, 0), + blurRadius: 10.r, + spreadRadius: 0, + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + '系统设置', + style: TextStyle( + color: AppColors.blackColor, + fontSize: 28.sp, + fontWeight: FontWeight.w600, + ), + ), + Text( + '系统的全局配置在此项内进行设置', + style: TextStyle( + color: AppColors.blackColor.withOpacity(0.6), + fontSize: 20.sp, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + )), SizedBox( height: 20.h, ),