Sfoglia il codice sorgente

引入第三方省市区包

daxu0403 7 anni fa
parent
commit
69da3d6c75
9 ha cambiato i file con 332 aggiunte e 142 eliminazioni
  1. 1 0
      .flutter-plugins
  2. 3 1
      .packages
  3. 0 6
      lib/login_page.dart
  4. 58 58
      lib/pages/order_taking_page.dart
  5. 131 71
      lib/pages/send_express_page.dart
  6. 63 6
      lib/util/api.dart
  7. 60 0
      lib/util/models.dart
  8. 14 0
      pubspec.lock
  9. 2 0
      pubspec.yaml

+ 1 - 0
.flutter-plugins

@@ -1 +1,2 @@
+city_pickers=/Users/daxu/app/flutter/.pub-cache/hosted/pub.dartlang.org/city_pickers-0.0.4/
 shared_preferences=/Users/daxu/app/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.1+1/

+ 3 - 1
.packages

@@ -1,7 +1,8 @@
-# Generated by pub on 2019-03-03 17:29:47.895474.
+# Generated by pub on 2019-03-04 17:43:48.429447.
 async:file:///Users/daxu/app/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.0.8/lib/
 boolean_selector:file:///Users/daxu/app/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-1.0.4/lib/
 charcode:file:///Users/daxu/app/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.1.2/lib/
+city_pickers:file:///Users/daxu/app/flutter/.pub-cache/hosted/pub.dartlang.org/city_pickers-0.0.4/lib/
 collection:file:///Users/daxu/app/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.14.11/lib/
 cookie_jar:file:///Users/daxu/app/flutter/.pub-cache/hosted/pub.dartlang.org/cookie_jar-1.0.0/lib/
 cupertino_icons:file:///Users/daxu/app/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.2/lib/
@@ -9,6 +10,7 @@ dio:file:///Users/daxu/app/flutter/.pub-cache/hosted/pub.dartlang.org/dio-2.0.14
 flutter:file:///Users/daxu/app/flutter/packages/flutter/lib/
 flutter_screenutil:file:///Users/daxu/app/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_screenutil-0.5.1/lib/
 flutter_test:file:///Users/daxu/app/flutter/packages/flutter_test/lib/
+lpinyin:file:///Users/daxu/app/flutter/.pub-cache/hosted/pub.dartlang.org/lpinyin-1.0.7/lib/
 matcher:file:///Users/daxu/app/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.3+1/lib/
 meta:file:///Users/daxu/app/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.1.6/lib/
 path:file:///Users/daxu/app/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.6.2/lib/

+ 0 - 6
lib/login_page.dart

