1,新增删除账号页面及相应接口和逻辑

2,新增免滑动验证码的验证码请求接口
3,新增更新个人信息-昵称接口
4,新增修改账号接口及逻辑
5,新增绑定邮箱接口及逻辑
6,新增修改密码接口
This commit is contained in:
Daisy 2023-10-09 18:45:10 +08:00
parent 08e36eee3c
commit 809096a11b
33 changed files with 1076 additions and 255 deletions

View File

@ -319,6 +319,7 @@
"registerPasswordTip":"The password must be 8-20 characters, including at least 2 of the numbers/letters/symbols",
"iphone":"Iphone",
"email":"Email",
"mobileNumber":"Mobile phone number",
"countryAndRegion":"Country And Region",
"selet":"Selet",
"getVerificationCode":"Get Verification Code",

View File

@ -319,6 +319,7 @@
"registerPasswordTip":"registerPasswordTip",
"iphone":"iphone",
"email":"email",
"mobileNumber":"mobileNumber",
"countryAndRegion":"countryAndRegion",
"selet":"selet",
"getVerificationCode":"getVerificationCode",

View File

@ -319,6 +319,7 @@
"registerPasswordTip":"密码必须是8-20位至少包括数字/字母/符号中的2种",
"iphone":"手机",
"email":"邮箱",
"mobileNumber":"手机号",
"countryAndRegion":"国家/地区",
"selet":"选择",
"getVerificationCode":"获取验证码",

View File

@ -33,7 +33,7 @@ class SafeVerifyLogic extends BaseGetXController {
//
void sendValidationCode() async {
var entity = await ApiRepository.to.sendValidationCode(
var entity = await ApiRepository.to.getValidationCodeAuth(
"+86",
state.loginData.value.mobile!,
'1',
@ -46,8 +46,9 @@ class SafeVerifyLogic extends BaseGetXController {
}
//
Future<void> userLogoutRequest() async {
LoginEntity entity = await ApiRepository.to.userLogout();
Future<void> deleteAccountRequest() async {
LoginEntity entity = await ApiRepository.to
.deleteAccount("", "", state.verificationCode.value);
if (entity.errorCode!.codeIsSuccessful) {
Toast.show(msg: '验证成功,账号已删除');
//

View File

@ -17,7 +17,6 @@ class SafeVerifyPage extends StatefulWidget {
class _SafeVerifyPageState extends State<SafeVerifyPage> {
final logic = Get.put(SafeVerifyLogic());
final state = Get.find<SafeVerifyLogic>().state;
String mobilePhone = '';
@override
void initState() {
@ -51,6 +50,9 @@ class _SafeVerifyPageState extends State<SafeVerifyPage> {
//
maxLines: 1,
controller: state.codeController,
onChanged: (value) {
logic.checkNext(state.codeController);
},
autofocus: false,
decoration: InputDecoration(
contentPadding:
@ -65,15 +67,15 @@ class _SafeVerifyPageState extends State<SafeVerifyPage> {
SizedBox(
height: 30.h,
),
SizedBox(
width: 200.w,
child: SubmitBtn(
btnName: TranslationLoader.lanKeys!.getVerificationCode!.tr,
onClick: () {
logic.sendValidationCode();
},
),
),
Obx(() => SizedBox(
width: 200.w,
child: SubmitBtn(
btnName: state.btnText.value,
onClick: () {
logic.sendValidationCode();
},
),
)),
SizedBox(
height: 60.h,
),
@ -92,7 +94,7 @@ class _SafeVerifyPageState extends State<SafeVerifyPage> {
btnName: '验证',
isDisabled: state.canSub.value,
onClick: () {
logic.userLogoutRequest();
logic.deleteAccountRequest();
},
))
],

View File

@ -14,7 +14,7 @@ class SafeVerifyState {
var countryCode = '+86'.obs;
var countryId = '9'.obs;
var codeType = '5'.obs;
var codeType = '5'.obs; //5
var verificationCode = ''.obs;
var xWidth = ''.obs; //
var canSub = false.obs;

View File

@ -0,0 +1,77 @@
class MinePersonInfoEntity {
int? errorCode;
String? description;
String? errorMsg;
MinePersonInfoData? data;
MinePersonInfoEntity(
{this.errorCode, this.description, this.errorMsg, this.data});
MinePersonInfoEntity.fromJson(Map<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
data =
json['data'] != null ? MinePersonInfoData.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['errorCode'] = errorCode;
data['description'] = description;
data['errorMsg'] = errorMsg;
if (this.data != null) {
data['data'] = this.data!.toJson();
}
return data;
}
}
class MinePersonInfoData {
String? mobile;
String? uid;
bool? isSecurityQuestionSetted;
String? nickname;
String? headUrl;
String? accountName;
int? countryId;
String? email;
String? countryName;
MinePersonInfoData(
{this.mobile,
this.uid,
this.isSecurityQuestionSetted,
this.nickname,
this.headUrl,
this.accountName,
this.countryId,
this.email,
this.countryName});
MinePersonInfoData.fromJson(Map<String, dynamic> json) {
mobile = json['mobile'];
uid = json['uid'];
isSecurityQuestionSetted = json['isSecurityQuestionSetted'];
nickname = json['nickname'];
headUrl = json['headUrl'];
accountName = json['accountName'];
countryId = json['countryId'];
email = json['email'];
countryName = json['countryName'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['mobile'] = mobile;
data['uid'] = uid;
data['isSecurityQuestionSetted'] = isSecurityQuestionSetted;
data['nickname'] = nickname;
data['headUrl'] = headUrl;
data['accountName'] = accountName;
data['countryId'] = countryId;
data['email'] = email;
data['countryName'] = countryName;
return data;
}
}

View File

@ -0,0 +1,19 @@
import 'dart:async';
import 'package:star_lock/mine/minePersonInfo/minePersonInfo/minePersonInfo_state.dart';
import '../../../../network/api_repository.dart';
import '../../../../tools/baseGetXController.dart';
class MinePersonInfoLogic extends BaseGetXController {
final MinePersonInfoState state = MinePersonInfoState();
//
Future<void> getUserInfoRequest() async {
var entity = await ApiRepository.to.getUserInfo("");
if (entity.errorCode!.codeIsSuccessful) {
state.mineInfoData.value = entity.data!;
state.nickname.value = entity.data!.nickname!;
state.mobileStr.value = entity.data!.mobile!;
state.emailStr.value = entity.data!.email!;
state.countryStr.value = entity.data!.countryName!;
}
}
}

View File

@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:image_picker/image_picker.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfo/minePersonInfo_logic.dart';
import 'package:star_lock/tools/seletImgTool.dart';
import '../../../appRouters.dart';
@ -18,6 +18,16 @@ class MinePersonInfoPage extends StatefulWidget {
}
class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
final logic = Get.put(MinePersonInfoLogic());
final state = Get.find<MinePersonInfoLogic>().state;
@override
void initState() {
super.initState();
logic.getUserInfoRequest();
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -47,33 +57,63 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
_openModalBottomSheet();
},
),
CommonItem(
Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.nickName!.tr,
rightTitle: "你好",
rightTitle: state.nickname.value,
isHaveLine: true,
isHaveDirection: true,
action: () {
Navigator.pushNamed(
context, Routers.minePersonInfoEditNamePage);
}),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.accountNumber!.tr,
rightTitle: "786612630@qq.com",
context, Routers.minePersonInfoEditNamePage,
arguments: {'nickName': state.nickname.value})
.then((value) => logic.getUserInfoRequest());
})),
Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.mobileNumber!.tr,
rightTitle: state.mobileStr.value,
isHaveLine: true,
isHaveDirection: true,
action: () {
Navigator.pushNamed(
context, Routers.minePersonInfoEditAccountPage);
}),
CommonItem(
// isFrom1 2
if (state.mobileStr.value.isNotEmpty) {
Navigator.pushNamed(
context, Routers.minePersonInfoEditAccountPage,
arguments: {
'mobile': state.mobileStr.value,
'isFrom': '1'
});
} else {
Navigator.pushNamed(
context, Routers.minePersonInfoEditEmailPage,
arguments: {
'mobile': state.mobileStr.value,
'isFrom': '1'
});
}
})),
Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.email!.tr,
rightTitle: "",
rightTitle: state.emailStr.value,
isHaveLine: true,
isHaveDirection: true,
action: () {
Navigator.pushNamed(
context, Routers.minePersonInfoEditEmailPage);
}),
// isFrom1 2
if (state.emailStr.value.isNotEmpty) {
Navigator.pushNamed(
context, Routers.minePersonInfoEditAccountPage,
arguments: {
'isFrom': '2',
'email': state.emailStr.value
});
} else {
Navigator.pushNamed(
context, Routers.minePersonInfoEditEmailPage,
arguments: {
'isFrom': '2',
'email': state.emailStr.value
});
}
})),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.resetPasswords!.tr,
rightTitle: "",
@ -92,11 +132,11 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
Navigator.pushNamed(
context, Routers.minePersonInfoSetSafetyProblemPage);
}),
CommonItem(
Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.countryAndRegion!.tr,
rightTitle: "中国",
rightTitle: state.countryStr.value,
isHaveLine: false,
isHaveDirection: false),
isHaveDirection: false)),
],
));
}

