|
@@ -0,0 +1,278 @@
|
|
|
+import 'package:flutter/cupertino.dart';
|
|
|
+import 'package:flutter/material.dart';
|
|
|
+import 'package:flutter/widgets.dart';
|
|
|
+import 'package:taskservice/Common/JXColors.dart';
|
|
|
+import 'package:taskservice/Model/JXServiceModel.dart';
|
|
|
+
|
|
|
+class CreateAccPage extends StatefulWidget {
|
|
|
+ @override
|
|
|
+ _CreateAccPageState createState() => _CreateAccPageState();
|
|
|
+}
|
|
|
+
|
|
|
+class _CreateAccPageState extends State<CreateAccPage> {
|
|
|
+ List<JXServiceModel> services;
|
|
|
+
|
|
|
+ @override
|
|
|
+ void initState() {
|
|
|
+ super.initState();
|
|
|
+ services = [
|
|
|
+ JXServiceModel()
|
|
|
+ ..kind = '清洗'
|
|
|
+ ..cycle = 3
|
|
|
+ ..cycleUnit = '个月'
|
|
|
+ ..remark = '备注1',
|
|
|
+ JXServiceModel()
|
|
|
+ ..kind = '清洗2'
|
|
|
+ ..cycle = 1
|
|
|
+ ..cycleUnit = '个月'
|
|
|
+ ..remark = '备注11',
|
|
|
+ JXServiceModel()
|
|
|
+ ..kind = '清洗3'
|
|
|
+ ..cycle = 2
|
|
|
+ ..cycleUnit = '个月'
|
|
|
+ ..remark = '备注1111',
|
|
|
+ JXServiceModel()
|
|
|
+ ..kind = '清洗4'
|
|
|
+ ..cycle = 30
|
|
|
+ ..cycleUnit = '个月'
|
|
|
+ ..remark = '备注111111',
|
|
|
+ JXServiceModel()
|
|
|
+ ..kind = '清洗5'
|
|
|
+ ..cycle = 12
|
|
|
+ ..cycleUnit = '个月'
|
|
|
+ ..remark = '备注111111',
|
|
|
+ JXServiceModel()
|
|
|
+ ..kind = '清洗6'
|
|
|
+ ..cycle = 2
|
|
|
+ ..cycleUnit = '个月'
|
|
|
+ ..remark = '备注111111',
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+ @override
|
|
|
+ Widget build(BuildContext context) {
|
|
|
+ return SafeArea(
|
|
|
+ child: Scaffold(
|
|
|
+ appBar: AppBar(
|
|
|
+ centerTitle: true,
|
|
|
+ title: Text('新建会员'),
|
|
|
+ backgroundColor: JXColors.k1F2529,
|
|
|
+ ),
|
|
|
+ body: CustomScrollView(
|
|
|
+ slivers: <Widget>[
|
|
|
+ buildEditPart(),
|
|
|
+ buildItemsPart(),
|
|
|
+ SliverToBoxAdapter(
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ borderRadius: BorderRadius.circular(12),
|
|
|
+ border: Border.all(
|
|
|
+ width: 1,
|
|
|
+ )),
|
|
|
+ margin: EdgeInsets.symmetric(vertical: 12, horizontal: 80),
|
|
|
+ child: InkWell(
|
|
|
+ onTap: () => null,
|
|
|
+ child: Container(
|
|
|
+ padding: EdgeInsets.all(8),
|
|
|
+ child: Text(
|
|
|
+ '添加服务',
|
|
|
+ textAlign: TextAlign.center,
|
|
|
+ style: TextStyle(fontSize: 18),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ));
|
|
|
+ }
|
|
|
+
|
|
|
+ SliverList buildItemsPart() {
|
|
|
+ return SliverList(
|
|
|
+ delegate: SliverChildBuilderDelegate((BuildContext context, int index) {
|
|
|
+ if (index <= services.length - 1) {
|
|
|
+ var service = services[index];
|
|
|
+ return Container(
|
|
|
+ padding: EdgeInsets.all(16),
|
|
|
+ child: Column(
|
|
|
+ children: <Widget>[
|
|
|
+ Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ children: <Widget>[
|
|
|
+ Text('类型: ${service.kind}'),
|
|
|
+ Text('周期: ${service.cycle}${service.cycleUnit}'),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ Row(
|
|
|
+ children: <Widget>[
|
|
|
+ Text('备注 ${service.remark}'),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ Divider(
|
|
|
+ height: 2,
|
|
|
+ thickness: 2,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }));
|
|
|
+ }
|
|
|
+
|
|
|
+ SliverList buildEditPart() {
|
|
|
+ return SliverList(
|
|
|
+ delegate: SliverChildListDelegate([
|
|
|
+ Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ children: <Widget>[
|
|
|
+ SizedBox(
|
|
|
+ width: 20,
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ '姓名',
|
|
|
+ style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold),
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: Padding(
|
|
|
+ padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
|
+ child: TextField(),
|
|
|
+ )),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ children: <Widget>[
|
|
|
+ SizedBox(
|
|
|
+ width: 20,
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ '电话',
|
|
|
+ style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold),
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: Padding(
|
|
|
+ padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
|
+ child: TextField(),
|
|
|
+ )),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ children: <Widget>[
|
|
|
+ SizedBox(
|
|
|
+ width: 20,
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ '生日',
|
|
|
+ style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold),
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: Padding(
|
|
|
+ padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
|
+ child: TextField(),
|
|
|
+ )),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ height: 44,
|
|
|
+ child: Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ children: <Widget>[
|
|
|
+ SizedBox(
|
|
|
+ width: 20,
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ '地址',
|
|
|
+ style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold),
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: Padding(
|
|
|
+ padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
|
+ child: Container(
|
|
|
+ margin: EdgeInsets.only(bottom: 1),
|
|
|
+ child: Text('省份/城市/区域')),
|
|
|
+ )),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Divider(
|
|
|
+ height: 1,
|
|
|
+ ),
|
|
|
+ SizedBox(
|
|
|
+ height: 12,
|
|
|
+ ),
|
|
|
+ Row(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: <Widget>[
|
|
|
+ SizedBox(
|
|
|
+ width: 12,
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.only(top: 8),
|
|
|
+ width: 60,
|
|
|
+ alignment: Alignment.center,
|
|
|
+ child: Text(
|
|
|
+ '详细地址',
|
|
|
+ style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: Padding(
|
|
|
+ padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ border: Border.all(color: JXColors.kE6E6E6, width: 2),
|
|
|
+ borderRadius: BorderRadius.circular(12)),
|
|
|
+ height: 150,
|
|
|
+ child: TextField(decoration: null)),
|
|
|
+ )),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ SizedBox(
|
|
|
+ height: 12,
|
|
|
+ ),
|
|
|
+ Row(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: <Widget>[
|
|
|
+ SizedBox(
|
|
|
+ width: 12,
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.only(top: 8),
|
|
|
+ width: 60,
|
|
|
+ alignment: Alignment.center,
|
|
|
+ child: Text(
|
|
|
+ '备注',
|
|
|
+ style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: Padding(
|
|
|
+ padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ border: Border.all(color: JXColors.kE6E6E6, width: 2),
|
|
|
+ borderRadius: BorderRadius.circular(12)),
|
|
|
+ height: 150,
|
|
|
+ child: TextField(decoration: null)),
|
|
|
+ )),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ SizedBox(
|
|
|
+ height: 12,
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ padding: EdgeInsets.all(12),
|
|
|
+ decoration: BoxDecoration(color: JXColors.kE6E6E6),
|
|
|
+ child: Text(
|
|
|
+ '服务',
|
|
|
+ style: TextStyle(color: JXColors.k2E3032),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ]),
|
|
|
+ );
|
|
|
+ }
|
|
|
+}
|