@@ -17,12 +17,6 @@ class _LoginPageState extends State < LoginPage > {
 
   String phone;
   String password;
-  @override
-  void initState() {
-    // TODO: implement initState
-    super.initState();
-    getData();
-  }
 
   @override
   Widget build(BuildContext context) {

+ 58 - 58
lib/pages/order_taking_page.dart

@@ -1,5 +1,7 @@
 import 'package:flutter/material.dart';
 import 'package:flutter_screenutil/flutter_screenutil.dart';
+import '../util/api.dart';
+import '../util/models.dart';
 
 class OrderTakingPage extends StatefulWidget {
 
@@ -12,11 +14,18 @@ class OrderTakingPage extends StatefulWidget {
 
 class _OrderTakingPageState extends State < OrderTakingPage >  with AutomaticKeepAliveClientMixin {
   
+ List listObj=[];
+
   @override
   void initState() {
     // TODO: implement initState
     super.initState();
-    print("重绘页面");
+    getOrderList().then((resp){
+      setState(() {
+        listObj = resp.orderList;
+      });
+      //print(listObj[0].id);
+    });
   }
 
   @override
@@ -58,13 +67,11 @@ class _OrderTakingPageState extends State < OrderTakingPage >  with AutomaticKee
           decoration: BoxDecoration(
             color: Color.fromRGBO(246, 246, 254, 1)
           ),
-          child: ListView(
-            children: < Widget > [
-              OrderCard(),
-              OrderCard(),
-              OrderCard(),
-               OrderCard(),
-            ],
+          child: ListView.builder(
+              itemCount: listObj.length,
+              itemBuilder: (BuildContext context,int index){
+               return OrderCard(order:listObj[index]);
+              },
           ),
         )
       ),
@@ -78,19 +85,14 @@ class _OrderTakingPageState extends State < OrderTakingPage >  with AutomaticKee
 
 
 class OrderCard extends StatefulWidget {
-  final Widget child;
-
-  OrderCard({
-    Key key,
-    this.child
-  }): super(key: key);
+  final OrderList order;
+ 
+  OrderCard({Key key,@required this.order}): super(key: key);
 
   _OrderCardState createState() => _OrderCardState();
 }
 
 class _OrderCardState extends State < OrderCard > {
-
-
   @override
   Widget build(BuildContext context) {
     return Card(
@@ -98,7 +100,7 @@ class _OrderCardState extends State < OrderCard > {
       elevation: 3.0,
       child: Column(
         children: < Widget > [
-          OrderCardContainer()
+          OrderCardContainer(order: widget.order)
         ],
       ),
     );
@@ -106,12 +108,9 @@ class _OrderCardState extends State < OrderCard > {
 }
 
 class OrderCardContainer extends StatefulWidget {
-  final Widget child;
+  final OrderList order;
 
-  OrderCardContainer({
-    Key key,
-    this.child
-  }): super(key: key);
+  OrderCardContainer({Key key, @required this.order}): super(key: key);
 
   _OrderCardContainerState createState() => _OrderCardContainerState();
 }
@@ -150,13 +149,13 @@ class _OrderCardContainerState extends State < OrderCardContainer > with SingleT
       padding: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(30), 0),
       child: Column(
         children: < Widget > [
-          orderNoRow(),
-          orderAddress(),
-          orderItem('货物名称', '汽车轮胎', 15),
-          orderItem('货物件数', '2件', 30),
+          orderNoRow(widget.order.orderNo,widget.order.createTime),
+          orderAddress(widget.order.startAddress,widget.order.endAddress),
+          orderItem('货物名称', widget.order.itemName, 15),
+          orderItem('货物件数', '${widget.order.itemNo}件', 30),
           orderCutLine(),
           orderBtn(animationStatus,controller,str),
-          AnimatedOpen(animation: animation)
+          AnimatedOpen(animation: animation,openInfo: widget.order,)
         ],
       ),
     );
@@ -215,56 +214,39 @@ Widget orderBtn(bool animationStatus,AnimationController controller,String str){
 }
 
 class AnimatedOpen extends AnimatedWidget {
+  final OrderList openInfo;
   AnimatedOpen({
     Key key,
-    Animation < double > animation
+    Animation < double > animation,
+    @required this.openInfo
   }): super(key: key, listenable: animation);
 
   Widget build(BuildContext context) {
     final Animation < double > animation = listenable;
     return Container(
       height: ScreenUtil.getInstance().setHeight(animation.value),
-      child: orderDetailInfo(),
+      child: orderDetailInfo(openInfo),
     );
   }
 }
-Widget orderNoRow() { //订单号及时间
+Widget orderNoRow(int orderNo,String createTime) { //订单号及时间
   return Container(
     margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(30)),
     child: Row(
       mainAxisAlignment: MainAxisAlignment.spaceBetween,
       children: < Widget > [
-        Text("订单号:10893477897899", style: TextStyle(color: Color.fromRGBO(153, 153, 153, 1), fontSize: ScreenUtil.getInstance().setSp(24)), ),
-        Text("2019/02/24 14:23", style: TextStyle(color: Color.fromRGBO(153, 153, 153, 1), fontSize: ScreenUtil.getInstance().setSp(24)), ),
+        Text("订单号:${orderNo}", style: TextStyle(color: Color.fromRGBO(153, 153, 153, 1), fontSize: ScreenUtil.getInstance().setSp(24)), ),
+        Text(createTime, style: TextStyle(color: Color.fromRGBO(153, 153, 153, 1), fontSize: ScreenUtil.getInstance().setSp(24)), ),
       ],
     ),
   );
 }
 
-Widget orderAddress() { //运送路线
+Widget orderAddress(String startAddress,String endAddress) { //运送路线
   return Container(
     margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
     child: Row(children: < Widget > [
-      Text('朝阳门大阳汽贸 ---> 朝阳门大阳汽贸', style: TextStyle(color: Colors.black, fontSize: ScreenUtil.getInstance().setSp(30)), ),
-    ], )
-  );
-}
-
-Widget orderItem(String key, String value, int marginBottom) {
-  return Container(
-    margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(marginBottom)),
-    child: Row(children: < Widget > [
-      Text('${key}:${value}', style: TextStyle(color: Color.fromRGBO(153, 153, 153, 1), fontSize: ScreenUtil.getInstance().setSp(24)), ),
-    ], )
-  );
-}
-
-Widget orderPhone(String key, String value, int marginBottom) {
-  return Container(
-    margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(marginBottom)),
-    child: Row(children: < Widget > [
-      Text('${key}:', style: TextStyle(color: Color.fromRGBO(153, 153, 153, 1), fontSize: ScreenUtil.getInstance().setSp(24)), ),
-      Text('${value}', style: TextStyle(color: Color.fromRGBO(64, 98, 254, 1), fontSize: ScreenUtil.getInstance().setSp(24)), ),
+      Text('${startAddress} ---> ${endAddress}', style: TextStyle(color: Colors.black, fontSize: ScreenUtil.getInstance().setSp(30)), ),
     ], )
   );
 }
@@ -278,17 +260,35 @@ Widget orderCutLine() { //分割线
 }
 
 
-Widget orderDetailInfo() {//卡片展开信息
+Widget orderDetailInfo(OrderList obj) {//卡片展开信息
   return Container(
     child: Wrap(
       children: < Widget > [
         orderCutLine(),
-        orderPhone('发件电话', '010-8788 6890', 15),
-        orderItem('发件地址', '北京市朝阳区朝阳门外大街28号', 30),
-        orderPhone('收件电话', '010-8788 6890', 15),
-        orderItem('收件地址', '河北省廊坊市香河县东大街29号院18', 30),
+        orderPhone('发件电话', obj.sendPhone, 15),
+        orderItem('发件地址', obj.sendAddress, 30),
+        orderPhone('收件电话', obj.getPhone, 15),
+        orderItem('收件地址', obj.getAddress, 30),
       ],
     )
   );
 }
 
+Widget orderItem(String key, String value, int marginBottom) {//货物名称,件数
+  return Container(
+    margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(marginBottom)),
+    child: Row(children: < Widget > [
+      Text('${key}:${value}', style: TextStyle(color: Color.fromRGBO(153, 153, 153, 1), fontSize: ScreenUtil.getInstance().setSp(24)), ),
+    ], )
+  );
+}
+
+Widget orderPhone(String key, String value, int marginBottom) {
+  return Container(
+    margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(marginBottom)),
+    child: Row(children: < Widget > [
+      Text('${key}:', style: TextStyle(color: Color.fromRGBO(153, 153, 153, 1), fontSize: ScreenUtil.getInstance().setSp(24)), ),
+      Text('${value}', style: TextStyle(color: Color.fromRGBO(64, 98, 254, 1), fontSize: ScreenUtil.getInstance().setSp(24)), ),
+    ], )
+  );
+}

+ 131 - 71
lib/pages/send_express_page.dart

@@ -1,6 +1,6 @@
 import 'package:flutter/material.dart';
 import 'package:flutter_screenutil/flutter_screenutil.dart';
-
+import 'package:city_pickers/city_pickers.dart';
 
 class SendExpressPage extends StatefulWidget {
   final Widget child;
@@ -13,44 +13,44 @@ class SendExpressPage extends StatefulWidget {
   _SendExpressPageState createState() => _SendExpressPageState();
 }
 
-class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeepAliveClientMixin{
+class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeepAliveClientMixin {
 
   @override
   bool get wantKeepAlive => true;
 
   final Map < Object,
-  String > sendInfo = {
-    "icon": 'lib/images/icon_send.png',
-    "title": "发件信息",
-    "phone": "010-8788 6890",
-    "code": "345678",
-    "name": "朝阳门大阳汽贸",
-    "address": "北京市朝阳区",
-    "addressDetail": "朝阳门外大街28号"
-  };
+    String > sendInfo = {
+      "icon": 'lib/images/icon_send.png',
+      "title": "发件信息",
+      "phone": "010-8788 6890",
+      "code": "345678",
+      "name": "朝阳门大阳汽贸",
+      "address": "",
+      "addressDetail": "朝阳门外大街28号"
+    };
 
   final Map < Object,
-  String > getInfo = {
-    "icon": 'lib/images/icon_shoujian.png',
-    "title": "收件信息",
-    "name": "香河汽修厂",
-    "phone": "010-6734 3426",
-    "address": "河北省廊坊市",
-    "addressDetail": "香河县东大街29号院18栋3单元206"
-  };
+    String > getInfo = {
+      "icon": 'lib/images/icon_shoujian.png',
+      "title": "收件信息",
+      "name": "香河汽修厂",
+      "phone": "010-6734 3426",
+      "address": "",
+      "addressDetail": "香河县东大街29号院18栋3单元206"
+    };
 
   Map < String,
-  String > _itemInfo = {
-    "icon": "lib/images/icon_huowu.png",
-    "title": "货物信息",
-    "itemName": "汽车轮胎",
-    "itemNo": "4",
-    "expressPrice": "15",
-    "collectionPrice": "15800",
-    "supportPrice": "5000",
-    "weight": "600",
-    "itemDesc": "轮胎请核对数量轮胎请"
-  };
+    String > _itemInfo = {
+      "icon": "lib/images/icon_huowu.png",
+      "title": "货物信息",
+      "itemName": "汽车轮胎",
+      "itemNo": "4",
+      "expressPrice": "15",
+      "collectionPrice": "15800",
+      "supportPrice": "5000",
+      "weight": "600",
+      "itemDesc": "轮胎请核对数量轮胎请"
+    };
   @override
   Widget build(BuildContext context) {
     return Container(
@@ -73,7 +73,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
           padding: EdgeInsets.fromLTRB(0, ScreenUtil.getInstance().setHeight(20), 0, ScreenUtil.getInstance().setHeight(20)),
           child: ListView(
             children: < Widget > [
-              _sendInfo(sendInfo),
+              _sendInfo(sendInfo,context),
               _getInfo(getInfo),
               _itemInfoWidget(_itemInfo),
               _submitBtn()
@@ -85,7 +85,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
     );
   }
 
-  Widget _sendInfo(Map str) {
+  Widget _sendInfo(Map str,BuildContext context) {
     return Container(
       color: Colors.white,
       margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
@@ -96,14 +96,14 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
           _contentWiget('电话', str['phone']),
           _contentWiget('企业编码', str['code']),
           _contentWiget('企业名称', str['name']),
-          _contentWiget('城市/区域', str['address']),
+          _cityWiget('城市/区域', str['address'],context),
           _lastContentWiget('详细地址', str['addressDetail'])
         ],
       )
     );
   }
 
-   Widget _getInfo(Map str) {
+  Widget _getInfo(Map str) {
     return Container(
       color: Colors.white,
       margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
@@ -113,14 +113,14 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
           _underLine(),
           _contentWiget('企业名称', str['name']),
           _contentWiget('电话', str['phone']),
-          _contentWiget('城市/区域', str['address']),
+          _cityWiget('城市/区域', str['address'],context),
           _lastContentWiget('详细地址', str['addressDetail'])
         ],
       )
     );
   }
 
-  Widget _itemInfoWidget(Map _itemInfo){
+  Widget _itemInfoWidget(Map _itemInfo) {
     return Container(
       child: Container(
         color: Colors.white,
@@ -194,7 +194,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
                         //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
                         SizedBox(
                           width: ScreenUtil.getInstance().setWidth(500),
-                          child:TextField(
+                          child: TextField(
                             keyboardType: TextInputType.number,
                             textAlign: TextAlign.end,
                             decoration: InputDecoration(
@@ -202,8 +202,8 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
                             ),
                           ),
                         ),
-                        
-                        Icon(Icons.keyboard_arrow_right,color:Color.fromRGBO(199,199,204,1) ,)
+
+                        Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
                       ],
                     )
                   )
@@ -220,47 +220,100 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
     );
   }
 
+  Widget _cityWiget(String key, String value,BuildContext context) {
+    return
+    GestureDetector(
+      child: Padding(
+        padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
+        child: Column(
+          children: < Widget > [
+            SizedBox(
+              height: ScreenUtil.getInstance().setHeight(89),
+              child: Center(
+                child: Row(
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: < Widget > [
+                    Expanded(
+                      flex: 0,
+                      child: Text('${key}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
+                    ),
+                    Expanded(
+                      child: Row(
+                        mainAxisAlignment: MainAxisAlignment.end,
+                        children: < Widget > [
+                          //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
+                          SizedBox(
+                            width: ScreenUtil.getInstance().setWidth(500),
+                            child: Text(value,textAlign: TextAlign.end,overflow: TextOverflow.ellipsis,)
+                          ),
+                          Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
+                        ],
+                      )
+                    )
+                  ],
+                ),
+              )
+            ),
+            Expanded(
+              flex: 0,
+              child: _underLine()
+            )
+          ],
+        )
+      ),
+      onTap: (){
+        getCity(context).then((resp){
+          setState(() {
+            this.sendInfo['address'] = resp.provinceName+' '+resp.cityName+' '+' '+resp.areaName;
+          });
+          //print(value);
+        });
+      },
+    );
+  }
+
   Widget _lastContentWiget(String key, String value) {
     return Padding(
       padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
       child: SizedBox(
-          height: ScreenUtil.getInstance().setHeight(89),
-          child: Center(
-            child: Row(
-              mainAxisAlignment: MainAxisAlignment.spaceBetween,
-              children: < Widget > [
-                Expanded(
-                    flex: 0,
-                    child: Text('${key}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
-                  ),
-                  Expanded(
-                    child: Row(
-                      mainAxisAlignment: MainAxisAlignment.end,
-                      children: < Widget > [
-                        //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
-                        SizedBox(
-                          width: ScreenUtil.getInstance().setWidth(500),
-                          child:TextField(
-                            keyboardType: TextInputType.number,
-                            textAlign: TextAlign.end,
-                            decoration: InputDecoration(
-                              border: InputBorder.none
-                            ),
-                          ),
+        height: ScreenUtil.getInstance().setHeight(89),
+        child: Center(
+          child: Row(
+            mainAxisAlignment: MainAxisAlignment.spaceBetween,
+            children: < Widget > [
+              Expanded(
+                flex: 0,
+                child: Text('${key}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
+              ),
+              Expanded(
+                child: Row(
+                  mainAxisAlignment: MainAxisAlignment.end,
+                  children: < Widget > [
+                    //Text('${value}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
+                    SizedBox(
+                      width: ScreenUtil.getInstance().setWidth(500),
+                      child: TextField(
+                        keyboardType: TextInputType.number,
+                        textAlign: TextAlign.end,
+                        decoration: InputDecoration(
+                          border: InputBorder.none
                         ),
-                        
-                        Icon(Icons.keyboard_arrow_right,color:Color.fromRGBO(199,199,204,1) ,)
-                      ],
-                    )
-                  )
-              ],
-            ),
-          )
+                      ),
+                    ),
+
+                    Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
+                  ],
+                )
+              )
+            ],
+          ),
         )
+      )
     );
   }
 
 
+
   Widget _descWidget(String str) {
     return
     Container(
@@ -294,4 +347,11 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
       },
     );
   }
-}
+ Future getCity(context) async {
+    Result result = await CityPickers.showCityPicker(
+      context: context,
+    );
+    return result;
+}
+}
+

+ 63 - 6
lib/util/api.dart

@@ -1,10 +1,67 @@
+import 'dart:convert';
 import 'request.dart';
+import 'models.dart';
 
 
 
-
-Future getData()async{
-  var response = await Http().get(
-                "query",data: {"name":"haha"});
-    print(response);
-}
+Future getOrderList()async{
+  //var response = await Http().get("query",data: {"name":"haha"});
+    var resp= {
+      "items":[
+        {
+          "id":1,
+          "orderNo":1111,
+          "createTime":"2019/02/11 14:23",
+          "startAddress":"朝阳门大阳汽贸",
+          "endAddress":"香河汽修厂",
+          "itemName":"汽车轮胎",
+          "itemNo":3,
+          "sendPhone":"010-8788 6890",
+          "sendAddress":"北京市朝阳区朝阳门外大街28号",
+          "getPhone":"010-6734 3426",
+          "getAddress":"河北省廊坊市香河县东大街29号院18栋"
+        },
+       {
+          "id":2,
+          "orderNo":2222,
+          "createTime":"2019/02/11 14:23",
+          "startAddress":"香河汽修厂",
+          "endAddress":"朝阳门大阳汽贸",
+          "itemName":"汽车零件",
+          "itemNo":99,
+          "sendPhone":"010-8788 6890",
+          "sendAddress":"河北省廊坊市香河县东大街29号院18栋",
+          "getPhone":"010-6734 3426",
+          "getAddress":"北京市朝阳区朝阳门外大街28号"
+        },
+       {
+          "id":2,
+          "orderNo":2222,
+          "createTime":"2019/02/11 14:23",
+          "startAddress":"香河汽修厂",
+          "endAddress":"朝阳门大阳汽贸",
+          "itemName":"汽车零件",
+          "itemNo":99,
+          "sendPhone":"010-8788 6890",
+          "sendAddress":"河北省廊坊市香河县东大街29号院18栋",
+          "getPhone":"010-6734 3426",
+          "getAddress":"北京市朝阳区朝阳门外大街28号"
+        },{
+          "id":2,
+          "orderNo":2222,
+          "createTime":"2019/02/11 14:23",
+          "startAddress":"香河汽修厂",
+          "endAddress":"朝阳门大阳汽贸",
+          "itemName":"汽车零件",
+          "itemNo":99,
+          "sendPhone":"010-8788 6890",
+          "sendAddress":"河北省廊坊市香河县东大街29号院18栋",
+          "getPhone":"010-6734 3426",
+          "getAddress":"北京市朝阳区朝阳门外大街28号"
+        },
+        ],
+      "hasNextPage":true
+      };
+    var orderList =OrderListObj.fromJson(resp);
+    return orderList;
+  }

+ 60 - 0
lib/util/models.dart

@@ -0,0 +1,60 @@
+class OrderListObj{
+  List<OrderList> orderList;
+  bool hasNextPage;
+
+  OrderListObj({this.hasNextPage,this.orderList});
+
+  factory OrderListObj.fromJson(Map<String,dynamic> json){
+    List list = json['items'] as List;
+    List<OrderList> tempOrderList = list.map((i)=>OrderList.fromJson(i)).toList();
+    return OrderListObj(
+      hasNextPage:json['hasNextPage'],
+      orderList: tempOrderList
+    );
+  }
+
+}
+
+class OrderList{
+  int id;
+  int orderNo;
+  String createTime;
+  String startAddress;
+  String endAddress;
+  String itemName;
+  int itemNo;
+  String sendPhone;
+  String sendAddress;
+  String getPhone;
+  String getAddress;
+
+  OrderList({
+    this.id,
+    this.orderNo,
+    this.createTime,
+    this.startAddress,
+    this.endAddress,
+    this.itemName,
+    this.itemNo,
+    this.sendPhone,
+    this.sendAddress,
+    this.getPhone,
+    this.getAddress
+    });
+
+  factory OrderList.fromJson(Map<String,dynamic> json){
+    return OrderList(
+      id:json['id'],
+      orderNo:json['orderNo'],
+      createTime:json['createTime'],
+      startAddress:json['startAddress'],
+      endAddress:json['endAddress'],
+      itemName:json['itemName'],
+      itemNo:json['itemNo'],
+      sendPhone:json['sendPhone'],
+      sendAddress: json['sendAddress'],
+      getPhone:json['getPhone'],
+      getAddress:json['getAddress']
+    );
+  }
+}

+ 14 - 0
pubspec.lock

@@ -22,6 +22,13 @@ packages:
       url: "https://pub.dartlang.org"
     source: hosted
     version: "1.1.2"
+  city_pickers:
+    dependency: "direct main"
+    description:
+      name: city_pickers
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "0.0.4"
   collection:
     dependency: transitive
     description:
@@ -67,6 +74,13 @@ packages:
     description: flutter
     source: sdk
     version: "0.0.0"
+  lpinyin:
+    dependency: transitive
+    description:
+      name: lpinyin
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "1.0.7"
   matcher:
     dependency: transitive
     description:

+ 2 - 0
pubspec.yaml

@@ -25,6 +25,8 @@ dependencies:
   flutter_screenutil: ^0.5.1
   # 本地数据存储
   shared_preferences: ^0.5.0
+  # 省市区三级联动
+  city_pickers: ^0.0.1
 
 dev_dependencies:
   flutter_test: