소스 검색

Merge branch 'master' into 1.0.0

# Conflicts:
#	taskservice/lib/main.dart
lailin 4 년 전
부모
커밋
69d6fbf40b
3개의 변경된 파일283개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      taskservice/lib/main.dart
  2. 278 0
      taskservice/lib/src/crtacc/page_crtacc.dart
  3. 3 0
      taskservice/pubspec.yaml

+ 2 - 1
taskservice/lib/main.dart

@@ -1,6 +1,7 @@
 import 'package:flutter/material.dart';
 import 'package:taskservice/Common/JXColors.dart';
 import 'package:taskservice/Model/JXMemberModel.dart';
+import 'package:taskservice/src/crtacc/page_crtacc.dart';
 
 void main() {
   runApp(MyApp());
@@ -28,7 +29,7 @@ class MyApp extends StatelessWidget {
         // closer together (more dense) than on mobile platforms.
         visualDensity: VisualDensity.adaptivePlatformDensity,
       ),
-      home: MyHomePage(title: 'JXZS'),
+      home: CreateAccPage(),
     );
   }
 }

+ 278 - 0
taskservice/lib/src/crtacc/page_crtacc.dart

@@ -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),
+          ),
+        ),
+      ]),
+    );
+  }
+}

+ 3 - 0
taskservice/pubspec.yaml

@@ -24,6 +24,9 @@ dependencies:
   flutter:
     sdk: flutter
 
+  #数据库
+  database: ^0.3.3
+
 
   # The following adds the Cupertino Icons font to your application.
   # Use with the CupertinoIcons class for iOS style icons.