Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
e5605df8
提交
e5605df8
authored
1月 03, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
忘记密码页面布局
上级
de62e122
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
209 行增加
和
7 行删除
+209
-7
controller.dart
lib/pages/forget_pwd/controller.dart
+77
-0
index.dart
lib/pages/forget_pwd/index.dart
+17
-0
view.dart
lib/pages/forget_pwd/view.dart
+83
-0
view.dart
lib/pages/login/view.dart
+6
-1
index.dart
lib/routes/index.dart
+1
-0
routes.dart
lib/routes/routes.dart
+24
-6
styles.dart
lib/utils/styles.dart
+1
-0
没有找到文件。
lib/pages/forget_pwd/controller.dart
0 → 100644
浏览文件 @
e5605df8
part of
forget_pwd
;
class
ForgetPwdController
extends
GetxController
{
// 账号
final
TextEditingController
phoneInput
=
TextEditingController
();
// 验证码
final
TextEditingController
codeInput
=
TextEditingController
();
// 定时器
late
Timer
_timer
;
// 按钮是否可用
bool
_enable
=
false
;
bool
get
enable
=>
_enable
;
// 倒计时60秒
int
_countDown
=
60
;
int
get
countDown
=>
_countDown
;
bool
_isCounting
=
false
;
bool
get
isCounting
=>
_isCounting
;
// 开启定时器
void
start
()
{
_isCounting
=
true
;
_timer
=
Timer
.
periodic
(
const
Duration
(
seconds:
1
),
(
timer
)
{
if
(
_countDown
>
1
)
{
_countDown
--;
}
else
{
stop
();
}
update
();
});
}
// 停止计时器
void
stop
()
{
if
(
_timer
!=
null
){
_timer
.
cancel
();
_isCounting
=
false
;
}
_countDown
=
60
;
}
void
setCanClick
(){
if
(
phoneInput
.
text
.
length
==
11
&&
codeInput
.
text
.
length
==
4
){
_enable
=
true
;
}
else
{
_enable
=
false
;
}
update
();
}
@override
void
onInit
()
{
_timer
=
Timer
.
periodic
(
const
Duration
(
seconds:
1
),
(
timer
)
{
// 定时器回调
});
/// 测试账号
if
(
kDebugMode
)
{
phoneInput
.
text
=
'13521054068'
;
codeInput
.
text
=
'123456'
;
}
super
.
onInit
();
}
@override
void
onClose
()
{
phoneInput
.
dispose
();
codeInput
.
dispose
();
_timer
.
cancel
();
_isCounting
=
false
;
super
.
onClose
();
}
}
\ No newline at end of file
lib/pages/forget_pwd/index.dart
0 → 100644
浏览文件 @
e5605df8
library
forget_pwd
;
import
'dart:async'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:get/get.dart'
;
import
'../../theme.dart'
;
import
'../../utils/index.dart'
;
import
'../../widgets/index.dart'
;
part
'view.dart'
;
part
'controller.dart'
;
\ No newline at end of file
lib/pages/forget_pwd/view.dart
0 → 100644
浏览文件 @
e5605df8
part of
forget_pwd
;
class
ForgetPwdPage
extends
StatefulWidget
{
const
ForgetPwdPage
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
ForgetPwdPage
>
createState
()
=>
_ForgetPwdPageState
();
}
class
_ForgetPwdPageState
extends
State
<
ForgetPwdPage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
GetBuilder
<
ForgetPwdController
>(
init:
ForgetPwdController
(),
builder:
(
controller
)
=>
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'忘记密码'
),
),
body:
Container
(
margin:
const
EdgeInsets
.
only
(
left:
10
,
right:
10
,
top:
15
),
child:
Column
(
children:
[
CustomFormInput
(
// label: 'Phone',
// required: true,
hintText:
'请输入手机号'
,
keyboardType:
TextInputType
.
number
,
controller:
controller
.
phoneInput
,
onChanged:
(
text
){
controller
.
setCanClick
();
},
),
Gaps
.
vGaps10
,
Stack
(
alignment:
Alignment
.
centerRight
,
children:
[
CustomFormInput
(
// label: 'Phone',
// required: true,
hintText:
'请输入验证码'
,
keyboardType:
TextInputType
.
number
,
controller:
controller
.
codeInput
,
onChanged:
(
text
){
controller
.
setCanClick
();
},
),
Positioned
(
right:
10
,
child:
Row
(
children:
[
Container
(
height:
20
,
width:
1
,
color:
const
Color
(
0xFFEBEBEB
),),
Gaps
.
hGaps10
,
GestureDetector
(
child:
Container
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
10
),
color:
Colors
.
yellow
,
child:
Text
(
controller
.
isCounting
?
'
${controller.countDown}
'
:
'获取验证码'
,
style:
const
TextStyle
(
fontSize:
11
,
color:
AppTheme
.
primary
,
height:
1.4
),)),
onTap:
(){
controller
.
start
();
},
),
],
)
),
],
),
Gaps
.
vGaps40
,
CustomGradientButton
(
text:
'立即登录'
,
isEnabled:
!
controller
.
enable
,
onPressed:
()
{
},
)
],
),
),
),
);
}
}
lib/pages/login/view.dart
浏览文件 @
e5605df8
...
@@ -134,7 +134,12 @@ class _LoginPageState extends State<LoginPage> {
...
@@ -134,7 +134,12 @@ class _LoginPageState extends State<LoginPage> {
controller
.
updateLoginType
(
0
);
controller
.
updateLoginType
(
0
);
},
},
),
),
controller
.
loginType
==
0
?
const
Text
(
'忘记密码'
,
style:
TextStyle
(
fontSize:
13
,
height:
1.3
,
color:
Colours
.
cBlue
),):
const
Text
(
'*登录后将自动完成注册'
,
style:
TextStyle
(
fontSize:
13
,
height:
1.3
,
color:
Colours
.
c6
),),
controller
.
loginType
==
0
?
GestureDetector
(
child:
const
Text
(
'忘记密码'
,
style:
TextStyle
(
fontSize:
13
,
height:
1.3
,
color:
Colours
.
cBlue
),),
onTap:
(){
context
.
pushNamed
(
Routes
.
forgetPwd
);
},
):
const
Text
(
'*登录后将自动完成注册'
,
style:
TextStyle
(
fontSize:
13
,
height:
1.3
,
color:
Colours
.
c6
),),
],
],
)
)
),
),
...
...
lib/routes/index.dart
浏览文件 @
e5605df8
...
@@ -5,6 +5,7 @@ import 'package:flutter/foundation.dart';
...
@@ -5,6 +5,7 @@ import 'package:flutter/foundation.dart';
import
'package:flutter_book/pages/about/index.dart'
;
import
'package:flutter_book/pages/about/index.dart'
;
import
'package:flutter_book/pages/ad/index.dart'
;
import
'package:flutter_book/pages/ad/index.dart'
;
import
'package:flutter_book/pages/book_pay/index.dart'
;
import
'package:flutter_book/pages/book_pay/index.dart'
;
import
'package:flutter_book/pages/forget_pwd/index.dart'
;
import
'package:flutter_book/pages/login/index.dart'
;
import
'package:flutter_book/pages/login/index.dart'
;
import
'package:flutter_book/pages/main/index.dart'
;
import
'package:flutter_book/pages/main/index.dart'
;
import
'package:flutter_book/pages/splash/index.dart'
;
import
'package:flutter_book/pages/splash/index.dart'
;
...
...
lib/routes/routes.dart
浏览文件 @
e5605df8
...
@@ -7,18 +7,25 @@ abstract class Routes {
...
@@ -7,18 +7,25 @@ abstract class Routes {
static
const
splash
=
'splash'
;
static
const
splash
=
'splash'
;
static
const
main
=
'main'
;
static
const
main
=
'main'
;
static
const
ad
=
'ad'
;
static
const
ad
=
'ad'
;
static
const
login
=
'login'
;
static
const
web
=
'web'
;
static
const
web
=
'web'
;
static
const
about
=
'about'
;
static
const
about
=
'about'
;
//
/
支付界面
// 支付界面
static
const
bookPay
=
'book_pay'
;
static
const
bookPay
=
'book_pay'
;
//
/
用户协议 和 隐私政策
// 用户协议 和 隐私政策
static
const
terms
=
'terms'
;
static
const
terms
=
'terms'
;
/// 消息
static
const
msgs
=
'msgs'
;
/// 我的
/// 登录模块
// 登录
static
const
login
=
'login'
;
// 忘记密码
static
const
forgetPwd
=
'forget_pwd'
;
// 重置密码
static
const
resetPwd
=
'reset_pwd'
;
/// 我的模块
// 个人信息
// 个人信息
static
const
userInfo
=
'user_info'
;
static
const
userInfo
=
'user_info'
;
// 修改昵称
// 修改昵称
...
@@ -35,6 +42,8 @@ abstract class Routes {
...
@@ -35,6 +42,8 @@ abstract class Routes {
static
const
collect
=
'collect'
;
static
const
collect
=
'collect'
;
// 紫金币
// 紫金币
static
const
coin
=
'coin'
;
static
const
coin
=
'coin'
;
// 消息
static
const
msgs
=
'msgs'
;
static
final
GoRouter
config
=
GoRouter
(
static
final
GoRouter
config
=
GoRouter
(
...
@@ -149,6 +158,15 @@ abstract class Routes {
...
@@ -149,6 +158,15 @@ abstract class Routes {
key:
state
.
pageKey
,
key:
state
.
pageKey
,
child:
const
UserCoinPage
()
child:
const
UserCoinPage
()
)
)
),
GoRoute
(
path:
'/
$forgetPwd
'
,
name:
forgetPwd
,
pageBuilder:
(
context
,
state
)
=>
CupertinoPage
(
name:
state
.
uri
.
toString
(),
key:
state
.
pageKey
,
child:
const
ForgetPwdPage
()
)
)
)
]
]
);
);
...
...
lib/utils/styles.dart
浏览文件 @
e5605df8
...
@@ -35,6 +35,7 @@ class Gaps {
...
@@ -35,6 +35,7 @@ class Gaps {
static
const
Widget
vGaps10
=
SizedBox
(
height:
10
,);
static
const
Widget
vGaps10
=
SizedBox
(
height:
10
,);
static
const
Widget
vGaps13
=
SizedBox
(
height:
13
,);
static
const
Widget
vGaps13
=
SizedBox
(
height:
13
,);
static
const
Widget
vGaps15
=
SizedBox
(
height:
15
,);
static
const
Widget
vGaps15
=
SizedBox
(
height:
15
,);
static
const
Widget
vGaps40
=
SizedBox
(
height:
40
,);
// static const Widget line = Padding(
// static const Widget line = Padding(
// padding: EdgeInsets.symmetric(horizontal: 15.0),
// padding: EdgeInsets.symmetric(horizontal: 15.0),
// child: Divider(color: Colours.cLine,),
// child: Divider(color: Colours.cLine,),
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论