소스 검색

1.修改我的页面打印类型和连接打印机位置,2.默认到付,3.添加已接单提示

daxu0403 7 년 전
부모
커밋
173d54c452
3개의 변경된 파일28개의 추가작업 그리고 8개의 파일을 삭제
  1. 6 5
      lib/pages/my_page.dart
  2. 20 1
      lib/pages/order_taking_page.dart
  3. 2 2
      lib/pages/send_express_page.dart

+ 6 - 5
lib/pages/my_page.dart

@@ -299,8 +299,8 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
         children: < Widget > [
           _switchSite(context),
           _passWordWidget(),
-          _linkPrint(),
           _printType(),
+          _linkPrint(),
         ],
       ),
     );
@@ -424,9 +424,10 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
       height: ScreenUtil.getInstance().setHeight(90),
       color: Colors.white,
       padding: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setHeight(30), 0, 0, 0),
-      margin: EdgeInsets.only(top: ScreenUtil.getInstance().setHeight(20)),
+      margin: EdgeInsets.only(top: ScreenUtil.getInstance().setHeight(0)),
       child: Column(
         children: < Widget > [
+           _underLine(),
           Expanded(
             child: Center(
               child: Row(
@@ -443,7 +444,7 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
                             height: ScreenUtil.getInstance().setHeight(34),
                           )
                         ),
-                        Text('打印机连接', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
+                        Text('扫描打印机', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
                       ],
                     ),
                   ),
@@ -483,7 +484,6 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
               ),
             ),
           ),
-          _underLine()
         ],
       )
     );
@@ -495,6 +495,7 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
         height: ScreenUtil.getInstance().setHeight(90),
         color: Colors.white,
         padding: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setHeight(30), 0, 0, 0),
+        margin: EdgeInsets.only(top: ScreenUtil.getInstance().setHeight(20)),
         child: Column(
           children: < Widget > [
             Expanded(
@@ -523,7 +524,7 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
                         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))
                       ],
-                    )
+                    ),
                   ],
                 ),
               ),

+ 20 - 1
lib/pages/order_taking_page.dart

@@ -6,6 +6,7 @@ import '../util/models.dart';
 import '../showDialog.dart';
 import '../util/session.dart';
 import '../util/util.dart';
+import '../showAlert.dart';
 
 class OrderTakingPage extends StatefulWidget {
 
@@ -319,6 +320,8 @@ class _OrderTakingPageState extends State < OrderTakingPage > with AutomaticKeep
     });
   }
 
+
+
   void deleteOrder(val) { //确认接单后的操作
     setState(() {
       orderList.removeAt(val);
@@ -493,7 +496,12 @@ class _OrderCardContainerState extends State < OrderCardContainer > with SingleT
                       if (val) {
                         orderReception(orderNo).then((resp) {
                           if (isNotError(context, resp) && this.mounted) {
-                            widget.callback(widget.index);
+                            OrderReception obj = OrderReception.fromJson(resp.data);
+                            if(obj.success){
+                               widget.callback(widget.index);
+                            }else{
+                               showError(obj.msg);
+                            }
                           }
                         });
                       } else {
@@ -508,6 +516,17 @@ class _OrderCardContainerState extends State < OrderCardContainer > with SingleT
       )
     );
   }
+  
+  showError(String str) {
+    showDialog < Null > (
+      context: context, //BuildContext对象
+      barrierDismissible: false,
+      builder: (BuildContext context) {
+        return MyAlertDialog( //调用对话框
+          text: str, childCallback: (val) {},
+        );
+      });
+  }
 }
 
 

+ 2 - 2
lib/pages/send_express_page.dart

@@ -87,7 +87,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
   int goodsQuantity = 1; //商品数量 不能为空
   int goodsPackingId; //商品包装ID 
   int goodsCategoryId; //商品类别ID 
-  int goodsPaymentMethod = 1; //付款方式 1,现付  2 到付
+  int goodsPaymentMethod = 2; //付款方式 1,现付  2 到付
   double goodsWeight = 0.0; //商品重量 
   double goodsPriceProtection = 0.0; //商品保价
   double goodsAgencyFund = 0.0; //商品代收款
@@ -101,7 +101,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
 
   String showTextGoodsCategory = ' ';
   String showTextGoodsPackage = ' ';
-  String showTextPaymentMehod = '付';
+  String showTextPaymentMehod = '付';
   BluetoothUtils bluetooth = BluetoothUtils();
   @override
   void initState() {