Przeglądaj źródła

发件接口字段

daxu0403 7 lat temu
rodzic
commit
a27992af76

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


+ 12 - 10
lib/pages/order_taking_page.dart

@@ -55,14 +55,13 @@ class _OrderTakingPageState extends State < OrderTakingPage > with AutomaticKeep
       if (_scrollController.position.pixels == _scrollController.position.maxScrollExtent) {
         print('滑动到底部了');
         if (hasNextPage) {
-          setState(() {
-            page = ++page;
-          });
+          page = ++page;
           getOrderList(stationId, lineIdStr, page).then((resp) {
-            if (resp.success && resp.code == 1) {
+            if (isNotError(context, resp)) {
+              OrderListObj tempObj =OrderListObj.fromJson(resp.data);
               setState(() {
-                orderList.addAll(resp.data.items);
-                hasNextPage = resp.data.hasNextPage;
+                orderList.addAll(tempObj.data.items);
+                hasNextPage = tempObj.data.hasNextPage;
               });
             }
           });
@@ -258,10 +257,13 @@ class _OrderTakingPageState extends State < OrderTakingPage > with AutomaticKeep
 
   Future < Null > _onRefresh() async {
     await getKey('stationId').then((value) {
-      getOrderList(value, lineIdStr, 1).then((resp) {
-        setState(() {
-          orderList = resp.data.items;
-        });
+      page = 1;
+      getOrderList(value, lineIdStr, page).then((resp) {
+        if(isNotError(context, resp)){
+          setState(() {
+            orderList = OrderListObj.fromJson(resp.data).data.items;
+          });
+        }
       });
     });
   }

+ 0 - 1
lib/pages/send_express_page.dart

@@ -32,7 +32,6 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
 
   @override
   void initState() {
-    // TODO: implement initState
     super.initState();
     _scrollController.addListener(() {
       if (!tipStatus) {

+ 68 - 1
lib/util/api.dart

@@ -1,5 +1,4 @@
 import 'request.dart';
-import 'models.dart';
 
 const int limit = 5;
 //登录接口
@@ -44,4 +43,72 @@ Future updataPasswrod(oldPassword, newPassword) async {
     'newPassword': newPassword
   });
   return response;
+}
+
+//发件(创建订单)
+Future createOrder(
+  int sendCompanyId,//寄件公司Id
+  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,//商品数量 不能为空
+  int goodsPackingId,//商品包装ID 不能为空
+  int goodsCategoryId,//商品包装类别ID 不能为空
+  int goodsPaymentMethod,//付款方式
+  double goodsWeight,//商品重量 不能为空
+  double goodsPriceProtection,//商品保价
+  double goodsAgencyFund,//商品代收款
+  String memo//备注
+) async{
+  var response = await Http().post('app/order/logistics_order_create',data:{
+    'sendCompanyId':sendCompanyId,
+    'sendCompanyName':sendCompanyName,
+    'sendCompanyPhone':sendCompanyPhone,
+    'sendCompanyCode':sendCompanyCode,
+    'sendCompanyProvinceName':sendCompanyProvinceName,
+    'sendCompanyProvinceCode':sendCompanyProvinceCode,
+    'sendCompanyCityName':sendCompanyCityName,
+    'sendCompanyCityCode':sendCompanyCityCode,
+    'sendCompanyAreaName':sendCompanyAreaName,
+    'sendCompanyAreaCode':sendCompanyAreaCode,
+    'sendCompanyAddress':sendCompanyAddress,
+    'receiptCompanyId':receiptCompanyId,
+    'receiptCompanyPhone':receiptCompanyPhone,
+    'receiptCompanyName':receiptCompanyName,
+    'receiptCompanyProvinceName':receiptCompanyProvinceName,
+    'receiptCompanyProvinceCode':receiptCompanyProvinceCode,
+    'receiptCompanyCityName':receiptCompanyCityName,
+    'receiptCompanyCityCode':receiptCompanyCityCode,
+    'receiptCompanyAreaName':receiptCompanyAreaName,
+    'receiptCompanyAreaCode':receiptCompanyAreaCode,
+    'receiptCompanyAddress':receiptCompanyAddress,
+    'goods':goods,
+    'goodsQuantity':goodsQuantity,
+    'goodsPackingId':goodsPackingId,
+    'goodsCategoryId':goodsCategoryId,
+    'goodsPaymentMethod':goodsPaymentMethod,
+    'goodsWeight':goodsWeight,
+    'goodsPriceProtection':goodsPriceProtection,
+    'goodsAgencyFund':goodsAgencyFund,
+    'memo':memo
+  });
+  return response;
 }