View File

@ -0,0 +1,11 @@
import 'package:get/get.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfo/minePersonInfo_entity.dart';
class MinePersonInfoState {
final mineInfoData = MinePersonInfoData().obs;
var nickname = ''.obs; //
var mobileStr = ''.obs; //
var emailStr = ''.obs; //
var countryStr = ''.obs; ///
}

View File

@ -0,0 +1,88 @@
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:get/get_core/src/get_main.dart';
import 'package:get/get_navigation/src/extension_navigation.dart';
import 'package:get/get_utils/get_utils.dart';
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/login/login/entity/LoginEntity.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEditAccount/minePersonInfoEditAccount/minePersonInfoEditAccount_state.dart';
import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/tools/toast.dart';
class MineInfoEditAccountLogic extends BaseGetXController {
final MineInfoEditAccountState state = MineInfoEditAccountState();
late Timer _timer;
void _startTimer() {
_timer = Timer.periodic(1.seconds, (timer) {
if (state.currentSecond > 1) {
state.currentSecond--;
} else {
_cancelTimer();
state.currentSecond = state.totalSeconds;
}
state.resetResend();
});
}
void _cancelTimer() {
_timer.cancel();
}
//
void sendValidationCode() async {
var entity = await ApiRepository.to.getValidationCodeAuth(
state.countryCode.value,
state.loginData.value.mobile!,
state.channel.value,
state.codeType.value,
state.uniqueid.value,
state.xWidth.value.toString());
if (entity.errorCode!.codeIsSuccessful) {
_startTimer();
} else {}
}
//
Future<void> deleteAccountRequest() async {
LoginEntity entity = await ApiRepository.to
.deleteAccount("", "", state.verificationCode.value);
if (entity.errorCode!.codeIsSuccessful) {
Toast.show(msg: '验证成功,账号已删除');
//
Get.offNamedUntil(Routers.starLockLoginPage, (route) => false);
}
}
void checkNext(TextEditingController controller) {
changeInput(controller);
}
void changeInput(TextEditingController controller) {
if (controller == state.codeController) {
state.verificationCode.value = controller.text;
}
_resetCanSub();
}
void _resetCanSub() {
state.canSub.value = state.codeIsOK;
}
@override
void onReady() {
super.onReady();
}
@override
void onInit() {
super.onInit();
state.initLoginData();
}
@override
void onClose() {
super.onClose();
}
}

View File

