From 6d1d01edc632c852fa4894699c263e525d8a69b4 Mon Sep 17 00:00:00 2001 From: wyf <494641114@qq.com> Date: Fri, 27 Jun 2025 10:02:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=99=BB=E5=BD=95=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/mh_page/homepage/new_Home_page.dart | 9 +- .../mh_page/user/page/mht_login_page.dart | 3222 ++++++++--------- 2 files changed, 1579 insertions(+), 1652 deletions(-) diff --git a/lib/pages/mh_page/homepage/new_Home_page.dart b/lib/pages/mh_page/homepage/new_Home_page.dart index 59f02ba..412ce84 100644 --- a/lib/pages/mh_page/homepage/new_Home_page.dart +++ b/lib/pages/mh_page/homepage/new_Home_page.dart @@ -171,7 +171,14 @@ class _NewHomePageState extends State { children: [ // 左侧头像 Obx(() { - return userInfo(userInfoController.model.login); + return InkWell( + onTap: () { + if (userInfoController.model.login == 0) { + Get.toNamed("/loginPage"); + } + }, + child: userInfo(userInfoController.model.login), + ); }), const Spacer(), // 左右分隔 FloatingSvgIcon( 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 be93d93..66a4dbf 100644 --- a/lib/pages/mh_page/user/page/mht_login_page.dart +++ b/lib/pages/mh_page/user/page/mht_login_page.dart @@ -145,6 +145,36 @@ class MHTLoginPage extends GetView { child: Scaffold( backgroundColor: Colors.transparent, resizeToAvoidBottomInset: true, + appBar: AppBar( + backgroundColor: Colors.transparent, + automaticallyImplyLeading: false, + iconTheme: IconThemeData(color: Colors.white), + titleSpacing: 0, + title: Container( + width: double.infinity, + height: 180.rpx, + child: Stack( + alignment: Alignment.center, + children: [ + // Text( + // '用户注册', + // textAlign: TextAlign.center, + // style: TextStyle( + // color: Colors.white, + // fontSize: 30.rpx, + // ), + // ), + Positioned( + left: 20.rpx, + child: returnIconButtomNew, + ), + ], + ), + ), + actions: [], + centerTitle: false, + ), + // key: scaffoldKey, body: PopScope( canPop: false, @@ -161,70 +191,177 @@ class MHTLoginPage extends GetView { } } }, - 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, - ), - ), - 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: Align( + alignment: AlignmentDirectional(0, 0), + child: Container( + width: bodysize!.maxWidth, + height: bodysize!.maxHeight * 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Align( + alignment: AlignmentDirectional(0, 0), + child: Container( + decoration: BoxDecoration(), child: Container( - // width: bodysize!.maxWidth * 0.74, - height: bodysize!.maxHeight * 0.79, + width: bodysize!.maxWidth, 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: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Obx(() { + return Visibility( + visible: controller.model.loginStyle == 1 + ? true + : false, + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 96.rpx, 0.rpx, 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: Container( - width: bodysize!.maxWidth, - height: - bodysize!.maxHeight * 0.06, - decoration: BoxDecoration(), - child: SingleChildScrollView( - scrollDirection: - Axis.horizontal, - child: Row( - mainAxisSize: - MainAxisSize.max, - children: [ - Container( + 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( + 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.165, + height: MediaQuery + .sizeOf( + context) + .height * + 0.045, + constraints: + BoxConstraints( + minWidth: 124, + ), + decoration: + BoxDecoration(), + 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 * @@ -239,143 +376,111 @@ class MHTLoginPage extends GetView { ), decoration: BoxDecoration(), - child: Container( - width: - MediaQuery.sizeOf( - context) + child: Column( + mainAxisSize: + MainAxisSize.max, + children: [ + Container( + width: MediaQuery + .sizeOf( + context) .width * - 0.165, - height: - MediaQuery.sizeOf( - context) + 0.14, + 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.165, - height: MediaQuery.sizeOf( - context) - .height * - 0.045, - constraints: - BoxConstraints( - minWidth: 124, - ), - decoration: - BoxDecoration(), - 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, - ), - ), - ), - ), - ), + 0.045, + constraints: + BoxConstraints( + minWidth: 105, ), - Align( + decoration: + BoxDecoration(), + child: 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"), + 0, 1), + child: Text( + '短信登录'.tr, + style: + TextStyle( + fontFamily: + 'Readex Pro', + color: Colors + .white, + fontSize: + AppFontsize + .normal_text_size, + letterSpacing: + 0, ), ), ), - ], - ), + ), + ], ), ), - 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( + ), + ], + ), + ), + ), + ), + ), + ); + }), + Obx(() { + return Visibility( + visible: controller.model.loginStyle == 2 + ? true + : false, + child: Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 96.rpx, 0, 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) @@ -397,7 +502,7 @@ class MHTLoginPage extends GetView { AlignmentDirectional( 0, 1), child: Text( - '短信登录'.tr, + '密码登录'.tr, style: TextStyle( fontFamily: @@ -413,117 +518,25 @@ class MHTLoginPage extends GetView { ), ), ), - ], - ), + ), + ], ), ), - ], - ), - ), - ), - ), - ), - ); - }), - 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, - ), - ), - ), - ), - ), - ], - ), - ), + ), + Container( + width: MediaQuery.sizeOf( + context) + .width * + 0.165, + height: MediaQuery.sizeOf( + context) + .height * + 1, + constraints: BoxConstraints( + minWidth: 100, ), - Container( + decoration: BoxDecoration(), + child: Container( width: MediaQuery.sizeOf( context) .width * @@ -534,1002 +547,98 @@ class MHTLoginPage extends GetView { 1, constraints: BoxConstraints( - minWidth: 100, + 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: 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, + 0.162, height: MediaQuery.sizeOf( context) .height * - 0.045, - constraints: - BoxConstraints( - minWidth: 124, - ), + 0.055, decoration: BoxDecoration(), - 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, - ), + 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, - ), + child: Container( + width: MediaQuery + .sizeOf( + context) + .width * + 0.156, + height: MediaQuery + .sizeOf( + context) + .height * + 0.003, + constraints: + BoxConstraints( + minWidth: 100, + maxWidth: 100, + maxHeight: 6, ), - ), - ), - 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, - ), + decoration: + BoxDecoration( + color: stringToColor( + "#84F5FF"), ), ), ), @@ -1537,420 +646,1231 @@ 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( - // maintainState: true, - // maintainAnimation: true, - // maintainSize: true, - visible: - controller.model.loginStyle == 2, - child: Padding( - padding: - EdgeInsetsDirectional.fromSTEB( - 96.rpx, 0, 96.rpx, 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: 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, 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', - color: stringToColor( - "#84F5FF"), - fontSize: AppFontsize - .small_text_size, - letterSpacing: 0, - ), - ), + 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, ), - InkWell( - onTap: () { - Get.toNamed( - "/registerPage"); - }, - child: Text( - '注册'.tr, - style: TextStyle( - fontFamily: - 'Readex Pro', - color: stringToColor( - "#84F5FF"), - fontSize: AppFontsize - .small_text_size, - letterSpacing: 0, - ), - ), + hintText: '请输入账号', + hintStyle: TextStyle( + fontFamily: 'Readex Pro', + color: Color(0xFFD2D2D2), + fontSize: 13.px, + letterSpacing: 0, ), - ].divide(SizedBox( - width: 57.rpx, - )), + 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( - // maintainState: true, - // maintainAnimation: true, - // maintainSize: true, - visible: - controller.model.loginStyle == 1, - child: Padding( - padding: - EdgeInsetsDirectional.fromSTEB( - 96.rpx, 0, 96.rpx, 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, - height: bodysize!.maxHeight * 0.03, - // decoration: - // BoxDecoration(color: Colors.pink), + 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, + ), + ), + ), ), ), - ); - }), - Divider( - color: stringToColor("#495A67"), // 线的颜色 - thickness: 1.rpx, // 线的粗细 - height: 20, // 垂直方向的占位高度 - indent: 16, // 左边缩进 - endIndent: 16, // 右边缩进 + ), + ); + }), + 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, 34.rpx, 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, + ), + ), + ), + ), ), - 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); - }, + ), + Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 96.rpx, 38.rpx, 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: 90.rpx, - height: 90.rpx, - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage( - 'assets/images/wechat.png'), // 本地图片 - fit: BoxFit.fill, // 填满整个 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, + ), + ), + ), + ), + ], + ), + ), + ), + ), + ), + ], ), ), ), - ], - ), - ), - ), - ), - ), - 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, - ), - decoration: BoxDecoration(), - 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, + ), + Obx(() { + return Visibility( + 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 == 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( + 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( + 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.03, + ), + ), + ); + }), + Obx(() { + return Visibility( + 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.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', + color: stringToColor( + "#84F5FF"), + fontSize: AppFontsize + .small_text_size, + letterSpacing: 0, + ), + ), + ), + 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, + )), + ), + ), + ), + ), + ); + }), + Obx(() { + return Visibility( + 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.03, + ), + ), + ); + }), + 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 + ), ), ), ), - 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, - // ), - // ), - // ), ], ), ), ), ), - ], - ), + ), + Container( + child: Column( + children: [ + 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, + ), + decoration: BoxDecoration(), + 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, + ), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + ], ), ), ),