Commit c70dc107 authored by skeyboy's avatar skeyboy

Android 登录页修改

parent c2930089
import 'dart:io';
import 'package:bruno/bruno.dart';
import 'package:chart/common/routers/routes.dart';
import 'package:chart/pages/application/index.dart';
import 'package:file_picker/file_picker.dart';
......@@ -17,6 +18,11 @@ import 'package:social_login_buttons/social_login_buttons.dart';
import 'index.dart';
const kPrimaryColor = Color(0xFF6F35A5);
const kPrimaryLightColor = Color(0xFFF1E6FF);
const double defaultPadding = 16.0;
class SignInPage extends GetView<SignInController> {
// logo
Widget _buildLogo() {
......@@ -266,25 +272,25 @@ class SignInPage extends GetView<SignInController> {
suffixIcon: InkWell(
onTap: () => controller.chageCodeStatus(),
child: Obx(() => Container(
// height: 20,
width: 100,
// padding: EdgeInsets.all(5.0),
decoration: BoxDecoration(
// color: Colors.red,
// border: Border.all(
// color: controller.codeEnable.value
// ? Color(0xFF0165B8)
// : Colors.white),
),
child: Center(
child: Text(
// height: 20,
width: 100,
// padding: EdgeInsets.all(5.0),
decoration: BoxDecoration(
// color: Colors.red,
// border: Border.all(
// color: controller.codeEnable.value
// ? Color(0xFF0165B8)
// : Colors.white),
),
child: Center(
child: Text(
controller.verifyStr.value,
style: TextStyle(
color: controller.codeEnable.value
? Color(0xFF0165B8)
: Color(0xFFACB1B6)),
)),
)),
)),
),
// isPassword: true,
),
......@@ -427,246 +433,379 @@ class SignInPage extends GetView<SignInController> {
return Scaffold(
body: Platform.isIOS
? Container(
width: double.infinity,
height: double.infinity,
// ignore: sort_child_properties_last
child: Column(
children: [
Expanded(
child: Column(
width: double.infinity,
height: double.infinity,
// ignore: sort_child_properties_last
child: Column(
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
_buildLogo(),
],
)),
Expanded(
child: Center(
child: Padding(
padding: EdgeInsets.only(top: 90),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SocialLoginButton(
text: "通过 Apple 登录",
buttonType: SocialLoginButtonType.apple,
onPressed: () {
Get.bottomSheet(
Container(
padding: EdgeInsets.all(14),
decoration: BoxDecoration(
// topLeft: Radius.circular(30), topRight: Radius.circular(30)))
borderRadius: BorderRadius.only(
topLeft: Radius.circular(15),
topRight: Radius.circular(15)),
color: Colors.white,
),
height: 260,
child: Column(children: [
Text(
"请阅读并同意以下条款",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold),
),
SizedBox(
height: 20,
),
Padding(
padding: EdgeInsets.symmetric(
vertical: 20),
child: RichText(
text: TextSpan(
style:
DefaultTextStyle.of(context)
.style,
children: [
TextSpan(
text: '《用户协议》',
recognizer:
TapGestureRecognizer()
..onTap = () {
Get.toNamed(AppRoutes
.USER_PRIVACT);
},
style: TextStyle(
fontWeight:
FontWeight.bold,
color: AppColors
.primaryElement)),
TextSpan(
text: '《隐私权限》',
recognizer:
TapGestureRecognizer()
..onTap = () {
Get.toNamed(
AppRoutes
.PRIVACT);
},
style: TextStyle(
fontWeight:
FontWeight.bold,
color: AppColors
.primaryElement)),
],
),
),
),
SizedBox(
height: 20,
),
btnFlatButtonWidget(
onPressed: () {
Get.back();
controller.signInWithApple();
},
width: 294,
gbColor: AppColors.primaryElement,
fontColor:
AppColors.primaryBackground,
title: "同意并登录",
fontWeight: FontWeight.w500,
Expanded(
child: Center(
child: Padding(
padding: EdgeInsets.only(top: 90),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SocialLoginButton(
text: "通过 Apple 登录",
buttonType: SocialLoginButtonType.apple,
onPressed: () {
Get.bottomSheet(
Container(
padding: EdgeInsets.all(14),
decoration: BoxDecoration(
// topLeft: Radius.circular(30), topRight: Radius.circular(30)))
borderRadius: BorderRadius.only(
topLeft: Radius.circular(15),
topRight: Radius.circular(15)),
color: Colors.white,
),
height: 260,
child: Column(children: [
Text(
"请阅读并同意以下条款",
style: TextStyle(
fontSize: 16,
)
// Text(
// "请阅读并同意以下条款",
// style: TextStyle(
// fontSize: 16,
// color: Colors.blue[900],
// fontWeight: FontWeight.bold),
// ),
]),
fontWeight: FontWeight.bold),
),
// backgroundColor: Colors.white,
);
// controller.signInWithApple
},
),
SizedBox(
height: 20,
),
Padding(
padding: EdgeInsets.symmetric(
vertical: 20),
child: RichText(
text: TextSpan(
style:
DefaultTextStyle.of(context)
.style,
children: [
TextSpan(
text: '《用户协议》',
recognizer:
TapGestureRecognizer()
..onTap = () {
Get.toNamed(AppRoutes
.USER_PRIVACT);
},
style: TextStyle(
fontWeight:
FontWeight.bold,
color: AppColors
.primaryElement)),
TextSpan(
text: '《隐私权限》',
recognizer:
TapGestureRecognizer()
..onTap = () {
Get.toNamed(
AppRoutes
.PRIVACT);
},
style: TextStyle(
fontWeight:
FontWeight.bold,
color: AppColors
.primaryElement)),
],
),
),
),
SizedBox(
height: 20,
),
btnFlatButtonWidget(
onPressed: () {
Get.back();
controller.signInWithApple();
},
width: 294,
gbColor: AppColors.primaryElement,
fontColor:
AppColors.primaryBackground,
title: "同意并登录",
fontWeight: FontWeight.w500,
fontSize: 16,
)
// Text(
// "请阅读并同意以下条款",
// style: TextStyle(
// fontSize: 16,
// color: Colors.blue[900],
// fontWeight: FontWeight.bold),
// ),
]),
),
// backgroundColor: Colors.white,
);
// controller.signInWithApple
},
),
SizedBox(
height: 20,
),
SocialLoginButton(
text: "不登录使用",
buttonType:
SocialLoginButtonType.generalLogin,
backgroundColor: AppColors.thirdElement,
onPressed: () async {
Get.back();
}),
// Get.put(ApplicationController());
// await Get.offAndToNamed(
// AppRoutes.Application);
// }),
// SizedBox(
// height: 20,
// ),
// SocialLoginButton(
// text: "微信登录",
// buttonType:
// SocialLoginButtonType.generalLogin,
// backgroundColor: AppColors.thirdElement,
// onPressed: () async {
// Get.back();
// }),
],
)),
),
)
],
),
padding: EdgeInsets.symmetric(horizontal: 16),
decoration: BoxDecoration(
image: DecorationImage(
image: Image.asset("assets/images/bg2.png").image,
fit: BoxFit.cover),
))
SizedBox(
height: 20,
),
SocialLoginButton(
text: "不登录使用",
buttonType:
SocialLoginButtonType.generalLogin,
backgroundColor: AppColors.thirdElement,
onPressed: () async {
Get.back();
}),
// Get.put(ApplicationController());
// await Get.offAndToNamed(
// AppRoutes.Application);
// }),
// SizedBox(
// height: 20,
// ),
// SocialLoginButton(
// text: "微信登录",
// buttonType:
// SocialLoginButtonType.generalLogin,
// backgroundColor: AppColors.thirdElement,
// onPressed: () async {
// Get.back();
// }),
],
)),
),
)
],
),
padding: EdgeInsets.symmetric(horizontal: 16),
decoration: BoxDecoration(
image: DecorationImage(
image: Image.asset("assets/images/bg2.png").image,
fit: BoxFit.cover),
))
: buildAndroidSigin(context));
}
Widget buildAndroidSigin(BuildContext buildContext) {
return GestureDetector(
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,
onTap: ()=> Focus.of(buildContext).unfocus(),
child: Stack(
alignment: Alignment.center,
children: <Widget>[
Container(
decoration: BoxDecoration(
image: DecorationImage(
image: Image.asset("assets/images/background.png").image,
fit: BoxFit.cover),
),
_buildSigCodeInput(),
const Padding(
padding: EdgeInsets.only(top: 10),
child: Center(
child: Text(
'未注册的手机号验证通过后将自动通过',
style: TextStyle(fontSize: 12, color: Colors.white70),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Column(
children: [
Row(
children: [
const Spacer(),
SizedBox(
height: 145,
width: 145,
child: Image.asset("assets/images/logo.png"),
),
const Spacer(),
],
),
SizedBox(height: defaultPadding * 1.5),
],
),
),
),
const SizedBox(
height: 55,
),
Container(
height: 44.h,
margin: EdgeInsets.only(top: 15.h),
child: btnFlatButtonWidget(
width: Get.width - 40,
fontColor: Colors.black54,
fontSize: 16,
gbColor: Colors.green.withOpacity(0.7),
onPressed: controller.handleSignIn,
// controller.handleSignIn,
title: "登录"),
Row(
children: [
Spacer(),
Expanded(
flex: 8,
child: Form(
child: Column(
children: [
TextFormField(
controller: controller.mobileMemberController,
keyboardType: TextInputType.emailAddress,
textInputAction: TextInputAction.next,
cursorColor: kPrimaryColor,
onSaved: (email) {},
decoration: const InputDecoration(
hintText: "输入手机号",
prefixIcon: Padding(
padding: EdgeInsets.all(defaultPadding),
child: Icon(Icons.phone_android),
),
),
),
Padding(
padding: const EdgeInsets.symmetric(
vertical: defaultPadding),
child: TextFormField(
controller: controller.codeController,
textInputAction: TextInputAction.done,
obscureText: true,
cursorColor: kPrimaryColor,
decoration: const InputDecoration(
hintText: "输入验证码",
prefixIcon: Padding(
padding: EdgeInsets.all(defaultPadding),
child: Icon(Icons.verified_sharp),
),
),
),
),
Row(
children: [
Flexible(child: Container()),
GestureDetector(
onTap: () => controller.chageCodeStatus(),
child: const Text(
"获取验证码",
style: TextStyle(
color: Colors.white54, fontSize: 12),
),
)
],
),
const SizedBox(height: defaultPadding),
Hero(
tag: "login_btn",
child: Container(
width: Get.width - 40,
height: 45,
child: ElevatedButton(
// style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Color(0xFF6F35A5))),
onPressed: () {
controller.handleSignIn();
},
child: Text(
"登录".toUpperCase(),
),
),
),
),
const SizedBox(height: defaultPadding),
],
),
),
),
Spacer(),
],
),
],
),
// SizedBox(
// height: 25,
// ),
// Center(
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: <Widget>[
// _buildInputForm(),
// // _buildLogo(),
// // _buildInputForm(),
// // Spacer(),
// // _buildThirdPartyLogin(),
// // _buildSignupButton(),
// ],
// ))
],
),
),
],
),
);
// return GestureDetector(
// 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,
// )),
// ]),
// const SizedBox(
// height: 25,
// ),
// Row(
// children: [
// const SizedBox(
// width: 35,
// ),
// const Text(
// "短信验证码登录",
// style: TextStyle(
// fontSize: 18,
// fontWeight: FontWeight.bold,
// color: Colors.white70),
// ),
// Flexible(child: Container())
// ],
// ),
// Row(
// children: [
// const SizedBox(
// width: 35,
// ),
// const Text(
// "未注册手机验证后自动登录",
// style: TextStyle(
// fontSize: 11,
// fontWeight: FontWeight.bold,
// color: Colors.white38),
// ),
// Flexible(child: Container())
// ],
// ),
// SizedBox(
// height: 65.h,
// ),
// _buildSigMobileInput(),
// const SizedBox(
// height: 25,
// ),
// _buildSigCodeInput(),
// const SizedBox(
// height: 100,
// ),
// Container(
// height: 44.h,
// margin: EdgeInsets.only(top: 15.h),
// child: btnFlatButtonWidget(
// 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(),
// // ],
// // ))
// ],
// ),
// ),
// );
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment