Преглед на файлове

我的页面添加打印类型,点击卡片进入订单详情

daxu0403 преди 7 години
родител
ревизия
41799bfddf
променени са 6 файла, в които са добавени 591 реда и са изтрити 117 реда
  1. 1 1
      README.md
  2. 2 0
      lib/login_page.dart
  3. 124 46
      lib/pages/my_page.dart
  4. 382 0
      lib/pages/order_detail/order_detail.dart
  5. 77 66
      lib/pages/order_management_page.dart
  6. 5 4
      lib/util/models.dart

+ 1 - 1
README.md

@@ -1,6 +1,6 @@
 # logistics_client
 
-物流助手
+物流助手    
 
 ## Getting Started
 

+ 2 - 0
lib/login_page.dart

@@ -117,6 +117,8 @@ class _LoginPageState extends State < LoginPage > {
                           setKey('phone',phone);
                           setKey('password',password);
                           setKey('nickName',loginObj.data.nickName);
+                          setKey('printType','1');//设置打印类型
+                          setKey('stationId', loginObj.data.stationId);//设置站点id
                           Navigator.pushReplacement(context, MaterialPageRoute(builder: (context){
                             return HomePage();
                           }));

+ 124 - 46
lib/pages/my_page.dart

@@ -28,8 +28,28 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
   List < String > stationList = [];
   Station stationObj;
   String name = '物流';
-   BluetoothUtils bluetooth =  BluetoothUtils();
-
+  BluetoothUtils bluetooth = BluetoothUtils();
+  List printTypeList = ["全部", "配件商", "修理厂", "司机", "货物", "货物外", "不打印"];
+  static
+  var printTypeMap = {
+    "全部": "1",
+    "配件商": "2",
+    "修理厂": "3",
+    "司机": "4",
+    "货物": "5",
+    "货物外": "6",
+    "不打印": "7",
+  };
+  static var printTypeMapSecond = {
+    "1":"全部",
+    "2":"配件商",
+    "3":"修理厂",
+    "4":"司机",
+    "5":"货物",
+    "6":"货物外",
+    "7":"不打印",
+  };
+  String printType = '全部';
   @override
   bool get wantKeepAlive => true;
 
@@ -39,30 +59,35 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
     getStationList().then((resp) {
       if (isNotError(context, resp)) {
         stationObj = Station.fromJson(resp.data);
-        List < String > tempList = [];
-        for (int i = 0; i < stationObj.data.length; i++) {
-          tempList.add(stationObj.data[i].name.toString());
-        }
-        getKey('nickName').then((value) {
-          setState(() {
-            stationList = tempList;
-            name = value;
-            _siteName = tempList[0];
+        getKey('stationId').then((value) {
+          List < String > tempList = [];
+          for (int i = 0; i < stationObj.data.length; i++) {
+            tempList.add(stationObj.data[i].name.toString());
+            if (stationObj.data[i].id.toString() == value) {
+              _siteName = stationObj.data[i].name.toString();
+            }
+          }
+          getKey('nickName').then((value) {
+            setState(() {
+              stationList = tempList;
+              name = value;
+            });
+          });
+          getKey('printType').then((value){
+            printType = printTypeMapSecond[value];
           });
         });
-        print(stationObj.data[0].id.toString());
-        setKey('stationId', stationObj.data[0].id.toString());
-      } 
+      }
     });
 
-    bluetooth.getEchannel().receiveBroadcastStream().listen(onEvent,onError:onError);
+    bluetooth.getEchannel().receiveBroadcastStream().listen(onEvent, onError: onError);
   }
 
-  onEvent(Object obj){
+  onEvent(Object obj) {
     print(obj.toString());
   }
 
-  onError(Object obj){
+  onError(Object obj) {
     print(obj.toString());
   }
   @override
@@ -123,6 +148,7 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
           _switchSite(context),
           _passWordWidget(),
           _linkPrint(check),
+          _printType(),
           _quitWidget(context)
         ],
       ),
@@ -186,13 +212,19 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
 
         //     );
         //   });
-        showPickerModal(context);
+        showPickerModal(context, 'station');
       },
     );
   }
