Ver Fonte

Merge remote-tracking branch 'origin/master'

Csy817 há 6 anos atrás
pai
commit
3e312e9e1a
3 ficheiros alterados com 50 adições e 27 exclusões
  1. 16 0
      src/pages/my/order/detail/index.css
  2. 11 9
      src/pages/my/order/detail/index.js
  3. 23 18
      src/utils/gql.js

+ 16 - 0
src/pages/my/order/detail/index.css

@@ -58,4 +58,20 @@
     color: black;
     font-size: 15px;
     line-height: 40px;
+}
+
+.detail-good-wrap {
+    background-color: white;
+    padding: 10px 0;
+    border: 1px solid #f3f3f3;
+}
+
+.detail-contact {
+    height: 40px;
+    width: 100%;
+    background-color: white;
+    padding: 0 15px;
+    line-height: 40px;
+    font-size: 15px;
+    text-align: center;
 }

+ 11 - 9
src/pages/my/order/detail/index.js

@@ -69,14 +69,8 @@ class Detail extends Component {
             data.map(data => (
                 <div
                     key={data.id}
-                    onClick={() => {
-                        this.props.history.push({
-                            pathname: '/home/detail',
-                            state: {
-                                id: data.product_id.id
-                            }
-                        })
-                    }}>
+                    className='detail-good-wrap'
+                >
                     <Row style={{width: '100%'}}>
                         <Col span={6} style={{height: '100px'}}>
                             <div className='order-product-img'
@@ -84,7 +78,14 @@ class Detail extends Component {
                         </Col>
                         <Col span={16} offset={2}>
                             <div className='order-product-name'>{data.product_id.name}</div>
-                            <div className='order-product-others'>数量:{data.count}&nbsp;规格:{data.productColor}</div>
+                            <div className='order-product-others'>
+                                <div>
+                                    数量:{data.count}&nbsp;规格:{data.productColor}
+                                </div>
+                                <div>
+                                    尺寸:{data.productSize}
+                                </div>
+                            </div>
                         </Col>
                     </Row>
                 </div>
@@ -146,6 +147,7 @@ class Detail extends Component {
                                     }
                                 }
                             </Query>
+                            <div className='detail-contact'>联系客服</div>
                         </div>
                     </div>
                 </div>

+ 23 - 18
src/utils/gql.js

@@ -164,30 +164,35 @@ const orderbyprops = `
     }
 `
 const orderProduct_by_props = `
-    query orderProductbyprops($updatedAt: String, $product_id: ID, $orderPay: Float, $createdAt: String, $order_id: ID, $count: Int, $productPay: Float, $user_id: ID) {
-        orderProductbyprops: orderProduct_by_props(updatedAt: $updatedAt product_id: $product_id orderPay: $orderPay createdAt: $createdAt order_id: $order_id count: $count productPay: $productPay user_id: $user_id) {
+    query orderProductbyprops($order_id: ID) {
+    orderProductbyprops: orderProduct_by_props(order_id: $order_id) {
+        updatedAt
+        productColor
+        unit
+        product_id {
+            category
             updatedAt
             unit
-            product_id {
-                category
-                updatedAt
-                unit
-                name
-                createdAt
-                status
-                id
-                intro
-                price
-                img
-                stock
-            }
-            orderPay
+            name
             createdAt
+            status
             id
-            count
-            productPay
+            intro
+            price
+            img
+            stock
         }
+        productSize
+        orderPay
+        createdAt
+        productImg
+        productName
+        productPrice
+        id
+        count
+        productPay
     }
+}
 `
 
 const create_order = `