更新眠花糖邮箱登录
This commit is contained in:
@@ -168,8 +168,15 @@ class _MinePageState extends State<NewMinePage> {
|
||||
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 字符
|
||||
|
||||
@@ -127,7 +127,7 @@ class DeviceRepairPage extends GetView<RepairListController> {
|
||||
// children: [
|
||||
// TextSpan(
|
||||
// text:
|
||||
// "尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障需要维修,请首先确认设备是否正确连接控制器或网络,检查设置是否正常,排除误操作问题。若问题依然存在,请记录下设备名称、设备编号、和具体故障内容,方便我们快速地为您提供帮助。您可以通过智慧棉花糖APP保修页面直接报修或拨打 "
|
||||
// "尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障需要维修,请首先确认设备是否正确连接控制器或网络,检查设置是否正常,排除误操作问题。若问题依然存在,请记录下设备名称、设备编号、和具体故障内容,方便我们快速地为您提供帮助。您可以通过智慧眠花糖APP保修页面直接报修或拨打 "
|
||||
// .tr,
|
||||
// style: TextStyle(
|
||||
// color: Color(0XFF929699),
|
||||
@@ -179,7 +179,7 @@ class DeviceRepairPage extends GetView<RepairListController> {
|
||||
children: [
|
||||
TextSpan(
|
||||
text:
|
||||
"尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障需要维修,请首先确认设备是否正确连接控制器或网络,检查设置是否正常,排除误操作问题。若问题依然存在,请记录下设备名称、设备编号、和具体故障内容,方便我们快速地为您提供帮助。您可以通过智慧棉花糖APP保修页面直接报修或拨打 "
|
||||
"尊敬的用户,感谢您选择我司产品。在使用过程中,如果设备出现故障需要维修,请首先确认设备是否正确连接控制器或网络,检查设置是否正常,排除误操作问题。若问题依然存在,请记录下设备名称、设备编号、和具体故障内容,方便我们快速地为您提供帮助。您可以通过智慧眠花糖APP保修页面直接报修或拨打 "
|
||||
.tr,
|
||||
style: TextStyle(
|
||||
color: Color(0XFF929699),
|
||||
|
||||
@@ -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<LoginModel> {
|
||||
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<LoginModel> {
|
||||
// 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;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user