@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEditAccount/minePersonInfoEditAccount/minePersonInfoEditAccount_logic.dart';
import 'package:star_lock/tools/tf_input_haveBorder.dart';
import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart';
@ -18,7 +20,8 @@ class MinePersonInfoEditAccountPage extends StatefulWidget {
class _MinePersonInfoEditAccountPageState
extends State<MinePersonInfoEditAccountPage> {
final TextEditingController _editAccountController = TextEditingController();
final logic = Get.put(MineInfoEditAccountLogic());
final state = Get.find<MineInfoEditAccountLogic>().state;
@override
Widget build(BuildContext context) {
@ -38,96 +41,39 @@ class _MinePersonInfoEditAccountPageState
TranslationLoader.lanKeys!.modifyAccountTip!.tr,
style: TextStyle(fontSize: 20.sp),
)),
Container(
padding: EdgeInsets.all(20.h),
height: 110.h,
child: TextField(
// maxLines: 1,
keyboardType: TextInputType.text,
// inputFormatters: inputFormatterstters??[],
controller: _editAccountController,
autofocus: false,
textAlign: TextAlign.start,
style: TextStyle(
height: 3.2,
fontSize: 22.sp,
fontWeight: FontWeight.w400,
color: const Color(0xFF333333)),
decoration: InputDecoration(
hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
hintStyle: TextStyle(
// height: 3.0,
fontSize: 22.sp,
color: const Color(0xFF999999)),
// labelText:"label",
labelStyle: const TextStyle(color: Color(0xFF999999)),
border: const OutlineInputBorder(
///
borderRadius: BorderRadius.all(Radius.circular(10)),
///
borderSide: BorderSide(
///
color: Color(0xffD3D3D3),
///
width: 1,
),
),
///
enabledBorder: const OutlineInputBorder(
///
borderRadius: BorderRadius.all(Radius.circular(10)),
///
borderSide: BorderSide(
///
color: Color(0xffD3D3D3),
///
width: 1,
),
),
disabledBorder: const OutlineInputBorder(
///
borderRadius: BorderRadius.all(Radius.circular(10)),
///
borderSide: BorderSide(
///
color: Color(0xffD3D3D3),
///
width: 1,
),
),
///
focusedBorder: const OutlineInputBorder(
///
borderRadius: BorderRadius.all(Radius.circular(10)),
///
borderSide: BorderSide(
///
color: Color(0xffD3D3D3),
///
width: 1,
),
),
),
obscureText: false,
onChanged: (String value) {},
),
),
Obx(() => Container(
padding: EdgeInsets.only(
left: 30.w, right: 30.w, top: 20.h, bottom: 10.h),
child: TFInputHaveBorder(
controller: state.codeController,
label:
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}",
rightSlot: GestureDetector(
child: Container(
width: 180.w,
height: 90.h,
padding: EdgeInsets.all(5.h),
margin: EdgeInsets.only(right: 10.w),
child: Center(
child: Text(state.btnText.value,
textAlign: TextAlign.center,
style: TextStyle(
color: AppColors.mainColor,
fontSize: 26.sp,
)),
),
),
onTap: () {
logic.sendValidationCode();
},
)))),
SizedBox(height: 50.w),
SubmitBtn(
btnName: TranslationLoader.lanKeys!.next!.tr,
onClick: () {
Navigator.pushNamed(
context, Routers.minePersonInfoEditAccountNextPage);
context, Routers.minePersonInfoEditAccountNextPage,
arguments: {'isFrom': '1'});
}),
SizedBox(height: 50.w),
Row(

View File

@ -0,0 +1,65 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:star_lock/login/login/entity/LoginData.dart';
import 'package:star_lock/login/seletCountryRegion/common/index.dart';
import 'package:star_lock/tools/storage.dart';
import 'package:star_lock/translations/trans_lib.dart';
class MineInfoEditAccountState {
final TextEditingController codeController = TextEditingController();
static int currentTimeMillis() {
return DateTime.now().millisecondsSinceEpoch;
}
var countryCode = '+86'.obs;
var countryId = '9'.obs;
var codeType = '4'.obs; //123456
var channel = '1'.obs; // 1 2
var uniqueid = 'B748F838-94EE-4BDB-A0E6-7B2D16849792'.obs;
var verificationCode = ''.obs;
var xWidth = ''.obs; //
var canSub = false.obs;
var date = currentTimeMillis().toString().obs;
bool get codeIsOK => verificationCode.value.isNotEmpty;
var canResend = false.obs;
var btnText = ''.obs;
var totalSeconds = 120;
var currentSecond = 120;
final loginData = LoginData().obs;
///
void saveLoginData(LoginData? data) async {
print("saveLoginData:${data!.mobile}");
await Storage.setString('userLoginData', jsonEncode(data));
loginData.value = data;
}
///
void initLoginData() async {
final data = await Storage.getString('userLoginData');
print("getLoginData:$data");
if (data != null && data.isNotEmpty) {
loginData.value = LoginData.fromJson(jsonDecode(data));
}
}
MineInfoEditAccountState() {
Map map = Get.arguments;
channel.value = map["isFrom"];
resetResend();
}
void resetResend() {
canResend.value = totalSeconds == currentSecond;
btnText.value = !canResend.value
? '$currentSecond s'
: btnText.value = TranslationLoader.lanKeys!.getVerificationCode!.tr;
}
void onClose() {}
}

View File

@ -0,0 +1,89 @@
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:get/get_core/src/get_main.dart';
import 'package:get/get_navigation/src/extension_navigation.dart';
import 'package:get/get_utils/get_utils.dart';
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/login/login/entity/LoginEntity.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEditAccount/minePersonInfoEditAccountNext/minePersonInfoEditAccountNext_state.dart';
import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/tools/toast.dart';
class PersonInfoEditAccountLogic extends BaseGetXController {
final PersonInfoEditAccountState state = PersonInfoEditAccountState();
late Timer _timer;
void _startTimer() {
_timer = Timer.periodic(1.seconds, (timer) {
if (state.currentSecond > 1) {
state.currentSecond--;
} else {
_cancelTimer();
state.currentSecond = state.totalSeconds;
}
state.resetResend();
});
}
void _cancelTimer() {
_timer.cancel();
}
//
void sendValidationCode() async {
var entity = await ApiRepository.to.getValidationCodeAuth(
state.countryCode.value,
state.loginData.value.mobile!,
state.channel.value,
state.codeType.value,
state.uniqueid.value,
state.xWidth.value.toString());
if (entity.errorCode!.codeIsSuccessful) {
_startTimer();
} else {}
}
//
Future<void> deleteAccountRequest() async {
LoginEntity entity = await ApiRepository.to
.deleteAccount("", "", state.verificationCode.value);
if (entity.errorCode!.codeIsSuccessful) {
Toast.show(msg: '验证成功,账号已删除');
//
Get.offNamedUntil(Routers.starLockLoginPage, (route) => false);
}
}
void checkNext(TextEditingController controller) {
changeInput(controller);
}
void changeInput(TextEditingController controller) {
if (controller == state.codeController) {
state.verificationCode.value = controller.text;
}
_resetCanSub();
}
void _resetCanSub() {
state.canSub.value = state.codeIsOK;
}
@override
void onReady() {
super.onReady();
}
@override
void onInit() {
super.onInit();
state.initLoginData();
}
@override
void onClose() {
super.onClose();
}
}

View File

@ -1,10 +1,7 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../../../appRouters.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEditAccount/minePersonInfoEditAccountNext/minePersonInfoEditAccountNext_logic.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/submitBtn.dart';
import '../../../../tools/tf_input_haveBorder.dart';
@ -21,9 +18,8 @@ class MinePersonInfoEditAccountNextPage extends StatefulWidget {
class _MinePersonInfoEditAccountNextPageState
extends State<MinePersonInfoEditAccountNextPage> {
final TextEditingController _editAccountController = TextEditingController();
late Timer _timer;
int _seconds = 60;
final logic = Get.put(PersonInfoEditAccountLogic());
final state = Get.find<PersonInfoEditAccountLogic>().state;
@override
Widget build(BuildContext context) {
@ -45,10 +41,11 @@ class _MinePersonInfoEditAccountNextPageState
TextStyle(fontWeight: FontWeight.w600, fontSize: 24.sp),
)),
Container(
height: 100.h,
padding: EdgeInsets.only(
left: 30.w, right: 30.w, top: 10.h, bottom: 10.h),
child: TFInputHaveBorder(
controller: _editAccountController,
controller: state.accountController,
label: TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr,
),
),
@ -56,9 +53,9 @@ class _MinePersonInfoEditAccountNextPageState
padding: EdgeInsets.only(
left: 30.w, right: 30.w, top: 20.h, bottom: 10.h),
child: TFInputHaveBorder(
controller: _editAccountController,
controller: state.codeController,
label:
"${TranslationLoader.lanKeys!.pleaseEnter!.tr} ${TranslationLoader.lanKeys!.verificationCode!.tr}",
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}",
rightSlot: GestureDetector(
child: Container(
width: 180.w,
@ -71,11 +68,7 @@ class _MinePersonInfoEditAccountNextPageState
// ),
child: Center(
child: Text(
_seconds == 60
? '${TranslationLoader.lanKeys!.getTip!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}'
: (_seconds < 10)
? '0$_seconds s'
: '$_seconds s',
'${TranslationLoader.lanKeys!.getTip!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.grey,
@ -83,13 +76,7 @@ class _MinePersonInfoEditAccountNextPageState
)),
),
),
onTap: () {
if (_seconds == 60) {
// _setVerify();
} else {
// Toast.show(msg: '正在获取验证码');
}
},
onTap: () {},
)),
),
SizedBox(height: 50.w),

