Parcourir la source

发件页跳转查看订单

daxu0403 il y a 7 ans
Parent
commit
5e68b67606

BIN
android/.gradle/4.10.2/fileHashes/fileHashes.bin


BIN
android/.gradle/4.10.2/fileHashes/fileHashes.lock


BIN
android/.gradle/4.10.2/taskHistory/taskHistory.bin


BIN
android/.gradle/4.10.2/taskHistory/taskHistory.lock


BIN
android/.gradle/buildOutputCleanup/buildOutputCleanup.lock


+ 130 - 120
lib/pages/send_express_page.dart

@@ -3,12 +3,12 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
 import 'package:city_pickers/city_pickers.dart';
 import 'package:flutter_picker/flutter_picker.dart';
 import 'dart:async';
+import 'send_express_page/order_detail_page.dart';
 import '../util/util.dart';
 import '../util/api.dart';
 import '../util/models.dart';
 import '../showAlert.dart';
 import '../send_Dialog.dart';
-
 class SendExpressPage extends StatefulWidget {
   final Widget child;
 
@@ -50,40 +50,40 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
   TextEditingController sendCompanyAddreddController = TextEditingController();
   TextEditingController receiptCompanyAddressController = TextEditingController();
 
-  List<dynamic> goodsCateGoryList = [];
-  List<dynamic> goodsPackageList = [];
+  List < dynamic > goodsCateGoryList = [];
+  List < dynamic > goodsPackageList = [];
   //请求字段-------------------------
   int sendCompanyId; //寄件公司Id
-  String sendCompanyName=''; //寄件公司名称 不能为空
-  String sendCompanyPhone=''; //寄件公司电话 不能为空
-  String sendCompanyCode=''; //寄件公司编码 
-  String sendCompanyProvinceName=''; //寄件公司省名称 不能为空
-  String sendCompanyProvinceCode=''; //寄件公司省编码 不能为空
-  String sendCompanyCityName=''; //寄件公司市名称 不能为空
-  String sendCompanyCityCode=''; //寄件公司市编码 不能为空
-  String sendCompanyAreaName=''; //寄件公司区名称 不能为空
-  String sendCompanyAreaCode=''; //寄件公司区编码 不能为空
-  String sendCompanyAddress=''; //寄件公司详细地址,不能为空
+  String sendCompanyName = ''; //寄件公司名称 不能为空
+  String sendCompanyPhone = ''; //寄件公司电话 不能为空
+  String sendCompanyCode = ''; //寄件公司编码 
+  String sendCompanyProvinceName = ''; //寄件公司省名称 不能为空
+  String sendCompanyProvinceCode = ''; //寄件公司省编码 不能为空
+  String sendCompanyCityName = ''; //寄件公司市名称 不能为空
+  String sendCompanyCityCode = ''; //寄件公司市编码 不能为空
+  String sendCompanyAreaName = ''; //寄件公司区名称 不能为空
+  String sendCompanyAreaCode = ''; //寄件公司区编码 不能为空
+  String sendCompanyAddress = ''; //寄件公司详细地址,不能为空
   int receiptCompanyId; //收件公司id
-  String receiptCompanyPhone=''; //收件公司电话 不能为空
-  String receiptCompanyName=''; //收件公司名称 不能为空
-  String receiptCompanyProvinceName=''; //收件公司省名称 不能为空
-  String receiptCompanyProvinceCode=''; //收件公司省编码 不能为空
-  String receiptCompanyCityName=''; //收件公司市名称 不能为空
-  String receiptCompanyCityCode=''; //收件公市编码 不能为空
-  String receiptCompanyAreaName=''; //收件公区名称 不能为空
-  String receiptCompanyAreaCode=''; //收件公司区编码 不能为空
-  String receiptCompanyAddress=''; //收件公司地址详情 不能为空
-  String goods=''; //商品名称 不能为空
-  int goodsQuantity=1; //商品数量 不能为空
+  String receiptCompanyPhone = ''; //收件公司电话 不能为空
+  String receiptCompanyName = ''; //收件公司名称 不能为空
+  String receiptCompanyProvinceName = ''; //收件公司省名称 不能为空
+  String receiptCompanyProvinceCode = ''; //收件公司省编码 不能为空
+  String receiptCompanyCityName = ''; //收件公司市名称 不能为空
+  String receiptCompanyCityCode = ''; //收件公市编码 不能为空
+  String receiptCompanyAreaName = ''; //收件公区名称 不能为空
+  String receiptCompanyAreaCode = ''; //收件公司区编码 不能为空
+  String receiptCompanyAddress = ''; //收件公司地址详情 不能为空
+  String goods = ''; //商品名称 不能为空
+  int goodsQuantity = 1; //商品数量 不能为空
   int goodsPackingId; //商品包装ID 
   int goodsCategoryId; //商品类别ID 
   int goodsPaymentMethod = 1; //付款方式 1,现付  2 到付
-  double goodsWeight=0.0; //商品重量 
-  double goodsPriceProtection=0.0; //商品保价
-  double goodsAgencyFund=0.0; //商品代收款
-  double goodsFreight=0.0; //商品运费 不能为空
-  String memo=''; //备注
+  double goodsWeight = 0.0; //商品重量 
+  double goodsPriceProtection = 0.0; //商品保价
+  double goodsAgencyFund = 0.0; //商品代收款
+  double goodsFreight = 0.0; //商品运费 不能为空
+  String memo = ''; //备注
 
 
   String sendPCA = ' '; //Text组件内容必须有空格,否则报null
@@ -97,8 +97,8 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
   void initState() {
     super.initState();
 
-    goodsCategory().then((resp){
-      if(isNotError(context, resp)){
+    goodsCategory().then((resp) {
+      if (isNotError(context, resp)) {
         GoodsCategory goodsCategoryObj = GoodsCategory.fromJson(resp.data);
         setState(() {
           goodsCateGoryList = goodsCategoryObj.data;
@@ -108,8 +108,8 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
       }
     });
 
-    goodsPackage().then((resp){
-      if(isNotError(context, resp)){
+    goodsPackage().then((resp) {
+      if (isNotError(context, resp)) {
         GoodsPackage goodsPackageObj = GoodsPackage.fromJson(resp.data);
         setState(() {
           goodsPackageList = goodsPackageObj.data;
@@ -204,15 +204,15 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
         }
       });
     });
-  
-    sendCompanyAddreddController.addListener((){
+
+    sendCompanyAddreddController.addListener(() {
       setState(() {
-         sendCompanyAddress =sendCompanyAddreddController.text;
+        sendCompanyAddress = sendCompanyAddreddController.text;
       });
     });
-    receiptCompanyAddressController.addListener((){
+    receiptCompanyAddressController.addListener(() {
       setState(() {
-         receiptCompanyAddress =receiptCompanyAddressController.text;
+        receiptCompanyAddress = receiptCompanyAddressController.text;
       });
     });
   }
@@ -602,7 +602,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
                     SizedBox(
                       width: ScreenUtil.getInstance().setWidth(500),
                       child: TextField(
-                        controller: type=='send'?sendCompanyAddreddController:receiptCompanyAddressController,
+                        controller: type == 'send' ? sendCompanyAddreddController : receiptCompanyAddressController,
                         textAlign: TextAlign.end,
                         decoration: InputDecoration(
                           border: InputBorder.none
@@ -650,10 +650,10 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
           color: Color.fromRGBO(37, 102, 242, 1),
         ),
         child: Center(
-          child:Row(
+          child: Row(
             mainAxisAlignment: MainAxisAlignment.center,
-            children: <Widget>[
-               Offstage(
+            children: < Widget > [
+              Offstage(
                 offstage: submitStatus,
                 child: SizedBox(
                   width: ScreenUtil.getInstance().setWidth(45),
@@ -663,17 +663,14 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
               ),
               Text("提交", style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(32), color: Colors.white), ),
             ],
-          ) 
+          )
         ),
       ),
       onTap: () {
-        // if(!submitStatus){
-        //   return;
-        // }
-        // setState(() {
-        //   submitStatus = false;
-        // });
-        String errStr ='';
+        if (!submitStatus) {
+          return;
+        }
+        String errStr = '';
         print('sendCompanyId---${sendCompanyId}');
         print('sendCompanyName---${sendCompanyName}');
         print('sendCompanyPhone---${sendCompanyPhone}');
@@ -705,52 +702,56 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
         print('goodsAgencyFund---${goodsAgencyFund}');
         print('goodsFreight---${goodsFreight}');
         print('memo---${memo}');
-        return;
+
         // if (!isChinaPhoneLegal(sendCompanyPhone)) {
-          
+
         // }
-        if(sendCompanyPhone==''){
-          errStr ='请填写发件电话';
+        if (sendCompanyPhone == '') {
+          errStr = '请填写发件电话';
         }
-        if(sendCompanyName==''){
+        if (sendCompanyName == '') {
           errStr = '请填写发件企业名称';
         }
-        if(sendCompanyProvinceName==''){
-          errStr ='请填写发件城市/区域';
+        if (sendCompanyProvinceName == '') {
+          errStr = '请填写发件城市/区域';
         }
-        if(sendCompanyAddress==''){
-          errStr ='请填写发件详细地址';
+        if (sendCompanyAddress == '') {
+          errStr = '请填写发件详细地址';
         }
-        if(receiptCompanyPhone==''){
-          errStr='请填写收件电话';
+        if (receiptCompanyPhone == '') {
+          errStr = '请填写收件电话';
         }
-        if(receiptCompanyName==''){
-          errStr='请填写收件企业名称';
+        if (receiptCompanyName == '') {
+          errStr = '请填写收件企业名称';
         }
-        if(receiptCompanyProvinceName==''){
-          errStr ='请填写收件城市/区域';
+        if (receiptCompanyProvinceName == '') {
+          errStr = '请填写收件城市/区域';
         }
-        if(receiptCompanyAddress==''){
-          errStr ='请填写收件详细地址';
+        if (receiptCompanyAddress == '') {
+          errStr = '请填写收件详细地址';
         }
-        if(goods==''){
-          errStr ='请填写货物名称';
+        if (goods == '') {
+          errStr = '请填写货物名称';
         }
-        if(goodsQuantity==0.0){
-          errStr ='请填写货物数量';
+        if (goodsQuantity == 0.0) {
+          errStr = '请填写货物数量';
         }
-        if(goodsFreight==0.0){
+        if (goodsFreight == 0.0) {
           errStr = '请填写运费';
         }
-        if(errStr!=''){
+        if (errStr != '') {
           showError(errStr);
+          return;
         }
+        setState(() {
+          submitStatus = false;
+        });
         createOrder(
-          sendCompanyId??"",//寄件公司Id
-          sendCompanyName,//寄件公司名称 不能为空
-          sendCompanyPhone,//寄件公司电话 不能为空
-          sendCompanyCode??'',//寄件公司编码 
-          sendCompanyProvinceName,//寄件公司省名称 不能为空
+          sendCompanyId ?? "", //寄件公司Id
+          sendCompanyName, //寄件公司名称 不能为空
+          sendCompanyPhone, //寄件公司电话 不能为空
+          sendCompanyCode ?? '', //寄件公司编码 
+          sendCompanyProvinceName, //寄件公司省名称 不能为空
           sendCompanyProvinceCode, //寄件公司省编码 不能为空
           sendCompanyCityName, //寄件公司市名称 不能为空
           sendCompanyCityCode, //寄件公司市编码 不能为空
@@ -758,41 +759,50 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
           sendCompanyAreaCode, //寄件公司区编码 不能为空
           sendCompanyAddress, //寄件公司详细地址,不能为空
           receiptCompanyId, //收件公司id
-          receiptCompanyPhone,//收件公司电话 不能为空
+          receiptCompanyPhone, //收件公司电话 不能为空
           receiptCompanyName, //收件公司名称 不能为空
-          receiptCompanyProvinceName,//收件公司省名称 不能为空
+          receiptCompanyProvinceName, //收件公司省名称 不能为空
           receiptCompanyProvinceCode, //收件公司省编码 不能为空
           receiptCompanyCityName, //收件公司市名称 不能为空
           receiptCompanyCityCode, //收件公市编码 不能为空
-          receiptCompanyAreaName,//收件公区名称 不能为空
+          receiptCompanyAreaName, //收件公区名称 不能为空
           receiptCompanyAreaCode, //收件公司区编码 不能为空
           receiptCompanyAddress, //收件公司地址详情 不能为空
           goods, //商品名称 不能为空
           goodsQuantity, //商品数量 不能为空
-          goodsPackingId,//商品包装ID 
+          goodsPackingId, //商品包装ID 
           goodsCategoryId, //商品类别ID 
           goodsPaymentMethod, //付款方式 1,现付  2 到付
           goodsWeight, //商品重量 
-          goodsPriceProtection*100, //商品保价,已分为单位
-          goodsAgencyFund*100, //商品代收款,已分为单位
-          goodsFreight*100,//商品运费 不能为空 ,已分为单位
-          memo,//备注
-        ).then((resp){
-          if(isNotError(context, resp)){
-             setState(() {
+          goodsPriceProtection * 100, //商品保价,已分为单位
+          goodsAgencyFund * 100, //商品代收款,已分为单位
+          goodsFreight * 100, //商品运费 不能为空 ,已分为单位
+          memo, //备注
+        ).then((resp) {
+          if (isNotError(context, resp)) {
+            setState(() {
               submitStatus = true;
             });
+            CreateOrder orderObj = CreateOrder.fromJson(resp.data);
             showDialog < Null > (
-            context: context, //BuildContext对象
-            barrierDismissible: false,
-            builder: (BuildContext context) {
-              return SendDialog( //调用对话框
-                childCallback: (val) {
-                  if(!val){
-                    //跳转
-                  }
-                },
-              );
+              context: context, //BuildContext对象
+              barrierDismissible: false,
+              builder: (BuildContext context) {
+                return SendDialog( //调用对话框
+                  orderNo: orderObj.orderNo,
+                  childCallback: (val) {
+                    if (!val) {
+                      //跳转
+                      Navigator.push(context, MaterialPageRoute(builder: (context) {
+                        return OrderDetail(orderId: orderObj.orderNo, );
+                      }));
+                    }
+                  },
+                );
+              });
+          } else {
+            setState(() {
+              submitStatus = false;
             });
           }
         });
@@ -800,7 +810,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
     );
   }
 
-  showError(String str){
+  showError(String str) {
     showDialog < Null > (
       context: context, //BuildContext对象
       barrierDismissible: false,
@@ -908,7 +918,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: Text(key=='包装类型'?showTextGoodsPackage:key=='商品类型'?showTextGoodsCategory:showTextPaymentMehod, textAlign: TextAlign.end, )
+                            child: Text(key == '包装类型' ? showTextGoodsPackage : key == '商品类型' ? showTextGoodsCategory : showTextPaymentMehod, textAlign: TextAlign.end, )
                           ),
                           Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
                         ],
@@ -933,17 +943,17 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
   }
 
   showPickerModal(BuildContext context, String type) {
-    List<dynamic> data = [];
-    if(type=='包装类型'){
-      for(int i=0;i<goodsPackageList.length;i++){
+    List < dynamic > data = [];
+    if (type == '包装类型') {
+      for (int i = 0; i < goodsPackageList.length; i++) {
         data.add(goodsPackageList[i].name);
       }
-    }else if(type=='商品类型'){
-      for(int i=0;i<goodsCateGoryList.length;i++){
+    } else if (type == '商品类型') {
+      for (int i = 0; i < goodsCateGoryList.length; i++) {
         data.add(goodsCateGoryList[i].name);
       }
-    }else if(type=='付款方式'){
-      data = ['现付','到付'];
+    } else if (type == '付款方式') {
+      data = ['现付', '到付'];
     }
     new Picker(
       adapter: PickerDataAdapter < String > (pickerdata: data),
@@ -958,21 +968,21 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
       changeToFirst: true,
       hideHeader: false,
       onConfirm: (Picker picker, List value) {
-        if(type=='包装类型'){
+        if (type == '包装类型') {
           setState(() {
-            showTextGoodsPackage =goodsPackageList[value[0]].name;
+            showTextGoodsPackage = goodsPackageList[value[0]].name;
             goodsPackingId = goodsPackageList[value[0]].id;
           });
-        }else if(type=='商品类型'){
-            showTextGoodsCategory =goodsCateGoryList[value[0]].name;
-            goodsCategoryId =goodsCateGoryList[value[0]].id;
-        }else if(type=='付款方式'){
-            showTextPaymentMehod = data[value[0]];
-            if(showTextPaymentMehod=='现付'){
-               goodsPaymentMethod = 1;
-            }else{
-              goodsPaymentMethod = 2;
-            }
+        } else if (type == '商品类型') {
+          showTextGoodsCategory = goodsCateGoryList[value[0]].name;
+          goodsCategoryId = goodsCateGoryList[value[0]].id;
+        } else if (type == '付款方式') {
+          showTextPaymentMehod = data[value[0]];
+          if (showTextPaymentMehod == '现付') {
+            goodsPaymentMethod = 1;
+          } else {
+            goodsPaymentMethod = 2;
+          }
         }
       }
     ).showModal(this.context); //_scaffoldKey.currentState);

+ 314 - 0
lib/pages/send_express_page/order_detail_page.dart

@@ -0,0 +1,314 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_screenutil/flutter_screenutil.dart';
+import '../order_management_page/order_detail_page.dart';
+import '../../showDialog.dart';
+import '../../util/api.dart';
+import '../../util/models.dart';
+import '../../util/util.dart';
+
+class OrderDetail extends StatefulWidget {
+  final String orderId;
+
+  OrderDetail({
+    Key key,
+    @required this.orderId
+  }): super(key: key);
+
+  _OrderDetailState createState() => _OrderDetailState();
+}
+
+class _OrderDetailState extends State < OrderDetail > {
+
+  OrderDetailData data;
+  @override
+  void initState() {
+    super.initState();
+    getOrderDetail(widget.orderId).then((resp) {
+      if (isNotError(context, resp)) {
+        OrderDetailObj orderDetailObj = OrderDetailObj.fromJson(resp.data);
+        setState(() {
+          data = orderDetailObj.data;
+        });
+      }
+    });
+  }
+  @override
+  Widget build(BuildContext context) {
+    return Container(
+      child: Scaffold(
+        appBar: AppBar(
+          title: Text('订单详情'),
+          centerTitle: true,
+          backgroundColor: Color.fromRGBO(64, 98, 254, 1),
+        ),
+        body: Container(
+          child: data==null?_getMoreWidget():_cardWiget()
+        ),
+      )
+    );
+  }
+
+  Widget _cardWiget() {
+    return GestureDetector(
+      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('订单号:${data.orderNo}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(102, 102, 102, 1)), ),
+                    Text("运输中", 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('${data.sendCompanyName} --> ${data.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('货物名称:${data.goods}', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(155, 155, 155, 1)), ),
+                    ),
+                    Text('代收款:${data.goodsAgencyFund/100}元', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(155, 155, 155, 1)), ),
+                  ],
+                ),
+              ),
+              Padding(
+                padding: EdgeInsets.only(bottom: ScreenUtil.getInstance().setHeight(30)),
+                child: Row(
+                  children: < Widget > [
+                    SizedBox(
+                      width: ScreenUtil.getInstance().setWidth(355),
+                      child: Text('货物件数:${data.goodsQuantity}件', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(155, 155, 155, 1)), ),
+                    ),
+                    Text('运费:${data.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),
+                ),
+              ),
+              Row(
+                mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                children: < Widget > [
+                  GestureDetector(
+                    child: Offstage(
+                      offstage: false,
+                      child: Container(
+                        width: ScreenUtil.getInstance().setWidth(94),
+                        height: ScreenUtil.getInstance().setHeight(48),
+                        decoration: BoxDecoration(
+                          color: Color.fromRGBO(239, 243, 249, 1),
+                          borderRadius: BorderRadius.all(Radius.circular(4.0))
+                        ),
+                        child: Center(
+                          child: Text('作废', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(64, 98, 254, 1))),
+                        ),
+                      ),
+                    ),
+                    onTap: () {
+                      showDialog < Null > (
+                        context: context, //BuildContext对象
+                        barrierDismissible: false,
+                        builder: (BuildContext context) {
+                          return new LoadingDialog( //调用对话框
+                            text: '是否确认作废', childCallback: (val) {
+                              if (val) {
+                                //widget.callback(widget.index);
+                              } else {
+                                return;
+                              }
+                            },
+                          );
+                        });
+                      print("作废");
+                    },
+                  ),
+                  GestureDetector(
+                    child: Offstage(
+                      offstage: false,
+                      child: Container(
+                        width: ScreenUtil.getInstance().setWidth(94),
+                        height: ScreenUtil.getInstance().setHeight(48),
+                        decoration: BoxDecoration(
+                          color: Color.fromRGBO(239, 243, 249, 1),
+                          borderRadius: BorderRadius.all(Radius.circular(4.0))
+                        ),
+                        child: Center(
+                          child: Text('拒收', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(64, 98, 254, 1))),
+                        ),
+                      ),
+                    ),
+                    onTap: () {
+                      showDialog < Null > (
+                        context: context, //BuildContext对象
+                        barrierDismissible: false,
+                        builder: (BuildContext context) {
+                          return new LoadingDialog( //调用对话框
+                            text: '是否确认拒收', childCallback: (val) {
+                              if (val) {
+                                //widget.callback(widget.index);
+                              } else {
+                                return;
+                              }
+                            },
+                          );
+                        });
+                      print("拒收");
+                    },
+                  ),
+                  GestureDetector(
+                    child: Offstage(
+                      offstage: false,
+                      child: Container(
+                        width: ScreenUtil.getInstance().setWidth(94),
+                        height: ScreenUtil.getInstance().setHeight(48),
+                        decoration: BoxDecoration(
+                          color: Color.fromRGBO(239, 243, 249, 1),
+                          borderRadius: BorderRadius.all(Radius.circular(4.0))
+                        ),
+                        child: Center(
+                          child: Text('签收', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(64, 98, 254, 1))),
+                        ),
+                      ),
+                    ),
+                    onTap: () {
+                      showDialog < Null > (
+                        context: context, //BuildContext对象
+                        barrierDismissible: false,
+                        builder: (BuildContext context) {
+                          return new LoadingDialog( //调用对话框
+                            text: '是否确认签收', childCallback: (val) {
+                              if (val) {
+                                //widget.callback(widget.index);
+                              } else {
+                                return;
+                              }
+                            },
+                          );
+                        });
+                      print("签收");
+                    },
+                  ),
+                  GestureDetector(
+                    child: Offstage(
+                      offstage: false,
+                      child: Container(
+                        width: ScreenUtil.getInstance().setWidth(94),
+                        height: ScreenUtil.getInstance().setHeight(48),
+                        decoration: BoxDecoration(
+                          color: Color.fromRGBO(239, 243, 249, 1),
+                          borderRadius: BorderRadius.all(Radius.circular(4.0))
+                        ),
+                        child: Center(
+                          child: Text('改单', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(64, 98, 254, 1))),
+                        ),
+                      ),
+                    ),
+                    onTap: () {
+                      showDialog < Null > (
+                        context: context, //BuildContext对象
+                        barrierDismissible: false,
+                        builder: (BuildContext context) {
+                          return new LoadingDialog( //调用对话框
+                            text: '是否确认改单', childCallback: (val) {
+                              if (val) {
+                                print(val);
+                                Navigator.push(context, MaterialPageRoute(builder: (context) {
+                                  return OrderDetailPage(orderId: 123456, );
+                                }));
+                              } else {
+                                return;
+                              }
+                            },
+                          );
+                        });
+                      print("改单");
+                    },
+                  ),
+                  GestureDetector(
+                    child: Offstage(
+                      offstage: false,
+                      child: Container(
+                        width: ScreenUtil.getInstance().setWidth(94),
+                        height: ScreenUtil.getInstance().setHeight(48),
+                        decoration: BoxDecoration(
+                          color: Color.fromRGBO(239, 243, 249, 1),
+                          borderRadius: BorderRadius.all(Radius.circular(4.0))
+                        ),
+                        child: Center(
+                          child: Text('打印', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(24), color: Color.fromRGBO(64, 98, 254, 1))),
+                        ),
+                      ),
+                    ),
+                    onTap: () {
+                      showDialog < Null > (
+                        context: context, //BuildContext对象
+                        barrierDismissible: false,
+                        builder: (BuildContext context) {
+                          return new LoadingDialog( //调用对话框
+                            text: '是否确认打印', childCallback: (val) {
+                              if (val) {
+                                //widget.callback(widget.index);
+                              } else {
+                                return;
+                              }
+                            },
+                          );
+                        });
+                      print("打印");
+                    },
+                  ),
+                ],
+              )
+            ],
+          ),
+        )
+      ),
+      onTap: () {
+
+      },
+    );
+  }
+
+  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()
+            )
+
+          ],
+        ),
+      ),
+    );
+  }
+}

+ 4 - 2
lib/send_dialog.dart

@@ -1,11 +1,13 @@
 import 'package:flutter/material.dart';
 import 'package:flutter_screenutil/flutter_screenutil.dart';
 // ignore: must_be_immutable
-class SendDialog extends Dialog {
+class SendDialog extends Dialog{
+  final orderNo;
   final childCallback;
 
   SendDialog({
     Key key,
+    @required this.orderNo,
     @required this.childCallback
   }): super(key: key);
 
@@ -38,7 +40,7 @@ class SendDialog extends Dialog {
                           ), ),
                           Padding(
                             padding: EdgeInsets.only(top: 10),
-                            child:Text('订单号:123456789123456', style: TextStyle(
+                            child:Text('订单号:${orderNo}', style: TextStyle(
                             fontSize: ScreenUtil.getInstance().setSp(28),
                             color: Colors.grey
                           ), )

+ 6 - 0
lib/util/api.dart

@@ -130,4 +130,10 @@ Future goodsCategory(){
 Future goodsPackage(){
   var response =Http().get('app/goods_packing/goods_packing_list');
   return response;
+}
+
+//订单详情
+Future getOrderDetail(orderNo){
+  var response =Http().get('app/order/order_info',data: {'orderNo':orderNo});
+  return response;
 }

+ 2 - 1
lib/util/config.dart

@@ -1,5 +1,6 @@
 class Config{
-  String baseUrl = "https://logistics.5fire.tech/";
+  //String baseUrl = "https://logistics.5fire.tech/";
+  String baseUrl='http://192.168.100.9:8866/';
   int connectTimeout = 30000;
   int receiveTimeout = 30000;
 }

+ 197 - 51
lib/util/models.dart

@@ -268,11 +268,11 @@ class UpdataPasswrod {
 }
 
 //手机号模糊匹配
-class LikePhone{
+class LikePhone {
   bool success;
   int code;
   String msg;
-  List<LikePhoneList> data;
+  List < LikePhoneList > data;
 
   LikePhone({
     this.success,
@@ -280,19 +280,19 @@ class LikePhone{
     this.msg,
     this.data
   });
-  
-  factory LikePhone.fromJson(Map<String,dynamic> json){
-     List list = json['data'] as List;
-     List<LikePhoneList> tempList = list.map((i) => LikePhoneList.fromJson(i)).toList();
-     return LikePhone(
-       success: json['success'],
-       code: json['code'],
-       msg:json['msg'],
-       data:tempList
-     );
+
+  factory LikePhone.fromJson(Map < String, dynamic > json) {
+    List list = json['data'] as List;
+    List < LikePhoneList > tempList = list.map((i) => LikePhoneList.fromJson(i)).toList();
+    return LikePhone(
+      success: json['success'],
+      code: json['code'],
+      msg: json['msg'],
+      data: tempList
+    );
   }
 }
-class LikePhoneList{
+class LikePhoneList {
   String address;
   String areaCode;
   String areaName;
@@ -321,30 +321,30 @@ class LikePhoneList{
     this.uzerPhone
   });
 
-  factory LikePhoneList.fromJson(Map<String,dynamic> json){
+  factory LikePhoneList.fromJson(Map < String, dynamic > json) {
     return LikePhoneList(
-      address:json['address'],
-      areaCode:json['areaCode'],
-      areaName:json['areaName'],
-      cityCode:json['cityCode'],
-      cityName:json['cityName'],
-      companyCode:json['companyCode'],
-      companyName:json['companyName'],
-      companyPhone:json['companyPhone'],
-      id:json['id'],
-      provinceCode:json['provinceCode'],
-      provinceName:json['provinceName'],
-      uzerPhone:json['uzerPhone']
+      address: json['address'],
+      areaCode: json['areaCode'],
+      areaName: json['areaName'],
+      cityCode: json['cityCode'],
+      cityName: json['cityName'],
+      companyCode: json['companyCode'],
+      companyName: json['companyName'],
+      companyPhone: json['companyPhone'],
+      id: json['id'],
+      provinceCode: json['provinceCode'],
+      provinceName: json['provinceName'],
+      uzerPhone: json['uzerPhone']
     );
   }
 }
 
 //商品类别列表
-class GoodsCategory{
+class GoodsCategory {
   bool success;
   int code;
   String msg;
-  List<GoodCategoryList> data;
+  List < GoodCategoryList > data;
 
   GoodsCategory({
     this.success,
@@ -353,18 +353,18 @@ class GoodsCategory{
     this.data
   });
 
-  factory GoodsCategory.fromJson(Map<String,dynamic> json){
+  factory GoodsCategory.fromJson(Map < String, dynamic > json) {
     List list = json['data'] as List;
-    List<GoodCategoryList> tempList = list.map((i) => GoodCategoryList.fromJson(i)).toList();
+    List < GoodCategoryList > tempList = list.map((i) => GoodCategoryList.fromJson(i)).toList();
     return GoodsCategory(
       success: json['success'],
-      code:json['code'],
-      msg:json['msg'],
-      data:tempList
+      code: json['code'],
+      msg: json['msg'],
+      data: tempList
     );
   }
 }
-class GoodCategoryList{
+class GoodCategoryList {
   int id;
   String name;
 
@@ -373,20 +373,20 @@ class GoodCategoryList{
     this.name
   });
 
-  factory GoodCategoryList.fromJson(Map<String,dynamic> json){
+  factory GoodCategoryList.fromJson(Map < String, dynamic > json) {
     return GoodCategoryList(
-      id:json['id'],
-      name:json['name']
+      id: json['id'],
+      name: json['name']
     );
   }
 }
 
 //商品包装类别列表
-class GoodsPackage{
+class GoodsPackage {
   bool success;
   int code;
   String msg;
-  List<GoodsPackageList> data;
+  List < GoodsPackageList > data;
 
   GoodsPackage({
     this.success,
@@ -395,18 +395,18 @@ class GoodsPackage{
     this.data
   });
 
-  factory GoodsPackage.fromJson(Map<String,dynamic> json){
+  factory GoodsPackage.fromJson(Map < String, dynamic > json) {
     List list = json['data'] as List;
-     List<GoodsPackageList> tempList = list.map((i) => GoodsPackageList.fromJson(i)).toList();
+    List < GoodsPackageList > tempList = list.map((i) => GoodsPackageList.fromJson(i)).toList();
     return GoodsPackage(
       success: json['success'],
-      code:json['code'],
-      msg:json['msg'],
-      data:tempList
+      code: json['code'],
+      msg: json['msg'],
+      data: tempList
     );
   }
 }
-class GoodsPackageList{
+class GoodsPackageList {
   int id;
   String name;
 
@@ -415,31 +415,177 @@ class GoodsPackageList{
     this.name
   });
 
-  factory GoodsPackageList.fromJson(Map<String,dynamic> json){
+  factory GoodsPackageList.fromJson(Map < String, dynamic > json) {
     return GoodsPackageList(
-      id:json['id'],
+      id: json['id'],
       name: json['name']
     );
   }
 }
 
 //创建订单
-class CreateOrder{
+class CreateOrder {
   bool success;
   int code;
   String msg;
+  String orderNo;
 
   CreateOrder({
     this.success,
     this.code,
-    this.msg
+    this.msg,
+    this.orderNo
   });
 
-  factory CreateOrder.fromJson(Map<String,dynamic> json){
+  factory CreateOrder.fromJson(Map < String, dynamic > json) {
     return CreateOrder(
       success: json['success'],
       code: json['code'],
-      msg:json['msg']
+      msg: json['msg'],
+      orderNo: json['data']['orderNo']
+    );
+  }
+}
+
+//订单详情
+class OrderDetailObj {
+  bool success;
+  int code;
+  String msg;
+  OrderDetailData data;
+
+  OrderDetailObj({
+    this.success,
+    this.code,
+    this.msg,
+    this.data,
+  });
+
+  factory OrderDetailObj.fromJson(Map < String, dynamic > json) {
+    OrderDetailData tempData = OrderDetailData.fromJson(json['data']);
+    return OrderDetailObj(
+      success:json['success'],
+      code:json['code'],
+      msg:json['msg'],
+      data:tempData
+    );
+  }
+}
+class OrderDetailData {
+  String orderNo;
+  String goods; //商品名称
+  double goodsAgencyFund; //代收款
+  double goodsFlatCost; //工本费
+  double goodsFreight; //运费
+  double goodsInsurance; //商品保险费
+  double goodsOtherFees; //其他费用
+  double goodsPriceProtection; //商品保价
+  int goodsQuantity; //商品数量
+  double goodsValue; //商品价值
+  double goodsWeight; //商品重量
+  int id; //订单Id
+  String memo; //备注
+  int orderStatus; //订单状态 0:代收单,1:已接单,2:配送中,3:已签收,4:拒收
+  String receiptCompanyAddress; //收件详细地址
+  String receiptCompanyAreaCode; //收件区码
+  String receiptCompanyAreaName; //收件区名
+  String receiptCompanyBankCard; //收件银行卡号
+  String receiptCompanyCityCode; //收件市码
+  String receiptCompanyCityName; //收件市名
+  String receiptCompanyName; //收件公司名称
+  String receiptCompanyProvinceCode; //收件省码
+  String receiptCompanyProvinceName; //收件省名
+  String sendCompanyAddress; //发件详细地址
+  String sendCompanyAreaCode; //发件区码
+  String sendCompanyAreaName; //发件区名
+  String sendCompanyBankCard; //发件银行卡号
+  String sendCompanyCityCode; //发件市码
+  String sendCompanyCityName; //发件市名
+  int sendCompanyId; //发件公司id
+  String sendCompanyName; //发件公司名称
+  String sendCompanyProvinceCode; //发件公司市码
+  String sendCompanyProvinceName; //发件公司市名
+  String senderIdCard; //发件人身份证号
+  String senderName; //发件人名称
+  String senderPhone; //发件人电话
+
+  OrderDetailData({
+    this.orderNo,
+    this.goods,
+    this.goodsAgencyFund,
+    this.goodsFlatCost,
+    this.goodsFreight,
+    this.goodsInsurance,
+    this.goodsOtherFees,
+    this.goodsPriceProtection,
+    this.goodsQuantity,
+    this.goodsValue,
+    this.goodsWeight,
+    this.id,
+    this.memo,
+    this.orderStatus,
+    this.receiptCompanyAddress,
+    this.receiptCompanyAreaCode,
+    this.receiptCompanyAreaName,
+    this.receiptCompanyBankCard,
+    this.receiptCompanyCityCode,
+    this.receiptCompanyCityName,
+    this.receiptCompanyName,
+    this.receiptCompanyProvinceCode,
+    this.receiptCompanyProvinceName,
+    this.sendCompanyAddress,
+    this.sendCompanyAreaCode,
+    this.sendCompanyAreaName,
+    this.sendCompanyBankCard, 
+    this.sendCompanyCityCode,
+    this.sendCompanyCityName,
+    this.sendCompanyId, 
+    this.sendCompanyName, 
+    this.sendCompanyProvinceCode, 
+    this.sendCompanyProvinceName, 
+    this.senderIdCard, 
+    this.senderName, 
+    this.senderPhone 
+  });
+
+  factory OrderDetailData.fromJson(Map < String, dynamic > json) {
+    return OrderDetailData(
+      orderNo: json['orderNo'],
+      goods: json['goods'],
+      goodsAgencyFund: json['goodsAgencyFund'],
+      goodsFlatCost: json['goodsFlatCost'],
+      goodsFreight: json['goodsFreight'],
+      goodsInsurance: json['goodsInsurance'],
+      goodsOtherFees: json['goodsOtherFees'],
+      goodsPriceProtection: json['goodsPriceProtection'],
+      goodsQuantity: json['goodsQuantity'],
+      goodsValue: json['goodsValue'],
+      goodsWeight: json['goodsWeight'],
+      id: json['id'],
+      memo: json['memo'],
+      orderStatus: json['orderStatus'],
+      receiptCompanyAddress: json['receiptCompanyAddress'],
+      receiptCompanyAreaCode: json['receiptCompanyAreaCode'],
+      receiptCompanyAreaName: json['receiptCompanyAreaName'],
+      receiptCompanyBankCard: json['receiptCompanyBankCard'],
+      receiptCompanyCityCode: json['receiptCompanyCityCode'],
+      receiptCompanyCityName: json['receiptCompanyCityName'],
+      receiptCompanyName: json['receiptCompanyName'],
+      receiptCompanyProvinceCode: json['receiptCompanyProvinceCode'],
+      receiptCompanyProvinceName: json['receiptCompanyProvinceName'],
+      sendCompanyAddress: json['sendCompanyAddress'],
+      sendCompanyAreaCode: json['sendCompanyAreaCode'],
+      sendCompanyAreaName: json['sendCompanyAreaName'],
+      sendCompanyBankCard: json['sendCompanyBankCard'],
+      sendCompanyCityCode: json['sendCompanyCityCode'],
+      sendCompanyCityName: json['sendCompanyCityName '],
+      sendCompanyId: json['sendCompanyId'],
+      sendCompanyName: json['sendCompanyName'],
+      sendCompanyProvinceCode: json['sendCompanyProvinceCode'],
+      sendCompanyProvinceName: json['sendCompanyProvinceName'],
+      senderIdCard: json['senderIdCard'],
+      senderName: json['senderName'],
+      senderPhone: json['senderPhone']
     );
   }
 }