diff --git a/assets/images/wechat.png b/assets/images/wechat.png index a12ce17..e04e541 100644 Binary files a/assets/images/wechat.png and b/assets/images/wechat.png differ diff --git a/assets/img/background.png b/assets/img/background.png new file mode 100644 index 0000000..f34dd5c Binary files /dev/null and b/assets/img/background.png differ diff --git a/assets/mhlangs/zh_CN.json b/assets/mhlangs/zh_CN.json index e0f54d5..ff867e5 100644 --- a/assets/mhlangs/zh_CN.json +++ b/assets/mhlangs/zh_CN.json @@ -11,5 +11,36 @@ "设置": "设置", "详情": "详情", "人员资料": "人员资料" - } + }, + "请输入手机号":"请输入手机号", + "请输入正确的手机号":"请输入正确的手机号", + "请输入密码":"请输入密码", + "密码格式提示":"1.密码长度必须至少8位\n2.密码需要字母加数字\n3.特殊字符和大写字母至少包含一个", + "请输入确认密码":"请输入确认密码", + "两次密码不一致":"两次密码不一致", + "请输入验证码":"请输入验证码", + "需要同意协议":"需要同意协议", + "请选择登录方式":"请选择登录方式", + "账户不能为空":"账户不能为空", + "密码不能为空":"密码不能为空", + "验证码不能为空":"验证码不能为空", + "密码登录":"密码登录", + "短信登录":"短信登录", + "获取验证码":"获取验证码", + "登录":"登录", + "找回密码":"找回密码", + "注册":"注册", + "我已阅读并同意":"我已阅读并同意", + "与":"与", + "《用户协议》":"《用户协议》", + "《隐私协议》":"《隐私协议》", + "注:首次登录会自动创建账号":"注:首次登录会自动创建账号", + "请输入新密码":"请输入新密码", + "确认新密码":"确认新密码", + "秒":"秒" + + + + + } \ No newline at end of file diff --git a/lib/common/color/appConstants.dart b/lib/common/color/appConstants.dart index c3cf4c0..779fbe5 100644 --- a/lib/common/color/appConstants.dart +++ b/lib/common/color/appConstants.dart @@ -21,6 +21,7 @@ class AppConstants { double smaller_text_fontSize = 18.rpx; //普通文字字号 double small_text_fontSize = 20.rpx; //普通文字字号 + double middler_text_fontSize = 24.rpx; //普通文字字号 double normal_text_fontSize = 26.rpx; //普通文字字号 double title_text_fontSize = 30.rpx; //标题文字字号 diff --git a/lib/controller/mh_controller/mh_language_controller.dart b/lib/controller/mh_controller/mh_language_controller.dart index c588611..0fcc400 100644 --- a/lib/controller/mh_controller/mh_language_controller.dart +++ b/lib/controller/mh_controller/mh_language_controller.dart @@ -19,13 +19,13 @@ class MHLanguageModel { factory MHLanguageModel.fromJson(Map json) { try { - return _$LanguageModelFromJson(json); + return _$MHLanguageModelFromJson(json); } catch (e) { return MHLanguageModel(); // 或者返回一个带有错误信息的特定实例 } } - Map toJson() => _$LanguageModelToJson(this); + Map toJson() => _$MHLanguageModelToJson(this); } class MHLanguageController extends GetControllerEx { diff --git a/lib/controller/mh_controller/mh_language_controller.g.dart b/lib/controller/mh_controller/mh_language_controller.g.dart index 5386c92..14c310d 100644 --- a/lib/controller/mh_controller/mh_language_controller.g.dart +++ b/lib/controller/mh_controller/mh_language_controller.g.dart @@ -6,14 +6,14 @@ part of 'mh_language_controller.dart'; // JsonSerializableGenerator // ************************************************************************** -MHLanguageModel _$LanguageModelFromJson(Map json) => +MHLanguageModel _$MHLanguageModelFromJson(Map json) => MHLanguageModel() ..filename = json['filename'] as String? ..language_name = json['language_name'] as String? ..selected = json['selected'] as bool? ..language_code = json['language_code'] as String?; -Map _$LanguageModelToJson(MHLanguageModel instance) => +Map _$MHLanguageModelToJson(MHLanguageModel instance) => { 'filename': instance.filename, 'language_name': instance.language_name, diff --git a/lib/main.dart b/lib/main.dart index 57f4e67..1dae682 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -63,6 +63,8 @@ import 'package:vbvs_app/model/CustomThemeColor.dart'; import 'package:vbvs_app/model/user_data.dart'; import 'package:vbvs_app/pages/main_bottom/component/main_page_b_bottom_change.dart'; import 'package:vbvs_app/pages/mh_page/MattressControl.dart'; +import 'package:vbvs_app/pages/mh_page/user/controller/mht_login_controller.dart'; +import 'package:vbvs_app/pages/mh_page/user/controller/mht_register_controller.dart'; import 'package:vbvs_app/routers/mh_routers.dart'; import 'controller/mh_controller/apply_repair_controller.dart'; @@ -279,7 +281,8 @@ class MyApp extends StatelessWidget { debugShowCheckedModeBanner: false, title: '', theme: themeController.currentTheme, - home: MainPageBBottomChange(), + // home: MainPageBBottomChange(), + initialRoute: "/loginPage", onGenerateRoute: mhonGenerateRoute, initialBinding: BindingsBuilder(() => [ // Get.lazyPut(() => UserInfoController()), @@ -316,6 +319,8 @@ class MyApp extends StatelessWidget { Get.lazyPut(() => DeviceShareListController()), Get.lazyPut(() => DeviceCalibrationController()), Get.lazyPut(() => RepairController()), + Get.lazyPut(() => MHTLoginController()), + Get.lazyPut(() => MHTRegisterController()), ])); } @@ -367,7 +372,8 @@ class MyApp extends StatelessWidget { ])); } - final selectapp = "th"; + // final selectapp = "th"; + final selectapp = "mht"; // This widget is the root of your application. @override Widget build(BuildContext context) { diff --git a/lib/pages/device_bind/componnet/SingleBlueteethDeviceCompoentWidget.dart b/lib/pages/device_bind/componnet/SingleBlueteethDeviceCompoentWidget.dart index 08b5de5..52592fb 100644 --- a/lib/pages/device_bind/componnet/SingleBlueteethDeviceCompoentWidget.dart +++ b/lib/pages/device_bind/componnet/SingleBlueteethDeviceCompoentWidget.dart @@ -110,6 +110,7 @@ class _SingleBlueteethDeviceCompoentWidgetState } }, onCancel: () { + print('用户点击了取消'); blueteethBindController.currentDeviceMac.value = ""; blueteethBindController.updateAll(); diff --git a/lib/pages/main_bottom/component/main_page_b_bottom_change.dart b/lib/pages/main_bottom/component/main_page_b_bottom_change.dart index 603cce4..bec2ebd 100644 --- a/lib/pages/main_bottom/component/main_page_b_bottom_change.dart +++ b/lib/pages/main_bottom/component/main_page_b_bottom_change.dart @@ -154,11 +154,9 @@ import 'package:flutter/material.dart'; import 'package:vbvs_app/pages/common/bezier_bottom_navigation_bar.dart'; import 'package:vbvs_app/pages/mh_page/MattressControl.dart'; -import 'package:vbvs_app/pages/mh_page/find_password_page.dart'; import 'package:vbvs_app/pages/mh_page/new_Home_page.dart'; import 'package:vbvs_app/pages/mh_page/new_mine_page.dart'; -import 'package:vbvs_app/pages/mh_page/register_page.dart'; -import 'package:vbvs_app/pages/mh_page/score_page.dart'; +import 'package:vbvs_app/pages/mh_page/user/page/register_page.dart'; class MainPageBBottomChange extends StatefulWidget { @override diff --git a/lib/pages/mh_page/user/controller/mht_login_controller.dart b/lib/pages/mh_page/user/controller/mht_login_controller.dart new file mode 100644 index 0000000..5d06e25 --- /dev/null +++ b/lib/pages/mh_page/user/controller/mht_login_controller.dart @@ -0,0 +1,189 @@ +import 'package:ef/ef.dart'; +import 'package:flutter/material.dart'; +import 'package:flutterflow_ui/flutterflow_ui.dart'; +import 'package:fluwx/fluwx.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:vbvs_app/common/util/MyUtils.dart'; +import 'package:vbvs_app/component/tool/TopSlideNotification.dart'; +import 'package:vbvs_app/pages/mh_page/user/controller/mht_register_controller.dart'; + +part 'mht_login_controller.g.dart'; + +@JsonSerializable() +class LoginModel { + //版本id + int? loginStyle = 1; //1.密码登录 2.短信登录 + + String? account = '17649984946'; //账户 + // String? account = '13953240733'; //账户 + String? password = 'wyf123,.'; //密码 + // String? account = '15255134931'; //账户 + // String? password = 'mht123,.'; //密码 + + // String? account = '18607922869'; //账户 + // String? password = '373068'; //密码 + // String? account = ''; //账户 + // String? password = ''; //密码 + + String? phone; //手机号 + String? code; //验证码 + + String? register_code; + + bool? showPd = true; + + int? forceLogin = 0; + + bool? isIos; //是否为ios设备 + + bool? isWeChatNotInstalled; //是否安装微信 + + LoginModel(); + + static LoginModel fromJson(Map json) => + _$LoginModelFromJson(json); + Map toJson() => _$LoginModelToJson(this); +} + +class MHTLoginController extends GetControllerEx { + // 初始化实例 + final Fluwx fluwx = Fluwx(); + // 微信监听返回值 + FluwxCancelable? fluwxCancelable; + + MHTLoginController() { + attr = GetModel(LoginModel()).obs; + } + + MHTRegisterController registerController = Get.find(); + + //登录 + Future login(BuildContext context) async { + String message = ''; + String account = ''; + String password = ''; + if (model.loginStyle == null) { + message = '请选择登录方式'.tr; + TopSlideNotification.show(context, + text: message, textColor: stringToColor("#FF7159")); + return message; + } + if (model.loginStyle == 1) { + //账号登录 + if (model.account == null || model.account!.isEmpty) { + message = '账户不能为空'.tr; + TopSlideNotification.show(context, + text: message, textColor: stringToColor("#FF7159")); + return message; + } + if (model.password == null || model.password!.isEmpty) { + message = '密码不能为空'.tr; + + TopSlideNotification.show(context, + text: message, textColor: stringToColor("#FF7159")); + + return message; + } + account = model.account!; + password = model.password!; + } + if (model.loginStyle == 2) { + //账号登录 + if (model.phone == null || model.phone!.isEmpty) { + message = '请输入手机号'.tr; + + TopSlideNotification.show(context, + text: message, textColor: stringToColor("#FF7159")); + return message; + } + if (!MyUtils.isValidPhoneNumber(model.phone!)) { + message = '请输入正确的手机号'.tr; + + TopSlideNotification.show(context, + text: message, textColor: stringToColor("#FF7159")); + return message; + } + if (model.code == null || model.code!.isEmpty) { + message = '验证码不能为空'.tr; + + TopSlideNotification.show(context, + text: message, textColor: stringToColor("#FF7159")); + return message; + } + account = model.phone!; + password = model.code!; + } + + if (registerController.model.register_agree == null || + registerController.model.register_agree != true) { + message = "需要同意协议".tr; + showToast(message); + return message; + } + model.forceLogin = 0; + return message; + } + + Future getCode(BuildContext context) async { + String message = ""; + if (registerController.model.register_agree == null || + registerController.model.register_agree != true) { + message = "需要同意协议".tr; + showToast(message); + return message; + } + if (model.phone == null || model.phone!.isEmpty) { + message = "请输入手机号".tr; + showToast(message); + return message; + } + if (!MyUtils.isValidPhoneNumber(model.phone!)) { + message = '请输入正确的手机号'.tr; + showToast(message); + return message; + } + return ''; + } + + //微信登录 + Future wxLoginSendAuth() async { + /* + 1、目前移动应用上微信登录只提供原生的登录方式,需要用户安装微信客户端才能配合使用。 + 2、对于Android应用,建议总是显示微信登录按钮,当用户手机没有安装微信客户端时,请引导用户下载安装微信客户端。 + 3、对于iOS应用,考虑到iOS应用商店审核指南中的相关规定,建议开发者接入微信登录时,先检测用户手机是否已安装微信客户端 + (使用sdk中isWXAppInstalled函数 ),对未安装的用户隐藏微信登录按钮,只提供其他登录方式(比如手机号注册登录、游客登录等) + */ + if (isAndroid) { + bool isWeChatInstalled = await fluwx.isWeChatInstalled; + debugPrint('is wechat installed: $isWeChatInstalled'); + if (!isWeChatInstalled) { + showToast("请先安装微信APP,再使用微信登录"); + return; + } + } + fluwx + .authBy( + which: NormalAuth( + scope: 'snsapi_userinfo', + state: 'wechat_sdk_zhmht_wxlogin', + )) + .then((data) { + //返回true表示成功或者false表示失败,这边没有意义从login_controller页面构造函数监听中去处理 + debugPrint('msg:$data'); + }); + } + + //退出登录 + Future logout() async { + // await repository.logout(); + } + + loginByWechatCode(String code) async { + // return await repository.loginByWechatCode(code); + } + + //注销账号 + deletedAccount() async { + // return await repository.deletedAccount(); + } +} diff --git a/lib/pages/mh_page/user/controller/mht_login_controller.g.dart b/lib/pages/mh_page/user/controller/mht_login_controller.g.dart new file mode 100644 index 0000000..49c28e8 --- /dev/null +++ b/lib/pages/mh_page/user/controller/mht_login_controller.g.dart @@ -0,0 +1,33 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'mht_login_controller.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +LoginModel _$LoginModelFromJson(Map json) => LoginModel() + ..loginStyle = (json['loginStyle'] as num?)?.toInt() + ..account = json['account'] as String? + ..password = json['password'] as String? + ..phone = json['phone'] as String? + ..code = json['code'] as String? + ..register_code = json['register_code'] as String? + ..showPd = json['showPd'] as bool? + ..forceLogin = (json['forceLogin'] as num?)?.toInt() + ..isIos = json['isIos'] as bool? + ..isWeChatNotInstalled = json['isWeChatNotInstalled'] as bool?; + +Map _$LoginModelToJson(LoginModel instance) => + { + 'loginStyle': instance.loginStyle, + 'account': instance.account, + 'password': instance.password, + 'phone': instance.phone, + 'code': instance.code, + 'register_code': instance.register_code, + 'showPd': instance.showPd, + 'forceLogin': instance.forceLogin, + 'isIos': instance.isIos, + 'isWeChatNotInstalled': instance.isWeChatNotInstalled, + }; diff --git a/lib/pages/mh_page/user/controller/mht_register_controller.dart b/lib/pages/mh_page/user/controller/mht_register_controller.dart new file mode 100644 index 0000000..80afc23 --- /dev/null +++ b/lib/pages/mh_page/user/controller/mht_register_controller.dart @@ -0,0 +1,131 @@ +import 'package:ef/ef.dart'; +import 'package:flutter/src/widgets/framework.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:vbvs_app/common/util/MyUtils.dart'; +import 'package:vbvs_app/component/tool/TopSlideNotification.dart'; + +part 'mht_register_controller.g.dart'; + +@JsonSerializable() +class RegisterModel { + String? register_phone; //注册手机号 + String? register_pd; //注册密码 + String? register_confirm_pd; //注册确认密码 + String? register_code; //注册验证码 + + bool? register_agree = false; //注册协议 + bool? save_password = false; //记住密码 + + bool? pdshow = true; //是否显示密码 + bool? cpdshow = true; //是否显示密码 + + RegisterModel(); + static RegisterModel fromJson(Map json) => + _$RegisterModelFromJson(json); + Map toJson() => _$RegisterModelToJson(this); +} + +class MHTRegisterController extends GetControllerEx { + MHTRegisterController() { + attr = GetModel(RegisterModel()).obs; + } + + Future registerUser(BuildContext context) async { + String message = ""; + if (model.register_phone == null || model.register_phone!.isEmpty) { + message = "请输入手机号".tr; + TopSlideNotification.show(context, + text: message, textColor: stringToColor("#FF7159")); + return message; + } + if (!MyUtils.isValidPhoneNumber(model.register_phone!)) { + message = '请输入正确的手机号'.tr; + TopSlideNotification.show(context, + text: message, textColor: stringToColor("#FF7159")); + return message; + } + if (model.register_pd == null || model.register_pd!.isEmpty) { + message = "请输入密码".tr; + TopSlideNotification.show(context, + text: message, textColor: stringToColor("#FF7159")); + return message; + } + String passwordMsg = "密码格式提示".tr; + bool hasUppercase = model.register_pd!.contains(RegExp(r'[A-Z]')); + bool hasDigit = model.register_pd!.contains(RegExp(r'[0-9]')); + bool hasSpecialCharacters = + model.register_pd!.contains(RegExp(r'[!@#$%^&*(),.?":{}|<>]')); + bool hasLetter = model.register_pd!.contains(RegExp(r'[a-zA-Z]')); + + if (model.register_pd!.length < 8) { + message = passwordMsg; + TopSlideNotification.show(context, + text: message, textColor: stringToColor("#FF7159")); + return message; + } + + if (!hasLetter || !hasDigit) { + message = passwordMsg; + TopSlideNotification.show(context, + text: message, textColor: stringToColor("#FF7159")); + return message; + } + + if (!(hasSpecialCharacters || hasUppercase)) { + message = passwordMsg; + TopSlideNotification.show(context, + text: message, textColor: stringToColor("#FF7159")); + return message; + } + if (model.register_confirm_pd == null || + model.register_confirm_pd!.isEmpty) { + message = "请输入确认密码".tr; + TopSlideNotification.show(context, + text: message, textColor: stringToColor("#FF7159")); + return message; + } + if (model.register_pd != model.register_confirm_pd) { + message = "两次密码不一致".tr; + TopSlideNotification.show(context, + text: message, textColor: stringToColor("#FF7159")); + return message; + } + if (model.register_code == null || model.register_code!.isEmpty) { + message = "请输入验证码".tr; + TopSlideNotification.show(context, + text: message, textColor: stringToColor("#FF7159")); + return message; + } + if (model.register_agree == null || model.register_agree != true) { + message = "需要同意协议".tr; + TopSlideNotification.show(context, + text: message, textColor: stringToColor("#FF7159")); + return message; + } + // message = await repository.createUser( + // model.register_pd!, model.register_phone!, model.register_code!); + // if (message.isNotEmpty) { + // showToast(message); + // return message; + // } + + return ""; + } + + Future getCode(BuildContext context) async { + String message = ""; + if (model.register_phone == null || model.register_phone!.isEmpty) { + message = "请输入手机号".tr; + TopSlideNotification.show(context, + text: message, textColor: stringToColor("#FF7159")); + return message; + } + if (!MyUtils.isValidPhoneNumber(model.register_phone!)) { + message = '请输入正确的手机号'.tr; + TopSlideNotification.show(context, + text: message, textColor: stringToColor("#FF7159")); + return message; + } + return ''; + } +} diff --git a/lib/pages/mh_page/user/controller/mht_register_controller.g.dart b/lib/pages/mh_page/user/controller/mht_register_controller.g.dart new file mode 100644 index 0000000..dca2e2b --- /dev/null +++ b/lib/pages/mh_page/user/controller/mht_register_controller.g.dart @@ -0,0 +1,28 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'mht_register_controller.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +RegisterModel _$RegisterModelFromJson(Map json) => + RegisterModel() + ..register_phone = json['register_phone'] as String? + ..register_pd = json['register_pd'] as String? + ..register_confirm_pd = json['register_confirm_pd'] as String? + ..register_code = json['register_code'] as String? + ..register_agree = json['register_agree'] as bool? + ..pdshow = json['pdshow'] as bool? + ..cpdshow = json['cpdshow'] as bool?; + +Map _$RegisterModelToJson(RegisterModel instance) => + { + 'register_phone': instance.register_phone, + 'register_pd': instance.register_pd, + 'register_confirm_pd': instance.register_confirm_pd, + 'register_code': instance.register_code, + 'register_agree': instance.register_agree, + 'pdshow': instance.pdshow, + 'cpdshow': instance.cpdshow, + }; diff --git a/lib/pages/mh_page/find_password_page.dart b/lib/pages/mh_page/user/page/find_password_page.dart similarity index 97% rename from lib/pages/mh_page/find_password_page.dart rename to lib/pages/mh_page/user/page/find_password_page.dart index a882395..bcfd35b 100644 --- a/lib/pages/mh_page/find_password_page.dart +++ b/lib/pages/mh_page/user/page/find_password_page.dart @@ -58,7 +58,7 @@ class FindPasswordPage extends GetView { children: [ // 中间居中的标题 Text( - '找回密码', + '找回密码'.tr, textAlign: TextAlign.center, style: TextStyle( color: Colors.white, @@ -84,9 +84,6 @@ class FindPasswordPage extends GetView { child: Column( mainAxisSize: MainAxisSize.max, children: [ - // TitleComponentWidget( - // titleName: '找回密码', - // ), Expanded( child: Padding( padding: EdgeInsetsDirectional.fromSTEB( @@ -134,17 +131,17 @@ class FindPasswordPage extends GetView { .override( fontFamily: 'Readex Pro', - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), - hintText: '请输入手机号', + hintText: '请输入手机号'.tr, hintStyle: FlutterFlowTheme.of( context) .labelMedium .override( fontFamily: 'Readex Pro', color: Color(0xFF929699), - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), enabledBorder: InputBorder.none, @@ -155,7 +152,7 @@ class FindPasswordPage extends GetView { contentPadding: EdgeInsetsDirectional .fromSTEB(20.rpx, 0, 0, - 10.rpx), + 0.rpx), ), style: FlutterFlowTheme.of(context) @@ -163,7 +160,7 @@ class FindPasswordPage extends GetView { .override( fontFamily: 'Readex Pro', - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), ), @@ -216,7 +213,7 @@ class FindPasswordPage extends GetView { letterSpacing: 0, ), - hintText: '请输验证码', + hintText: '请输验证码'.tr, hintStyle: FlutterFlowTheme.of( context) @@ -227,7 +224,7 @@ class FindPasswordPage extends GetView { color: Color( 0xFF929699), fontSize: - 20.rpx, + 26.rpx, letterSpacing: 0, ), @@ -242,7 +239,7 @@ class FindPasswordPage extends GetView { contentPadding: EdgeInsetsDirectional .fromSTEB(20.rpx, - 0, 0, 10.rpx), + 0, 0, 0.rpx), ), style: FlutterFlowTheme.of( context) @@ -250,7 +247,7 @@ class FindPasswordPage extends GetView { .override( fontFamily: 'Readex Pro', - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), ), @@ -259,18 +256,19 @@ class FindPasswordPage extends GetView { ), Align( alignment: AlignmentDirectional( - 0.2, 0.3), + 0.4, 0.1), child: Container( - width: 3, - height: 30, + width: 1.rpx, + height: 38.rpx, decoration: BoxDecoration( - color: Color(0xFFCCCCCC), + color: + stringToColor("#929699"), ), ), ), Align( alignment: - AlignmentDirectional(0.9, 0), + AlignmentDirectional(1.2, 0), child: Container( width: bodysize!.maxWidth * 0.157, @@ -326,10 +324,9 @@ class FindPasswordPage extends GetView { .value == 0 ? '获取验证码' - : '${countdownController.countdown.value}秒', + : '${countdownController.countdown.value}' + + '秒'.tr, style: TextStyle( - fontFamily: - 'Readex Pro', color: Color(0xFF333333), fontSize: 20.rpx, @@ -381,10 +378,10 @@ class FindPasswordPage extends GetView { .override( fontFamily: 'Readex Pro', - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), - hintText: '请输入新密码', + hintText: '请输入新密码'.tr, hintStyle: FlutterFlowTheme .of(context) .labelMedium @@ -393,7 +390,7 @@ class FindPasswordPage extends GetView { 'Readex Pro', color: Color(0xFF929699), - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), enabledBorder: @@ -406,7 +403,7 @@ class FindPasswordPage extends GetView { contentPadding: EdgeInsetsDirectional .fromSTEB( - 10, 10, 0, 0), + 10, 26.rpx, 0, 0), suffixIcon: IconButton( icon: Icon( // 根据 pdshow 控制图标 @@ -431,7 +428,7 @@ class FindPasswordPage extends GetView { .override( fontFamily: 'Readex Pro', - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), ); @@ -477,7 +474,7 @@ class FindPasswordPage extends GetView { .override( fontFamily: 'Readex Pro', - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), hintText: '确认新密码', @@ -489,7 +486,7 @@ class FindPasswordPage extends GetView { 'Readex Pro', color: Color(0xFF929699), - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), enabledBorder: @@ -502,7 +499,7 @@ class FindPasswordPage extends GetView { contentPadding: EdgeInsetsDirectional .fromSTEB( - 10, 10, 0, 0), + 10, 26.rpx, 0, 0), suffixIcon: IconButton( icon: Icon( // 根据 pdshow 控制图标 @@ -527,7 +524,7 @@ class FindPasswordPage extends GetView { .override( fontFamily: 'Readex Pro', - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), ); @@ -608,7 +605,7 @@ class FindPasswordPage extends GetView { fontFamily: 'Readex Pro', color: Color(0XFF003058), letterSpacing: 0, - fontSize: 30.rpx, + fontSize: 26.rpx, ), ), ), diff --git a/lib/pages/mh_page/user/page/mht_login_page.dart b/lib/pages/mh_page/user/page/mht_login_page.dart new file mode 100644 index 0000000..75dbcec --- /dev/null +++ b/lib/pages/mh_page/user/page/mht_login_page.dart @@ -0,0 +1,2151 @@ +import 'dart:io'; + +import 'package:ef/ef.dart'; +import 'package:flutter/material.dart'; +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:vbvs_app/common/color/appConstants.dart'; +import 'package:vbvs_app/common/color/appFontsize.dart'; +import 'package:vbvs_app/common/util/CheckNetwork.dart'; +import 'package:vbvs_app/common/util/CommonVariables.dart'; +import 'package:vbvs_app/common/util/FitTool.dart'; +import 'package:vbvs_app/common/util/MyUtils.dart'; +import 'package:vbvs_app/component/tool/CustomCard.dart'; +import 'package:vbvs_app/controller/time/countdown_controller.dart'; +import 'package:vbvs_app/pages/mh_page/user/controller/mht_login_controller.dart'; +import 'package:vbvs_app/pages/mh_page/user/controller/mht_register_controller.dart'; + +class MHTLoginPage extends GetView { + final scaffoldKey = GlobalKey(); + BoxConstraints? bodysize; + + final ScrollController _scrollController = ScrollController(); + final FocusNode _focusNode1 = FocusNode(); + final FocusNode _focusNode2 = FocusNode(); + final FocusNode _focusNode3 = FocusNode(); + final FocusNode _focusNode4 = FocusNode(); + + MHTLoginPage({super.key}) { + controller.model.showPd = true; + _focusNode1.addListener(() { + if (_focusNode1.hasFocus) { + MyUtils.scrollToFocusedInput(_focusNode1, _scrollController); + } + }); + _focusNode2.addListener(() { + if (_focusNode2.hasFocus) { + MyUtils.scrollToFocusedInput(_focusNode2, _scrollController); + } + }); + _focusNode3.addListener(() { + if (_focusNode3.hasFocus) { + MyUtils.scrollToFocusedInput(_focusNode3, _scrollController); + } + }); + _focusNode4.addListener(() { + if (_focusNode4.hasFocus) { + MyUtils.scrollToFocusedInput(_focusNode4, _scrollController); + } + }); + + // 微信登录监听 + Fluwx fluwx = controller.fluwx; + /* + 1、目前移动应用上微信登录只提供原生的登录方式,需要用户安装微信客户端才能配合使用。 + 2、对于Android应用,建议总是显示微信登录按钮,当用户手机没有安装微信客户端时,请引导用户下载安装微信客户端。 + 3、对于iOS应用,考虑到iOS应用商店审核指南中的相关规定,建议开发者接入微信登录时,先检测用户手机是否已安装微信客户端 + (使用sdk中isWXAppInstalled函数 ),对未安装的用户隐藏微信登录按钮,只提供其他登录方式(比如手机号注册登录、游客登录等) + */ + if (isiOS) { + controller.model.isIos = true; + fluwx.isWeChatInstalled.then((isWeChatInstalled) { + debugPrint('is wechat installed: $isWeChatInstalled'); + if (!isWeChatInstalled) { + // TODO ios未安装微信 隐藏微信一键登录按钮 + controller.model.isWeChatNotInstalled = false; + } else { + controller.model.isWeChatNotInstalled = true; + } + controller.updateAll(); + }); + } + + // 微信监听回调 + controller.fluwxCancelable = fluwx.addSubscriber((response) async { + if (response is WeChatAuthResponse) { + debugPrint('state :${response.state} \n code:${response.code}'); + int errCode = response.errCode ?? -9999; + if (errCode == 0) { + // TODO 微信登录成功 传递code给后台 再操作逻辑 + String code = response.code ?? ""; + //把微信登录返回的code传给后台,剩下的事就交给后台处理 + //首次未注册的用户引导去手机号填写页面 + //已注册的用户直接跳转首页 + if (CommonVariables.isNetWorkOn == false) { + showToast("网络未连接,请开启设备网络后重试"); + return; + } + String msg = await controller.loginByWechatCode(code); + if (msg.isEmpty) { + // TODO 操作全部跳转页面前成功以后移除监听,防止重复监听,其他方式登录成功也需要移出监听 + controller.fluwxCancelable?.cancel(); + // 登录成功移出网络检查监听 + Checknetwork.subscription?.cancel(); + Get.offAndToNamed("/mianPageBottomChange"); + } + // TODO 操作全部跳转页面前成功以后移除监听,防止重复监听,其他方式登录成功也需要移出监听 + // fluwxCancelable?.cancel(); + } else if (errCode == -4) { + showToast("用户拒绝授权"); + } else if (errCode == -2) { + showToast("用户取消授权"); + } + } + }); + } + + DateTime? _lastBackPressedTime; // 记录上一次返回的时间 + + final getStorage = GetStorage(); + + @override + Widget build(BuildContext context) { + MHTRegisterController registerController = Get.find(); + bool isProgrammaticPop = false; // 标记变量 + Future.delayed(const Duration(milliseconds: 300), () { + String? isShowYingShiDialog = getStorage.read("isShowYingShiDialog"); + if (isShowYingShiDialog == null || isShowYingShiDialog != "true") { + String btnName = "同意"; + String cancelName = "取消"; + if (Platform.isAndroid) { + cancelName = "退出"; + } + } + }); + + return LayoutBuilder(builder: (context, cc) { + 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: 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(), + ), + Expanded( + child: Align( + alignment: AlignmentDirectional(0, 0), + child: Container( + // width: bodysize!.maxWidth * 0.74, + height: bodysize!.maxHeight * 0.79, + 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: 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( + 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: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + 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( + alignment: + AlignmentDirectional( + 0, 1), + child: Text( + '短信登录'.tr, + style: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + fontFamily: + 'Readex Pro', + color: Colors + .white, + fontSize: + AppFontsize + .normal_text_size, + letterSpacing: + 0, + ), + ), + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + ), + ), + ); + }), + 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: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + 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, + ), + 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: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + 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: + FlutterFlowTheme.of( + context) + .labelMedium + .override( + fontFamily: + 'Readex Pro', + fontSize: AppFontsize + .normal_text_size, + letterSpacing: 0, + ), + hintText: '请输入账号', + hintStyle: FlutterFlowTheme + .of(context) + .labelMedium + .override( + 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: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + 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: + FlutterFlowTheme.of( + context) + .labelMedium + .override( + fontFamily: + 'Readex Pro', + fontSize: + AppFontsize + .normal_text_size, + letterSpacing: + 0, + ), + hintText: '请输入密码', + hintStyle: + FlutterFlowTheme.of( + context) + .labelMedium + .override( + 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: FlutterFlowTheme + .of(context) + .bodyMedium + .override( + 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) { + showToast( + "网络未连接,请开启设备网络后重试"); + 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, + ), + ), + ); + }), + ), + ), + ), + ); + }) + ], + ), + ), + ), + ); + }), + 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: + FlutterFlowTheme.of( + context) + .labelMedium + .override( + fontFamily: + 'Readex Pro', + fontSize: AppFontsize + .normal_text_size, + letterSpacing: 0, + ), + hintText: '请输入手机号'.tr, + hintStyle: FlutterFlowTheme + .of(context) + .labelMedium + .override( + 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: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + 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: + FlutterFlowTheme.of( + context) + .labelMedium + .override( + fontFamily: + 'Readex Pro', + fontSize: + AppFontsize + .normal_text_size, + letterSpacing: + 0, + ), + hintText: '请输入验证码', + hintStyle: + FlutterFlowTheme.of( + context) + .labelMedium + .override( + 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: FlutterFlowTheme + .of(context) + .bodyMedium + .override( + 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) { + showToast( + "网络未连接,请开启设备网络后重试"); + 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) { + showToast("网络未连接,请开启设备网络后重试"); + 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; + + Get.offAndToNamed( + "/mianPageBottomChange"); + } else { + showToast(msg); + } + }, + 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: FlutterFlowTheme + .of(context) + .secondaryText, + ), + 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: FlutterFlowTheme + .of(context) + .bodyMedium + .override( + 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: FlutterFlowTheme + .of(context) + .bodyMedium + .override( + fontFamily: + 'Readex Pro', + color: stringToColor( + "FF9F66"), + fontSize: + 12, + letterSpacing: + 0, + ), + ), + ), + ), + Align( + alignment: + AlignmentDirectional( + 0, 0), + child: Text( + '与'.tr, + style: FlutterFlowTheme + .of(context) + .bodyMedium + .override( + 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: FlutterFlowTheme + .of(context) + .bodyMedium + .override( + 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: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + 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), + 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: FlutterFlowTheme.of(context) + .secondaryText, + ), + 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: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + 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: FlutterFlowTheme.of( + context) + .bodyMedium + .override( + 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, + ), + 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, + ), + ), + ), + 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: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: 'Readex Pro', + color: Color(0xFF9EA4B7), + fontSize: AppFontsize.explain_size, + letterSpacing: 0, + ), + ), + ), + Align( + alignment: AlignmentDirectional(0, 0), + child: Text( + 'Copyright© 2019-2029', + 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, + // ), + // ), + // ), + ], + ), + ), + ), + ), + ], + ), + ), + ), + ), + ), + ), + ); + }); + } + + Future _handleBackPressed(BuildContext context) async { + final currentTime = DateTime.now(); + // 如果上次点击返回键时间为空,或者间隔超过 1 秒 + if (_lastBackPressedTime == null || + currentTime.difference(_lastBackPressedTime!) > Duration(seconds: 2)) { + _lastBackPressedTime = currentTime; + showToast("再按一次退出程序", color: color_warning, closeTime: 2); + return false; // 阻止退出程序 + } else { + return true; // 允许退出程序 + } + } +} diff --git a/lib/pages/mh_page/register_page.dart b/lib/pages/mh_page/user/page/register_page.dart similarity index 96% rename from lib/pages/mh_page/register_page.dart rename to lib/pages/mh_page/user/page/register_page.dart index fd537a9..5e753d0 100644 --- a/lib/pages/mh_page/register_page.dart +++ b/lib/pages/mh_page/user/page/register_page.dart @@ -12,36 +12,11 @@ class RegisterPage extends GetView { BoxConstraints? bodysize; final ScrollController _scrollController = ScrollController(); - // final FocusNode _focusNode1 = FocusNode(); - // final FocusNode _focusNode2 = FocusNode(); - // final FocusNode _focusNode3 = FocusNode(); - // final FocusNode _focusNode4 = FocusNode(); RegisterPage() { controller.model.pdshow = true; controller.model.cpdshow = true; Get.put(RegisterController()); - - // _focusNode1.addListener(() { - // if (_focusNode1.hasFocus) { - // MyUtils.scrollToFocusedInput(_focusNode1, _scrollController); - // } - // }); - // _focusNode2.addListener(() { - // if (_focusNode2.hasFocus) { - // MyUtils.scrollToFocusedInput(_focusNode2, _scrollController); - // } - // }); - // _focusNode3.addListener(() { - // if (_focusNode3.hasFocus) { - // MyUtils.scrollToFocusedInput(_focusNode3, _scrollController); - // } - // }); - // _focusNode4.addListener(() { - // if (_focusNode4.hasFocus) { - // MyUtils.scrollToFocusedInput(_focusNode4, _scrollController); - // } - // }); } @override @@ -146,17 +121,17 @@ class RegisterPage extends GetView { .labelMedium .override( fontFamily: 'Readex Pro', - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), - hintText: '请输入手机号', + hintText: '请输入手机号'.tr, hintStyle: FlutterFlowTheme.of(context) .labelMedium .override( fontFamily: 'Readex Pro', color: Color(0xFF929699), - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), enabledBorder: InputBorder.none, @@ -172,7 +147,7 @@ class RegisterPage extends GetView { .bodyMedium .override( fontFamily: 'Readex Pro', - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), ), @@ -214,17 +189,17 @@ class RegisterPage extends GetView { .override( fontFamily: 'Readex Pro', - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), - hintText: '请输入密码', + hintText: '请输入密码'.tr, hintStyle: FlutterFlowTheme.of( context) .labelMedium .override( fontFamily: 'Readex Pro', color: Color(0xFF929699), - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), enabledBorder: InputBorder.none, @@ -234,8 +209,8 @@ class RegisterPage extends GetView { InputBorder.none, contentPadding: EdgeInsetsDirectional - .fromSTEB(20.rpx, - 20.rpx, 0, 0), + .fromSTEB( + 10, 26.rpx, 0, 0), suffixIcon: IconButton( icon: Icon( // 根据 pdshow 控制图标 @@ -260,7 +235,7 @@ class RegisterPage extends GetView { .override( fontFamily: 'Readex Pro', - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), ); @@ -303,17 +278,17 @@ class RegisterPage extends GetView { .override( fontFamily: 'Readex Pro', - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), - hintText: '确认密码', + hintText: '请输入确认密码'.tr, hintStyle: FlutterFlowTheme.of( context) .labelMedium .override( fontFamily: 'Readex Pro', color: Color(0xFF929699), - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), enabledBorder: InputBorder.none, @@ -323,8 +298,8 @@ class RegisterPage extends GetView { InputBorder.none, contentPadding: EdgeInsetsDirectional - .fromSTEB(20.rpx, - 20.rpx, 0, 0), + .fromSTEB( + 10, 26.rpx, 0, 0), suffixIcon: IconButton( icon: Icon( // 根据 pdshow 控制图标 @@ -349,7 +324,7 @@ class RegisterPage extends GetView { .override( fontFamily: 'Readex Pro', - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), ); @@ -395,10 +370,10 @@ class RegisterPage extends GetView { .override( fontFamily: 'Readex Pro', - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), - hintText: '请输验证码', + hintText: '请输入验证码', hintStyle: FlutterFlowTheme .of(context) .labelMedium @@ -407,7 +382,7 @@ class RegisterPage extends GetView { 'Readex Pro', color: Color(0xFF929699), - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), enabledBorder: @@ -420,7 +395,7 @@ class RegisterPage extends GetView { contentPadding: EdgeInsetsDirectional .fromSTEB(20.rpx, 0, - 0, 10.rpx), + 0, 0.rpx), ), style: FlutterFlowTheme.of(context) @@ -428,7 +403,7 @@ class RegisterPage extends GetView { .override( fontFamily: 'Readex Pro', - fontSize: 20.rpx, + fontSize: 26.rpx, letterSpacing: 0, ), ), @@ -437,18 +412,18 @@ class RegisterPage extends GetView { ), Align( alignment: - AlignmentDirectional(0.2, 0.1), + AlignmentDirectional(0.4, 0.1), child: Container( - width: 3, - height: 30, + width: 1.rpx, + height: 38.rpx, decoration: BoxDecoration( - color: Color(0xFFCCCCCC), + color: stringToColor("#929699"), ), ), ), Align( alignment: - AlignmentDirectional(0.9, 0), + AlignmentDirectional(1.2, 0), child: Container( width: bodysize!.maxWidth * 0.157, height: bodysize!.maxHeight * 0.014, @@ -500,8 +475,9 @@ class RegisterPage extends GetView { .countdown .value == 0 - ? '获取验证码' - : '${countdownController.countdown.value}秒', + ? '获取验证码'.tr + : '${countdownController.countdown.value}' + + '秒'.tr, style: TextStyle( fontFamily: 'Readex Pro', color: Color(0xFF333333), @@ -652,7 +628,7 @@ class RegisterPage extends GetView { AlignmentDirectional( 0, 0), child: Text( - '我已阅读并同意', + '我已阅读并同意'.tr, style: FlutterFlowTheme .of(context) .bodyMedium @@ -679,15 +655,15 @@ class RegisterPage extends GetView { "/#/pages/agreement/agreement?type=2&hideHead=true"); }, child: Text( - '《用户协议》', + '《用户协议》'.tr, style: FlutterFlowTheme .of(context) .bodyMedium .override( fontFamily: 'Readex Pro', - color: Color( - 0xFF1890FF), + color: stringToColor( + "FF9F66"), fontSize: 12, letterSpacing: 0, @@ -700,7 +676,7 @@ class RegisterPage extends GetView { AlignmentDirectional( 0, 0), child: Text( - '与', + '与'.tr, style: FlutterFlowTheme .of(context) .bodyMedium @@ -727,15 +703,15 @@ class RegisterPage extends GetView { "/#/pages/agreement/agreement?type=1&hideHead=true"); }, child: Text( - '《隐私协议》', + '《隐私协议》'.tr, style: FlutterFlowTheme .of(context) .bodyMedium .override( fontFamily: 'Readex Pro', - color: Color( - 0xFF1890FF), + color: stringToColor( + "FF9F66"), fontSize: 12, letterSpacing: 0, diff --git a/lib/routers/mh_routers.dart b/lib/routers/mh_routers.dart index f192fc2..70f7f3d 100644 --- a/lib/routers/mh_routers.dart +++ b/lib/routers/mh_routers.dart @@ -1,10 +1,8 @@ import 'package:ef/ef.dart'; import 'package:flutter/cupertino.dart'; -import 'package:path/path.dart'; import 'package:vbvs_app/controller/mh_controller/muser_info_controller.dart'; - import 'package:vbvs_app/controller/theme_controller/ThemeController.dart'; - +import 'package:vbvs_app/pages/main_bottom/component/main_page_b_bottom_change.dart'; import 'package:vbvs_app/pages/mh_page/HomeDeviceType.dart'; import 'package:vbvs_app/pages/mh_page/LanguagePage.dart'; import 'package:vbvs_app/pages/mh_page/address_list_page.dart'; @@ -15,16 +13,17 @@ import 'package:vbvs_app/pages/mh_page/device_people_info.dart'; import 'package:vbvs_app/pages/mh_page/edit_bed.dart'; import 'package:vbvs_app/pages/mh_page/edit_userinfo_page.dart'; import 'package:vbvs_app/pages/mh_page/experience_store_page.dart'; -import 'package:vbvs_app/pages/mh_page/find_password_page.dart'; import 'package:vbvs_app/pages/mh_page/issue_list_page.dart'; import 'package:vbvs_app/pages/mh_page/my_experience_page.dart'; import 'package:vbvs_app/pages/mh_page/people_info.dart'; -import 'package:vbvs_app/pages/mh_page/register_page.dart'; +import 'package:vbvs_app/pages/mh_page/user/page/register_page.dart'; import 'package:vbvs_app/pages/mh_page/repair_history_page.dart'; import 'package:vbvs_app/pages/mh_page/repair_list.dart'; import 'package:vbvs_app/pages/mh_page/room_picker.dart'; import 'package:vbvs_app/pages/mh_page/sleep_habit.dart'; import 'package:vbvs_app/pages/mh_page/smys.dart'; +import 'package:vbvs_app/pages/mh_page/user/page/find_password_page.dart'; +import 'package:vbvs_app/pages/mh_page/user/page/mht_login_page.dart'; import '../pages/mh_page/bluetooth.dart'; import '../pages/mh_page/edit_address_page.dart'; @@ -34,6 +33,7 @@ import '../pages/mh_page/new_settingPage.dart'; ThemeController themeController = Get.find(); var mhroutes = { + "/mianPageBottomChange": (contxt) => MainPageBBottomChange(), "/homeDeviceType": (contxt) => HomeDeviceType(), "/editUserInfoPage": (contxt) => EditUserInfoPage(), "/peopleInfoPage": (contxt) => PeopleInfoPage(), @@ -58,7 +58,8 @@ var mhroutes = { BookSuccessPage(data: arguments["data"]), "/myExperiencePage": (context) => MyExperiencePage(), "/registerPage": (context) => RegisterPage(), - "/findPasswordPage": (context) => FindPasswordPage(), + "/findPasswordPage": (context) => FindPasswordPage(), + "/loginPage": (context) => MHTLoginPage(), }; var mhonGenerateRoute = (RouteSettings settings) { final String? name = settings.name; // 获取路由名称,如 /news 或 /search