-  showPickerModal(BuildContext context) {
+  showPickerModal(BuildContext context, String type) {
+    var list;
+    if (type == 'station') {
+      list = stationList;
+    } else if (type == 'printType') {
+      list = printTypeList;
+    }
     new Picker(
-      adapter: PickerDataAdapter < String > (pickerdata: stationList),
+      adapter: PickerDataAdapter < String > (pickerdata: list),
       height: ScreenUtil.getInstance().setHeight(450),
       confirmText: '确定',
       confirmTextStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(64, 98, 254, 1)),
@@ -204,10 +236,21 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
       changeToFirst: true,
       hideHeader: false,
       onConfirm: (Picker picker, List value) {
-        setState(() {
-          _siteName = stationObj.data[value[0]].name;
-        });
-        setKey('stationId', stationObj.data[value[0]].id.toString());
+        if (type == 'station') {
+          setState(() {
+            _siteName = stationObj.data[value[0]].name;
+          });
+          setKey('stationId', stationObj.data[value[0]].id.toString());
+        } else if (type == "printType") {
+          setState(() {
+            printType = printTypeList[value[0]];
+          });
+          setKey('printType', printTypeMap[printTypeList[value[0]]]);
+          getKey('printType').then((value) {
+            print(value);
+          });
+        }
+
       }
     ).showModal(this.context); //_scaffoldKey.currentState);
   }
@@ -295,32 +338,76 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
                     value: this.check,
                     activeColor: Colors.blue,
                     onChanged: (bool val) {
-                      bluetooth.isBTDevice().then((resp){
-                        if(resp){
-                           bluetooth.isEnableBluetooth().then((bool resp){
-                              this.setState(() {
-                                  this.check = resp;
-                                });
-                                bluetooth.scanBT();//
+                      bluetooth.isBTDevice().then((resp) {
+                        if (resp) {
+                          bluetooth.isEnableBluetooth().then((bool resp) {
+                            this.setState(() {
+                              this.check = resp;
                             });
+                            bluetooth.scanBT(); //
+                          });
 
                         }
                       });
-                     
-                      
-                     
-                      //print('check:${this.check}');
                     },
                   )
                 ],
               ),
             ),
-          )
+          ),
+          _underLine()
         ],
       )
     );
   }
 
+  Widget _printType() {
+    return InkWell(
+      child: Container(
+        height: ScreenUtil.getInstance().setHeight(90),
+        color: Colors.white,
+        padding: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setHeight(30), 0, 0, 0),
+        child: Column(
+          children: < Widget > [
+            Expanded(
+              child: Center(
+                child: Row(
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: < Widget > [
+                    Expanded(
+                      child: Row(
+                        mainAxisAlignment: MainAxisAlignment.start,
+                        children: < Widget > [
+                          Padding(
+                            padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(22)),
+                            child: Image.asset('lib/images/icon_dayinji.png',
+                              width: ScreenUtil.getInstance().setWidth(30),
+                              height: ScreenUtil.getInstance().setHeight(34),
+                            )
+                          ),
+                          Text('打印类型', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
+                        ],
+                      ),
+                    ),
+                    Row(
+                      mainAxisAlignment: MainAxisAlignment.end,
+                      children: < Widget > [
+                        Text(printType, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(153, 153, 153, 1)), ),
+                        Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1))
+                      ],
+                    )
+                  ],
+                ),
+              ),
+            )
+          ],
+        )
+      ),
+      onTap: () {
+        showPickerModal(context, 'printType');
+      },
+    );
+  }
   Widget _quitWidget(BuildContext context) {
     return InkWell(
       child: Container(
@@ -366,13 +453,4 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
     );
 
   }
-}
-
-
-
-// //打印机弹出层
-// class PrintDialog extends Dialog {
-//   PrintDialog({
-//     Key key,
-//   }): super(key: key);
-// }
+}