View File

@ -0,0 +1,68 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:star_lock/login/login/entity/LoginData.dart';
import 'package:star_lock/login/seletCountryRegion/common/index.dart';
import 'package:star_lock/tools/storage.dart';
import 'package:star_lock/translations/trans_lib.dart';
class PersonInfoEditAccountState {
final TextEditingController accountController = TextEditingController();
final TextEditingController codeController = TextEditingController();
static int currentTimeMillis() {
return DateTime.now().millisecondsSinceEpoch;
}
var countryCode = '+86'.obs;
var countryId = '9'.obs;
var codeType = '3'.obs; //123456
var channel = '1'.obs; // 1 2
var uniqueid = 'B748F838-94EE-4BDB-A0E6-7B2D16849792'.obs;
var newAccountStr = ''.obs;
var verificationCode = ''.obs;
var xWidth = ''.obs; //
var canSub = false.obs;
var date = currentTimeMillis().toString().obs;
bool get accountIsOK => newAccountStr.value.isNotEmpty;
bool get codeIsOK => verificationCode.value.isNotEmpty;
var canResend = false.obs;
var btnText = ''.obs;
var totalSeconds = 120;
var currentSecond = 120;
final loginData = LoginData().obs;
///
void saveLoginData(LoginData? data) async {
print("saveLoginData:${data!.mobile}");
await Storage.setString('userLoginData', jsonEncode(data));
loginData.value = data;
}
///
void initLoginData() async {
final data = await Storage.getString('userLoginData');
print("getLoginData:$data");
if (data != null && data.isNotEmpty) {
loginData.value = LoginData.fromJson(jsonDecode(data));
}
}
PersonInfoEditAccountState() {
Map map = Get.arguments;
channel.value = map["isFrom"];
resetResend();
}
void resetResend() {
canResend.value = totalSeconds == currentSecond;
btnText.value = !canResend.value
? '$currentSecond s'
: btnText.value = TranslationLoader.lanKeys!.getVerificationCode!.tr;
}
void onClose() {}
}

View File

@ -0,0 +1,15 @@
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
class MinePersonInfoEditNamePageState {
final TextEditingController nickNameController = TextEditingController();
final inputNickName = ''.obs;
var canSub = false.obs;
bool get nickNameIsOK => inputNickName.value.isNotEmpty;
MinePersonInfoEditNamePageState() {
Map map = Get.arguments;
inputNickName.value = map["nickName"];
}
}

View File

@ -0,0 +1,43 @@
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEditName/MinePersonInfoEditNamePage_state.dart';
import 'package:star_lock/tools/toast.dart';
import '../../../../network/api_repository.dart';
import '../../../../tools/baseGetXController.dart';
class MinePersonInfoEditNameLogic extends BaseGetXController {
final MinePersonInfoEditNamePageState state =
MinePersonInfoEditNamePageState();
//-
Future<void> updateUserInfoRequest() async {
var entity =
await ApiRepository.to.updateUserInfo(state.inputNickName.value);
if (entity.errorCode!.codeIsSuccessful) {
Toast.show(msg: '操作成功');
Get.back();
}
}
void checkNext(TextEditingController controller) {
changeInput(controller);
}
void changeInput(TextEditingController controller) {
if (controller == state.nickNameController) {
state.inputNickName.value = controller.text;
}
_resetCanSub();
}
void _resetCanSub() {
state.canSub.value = state.nickNameIsOK;
}
@override
void onInit() {
super.onInit();
state.nickNameController.text = state.inputNickName.value;
}
}

