From ad8cdc279b03057a320db3caf86b6e17f2107c59 Mon Sep 17 00:00:00 2001 From: Daisy <> Date: Fri, 8 Mar 2024 13:55:47 +0800 Subject: [PATCH] =?UTF-8?q?1=EF=BC=8C=E4=B8=8A=E6=9E=B6=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E7=B1=BB=E6=B3=A8=E9=87=8A=202=EF=BC=8C=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=9A=90=E7=A7=81=E5=8D=8F=E8=AE=AE=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E6=A1=86=E5=8F=8A=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/login/login/starLock_login_page.dart | 2 +- .../lib/login/login/starLock_login_state.dart | 2 - .../register/starLock_register_logic.dart | 26 +++++----- .../register/starLock_register_page.dart | 51 +++++++++++-------- .../register/starLock_register_state.dart | 1 + star_lock/lib/main.dart | 1 + .../main/lockMian/lockMain/lockMain_page.dart | 2 +- .../mine/mineSet/mineSet/mineSet_page.dart | 49 +++++++++--------- .../lib/network/request_interceptor.dart | 5 +- 9 files changed, 74 insertions(+), 65 deletions(-) diff --git a/star_lock/lib/login/login/starLock_login_page.dart b/star_lock/lib/login/login/starLock_login_page.dart index 0267be71..6e34d4e5 100644 --- a/star_lock/lib/login/login/starLock_login_page.dart +++ b/star_lock/lib/login/login/starLock_login_page.dart @@ -198,7 +198,7 @@ class _StarLockLoginPageState extends State { child: SizedBox( width: 10.sp, )), - //提交Google暂时屏蔽 + //上架审核注释 提交Google暂时屏蔽 // GestureDetector( // child: SizedBox( // // width: 150.w, diff --git a/star_lock/lib/login/login/starLock_login_state.dart b/star_lock/lib/login/login/starLock_login_state.dart index ddd026a4..37d65040 100644 --- a/star_lock/lib/login/login/starLock_login_state.dart +++ b/star_lock/lib/login/login/starLock_login_state.dart @@ -1,8 +1,6 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; -import '../../tools/store_service.dart'; - class StarLockLoginState { var passwordShow = true.obs; var agree = false.obs; diff --git a/star_lock/lib/login/register/starLock_register_logic.dart b/star_lock/lib/login/register/starLock_register_logic.dart index a5073aab..051cd906 100644 --- a/star_lock/lib/login/register/starLock_register_logic.dart +++ b/star_lock/lib/login/register/starLock_register_logic.dart @@ -30,11 +30,11 @@ class StarLockRegisterLogic extends BaseGetXController { void register() async { var entity = await ApiRepository.to.register( - receiverType:state.isIphoneType.value == true ? 1 : 2, - countryCode:state.countryCode.value, - account:state.phoneOrEmailStr.value, - password:state.pwd.value, - verificationCode:state.verificationCode.value); + receiverType: state.isIphoneType.value == true ? 1 : 2, + countryCode: state.countryCode.value, + account: state.phoneOrEmailStr.value, + password: state.pwd.value, + verificationCode: state.verificationCode.value); if (entity.errorCode!.codeIsSuccessful) { // await loginSuccess(loginEntity: entity); // Toast.show(msg: "注册成功"); @@ -46,16 +46,18 @@ class StarLockRegisterLogic extends BaseGetXController { void sendValidationCode() async { var entity = await ApiRepository.to.sendValidationCode( // state.countryCode.value, - countryCode:state.countryCode.value.toString(), - account:state.phoneOrEmailStr.value, - channel:state.isIphoneType.value ? "1" : "2", - codeType:'1', - xWidth:state.xWidth.value.toString()); + countryCode: state.countryCode.value.toString(), + account: state.phoneOrEmailStr.value, + channel: state.isIphoneType.value ? "1" : "2", + codeType: '1', + xWidth: state.xWidth.value.toString()); if (entity.errorCode!.codeIsSuccessful) { _startTimer(); - } else { + } else {} + } - } + void changeAgreeState() { + _resetCanSub(); } void checkNext(TextEditingController controller) { diff --git a/star_lock/lib/login/register/starLock_register_page.dart b/star_lock/lib/login/register/starLock_register_page.dart index 24c6e7f5..0f7c57ac 100644 --- a/star_lock/lib/login/register/starLock_register_page.dart +++ b/star_lock/lib/login/register/starLock_register_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -51,7 +50,12 @@ class _StarLockRegisterPageState extends State { isDisabled: state.canSub.value, onClick: state.canSub.value ? () { - logic.register(); + if (state.agree.value == false) { + logic.showToast('请先同意用户协议及隐私政策'); + return; + } else { + logic.register(); + } } : null); }), @@ -294,7 +298,8 @@ class _StarLockRegisterPageState extends State { "countryCode": state.countryCode, "account": state.phoneOrEmailStr.value }); - state.xWidth.value = (result as Map)['xWidth']; + state.xWidth.value = + (result as Map)['xWidth']; logic.sendValidationCode(); } : null, @@ -303,7 +308,9 @@ class _StarLockRegisterPageState extends State { height: 60.h, padding: EdgeInsets.all(5.h), decoration: BoxDecoration( - color: state.phoneOrEmailStrIsOK.value ? AppColors.mainColor : Colors.grey, + color: state.phoneOrEmailStrIsOK.value + ? AppColors.mainColor + : Colors.grey, borderRadius: BorderRadius.circular(5)), child: Center( child: Text(state.btnText.value, @@ -326,15 +333,18 @@ class _StarLockRegisterPageState extends State { return Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Image.asset( - 'images/icon_select_circle.png', - width: 28.w, - height: 28.w, - ), - // SizedBox( - // height: 20.h, - // width: 26.w, - // child: Checkbox(value: false, onChanged: (value) {})), + Obx(() => GestureDetector( + onTap: () { + state.agree.value = !state.agree.value; + logic.changeAgreeState(); + }, + child: Image.asset( + state.agree.value + ? 'images/icon_round_select.png' + : 'images/icon_round_unSelect.png', + width: 30.w, + height: 30.w, + ))), SizedBox( width: 15.w, ), @@ -352,11 +362,10 @@ class _StarLockRegisterPageState extends State { style: TextStyle( color: AppColors.mainColor, fontSize: 20.sp)), onTap: () { - Get.toNamed(Routers.webviewShowPage, - arguments: { - "url": XSConstantMacro.userAgreementURL, - "title": '用户协议' - }); + Get.toNamed(Routers.webviewShowPage, arguments: { + "url": XSConstantMacro.userAgreementURL, + "title": '用户协议' + }); }, )), WidgetSpan( @@ -368,9 +377,9 @@ class _StarLockRegisterPageState extends State { color: AppColors.mainColor, fontSize: 20.sp)), onTap: () { Get.toNamed(Routers.webviewShowPage, arguments: { - "url": XSConstantMacro.privacyPolicyURL, - "title": '隐私政策' - }); + "url": XSConstantMacro.privacyPolicyURL, + "title": '隐私政策' + }); }, )), ], diff --git a/star_lock/lib/login/register/starLock_register_state.dart b/star_lock/lib/login/register/starLock_register_state.dart index 253aba4f..8ba411a5 100644 --- a/star_lock/lib/login/register/starLock_register_state.dart +++ b/star_lock/lib/login/register/starLock_register_state.dart @@ -21,6 +21,7 @@ class StarLockRegisterState { var xWidth = ''.obs; // 滑动验证码滑动位置 var isIphoneType = true.obs; var canSub = false.obs; + var agree = false.obs; bool get isEmail => RegexUtil.isEmail(phoneOrEmailStr.value); bool get isIphone => RegexUtil.isMobileSimple(phoneOrEmailStr.value); diff --git a/star_lock/lib/main.dart b/star_lock/lib/main.dart index 61e1f4ea..dfdc7067 100644 --- a/star_lock/lib/main.dart +++ b/star_lock/lib/main.dart @@ -36,6 +36,7 @@ Future _initTranslation() async => TranslationLoader.loadTranslation( Future _setCommonServices() async { await Get.putAsync(() => StoreService().init()); await Get.putAsync(() => PlatformInfoService().init()); + //上架审核注释 // await Get.putAsync(() => DeviceInfoService().init()); // Get.log(PlatformInfoService.to.info.version); } diff --git a/star_lock/lib/main/lockMian/lockMain/lockMain_page.dart b/star_lock/lib/main/lockMian/lockMain/lockMain_page.dart index cdd77dbc..3f8585a9 100644 --- a/star_lock/lib/main/lockMian/lockMain/lockMain_page.dart +++ b/star_lock/lib/main/lockMian/lockMain/lockMain_page.dart @@ -198,7 +198,7 @@ class _StarLockMainPageState extends State with BaseWidget { SizedBox( height: 160.h, ), - //提交Google暂时屏蔽 + //上架审核注释 提交Google暂时屏蔽 // SubmitBtn( // btnName: '演示模式', // onClick: () { diff --git a/star_lock/lib/mine/mineSet/mineSet/mineSet_page.dart b/star_lock/lib/mine/mineSet/mineSet/mineSet_page.dart index dbc30f22..acd2d454 100644 --- a/star_lock/lib/mine/mineSet/mineSet/mineSet_page.dart +++ b/star_lock/lib/mine/mineSet/mineSet/mineSet_page.dart @@ -184,30 +184,31 @@ class _MineSetPageState extends State { SizedBox( height: 10.h, ), - CommonItem( - leftTitel: "Amazon Alexa", - rightTitle: "", - isHaveLine: true, - isHaveDirection: true, - action: () { - logic.showToast("功能暂未开放"); - }), - CommonItem( - leftTitel: "Google Home", - rightTitle: "", - isHaveLine: true, - isHaveDirection: true, - action: () { - logic.showToast("功能暂未开放"); - }), - CommonItem( - leftTitel: TranslationLoader.lanKeys!.xiaomiIOTPlatform!.tr, - rightTitle: "", - isHaveLine: false, - isHaveDirection: true, - action: () { - logic.showToast("功能暂未开放"); - }), + //上架审核注释 + // CommonItem( + // leftTitel: "Amazon Alexa", + // rightTitle: "", + // isHaveLine: true, + // isHaveDirection: true, + // action: () { + // logic.showToast("功能暂未开放"); + // }), + // CommonItem( + // leftTitel: "Google Home", + // rightTitle: "", + // isHaveLine: true, + // isHaveDirection: true, + // action: () { + // logic.showToast("功能暂未开放"); + // }), + // CommonItem( + // leftTitel: TranslationLoader.lanKeys!.xiaomiIOTPlatform!.tr, + // rightTitle: "", + // isHaveLine: false, + // isHaveDirection: true, + // action: () { + // logic.showToast("功能暂未开放"); + // }), // CommonItem(leftTitel:TranslationLoader.lanKeys!.valueAddedServices!.tr, rightTitle:"", isHaveDirection: true, action: (){ // // }), diff --git a/star_lock/lib/network/request_interceptor.dart b/star_lock/lib/network/request_interceptor.dart index a5fd6cef..17d6db8e 100644 --- a/star_lock/lib/network/request_interceptor.dart +++ b/star_lock/lib/network/request_interceptor.dart @@ -4,16 +4,13 @@ import 'package:get/get.dart'; import 'package:get/get_connect/http/src/request/request.dart'; import 'package:star_lock/login/login/entity/LoginData.dart'; -import '../login/login/entity/LoginData.dart'; -import '../login/login/entity/LoginEntity.dart'; import '../tools/platform_info_services.dart'; import '../tools/storage.dart'; -import '../tools/store_service.dart'; FutureOr requestInterceptor(Request request) async { request.headers['User-Agent'] = 'StarLock/${PlatformInfoService.to.info.version}/${PlatformInfoService.to.info.buildNumber}/${GetPlatform.isAndroid ? 'Android' : 'iOS'}'; - request.headers['Accept-Language'] = 'zh_CN'; + request.headers['Accept-Language'] = 'zh-CN'; // request.headers['Content-Type'] = 'application/json'; // request.headers['token'] = StoreService.to.userToken!; // print("11111${StoreService.to.userToken}");