diff --git a/lib/pages/mh_page/user/page/mht_login_page.dart b/lib/pages/mh_page/user/page/mht_login_page.dart index a7ff4d6..be93d93 100644 --- a/lib/pages/mh_page/user/page/mht_login_page.dart +++ b/lib/pages/mh_page/user/page/mht_login_page.dart @@ -6,7 +6,6 @@ import 'package:flutter/services.dart'; import 'package:flutterflow_ui/flutterflow_ui.dart'; import 'package:fluwx/fluwx.dart'; import 'package:get_storage/get_storage.dart'; -import 'package:path/path.dart'; import 'package:vbvs_app/common/color/appConstants.dart'; import 'package:vbvs_app/common/color/appFontsize.dart'; import 'package:vbvs_app/common/util/CheckNetwork.dart'; @@ -136,97 +135,96 @@ class MHTLoginPage extends GetView { bodysize = cc; return GestureDetector( onTap: () => FocusScope.of(context).unfocus(), - child: Scaffold( - resizeToAvoidBottomInset: true, - // key: scaffoldKey, - body: PopScope( - canPop: false, - onPopInvokedWithResult: (disposition, result) async { - if (isProgrammaticPop) { - // 如果是程序触发,重置标记并忽略 - isProgrammaticPop = false; - return; // 阻止处理 - } - if (Platform.isAndroid) { - var flag = await _handleBackPressed(context); // 自定义返回逻辑 - if (flag) { - SystemNavigator.pop(); + child: Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/images/new_background.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container + ), + ), + child: Scaffold( + backgroundColor: Colors.transparent, + resizeToAvoidBottomInset: true, + // key: scaffoldKey, + body: PopScope( + canPop: false, + onPopInvokedWithResult: (disposition, result) async { + if (isProgrammaticPop) { + // 如果是程序触发,重置标记并忽略 + isProgrammaticPop = false; + return; // 阻止处理 } - } - }, - child: SingleChildScrollView( - controller: _scrollController, - child: Align( - alignment: AlignmentDirectional(0, 0), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 1, - decoration: BoxDecoration( - color: Color(0xFF000750), - image: DecorationImage( - fit: BoxFit.contain, - image: Image.asset( - 'assets/img/background.png', - ).image, - ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.07, - decoration: BoxDecoration(), + if (Platform.isAndroid) { + var flag = await _handleBackPressed(context); // 自定义返回逻辑 + if (flag) { + SystemNavigator.pop(); + } + } + }, + child: SingleChildScrollView( + controller: _scrollController, + child: Align( + alignment: AlignmentDirectional(0, 0), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 1, + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.contain, + image: Image.asset( + 'assets/img/background.png', + ).image, ), - Expanded( - child: Align( - alignment: AlignmentDirectional(0, 0), - child: Container( - // width: bodysize!.maxWidth * 0.74, - height: bodysize!.maxHeight * 0.79, - decoration: BoxDecoration(), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.07, + decoration: BoxDecoration(), + ), + Expanded( + child: Align( + alignment: AlignmentDirectional(0, 0), child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 1, + // width: bodysize!.maxWidth * 0.74, + height: bodysize!.maxHeight * 0.79, decoration: BoxDecoration(), - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Obx(() { - return Visibility( - visible: controller.model.loginStyle == 1 - ? true - : false, - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 96.rpx, 54, 96.rpx, 0), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.06, - decoration: BoxDecoration(), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 1, + decoration: BoxDecoration(), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Obx(() { + return Visibility( + visible: + controller.model.loginStyle == 1 + ? true + : false, + child: Padding( + padding: + EdgeInsetsDirectional.fromSTEB( + 96.rpx, 54, 96.rpx, 0), child: Container( width: bodysize!.maxWidth, height: bodysize!.maxHeight * 0.06, decoration: BoxDecoration(), - child: SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Container( - width: MediaQuery.sizeOf( - context) - .width * - 0.165, - height: MediaQuery.sizeOf( - context) - .height * - 1, - constraints: BoxConstraints( - minWidth: 100, - ), - decoration: BoxDecoration(), - child: Container( + child: Container( + width: bodysize!.maxWidth, + height: + bodysize!.maxHeight * 0.06, + decoration: BoxDecoration(), + child: SingleChildScrollView( + scrollDirection: + Axis.horizontal, + child: Row( + mainAxisSize: + MainAxisSize.max, + children: [ + Container( width: MediaQuery.sizeOf( context) .width * @@ -237,231 +235,147 @@ class MHTLoginPage extends GetView { 1, constraints: BoxConstraints( - minWidth: 124, + minWidth: 100, ), decoration: BoxDecoration(), - child: Column( - mainAxisSize: - MainAxisSize.max, - children: [ - Padding( - padding: - EdgeInsetsDirectional - .fromSTEB( - 0, - 0, - 0, - 8), - child: Container( - width: MediaQuery - .sizeOf( - context) - .width * - 0.165, - height: MediaQuery - .sizeOf( - context) - .height * - 0.045, - constraints: - BoxConstraints( - minWidth: 124, - ), - decoration: - BoxDecoration(), + child: Container( + width: + MediaQuery.sizeOf( + context) + .width * + 0.165, + height: + MediaQuery.sizeOf( + context) + .height * + 1, + constraints: + BoxConstraints( + minWidth: 124, + ), + decoration: + BoxDecoration(), + child: Column( + mainAxisSize: + MainAxisSize.max, + children: [ + Padding( + padding: + EdgeInsetsDirectional + .fromSTEB( + 0, + 0, + 0, + 8), child: Container( width: MediaQuery.sizeOf( context) .width * - 0.162, + 0.165, height: MediaQuery.sizeOf( context) .height * - 0.055, + 0.045, + constraints: + BoxConstraints( + minWidth: 124, + ), decoration: BoxDecoration(), - child: Align( - alignment: - AlignmentDirectional( - 0, 1), - child: Text( - '密码登录'.tr, - style: - TextStyle( - fontFamily: - 'Readex Pro', - color: stringToColor( - "#84F5FF"), - fontSize: - AppFontsize - .title_size, - letterSpacing: - 0, + child: + Container( + width: MediaQuery.sizeOf( + context) + .width * + 0.162, + height: MediaQuery.sizeOf( + context) + .height * + 0.055, + decoration: + BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional( + 0, + 1), + child: Text( + '密码登录'.tr, + style: + TextStyle( + fontFamily: + 'Readex Pro', + color: stringToColor( + "#84F5FF"), + fontSize: + AppFontsize.title_size, + letterSpacing: + 0, + ), ), ), ), ), ), - ), - Align( - alignment: - AlignmentDirectional( - 0, 0), - child: Container( - width: MediaQuery - .sizeOf( - context) - .width * - 0.156, - height: MediaQuery - .sizeOf( - context) - .height * - 0.003, - constraints: - BoxConstraints( - minWidth: 100, - maxWidth: 100, - maxHeight: 6, - ), - decoration: - BoxDecoration( - color: stringToColor( - "#84F5FF"), - ), - ), - ), - ], - ), - ), - ), - InkWell( - onTap: () { - controller - .model.loginStyle = 2; - controller.updateAll(); - }, - child: Container( - width: MediaQuery.sizeOf( - context) - .width * - 0.165, - height: MediaQuery.sizeOf( - context) - .height * - 1, - constraints: - BoxConstraints( - minWidth: 100, - ), - decoration: - BoxDecoration(), - child: Column( - mainAxisSize: - MainAxisSize.max, - children: [ - Container( - width: MediaQuery - .sizeOf( - context) - .width * - 0.14, - height: MediaQuery - .sizeOf( - context) - .height * - 0.045, - constraints: - BoxConstraints( - minWidth: 105, - ), - decoration: - BoxDecoration(), - child: Align( + Align( alignment: AlignmentDirectional( - 0, 1), - child: Text( - '短信登录'.tr, - style: - TextStyle( - fontFamily: - 'Readex Pro', - color: Colors - .white, - fontSize: - AppFontsize - .normal_text_size, - letterSpacing: - 0, + 0, 0), + child: Container( + width: MediaQuery.sizeOf( + context) + .width * + 0.156, + height: MediaQuery.sizeOf( + context) + .height * + 0.003, + constraints: + BoxConstraints( + minWidth: 100, + maxWidth: 100, + maxHeight: 6, + ), + decoration: + BoxDecoration( + color: stringToColor( + "#84F5FF"), ), ), ), - ), - ], + ], + ), ), ), - ), - ], - ), - ), - ), - ), - ), - ); - }), - Obx(() { - return Visibility( - visible: controller.model.loginStyle == 2 - ? true - : false, - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 96.rpx, 54, 96.rpx, 0), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.06, - decoration: BoxDecoration(), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.06, - decoration: BoxDecoration(), - child: SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - InkWell( - onTap: () { - controller - .model.loginStyle = 1; - controller.updateAll(); - }, - child: Container( - width: MediaQuery.sizeOf( - context) - .width * - 0.165, - height: MediaQuery.sizeOf( - context) - .height * - 1, - constraints: - BoxConstraints( - minWidth: 100, - ), - decoration: - BoxDecoration(), - child: Column( - mainAxisSize: - MainAxisSize.max, - children: [ - Align( - alignment: - AlignmentDirectional( - 0, 1), - child: Container( + InkWell( + onTap: () { + controller.model + .loginStyle = 2; + controller.updateAll(); + }, + child: Container( + width: + MediaQuery.sizeOf( + context) + .width * + 0.165, + height: + MediaQuery.sizeOf( + context) + .height * + 1, + constraints: + BoxConstraints( + minWidth: 100, + ), + decoration: + BoxDecoration(), + child: Column( + mainAxisSize: + MainAxisSize.max, + children: [ + Container( width: MediaQuery .sizeOf( context) @@ -483,7 +397,7 @@ class MHTLoginPage extends GetView { AlignmentDirectional( 0, 1), child: Text( - '密码登录'.tr, + '短信登录'.tr, style: TextStyle( fontFamily: @@ -499,25 +413,117 @@ class MHTLoginPage extends GetView { ), ), ), - ), - ], + ], + ), ), ), - ), - Container( - width: MediaQuery.sizeOf( - context) - .width * - 0.165, - height: MediaQuery.sizeOf( - context) - .height * - 1, - constraints: BoxConstraints( - minWidth: 100, + ], + ), + ), + ), + ), + ), + ); + }), + Obx(() { + return Visibility( + visible: + controller.model.loginStyle == 2 + ? true + : false, + child: Padding( + padding: + EdgeInsetsDirectional.fromSTEB( + 96.rpx, 54, 96.rpx, 0), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.06, + decoration: BoxDecoration(), + child: Container( + width: bodysize!.maxWidth, + height: + bodysize!.maxHeight * 0.06, + decoration: BoxDecoration(), + child: SingleChildScrollView( + scrollDirection: + Axis.horizontal, + child: Row( + mainAxisSize: + MainAxisSize.max, + children: [ + InkWell( + onTap: () { + controller.model + .loginStyle = 1; + controller.updateAll(); + }, + child: Container( + width: + MediaQuery.sizeOf( + context) + .width * + 0.165, + height: + MediaQuery.sizeOf( + context) + .height * + 1, + constraints: + BoxConstraints( + minWidth: 100, + ), + decoration: + BoxDecoration(), + child: Column( + mainAxisSize: + MainAxisSize.max, + children: [ + Align( + alignment: + AlignmentDirectional( + 0, 1), + child: Container( + width: MediaQuery.sizeOf( + context) + .width * + 0.14, + height: MediaQuery.sizeOf( + context) + .height * + 0.045, + constraints: + BoxConstraints( + minWidth: 105, + ), + decoration: + BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional( + 0, 1), + child: Text( + '密码登录'.tr, + style: + TextStyle( + fontFamily: + 'Readex Pro', + color: Colors + .white, + fontSize: + AppFontsize + .normal_text_size, + letterSpacing: + 0, + ), + ), + ), + ), + ), + ], + ), + ), ), - decoration: BoxDecoration(), - child: Container( + Container( width: MediaQuery.sizeOf( context) .width * @@ -528,98 +534,1002 @@ class MHTLoginPage extends GetView { 1, constraints: BoxConstraints( - minWidth: 124, + minWidth: 100, ), decoration: BoxDecoration(), - child: Column( - mainAxisSize: - MainAxisSize.max, - children: [ - Padding( - padding: - EdgeInsetsDirectional - .fromSTEB( - 0, - 0, - 0, - 8), - child: Container( - width: MediaQuery - .sizeOf( - context) - .width * - 0.165, - height: MediaQuery - .sizeOf( - context) - .height * - 0.045, - constraints: - BoxConstraints( - minWidth: 124, - ), - decoration: - BoxDecoration(), + child: Container( + width: + MediaQuery.sizeOf( + context) + .width * + 0.165, + height: + MediaQuery.sizeOf( + context) + .height * + 1, + constraints: + BoxConstraints( + minWidth: 124, + ), + decoration: + BoxDecoration(), + child: Column( + mainAxisSize: + MainAxisSize.max, + children: [ + Padding( + padding: + EdgeInsetsDirectional + .fromSTEB( + 0, + 0, + 0, + 8), child: Container( width: MediaQuery.sizeOf( context) .width * - 0.162, + 0.165, height: MediaQuery.sizeOf( context) .height * - 0.055, + 0.045, + constraints: + BoxConstraints( + minWidth: 124, + ), decoration: BoxDecoration(), - child: Align( - alignment: - AlignmentDirectional( - 0, 1), - child: Text( - '短信登录'.tr, - style: - TextStyle( - fontFamily: - 'Readex Pro', - color: stringToColor( - "#84F5FF"), - fontSize: - AppFontsize - .title_size, - letterSpacing: - 0, + child: + Container( + width: MediaQuery.sizeOf( + context) + .width * + 0.162, + height: MediaQuery.sizeOf( + context) + .height * + 0.055, + decoration: + BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional( + 0, + 1), + child: Text( + '短信登录'.tr, + style: + TextStyle( + fontFamily: + 'Readex Pro', + color: stringToColor( + "#84F5FF"), + fontSize: + AppFontsize.title_size, + letterSpacing: + 0, + ), ), ), ), ), ), + Align( + alignment: + AlignmentDirectional( + 0, 0), + child: Container( + width: MediaQuery.sizeOf( + context) + .width * + 0.156, + height: MediaQuery.sizeOf( + context) + .height * + 0.003, + constraints: + BoxConstraints( + minWidth: 100, + maxWidth: 100, + maxHeight: 6, + ), + decoration: + BoxDecoration( + color: stringToColor( + "#84F5FF"), + ), + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + ), + ), + ); + }), + Obx(() { + return Visibility( + visible: + controller.model.loginStyle == 1 + ? true + : false, + child: Padding( + padding: + EdgeInsetsDirectional.fromSTEB( + 96.rpx, 17, 96.rpx, 0), + child: Container( + width: bodysize!.maxWidth, + height: 46, + decoration: BoxDecoration(), + child: Container( + width: bodysize!.maxWidth, + height: + bodysize!.maxHeight * 0.06, + decoration: BoxDecoration( + color: Color(0xFFF3F5F6), + borderRadius: + BorderRadius.circular(12), + ), + child: Align( + alignment: + AlignmentDirectional(0, 0), + child: TextFormField( + // focusNode: _focusNode1, + onChanged: (value) { + controller.model.account = + value; + }, + initialValue: + controller.model.account, + obscureText: false, + decoration: InputDecoration( + labelStyle: TextStyle( + fontFamily: 'Readex Pro', + fontSize: AppFontsize + .normal_text_size, + letterSpacing: 0, + ), + hintText: '请输入账号', + hintStyle: TextStyle( + fontFamily: 'Readex Pro', + color: Color(0xFFD2D2D2), + fontSize: 13.px, + letterSpacing: 0, + ), + enabledBorder: + InputBorder.none, + focusedBorder: + InputBorder.none, + errorBorder: + InputBorder.none, + focusedErrorBorder: + InputBorder.none, + contentPadding: + EdgeInsetsDirectional + .fromSTEB( + 10, 0, 0, 5), + ), + style: TextStyle( + fontFamily: 'Readex Pro', + fontSize: AppFontsize + .normal_text_size, + letterSpacing: 0, + ), + ), + ), + ), + ), + ), + ); + }), + Obx(() { + return Visibility( + visible: + controller.model.loginStyle == 1 + ? true + : false, + child: Padding( + padding: + EdgeInsetsDirectional.fromSTEB( + 96.rpx, 17, 96.rpx, 0), + child: Container( + width: bodysize!.maxWidth, + height: 46, + decoration: BoxDecoration(), + child: Stack( + children: [ + Align( + alignment: + AlignmentDirectional( + 0, 0), + child: Container( + width: MediaQuery.sizeOf( + context) + .width, + height: 46, + decoration: BoxDecoration( + color: Color(0xFFF3F5F6), + borderRadius: + BorderRadius.circular( + 12), + ), + child: Align( + alignment: + AlignmentDirectional( + 0, 0), + child: TextFormField( + obscureText: controller + .model.showPd!, + onChanged: (value) { + controller.model + .password = value; + }, + initialValue: controller + .model.password, + decoration: + InputDecoration( + labelStyle: TextStyle( + fontFamily: + 'Readex Pro', + fontSize: AppFontsize + .normal_text_size, + letterSpacing: 0, + ), + hintText: '请输入密码', + hintStyle: TextStyle( + fontFamily: + 'Readex Pro', + color: Color( + 0xFFD2D2D2), + fontSize: AppFontsize + .normal_text_size, + letterSpacing: 0, + ), + enabledBorder: + InputBorder.none, + focusedBorder: + InputBorder.none, + errorBorder: + InputBorder.none, + focusedErrorBorder: + InputBorder.none, + contentPadding: + EdgeInsetsDirectional + .fromSTEB(10, + 12, 0, 0), + suffixIcon: + IconButton( + icon: Icon( + // 根据 pdshow 控制图标 + controller.model + .showPd! + ? Icons + .visibility_off + : Icons + .visibility, + color: Color( + 0xFF333333), + size: 16, + ), + onPressed: () { + // 切换 pdshow 状态 + controller.model + .showPd = + !controller + .model + .showPd!; + controller + .updateAll(); + }, + ), + ), + style: TextStyle( + fontFamily: + 'Readex Pro', + fontSize: AppFontsize + .normal_text_size, + letterSpacing: 0, + ), + ), + ), + ), + ), + Obx(() { + return Visibility( + visible: controller + .model.loginStyle == + 2, + child: Align( + alignment: + AlignmentDirectional( + 0.2, 0.3), + child: Container( + width: 3, + height: 30, + decoration: + BoxDecoration( + color: stringToColor( + "#929699"), + ), + ), + ), + ); + }), + Obx(() { + return Visibility( + visible: controller + .model.loginStyle == + 2, + child: Align( + alignment: + AlignmentDirectional( + 0.9, 0), + child: Container( + width: + MediaQuery.sizeOf( + context) + .width * + 0.157, + height: + MediaQuery.sizeOf( + context) + .height * + 0.014, + constraints: + BoxConstraints( + minWidth: 118, + minHeight: 30, + maxWidth: 118, + ), + decoration: + BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional( + 0, 0), + child: Obx(() { + final CountdownController + countdownController = + Get.find< + CountdownController>(); + return InkWell( + onTap: () async { + if (countdownController + .countdown + .value != + 0) { + return; + } + if (CommonVariables + .isNetWorkOn == + false) { + TopSlideNotification.show( + context, + text: "网络未连接,请开启设备网络后重试" + .tr, + textColor: themeController + .currentColor + .sc9); + return; + } + String msg = + await controller + .getCode( + context); + if (msg + .isNotEmpty) { + return; + } + countdownController + .countdown + .value == + 0 + ? countdownController + .startCountdown( + AppConstants.code_time) + : null; + }, + child: Text( + countdownController + .countdown + .value == + 0 + ? '获取验证码'.tr + : '${countdownController.countdown.value}' + + '秒'.tr, + style: + TextStyle( + fontFamily: + 'Readex Pro', + color: Color( + 0xFF333333), + fontSize: + AppFontsize + .normal_text_size, + letterSpacing: + 0, + ), + ), + ); + }), + ), + ), + ), + ); + }) + ], + ), + ), + ), + ); + }), + Obx(() { + return Visibility( + visible: + controller.model.loginStyle == 2 + ? true + : false, + child: Padding( + padding: + EdgeInsetsDirectional.fromSTEB( + 96.rpx, 17, 96.rpx, 0), + child: Container( + width: bodysize!.maxWidth, + height: 46, + decoration: BoxDecoration(), + child: Container( + width: bodysize!.maxWidth, + height: + bodysize!.maxHeight * 0.06, + decoration: BoxDecoration( + color: Color(0xFFF3F5F6), + borderRadius: + BorderRadius.circular(12), + ), + child: Align( + alignment: + AlignmentDirectional(0, 0), + child: TextFormField( + // focusNode: _focusNode3, + onChanged: (value) { + controller.model.phone = + value; + }, + obscureText: false, + decoration: InputDecoration( + labelStyle: TextStyle( + fontFamily: 'Readex Pro', + fontSize: AppFontsize + .normal_text_size, + letterSpacing: 0, + ), + hintText: '请输入手机号'.tr, + hintStyle: TextStyle( + fontFamily: 'Readex Pro', + color: Color(0xFFD2D2D2), + fontSize: AppFontsize + .normal_text_size, + letterSpacing: 0, + ), + enabledBorder: + InputBorder.none, + focusedBorder: + InputBorder.none, + errorBorder: + InputBorder.none, + focusedErrorBorder: + InputBorder.none, + contentPadding: + EdgeInsetsDirectional + .fromSTEB( + 10, 0, 0, 5), + ), + style: TextStyle( + fontFamily: 'Readex Pro', + fontSize: AppFontsize + .normal_text_size, + letterSpacing: 0, + ), + ), + ), + ), + ), + ), + ); + }), + Obx(() { + return Visibility( + visible: + controller.model.loginStyle == 2 + ? true + : false, + child: Padding( + padding: + EdgeInsetsDirectional.fromSTEB( + 96.rpx, 17, 96.rpx, 0), + child: Container( + width: bodysize!.maxWidth, + height: 46, + decoration: BoxDecoration(), + child: Stack( + children: [ + Align( + alignment: + AlignmentDirectional( + 0, 0), + child: Container( + width: MediaQuery.sizeOf( + context) + .width, + height: 46, + decoration: BoxDecoration( + color: Color(0xFFF3F5F6), + borderRadius: + BorderRadius.circular( + 12), + ), + child: Align( + alignment: + AlignmentDirectional( + 0, 0), + child: TextFormField( + // focusNode: _focusNode4, + onChanged: (value) { + controller.model + .code = value; + }, + obscureText: false, + decoration: + InputDecoration( + labelStyle: TextStyle( + fontFamily: + 'Readex Pro', + fontSize: AppFontsize + .normal_text_size, + letterSpacing: 0, + ), + hintText: '请输入验证码', + hintStyle: TextStyle( + fontFamily: + 'Readex Pro', + color: Color( + 0xFFD2D2D2), + fontSize: AppFontsize + .normal_text_size, + letterSpacing: 0, + ), + enabledBorder: + InputBorder.none, + focusedBorder: + InputBorder.none, + errorBorder: + InputBorder.none, + focusedErrorBorder: + InputBorder.none, + contentPadding: + EdgeInsetsDirectional + .fromSTEB(10, + 0, 0, 5), + ), + style: TextStyle( + fontFamily: + 'Readex Pro', + fontSize: AppFontsize + .normal_text_size, + letterSpacing: 0, + ), + ), + ), + ), + ), + Align( + alignment: + AlignmentDirectional( + 0.2, 0.1), + child: Container( + width: 1.rpx, + height: 38.rpx, + decoration: BoxDecoration( + color: stringToColor( + "#929699"), + ), + ), + ), + Align( + alignment: + AlignmentDirectional( + 0.9, 0), + child: Container( + width: MediaQuery.sizeOf( + context) + .width * + 0.157, + height: MediaQuery.sizeOf( + context) + .height * + 0.014, + constraints: BoxConstraints( + minWidth: 118, + minHeight: 30, + ), + decoration: BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional( + 0, 0), + child: Obx(() { + final CountdownController + countdownController = + Get.find< + CountdownController>(); + return InkWell( + onTap: () async { + if (countdownController + .countdown + .value != + 0) { + return; + } + if (CommonVariables + .isNetWorkOn == + false) { + TopSlideNotification.show( + context, + text: + "网络未连接,请开启设备网络后重试" + .tr, + textColor: + themeController + .currentColor + .sc9); + return; + } + String msg = + await controller + .getCode( + context); + if (msg + .isNotEmpty) { + return; + } + countdownController + .countdown + .value == + 0 + ? countdownController + .startCountdown( + AppConstants + .code_time) + : null; + }, + child: Text( + countdownController + .countdown + .value == + 0 + ? '获取验证码' + : '${countdownController.countdown.value}' + + '秒'.tr, + style: TextStyle( + fontFamily: + 'Readex Pro', + color: Color( + 0xFF333333), + fontSize: AppFontsize + .normal_text_size, + letterSpacing: 0, + ), + ), + ); + }), + ), + ), + ), + ], + ), + ), + ), + ); + }), + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 96.rpx, 17, 96.rpx, 0), + child: SizedBox( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.056, + child: CustomCard( + gradientDirection: + GradientDirection.vertical, + borderRadius: AppConstants() + .normal_container_radius, + onTap: () async { + if (CommonVariables.isNetWorkOn == + false) { + TopSlideNotification.show(context, + text: "网络未连接,请开启设备网络后重试".tr, + textColor: themeController + .currentColor.sc9); + return; + } + String msg = + await controller.login(context); + if (msg == null || msg.isEmpty) { + final box = GetStorage(); + box.remove('countdown'); + CountdownController + countdownController = + Get.find(); + countdownController.countdown = + 0.obs; + countdownController + .startCountdown(0); + + controller.fluwxCancelable + ?.cancel(); + Checknetwork.subscription + ?.cancel(); + + isProgrammaticPop = true; + MHTLoginController + loginController = Get.find(); + loginController.model.account = + null; + loginController.model.password = + null; + loginController.model.phone = + null; + loginController.model.code = null; + MHTRegisterController + registerController = + Get.find(); + registerController + .model.register_agree = false; + Get.offAndToNamed( + "/mianPageBottomChange"); + } + }, + colors: [ + stringToColor("FCFCFC"), + stringToColor("CEECE3") + ], // 纯色背景 + enableGradient: true, // 不启用渐变 + child: Center( + child: Text( + '登录'.tr, + style: TextStyle( + color: stringToColor("#003058"), + fontSize: 26.rpx, + letterSpacing: 0, + ), + ), + ), + ), + ), + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 96.rpx, 19, 96.rpx, 0), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.022, + constraints: BoxConstraints( + minWidth: 466, + minHeight: 30, + ), + // decoration: + // BoxDecoration(color: Colors.green), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.022, + constraints: BoxConstraints( + minWidth: 466, + minHeight: 30, + ), + decoration: BoxDecoration(), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Align( + alignment: + AlignmentDirectional(0, 0), + child: Padding( + padding: EdgeInsetsDirectional + .fromSTEB(0, 3, 0, 0), + child: Container( + width: 36, + height: 36, + decoration: BoxDecoration(), + child: Align( + alignment: + AlignmentDirectional( + 0, 0), + child: Theme( + data: ThemeData( + checkboxTheme: + CheckboxThemeData( + visualDensity: + VisualDensity + .compact, + materialTapTargetSize: + MaterialTapTargetSize + .shrinkWrap, + shape: + RoundedRectangleBorder( + borderRadius: + BorderRadius + .circular( + 64), + ), + ), + unselectedWidgetColor: + Color( + 0xFFD3D3D3), + ), + child: Obx( + () => Checkbox( + value: registerController + .model + .register_agree ?? + false, + onChanged: + (newValue) async { + registerController + .model + .register_agree = + newValue; + + controller + .updateAll(); + registerController + .updateAll(); + // 获取设备信息,需要用户点击确认隐私协议与用户协议选择框时才能获取 + // if (newValue == + // true) { + // Deviceconfig + // .initPlatformState(); + // } + }, + side: BorderSide( + width: 1.5, + color: Colors + .white, + ), + activeColor: + stringToColor( + "#84F5FF"), + checkColor: + stringToColor( + "#011D33"), + ), + )), + ), + ), + ), + ), + Flexible( + child: Padding( + padding: EdgeInsetsDirectional + .fromSTEB(0, 0, 0, 0), + child: Container( + width: MediaQuery.sizeOf( + context) + .width * + 0.622, + height: MediaQuery.sizeOf( + context) + .height * + 1, + constraints: BoxConstraints( + minWidth: 466, + minHeight: 30, + ), + decoration: BoxDecoration(), + child: Container( + width: 100, + height: 100, + decoration: + BoxDecoration(), + child: Row( + mainAxisSize: + MainAxisSize.max, + children: [ + Align( + alignment: + AlignmentDirectional( + 0, 0), + child: Text( + '我已阅读并同意'.tr, + style: TextStyle( + fontFamily: + 'Readex Pro', + color: Colors + .white, + fontSize: 12, + letterSpacing: + 0, + ), + ), + ), + Align( + alignment: + AlignmentDirectional( + 0, 0), + child: InkWell( + onTap: () { + // showCustomConfirmOfWebViewDialog( + // context, + // "用户协议", + // "/#/pages/agreement/agreement?type=2&hideHead=true", + // btnName: + // "同意并继续"); + }, + child: Text( + '《用户协议》'.tr, + style: + TextStyle( + fontFamily: + 'Readex Pro', + color: stringToColor( + "FF9F66"), + fontSize: 12, + letterSpacing: + 0, + ), + ), + ), ), Align( alignment: AlignmentDirectional( 0, 0), - child: Container( - width: MediaQuery - .sizeOf( - context) - .width * - 0.156, - height: MediaQuery - .sizeOf( - context) - .height * - 0.003, - constraints: - BoxConstraints( - minWidth: 100, - maxWidth: 100, - maxHeight: 6, + child: Text( + '与'.tr, + style: TextStyle( + fontFamily: + 'Readex Pro', + color: Colors + .white, + fontSize: 12, + letterSpacing: + 0, ), - decoration: - BoxDecoration( - color: stringToColor( - "#84F5FF"), + ), + ), + Align( + alignment: + AlignmentDirectional( + 0, 0), + child: InkWell( + onTap: () { + // showCustomConfirmOfWebViewDialog( + // context, + // "隐私协议", + // "/#/pages/agreement/agreement?type=1&hideHead=true", + // btnName: + // "同意并继续"); + }, + child: Text( + '《隐私协议》'.tr, + style: + TextStyle( + fontFamily: + 'Readex Pro', + color: stringToColor( + "FF9F66"), + fontSize: 12, + letterSpacing: + 0, + ), ), ), ), @@ -627,1471 +1537,420 @@ class MHTLoginPage extends GetView { ), ), ), + ), + ), + ], + ), + ), + ), + ), + Obx(() { + return Visibility( + // maintainState: true, + // maintainAnimation: true, + // maintainSize: true, + visible: + controller.model.loginStyle == 2, + child: Padding( + padding: + EdgeInsetsDirectional.fromSTEB( + 96.rpx, 0, 96.rpx, 0), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.03, + decoration: BoxDecoration(), + child: Container( + width: bodysize!.maxWidth, + height: + bodysize!.maxHeight * 0.025, + constraints: BoxConstraints( + minWidth: 466, + minHeight: 30, + ), + decoration: BoxDecoration(), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Align( + alignment: + AlignmentDirectional( + 0, 0), + child: Padding( + padding: + EdgeInsetsDirectional + .fromSTEB( + 0, 0, 0, 0), + child: Container( + width: 36, + height: 36, + decoration: + BoxDecoration(), + ), + ), + ), + Flexible( + child: Padding( + padding: + EdgeInsetsDirectional + .fromSTEB( + 0, 0, 0, 0), + child: Container( + width: + MediaQuery.sizeOf( + context) + .width * + 0.622, + height: + MediaQuery.sizeOf( + context) + .height * + 1, + // constraints: + // BoxConstraints( + // minWidth: 466, + // minHeight: 30, + // ), + decoration: + BoxDecoration(), + child: Container( + // width: 100, + // height: 100, + decoration: + BoxDecoration(), + child: Row( + mainAxisSize: + MainAxisSize + .max, + children: [ + Align( + alignment: + AlignmentDirectional( + 0, 0), + child: Text( + '注:首次登录会自动创建账号' + .tr, + style: + TextStyle( + fontFamily: + 'Readex Pro', + color: stringToColor( + "#FFFFFF"), + fontSize: + 23.rpx, + letterSpacing: + 0, + ), + ), + ), + ], + ), + ), + ), + ), + ), ], ), ), ), ), - ), - ); - }), - Obx(() { - return Visibility( - visible: controller.model.loginStyle == 1 - ? true - : false, - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 96.rpx, 17, 96.rpx, 0), - child: Container( - width: bodysize!.maxWidth, - height: 46, - decoration: BoxDecoration(), + ); + }), + Obx(() { + return Visibility( + // maintainState: true, + // maintainAnimation: true, + // maintainSize: true, + visible: + controller.model.loginStyle == 2, + child: Padding( + padding: + EdgeInsetsDirectional.fromSTEB( + 96.rpx, 0, 96.rpx, 0), child: Container( width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.06, - decoration: BoxDecoration( - color: Color(0xFFF3F5F6), - borderRadius: - BorderRadius.circular(12), - ), - child: Align( - alignment: - AlignmentDirectional(0, 0), - child: TextFormField( - // focusNode: _focusNode1, - onChanged: (value) { - controller.model.account = - value; - }, - initialValue: - controller.model.account, - obscureText: false, - decoration: InputDecoration( - labelStyle: TextStyle( - fontFamily: 'Readex Pro', - fontSize: AppFontsize - .normal_text_size, - letterSpacing: 0, - ), - hintText: '请输入账号', - hintStyle: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFFD2D2D2), - fontSize: 13.px, - letterSpacing: 0, - ), - enabledBorder: - InputBorder.none, - focusedBorder: - InputBorder.none, - errorBorder: InputBorder.none, - focusedErrorBorder: - InputBorder.none, - contentPadding: - EdgeInsetsDirectional - .fromSTEB( - 10, 0, 0, 5), - ), - style: TextStyle( - fontFamily: 'Readex Pro', - fontSize: AppFontsize - .normal_text_size, - letterSpacing: 0, - ), - ), - ), + height: bodysize!.maxHeight * 0.03, + decoration: BoxDecoration(), ), ), - ), - ); - }), - Obx(() { - return Visibility( - visible: controller.model.loginStyle == 1 - ? true - : false, - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 96.rpx, 17, 96.rpx, 0), - child: Container( - width: bodysize!.maxWidth, - height: 46, - decoration: BoxDecoration(), - child: Stack( - children: [ - Align( - alignment: - AlignmentDirectional(0, 0), - child: Container( - width: - MediaQuery.sizeOf(context) - .width, - height: 46, - decoration: BoxDecoration( - color: Color(0xFFF3F5F6), - borderRadius: - BorderRadius.circular( - 12), - ), - child: Align( - alignment: - AlignmentDirectional( - 0, 0), - child: TextFormField( - obscureText: controller - .model.showPd!, - onChanged: (value) { - controller.model - .password = value; - }, - initialValue: controller - .model.password, - decoration: - InputDecoration( - labelStyle: TextStyle( - fontFamily: - 'Readex Pro', - fontSize: AppFontsize - .normal_text_size, - letterSpacing: 0, - ), - hintText: '请输入密码', - hintStyle: TextStyle( - fontFamily: - 'Readex Pro', - color: - Color(0xFFD2D2D2), - fontSize: AppFontsize - .normal_text_size, - letterSpacing: 0, - ), - enabledBorder: - InputBorder.none, - focusedBorder: - InputBorder.none, - errorBorder: - InputBorder.none, - focusedErrorBorder: - InputBorder.none, - contentPadding: - EdgeInsetsDirectional - .fromSTEB(10, - 12, 0, 0), - suffixIcon: IconButton( - icon: Icon( - // 根据 pdshow 控制图标 - controller.model - .showPd! - ? Icons - .visibility_off - : Icons - .visibility, - color: Color( - 0xFF333333), - size: 16, - ), - onPressed: () { - // 切换 pdshow 状态 - controller.model - .showPd = - !controller - .model - .showPd!; - controller - .updateAll(); - }, - ), - ), + ); + }), + Obx(() { + return Visibility( + // maintainState: true, + // maintainAnimation: true, + // maintainSize: true, + visible: + controller.model.loginStyle == 2, + child: Padding( + padding: + EdgeInsetsDirectional.fromSTEB( + 96.rpx, 0, 96.rpx, 0), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 0.03, + decoration: BoxDecoration(), + ), + ), + ); + }), + Obx(() { + return Visibility( + // maintainState: true, + // maintainAnimation: true, + // maintainSize: true, + visible: + controller.model.loginStyle == 1, + child: Padding( + padding: + EdgeInsetsDirectional.fromSTEB( + 96.rpx, 0, 96.rpx, 0), + child: Container( + width: bodysize!.maxWidth, + // height: bodysize!.maxHeight * 0.06, + height: bodysize!.maxHeight * 0.03, + // decoration: + // BoxDecoration(color: Colors.pink), + ), + ), + ); + }), + Obx(() { + return Visibility( + // maintainState: true, + // maintainAnimation: true, + // maintainSize: true, + visible: + controller.model.loginStyle == 1, + child: Padding( + padding: + EdgeInsetsDirectional.fromSTEB( + 96.rpx, 0, 96.rpx, 0), + child: Container( + width: bodysize!.maxWidth, + // height: bodysize!.maxHeight * 0.06, + height: bodysize!.maxHeight * 0.03, + child: Container( + width: bodysize!.maxWidth, + height: + bodysize!.maxHeight * 0.06, + decoration: BoxDecoration(), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + InkWell( + onTap: () { + Get.toNamed( + "/findPasswordPage"); + }, + child: Text( + '找回密码'.tr, style: TextStyle( fontFamily: 'Readex Pro', - fontSize: AppFontsize - .normal_text_size, - letterSpacing: 0, - ), - ), - ), - ), - ), - Obx(() { - return Visibility( - visible: controller - .model.loginStyle == - 2, - child: Align( - alignment: - AlignmentDirectional( - 0.2, 0.3), - child: Container( - width: 3, - height: 30, - decoration: BoxDecoration( color: stringToColor( - "#929699"), - ), - ), - ), - ); - }), - Obx(() { - return Visibility( - visible: controller - .model.loginStyle == - 2, - child: Align( - alignment: - AlignmentDirectional( - 0.9, 0), - child: Container( - width: MediaQuery.sizeOf( - context) - .width * - 0.157, - height: MediaQuery.sizeOf( - context) - .height * - 0.014, - constraints: - BoxConstraints( - minWidth: 118, - minHeight: 30, - maxWidth: 118, - ), - decoration: - BoxDecoration(), - child: Align( - alignment: - AlignmentDirectional( - 0, 0), - child: Obx(() { - final CountdownController - countdownController = - Get.find< - CountdownController>(); - return InkWell( - onTap: () async { - if (countdownController - .countdown - .value != - 0) { - return; - } - if (CommonVariables - .isNetWorkOn == - false) { - TopSlideNotification.show( - context, - text: - "网络未连接,请开启设备网络后重试" - .tr, - textColor: - themeController - .currentColor - .sc9); - return; - } - String msg = - await controller - .getCode( - context); - if (msg - .isNotEmpty) { - return; - } - countdownController - .countdown - .value == - 0 - ? countdownController - .startCountdown( - AppConstants - .code_time) - : null; - }, - child: Text( - countdownController - .countdown - .value == - 0 - ? '获取验证码'.tr - : '${countdownController.countdown.value}' + - '秒'.tr, - style: TextStyle( - fontFamily: - 'Readex Pro', - color: Color( - 0xFF333333), - fontSize: - AppFontsize - .normal_text_size, - letterSpacing: - 0, - ), - ), - ); - }), - ), - ), - ), - ); - }) - ], - ), - ), - ), - ); - }), - Obx(() { - return Visibility( - visible: controller.model.loginStyle == 2 - ? true - : false, - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 96.rpx, 17, 96.rpx, 0), - child: Container( - width: bodysize!.maxWidth, - height: 46, - decoration: BoxDecoration(), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.06, - decoration: BoxDecoration( - color: Color(0xFFF3F5F6), - borderRadius: - BorderRadius.circular(12), - ), - child: Align( - alignment: - AlignmentDirectional(0, 0), - child: TextFormField( - // focusNode: _focusNode3, - onChanged: (value) { - controller.model.phone = - value; - }, - obscureText: false, - decoration: InputDecoration( - labelStyle: TextStyle( - fontFamily: 'Readex Pro', - fontSize: AppFontsize - .normal_text_size, - letterSpacing: 0, - ), - hintText: '请输入手机号'.tr, - hintStyle: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFFD2D2D2), - fontSize: AppFontsize - .normal_text_size, - letterSpacing: 0, - ), - enabledBorder: - InputBorder.none, - focusedBorder: - InputBorder.none, - errorBorder: InputBorder.none, - focusedErrorBorder: - InputBorder.none, - contentPadding: - EdgeInsetsDirectional - .fromSTEB( - 10, 0, 0, 5), - ), - style: TextStyle( - fontFamily: 'Readex Pro', - fontSize: AppFontsize - .normal_text_size, - letterSpacing: 0, - ), - ), - ), - ), - ), - ), - ); - }), - Obx(() { - return Visibility( - visible: controller.model.loginStyle == 2 - ? true - : false, - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 96.rpx, 17, 96.rpx, 0), - child: Container( - width: bodysize!.maxWidth, - height: 46, - decoration: BoxDecoration(), - child: Stack( - children: [ - Align( - alignment: - AlignmentDirectional(0, 0), - child: Container( - width: - MediaQuery.sizeOf(context) - .width, - height: 46, - decoration: BoxDecoration( - color: Color(0xFFF3F5F6), - borderRadius: - BorderRadius.circular( - 12), - ), - child: Align( - alignment: - AlignmentDirectional( - 0, 0), - child: TextFormField( - // focusNode: _focusNode4, - onChanged: (value) { - controller.model.code = - value; - }, - obscureText: false, - decoration: - InputDecoration( - labelStyle: TextStyle( - fontFamily: - 'Readex Pro', - fontSize: AppFontsize - .normal_text_size, - letterSpacing: 0, - ), - hintText: '请输入验证码', - hintStyle: TextStyle( - fontFamily: - 'Readex Pro', - color: - Color(0xFFD2D2D2), - fontSize: AppFontsize - .normal_text_size, - letterSpacing: 0, - ), - enabledBorder: - InputBorder.none, - focusedBorder: - InputBorder.none, - errorBorder: - InputBorder.none, - focusedErrorBorder: - InputBorder.none, - contentPadding: - EdgeInsetsDirectional - .fromSTEB(10, 0, - 0, 5), - ), - style: TextStyle( - fontFamily: - 'Readex Pro', + "#84F5FF"), fontSize: AppFontsize - .normal_text_size, + .small_text_size, letterSpacing: 0, ), ), ), - ), - ), - Align( - alignment: AlignmentDirectional( - 0.2, 0.1), - child: Container( - width: 1.rpx, - height: 38.rpx, - decoration: BoxDecoration( - color: stringToColor( - "#929699"), + InkWell( + onTap: () { + Get.toNamed( + "/registerPage"); + }, + child: Text( + '注册'.tr, + style: TextStyle( + fontFamily: + 'Readex Pro', + color: stringToColor( + "#84F5FF"), + fontSize: AppFontsize + .small_text_size, + letterSpacing: 0, + ), + ), ), - ), + ].divide(SizedBox( + width: 57.rpx, + )), ), - Align( - alignment: AlignmentDirectional( - 0.9, 0), - child: Container( - width: - MediaQuery.sizeOf(context) - .width * - 0.157, - height: - MediaQuery.sizeOf(context) - .height * - 0.014, - constraints: BoxConstraints( - minWidth: 118, - minHeight: 30, - ), - decoration: BoxDecoration(), - child: Align( - alignment: - AlignmentDirectional( - 0, 0), - child: Obx(() { - final CountdownController - countdownController = - Get.find< - CountdownController>(); - return InkWell( - onTap: () async { - if (countdownController - .countdown - .value != - 0) { - return; - } - if (CommonVariables - .isNetWorkOn == - false) { - TopSlideNotification.show( - context, - text: - "网络未连接,请开启设备网络后重试" - .tr, - textColor: - themeController - .currentColor - .sc9); - return; - } - String msg = - await controller - .getCode( - context); - if (msg.isNotEmpty) { - return; - } - countdownController - .countdown - .value == - 0 - ? countdownController - .startCountdown( - AppConstants - .code_time) - : null; - }, - child: Text( - countdownController - .countdown - .value == - 0 - ? '获取验证码' - : '${countdownController.countdown.value}' + - '秒'.tr, - style: TextStyle( - fontFamily: - 'Readex Pro', - color: Color( - 0xFF333333), - fontSize: AppFontsize - .normal_text_size, - letterSpacing: 0, - ), - ), - ); - }), - ), - ), - ), - ], - ), - ), - ), - ); - }), - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 96.rpx, 17, 96.rpx, 0), - child: SizedBox( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.056, - child: CustomCard( - gradientDirection: - GradientDirection.vertical, - borderRadius: AppConstants() - .normal_container_radius, - onTap: () async { - if (CommonVariables.isNetWorkOn == - false) { - TopSlideNotification.show(context, - text: "网络未连接,请开启设备网络后重试".tr, - textColor: themeController - .currentColor.sc9); - return; - } - String msg = - await controller.login(context); - if (msg == null || msg.isEmpty) { - final box = GetStorage(); - box.remove('countdown'); - CountdownController - countdownController = - Get.find(); - countdownController.countdown = - 0.obs; - countdownController - .startCountdown(0); - - controller.fluwxCancelable - ?.cancel(); - Checknetwork.subscription?.cancel(); - - isProgrammaticPop = true; - MHTLoginController loginController = - Get.find(); - loginController.model.account = - null; - loginController.model.password = - null; - loginController.model.phone = null; - loginController.model.code = null; - MHTRegisterController - registerController = Get.find(); - registerController - .model.register_agree = false; - Get.offAndToNamed( - "/mianPageBottomChange"); - } - }, - colors: [ - stringToColor("FCFCFC"), - stringToColor("CEECE3") - ], // 纯色背景 - enableGradient: true, // 不启用渐变 - child: Center( - child: Text( - '登录'.tr, - style: TextStyle( - color: stringToColor("#003058"), - fontSize: 26.rpx, - letterSpacing: 0, ), ), ), - ), + ); + }), + Obx(() { + return Visibility( + // maintainState: true, + // maintainAnimation: true, + // maintainSize: true, + visible: + controller.model.loginStyle == 1, + child: Padding( + padding: + EdgeInsetsDirectional.fromSTEB( + 96.rpx, 0, 96.rpx, 0), + child: Container( + width: bodysize!.maxWidth, + // height: bodysize!.maxHeight * 0.06, + height: bodysize!.maxHeight * 0.03, + // decoration: + // BoxDecoration(color: Colors.pink), + ), + ), + ); + }), + Divider( + color: stringToColor("#495A67"), // 线的颜色 + thickness: 1.rpx, // 线的粗细 + height: 20, // 垂直方向的占位高度 + indent: 16, // 左边缩进 + endIndent: 16, // 右边缩进 ), - ), - Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 96.rpx, 19, 96.rpx, 0), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.022, - constraints: BoxConstraints( - minWidth: 466, - minHeight: 30, - ), - // decoration: - // BoxDecoration(color: Colors.green), + Text( + "其他登录方式".tr, + style: TextStyle( + color: Colors.white, + fontSize: AppConstants() + .normal_text_fontSize), + ), + SizedBox( + height: 30.rpx, + ), + ClickableContainer( + backgroundColor: Colors.white, // 背景色 + highlightColor: Colors.grey, // 点击水波纹颜色 + borderRadius: 999.rpx, + padding: EdgeInsets.zero, + onTap: () async { + //loginController.model.isIos == true && + // if (loginController + // .model.register_agree == + // null || + // loginController + // .model.register_agree != + // true) { + // TopSlideNotification.show( + // context, + // text: "登录页.未同意协议".tr, + // textColor: + // themeController.currentColor.sc9, + // ); + // return; + // } + // await loginController + // .wxLoginSendAuth(context); + TopSlideNotification.show(context, + text: "测试阶段,暂不支持".tr); + }, child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.022, - constraints: BoxConstraints( - minWidth: 466, - minHeight: 30, - ), - decoration: BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Align( - alignment: - AlignmentDirectional(0, 0), - child: Padding( - padding: EdgeInsetsDirectional - .fromSTEB(0, 3, 0, 0), - child: Container( - width: 36, - height: 36, - decoration: BoxDecoration(), - child: Align( - alignment: - AlignmentDirectional( - 0, 0), - child: Theme( - data: ThemeData( - checkboxTheme: - CheckboxThemeData( - visualDensity: - VisualDensity - .compact, - materialTapTargetSize: - MaterialTapTargetSize - .shrinkWrap, - shape: - RoundedRectangleBorder( - borderRadius: - BorderRadius - .circular( - 64), - ), - ), - unselectedWidgetColor: - Color(0xFFD3D3D3), - ), - child: Obx( - () => Checkbox( - value: registerController - .model - .register_agree ?? - false, - onChanged: - (newValue) async { - registerController - .model - .register_agree = - newValue; - - controller - .updateAll(); - registerController - .updateAll(); - // 获取设备信息,需要用户点击确认隐私协议与用户协议选择框时才能获取 - // if (newValue == - // true) { - // Deviceconfig - // .initPlatformState(); - // } - }, - side: BorderSide( - width: 1.5, - color: - Colors.white, - ), - activeColor: - stringToColor( - "#84F5FF"), - checkColor: - stringToColor( - "#011D33"), - ), - )), - ), - ), - ), - ), - Flexible( - child: Padding( - padding: EdgeInsetsDirectional - .fromSTEB(0, 0, 0, 0), - child: Container( - width: - MediaQuery.sizeOf(context) - .width * - 0.622, - height: - MediaQuery.sizeOf(context) - .height * - 1, - constraints: BoxConstraints( - minWidth: 466, - minHeight: 30, - ), - decoration: BoxDecoration(), - child: Container( - width: 100, - height: 100, - decoration: BoxDecoration(), - child: Row( - mainAxisSize: - MainAxisSize.max, - children: [ - Align( - alignment: - AlignmentDirectional( - 0, 0), - child: Text( - '我已阅读并同意'.tr, - style: TextStyle( - fontFamily: - 'Readex Pro', - color: - Colors.white, - fontSize: 12, - letterSpacing: 0, - ), - ), - ), - Align( - alignment: - AlignmentDirectional( - 0, 0), - child: InkWell( - onTap: () { - // showCustomConfirmOfWebViewDialog( - // context, - // "用户协议", - // "/#/pages/agreement/agreement?type=2&hideHead=true", - // btnName: - // "同意并继续"); - }, - child: Text( - '《用户协议》'.tr, - style: TextStyle( - fontFamily: - 'Readex Pro', - color: - stringToColor( - "FF9F66"), - fontSize: 12, - letterSpacing: - 0, - ), - ), - ), - ), - Align( - alignment: - AlignmentDirectional( - 0, 0), - child: Text( - '与'.tr, - style: TextStyle( - fontFamily: - 'Readex Pro', - color: - Colors.white, - fontSize: 12, - letterSpacing: 0, - ), - ), - ), - Align( - alignment: - AlignmentDirectional( - 0, 0), - child: InkWell( - onTap: () { - // showCustomConfirmOfWebViewDialog( - // context, - // "隐私协议", - // "/#/pages/agreement/agreement?type=1&hideHead=true", - // btnName: - // "同意并继续"); - }, - child: Text( - '《隐私协议》'.tr, - style: TextStyle( - fontFamily: - 'Readex Pro', - color: - stringToColor( - "FF9F66"), - fontSize: 12, - letterSpacing: - 0, - ), - ), - ), - ), - ], - ), - ), - ), - ), - ), - ], - ), - ), - ), - ), - Obx(() { - return Visibility( - // maintainState: true, - // maintainAnimation: true, - // maintainSize: true, - visible: controller.model.loginStyle == 2, - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 96.rpx, 0, 96.rpx, 0), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.03, - decoration: BoxDecoration(), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.025, - constraints: BoxConstraints( - minWidth: 466, - minHeight: 30, - ), - decoration: BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Align( - alignment: - AlignmentDirectional( - 0, 0), - child: Padding( - padding: - EdgeInsetsDirectional - .fromSTEB( - 0, 0, 0, 0), - child: Container( - width: 36, - height: 36, - decoration: - BoxDecoration(), - ), - ), - ), - Flexible( - child: Padding( - padding: - EdgeInsetsDirectional - .fromSTEB( - 0, 0, 0, 0), - child: Container( - width: MediaQuery.sizeOf( - context) - .width * - 0.622, - height: MediaQuery.sizeOf( - context) - .height * - 1, - // constraints: - // BoxConstraints( - // minWidth: 466, - // minHeight: 30, - // ), - decoration: - BoxDecoration(), - child: Container( - // width: 100, - // height: 100, - decoration: - BoxDecoration(), - child: Row( - mainAxisSize: - MainAxisSize.max, - children: [ - Align( - alignment: - AlignmentDirectional( - 0, 0), - child: Text( - '注:首次登录会自动创建账号' - .tr, - style: - TextStyle( - fontFamily: - 'Readex Pro', - color: stringToColor( - "#FFFFFF"), - fontSize: - 23.rpx, - letterSpacing: - 0, - ), - ), - ), - ], - ), - ), - ), - ), - ), - ], - ), + width: 90.rpx, + height: 90.rpx, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage( + 'assets/images/wechat.png'), // 本地图片 + fit: BoxFit.fill, // 填满整个 Container ), ), ), - ); - }), - Obx(() { - return Visibility( - // maintainState: true, - // maintainAnimation: true, - // maintainSize: true, - visible: controller.model.loginStyle == 2, - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 96.rpx, 0, 96.rpx, 0), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.03, - decoration: BoxDecoration(), - ), - ), - ); - }), - Obx(() { - return Visibility( - // maintainState: true, - // maintainAnimation: true, - // maintainSize: true, - visible: controller.model.loginStyle == 2, - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 96.rpx, 0, 96.rpx, 0), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.03, - decoration: BoxDecoration(), - ), - ), - ); - }), - Obx(() { - return Visibility( - // maintainState: true, - // maintainAnimation: true, - // maintainSize: true, - visible: controller.model.loginStyle == 1, - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 96.rpx, 0, 96.rpx, 0), - child: Container( - width: bodysize!.maxWidth, - // height: bodysize!.maxHeight * 0.06, - height: bodysize!.maxHeight * 0.03, - // decoration: - // BoxDecoration(color: Colors.pink), - ), - ), - ); - }), - Obx(() { - return Visibility( - // maintainState: true, - // maintainAnimation: true, - // maintainSize: true, - visible: controller.model.loginStyle == 1, - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 96.rpx, 0, 131.rpx, 0), - child: Container( - width: bodysize!.maxWidth, - // height: bodysize!.maxHeight * 0.06, - height: bodysize!.maxHeight * 0.03, - // decoration: - // BoxDecoration(color: Colors.pink), - child: Container( - width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 0.06, - decoration: BoxDecoration(), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Flexible( - child: InkWell( - onTap: () async {}, - child: Container( - width: MediaQuery.sizeOf( - context) - .width * - 0.253, - height: MediaQuery.sizeOf( - context) - .height * - 0.06, - constraints: - BoxConstraints( - minWidth: 190, - ), - decoration: - BoxDecoration(), - child: Row( - mainAxisSize: - MainAxisSize.max, - children: [ - Container( - width: 36, - height: 36, - decoration: - BoxDecoration(), - child: Align( - alignment: - AlignmentDirectional( - 0, 0), - child: Theme( - data: - ThemeData( - checkboxTheme: - CheckboxThemeData( - visualDensity: - VisualDensity - .compact, - materialTapTargetSize: - MaterialTapTargetSize - .shrinkWrap, - shape: - RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(64), - ), - ), - unselectedWidgetColor: - Color( - 0xFFD3D3D3), - ), - child: Obx( - () => - Checkbox( - value: registerController - .model - .save_password ?? - false, - onChanged: - (newValue) async { - registerController - .model - .save_password = newValue; - - controller - .updateAll(); - registerController - .updateAll(); - // 获取设备信息,需要用户点击确认隐私协议与用户协议选择框时才能获取 - // if (newValue == - // true) { - // Deviceconfig - // .initPlatformState(); - // } - }, - side: - BorderSide( - width: - 1.5, - color: Colors.white, - ), - activeColor: - stringToColor( - "#84F5FF"), - checkColor: - stringToColor( - "#011D33"), - ), - )), - ), - ), - Text( - "记住密码".tr, - style: TextStyle( - fontSize: - AppConstants() - .middler_text_fontSize, - color: stringToColor( - "#FFFFFF")), - ), - ], - ), - ), - ), - ), - Flexible( - child: Container( - width: MediaQuery.sizeOf( - context) - .width * - 0.201, - height: MediaQuery.sizeOf( - context) - .height * - 0.06, - constraints: BoxConstraints( - minWidth: 230, - ), - decoration: BoxDecoration(), - child: Row( - mainAxisSize: - MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.end, - children: [ - Flexible( - child: Container( - width: MediaQuery - .sizeOf( - context) - .width * - 0.124, - height: MediaQuery - .sizeOf( - context) - .height * - 1, - constraints: - BoxConstraints( - minHeight: 23, - ), - decoration: - BoxDecoration(), - child: Align( - alignment: - AlignmentDirectional( - 0, 0), - child: InkWell( - onTap: () { - Get.toNamed( - "/findPasswordPage"); - }, - child: Text( - '找回密码'.tr, - style: - TextStyle( - fontFamily: - 'Readex Pro', - color: stringToColor( - "#84F5FF"), - fontSize: - AppFontsize - .small_text_size, - letterSpacing: - 0, - ), - ), - ), - ), - ), - ), - SizedBox( - width: 29, - ), - Flexible( - child: Container( - width: MediaQuery - .sizeOf( - context) - .width * - 0.061, - height: MediaQuery - .sizeOf( - context) - .height * - 1, - constraints: - BoxConstraints( - minWidth: 30, - minHeight: 23, - ), - decoration: - BoxDecoration(), - child: Container( - width: MediaQuery - .sizeOf( - context) - .width * - 0.061, - height: 100, - constraints: - BoxConstraints( - minWidth: 46, - minHeight: 23, - ), - decoration: - BoxDecoration(), - child: Align( - alignment: - AlignmentDirectional( - 0, 0), - child: - InkWell( - onTap: () { - Get.toNamed( - "/registerPage"); - }, - child: Text( - '注册'.tr, - style: - TextStyle( - fontFamily: - 'Readex Pro', - color: stringToColor( - "#84F5FF"), - fontSize: - AppFontsize.small_text_size, - letterSpacing: - 0, - ), - ), - )), - ), - ), - ), - ], - ), - ), - ), - ], - ), - ), - ), - ), - ); - }), - Obx(() { - return Visibility( - // maintainState: true, - // maintainAnimation: true, - // maintainSize: true, - visible: controller.model.loginStyle == 1, - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 96.rpx, 0, 96.rpx, 0), - child: Container( - width: bodysize!.maxWidth, - // height: bodysize!.maxHeight * 0.06, - height: bodysize!.maxHeight * 0.03, - // decoration: - // BoxDecoration(color: Colors.pink), - ), - ), - ); - }), - Divider( - color: stringToColor("#495A67"), // 线的颜色 - thickness: 1.rpx, // 线的粗细 - height: 20, // 垂直方向的占位高度 - indent: 16, // 左边缩进 - endIndent: 16, // 右边缩进 - ), - Text( - "其他登录方式".tr, - style: TextStyle( - color: Colors.white, - fontSize: AppConstants() - .normal_text_fontSize), - ), - SizedBox( - height: 30.rpx, - ), - ClickableContainer( - backgroundColor: Colors.white, // 背景色 - highlightColor: Colors.grey, // 点击水波纹颜色 - borderRadius: 999.rpx, - padding: EdgeInsets.zero, - onTap: () async { - //loginController.model.isIos == true && - // if (loginController - // .model.register_agree == - // null || - // loginController - // .model.register_agree != - // true) { - // TopSlideNotification.show( - // context, - // text: "登录页.未同意协议".tr, - // textColor: - // themeController.currentColor.sc9, - // ); - // return; - // } - // await loginController - // .wxLoginSendAuth(context); - TopSlideNotification.show(context, - text: "测试阶段,暂不支持".tr); - }, - child: Container( - width: 90.rpx, - height: 90.rpx, - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage( - 'assets/images/wechat.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 Container - ), - ), ), - ), - ], + ], + ), ), ), ), ), - ), - Container( - width: bodysize!.maxWidth * 0.365, - height: MediaQuery.sizeOf(context).height * 0.044, - decoration: BoxDecoration(), - child: ClipRRect( - borderRadius: BorderRadius.circular(8), - child: Image.asset( - 'assets/images/_18328.png', - width: 300, - height: 200, - fit: BoxFit.contain, + Container( + width: bodysize!.maxWidth * 0.365, + height: MediaQuery.sizeOf(context).height * 0.044, + decoration: BoxDecoration(), + child: ClipRRect( + borderRadius: BorderRadius.circular(8), + child: Image.asset( + 'assets/images/_18328.png', + width: 300, + height: 200, + fit: BoxFit.contain, + ), ), ), - ), - SizedBox( - height: 73.rpx, - ), - Container( - width: bodysize!.maxWidth, - // height: bodysize!.maxHeight * 0.118, - height: bodysize!.maxHeight * 0.09, - constraints: BoxConstraints( - minWidth: 335, - minHeight: 61, + SizedBox( + height: 73.rpx, ), - decoration: BoxDecoration(), - child: Container( + Container( width: bodysize!.maxWidth, - height: bodysize!.maxHeight * 1, + // height: bodysize!.maxHeight * 0.118, + height: bodysize!.maxHeight * 0.09, constraints: BoxConstraints( minWidth: 335, minHeight: 61, ), decoration: BoxDecoration(), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: AlignmentDirectional(0, 0), - child: Text( - '合肥眠花糖家具有限责任公司版权所有', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFF9EA4B7), - fontSize: AppFontsize.explain_size, - letterSpacing: 0, + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 1, + constraints: BoxConstraints( + minWidth: 335, + minHeight: 61, + ), + decoration: BoxDecoration(), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: AlignmentDirectional(0, 0), + child: Text( + '合肥眠花糖家具有限责任公司版权所有', + style: TextStyle( + fontFamily: 'Readex Pro', + color: Color(0xFF9EA4B7), + fontSize: AppFontsize.explain_size, + letterSpacing: 0, + ), ), ), - ), - Align( - alignment: AlignmentDirectional(0, 0), - child: Text( - 'Copyright© 2019-2029', - style: TextStyle( - fontFamily: 'Readex Pro', - color: Color(0xFF9EA4B7), - fontSize: AppFontsize.explain_size, - letterSpacing: 0, + Align( + alignment: AlignmentDirectional(0, 0), + child: Text( + 'Copyright© 2019-2029', + style: TextStyle( + fontFamily: 'Readex Pro', + color: Color(0xFF9EA4B7), + fontSize: AppFontsize.explain_size, + letterSpacing: 0, + ), ), ), - ), - // Align( - // alignment: AlignmentDirectional(0, 0), - // child: Text( - // ' 网上国网 版权所有', - // style: FlutterFlowTheme.of(context) - // .bodyMedium - // .override( - // fontFamily: 'Readex Pro', - // color: Color(0xFF9EA4B7), - // fontSize: AppFontsize.explain_size, - // letterSpacing: 0, - // ), - // ), - // ), - ], + // Align( + // alignment: AlignmentDirectional(0, 0), + // child: Text( + // ' 网上国网 版权所有', + // style: FlutterFlowTheme.of(context) + // .bodyMedium + // .override( + // fontFamily: 'Readex Pro', + // color: Color(0xFF9EA4B7), + // fontSize: AppFontsize.explain_size, + // letterSpacing: 0, + // ), + // ), + // ), + ], + ), ), ), ), - ), - ], + ], + ), ), ), ), diff --git a/lib/pages/mh_page/user/page/register_page.dart b/lib/pages/mh_page/user/page/register_page.dart index e747876..220ab5a 100644 --- a/lib/pages/mh_page/user/page/register_page.dart +++ b/lib/pages/mh_page/user/page/register_page.dart @@ -137,7 +137,7 @@ class RegisterPage extends GetView { InputBorder.none, contentPadding: EdgeInsetsDirectional.fromSTEB( - 20.rpx, 0, 0, 10.rpx), + 20.rpx, 0, 0, 0.rpx), ), style: TextStyle( fontFamily: 'Readex Pro', diff --git a/lib/pages/mh_page/user/page/update_password_page.dart b/lib/pages/mh_page/user/page/update_password_page.dart index 4d93eb7..d0730f3 100644 --- a/lib/pages/mh_page/user/page/update_password_page.dart +++ b/lib/pages/mh_page/user/page/update_password_page.dart @@ -42,7 +42,7 @@ class UpdatePasswordPage extends GetView { ), ), child: Scaffold( - // key: scaffoldKey, + // key: scaffoldKey, appBar: AppBar( backgroundColor: Colors.transparent, // backgroundColor: Colors.transparent, @@ -80,7 +80,6 @@ class UpdatePasswordPage extends GetView { actions: [], centerTitle: false, ), - backgroundColor: Colors.transparent, body: Container( width: bodysize!.maxWidth, diff --git a/lib/routers/mh_routers.dart b/lib/routers/mh_routers.dart index b828425..827784f 100644 --- a/lib/routers/mh_routers.dart +++ b/lib/routers/mh_routers.dart @@ -108,7 +108,9 @@ var mhonGenerateRoute = (RouteSettings settings) { if (loginStatus != 1) { if (settings.name != "/loginPage" && settings.name != "/otherLoginPage" && - settings.name != "/mianPageBottomChange") { + settings.name != "/mianPageBottomChange" && + settings.name != "/registerPage" && + settings.name != "/findPasswordPage") { // TopSlideNotification.show( // navigatorKey.currentContext!, // text: "必须登录提示".tr,