Pārlūkot izejas kodu

寄件添加默认运费与多线路情况下精确运费价格

daxu0403 7 gadi atpakaļ
vecāks
revīzija
b6520a5fce

+ 23 - 3
lib/pages/order_management_page/order_detail_page.dart

@@ -144,6 +144,8 @@ class _ItemInfoWidgetState extends State < ItemInfoWidget > {
   String showTextPaymentMehod = '现付';
   int goodsPaymentMethod = 1;
   BluetoothUtils bluetooth = BluetoothUtils();
+  bool checkedLine = false;
+  String stationId;
   @override
   void initState() {
     super.initState();
@@ -153,6 +155,14 @@ class _ItemInfoWidgetState extends State < ItemInfoWidget > {
       afterCollectingFee = widget.obj.goodsAgencyFund / 100;
       lineId = widget.obj.lineId.toString();
     });
+    if(afterTransportFee<=0){
+      getKey('defaultFreightPrice').then((resp){
+        afterTransportFee = int.parse(resp)/100;
+      });
+    }
+    getKey('stationId').then((resp){
+      stationId = resp;
+    });
     if (widget.obj.receiptCompanyId != null) {
       getLineOfCompanyId(widget.obj.receiptCompanyId.toString()).then((resp) {
         if (isNotError(context, resp) && this.mounted) {
@@ -179,7 +189,7 @@ class _ItemInfoWidgetState extends State < ItemInfoWidget > {
             underLine(),
             contentWiget("货物名称", widget.obj.goods),
             _inputWidget("数量", widget.obj.goodsQuantity),
-            _inputWidget("运费", widget.obj.goodsFreight / 100),
+            _inputWidget("运费", afterTransportFee),
             _inputWidget("代收", widget.obj.goodsAgencyFund / 100),
             _packageType('付款方式'),
             contentWiget(
@@ -333,7 +343,7 @@ class _ItemInfoWidgetState extends State < ItemInfoWidget > {
             return;
           }
         }
-        if (lineList.length > 1 && widget.status == '寄件') {
+        if (lineList.length > 1 && widget.status == '寄件' && !checkedLine) {
           showLineModal(lineList, orderNo);
           return;
         }
@@ -433,7 +443,17 @@ class _ItemInfoWidgetState extends State < ItemInfoWidget > {
           lineList: list,
           childCallback: (val) {
             lineId = val;
-            submitOrder(orderNo);
+            goodsNameAccurate(stationId,afterTransportFee.toString(),lineId).then((resp){
+                if(isNotError(context, resp) && this.mounted){
+                  if(resp.data['data']['goods']!=null){
+                    GoodsPriceList tempObj = GoodsPriceObjAccurate.fromJson(resp.data).data;
+                      setState(() {
+                       afterTransportFee=tempObj.price/100;
+                      });
+                  }
+                  checkedLine = true;
+                }
+              });
           },
         );
       });

+ 0 - 7
lib/pages/send_express_page.dart

@@ -1485,13 +1485,6 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
                       });
                   }
                   checkedLine = true;
-                  // showDialog <Null> (
-                  //   context: context,
-                  //   barrierDismissible: false,
-                  //   builder: (BuildContext context) {
-                  //     return MyAlertDialog(text: '线路已变更,请确认运费是否正确',childCallback:(val){});
-                  //   }
-                  // );
                 }
               });
           },