init
This commit is contained in:
41
lib/pages/auth/agreement.dart
Normal file
41
lib/pages/auth/agreement.dart
Normal file
@@ -0,0 +1,41 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AgreementPages extends StatefulWidget {
|
||||
const AgreementPages({
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
@override
|
||||
State<AgreementPages> createState() => _AgreementPagesState();
|
||||
}
|
||||
|
||||
class _AgreementPagesState extends State<AgreementPages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('隐私协议'),
|
||||
),
|
||||
body: const UserAgreement(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// 用户协议
|
||||
class UserAgreement extends StatelessWidget {
|
||||
const UserAgreement({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Text('用户协议');
|
||||
}
|
||||
}
|
||||
|
||||
/// 隐私协议
|
||||
class PrivacyAgreement extends StatelessWidget {
|
||||
const PrivacyAgreement({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Text('隐私协议');
|
||||
}
|
||||
}
|
||||
135
lib/pages/auth/auth.dart
Normal file
135
lib/pages/auth/auth.dart
Normal file
@@ -0,0 +1,135 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../main_color.dart';
|
||||
import './agreement.dart';
|
||||
|
||||
///widget
|
||||
import './widget/auth_input.dart';
|
||||
import './widget/auth_title.dart';
|
||||
|
||||
/// 登录
|
||||
class AuthPages extends StatefulWidget {
|
||||
const AuthPages({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<AuthPages> createState() => _AuthPagesState();
|
||||
}
|
||||
|
||||
class _AuthPagesState extends State<AuthPages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
padding: const EdgeInsets.fromLTRB(30.0, 40.0, 30.0, 50.0),
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.cover,
|
||||
image: AssetImage('assets/login/auth_bg.png'),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const AuthTitle(title: '共力生态'),
|
||||
const AuthTitle(title: '即可开始你的共力人生'),
|
||||
const SizedBox(height: 40.0),
|
||||
const AuthInput(hint: '输入手机号码'),
|
||||
const SizedBox(height: 20.0),
|
||||
const AuthInput(hint: '输入验证码'),
|
||||
const SizedBox(height: 40.0),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: 50.0,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
child: ElevatedButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.all(tMainColor),
|
||||
),
|
||||
onPressed: null,
|
||||
child: const Text(
|
||||
'登录',
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text(
|
||||
'登录即表示同意',
|
||||
style: TextStyle(
|
||||
color: Color(0xffffffff),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(
|
||||
const EdgeInsets.all(0.00),
|
||||
),
|
||||
overlayColor: MaterialStateProperty.all(Colors.transparent),
|
||||
),
|
||||
child: const Text(
|
||||
'用户协议',
|
||||
style: TextStyle(
|
||||
color: tMainColor,
|
||||
),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return const AgreementPages();
|
||||
}),
|
||||
);
|
||||
},
|
||||
),
|
||||
const Text(
|
||||
'和',
|
||||
style: TextStyle(
|
||||
color: Color(0xffffffff),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(
|
||||
const EdgeInsets.all(0.00),
|
||||
),
|
||||
overlayColor: MaterialStateProperty.all(Colors.transparent),
|
||||
),
|
||||
child: const Text(
|
||||
'隐私保护',
|
||||
style: TextStyle(
|
||||
color: tMainColor,
|
||||
),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return const AgreementPages();
|
||||
}),
|
||||
);
|
||||
},
|
||||
),
|
||||
const Text(
|
||||
'协议',
|
||||
style: TextStyle(
|
||||
color: Color(0xffffffff),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
42
lib/pages/auth/role.dart
Normal file
42
lib/pages/auth/role.dart
Normal file
@@ -0,0 +1,42 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../store/store.dart';
|
||||
|
||||
class RolePages extends StatefulWidget {
|
||||
const RolePages({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<RolePages> createState() => _RolePagesState();
|
||||
}
|
||||
|
||||
class _RolePagesState extends State<RolePages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('创建角色'),
|
||||
shadowColor: Colors.transparent,
|
||||
backgroundColor: Colors.white,
|
||||
leading: const BackButton(
|
||||
color: Colors.black,
|
||||
),
|
||||
titleTextStyle: const TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 16.0,
|
||||
),
|
||||
),
|
||||
body: Center(
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return const StorePages();
|
||||
}),
|
||||
);
|
||||
},
|
||||
child: const Text('创建角色'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
49
lib/pages/auth/widget/auth_input.dart
Normal file
49
lib/pages/auth/widget/auth_input.dart
Normal file
@@ -0,0 +1,49 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// 输入框
|
||||
class AuthInput extends StatelessWidget {
|
||||
final String hint;
|
||||
final bool password;
|
||||
|
||||
const AuthInput({
|
||||
Key? key,
|
||||
this.hint = '',
|
||||
this.password = false,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
height: 50.0,
|
||||
alignment: Alignment.center,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
child: TextField(
|
||||
obscureText: password,
|
||||
style: const TextStyle(
|
||||
fontSize: 15.0,
|
||||
color: Color(0xff000000),
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
hintText: hint,
|
||||
fillColor: Colors.white,
|
||||
filled: true,
|
||||
contentPadding: const EdgeInsets.fromLTRB(20.0, 0, 20.0, 0),
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(5.0),
|
||||
),
|
||||
),
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(5.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
18
lib/pages/auth/widget/auth_title.dart
Normal file
18
lib/pages/auth/widget/auth_title.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// 文字标题
|
||||
class AuthTitle extends StatelessWidget {
|
||||
final String title;
|
||||
const AuthTitle({Key? key, this.title = ''}) : super(key: key);
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontSize: 25.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xffffffff),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
23
lib/pages/dtx/dtx.dart
Normal file
23
lib/pages/dtx/dtx.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DtxPages extends StatefulWidget {
|
||||
const DtxPages({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<DtxPages> createState() => _DtxPagesState();
|
||||
}
|
||||
|
||||
class _DtxPagesState extends State<DtxPages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('DTX积分'),
|
||||
shadowColor: Colors.transparent,
|
||||
),
|
||||
body: const Center(
|
||||
child: Text('Dtx积分'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
15
lib/pages/order/info.dart
Normal file
15
lib/pages/order/info.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class OrderInfoPages extends StatefulWidget {
|
||||
const OrderInfoPages({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<OrderInfoPages> createState() => _OrderInfoPagesState();
|
||||
}
|
||||
|
||||
class _OrderInfoPagesState extends State<OrderInfoPages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Text('订单详情');
|
||||
}
|
||||
}
|
||||
15
lib/pages/order/order.dart
Normal file
15
lib/pages/order/order.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class OrderPages extends StatefulWidget {
|
||||
const OrderPages({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<OrderPages> createState() => _OrderPagesState();
|
||||
}
|
||||
|
||||
class _OrderPagesState extends State<OrderPages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Text('订单列表');
|
||||
}
|
||||
}
|
||||
15
lib/pages/store/buy.dart
Normal file
15
lib/pages/store/buy.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class BuyPages extends StatefulWidget {
|
||||
const BuyPages({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<BuyPages> createState() => _BuyPagesState();
|
||||
}
|
||||
|
||||
class _BuyPagesState extends State<BuyPages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Text('下单购买');
|
||||
}
|
||||
}
|
||||
15
lib/pages/store/details.dart
Normal file
15
lib/pages/store/details.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class StoreDetailsPages extends StatefulWidget {
|
||||
const StoreDetailsPages({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StoreDetailsPages> createState() => _StoreDetailsPagesState();
|
||||
}
|
||||
|
||||
class _StoreDetailsPagesState extends State<StoreDetailsPages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Text('详情');
|
||||
}
|
||||
}
|
||||
15
lib/pages/store/list.dart
Normal file
15
lib/pages/store/list.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class StoreListPages extends StatefulWidget {
|
||||
const StoreListPages({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StoreListPages> createState() => _StoreListPagesState();
|
||||
}
|
||||
|
||||
class _StoreListPagesState extends State<StoreListPages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Text('商品列表');
|
||||
}
|
||||
}
|
||||
48
lib/pages/store/store.dart
Normal file
48
lib/pages/store/store.dart
Normal file
@@ -0,0 +1,48 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../auth/auth.dart';
|
||||
|
||||
import '../../https/auth_api.dart';
|
||||
|
||||
class StorePages extends StatefulWidget {
|
||||
const StorePages({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StorePages> createState() => _StorePagesState();
|
||||
}
|
||||
|
||||
class _StorePagesState extends State<StorePages> {
|
||||
@override
|
||||
void initState() {
|
||||
HttpApi().ApiPost(
|
||||
'user/auth/sms',
|
||||
body: {
|
||||
'mobileNo': '18245180131',
|
||||
'code': '0000',
|
||||
},
|
||||
);
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('DTX商城'),
|
||||
shadowColor: Colors.transparent,
|
||||
),
|
||||
body: Center(
|
||||
child: TextButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return const AuthPages();
|
||||
}),
|
||||
);
|
||||
},
|
||||
child: const Text('登录'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
83
lib/pages/tabs/tabs.dart
Normal file
83
lib/pages/tabs/tabs.dart
Normal file
@@ -0,0 +1,83 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../main_color.dart';
|
||||
|
||||
import '../store/store.dart';
|
||||
import '../dtx/dtx.dart';
|
||||
import '../user/user.dart';
|
||||
|
||||
class TabPages extends StatefulWidget {
|
||||
const TabPages({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<TabPages> createState() => _TabPagesState();
|
||||
}
|
||||
|
||||
class _TabPagesState extends State<TabPages> {
|
||||
int _currentIndex = 0;
|
||||
|
||||
final List _pages = const <Widget>[
|
||||
StorePages(),
|
||||
DtxPages(),
|
||||
UserPages(),
|
||||
];
|
||||
|
||||
Widget _currentPages = const StorePages();
|
||||
|
||||
void _onTab(index) {
|
||||
setState(() {
|
||||
_currentPages = _pages[index];
|
||||
_currentIndex = index;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: _currentPages,
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
items: [
|
||||
BottomNavigationBarItem(
|
||||
label: '首页',
|
||||
icon: Image.asset(
|
||||
'assets/tabBar/tabBar_00.png',
|
||||
width: 24.0,
|
||||
),
|
||||
activeIcon: Image.asset(
|
||||
'assets/tabBar/tabBar_show_00.png',
|
||||
width: 24.0,
|
||||
),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
label: 'DTX积分',
|
||||
icon: Image.asset(
|
||||
'assets/tabBar/tabBar_01.png',
|
||||
width: 24.0,
|
||||
),
|
||||
activeIcon: Image.asset(
|
||||
'assets/tabBar/tabBar_show_01.png',
|
||||
width: 24.0,
|
||||
),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
label: '我的',
|
||||
icon: Image.asset(
|
||||
'assets/tabBar/tabBar_02.png',
|
||||
width: 24.0,
|
||||
),
|
||||
activeIcon: Image.asset(
|
||||
'assets/tabBar/tabBar_show_02.png',
|
||||
width: 24.0,
|
||||
),
|
||||
),
|
||||
],
|
||||
currentIndex: _currentIndex,
|
||||
selectedLabelStyle: const TextStyle(
|
||||
fontSize: 10.0,
|
||||
),
|
||||
selectedItemColor: tMainColor,
|
||||
unselectedLabelStyle: const TextStyle(fontSize: 10.0),
|
||||
onTap: _onTab,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
23
lib/pages/user/user.dart
Normal file
23
lib/pages/user/user.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class UserPages extends StatefulWidget {
|
||||
const UserPages({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<UserPages> createState() => _UserPagesState();
|
||||
}
|
||||
|
||||
class _UserPagesState extends State<UserPages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('我的'),
|
||||
shadowColor: Colors.transparent,
|
||||
),
|
||||
body: const Center(
|
||||
child: Text('我的'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
15
lib/pages/vip/vip.dart
Normal file
15
lib/pages/vip/vip.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class VipPages extends StatefulWidget {
|
||||
const VipPages({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<VipPages> createState() => _VipPagesState();
|
||||
}
|
||||
|
||||
class _VipPagesState extends State<VipPages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Text('会员');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user