更新
This commit is contained in:
@@ -94,7 +94,7 @@ class AuthBindTelController extends GetControllerEx<AuthBindTelModel> {
|
||||
// }
|
||||
}
|
||||
|
||||
getCode(BuildContext context) async {
|
||||
getCode(BuildContext context, [Map? img]) async {
|
||||
String message = "";
|
||||
if (model.phone == null || model.phone!.isEmpty) {
|
||||
message = "请输入手机号".tr;
|
||||
@@ -116,7 +116,11 @@ class AuthBindTelController extends GetControllerEx<AuthBindTelModel> {
|
||||
"userName": model.phone!,
|
||||
'type': 5,
|
||||
};
|
||||
data['code'] = "mht";
|
||||
if (img != null) {
|
||||
if (img!['code'] != null) {
|
||||
data['code'] = img!['code'];
|
||||
}
|
||||
}
|
||||
await requestWithLog(
|
||||
logTitle: "获取验证码".tr,
|
||||
method: MyHttpMethod.post,
|
||||
@@ -147,7 +151,7 @@ class AuthBindTelController extends GetControllerEx<AuthBindTelModel> {
|
||||
String serviceApi = ServiceConstant.user_info;
|
||||
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}";
|
||||
String? language = "";
|
||||
if (languageController.selectLanguage != null) {
|
||||
if (languageController.selectLanguage.value != null) {
|
||||
language = languageController.selectLanguage.value!.language_code;
|
||||
}
|
||||
if (language != null && language.isNotEmpty) {
|
||||
|
||||
@@ -271,12 +271,6 @@ class MHTLoginController extends GetControllerEx<LoginModel> {
|
||||
queryUrl: queryUrl,
|
||||
data: data);
|
||||
if (apiResponse.code == HttpStatusCodes.ok) {
|
||||
// UserInfoController userInfoController = Get.find();
|
||||
// if (userInfoController.model.user!.phone == null ||
|
||||
// userInfoController.model.user!.phone!.isEmpty) {
|
||||
// Get.toNamed("/auth_bind_tel");
|
||||
// return;
|
||||
// }
|
||||
UserInfoController userInfoController = Get.find();
|
||||
userInfoController.model.user = UserModel.fromJson(apiResponse.data);
|
||||
userInfoController.model.login = 1;
|
||||
@@ -287,7 +281,7 @@ class MHTLoginController extends GetControllerEx<LoginModel> {
|
||||
box.write('user', userInfoController.model.user!.toJson()); // 存储用户信息
|
||||
if (userInfoController.model.user!.phone == null ||
|
||||
userInfoController.model.user!.phone!.isEmpty) {
|
||||
await Get.toNamed("/auth_bind_tel");
|
||||
await Get.toNamed("/auth_bind_tel", arguments: {'code':'mht'});
|
||||
}
|
||||
if (userInfoController.model.user!.phone == null ||
|
||||
userInfoController.model.user!.phone!.isEmpty) {
|
||||
|
||||
@@ -17,9 +17,12 @@ import 'package:vbvs_app/pages/mh_page/user/controller/mht_login_controller.dart
|
||||
|
||||
class BindTelWidget extends GetView<AuthBindTelController> {
|
||||
BoxConstraints? bodysize;
|
||||
Map img;
|
||||
|
||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
|
||||
BindTelWidget({super.key, required this.img});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LayoutBuilder(builder: (context, cc) {
|
||||
@@ -28,7 +31,9 @@ class BindTelWidget extends GetView<AuthBindTelController> {
|
||||
// onTap: () => FocusScope.of(context).unfocus(),
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/images/new_background.png'),
|
||||
image: AssetImage((img!['img'] == null || "" == img!['img'])
|
||||
? 'assets/images/new_background.png'
|
||||
: img!['img']!),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
@@ -304,7 +309,7 @@ class BindTelWidget extends GetView<AuthBindTelController> {
|
||||
}
|
||||
String msg =
|
||||
await controller
|
||||
.getCode(context);
|
||||
.getCode(context,img);
|
||||
if (msg.isNotEmpty) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user