|
|
|
@ -44,61 +44,67 @@ class _SetPsdPageState extends State<SetPsdPage> {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return AkuScaffold(
|
|
|
|
|
title: '',
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
body: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
24.w.heightBox,
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
48.w.widthBox,
|
|
|
|
|
'首次登陆,请设置账号密码'
|
|
|
|
|
.text
|
|
|
|
|
.size(36.sp)
|
|
|
|
|
.bold
|
|
|
|
|
.color(Colors.black.withOpacity(0.65))
|
|
|
|
|
.make(),
|
|
|
|
|
Spacer(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
16.w.heightBox,
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
48.w.widthBox,
|
|
|
|
|
'密码需由6-20位数字、字母、或符号组成,至少两种'
|
|
|
|
|
.text
|
|
|
|
|
.size(28.sp)
|
|
|
|
|
.color(Colors.black.withOpacity(0.45))
|
|
|
|
|
.make(),
|
|
|
|
|
Spacer(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
144.w.heightBox,
|
|
|
|
|
PsdTextField(controller: _psdController, hintText: '请输入密码'),
|
|
|
|
|
24.w.heightBox,
|
|
|
|
|
PsdTextField(controller: _confirmPsdController, hintText: '请再次输入密码'),
|
|
|
|
|
16.w.heightBox,
|
|
|
|
|
PsdVerify.checkString(psdCheck)
|
|
|
|
|
.text
|
|
|
|
|
.size(28.sp)
|
|
|
|
|
.color(Color(0xFFCF1322).withOpacity(0.8))
|
|
|
|
|
.make(),
|
|
|
|
|
37.w.heightBox,
|
|
|
|
|
LoginButtonWidget(
|
|
|
|
|
onTap: psdCheck == PSDVERIFY.correct
|
|
|
|
|
? () async {
|
|
|
|
|
var result =
|
|
|
|
|
await SignFunc.settingPsd(_psdController.text);
|
|
|
|
|
if (result) {
|
|
|
|
|
await UserTool.userProvider.updateUserInfo();
|
|
|
|
|
await SignFunc.checkNameAndAccount();
|
|
|
|
|
return WillPopScope(
|
|
|
|
|
onWillPop: () async {
|
|
|
|
|
return false;
|
|
|
|
|
},
|
|
|
|
|
child: AkuScaffold(
|
|
|
|
|
title: '',
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
body: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
24.w.heightBox,
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
48.w.widthBox,
|
|
|
|
|
'首次登陆,请设置账号密码'
|
|
|
|
|
.text
|
|
|
|
|
.size(36.sp)
|
|
|
|
|
.bold
|
|
|
|
|
.color(Colors.black.withOpacity(0.65))
|
|
|
|
|
.make(),
|
|
|
|
|
Spacer(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
16.w.heightBox,
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
48.w.widthBox,
|
|
|
|
|
'密码需由6-20位数字、字母、或符号组成,至少两种'
|
|
|
|
|
.text
|
|
|
|
|
.size(28.sp)
|
|
|
|
|
.color(Colors.black.withOpacity(0.45))
|
|
|
|
|
.make(),
|
|
|
|
|
Spacer(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
144.w.heightBox,
|
|
|
|
|
PsdTextField(controller: _psdController, hintText: '请输入密码'),
|
|
|
|
|
24.w.heightBox,
|
|
|
|
|
PsdTextField(
|
|
|
|
|
controller: _confirmPsdController, hintText: '请再次输入密码'),
|
|
|
|
|
16.w.heightBox,
|
|
|
|
|
PsdVerify.checkString(psdCheck)
|
|
|
|
|
.text
|
|
|
|
|
.size(28.sp)
|
|
|
|
|
.color(Color(0xFFCF1322).withOpacity(0.8))
|
|
|
|
|
.make(),
|
|
|
|
|
37.w.heightBox,
|
|
|
|
|
LoginButtonWidget(
|
|
|
|
|
onTap: psdCheck == PSDVERIFY.correct
|
|
|
|
|
? () async {
|
|
|
|
|
var result =
|
|
|
|
|
await SignFunc.settingPsd(_psdController.text);
|
|
|
|
|
if (result) {
|
|
|
|
|
await UserTool.userProvider.updateUserInfo();
|
|
|
|
|
await SignFunc.checkNameAndAccount();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
text: '确认'),
|
|
|
|
|
],
|
|
|
|
|
: null,
|
|
|
|
|
text: '确认'),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|