View File

@ -1,6 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEditName/MinePersonInfoEditName_logic.dart';
import 'package:star_lock/tools/toast.dart';
import '../../../app_settings/app_colors.dart';
import '../../../tools/tf_loginInput.dart';
@ -17,8 +20,8 @@ class MinePersonInfoEditNamePage extends StatefulWidget {
class _MinePersonInfoEditNamePageState
extends State<MinePersonInfoEditNamePage> {
final TextEditingController _changeNickNameController =
TextEditingController();
final logic = Get.put(MinePersonInfoEditNameLogic());
final state = Get.find<MinePersonInfoEditNameLogic>().state;
@override
Widget build(BuildContext context) {
@ -34,7 +37,13 @@ class _MinePersonInfoEditNamePageState
TranslationLoader.lanKeys!.save!.tr,
style: TextStyle(color: Colors.white, fontSize: 24.sp),
),
onPressed: () {},
onPressed: () {
if (state.nickNameIsOK == false) {
Toast.show(msg: '请输入昵称');
} else {
logic.updateUserInfoRequest();
}
},
),
],
),
@ -43,13 +52,16 @@ class _MinePersonInfoEditNamePageState
child: Column(
children: [
LoginInput(
controller: _changeNickNameController,
isPwd: true,
controller: state.nickNameController,
onchangeAction: (textStr) {
logic.checkNext(state.nickNameController);
},
isPwd: false,
leftWidget: SizedBox(width: 15.w),
hintText:
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.accountNumber!.tr}",
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.nickName!.tr}",
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
LengthLimitingTextInputFormatter(20),
]),
],
),

View File

@ -0,0 +1,102 @@
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEmail/minePersonInfoEmail_state.dart';
import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/tools/toast.dart';
class MinePersonInfoEmailLogic extends BaseGetXController {
final MinePersonInfoEmailState state = MinePersonInfoEmailState();
late Timer _timer;
void _startTimer() {
_timer = Timer.periodic(1.seconds, (timer) {
if (state.currentSecond > 1) {
state.currentSecond--;
} else {
_cancelTimer();
state.currentSecond = state.totalSeconds;
}
state.resetResend();
});
}
void _cancelTimer() {
_timer.cancel();
}
//
void sendValidationCode() async {
var entity = await ApiRepository.to.getValidationCodeAuth(
state.countryCode.value,
state.inputAccount.value,
state.channel.value,
state.codeType.value,
state.uniqueid.value,
state.xWidth.value.toString());
if (entity.errorCode!.codeIsSuccessful) {
_startTimer();
}
}
//
Future<void> bindEmailRequest() async {
PasswordKeyListEntity entity = await ApiRepository.to.bindEmail(
state.inputAccount.value, '', state.verificationCode.value, '');
if (entity.errorCode!.codeIsSuccessful) {
Toast.show(msg: '邮箱绑定成功');
Get.back();
}
}
//
Future<void> bindMobileRequest() async {
PasswordKeyListEntity entity = await ApiRepository.to.changeAccount(
state.countryCode.value,
state.inputAccount.value,
state.uniqueid.value,
state.verificationCode.value);
if (entity.errorCode!.codeIsSuccessful) {
Toast.show(msg: '手机绑定成功');
Get.back();
}
}
void checkNext(TextEditingController controller) {
changeInput(controller);
}
void changeInput(TextEditingController controller) {
if (controller == state.accountController) {
state.inputAccount.value = controller.text;
state.accountIsOK.value = state.inputAccount.value.isNotEmpty;
}
if (controller == state.codeController) {
state.verificationCode.value = controller.text;
}
_resetCanSub();
}
void _resetCanSub() {
state.canSub.value = state.codeIsOK;
}
@override
void onReady() {
super.onReady();
}
@override
void onInit() {
super.onInit();
}
@override
void onClose() {
super.onClose();
}
}

View File

@ -1,10 +1,9 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEmail/minePersonInfoEmail_logic.dart';
import '../../../appRouters.dart';
import '../../../app_settings/app_colors.dart';
import '../../../tools/submitBtn.dart';
import '../../../tools/tf_loginInput.dart';
@ -21,10 +20,8 @@ class MinePersonInfoEditEmailPage extends StatefulWidget {
class _MinePersonInfoEditEmailPageState
extends State<MinePersonInfoEditEmailPage> {
final TextEditingController _phoneController = TextEditingController();
final TextEditingController _codeController = TextEditingController();
late Timer _timer;
int _seconds = 60;
final logic = Get.put(MinePersonInfoEmailLogic());
final state = Get.find<MinePersonInfoEmailLogic>().state;
@override
Widget build(BuildContext context) {
@ -46,70 +43,84 @@ class _MinePersonInfoEditEmailPageState
style: TextStyle(fontSize: 20.sp),
)),
LoginInput(
controller: _phoneController,
isPwd: true,
controller: state.accountController,
isPwd: false,
onchangeAction: (textStr) {
logic.checkNext(state.accountController);
},
leftWidget: const SizedBox(),
hintText:
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.email!.tr}",
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
LengthLimitingTextInputFormatter(20),
]),
SizedBox(height: 10.w),
Row(
children: [
Expanded(
child: LoginInput(
controller: _codeController,
isPwd: true,
controller: state.codeController,
isPwd: false,
leftWidget: const SizedBox(),
onchangeAction: (textStr) {
logic.checkNext(state.codeController);
},
hintText:
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}",
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
LengthLimitingTextInputFormatter(20),
]),
),
SizedBox(
width: 20.w,
),
GestureDetector(
child: Container(
width: 140.w,
// height: 60.h,
padding: EdgeInsets.all(8.h),
decoration: BoxDecoration(
color: AppColors.mainColor,
borderRadius: BorderRadius.circular(5)),
child: Center(
child: Text(
_seconds == 60
? '${TranslationLoader.lanKeys!.getTip!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}'
: (_seconds < 10)
? '0$_seconds s'
: '$_seconds s',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 22.sp,
)),
),
),
onTap: () {
if (_seconds == 60) {
// _setVerify();
} else {
// Toast.show(msg: '正在获取验证码');
}
},
)
Obx(() => GestureDetector(
child: Container(
width: 180.w,
height: 60.h,
padding: EdgeInsets.all(5.h),
decoration: BoxDecoration(
color: state.accountIsOK.value
? AppColors.mainColor
: AppColors.btnDisableColor,
borderRadius: BorderRadius.circular(5)),
child: Center(
child: Text(state.btnText.value,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 24.sp,
)),
),
),
onTap: () {
if (state.accountIsOK.value) {
logic.sendValidationCode();
}
},
))
],
),
SizedBox(height: 50.w),
SubmitBtn(
btnName: TranslationLoader.lanKeys!.sure!.tr,
fontSize: 28.sp,
borderRadius: 20.w,
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () {}),
Obx(() {
return SubmitBtn(
btnName: TranslationLoader.lanKeys!.sure!.tr,
fontSize: 30.sp,
borderRadius: 20.w,
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
isDisabled: state.canSub.value,
onClick: state.canSub.value
? () {
if (state.accountIsOK.value && state.codeIsOK) {
if (state.channel.value == "1") {
logic.bindMobileRequest();
} else {
logic.bindEmailRequest();
}
}
}
: null);
}),
],
),
));

View File

@ -0,0 +1,54 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:star_lock/translations/trans_lib.dart';
class MinePersonInfoEmailState {
final TextEditingController accountController = TextEditingController();
final TextEditingController codeController = TextEditingController();
static int currentTimeMillis() {
return DateTime.now().millisecondsSinceEpoch;
}
var countryCode = '+86'.obs;
var countryId = '9'.obs;
var codeType = '4'.obs; //123456
var channel = '1'.obs; // 1 2
var uniqueid = 'B748F838-94EE-4BDB-A0E6-7B2D16849792'.obs;
var verificationCode = ''.obs;
var xWidth = ''.obs; //
var canSub = false.obs;
var date = currentTimeMillis().toString().obs;
var inputAccount = ''.obs; //
var accountIsOK = false.obs;
bool get codeIsOK => verificationCode.value.isNotEmpty;
var canResend = false.obs;
var btnText = ''.obs;
var totalSeconds = 120;
var currentSecond = 120;
MinePersonInfoEmailState() {
Map map = Get.arguments;
channel.value = map["isFrom"];
// 1 2
// 123456
if (channel.value == "1") {
codeType.value = "3";
} else {
codeType.value = "6";
}
resetResend();
}
void resetResend() {
canResend.value = totalSeconds == currentSecond;
btnText.value = !canResend.value
? '$currentSecond s'
: btnText.value = TranslationLoader.lanKeys!.getVerificationCode!.tr;
}
void onClose() {}
}

View File

@ -0,0 +1,46 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_state.dart';
import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/tools/toast.dart';
class MinePersonInfoResetPasswordLogic extends BaseGetXController {
final MinePersonInfoResetPasswordState state =
MinePersonInfoResetPasswordState();
void changePasswordRequest() async {
var entity = await ApiRepository.to.changePassword(
state.date.value, state.surePwd.value, state.oldPwd.value, "");
if (entity.errorCode!.codeIsSuccessful) {
Toast.show(msg: '重置成功');
Get.back();
} else {
print('Error');
}
}
void checkNext(TextEditingController controller) {
changeInput(controller);
}
void changeInput(TextEditingController controller) {
if (controller == state.oldPwdController) {
state.oldPwd.value = controller.text;
}
if (controller == state.newPwdController) {
state.newPwd.value = controller.text;
}
if (controller == state.surePwdController) {
state.surePwd.value = controller.text;
}
_resetCanSub();
}
void _resetCanSub() {
state.canSub.value = state.oldPwdIsOK && state.newPwdIsOK;
print("22222:${state.canSub.value}");
}
}

View File