+ 382 - 0
lib/pages/order_detail/order_detail.dart

@@ -0,0 +1,382 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_screenutil/flutter_screenutil.dart';
+import '../../util/api.dart';
+import '../../util/models.dart';
+import '../../util/util.dart';
+import '../../showAlert.dart';
+class OrderDetailsPage extends StatefulWidget {
+  final String orderNo;
+
+  OrderDetailsPage({
+    Key key,
+    @required this.orderNo
+  }): super(key: key);
+
+  _OrderDetailsPageState createState() => _OrderDetailsPageState();
+}
+
+class _OrderDetailsPageState extends State < OrderDetailsPage > {
+
+  OrderDetailData orderDetailObj;
+
+  @override
+  void initState() {
+    super.initState();
+    getOrderDetail(widget.orderNo).then((resp){
+      if(isNotError(context, resp)){
+       OrderDetailObj tempObj = OrderDetailObj.fromJson(resp.data);
+       setState(() {
+         orderDetailObj =tempObj.data;
+       });
+      }
+    });
+  }
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      appBar: AppBar(
+        title: Text("订单详情", style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(36)), ),
+        centerTitle: true,
+        backgroundColor: Color.fromRGBO(64, 98, 254, 1),
+      ),
+      body: Container(
+        padding: EdgeInsets.fromLTRB(0, ScreenUtil.getInstance().setHeight(20), 0, ScreenUtil.getInstance().setHeight(20)),
+        color: Color.fromRGBO(246, 246, 254, 1),
+        child:orderDetailObj==null?Center(
+          child:_getMoreWidget(),
+        ): ListView(
+          children: < Widget > [
+            _sendInfo(),
+            _getInfo(),
+            ItemInfoWidget(obj:orderDetailObj),
+          ],
+        )
+      ),
+        
+      //resizeToAvoidBottomPadding: false //键盘弹出,页面不跟随向上滑动,防止出现溢出错误
+    );
+  }
+
+  Widget _sendInfo() {
+    return Container(
+      color: Colors.white,
+      margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
+      child: Column(
+        children: < Widget > [
+          titleWidget('lib/images/icon_send.png', '发件信息'),
+          underLine(),
+          contentWiget('电话', orderDetailObj.senderPhone),
+          contentWiget('企业编码', orderDetailObj.sendCompanyCode),
+          contentWiget('企业名称', orderDetailObj.sendCompanyName),
+          contentWiget('城市/区域', '${orderDetailObj.sendCompanyProvinceName}'+' '+'${orderDetailObj.sendCompanyCityName}'+' '+ '${orderDetailObj.sendCompanyAreaName}'),
+          lastContentWiget('详细地址', orderDetailObj.sendCompanyAddress)
+        ],
+      )
+    );
+  }
+
+  Widget _getInfo() {
+    return Container(
+      color: Colors.white,
+      margin: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
+      child: Column(
+        children: < Widget > [
+          titleWidget('lib/images/icon_shoujian.png', '收件信息'),
+          underLine(),
+          contentWiget('企业名称', orderDetailObj.receiptCompanyName),
+          contentWiget('电话', orderDetailObj.receiptCompanyPhone),
+          contentWiget('城市/区域', '${orderDetailObj.receiptCompanyProvinceName}'+' '+ '${orderDetailObj.receiptCompanyCityName}'+' '+ '${orderDetailObj.receiptCompanyAreaName}'),
+          lastContentWiget('详细地址', orderDetailObj.sendCompanyAddress)
+        ],
+      )
+    );
+  }
+}
+
+
+class ItemInfoWidget extends StatefulWidget {
+  final OrderDetailData obj;
+  ItemInfoWidget({
+    Key key,
+    @required this.obj
+  }): super(key: key);
+
+  _ItemInfoWidgetState createState() => _ItemInfoWidgetState();
+}
+
+class _ItemInfoWidgetState extends State < ItemInfoWidget > {
+
+  double afterTransportFee=0.0;//运费
+  int afterGoodsNumber=0;//数量
+  double afterCollectingFee=0.0;//代收
+  bool submitStatus = true;
+  @override
+  void initState() {
+    super.initState();
+    setState(() {
+       afterTransportFee = widget.obj.goodsFreight/100;
+       afterGoodsNumber =widget.obj.goodsQuantity;
+       afterCollectingFee =widget.obj.goodsAgencyFund/100;
+    });
+   
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Container(
+      child: Container(
+        color: Colors.white,
+        child: Column(
+          crossAxisAlignment: CrossAxisAlignment.start,
+          children: < Widget > [
+            titleWidget('lib/images/icon_huowu.png', "货物信息"),
+            underLine(),
+            contentWiget("货物名称",widget.obj.goods),
+            contentWiget("数量", (widget.obj.goodsQuantity).toString()),
+            contentWiget("运费", (widget.obj.goodsFreight/100).toString()),
+            contentWiget("代收", (widget.obj.goodsAgencyFund/100).toString()),
+            contentWiget("保价", widget.obj.goodsPriceProtection.toString()),
+            contentWiget("重量", widget.obj.goodsWeight.toStringAsFixed(1)),
+            _descWidget(widget.obj.memo),
+          ],
+        ),
+      )
+    );
+  }
+
+  Widget _inputWidget(String key, num value) {
+    return 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 > [
+                    Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
+                    Container(
+                      width: ScreenUtil.getInstance().setWidth(300),
+                      child: Row(
+                        mainAxisAlignment: MainAxisAlignment.end,
+                        children: < Widget > [
+                          Expanded(
+                            //padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(20)),
+                            //child: Text(value,style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
+                            child: Center(
+                              child: TextField(
+                                keyboardType: TextInputType.number,
+                                textAlign: TextAlign.end,
+                                style: TextStyle(
+                                  fontSize: ScreenUtil.getInstance().setSp(30),
+                                  color: Color.fromRGBO(136, 136, 136, 1)
+                                ),
+                                decoration: InputDecoration(
+                                  border: InputBorder.none,
+                                  hintText: value.toString(),
+                                  hintStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)),
+                                  contentPadding: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setWidth(20), 0, 0, 0),
+                                ),
+                                onChanged: (value){
+                                  if(key=='数量'){
+                                    afterGoodsNumber =int.parse(value);
+                                  }else if(key=='运费'){
+                                    afterTransportFee =double.parse(value);
+                                    String temp = afterTransportFee.toStringAsFixed(1);
+                                    afterTransportFee = double.parse(temp);
+                                  }else if(key=='代收'){
+                                    afterCollectingFee =double.parse(value);
+                                     String temp = afterCollectingFee.toStringAsFixed(1);
+                                     afterCollectingFee = double.parse(temp);
+                                  }
+                                },
+                              ),
+                            )
+                          ),
+                          Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
+                        ],
+                      )
+                    )
+                  ],
+                ),
+              )
+          ),
+          Expanded(
+            flex: 0,
+            child: underLine()
+          )
+        ],
+      )
+    );
+  }
+
+  Widget _descWidget(String str) {
+    return
+    Container(
+      padding: EdgeInsets.all(ScreenUtil.getInstance().setWidth(30)),
+      child: Text(str, maxLines: 100, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
+    );
+  }
+
+  Widget submitBtn(String orderNo) {
+  return GestureDetector(
+    child: Container(
+      margin: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(50), ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(40)),
+      height: ScreenUtil.getInstance().setHeight(88),
+      decoration: BoxDecoration(
+        borderRadius: BorderRadius.all(Radius.circular(4)),
+        color: Color.fromRGBO(37, 102, 242, 1),
+      ),
+      child: Center(
+       child:Row(
+          mainAxisAlignment: MainAxisAlignment.center,
+          children: <Widget>[
+              Offstage(
+                offstage: submitStatus,
+                child: SizedBox(
+                  width: ScreenUtil.getInstance().setWidth(45),
+                  height: ScreenUtil.getInstance().setHeight(45),
+                  child: Image.asset('lib/images/loading.gif'),
+                ),
+              ),
+              Text('提交', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(36), color: Colors.white)),
+          ],
+        )
+      ),
+    ),
+    onTap: () {
+      if(!submitStatus) return;
+      setState(() {
+        submitStatus = false;
+      });
+      updataOrder(orderNo,afterTransportFee,afterCollectingFee,afterGoodsNumber).then((resp){
+        if(isNotError(context, resp)){
+          showDialog < Null > (
+          context: context, //BuildContext对象
+          barrierDismissible: false,
+          builder: (BuildContext context) {
+            return MyAlertDialog( //调用对话框
+              text: '订单修改成功!', childCallback: (val) {
+                if(val){
+                  Navigator.pop(context,true);
+                }
+              },
+            );
+          });
+        }else{
+          setState(() {
+            submitStatus = true;
+          });
+        }
+      });
+    },
+  );
+}
+  
+}
+
+Widget titleWidget(String iconUrl, String str) {
+  return Container(
+    height: ScreenUtil.getInstance().setHeight(90),
+    padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
+    child: Center(
+      child: Row(
+        mainAxisAlignment: MainAxisAlignment.start,
+        children: < Widget > [
+          Padding(
+            padding: EdgeInsets.only(right: ScreenUtil.getInstance().setHeight(20)),
+            child: Image.asset(
+              iconUrl,
+              width: ScreenUtil.getInstance().setWidth(40),
+              height: ScreenUtil.getInstance().setHeight(40),
+            )
+          ),
+          Text(str, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(32)), )
+        ],
+      ),
+    ),
+  );
+}
+
+Widget underLine() {
+  return Container(
+    color: Color.fromRGBO(223, 223, 223, 1),
+    height: ScreenUtil.getInstance().setHeight(1),
+  );
+}
+
+Widget contentWiget(String key, String value) {
+  return Padding(
+    padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
+    child: Column(
+      children: < Widget > [
+        Padding(
+          padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(30)),
+          child: SizedBox(
+            height: ScreenUtil.getInstance().setHeight(89),
+            child: Center(
+              child: Row(
+                mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                children: < Widget > [
+                  Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
+                  Text(value, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
+                ],
+              ),
+            )
+          )
+        ),
+        Expanded(
+          flex: 0,
+          child: underLine()
+        )
+      ],
+    )
+  );
+}
+
+Widget lastContentWiget(String key, String value) {
+  return Padding(
+    padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
+    child:
+    Padding(
+      padding: EdgeInsets.only(right: ScreenUtil.getInstance().setWidth(30)),
+      child: SizedBox(
+        height: ScreenUtil.getInstance().setHeight(89),
+        child: Center(
+          child: Row(
+            mainAxisAlignment: MainAxisAlignment.spaceBetween,
+            children: < Widget > [
+              Text(key, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
+              Text(value, style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)), ),
+            ],
+          ),
+        )
+      )
+    ),
+  );
+}
+
+Widget _getMoreWidget() {
+    return Center(
+      child: Padding(
+        padding: EdgeInsets.all(10.0),
+        child: Row(
+          mainAxisAlignment: MainAxisAlignment.center,
+          crossAxisAlignment: CrossAxisAlignment.center,
+          children: < Widget > [
+            Text(
+              '加载中...',
+              style: TextStyle(fontSize: 16.0),
+            ),
+            Container(
+              width: ScreenUtil.getInstance().setWidth(50),
+              height: ScreenUtil.getInstance().setHeight(50),
+              child: CircularProgressIndicator()
+            )
+
+          ],
+        ),
+      ),
+    );
+  }

