Merge branch 'master' of http://test.akuhotel.com:8099/zhangmeng/aku_community_manager
# Conflicts: # lib/ui/home/home_page.darthmxc
commit
b791b9aa7a
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.3 KiB |
@ -0,0 +1,4 @@
|
|||||||
|
class UserInfoModel {
|
||||||
|
String nickName;
|
||||||
|
String avatarPath;
|
||||||
|
}
|
@ -1,10 +1,18 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
//登录状态管理
|
//登录状态管理
|
||||||
class UserProvider extends ChangeNotifier{
|
class UserProvider extends ChangeNotifier{
|
||||||
|
|
||||||
|
|
||||||
bool _isSigned=false;
|
bool _isSigned=false;
|
||||||
|
///用户是否登陆
|
||||||
get isSigned=>_isSigned;
|
get isSigned=>_isSigned;
|
||||||
|
|
||||||
|
///设置用户登陆
|
||||||
setisSigned (bool state){
|
setisSigned (bool state){
|
||||||
_isSigned=state;
|
_isSigned=state;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
|
||||||
|
import 'package:aku_community_manager/style/app_style.dart';
|
||||||
|
import 'package:aku_community_manager/tools/widget_tool.dart';
|
||||||
|
import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart';
|
||||||
|
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:aku_community_manager/tools/screen_tool.dart';
|
||||||
|
|
||||||
|
class ApplicationPage extends StatefulWidget {
|
||||||
|
ApplicationPage({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_ApplicationPageState createState() => _ApplicationPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ApplicationPageState extends State<ApplicationPage> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AkuScaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
brightness: Brightness.light,
|
||||||
|
elevation: 0,
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
leading: SizedBox(
|
||||||
|
width: 89.w,
|
||||||
|
child: AkuBackButton(),
|
||||||
|
),
|
||||||
|
titleSpacing: 0,
|
||||||
|
title: Container(
|
||||||
|
margin: EdgeInsets.only(right: 37.w),
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 32.w),
|
||||||
|
height: 72.w,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
R.ASSETS_HOME_IC_SEARCH_PNG,
|
||||||
|
height: 40.w,
|
||||||
|
width: 40.w,
|
||||||
|
),
|
||||||
|
AkuBox.w(16),
|
||||||
|
Text(
|
||||||
|
'搜索应用',
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppStyle.minorTextColor,
|
||||||
|
fontSize: 28.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xFFF9F9F9),
|
||||||
|
borderRadius: BorderRadius.circular(8.w),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
|
children: [],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,126 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:aku_community_manager/provider/user_provider.dart';
|
||||||
|
import 'package:aku_community_manager/style/app_style.dart';
|
||||||
|
import 'package:aku_community_manager/tools/widget_tool.dart';
|
||||||
|
import 'package:aku_community_manager/ui/home/home_page.dart';
|
||||||
|
import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart';
|
||||||
|
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||||
|
import 'package:aku_ui/common_widgets/aku_material_button.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:aku_community_manager/tools/screen_tool.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:pin_input_text_field/pin_input_text_field.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class LoginSMSPage extends StatefulWidget {
|
||||||
|
final String phone;
|
||||||
|
LoginSMSPage({Key key, this.phone}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_LoginSMSPageState createState() => _LoginSMSPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _LoginSMSPageState extends State<LoginSMSPage> {
|
||||||
|
TextEditingController _textEditingController = TextEditingController();
|
||||||
|
int _count = 60;
|
||||||
|
Timer _countTimer;
|
||||||
|
bool get canResend => _count <= 0;
|
||||||
|
String get countString {
|
||||||
|
if (_count <= 0)
|
||||||
|
return '';
|
||||||
|
else
|
||||||
|
return '$_count\s';
|
||||||
|
}
|
||||||
|
|
||||||
|
startTick() {
|
||||||
|
_count = 60;
|
||||||
|
_countTimer = Timer.periodic(Duration(seconds: 1), (timer) {
|
||||||
|
if (_count >= 0)
|
||||||
|
_count--;
|
||||||
|
else {
|
||||||
|
_countTimer?.cancel();
|
||||||
|
}
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
startTick();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_textEditingController?.dispose();
|
||||||
|
_countTimer?.cancel();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AkuScaffold(
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
leading: AkuBackButton(),
|
||||||
|
body: ListView(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 32.w,
|
||||||
|
vertical: 40.w,
|
||||||
|
),
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'请输入短信验证码',
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppStyle.primaryTextColor,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 48.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
AkuBox.h(16),
|
||||||
|
Text(
|
||||||
|
'已向${widget.phone}发送了一个验证码',
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppStyle.primaryTextColor,
|
||||||
|
fontSize: 24.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
AkuBox.h(160),
|
||||||
|
PinInputTextField(
|
||||||
|
controller: _textEditingController,
|
||||||
|
autoFocus: true,
|
||||||
|
decoration: UnderlineDecoration(
|
||||||
|
lineHeight: 1.w,
|
||||||
|
colorBuilder: FixedColorBuilder(Color(0xFFE8E8E8)),
|
||||||
|
),
|
||||||
|
onChanged: (text) {
|
||||||
|
final userProvider =
|
||||||
|
Provider.of<UserProvider>(context, listen: false);
|
||||||
|
if (text == '000000') {
|
||||||
|
userProvider.setisSigned(true);
|
||||||
|
Get.offAll(HomePage());
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
AkuBox.h(40),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
AkuMaterialButton(
|
||||||
|
onPressed: canResend ? () => startTick() : null,
|
||||||
|
child: Text(
|
||||||
|
'重新发送 $countString',
|
||||||
|
style: TextStyle(
|
||||||
|
color: canResend
|
||||||
|
? AppStyle.secondaryColor
|
||||||
|
: AppStyle.minorTextColor,
|
||||||
|
fontSize: 28.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue