Quellcode durchsuchen

改单添加修改付款方式

daxu0403 vor 7 Jahren
Ursprung
Commit
07d453e82d
2 geänderte Dateien mit 83 neuen und 3 gelöschten Zeilen
  1. 2 1
      lib/pages/my_page.dart
  2. 81 2
      lib/pages/order_management_page/order_detail_page.dart

+ 2 - 1
lib/pages/my_page.dart

@@ -617,7 +617,8 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
             return;
           }
         }
-        bluetooth.connectBT(btAddress);
+        bluetooth.connectBT(btAddress);//连接蓝牙
+        bluetooth.cancelDiscoveryBT();//停止扫描
          setState(() {
           btList[index].showLoadStauts = true;
         });

+ 81 - 2
lib/pages/order_management_page/order_detail_page.dart

@@ -1,5 +1,6 @@
 import 'package:flutter/material.dart';
 import 'package:flutter_screenutil/flutter_screenutil.dart';
+import 'package:flutter_picker/flutter_picker.dart';
 import '../../util/api.dart';
 import '../../util/models.dart';
 import '../../util/util.dart';
@@ -113,6 +114,8 @@ class _ItemInfoWidgetState extends State < ItemInfoWidget > {
   bool submitStatus = true;
    String lineId = '-1';
    List<CompanyOfLineList>  lineList = [];
+   String showTextPaymentMehod = '现付';
+  int goodsPaymentMethod = 1;
   @override
   void initState() {
     super.initState();
@@ -145,6 +148,7 @@ class _ItemInfoWidgetState extends State < ItemInfoWidget > {
             _inputWidget("数量", widget.obj.goodsQuantity),
             _inputWidget("运费", widget.obj.goodsFreight/100),
             _inputWidget("代收", widget.obj.goodsAgencyFund/100),
+             _packageType('付款方式'),
             contentWiget("保价", widget.obj.goodsPriceProtection.toString()),
             contentWiget("重量", widget.obj.goodsWeight.toStringAsFixed(1)),
             _descWidget(widget.obj.memo),
@@ -181,12 +185,12 @@ class _ItemInfoWidgetState extends State < ItemInfoWidget > {
                                 textAlign: TextAlign.end,
                                 style: TextStyle(
                                   fontSize: ScreenUtil.getInstance().setSp(30),
-                                  color: Color.fromRGBO(136, 136, 136, 1)
+                                  color: Colors.black
                                 ),
                                 decoration: InputDecoration(
                                   border: InputBorder.none,
                                   hintText: value.toString(),
-                                  hintStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(136, 136, 136, 1)),
+                                  hintStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Colors.black),
                                   contentPadding: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setWidth(20), 0, 0, 0),
                                 ),
                                 onChanged: (value){
@@ -268,6 +272,81 @@ class _ItemInfoWidgetState extends State < ItemInfoWidget > {
       },
     );
   }
+  showPickerModal(BuildContext context, String type) {
+    List < dynamic > data = [];
+    if (type == '付款方式') {
+        data = ['现付', '到付'];
+    }
+    new Picker(
+      adapter: PickerDataAdapter < String > (pickerdata: data),
+      height: ScreenUtil.getInstance().setHeight(450),
+      confirmText: '确定',
+      confirmTextStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(64, 98, 254, 1)),
+      cancelText: '取消',
+      cancelTextStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(153, 153, 153, 1)),
+      headercolor: Color.fromRGBO(245, 245, 245, 1),
+      itemExtent: ScreenUtil.getInstance().setHeight(80),
+      textStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(42, 42, 42, 1)),
+      changeToFirst: true,
+      hideHeader: false,
+      onConfirm: (Picker picker, List value) {
+        showTextPaymentMehod = data[value[0]];
+        if (showTextPaymentMehod == '现付') {
+          goodsPaymentMethod = 1;
+        } else {
+          goodsPaymentMethod = 2;
+        }
+      }
+    ).showModal(this.context); 
+  }
+
+   Widget _packageType(String key) {
+    return Padding(
+      padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
+      child: Column(
+        children: < Widget > [
+          InkWell(
+            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: Text(showTextPaymentMehod, textAlign: TextAlign.end, )
+                          ),
+                          Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1), )
+                        ],
+                      )
+                    )
+                  ],
+                ),
+              )
+            ),
+            onTap: () {
+              showPickerModal(context, key);
+            },
+          ),
+          Expanded(
+            flex: 0,
+            child: underLine()
+          )
+        ],
+      )
+    );
+
+  }
+
   showLineModal(List<CompanyOfLineList> list,String orderNo){
     showDialog < Null > (
       context: context, //BuildContext对象