+ 77 - 66
lib/pages/order_management_page.dart

@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
 import 'package:flutter_screenutil/flutter_screenutil.dart';
 import 'dart:async';
 import 'order_management_page/order_detail_page.dart';
+import 'order_detail/order_detail.dart';
 import '../showDialog.dart';
 import '../util/models.dart';
 import '../util/api.dart';
@@ -277,11 +278,10 @@ class _QueryWidgetState extends State < QueryWidget > {
                   padding: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setWidth(20), ScreenUtil.getInstance().setWidth(20), ScreenUtil.getInstance().setWidth(20), 0),
                   child: orderList == null ? Center(
                     child: _getMoreWidget()
-                  ) : orderList.length == 0 ? 
-                 Center(
-                   child: Text('暂无订单'),
-                 )
-                  :
+                  ) : orderList.length == 0 ?
+                  Center(
+                    child: Text('暂无订单'),
+                  ) :
                   RefreshIndicator(
                     onRefresh: refreshOrder,
                     child: ListView.builder(
@@ -366,65 +366,76 @@ class _QueryWidgetState extends State < QueryWidget > {
       4: '已拒收',
       5: '已作废'
     };
-    return Card(
-      color: Colors.white,
-      child: Container(
-        padding: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(20)),
-        child: Column(
-          children: < Widget > [
-            Padding(
-              padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(30)),
-              child: Row(
-                mainAxisAlignment: MainAxisAlignment.spaceBetween,
-                children: < Widget > [
-                  Text('订单号:${obj.orderNo}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(102, 102, 102, 1)), ),
-                  Text('${statusMap[obj.orderStatus]}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(126, 211, 33, 1)), ),
-                ],
-              )
-            ),
-            Padding(
-              padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
-              child: Row(
-                children: < Widget > [
-                  Text('${obj.sendCompanyName} --> ${obj.receiptCompanyName}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30)), ),
-                ],
-              )
-            ),
-            Padding(
-              padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(15)),
-              child: Row(
-                children: < Widget > [
-                  SizedBox(
-                    width: ScreenUtil.getInstance().setWidth(355),
-                    child: Text('货物名称:${obj.goods}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(155, 155, 155, 1)), ),
-                  ),
-                  Text('代收款:${obj.goodsAgencyFund/100}元', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(155, 155, 155, 1)), ),
-                ],
+    return InkWell(
+      child: Card(
+        color: Colors.white,
+        child: Container(
+          padding: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(30), ScreenUtil.getInstance().setWidth(20)),
+          child: Column(
+            children: < Widget > [
+              Padding(
+                padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(30)),
+                child: Row(
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: < Widget > [
+                    Text('订单号:${obj.orderNo}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(102, 102, 102, 1)), ),
+                    Text('${statusMap[obj.orderStatus]}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(126, 211, 33, 1)), ),
+                  ],
+                )
               ),
-            ),
-            Padding(
-              padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(30)),
-              child: Row(
-                children: < Widget > [
-                  SizedBox(
-                    width: ScreenUtil.getInstance().setWidth(355),
-                    child: Text('货物件数:${obj.goodsQuantity}件', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(155, 155, 155, 1)), ),
-                  ),
-                  Text('运费:${obj.goodsFreight/100}元', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(155, 155, 155, 1)), ),
-                ],
+              Padding(
+                padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
+                child: Row(
+                  children: < Widget > [
+                    Text('${obj.sendCompanyName} --> ${obj.receiptCompanyName}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30)), ),
+                  ],
+                )
               ),
-            ),
-            Padding(
-              padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
-              child: Container(
-                height: ScreenUtil.getInstance().setHeight(1),
-                color: Color.fromRGBO(223, 223, 223, 1),
+              Padding(
+                padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(15)),
+                child: Row(
+                  children: < Widget > [
+                    SizedBox(
+                      width: ScreenUtil.getInstance().setWidth(355),
+                      child: Text('货物名称:${obj.goods}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(155, 155, 155, 1)), ),
+                    ),
+                    Text('代收款:${obj.goodsAgencyFund/100}元', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(155, 155, 155, 1)), ),
+                  ],
+                ),
               ),
-            ),
-            orderStatus == 1 ? _status1Fun(obj, index) : orderStatus == 2 ? _status2Fun(obj, index) : _status3Fun(obj, index)
-          ],
-        ),
-      )
+              Padding(
+                padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(30)),
+                child: Row(
+                  children: < Widget > [
+                    SizedBox(
+                      width: ScreenUtil.getInstance().setWidth(355),
+                      child: Text('货物件数:${obj.goodsQuantity}件', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(155, 155, 155, 1)), ),
+                    ),
+                    Text('运费:${obj.goodsFreight/100}元', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(155, 155, 155, 1)), ),
+                  ],
+                ),
+              ),
+              Padding(
+                padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(20)),
+                child: Container(
+                  height: ScreenUtil.getInstance().setHeight(1),
+                  color: Color.fromRGBO(223, 223, 223, 1),
+                ),
+              ),
+              orderStatus == 1 ? _status1Fun(obj, index) : orderStatus == 2 ? _status2Fun(obj, index) : _status3Fun(obj, index)
+            ],
+          ),
+        )
+      ),
+      onTap: () {
+        Navigator.push(
+          context,
+          MaterialPageRoute(
+            builder: (BuildContext context) {
+              return OrderDetailsPage(orderNo: obj.orderNo);
+            })
+        );
+      },
     );
   }
   Widget _status1Fun(FromStatusGetOrderList obj, int index) {
@@ -624,8 +635,8 @@ class _QueryWidgetState extends State < QueryWidget > {
                           builder: (BuildContext context) {
                             return OrderDetailPage(orderNo: obj.orderNo);
                           })
-                      ).then((resp){
-                        if(resp==true){
+                      ).then((resp) {
+                        if (resp == true) {
                           switchOrderFromStatus(orderStatus, page);
                         }
                       });
@@ -750,7 +761,7 @@ class _QueryWidgetState extends State < QueryWidget > {
       orderList = null;
     });
     page = 1;
-    fromStatusGetOrderList(orderStatus, page,_orderNo).then((resp) {
+    fromStatusGetOrderList(orderStatus, page, _orderNo).then((resp) {
       if (isNotError(context, resp)) {
         FromStatusGetOrderObj tempObj = FromStatusGetOrderObj.fromJson(resp.data);
         setState(() {
@@ -765,7 +776,7 @@ class _QueryWidgetState extends State < QueryWidget > {
       return;
     }
     loadMoreStatus = false;
-    fromStatusGetOrderList(orderStatus, page,_orderNo).then((resp) {
+    fromStatusGetOrderList(orderStatus, page, _orderNo).then((resp) {
       if (isNotError(context, resp)) {
         FromStatusGetOrderObj tempObj = FromStatusGetOrderObj.fromJson(resp.data);
         setState(() {
@@ -801,7 +812,7 @@ class _QueryWidgetState extends State < QueryWidget > {
   }
   Future refreshOrder() async {
     page = 1;
-    await fromStatusGetOrderList(orderStatus, page,_orderNo).then((resp) {
+    await fromStatusGetOrderList(orderStatus, page, _orderNo).then((resp) {
       if (isNotError(context, resp)) {
         FromStatusGetOrderObj tempObj = FromStatusGetOrderObj.fromJson(resp.data);
         setState(() {

+ 5 - 4
lib/util/models.dart

@@ -4,12 +4,11 @@ class Login {
   int code;
   String msg;
   LoginMap data;
-
   Login({
     this.success,
     this.code,
     this.msg,
-    this.data
+    this.data,
   });
 
   factory Login.fromJson(Map < String, dynamic > json) {
@@ -29,6 +28,7 @@ class LoginMap {
   String userId;
   int status;
   String token;
+  String stationId;
 
   LoginMap({
     this.userId,
@@ -36,7 +36,8 @@ class LoginMap {
     this.nickName,
     this.roleType,
     this.status,
-    this.token
+    this.token,
+    this.stationId
   });
 
   factory LoginMap.fromJson(Map < String, dynamic > json) {
@@ -47,7 +48,7 @@ class LoginMap {
       userId: json['userId'],
       status: json['status'],
       token: json['token'],
-
+      stationId:json['stationId'].toString()
     );
   }
 }