增加若干基础页面
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tdesign_flutter/tdesign_flutter.dart';
|
||||
|
||||
import '../../utils/utils.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
class LoginPage extends StatelessWidget {
|
||||
@@ -9,18 +11,123 @@ class LoginPage extends StatelessWidget {
|
||||
final logic = Get.find<LoginLogic>();
|
||||
final state = Get.find<LoginLogic>().state;
|
||||
|
||||
DateTime? _lastPressedAt;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
onPopInvoked: (_) {
|
||||
logic.isExit(context);
|
||||
ToolFn().isExit();
|
||||
},
|
||||
child: const Scaffold(
|
||||
body: Center(
|
||||
child: Text("login"),
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/login/icon-no-shop-head.png",
|
||||
width: double.maxFinite,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10, right: 10, top: 50),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(left: 15),
|
||||
child: Text("手机登录",
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w400))),
|
||||
const SizedBox(height: 16.0),
|
||||
Form(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TDInput(
|
||||
maxNum: 11,
|
||||
leftLabel: '+86',
|
||||
hintText: '请输入手机号码',
|
||||
onChanged: (text) {
|
||||
logic.setPhone(text);
|
||||
},
|
||||
onClearTap: () {
|
||||
state.phone = "";
|
||||
},
|
||||
),
|
||||
TDInput(
|
||||
maxNum: 6,
|
||||
hintText: '请输入验证码',
|
||||
rightBtn: SizedBox(
|
||||
width: 100,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 16),
|
||||
child: Container(
|
||||
width: 0.5,
|
||||
height: 24,
|
||||
color: TDTheme.of(context).grayColor3,
|
||||
),
|
||||
),
|
||||
GetBuilder<LoginLogic>(
|
||||
builder: (_) {
|
||||
return state.countTime != 0
|
||||
? TDText(
|
||||
'重发(${state.countTime}秒)',
|
||||
textColor: TDTheme.of(context)
|
||||
.fontGyColor4,
|
||||
)
|
||||
: TDText("发送验证码",
|
||||
textColor: TDTheme.of(context)
|
||||
.brandNormalColor);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
needClear: false,
|
||||
onBtnTap: () {
|
||||
logic.getCode(context);
|
||||
},
|
||||
onChanged: (text) {
|
||||
logic.setSmsCode(text);
|
||||
},
|
||||
onClearTap: () {
|
||||
state.phone = "";
|
||||
},
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: TDText(
|
||||
"未注册的手机号登录成功后将自动注册",
|
||||
textColor: TDTheme.of(context).grayColor6,
|
||||
textAlign: TextAlign.start,
|
||||
style: const TextStyle(fontSize: 13),
|
||||
)),
|
||||
GetBuilder<LoginLogic>(
|
||||
builder: (_) {
|
||||
return TDButton(
|
||||
isBlock: true,
|
||||
size: TDButtonSize.large,
|
||||
theme: TDButtonTheme.primary,
|
||||
width: double.maxFinite,
|
||||
text: "立即登录",
|
||||
disabled: false,
|
||||
onTap: () {
|
||||
logic.loginFn(context);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
]),
|
||||
)
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user