@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_logic.dart';
import '../../../appRouters.dart';
import '../../../app_settings/app_colors.dart';
@ -19,9 +21,8 @@ class MinePersonInfoResetPasswordPage extends StatefulWidget {
class _MinePersonInfoResetPasswordPageState
extends State<MinePersonInfoResetPasswordPage> {
final TextEditingController _oldPwdController = TextEditingController();
final TextEditingController _newPwdController = TextEditingController();
final TextEditingController _surePwdController = TextEditingController();
final logic = Get.put(MinePersonInfoResetPasswordLogic());
final state = Get.find<MinePersonInfoResetPasswordLogic>().state;
@override
Widget build(BuildContext context) {
@ -36,7 +37,7 @@ class _MinePersonInfoResetPasswordPageState
child: Column(
children: [
LoginInput(
controller: _oldPwdController,
controller: state.oldPwdController,
isPwd: true,
leftWidget: Text(
"${TranslationLoader.lanKeys!.originalPassword!.tr} ",
@ -44,10 +45,10 @@ class _MinePersonInfoResetPasswordPageState
),
hintText: "",
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
LengthLimitingTextInputFormatter(20),
]),
LoginInput(
controller: _newPwdController,
controller: state.newPwdController,
isPwd: true,
leftWidget: Text(
"${TranslationLoader.lanKeys!.newPassword!.tr} ",
@ -55,10 +56,10 @@ class _MinePersonInfoResetPasswordPageState
),
hintText: "",
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
LengthLimitingTextInputFormatter(20),
]),
LoginInput(
controller: _surePwdController,
controller: state.surePwdController,
isPwd: true,
// isHaveLeftWidget: false,
leftWidget: Text(
@ -67,7 +68,7 @@ class _MinePersonInfoResetPasswordPageState
),
hintText: "",
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
LengthLimitingTextInputFormatter(20),
]),
Container(
width: 1.sw,
@ -77,12 +78,12 @@ class _MinePersonInfoResetPasswordPageState
style: TextStyle(
fontSize: 18.w, color: AppColors.darkGrayTextColor))),
SizedBox(height: 50.w),
SubmitBtn(
Obx(() => SubmitBtn(
btnName: TranslationLoader.lanKeys!.save!.tr,
fontSize: 30.sp,
borderRadius: 20.w,
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () {}),
onClick: () {})),
SizedBox(height: 40.w),
Row(
mainAxisAlignment: MainAxisAlignment.center,

View File

@ -0,0 +1,26 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class MinePersonInfoResetPasswordState {
final TextEditingController oldPwdController = TextEditingController();
final TextEditingController newPwdController = TextEditingController();
final TextEditingController surePwdController = TextEditingController();
static int currentTimeMillis() {
return DateTime.now().millisecondsSinceEpoch;
}
var oldPwd = ''.obs;
var newPwd = ''.obs;
var surePwd = ''.obs;
var canSub = false.obs;
var date = currentTimeMillis().toString().obs;
bool get oldPwdIsOK => oldPwd.value.isNotEmpty;
bool get newPwdIsOK =>
newPwd.value.isNotEmpty && (newPwd.value == surePwd.value);
var canResend = false.obs;
void onClose() {}
}

View File

@ -5,7 +5,6 @@ import 'package:get/get.dart';
import '../../../app_settings/app_colors.dart';
import '../../../tools/commonItem.dart';
import '../../../tools/submitBtn.dart';
import '../../../tools/tf_loginInput.dart';
import '../../../tools/titleAppBar.dart';
import '../../../translations/trans_lib.dart';

View File

@ -123,4 +123,10 @@ abstract class Api {
final String userLogoutURL = '/user/logout'; //退
final String deleteAccountURL = '/user/delete'; //
final String getUserInfoURL = '/user/getUserInfo'; //
final String getValidationCodeAuthURL =
'/user/sendValidationCodeAuth'; //使
final String updateUserInfoURL = '/user/updateUserInfo'; //-/
final String changeAccountURL = '/user/changeAccount'; //
final String bindEmailURL = '/user/bindEmail'; //
final String changePasswordURL = '/user/changePassword'; //
}

View File

@ -255,24 +255,19 @@ class ApiProvider extends BaseProvider {
}));
//
Future<Response> lockRecordUploadData(
String lockId,
List records) =>
post(
lockRecordUploadURL.toUrl,
jsonEncode({
'lockId': lockId,
'records': records,
}));
Future<Response> lockRecordUploadData(String lockId, List records) => post(
lockRecordUploadURL.toUrl,
jsonEncode({
'lockId': lockId,
'records': records,
}));
//
Future<Response> getLockRecordLastUploadDataTime(
String lockId) =>
post(
getLockRecordLastUploadDataTimeURL.toUrl,
jsonEncode({
'lockId': lockId,
}));
Future<Response> getLockRecordLastUploadDataTime(String lockId) => post(
getLockRecordLastUploadDataTimeURL.toUrl,
jsonEncode({
'lockId': lockId,
}));
//
Future<Response> bindingBlueAdmin(
@ -1157,6 +1152,60 @@ class ApiProvider extends BaseProvider {
//
Future<Response> keyboardPwdReset(String lockId) =>
post(keyboardPwdResetURL.toUrl, jsonEncode({'lockId': lockId}));
//使
Future<Response> getValidationCodeAuth(String countryCode, String account,
String channel, String codeType, String uniqueid, String xWidth) =>
post(
getValidationCodeAuthURL.toUrl,
jsonEncode({
'countryCode': countryCode,
'account': account,
"channel": channel,
'codeType': codeType,
"uniqueid": uniqueid,
'xWidth': xWidth,
}));
//-/
Future<Response> updateUserInfo(String nickname) =>
post(updateUserInfoURL.toUrl, jsonEncode({'nickname': nickname}));
//
Future<Response> changeAccount(String countryCode, String newAccount,
String uniqueid, String verificationCode) =>
post(
changeAccountURL.toUrl,
jsonEncode({
'countryCode': countryCode,
'newAccount': newAccount,
'uniqueid': uniqueid,
'verificationCode': verificationCode
}));
//
Future<Response> bindEmail(String email, String uniqueid,
String verificationCode, String operatorUid) =>
post(
bindEmailURL.toUrl,
jsonEncode({
'email': email,
'uniqueid': uniqueid,
'verificationCode': verificationCode,
'operatorUid': operatorUid
}));
//
Future<Response> changePassword(String date, String newPassword,
String oldPassword, String operatorUid) =>
post(
changePasswordURL.toUrl,
jsonEncode({
"date": date,
'newPassword': newPassword,
"oldPassword": oldPassword,
'operatorUid': operatorUid
}));
}
extension ExtensionString on String {

View File

@ -7,6 +7,7 @@ import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/ma
import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/basicInformation/KeyDetailEntity.dart';
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfo/minePersonInfo_entity.dart';
import 'package:star_lock/mine/mineSet/appUnlockNeedMobileNetworkingLock/selectLockListEntity.dart';
import 'package:star_lock/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetailEntity.dart';
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdminListEntity.dart';
@ -211,23 +212,15 @@ class ApiRepository {
//
Future<KeyOperationRecordEntity> lockRecordUploadData(
{
required String lockId,
required List records
}) async {
final res = await apiProvider.lockRecordUploadData(
lockId,
records);
{required String lockId, required List records}) async {
final res = await apiProvider.lockRecordUploadData(lockId, records);
return KeyOperationRecordEntity.fromJson(res.body);
}
//
Future<LockOperatingRecordGetLastRecordTimeEntity> getLockRecordLastUploadDataTime(
{
required String lockId
}) async {
final res = await apiProvider.getLockRecordLastUploadDataTime(
lockId);
Future<LockOperatingRecordGetLastRecordTimeEntity>
getLockRecordLastUploadDataTime({required String lockId}) async {
final res = await apiProvider.getLockRecordLastUploadDataTime(lockId);
return LockOperatingRecordGetLastRecordTimeEntity.fromJson(res.body);
}
@ -1134,17 +1127,17 @@ class ApiRepository {
}
//
Future<AuthorizedAdminListEntity> deleteAccount(
Future<LoginEntity> deleteAccount(
String operatorUid, String uniqueid, String verificationCode) async {
final res = await apiProvider.deleteAccount(
operatorUid, uniqueid, verificationCode);
return AuthorizedAdminListEntity.fromJson(res.body);
return LoginEntity.fromJson(res.body);
}
//
Future<AuthorizedAdminListEntity> getUserInfo(String operatorUid) async {
Future<MinePersonInfoEntity> getUserInfo(String operatorUid) async {
final res = await apiProvider.getUserInfo(operatorUid);
return AuthorizedAdminListEntity.fromJson(res.body);
return MinePersonInfoEntity.fromJson(res.body);
}
//
@ -1152,4 +1145,47 @@ class ApiRepository {
final res = await apiProvider.keyboardPwdReset(lockId);
return PasswordKeyListEntity.fromJson(res.body);
}
// 2使 sendValidationCodeAuth 5
Future<SendValidationCodeEntity> getValidationCodeAuth(
String countryCode,
String account,
String channel,
String codeType,
String uniqueid,
String xWidth) async {
final res = await apiProvider.getValidationCodeAuth(
countryCode, account, channel, codeType, uniqueid, xWidth);
return SendValidationCodeEntity.fromJson(res.body);
}
//-/
Future<PasswordKeyListEntity> updateUserInfo(String nickname) async {
final res = await apiProvider.updateUserInfo(nickname);
return PasswordKeyListEntity.fromJson(res.body);
}
//
Future<PasswordKeyListEntity> changeAccount(String countryCode,
String newAccount, String uniqueid, String verificationCode) async {
final res = await apiProvider.changeAccount(
countryCode, newAccount, uniqueid, verificationCode);
return PasswordKeyListEntity.fromJson(res.body);
}
//
Future<PasswordKeyListEntity> bindEmail(String email, String uniqueid,
String verificationCode, String operatorUid) async {
final res = await apiProvider.bindEmail(
email, uniqueid, verificationCode, operatorUid);
return PasswordKeyListEntity.fromJson(res.body);
}
//
Future<LoginEntity> changePassword(String date, String newPassword,
String oldPassword, String operatorUid) async {
final res = await apiProvider.changePassword(
date, newPassword, oldPassword, operatorUid);
return LoginEntity.fromJson(res.body);
}
}

View File

@ -8,7 +8,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
* */
class TFInputHaveBorder extends StatelessWidget {
TextEditingController? controller;
List<TextInputFormatter>? inputFormatters;
TextInputType? keyboardType;
@ -18,7 +17,18 @@ class TFInputHaveBorder extends StatelessWidget {
String? label;
bool? isPwd;
Widget? rightSlot;
TFInputHaveBorder({Key? key, required this.controller,this.rightSlot,this.label,this.isPwd,this.inputFormatters,this.keyboardType,this.background,this.hintText, this.leftImg}) : super(key: key);
TFInputHaveBorder(
{Key? key,
required this.controller,
this.rightSlot,
this.label,
this.isPwd,
this.inputFormatters,
this.keyboardType,
this.background,
this.hintText,
this.leftImg})
: super(key: key);
@override
Widget build(BuildContext context) {
@ -29,39 +39,47 @@ class TFInputHaveBorder extends StatelessWidget {
maxLines: 1,
keyboardType: TextInputType.text,
// inputFormatters: inputFormatterstters??[],
controller:controller,
controller: controller,
autofocus: false,
textAlign: TextAlign.start,
style:TextStyle(height: 1.1, fontSize: 30.sp, fontWeight: FontWeight.w400, color: const Color(0xFF333333)),
style: TextStyle(
height: 1.1,
fontSize: 24.sp,
fontWeight: FontWeight.w400,
color: const Color(0xFF333333)),
decoration: InputDecoration(
hintText: label,
hintStyle: TextStyle(
height: 1.1,
fontSize: 30.sp,
fontSize: 24.sp,
fontWeight: FontWeight.w400,
color: const Color(0xFF999999)
),
color: const Color(0xFF999999)),
// labelText:"label",
labelStyle: const TextStyle(color: Color(0xFF999999)),
border: const OutlineInputBorder(
///
borderRadius: BorderRadius.all(Radius.circular(10)),
///
borderSide: BorderSide(
///
color: Color(0xffD3D3D3),
///
width: 1,
),
),
///
enabledBorder: const OutlineInputBorder(
///
borderRadius: BorderRadius.all(Radius.circular(10)),
///
borderSide: BorderSide(
///
color: Color(0xffD3D3D3),
///
width: 1,
),
@ -69,33 +87,36 @@ class TFInputHaveBorder extends StatelessWidget {
disabledBorder: const OutlineInputBorder(
///
borderRadius: BorderRadius.all(Radius.circular(10)),
///
borderSide: BorderSide(
///
color: Color(0xffD3D3D3),
///
width: 1,
),
),
///
focusedBorder: const OutlineInputBorder(
///
borderRadius: BorderRadius.all(Radius.circular(10)),
///
borderSide: BorderSide(
///
color: Color(0xffD3D3D3),
///
width: 1,
),
),
),
obscureText:false,
onChanged: (String value){
},
obscureText: false,
onChanged: (String value) {},
),
rightSlot??const SizedBox(width: 0,height: 0)
rightSlot ?? const SizedBox(width: 0, height: 0)
],
);
}

View File

@ -311,6 +311,7 @@ class LanKeyEntity {
this.registerPasswordTip,
this.iphone,
this.email,
this.mobileNumber,
this.countryAndRegion,
this.selet,
this.businessCooperation,
@ -734,6 +735,7 @@ class LanKeyEntity {
registerPasswordTip = json['registerPasswordTip'];
iphone = json['iphone'];
email = json['email'];
mobileNumber = json['mobileNumber'];
countryAndRegion = json['countryAndRegion'];
selet = json['selet'];
@ -1158,6 +1160,7 @@ class LanKeyEntity {
String? registerPasswordTip;
String? iphone;
String? email;
String? mobileNumber;
String? countryAndRegion;
String? selet;
@ -1587,6 +1590,7 @@ class LanKeyEntity {
map['registerPasswordTip'] = registerPasswordTip;
map['iphone'] = iphone;
map['email'] = email;
map['mobileNumber'] = mobileNumber;
map['countryAndRegion'] = countryAndRegion;
map['selet'] = selet;