Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
ChatGPT
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
关振斌
ChatGPT
Commits
b202aaf4
Commit
b202aaf4
authored
Apr 06, 2023
by
skeyboy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录页调整
parent
1c1e22c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
219 additions
and
21 deletions
+219
-21
android/build.gradle
android/build.gradle
+6
-1
lib/pages/frame/sign_in/controller.dart
lib/pages/frame/sign_in/controller.dart
+9
-0
lib/pages/frame/sign_in/view.dart
lib/pages/frame/sign_in/view.dart
+204
-20
No files found.
android/build.gradle
View file @
b202aaf4
buildscript
{
buildscript
{
ext
.
kotlin_version
=
'1.
6.2
0'
ext
.
kotlin_version
=
'1.
8.
0'
repositories
{
repositories
{
google
()
google
()
mavenCentral
()
mavenCentral
()
...
@@ -16,6 +16,11 @@ allprojects {
...
@@ -16,6 +16,11 @@ allprojects {
google
()
google
()
mavenCentral
()
mavenCentral
()
}
}
gradle
.
projectsEvaluated
{
tasks
.
withType
(
JavaCompile
)
{
options
.
compilerArgs
<<
"-Xlint:unchecked"
<<
"-Xlint:deprecation"
}
}
}
}
rootProject
.
buildDir
=
'../build'
rootProject
.
buildDir
=
'../build'
...
...
lib/pages/frame/sign_in/controller.dart
View file @
b202aaf4
...
@@ -66,6 +66,11 @@ class SignInController extends GetxController {
...
@@ -66,6 +66,11 @@ class SignInController extends GetxController {
// 执行登录操作
// 执行登录操作
handleSignIn
()
async
{
handleSignIn
()
async
{
if
(!
GetUtils
.
isPhoneNumber
(
mobileMemberController
.
text
))
{
EasyLoading
.
showToast
(
"请输入手机号"
);
return
;
}
if
(
codeController
.
text
.
length
<
5
)
{
if
(
codeController
.
text
.
length
<
5
)
{
EasyLoading
.
showToast
(
"验证码输入有误"
);
EasyLoading
.
showToast
(
"验证码输入有误"
);
return
;
return
;
...
@@ -180,6 +185,10 @@ class SignInController extends GetxController {
...
@@ -180,6 +185,10 @@ class SignInController extends GetxController {
}
}
chageCodeStatus
()
async
{
chageCodeStatus
()
async
{
if
(!
mobileMemberController
.
text
.
isNotEmpty
)
{
EasyLoading
.
showToast
(
'请先输入手机号'
);
return
;
}
if
(
codeEnable
.
value
)
{
if
(
codeEnable
.
value
)
{
EasyLoading
.
show
(
status:
"发送验证码中"
);
EasyLoading
.
show
(
status:
"发送验证码中"
);
MsmEntity
?
res
=
MsmEntity
?
res
=
...
...
lib/pages/frame/sign_in/view.dart
View file @
b202aaf4
...
@@ -2,11 +2,13 @@ import 'dart:io';
...
@@ -2,11 +2,13 @@ import 'dart:io';
import
'package:chart/common/routers/routes.dart'
;
import
'package:chart/common/routers/routes.dart'
;
import
'package:chart/pages/application/index.dart'
;
import
'package:chart/pages/application/index.dart'
;
import
'package:file_picker/file_picker.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:chart/common/values/values.dart'
;
import
'package:chart/common/values/values.dart'
;
import
'package:chart/common/widgets/widgets.dart'
;
import
'package:chart/common/widgets/widgets.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
;
// import 'package:flutter_icons/flutter_icons.dart';
// import 'package:flutter_icons/flutter_icons.dart';
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'package:get/get.dart'
;
import
'package:get/get.dart'
;
...
@@ -97,6 +99,121 @@ class SignInPage extends GetView<SignInController> {
...
@@ -97,6 +99,121 @@ class SignInPage extends GetView<SignInController> {
);
);
}
}
// 手机号登录
Widget
_buildSigMobileInput
({
Color
mainColor
=
Colors
.
green
})
{
return
Container
(
width:
Get
.
width
,
height:
45
,
// color: Colors.white,
margin:
const
EdgeInsets
.
fromLTRB
(
15
,
0
,
15
,
0
),
decoration:
BoxDecoration
(
color:
mainColor
,
gradient:
LinearGradient
(
colors:
[
mainColor
.
withOpacity
(
0.2
),
mainColor
.
withOpacity
(
0.2
),
mainColor
.
withOpacity
(
0.2
)
],
begin:
Alignment
.
topLeft
,
end:
Alignment
.
bottomRight
),
border:
Border
.
all
(
color:
mainColor
,
width:
1
.
w
),
borderRadius:
BorderRadius
.
circular
(
5
),
),
child:
Row
(
children:
[
SizedBox
(
width:
45
,
child:
Center
(
child:
Text
(
textAlign:
TextAlign
.
center
,
'+86'
,
style:
TextStyle
(
color:
mainColor
,
fontSize:
11
),
),
),
),
Flexible
(
flex:
1
,
child:
TextField
(
autofocus:
false
,
controller:
controller
.
mobileMemberController
,
keyboardType:
TextInputType
.
phone
,
decoration:
InputDecoration
(
hintText:
'请输入手机号'
,
contentPadding:
EdgeInsets
.
fromLTRB
(
0
,
0
,
0
,
9
),
border:
InputBorder
.
none
,
suffixIcon:
null
),
style:
const
TextStyle
(
color:
Colors
.
grey
,
fontFamily:
"Avenir"
,
fontWeight:
FontWeight
.
w400
,
fontSize:
11
,
),
maxLines:
1
,
autocorrect:
false
,
// 自动纠正
obscureText:
false
,
// 隐藏输入内容, 密码框
),
)
],
));
}
// 验证码
Widget
_buildSigCodeInput
({
Color
mainColor
=
Colors
.
green
})
{
return
Container
(
width:
Get
.
width
,
height:
45
,
// color: Colors.white,
margin:
const
EdgeInsets
.
fromLTRB
(
15
,
0
,
15
,
0
),
decoration:
BoxDecoration
(
color:
mainColor
,
gradient:
LinearGradient
(
colors:
[
mainColor
.
withOpacity
(
0.2
),
mainColor
.
withOpacity
(
0.2
),
mainColor
.
withOpacity
(
0.2
)
],
begin:
Alignment
.
topLeft
,
end:
Alignment
.
bottomRight
),
border:
Border
.
all
(
color:
mainColor
,
width:
1
.
w
),
borderRadius:
BorderRadius
.
circular
(
5
),
),
child:
Row
(
children:
[
Flexible
(
flex:
1
,
child:
TextField
(
autofocus:
false
,
controller:
controller
.
codeController
,
keyboardType:
TextInputType
.
phone
,
decoration:
const
InputDecoration
(
hintText:
'输入验证码'
,
contentPadding:
EdgeInsets
.
fromLTRB
(
25
,
0
,
0
,
9
),
border:
InputBorder
.
none
,
suffixIcon:
null
),
style:
const
TextStyle
(
color:
Colors
.
grey
,
fontFamily:
"Avenir"
,
fontWeight:
FontWeight
.
w400
,
fontSize:
11
,
),
maxLines:
1
,
autocorrect:
false
,
// 自动纠正
obscureText:
false
,
// 隐藏输入内容, 密码框
),
),
SizedBox
(
width:
45
,
child:
GestureDetector
(
onTap:
()
=>
controller
.
chageCodeStatus
(),
child:
Center
(
child:
Text
(
textAlign:
TextAlign
.
center
,
'获取'
,
style:
TextStyle
(
color:
mainColor
,
fontSize:
13
),
),
),
),
),
],
));
}
// 登录表单
// 登录表单
Widget
_buildInputForm
()
{
Widget
_buildInputForm
()
{
return
GlassmorphicContainer
(
return
GlassmorphicContainer
(
...
@@ -308,7 +425,6 @@ class SignInPage extends GetView<SignInController> {
...
@@ -308,7 +425,6 @@ class SignInPage extends GetView<SignInController> {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
return
Scaffold
(
resizeToAvoidBottomInset:
false
,
body:
Platform
.
isIOS
body:
Platform
.
isIOS
?
Container
(
?
Container
(
width:
double
.
infinity
,
width:
double
.
infinity
,
...
@@ -464,25 +580,93 @@ class SignInPage extends GetView<SignInController> {
...
@@ -464,25 +580,93 @@ class SignInPage extends GetView<SignInController> {
image:
Image
.
asset
(
"assets/images/bg2.png"
).
image
,
image:
Image
.
asset
(
"assets/images/bg2.png"
).
image
,
fit:
BoxFit
.
cover
),
fit:
BoxFit
.
cover
),
))
))
:
Container
(
:
buildAndroidSigin
(
context
));
padding:
EdgeInsets
.
symmetric
(
horizontal:
16
),
}
decoration:
BoxDecoration
(
image:
DecorationImage
(
Widget
buildAndroidSigin
(
BuildContext
buildContext
)
{
image:
Image
.
asset
(
"assets/images/bg2.png"
).
image
,
return
GestureDetector
(
fit:
BoxFit
.
cover
),
behavior:
HitTestBehavior
.
translucent
,
onTap:
()
=>
FocusScope
.
of
(
buildContext
).
unfocus
(),
child:
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
16
),
decoration:
BoxDecoration
(
image:
DecorationImage
(
image:
Image
.
asset
(
"assets/images/background.png"
).
image
,
fit:
BoxFit
.
cover
),
),
child:
Column
(
children:
[
SizedBox
(
height:
55
.
h
,
),
Row
(
children:
[
GestureDetector
(
onTap:
()
=>
Get
.
back
(),
child:
const
Icon
(
Icons
.
chevron_left
,
color:
Colors
.
white70
,
size:
35
,
)),
]),
SizedBox
(
height:
65
.
h
,
),
const
Text
(
'欢迎登录'
,
style:
TextStyle
(
color:
Colors
.
white70
,
fontWeight:
FontWeight
.
bold
),
),
SizedBox
(
height:
45
.
h
,
),
_buildSigMobileInput
(),
const
SizedBox
(
height:
20
,
),
_buildSigCodeInput
(),
const
Padding
(
padding:
EdgeInsets
.
only
(
top:
10
),
child:
Center
(
child:
Text
(
'未注册的手机号验证通过后将自动通过'
,
style:
TextStyle
(
fontSize:
10
,
color:
Colors
.
white70
),
),
),
child:
Center
(
),
child:
Column
(
),
mainAxisAlignment:
MainAxisAlignment
.
center
,
const
SizedBox
(
children:
<
Widget
>[
height:
55
,
_buildInputForm
(),
),
// _buildLogo(),
Container
(
// _buildInputForm(),
height:
44
.
h
,
// Spacer(),
margin:
EdgeInsets
.
only
(
top:
15
.
h
),
// _buildThirdPartyLogin(),
child:
btnFlatButtonWidget
(
// _buildSignupButton(),
width:
Get
.
width
-
40
,
],
fontColor:
Colors
.
black54
,
)),
fontSize:
16
,
));
gbColor:
Colors
.
green
.
withOpacity
(
0.7
),
onPressed:
controller
.
handleSignIn
,
// controller.handleSignIn,
title:
"登录"
),
),
// SizedBox(
// height: 25,
// ),
// Center(
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: <Widget>[
// _buildInputForm(),
// // _buildLogo(),
// // _buildInputForm(),
// // Spacer(),
// // _buildThirdPartyLogin(),
// // _buildSignupButton(),
// ],
// ))
],
),
),
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment