Browse Source

amend manage order and update schema

Csy817 6 years ago
parent
commit
b3eb4c5515

+ 54 - 60
ec_enhance.txt

@@ -48,11 +48,13 @@ query specificationStockbyid($id: ID) {
             unit
             name
             createdAt
+            slideImg
             status
             id
             intro
             discountRate
             price
+            detailImg
 
             img
             stock
@@ -122,11 +124,13 @@ query userCartbyid($id: ID) {
             unit
             name
             createdAt
+            slideImg
             status
             id
             intro
             discountRate
             price
+            detailImg
 
             img
             stock
@@ -213,11 +217,13 @@ query userCollectbyprops($updatedAt: String, $where: userCollect_filter, $sort_b
             unit
             name
             createdAt
+            slideImg
             status
             id
             intro
             discountRate
             price
+            detailImg
 
             img
             stock
@@ -234,11 +240,13 @@ query productbyprops($recommend: Int, $updatedAt: String, $where: product_filter
         unit
         name
         createdAt
+        slideImg
         status
         id
         intro
         discountRate
         price
+        detailImg
         category_id {
             id
             name
@@ -259,6 +267,7 @@ query orderLogisticsbyid($id: ID) {
         serviceStore
         updatedAt
         logisticsFee
+        expressDetailName
         expressId
         createdAt
         order_id {
@@ -268,7 +277,6 @@ query orderLogisticsbyid($id: ID) {
             orderTotalPay
             createdAt
             orderStatus
-
             id
             count
 
@@ -307,11 +315,13 @@ query specificationStockbyprops($updatedAt: String, $where: specificationStock_f
             unit
             name
             createdAt
+            slideImg
             status
             id
             intro
             discountRate
             price
+            detailImg
 
             img
             stock
@@ -337,11 +347,13 @@ query orderProductbyid($id: ID) {
             unit
             name
             createdAt
+            slideImg
             status
             id
             intro
             discountRate
             price
+            detailImg
 
             img
             stock
@@ -370,7 +382,6 @@ query orderProductbyid($id: ID) {
             orderTotalPay
             createdAt
             orderStatus
-
             id
             count
 
@@ -424,11 +435,13 @@ query userCollectbyid($id: ID) {
             unit
             name
             createdAt
+            slideImg
             status
             id
             intro
             discountRate
             price
+            detailImg
 
             img
             stock
@@ -540,12 +553,13 @@ query shopsearch($description: String, $address: String, $updatedAt: String, $li
     shopsearch: shop_search(description: $description address: $address updatedAt: $updatedAt limit: $limit order_by: $order_by telephone: $telephone name: $name createdAt: $createdAt filter: $filter status: $status breakout: $breakout notice: $notice intro: $intro aggregate: $aggregate skip: $skip)
 }
 
-query orderLogisticsbyprops($deliveryTime: String, $serviceStore: String, $updatedAt: String, $where: orderLogistics_filter, $logisticsFee: Float, $sort_by: orderLogistics_sort_by, $limit: Int, $expressId: String, $order_by: OrderBy, $createdAt: String, $filter: Filter, $order_id: ID, $consigneeTel: String, $expressName: String, $consignAddress: String, $LogisticsStatus: String, $user_id: ID, $consigneeName: String, $skip: Int) {
-    orderLogisticsbyprops: orderLogistics_by_props(deliveryTime: $deliveryTime serviceStore: $serviceStore updatedAt: $updatedAt where: $where logisticsFee: $logisticsFee sort_by: $sort_by limit: $limit expressId: $expressId order_by: $order_by createdAt: $createdAt filter: $filter order_id: $order_id consigneeTel: $consigneeTel expressName: $expressName consignAddress: $consignAddress LogisticsStatus: $LogisticsStatus user_id: $user_id consigneeName: $consigneeName skip: $skip) {
+query orderLogisticsbyprops($deliveryTime: String, $serviceStore: String, $updatedAt: String, $where: orderLogistics_filter, $logisticsFee: Float, $expressDetailName: String, $sort_by: orderLogistics_sort_by, $limit: Int, $expressId: String, $order_by: OrderBy, $createdAt: String, $filter: Filter, $order_id: ID, $consigneeTel: String, $expressName: String, $consignAddress: String, $LogisticsStatus: String, $user_id: ID, $consigneeName: String, $skip: Int) {
+    orderLogisticsbyprops: orderLogistics_by_props(deliveryTime: $deliveryTime serviceStore: $serviceStore updatedAt: $updatedAt where: $where logisticsFee: $logisticsFee expressDetailName: $expressDetailName sort_by: $sort_by limit: $limit expressId: $expressId order_by: $order_by createdAt: $createdAt filter: $filter order_id: $order_id consigneeTel: $consigneeTel expressName: $expressName consignAddress: $consignAddress LogisticsStatus: $LogisticsStatus user_id: $user_id consigneeName: $consigneeName skip: $skip) {
         deliveryTime
         serviceStore
         updatedAt
         logisticsFee
+        expressDetailName
         expressId
         createdAt
         order_id {
@@ -555,7 +569,6 @@ query orderLogisticsbyprops($deliveryTime: String, $serviceStore: String, $updat
             orderTotalPay
             createdAt
             orderStatus
-
             id
             count
 
@@ -614,6 +627,7 @@ query orderbyid($id: ID) {
             serviceStore
             updatedAt
             logisticsFee
+            expressDetailName
             expressId
             createdAt
 
@@ -628,21 +642,6 @@ query orderbyid($id: ID) {
         orderTotalPay
         createdAt
         orderStatus
-        userAddress_id {
-            address
-            updatedAt
-            telephone
-            default
-            city
-            username
-            postcode
-            createdAt
-            deletedAt
-            id
-
-            area
-            province
-        }
         id
         count
         user_id {
@@ -671,8 +670,8 @@ query orderbyid($id: ID) {
     }
 }
 
-query orderLogisticssearch($deliveryTime: String, $serviceStore: String, $updatedAt: String, $logisticsFee: Float, $limit: Int, $expressId: String, $order_by: OrderBy, $createdAt: String, $filter: Filter, $order_id: ID, $consigneeTel: String, $expressName: String, $breakout: Field, $consignAddress: String, $LogisticsStatus: String, $user_id: ID, $aggregate: Aggregation, $consigneeName: String, $skip: Int) {
-    orderLogisticssearch: orderLogistics_search(deliveryTime: $deliveryTime serviceStore: $serviceStore updatedAt: $updatedAt logisticsFee: $logisticsFee limit: $limit expressId: $expressId order_by: $order_by createdAt: $createdAt filter: $filter order_id: $order_id consigneeTel: $consigneeTel expressName: $expressName breakout: $breakout consignAddress: $consignAddress LogisticsStatus: $LogisticsStatus user_id: $user_id aggregate: $aggregate consigneeName: $consigneeName skip: $skip)
+query orderLogisticssearch($deliveryTime: String, $serviceStore: String, $updatedAt: String, $logisticsFee: Float, $expressDetailName: String, $limit: Int, $expressId: String, $order_by: OrderBy, $createdAt: String, $filter: Filter, $order_id: ID, $consigneeTel: String, $expressName: String, $breakout: Field, $consignAddress: String, $LogisticsStatus: String, $user_id: ID, $aggregate: Aggregation, $consigneeName: String, $skip: Int) {
+    orderLogisticssearch: orderLogistics_search(deliveryTime: $deliveryTime serviceStore: $serviceStore updatedAt: $updatedAt logisticsFee: $logisticsFee expressDetailName: $expressDetailName limit: $limit expressId: $expressId order_by: $order_by createdAt: $createdAt filter: $filter order_id: $order_id consigneeTel: $consigneeTel expressName: $expressName breakout: $breakout consignAddress: $consignAddress LogisticsStatus: $LogisticsStatus user_id: $user_id aggregate: $aggregate consigneeName: $consigneeName skip: $skip)
 }
 
 query orderProductbyprops($updatedAt: String, $where: orderProduct_filter, $sort_by: orderProduct_sort_by, $limit: Int, $productColor: String, $unit: String, $product_id: ID, $productSize: String, $order_by: OrderBy, $orderPay: Float, $createdAt: String, $productImg: String, $productName: String, $specificationStock_id: ID, $filter: Filter, $order_id: ID, $productPrice: Float, $count: Int, $productPay: Float, $user_id: ID, $orderPay_id: ID, $skip: Int) {
@@ -686,11 +685,13 @@ query orderProductbyprops($updatedAt: String, $where: orderProduct_filter, $sort
             unit
             name
             createdAt
+            slideImg
             status
             id
             intro
             discountRate
             price
+            detailImg
 
             img
             stock
@@ -719,7 +720,6 @@ query orderProductbyprops($updatedAt: String, $where: orderProduct_filter, $sort
             orderTotalPay
             createdAt
             orderStatus
-
             id
             count
 
@@ -761,11 +761,13 @@ query productbyid($id: ID) {
         unit
         name
         createdAt
+        slideImg
         status
         id
         intro
         discountRate
         price
+        detailImg
         category_id {
             id
             name
@@ -856,11 +858,13 @@ query userCartbyprops($updatedAt: String, $where: userCart_filter, $sort_by: use
             unit
             name
             createdAt
+            slideImg
             status
             id
             intro
             discountRate
             price
+            detailImg
 
             img
             stock
@@ -891,8 +895,8 @@ query userDatasearch($updatedAt: String, $userPoint: Int, $limit: Int, $order_by
     userDatasearch: userData_search(updatedAt: $updatedAt userPoint: $userPoint limit: $limit order_by: $order_by nickname: $nickname createdAt: $createdAt filter: $filter avatar: $avatar breakout: $breakout vipCode: $vipCode aggregate: $aggregate isVip: $isVip skip: $skip)
 }
 
-query ordersearch($remark: String, $updatedAt: String, $orderLogistics_id: ID, $limit: Int, $order_by: OrderBy, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $userAddress_id: ID, $filter: Filter, $count: Int, $breakout: Field, $user_id: ID, $productTotalPay: Float, $aggregate: Aggregation, $orderPay_id: ID, $skip: Int) {
-    ordersearch: order_search(remark: $remark updatedAt: $updatedAt orderLogistics_id: $orderLogistics_id limit: $limit order_by: $order_by orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus userAddress_id: $userAddress_id filter: $filter count: $count breakout: $breakout user_id: $user_id productTotalPay: $productTotalPay aggregate: $aggregate orderPay_id: $orderPay_id skip: $skip)
+query ordersearch($remark: String, $updatedAt: String, $orderLogistics_id: ID, $limit: Int, $order_by: OrderBy, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $filter: Filter, $count: Int, $breakout: Field, $user_id: ID, $productTotalPay: Float, $aggregate: Aggregation, $orderPay_id: ID, $skip: Int) {
+    ordersearch: order_search(remark: $remark updatedAt: $updatedAt orderLogistics_id: $orderLogistics_id limit: $limit order_by: $order_by orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus filter: $filter count: $count breakout: $breakout user_id: $user_id productTotalPay: $productTotalPay aggregate: $aggregate orderPay_id: $orderPay_id skip: $skip)
 }
 
 query shopbyid($id: ID) {
@@ -943,8 +947,8 @@ query userbyprops($email: String, $updatedAt: String, $where: user_filter, $sort
     }
 }
 
-query orderbyprops($remark: String, $updatedAt: String, $where: order_filter, $orderLogistics_id: ID, $sort_by: order_sort_by, $limit: Int, $order_by: OrderBy, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $userAddress_id: ID, $filter: Filter, $count: Int, $user_id: ID, $productTotalPay: Float, $orderPay_id: ID, $skip: Int) {
-    orderbyprops: order_by_props(remark: $remark updatedAt: $updatedAt where: $where orderLogistics_id: $orderLogistics_id sort_by: $sort_by limit: $limit order_by: $order_by orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus userAddress_id: $userAddress_id filter: $filter count: $count user_id: $user_id productTotalPay: $productTotalPay orderPay_id: $orderPay_id skip: $skip) {
+query orderbyprops($remark: String, $updatedAt: String, $where: order_filter, $orderLogistics_id: ID, $sort_by: order_sort_by, $limit: Int, $order_by: OrderBy, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $filter: Filter, $count: Int, $user_id: ID, $productTotalPay: Float, $orderPay_id: ID, $skip: Int) {
+    orderbyprops: order_by_props(remark: $remark updatedAt: $updatedAt where: $where orderLogistics_id: $orderLogistics_id sort_by: $sort_by limit: $limit order_by: $order_by orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus filter: $filter count: $count user_id: $user_id productTotalPay: $productTotalPay orderPay_id: $orderPay_id skip: $skip) {
         remark
         updatedAt
         orderLogistics_id {
@@ -952,6 +956,7 @@ query orderbyprops($remark: String, $updatedAt: String, $where: order_filter, $o
             serviceStore
             updatedAt
             logisticsFee
+            expressDetailName
             expressId
             createdAt
 
@@ -966,21 +971,6 @@ query orderbyprops($remark: String, $updatedAt: String, $where: order_filter, $o
         orderTotalPay
         createdAt
         orderStatus
-        userAddress_id {
-            address
-            updatedAt
-            telephone
-            default
-            city
-            username
-            postcode
-            createdAt
-            deletedAt
-            id
-
-            area
-            province
-        }
         id
         count
         user_id {
@@ -1092,8 +1082,8 @@ mutation deletecategory($id: ID, $name: String, $img: String, $order: Int, $stat
     deletecategory: delete_category(id: $id name: $name img: $img order: $order status: $status createdAt: $createdAt updatedAt: $updatedAt where: $where)
 }
 
-mutation updateproduct($recommend: Int, $updatedAt: String, $where: product_filter, $unit: String, $name: String, $createdAt: String, $status: String, $id: ID, $intro: String, $discountRate: Float, $price: Float, $category_id: ID, $img: String, $stock: Int) {
-    updateproduct: update_product(recommend: $recommend updatedAt: $updatedAt where: $where unit: $unit name: $name createdAt: $createdAt status: $status id: $id intro: $intro discountRate: $discountRate price: $price category_id: $category_id img: $img stock: $stock) {
+mutation updateproduct($recommend: Int, $updatedAt: String, $where: product_filter, $unit: String, $name: String, $createdAt: String, $slideImg: String, $status: String, $id: ID, $intro: String, $discountRate: Float, $price: Float, $detailImg: String, $category_id: ID, $img: String, $stock: Int) {
+    updateproduct: update_product(recommend: $recommend updatedAt: $updatedAt where: $where unit: $unit name: $name createdAt: $createdAt slideImg: $slideImg status: $status id: $id intro: $intro discountRate: $discountRate price: $price detailImg: $detailImg category_id: $category_id img: $img stock: $stock) {
         result
         product {
             recommend
@@ -1101,11 +1091,13 @@ mutation updateproduct($recommend: Int, $updatedAt: String, $where: product_filt
             unit
             name
             createdAt
+            slideImg
             status
             id
             intro
             discountRate
             price
+            detailImg
 
             img
             stock
@@ -1292,8 +1284,8 @@ mutation createuserSearch($id: ID!, $keyword: Int, $user_id: ID, $createdAt: Str
     }
 }
 
-mutation createproduct($recommend: Int, $updatedAt: String, $unit: String, $name: String, $createdAt: String, $status: String, $id: ID!, $intro: String, $discountRate: Float, $price: Float, $category_id: ID, $img: String, $stock: Int) {
-    createproduct: create_product(recommend: $recommend updatedAt: $updatedAt unit: $unit name: $name createdAt: $createdAt status: $status id: $id intro: $intro discountRate: $discountRate price: $price category_id: $category_id img: $img stock: $stock) {
+mutation createproduct($recommend: Int, $updatedAt: String, $unit: String, $name: String, $createdAt: String, $slideImg: String, $status: String, $id: ID!, $intro: String, $discountRate: Float, $price: Float, $detailImg: String, $category_id: ID, $img: String, $stock: Int) {
+    createproduct: create_product(recommend: $recommend updatedAt: $updatedAt unit: $unit name: $name createdAt: $createdAt slideImg: $slideImg status: $status id: $id intro: $intro discountRate: $discountRate price: $price detailImg: $detailImg category_id: $category_id img: $img stock: $stock) {
         result
         product {
             recommend
@@ -1301,11 +1293,13 @@ mutation createproduct($recommend: Int, $updatedAt: String, $unit: String, $name
             unit
             name
             createdAt
+            slideImg
             status
             id
             intro
             discountRate
             price
+            detailImg
 
             img
             stock
@@ -1360,8 +1354,8 @@ mutation updateuserCollect($id: ID, $product_id: ID, $user_id: ID, $createdAt: S
     }
 }
 
-mutation deleteorder($remark: String, $updatedAt: String, $where: order_filter, $orderLogistics_id: ID, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $userAddress_id: ID, $id: ID, $count: Int, $user_id: ID, $productTotalPay: Float, $orderPay_id: ID) {
-    deleteorder: delete_order(remark: $remark updatedAt: $updatedAt where: $where orderLogistics_id: $orderLogistics_id orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus userAddress_id: $userAddress_id id: $id count: $count user_id: $user_id productTotalPay: $productTotalPay orderPay_id: $orderPay_id)
+mutation deleteorder($remark: String, $updatedAt: String, $where: order_filter, $orderLogistics_id: ID, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $id: ID, $count: Int, $user_id: ID, $productTotalPay: Float, $orderPay_id: ID) {
+    deleteorder: delete_order(remark: $remark updatedAt: $updatedAt where: $where orderLogistics_id: $orderLogistics_id orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus id: $id count: $count user_id: $user_id productTotalPay: $productTotalPay orderPay_id: $orderPay_id)
 }
 
 mutation deleteadmin($email: String, $updatedAt: String, $where: admin_filter, $password: String, $telephone: String, $username: String, $createdAt: String, $openid: String, $id: ID) {
@@ -1441,8 +1435,8 @@ mutation createuserData($id: ID!, $nickname: String, $avatar: String, $isVip: Bo
     }
 }
 
-mutation createorder($remark: String, $updatedAt: String, $orderLogistics_id: ID, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $userAddress_id: ID, $id: ID!, $count: Int, $user_id: ID, $productTotalPay: Float, $orderPay_id: ID) {
-    createorder: create_order(remark: $remark updatedAt: $updatedAt orderLogistics_id: $orderLogistics_id orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus userAddress_id: $userAddress_id id: $id count: $count user_id: $user_id productTotalPay: $productTotalPay orderPay_id: $orderPay_id) {
+mutation createorder($remark: String, $updatedAt: String, $orderLogistics_id: ID, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $id: ID!, $count: Int, $user_id: ID, $productTotalPay: Float, $orderPay_id: ID) {
+    createorder: create_order(remark: $remark updatedAt: $updatedAt orderLogistics_id: $orderLogistics_id orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus id: $id count: $count user_id: $user_id productTotalPay: $productTotalPay orderPay_id: $orderPay_id) {
         result
         order {
             remark
@@ -1451,7 +1445,6 @@ mutation createorder($remark: String, $updatedAt: String, $orderLogistics_id: ID
             orderTotalPay
             createdAt
             orderStatus
-
             id
             count
 
@@ -1486,8 +1479,8 @@ mutation updateorderPay($updatedAt: String, $where: orderPay_filter, $tradeNo: S
     }
 }
 
-mutation deleteorderLogistics($deliveryTime: String, $serviceStore: String, $updatedAt: String, $where: orderLogistics_filter, $logisticsFee: Float, $expressId: String, $createdAt: String, $order_id: ID, $consigneeTel: String, $id: ID, $expressName: String, $consignAddress: String, $LogisticsStatus: String, $user_id: ID, $consigneeName: String) {
-    deleteorderLogistics: delete_orderLogistics(deliveryTime: $deliveryTime serviceStore: $serviceStore updatedAt: $updatedAt where: $where logisticsFee: $logisticsFee expressId: $expressId createdAt: $createdAt order_id: $order_id consigneeTel: $consigneeTel id: $id expressName: $expressName consignAddress: $consignAddress LogisticsStatus: $LogisticsStatus user_id: $user_id consigneeName: $consigneeName)
+mutation deleteorderLogistics($deliveryTime: String, $serviceStore: String, $updatedAt: String, $where: orderLogistics_filter, $logisticsFee: Float, $expressDetailName: String, $expressId: String, $createdAt: String, $order_id: ID, $consigneeTel: String, $id: ID, $expressName: String, $consignAddress: String, $LogisticsStatus: String, $user_id: ID, $consigneeName: String) {
+    deleteorderLogistics: delete_orderLogistics(deliveryTime: $deliveryTime serviceStore: $serviceStore updatedAt: $updatedAt where: $where logisticsFee: $logisticsFee expressDetailName: $expressDetailName expressId: $expressId createdAt: $createdAt order_id: $order_id consigneeTel: $consigneeTel id: $id expressName: $expressName consignAddress: $consignAddress LogisticsStatus: $LogisticsStatus user_id: $user_id consigneeName: $consigneeName)
 }
 
 mutation updateuserSearch($id: ID, $keyword: Int, $user_id: ID, $createdAt: String, $updatedAt: String, $where: userSearch_filter) {
@@ -1503,8 +1496,8 @@ mutation updateuserSearch($id: ID, $keyword: Int, $user_id: ID, $createdAt: Stri
     }
 }
 
-mutation updateorder($remark: String, $updatedAt: String, $where: order_filter, $orderLogistics_id: ID, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $userAddress_id: ID, $id: ID, $count: Int, $user_id: ID, $productTotalPay: Float, $orderPay_id: ID) {
-    updateorder: update_order(remark: $remark updatedAt: $updatedAt where: $where orderLogistics_id: $orderLogistics_id orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus userAddress_id: $userAddress_id id: $id count: $count user_id: $user_id productTotalPay: $productTotalPay orderPay_id: $orderPay_id) {
+mutation updateorder($remark: String, $updatedAt: String, $where: order_filter, $orderLogistics_id: ID, $orderTotalPay: Float, $createdAt: String, $orderStatus: String, $id: ID, $count: Int, $user_id: ID, $productTotalPay: Float, $orderPay_id: ID) {
+    updateorder: update_order(remark: $remark updatedAt: $updatedAt where: $where orderLogistics_id: $orderLogistics_id orderTotalPay: $orderTotalPay createdAt: $createdAt orderStatus: $orderStatus id: $id count: $count user_id: $user_id productTotalPay: $productTotalPay orderPay_id: $orderPay_id) {
         result
         order {
             remark
@@ -1513,7 +1506,6 @@ mutation updateorder($remark: String, $updatedAt: String, $where: order_filter,
             orderTotalPay
             createdAt
             orderStatus
-
             id
             count
 
@@ -1522,14 +1514,15 @@ mutation updateorder($remark: String, $updatedAt: String, $where: order_filter,
     }
 }
 
-mutation createorderLogistics($deliveryTime: String, $serviceStore: String, $updatedAt: String, $logisticsFee: Float, $expressId: String, $createdAt: String, $order_id: ID, $consigneeTel: String, $id: ID!, $expressName: String, $consignAddress: String, $LogisticsStatus: String, $user_id: ID, $consigneeName: String) {
-    createorderLogistics: create_orderLogistics(deliveryTime: $deliveryTime serviceStore: $serviceStore updatedAt: $updatedAt logisticsFee: $logisticsFee expressId: $expressId createdAt: $createdAt order_id: $order_id consigneeTel: $consigneeTel id: $id expressName: $expressName consignAddress: $consignAddress LogisticsStatus: $LogisticsStatus user_id: $user_id consigneeName: $consigneeName) {
+mutation createorderLogistics($deliveryTime: String, $serviceStore: String, $updatedAt: String, $logisticsFee: Float, $expressDetailName: String, $expressId: String, $createdAt: String, $order_id: ID, $consigneeTel: String, $id: ID!, $expressName: String, $consignAddress: String, $LogisticsStatus: String, $user_id: ID, $consigneeName: String) {
+    createorderLogistics: create_orderLogistics(deliveryTime: $deliveryTime serviceStore: $serviceStore updatedAt: $updatedAt logisticsFee: $logisticsFee expressDetailName: $expressDetailName expressId: $expressId createdAt: $createdAt order_id: $order_id consigneeTel: $consigneeTel id: $id expressName: $expressName consignAddress: $consignAddress LogisticsStatus: $LogisticsStatus user_id: $user_id consigneeName: $consigneeName) {
         result
         orderLogistics {
             deliveryTime
             serviceStore
             updatedAt
             logisticsFee
+            expressDetailName
             expressId
             createdAt
 
@@ -1544,14 +1537,15 @@ mutation createorderLogistics($deliveryTime: String, $serviceStore: String, $upd
     }
 }
 
-mutation updateorderLogistics($deliveryTime: String, $serviceStore: String, $updatedAt: String, $where: orderLogistics_filter, $logisticsFee: Float, $expressId: String, $createdAt: String, $order_id: ID, $consigneeTel: String, $id: ID, $expressName: String, $consignAddress: String, $LogisticsStatus: String, $user_id: ID, $consigneeName: String) {
-    updateorderLogistics: update_orderLogistics(deliveryTime: $deliveryTime serviceStore: $serviceStore updatedAt: $updatedAt where: $where logisticsFee: $logisticsFee expressId: $expressId createdAt: $createdAt order_id: $order_id consigneeTel: $consigneeTel id: $id expressName: $expressName consignAddress: $consignAddress LogisticsStatus: $LogisticsStatus user_id: $user_id consigneeName: $consigneeName) {
+mutation updateorderLogistics($deliveryTime: String, $serviceStore: String, $updatedAt: String, $where: orderLogistics_filter, $logisticsFee: Float, $expressDetailName: String, $expressId: String, $createdAt: String, $order_id: ID, $consigneeTel: String, $id: ID, $expressName: String, $consignAddress: String, $LogisticsStatus: String, $user_id: ID, $consigneeName: String) {
+    updateorderLogistics: update_orderLogistics(deliveryTime: $deliveryTime serviceStore: $serviceStore updatedAt: $updatedAt where: $where logisticsFee: $logisticsFee expressDetailName: $expressDetailName expressId: $expressId createdAt: $createdAt order_id: $order_id consigneeTel: $consigneeTel id: $id expressName: $expressName consignAddress: $consignAddress LogisticsStatus: $LogisticsStatus user_id: $user_id consigneeName: $consigneeName) {
         result
         orderLogistics {
             deliveryTime
             serviceStore
             updatedAt
             logisticsFee
+            expressDetailName
             expressId
             createdAt
 

+ 2 - 0
ecommerce.csv

@@ -75,6 +75,8 @@ category_id,ID,non-null
 name,string,non-null
 price,float,non-null
 img,string,
+slideImg,string,list
+detailImg,string,list
 intro,string,
 stock,int,
 unit,string,non-null

+ 36 - 34
src/pages/my/all/index.js

@@ -1,14 +1,15 @@
 import React, {Component} from 'react'
-import './index.css'
-import {message} from 'antd'
-import {Grid, ActivityIndicator,Modal} from 'antd-mobile'
 import {withRouter} from 'react-router-dom'
-import Logo from '../../../components/logo'
-import {getCookie, setCookie} from "../../../utils/cookie"
-import {user_by_id, admin_by_id} from "../../../utils/gql"
+import {message} from 'antd'
+import {Grid, ActivityIndicator, Modal} from 'antd-mobile'
 import {Query} from "react-apollo"
 import gql from "graphql-tag"
 
+import {getCookie, setCookie} from "../../../utils/cookie"
+import {user_by_id, admin_by_id} from "../../../utils/gql"
+import Logo from '../../../components/logo'
+import './index.css'
+
 const prompt = Modal.prompt;
 
 const orderIcon = [
@@ -195,23 +196,23 @@ class All extends Component {
                           return (
                             <div className='my-card member-card'>
                               <div className='card-title'
-                                   onClick={() => prompt(
-                                     '管理员登陆',
-                                     '请输入账户名及密码',
-                                     (login, password) => {
-                                       const {username, password:userPassWord} = adminData
-                                       // console.log(`login: ${login}, password: ${password}`)
-                                       if(login === username && password === userPassWord) {
-                                         this.setState({showAdmin:true})
-                                         setCookie('showAdmin',true)
-                                       }else {
-                                         message.error('账户或密码有误')
-                                       }
-                                     },
-                                     'login-password',
-                                     null,
-                                     ['请输入管理员账号', '请输入管理员密码'],
-                                   )}
+                                onClick={() => prompt(
+                                  '管理员登陆',
+                                  '请输入账户名及密码',
+                                  (login, password) => {
+                                    const {username, password:userPassWord} = adminData
+                                    // console.log(`login: ${login}, password: ${password}`)
+                                    if(login === username && password === userPassWord) {
+                                      this.setState({showAdmin:true})
+                                      setCookie('showAdmin',true)
+                                    }else {
+                                      message.error('账户或密码有误')
+                                    }
+                                  },
+                                  'login-password',
+                                  null,
+                                  ['请输入管理员账号', '请输入管理员密码'],
+                                )}
                               >
                                 商家入口
                               </div>
@@ -258,17 +259,18 @@ export default withRouter(All)
 export const OrderTab = (props) => {
   return (
     <div className='card-icons'>
-      <Grid data={orderIcon}
-            columnNum={4}
-            hasLine={false}
-            onClick={(order) => {
-              props.history.push({
-                pathname: '/my/order',
-                state: {
-                  kind: order.id
-                }
-              })
-            }}
+      <Grid
+        data={orderIcon}
+        columnNum={4}
+        hasLine={false}
+        onClick={(order) => {
+          props.history.push({
+            pathname: '/my/order',
+            state: {
+              kind: order.id
+            }
+          })
+        }}
       />
     </div>
   )

+ 3 - 2
src/pages/my/manage/index.js

@@ -1,9 +1,10 @@
 import React, {Component} from 'react'
+import {withRouter, Route, Switch} from 'react-router-dom'
+
 import Shop from './shop'
 import Goods from './goods'
 import Orders from './orders'
 import Admin from './admin'
-import {withRouter, Route, Switch} from 'react-router-dom'
 
 class Manage extends Component {
     constructor(props) {
@@ -31,7 +32,7 @@ class Manage extends Component {
                     <Route path="/my/manage/goods" component={Goods}/>
                     <Route path="/my/manage/orders" component={Orders}/>
                     <Route path="/my/manage/admin" component={Admin}/>
-                    <Route path="/my/manage/*" component={Goods}/>
+                    <Route path="/my/manage/*" component={Orders}/>
                 </Switch>
             </div>
         )

+ 20 - 5
src/pages/my/manage/orders/index.js

@@ -21,10 +21,19 @@ class Orders extends Component {
   constructor(props) {
     super(props)
     this.state = {
+      tabValue: '0',
     }
   }
 
+  changeOrderStatus = (value) => {
+    this.setState({
+      tabValue: value.tabValue
+    })
+  }
+
   render() {
+    const { history } = this.props
+    // console.log("Orders history",history)
     return (
       <div className='goods-wrap'>
         <NavBar
@@ -32,17 +41,22 @@ class Orders extends Component {
           mode="light"
           icon={<Icon type="left"/>}
           onLeftClick={() => {
-            this.props.history.go(-1)
+            history.go(-1)
           }}
         >订单管理</NavBar>
         <Tabs
           tabs={tabs}
+          initialPage={0}
+          onChange={(tabValue, index) => {
+            console.log('onChange', index, tabValue);
+            this.changeOrderStatus(tabValue)
+          }}
           // onChange={(tab, index) => { console.log('onChange', index, tab); }}
         >
-          <Shiping/>
-          <Unbox/>
-          <Completed/>
-          <Search/>
+          <Shiping history={history} />
+          <Unbox history={history} />
+          <Completed history={history} />
+          <Search history={history} />
         </Tabs>
       </div>
     )
@@ -192,6 +206,7 @@ class Shiping extends Component {
   }
 
   render() {
+    // console.log("Shiping this.props.history",this.props.history)
     return (
       <Query query={gql(orderbyprops)} variables={{orderStatus: '1'}}>
         {

+ 37 - 7
src/pages/my/order/detail/index.js

@@ -13,7 +13,8 @@ class Detail extends Component {
   constructor(props) {
     super(props)
     this.state = {
-      data: {}
+      data: {},
+      isAdmin: false
     }
   }
 
@@ -21,7 +22,8 @@ class Detail extends Component {
     let {location} = this.props
     if (location && location.state) {
       this.setState({
-        data: location.state.data
+        data: location.state.data || {},
+        isAdmin: !!location.state.isAdmin
       })
     }
   }
@@ -89,9 +91,11 @@ class Detail extends Component {
   }
 
   render() {
-    let {data} = this.state
-    // console.log("detail data",data)
-    let {consigneeName, consigneeTel, consignAddress} = data.orderLogistics_id
+    let {data, isAdmin} = this.state
+    // console.log("Detail this.props.history",this.props.history)
+    let consigneeName = (data.orderLogistics_id && data.orderLogistics_id.consigneeName) || ''
+    let consigneeTel = (data.orderLogistics_id && data.orderLogistics_id.consigneeTel) || ''
+    let consignAddress = (data.orderLogistics_id && data.orderLogistics_id.consignAddress) || ''
 
     return (
       <div>
@@ -101,7 +105,12 @@ class Detail extends Component {
               mode="light"
               icon={<Icon type="left"/>}
               onLeftClick={() => {
-                this.props.history.go(-1)
+                // console.log("goback")
+                if(isAdmin){
+                  this.props.history.go(-2)
+                }else {
+                  this.props.history.go(-1)
+                }
                 sessionStorage.setItem('select_orderStatus',data.orderStatus)
               }}
             >订单详情</NavBar>
@@ -154,7 +163,7 @@ class Detail extends Component {
             </div>
           </div>
           <div className='detail-footer-wrap'>
-            <ButtonGroupRender order={data} orderStatus={data.orderStatus}/>
+            <ButtonGroupRender order={data} orderStatus={data.orderStatus} isAdmin={isAdmin}/>
           </div>
         </div>
       </div>
@@ -174,6 +183,9 @@ class Order extends Component {
 
   render() {
     let {data} = this.props
+    const { orderLogistics_id } = data
+    // console.log("Order data",data)
+    // console.log("Order orderLogistics_id",orderLogistics_id)
     return (
       <div className='detail-order-wrapper'>
         <div className='detail-order-item'>
@@ -184,6 +196,24 @@ class Order extends Component {
           <span className='detail-order-title'>下单时间:</span>
           <span>{data.createdAt}</span>
         </div>
+        {
+          orderLogistics_id.expressDetailName && orderLogistics_id.expressId ?
+            <div>
+              <div className='detail-order-item'>
+                <span className='detail-order-title'>发货时间:</span>
+                <span>{orderLogistics_id.deliveryTime}</span>
+              </div>
+              <div className='detail-order-item'>
+                <span className='detail-order-title'>快递名称:</span>
+                <span>{orderLogistics_id.expressDetailName}</span>
+              </div>
+              <div className='detail-order-item'>
+                <span className='detail-order-title'>快递单号:</span>
+                <span>{orderLogistics_id.expressId}</span>
+              </div>
+            </div>
+            :''
+        }
       </div>
     )
   }

+ 4 - 0
src/pages/my/order/display/index.css

@@ -89,6 +89,10 @@
     width: 85px;
 }
 
+.order-admin-button {
+    width: 120px;
+}
+
 .judge-button {
 
 }

+ 267 - 132
src/pages/my/order/display/index.js

@@ -1,18 +1,24 @@
 import React, {Component} from 'react'
 import {withRouter} from 'react-router-dom'
-import {Row, Col, message} from 'antd'
-import moment from 'moment'
-import {NavBar, Icon, ActivityIndicator, Button, Modal, Tabs} from 'antd-mobile'
+import {Row, Col, message, Icon} from 'antd'
+import {NavBar, List, InputItem, Button, ActivityIndicator, Modal, Tabs } from 'antd-mobile'
 import {Query} from "react-apollo"
 import {Mutation} from "react-apollo"
 import gql from "graphql-tag"
-import classNames from 'classnames'
+import moment from 'moment'
 
-import {delete_order, orderbyprops, orderProduct_by_props, update_order} from "../../../../utils/gql"
+import {
+  delete_order,
+  orderbyprops,
+  orderProduct_by_props,
+  update_order,
+  update_order_logistics
+} from "../../../../utils/gql"
 import {getCookie} from "../../../../utils/cookie"
 import './index.css'
 
 const alert = Modal.alert
+
 const tabs = [
   {
     key: '0',
@@ -153,12 +159,12 @@ class DisplayRender extends Component {
   }
 
   orderCardContentRender = (data) => {
+    // console.log("DisplayRender this.props.history",this.props.history)
     if (data.length === 1) {
       return (
         <Row style={{width: '100%'}}>
           <Col span={6} style={{height: '100%'}}>
-            <div className='order-product-img'
-                 style={{backgroundImage: `url('${data[0].product_id.img}')`}}/>
+            <div className='order-product-img' style={{backgroundImage: `url('${data[0].product_id.img}')`}}/>
           </Col>
           <Col span={16} offset={2}>
             <div className='order-product-name'>{data[0].product_id.name}</div>
@@ -167,8 +173,11 @@ class DisplayRender extends Component {
       )
     } else {
       return (data.map(data => (
-        <div className='order-product-img' style={{backgroundImage: `url('${data.product_id.img}')`}}
-             key={data.id}/>
+        <div
+          className='order-product-img'
+          style={{backgroundImage: `url('${data.product_id.img}')`}}
+          key={data.id}
+        />
       )))
     }
   }
@@ -179,7 +188,7 @@ class DisplayRender extends Component {
     let content = orderStatus === '0' ? '需付款' : '实付款'
 
     return (
-      <div className={classNames({'content-wrap': button})}>
+      <div >
         <div className='order-body'>
           {
             data.length === 0 ?
@@ -206,24 +215,16 @@ class DisplayRender extends Component {
                         }
                         data = data.orderProductbyprops
                         return (
-                          <div>
-                            {
-                              button ?
-                                <div className='order-card-content' onClick={() => {
-                                  history.push({
-                                    pathname: '/my/order/detail',
-                                    state: {
-                                      data: order
-                                    }
-                                  })
-                                }}>
-                                  {this.orderCardContentRender(data)}
-                                </div>
-                                :
-                                <div className='order-card-content'>
-                                  {this.orderCardContentRender(data)}
-                                </div>
-                            }
+                          <div className='order-card-content' onClick={() => {
+                            history.push({
+                              pathname: '/my/order/detail',
+                              state: {
+                                data: order,
+                                isAdmin: !button
+                              }
+                            })
+                          }}>
+                            {this.orderCardContentRender(data)}
                           </div>
                         )
                       }
@@ -236,7 +237,7 @@ class DisplayRender extends Component {
                   </div>
                   {
                     button ?
-                      <ButtonGroupRender order={order} orderStatus={orderStatus} history={history}/> : ''
+                      <ButtonGroupRender order={order} orderStatus={orderStatus} history={history} isAdmin={!button}/> : ''
                   }
                 </div>
               ))
@@ -251,10 +252,18 @@ class ButtonGroupRender extends Component {
   constructor(props) {
     super(props)
     this.state = {
-      modal: false
+      modal: false,
+      updateOrderModal: false
     }
   }
 
+  controlUpdateOrderModal = (bool,e) => {
+    e.persist()
+    this.setState({
+      updateOrderModal: bool
+    })
+  }
+
   showModal = (key,e) => {
     e.preventDefault(); // 修复 Android 上点击穿透
     this.setState({
@@ -269,117 +278,146 @@ class ButtonGroupRender extends Component {
   }
 
   renderByOrderStatus = () => {
-    const { order, history } = this.props
-    let { modal } = this.state
+    const { order, history, isAdmin } = this.props
+    // console.log("ButtonGroupRender isAdmin",isAdmin)
+    let { modal, updateOrderModal } = this.state
     // console.log("renderByOrderStatus order",order)
     const { id, orderStatus, orderLogistics_id } = order
     const { expressId, expressDetailName='' } = orderLogistics_id
     const user_id = getCookie('user_id')
-    switch (orderStatus) {
-      case '0':
-        return (
-          <div className='order-card-button-group'>
-            <Mutation
-              mutation={gql(delete_order)}
-              refetchQueries={[{query: gql(orderbyprops), variables: {user_id, orderStatus}}]}
-            >
-              {(delete_order, {loading, error}) => {
-                if (loading) {
+    if(isAdmin && orderStatus === '1') {
+      return (
+        <div className='order-card-button-group'>
+          <Button
+            size="small"
+            className='order-admin-button order-button'
+            onClick={(e)=>this.controlUpdateOrderModal(true, e)}
+          >添加快递单号</Button>
+          <Modal
+            popup
+            visible={updateOrderModal}
+            onClose={(e)=>this.controlUpdateOrderModal(false, e)}
+            animationType="slide-up"
+            className='modify-goods-modal'
+          >
+            <div className='close-item'>
+              <div className='close-popup' onClick={(e)=>this.controlUpdateOrderModal(false, e)}>
+                <Icon type="close" />
+              </div>
+            </div>
+            <AdminUpdateOrder order={order} controlUpdateOrderModal={this.controlUpdateOrderModal}/>
+          </Modal>
+        </div>
+      )
+    }else if(!isAdmin){
+      switch (orderStatus) {
+        case '0':
+          return (
+            <div className='order-card-button-group'>
+              <Mutation
+                mutation={gql(delete_order)}
+                refetchQueries={[{query: gql(orderbyprops), variables: {user_id, orderStatus}}]}
+              >
+                {(delete_order, {loading, error}) => {
+                  if (loading) {
+                    return (
+                      <div className="loading-center">
+                        <ActivityIndicator text="加载中..." size="large"/>
+                      </div>
+                    )
+                  }
+                  if (error) {
+                    return 'error!'
+                  }
                   return (
-                    <div className="loading-center">
-                      <ActivityIndicator text="加载中..." size="large"/>
-                    </div>
+                    <Button size="small" className='pay-button order-button' onClick={() => {
+                      delete_order({variables: {id}})
+                    }}>取消</Button>
                   )
-                }
-                if (error) {
-                  return 'error!'
-                }
-                return (
-                  <Button size="small" className='pay-button order-button' onClick={() => {
-                    delete_order({variables: {id}})
-                  }}>取消</Button>
-                )
-              }}
-            </Mutation>
+                }}
+              </Mutation>
 
-            <Button size="small" className='pay-button order-button' style={{marginLeft: 5}} onClick={() => {
-              sessionStorage.setItem('payOrder',JSON.stringify(order))
-              history.push({
-                pathname: '/cart/pay',
-                state: {}
-              })
-            }}>去支付</Button>
-          </div>
-        )
-      case '1':
-        return (
-          <div className='order-card-button-group'>
-            <Button size="small" className='ship-button order-button' onClick={() => {
-              message.success('已提醒')
-            }}>提醒发货</Button>
-          </div>
-        )
-      case '2':
-        return (
-          <div className='order-card-button-group'>
-            <Button size="small" className='unbox-button order-button' onClick={(e) => {
-              if(expressId){
-                this.showModal('modal',e)
-              }else {
-                message.info('暂无物流信息')
-              }
-            }}>查看物流</Button>
-            <Modal
-              visible={modal}
-              transparent
-              onClose={this.onClose('modal')}
-              title="物流信息"
-            >
-              <div>
-                {expressDetailName ?
-                  <div>快递名称:<span className='express-info'>{expressDetailName}</span></div>:''
+              <Button size="small" className='pay-button order-button' style={{marginLeft: 5}} onClick={() => {
+                sessionStorage.setItem('payOrder',JSON.stringify(order))
+                history.push({
+                  pathname: '/cart/pay',
+                  state: {}
+                })
+              }}>去支付</Button>
+            </div>
+          )
+        case '1':
+          return (
+            <div className='order-card-button-group'>
+              <Button size="small" className='ship-button order-button' onClick={() => {
+                message.success('已提醒')
+              }}>提醒发货</Button>
+            </div>
+          )
+        case '2':
+          return (
+            <div className='order-card-button-group'>
+              <Button size="small" className='unbox-button order-button' onClick={(e) => {
+                if(expressId){
+                  this.showModal('modal',e)
+                }else {
+                  message.info('暂无物流信息')
                 }
-                <div>快递单号:<span className='express-info'>{expressId}</span></div>
-              </div>
-            </Modal>
-            &nbsp;&nbsp;
-            <Mutation
-              mutation={gql(update_order)}
-              refetchQueries={[{query: gql(orderbyprops), variables: {user_id, orderStatus}}]}
-            >
-              {(update_order, {error}) => {
-                if (error) {
-                  return 'error!'
-                }
-                return (
-                  <Button size="small" className='unbox-button order-button' onClick={() => {
-                    console.log("确认收货")
-                    alert('确认收货', `确定确认收货吗?`, [
-                      { text: '取消', onPress: () => console.log('cancel') },
-                      {
-                        text: '确定',
-                        onPress: () => {
-                          const updatedAt = moment().format('YYYY-MM-DD HH:mm:ss')
-                          update_order({variables: {id, orderStatus:'3', updatedAt}})
+              }}>查看物流</Button>
+              <Modal
+                visible={modal}
+                transparent
+                onClose={this.onClose('modal')}
+                title="物流信息"
+              >
+                <div>
+                  {expressDetailName ?
+                    <div>快递名称:<span className='express-info'>{expressDetailName}</span></div>:''
+                  }
+                  <div>快递单号:<span className='express-info'>{expressId}</span></div>
+                </div>
+              </Modal>
+              &nbsp;&nbsp;
+              <Mutation
+                mutation={gql(update_order)}
+                refetchQueries={[{query: gql(orderbyprops), variables: {user_id, orderStatus}}]}
+              >
+                {(update_order, {error}) => {
+                  if (error) {
+                    return 'error!'
+                  }
+                  return (
+                    <Button size="small" className='unbox-button order-button' onClick={() => {
+                      console.log("确认收货")
+                      alert('确认收货', `确定确认收货吗?`, [
+                        { text: '取消', onPress: () => console.log('cancel') },
+                        {
+                          text: '确定',
+                          onPress: () => {
+                            const updatedAt = moment().format('YYYY-MM-DD HH:mm:ss')
+                            update_order({variables: {id, orderStatus:'3', updatedAt}})
+                          }
                         }
-                      }
-                    ])
-                  }}>确认收货</Button>
-                )
-              }}
-            </Mutation>
-          </div>
-        )
-      // case '3':
-      //     return (
-      //         <div className='order-card-button-group'>
-      //             <Button size="small" className='judge-button order-button'>去评价</Button>
-      //         </div>
-      //     )
-      default:
-        return (
-          <div> </div>
-        )
+                      ])
+                    }}>确认收货</Button>
+                  )
+                }}
+              </Mutation>
+            </div>
+          )
+        // case '3':
+        //     return (
+        //         <div className='order-card-button-group'>
+        //             <Button size="small" className='judge-button order-button'>去评价</Button>
+        //         </div>
+        //     )
+        default:
+          return (
+            <div> </div>
+          )
+      }
+    }else {
+      return null
     }
   }
 
@@ -392,6 +430,103 @@ class ButtonGroupRender extends Component {
   }
 }
 
+class AdminUpdateOrder extends Component {
+  constructor(props) {
+    super(props)
+    this.state = {
+      expressId: '',
+      expressDetailName: '',
+    }
+  }
+
+  updateOrderLogistics = (updateorderlogistics, e) => {
+    const {order} = this.props
+    let {expressId, expressDetailName} = this.state
+    const deliveryTime = moment().format('YYYY-MM-DD HH:mm:ss')
+    let varObj = {
+      id: order.id,
+      orderLogistics_id: order.orderLogistics_id.id,
+      expressId,
+      expressDetailName,
+      deliveryTime,
+      updatedAt:deliveryTime,
+      orderStatus: '2',
+      LogisticsStatus: '已发货'
+    }
+
+    // console.log("updateOrderLogistics varObj",varObj)
+
+    updateorderlogistics({variables: varObj}).then((data)=>{
+      // console.log("updateorderlogistics data", data)
+      this.props.controlUpdateOrderModal(false, e)
+      if(data.data && data.data.updateorderLogistics.result === 'ok'){
+        message.success('订单更新成功')
+      }else {
+        message.error('订单更新失败,请稍后重试!')
+      }
+    })
+  }
+
+  render() {
+    const {order} = this.props
+    // console.log("AdminUpdateOrder order",order)
+    const { id } = order
+    let {expressId, expressDetailName} = this.state
+
+    return (
+      <div>
+        <List>
+          <InputItem
+            onChange={(e) => {
+              this.setState({expressDetailName: e})
+            }}
+            value={expressDetailName}
+            placeholder="请输入快递名称">
+            快递名称</InputItem>
+          <InputItem
+            onChange={(e) => {
+              this.setState({expressId: e})
+            }}
+            value={expressId}
+            placeholder="请输入快递单号">
+            快递单号
+          </InputItem>
+          <div className='list-others'>
+            <div className='spec-button-group'>
+              <Mutation
+                mutation={gql(update_order_logistics)}
+                refetchQueries={[{query: gql(orderbyprops), variables: {id}}]}
+              >
+                {(updateorderlogistics, {loading, error}) => {
+                  if (loading)
+                    return (
+                      <div className="loading">
+                        <div className="align">
+                          <ActivityIndicator text="加载中..." size="large"/>
+                        </div>
+                      </div>
+                    )
+                  if (error) return 'error'
+                  return (
+                    <Button
+                      type="primary"
+                      size="small"
+                      inline
+                      onClick={(e) => {
+                        this.updateOrderLogistics(updateorderlogistics, e)
+                      }}>
+                      更新
+                    </Button>
+                  )
+                }}
+              </Mutation>
+            </div>
+          </div>
+        </List>
+      </div>
+    )
+  }
+}
 
 export default withRouter(Display)
 export {

+ 2 - 1
src/pages/my/order/index.js

@@ -11,6 +11,7 @@ class Order extends Component {
 
     componentWillMount() {
         let {location} = this.props
+
         if (location && location.state) {
             if(['pay', 'ship', 'unbox', 'judge'].indexOf(location.state.kind)>-1) {
                 this.props.history.replace({
@@ -41,4 +42,4 @@ class Order extends Component {
     }
 }
 
-export default withRouter(Order)
+export default withRouter(Order)

+ 50 - 1
src/utils/gql.js

@@ -544,6 +544,7 @@ const orderbyprops = `
                 serviceStore
                 updatedAt
                 logisticsFee
+                expressDetailName
                 expressId
                 createdAt
     
@@ -648,6 +649,53 @@ const update_order = `
     }
 `
 
+const update_order_logistics = `
+    mutation updateorderlogistics($id: ID, $updatedAt: String, $orderStatus: String
+    $orderLogistics_id: ID, $deliveryTime: String, $serviceStore: String, $updatedAt: String, $where: orderLogistics_filter, $logisticsFee: Float, 
+    $expressDetailName: String, $expressId: String, $createdAt: String, $order_id: ID, 
+    $consigneeTel: String, $expressName: String, $consignAddress: String, $LogisticsStatus: String, $user_id: ID, $consigneeName: String
+    ) {
+        updateorder: update_order(id: $id updatedAt: $updatedAt orderStatus: $orderStatus) {
+            result
+            order {
+                remark
+                updatedAt
+                orderTotalPay
+                createdAt
+                orderStatus
+                id
+                count
+                productTotalPay
+            }
+        }
+        updateorderLogistics: update_orderLogistics(
+        id: $orderLogistics_id deliveryTime: $deliveryTime serviceStore: $serviceStore updatedAt: $updatedAt where: $where 
+        logisticsFee: $logisticsFee expressDetailName: $expressDetailName expressId: $expressId 
+        createdAt: $createdAt order_id: $order_id consigneeTel: $consigneeTel
+        expressName: $expressName consignAddress: $consignAddress LogisticsStatus: $LogisticsStatus 
+        user_id: $user_id consigneeName: $consigneeName) {
+            result
+            orderLogistics {
+                deliveryTime
+                serviceStore
+                updatedAt
+                logisticsFee
+                expressDetailName
+                expressId
+                createdAt
+    
+                consigneeTel
+                id
+                expressName
+                consignAddress
+                LogisticsStatus
+    
+                consigneeName
+            }
+        }
+    }
+`
+
 const delete_order = `
     mutation deleteorder($id: ID) {
         deleteorder: delete_order(id: $id)
@@ -1013,5 +1061,6 @@ export {
     create_admin,
     update_admin,
     delete_admin,
-    logisticsExpressId
+    logisticsExpressId,
+    update_order_logistics
 }