diff --git a/assets/mhlangs/en_US.json b/assets/mhlangs/en_US.json index 14962bd..4bc42a3 100644 --- a/assets/mhlangs/en_US.json +++ b/assets/mhlangs/en_US.json @@ -381,7 +381,7 @@ "维修完成": "Repaired", "已评价": "Rated", "报修须知": "Repair Notice", - "尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障需要维修,请首先确认设备是否正确连接控制器或网络,检查设置是否正常,排除误操作问题。若问题依然存在,请记录下设备名称、设备编号、和具体故障内容,方便我们快速地为您提供帮助。您可以通过智慧棉花糖APP保修页面直接报修或拨打 ": " Dear user, thank you for choosing our product. If the device encounters a malfunction during use and requires repair, please first ensure it is properly connected to the controller or network, check whether the settings are correct, and rule out any misuse. If the issue persists, please record the device name, device ID, and a detailed description of the issue so that we can assist you efficiently. You can request service directly through the warranty page in the Smart Cotton Candy App or by calling ", + "尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障需要维修,请首先确认设备是否正确连接控制器或网络,检查设置是否正常,排除误操作问题。若问题依然存在,请记录下设备名称、设备编号、和具体故障内容,方便我们快速地为您提供帮助。您可以通过智慧眠花糖APP保修页面直接报修或拨打 ": " Dear user, thank you for choosing our product. If the device encounters a malfunction during use and requires repair, please first ensure it is properly connected to the controller or network, check whether the settings are correct, and rule out any misuse. If the issue persists, please record the device name, device ID, and a detailed description of the issue so that we can assist you efficiently. You can request service directly through the warranty page in the Smart Cotton Candy App or by calling ", " 反馈。": " for help.", "我要报修": "Request Repair", "报修历史": "Repair History", diff --git a/assets/mhlangs/zh_CN.json b/assets/mhlangs/zh_CN.json index a223ade..108dcd5 100644 --- a/assets/mhlangs/zh_CN.json +++ b/assets/mhlangs/zh_CN.json @@ -382,7 +382,7 @@ "维修完成": "维修完成", "已评价": "已评价", "报修须知": "报修须知", - "尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障需要维修,请首先确认设备是否正确连接控制器或网络,检查设置是否正常,排除误操作问题。若问题依然存在,请记录下设备名称、设备编号、和具体故障内容,方便我们快速地为您提供帮助。您可以通过智慧棉花糖APP保修页面直接报修或拨打 ": "尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障需要维修,请首先确认设备是否正确连接控制器或网络,检查设置是否正常,排除误操作问题。若问题依然存在,请记录下设备名称、设备编号、和具体故障内容,方便我们快速地为您提供帮助。您可以通过智慧棉花糖APP保修页面直接报修或拨打", + "尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障需要维修,请首先确认设备是否正确连接控制器或网络,检查设置是否正常,排除误操作问题。若问题依然存在,请记录下设备名称、设备编号、和具体故障内容,方便我们快速地为您提供帮助。您可以通过智慧眠花糖APP保修页面直接报修或拨打 ": "尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障需要维修,请首先确认设备是否正确连接控制器或网络,检查设置是否正常,排除误操作问题。若问题依然存在,请记录下设备名称、设备编号、和具体故障内容,方便我们快速地为您提供帮助。您可以通过智慧眠花糖APP保修页面直接报修或拨打", " 反馈。": "反馈。", "我要报修": "我要报修", "报修历史": "报修历史", diff --git a/assets/mhlangs/zh_TW.json b/assets/mhlangs/zh_TW.json index c36db9c..45e3be3 100644 --- a/assets/mhlangs/zh_TW.json +++ b/assets/mhlangs/zh_TW.json @@ -382,7 +382,7 @@ "维修完成": "維修完成", "已评价": "已評價", "报修须知": "報修須知", - "尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障需要维修,请首先确认设备是否正确连接控制器或网络,检查设置是否正常,排除误操作问题。若问题依然存在,请记录下设备名称、设备编号、和具体故障内容,方便我们快速地为您提供帮助。您可以通过智慧棉花糖APP保修页面直接报修或拨打 ": "尊敬的用戶,感謝您選擇我司產品。在使用過程中,如果設備出現故障需要維修,請首先確認設備是否正確連接控制器或網絡,檢查設置是否正常,排除誤操作問題。若問題依然存在,請記錄下設備名稱、設備編號、和具體故障內容,方便我們快速地為您提供幫助。您可以通過智慧棉花糖APP保修頁面直接報修或撥打", + "尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障需要维修,请首先确认设备是否正确连接控制器或网络,检查设置是否正常,排除误操作问题。若问题依然存在,请记录下设备名称、设备编号、和具体故障内容,方便我们快速地为您提供帮助。您可以通过智慧眠花糖APP保修页面直接报修或拨打 ": "尊敬的用戶,感謝您選擇我司產品。在使用過程中,如果設備出現故障需要維修,請首先確認設備是否正確連接控制器或網絡,檢查設置是否正常,排除誤操作問題。若問題依然存在,請記錄下設備名稱、設備編號、和具體故障內容,方便我們快速地為您提供幫助。您可以通過智慧眠花糖APP保修頁面直接報修或撥打", " 反馈。": "反饋。", "我要报修": "我要報修", "报修历史": "報修歷史", diff --git a/assets/miniapp/mhtControl_1.0.89.zip b/assets/miniapp/mhtControl_1.0.89.zip deleted file mode 100644 index dc648ae..0000000 Binary files a/assets/miniapp/mhtControl_1.0.89.zip and /dev/null differ diff --git a/assets/miniapp/mhtControl_1.0.90.zip b/assets/miniapp/mhtControl_1.0.90.zip index ffcc371..891e6d2 100644 Binary files a/assets/miniapp/mhtControl_1.0.90.zip and b/assets/miniapp/mhtControl_1.0.90.zip differ diff --git a/lib/main.dart b/lib/main.dart index 2c2509f..324b0ff 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -140,6 +140,7 @@ void initServiceAddress() { if (AppConstants().ent_type == APPPackageType.MHT.code) { // 眠花糖 ServiceConstant.baseHost = "zhmht.swes.com.cn:27020"; + // ServiceConstant.baseHost = "vsbs-test.he-info.cn"; } else if (AppConstants().ent_type == APPPackageType.TH.code) { // 太和 ServiceConstant.baseHost = "vsbst-api.he-info.com"; @@ -958,7 +959,7 @@ class MyApp extends StatelessWidget { const Locale('en', 'US'), // ⚠️ 添加你支持的语言 ], debugShowCheckedModeBanner: false, - title: '太和e护', + title: getAPPName(), theme: themeController.currentTheme, // home: const MyHomePage(title: '智慧眠花糖 Home Page'), initialRoute: "/mianPageBottomChange", @@ -1013,4 +1014,19 @@ class MyApp extends StatelessWidget { } }); } + + getAPPName() { + switch (AppConstants().ent_type) { + case 1: + return "太和"; + case 2: + return "欢睡"; + case 3: + return "眠花糖"; + case 4: + return "东华智能睡眠"; + default: + return "太和e护"; + } + } } diff --git a/lib/pages/mh_page/new_mine_page.dart b/lib/pages/mh_page/new_mine_page.dart index e061026..6c4610f 100644 --- a/lib/pages/mh_page/new_mine_page.dart +++ b/lib/pages/mh_page/new_mine_page.dart @@ -168,8 +168,15 @@ class _MinePageState extends State { Text( limitText( login == 1 - ? userInfoController - .model.user?.nick_name + ? ((userInfoController.model.user + ?.nick_name == + null || + userInfoController.model.user + ?.nick_name == + "") + ? '未命名'.tr + : userInfoController + .model.user?.nick_name) : '未命名'.tr, AppConstants() .text_length, // 这里设置最大长度,按你需求改,比如 6~10 字符 diff --git a/lib/pages/mh_page/repair_list.dart b/lib/pages/mh_page/repair_list.dart index 1dc3241..0451d64 100644 --- a/lib/pages/mh_page/repair_list.dart +++ b/lib/pages/mh_page/repair_list.dart @@ -127,7 +127,7 @@ class DeviceRepairPage extends GetView { // children: [ // TextSpan( // text: - // "尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障需要维修,请首先确认设备是否正确连接控制器或网络,检查设置是否正常,排除误操作问题。若问题依然存在,请记录下设备名称、设备编号、和具体故障内容,方便我们快速地为您提供帮助。您可以通过智慧棉花糖APP保修页面直接报修或拨打 " + // "尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障需要维修,请首先确认设备是否正确连接控制器或网络,检查设置是否正常,排除误操作问题。若问题依然存在,请记录下设备名称、设备编号、和具体故障内容,方便我们快速地为您提供帮助。您可以通过智慧眠花糖APP保修页面直接报修或拨打 " // .tr, // style: TextStyle( // color: Color(0XFF929699), @@ -179,7 +179,7 @@ class DeviceRepairPage extends GetView { children: [ TextSpan( text: - "尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障需要维修,请首先确认设备是否正确连接控制器或网络,检查设置是否正常,排除误操作问题。若问题依然存在,请记录下设备名称、设备编号、和具体故障内容,方便我们快速地为您提供帮助。您可以通过智慧棉花糖APP保修页面直接报修或拨打 " + "尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障需要维修,请首先确认设备是否正确连接控制器或网络,检查设置是否正常,排除误操作问题。若问题依然存在,请记录下设备名称、设备编号、和具体故障内容,方便我们快速地为您提供帮助。您可以通过智慧眠花糖APP保修页面直接报修或拨打 " .tr, style: TextStyle( color: Color(0XFF929699), diff --git a/lib/pages/mh_page/user/controller/mht_login_controller.dart b/lib/pages/mh_page/user/controller/mht_login_controller.dart index f18871a..61d138c 100644 --- a/lib/pages/mh_page/user/controller/mht_login_controller.dart +++ b/lib/pages/mh_page/user/controller/mht_login_controller.dart @@ -22,7 +22,8 @@ part 'mht_login_controller.g.dart'; @JsonSerializable() class LoginModel { //版本id - int? loginStyle = 1; //1.密码登录 2.短信登录(登录类型: 1:手机号/邮箱+验证码 2:微信一键登录 3:手机号+密码) + int? loginStyle = + 1; //1.密码登录 2.短信登录 3.邮箱登录(登录类型: 1:手机号/邮箱+验证码 2:微信一键登录 3:手机号+密码) // String? account = '17649984946'; //账户 // String? account = '13953240733'; //账户 @@ -35,7 +36,7 @@ class LoginModel { String? account = ''; //账户 String? password = ''; //密码 - String? phone; //手机号 + String? phone; //手机号/邮箱 String? code; //验证码 String? register_code; @@ -123,6 +124,33 @@ class MHTLoginController extends GetControllerEx { account = model.phone!; password = model.code!; } + if (model.loginStyle == 3) { + //账号登录 + if (model.phone == null || model.phone!.isEmpty) { + message = '请输入邮箱'.tr; + + TopSlideNotification.show(context, + text: message, textColor: stringToColor("#FF7159")); + return message; + } + if (!MyUtils.isValidEmail(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) { @@ -186,14 +214,52 @@ class MHTLoginController extends GetControllerEx { // text: message, textColor: themeController.currentColor.sc9); // return message; // } - if (model.phone == null || model.phone!.isEmpty) { - message = "请输入手机号".tr; - TopSlideNotification.show(context, - text: message, textColor: themeController.currentColor.sc9); - return message; - } - if (!MyUtils.isValidPhoneNumber(model.phone!)) { - message = '请输入正确的手机号'.tr; + // model.loginStyle;// 2 手机号 3 邮箱 + // if (model.phone == null || model.phone!.isEmpty) { + // message = "请输入手机号".tr; + // TopSlideNotification.show(context, + // text: message, textColor: themeController.currentColor.sc9); + // return message; + // } + // if (!MyUtils.isValidPhoneNumber(model.phone!)) { + // message = '请输入正确的手机号'.tr; + // TopSlideNotification.show(context, + // text: message, textColor: themeController.currentColor.sc9); + // return message; + // } + // 2 手机号 3 邮箱 + if (model.loginStyle == 2) { + // 短信登录:验证手机号 + if (model.phone == null || model.phone!.isEmpty) { + message = "请输入手机号".tr; + TopSlideNotification.show(context, + text: message, textColor: themeController.currentColor.sc9); + return message; + } + if (!MyUtils.isValidPhoneNumber(model.phone!)) { + message = '请输入正确的手机号'.tr; + TopSlideNotification.show(context, + text: message, textColor: themeController.currentColor.sc9); + return message; + } + } else if (model.loginStyle == 3) { + // 邮箱登录:验证邮箱 + if (model.phone == null || model.phone!.isEmpty) { + message = "请输入邮箱".tr; + TopSlideNotification.show(context, + text: message, textColor: themeController.currentColor.sc9); + return message; + } + if (!MyUtils.isValidEmail(model.phone!)) { + message = '请输入正确的邮箱地址'.tr; + TopSlideNotification.show(context, + text: message, textColor: themeController.currentColor.sc9); + return message; + } + } else { + // 其他登录类型(如密码登录) + // 根据你的实际需求处理 + message = "请选择正确的登录方式".tr; TopSlideNotification.show(context, text: message, textColor: themeController.currentColor.sc9); return message; 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 88b5d27..b786def 100644 --- a/lib/pages/mh_page/user/page/mht_login_page.dart +++ b/lib/pages/mh_page/user/page/mht_login_page.dart @@ -206,28 +206,757 @@ class MHTLoginPage extends GetView { mainAxisAlignment: MainAxisAlignment.start, 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: 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 * + // 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: + // TextStyle( + // fontFamily: + // 'Readex Pro', + // color: Colors + // .white, + // fontSize: + // AppFontsize + // .normal_text_size, + // letterSpacing: + // 0, + // ), + // ), + // ), + // ), + // ], + // ), + // ), + // ), + // InkWell( + // onTap: () { + // controller + // .model.loginStyle = 3; + // 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: + // TextStyle( + // 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, 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) + // .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, + // ), + // 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"), + // ), + // ), + // ), + // ], + // ), + // ), + // ), + // 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"), + // ), + // ), + // ), + // ], + // ), + // ), + // ), + // ], + // ), + // ), + // ), + // ), + // ), + // ); + // }), + // Obx(() { + // return Visibility( + // visible: controller.model.loginStyle == 3 + // ? true + // : false, + // child: Padding( + // padding: EdgeInsetsDirectional.fromSTEB( + // 96.rpx, 0, 96.rpx, 0), + // child: Container( + // child: SingleChildScrollView( + // scrollDirection: Axis.horizontal, + // child: Row( + // mainAxisSize: MainAxisSize.max, + // children: [ + // // 密码登录标签 + // InkWell( + // onTap: () { + // controller + // .model.loginStyle = 1; + // controller.updateAll(); + // }, + // child: Container( + // child: Text( + // '密码登录'.tr, + // style: TextStyle( + // color: Colors.white, + // fontSize: AppFontsize + // .normal_text_size, + // ), + // ), + // ), + // ), + // // 短信登录标签 + // InkWell( + // onTap: () { + // controller + // .model.loginStyle = 2; + // controller.updateAll(); + // }, + // child: Container( + // child: Text( + // '短信登录'.tr, + // style: TextStyle( + // color: Colors.white, + // fontSize: AppFontsize + // .normal_text_size, + // ), + // ), + // ), + // ), + // // 邮箱登录标签(选中状态) + // Container( + // child: Column( + // children: [ + // Padding( + // padding: + // EdgeInsetsDirectional + // .fromSTEB( + // 0, 0, 0, 8), + // child: Container( + // child: Text( + // '邮箱登录'.tr, + // style: TextStyle( + // color: + // stringToColor( + // "#84F5FF"), + // fontSize: + // AppFontsize + // .title_size, + // ), + // ), + // ), + // ), + // // 选中状态的下划线 + // Container( + // decoration: + // BoxDecoration( + // color: stringToColor( + // "#84F5FF"), + // ), + // ), + // ], + // ), + // ), + // ], + // ), + // ), + // ), + // ), + // ); + // }), +// 替换掉那三个 Obx Visibility 代码块,只保留一个统一的标签切换区域 + Obx(() { - return Visibility( - visible: controller.model.loginStyle == 1 - ? true - : false, - child: Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 96.rpx, 0.rpx, 96.rpx, 0), + return 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: [ + // 密码登录标签 + InkWell( + onTap: () { + controller + .model.loginStyle = 1; + controller.updateAll(); + }, + child: Container( width: MediaQuery.sizeOf( context) .width * @@ -237,145 +966,18 @@ class MHTLoginPage extends GetView { .height * 1, constraints: BoxConstraints( - minWidth: 100, - ), + 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 * - 0.165, - height: MediaQuery.sizeOf( - context) - .height * - 1, - constraints: - BoxConstraints( - minWidth: 100, - ), - decoration: - BoxDecoration(), - child: Column( - mainAxisSize: - MainAxisSize.max, - children: [ - Container( + child: Column( + mainAxisSize: + MainAxisSize.max, + children: [ + Padding( + padding: + EdgeInsetsDirectional + .fromSTEB(0, + 0, 0, 8), + child: Container( width: MediaQuery .sizeOf( context) @@ -388,8 +990,8 @@ class MHTLoginPage extends GetView { 0.045, constraints: BoxConstraints( - minWidth: 105, - ), + minWidth: + 105), decoration: BoxDecoration(), child: Align( @@ -397,15 +999,25 @@ class MHTLoginPage extends GetView { AlignmentDirectional( 0, 1), child: Text( - '短信登录'.tr, + '密码登录'.tr, style: TextStyle( fontFamily: 'Readex Pro', - color: Colors - .white, - fontSize: - AppFontsize + color: controller + .model.loginStyle == + 1 + ? stringToColor( + "#84F5FF") + : Colors + .white, + fontSize: controller + .model + .loginStyle == + 1 + ? AppFontsize + .title_size + : AppFontsize .normal_text_size, letterSpacing: 0, @@ -413,202 +1025,10 @@ class MHTLoginPage extends GetView { ), ), ), - ], - ), - ), - ), - ], - ), - ), - ), - ), - ), - ); - }), - 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) - .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, - ), - 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, - ), - ), - ), - ), - ), - ), + ), + if (controller.model + .loginStyle == + 1) Align( alignment: AlignmentDirectional( @@ -637,12 +1057,235 @@ class MHTLoginPage extends GetView { ), ), ), - ], - ), + ], ), ), - ], - ), + ), + // 短信登录标签 + 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: [ + Padding( + padding: + EdgeInsetsDirectional + .fromSTEB(0, + 0, 0, 8), + 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: controller + .model.loginStyle == + 2 + ? stringToColor( + "#84F5FF") + : Colors + .white, + fontSize: controller + .model + .loginStyle == + 2 + ? AppFontsize + .title_size + : AppFontsize + .normal_text_size, + letterSpacing: + 0, + ), + ), + ), + ), + ), + if (controller.model + .loginStyle == + 2) + 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 = 3; + 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: [ + Padding( + padding: + EdgeInsetsDirectional + .fromSTEB(0, + 0, 0, 8), + 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: controller + .model.loginStyle == + 3 + ? stringToColor( + "#84F5FF") + : Colors + .white, + fontSize: controller + .model + .loginStyle == + 3 + ? AppFontsize + .title_size + : AppFontsize + .normal_text_size, + letterSpacing: + 0, + ), + ), + ), + ), + ), + if (controller.model + .loginStyle == + 3) + 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"), + ), + ), + ), + ], + ), + ), + ), + ], ), ), ), @@ -958,9 +1601,9 @@ class MHTLoginPage extends GetView { }), Obx(() { return Visibility( - visible: controller.model.loginStyle == 2 - ? true - : false, + visible: + controller.model.loginStyle == 2 || + controller.model.loginStyle == 3, child: Padding( padding: EdgeInsetsDirectional.fromSTEB( 96.rpx, 17, 96.rpx, 0), @@ -993,7 +1636,11 @@ class MHTLoginPage extends GetView { .normal_text_size, letterSpacing: 0, ), - hintText: '请输入手机号'.tr, + hintText: controller.model + .loginStyle == + 2 + ? '请输入手机号'.tr + : '请输入邮箱'.tr, hintStyle: TextStyle( fontFamily: 'Readex Pro', color: Color(0xFFD2D2D2), @@ -1028,7 +1675,9 @@ class MHTLoginPage extends GetView { }), Obx(() { return Visibility( - visible: controller.model.loginStyle == 2 + visible: controller.model.loginStyle == + 2 || + controller.model.loginStyle == 3 ? true : false, child: Padding( @@ -1547,7 +2196,9 @@ class MHTLoginPage extends GetView { ), Obx(() { return Visibility( - visible: controller.model.loginStyle == 2, + visible: + controller.model.loginStyle == 2 || + controller.model.loginStyle == 3, child: Padding( padding: EdgeInsetsDirectional.fromSTEB( 96.rpx, 0, 96.rpx, 0), @@ -1651,7 +2302,9 @@ class MHTLoginPage extends GetView { }), Obx(() { return Visibility( - visible: controller.model.loginStyle == 2, + visible: + controller.model.loginStyle == 2 || + controller.model.loginStyle == 3, child: Padding( padding: EdgeInsetsDirectional.fromSTEB( 96.rpx, 0, 96.rpx, 0), @@ -1665,7 +2318,9 @@ class MHTLoginPage extends GetView { }), Obx(() { return Visibility( - visible: controller.model.loginStyle == 2, + visible: + controller.model.loginStyle == 2 || + controller.model.loginStyle == 3, child: Padding( padding: EdgeInsetsDirectional.fromSTEB( 96.rpx, 0, 96.rpx, 0), diff --git a/pubspec.lock b/pubspec.lock index bca2ab5..9bd8156 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -399,6 +399,22 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "3.2.4" + device_info_plus: + dependency: "direct main" + description: + name: device_info_plus + sha256: a7fd703482b391a87d60b6061d04dfdeab07826b96f9abd8f5ed98068acc0074 + url: "https://pub.flutter-io.cn" + source: hosted + version: "10.1.2" + device_info_plus_platform_interface: + dependency: transitive + description: + name: device_info_plus_platform_interface + sha256: "0b04e02b30791224b31969eb1b50d723498f402971bff3630bca2ba839bd1ed2" + url: "https://pub.flutter-io.cn" + source: hosted + version: "7.0.2" dio: dependency: transitive description: @@ -1336,6 +1352,70 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" + open_file: + dependency: "direct main" + description: + name: open_file + sha256: b22decdae85b459eac24aeece48f33845c6f16d278a9c63d75c5355345ca236b + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.5.11" + open_file_android: + dependency: transitive + description: + name: open_file_android + sha256: "58141fcaece2f453a9684509a7275f231ac0e3d6ceb9a5e6de310a7dff9084aa" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.6" + open_file_ios: + dependency: transitive + description: + name: open_file_ios + sha256: a5acd07ba1f304f807a97acbcc489457e1ad0aadff43c467987dd9eef814098f + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.4" + open_file_linux: + dependency: transitive + description: + name: open_file_linux + sha256: d189f799eecbb139c97f8bc7d303f9e720954fa4e0fa1b0b7294767e5f2d7550 + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.0.5" + open_file_mac: + dependency: transitive + description: + name: open_file_mac + sha256: cd293f6750de6438ab2390513c99128ade8c974825d4d8128886d1cda8c64d01 + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.4" + open_file_platform_interface: + dependency: transitive + description: + name: open_file_platform_interface + sha256: "101b424ca359632699a7e1213e83d025722ab668b9fd1412338221bf9b0e5757" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.0.3" + open_file_web: + dependency: transitive + description: + name: open_file_web + sha256: e3dbc9584856283dcb30aef5720558b90f88036360bd078e494ab80a80130c4f + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.0.4" + open_file_windows: + dependency: transitive + description: + name: open_file_windows + sha256: d26c31ddf935a94a1a3aa43a23f4fff8a5ff4eea395fe7a8cb819cf55431c875 + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.0.3" package_config: dependency: transitive description: @@ -2245,6 +2325,14 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "5.10.1" + win32_registry: + dependency: transitive + description: + name: win32_registry + sha256: "21ec76dfc731550fd3e2ce7a33a9ea90b828fdf19a5c3bcf556fa992cfa99852" + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.5" xdg_directories: dependency: transitive description: