瀏覽代碼

Merge remote-tracking branch 'origin/master'

Csy817 6 年之前
父節點
當前提交
e320bd7215

+ 1 - 5
src/pages/home/detail/index.js

@@ -33,10 +33,7 @@ class Detail extends Component {
                         className='detail-navbar'
                         mode="light"
                         icon={<Icon type="left"/>}
-                        onLeftClick={() => {this.props.history.push({pathname: '/'})}}
-                        rightContent={[
-                            <Icon key="1" type="ellipsis"/>,
-                        ]}
+                        onLeftClick={() => {this.props.history.go(-1)}}
                     >商品详情</NavBar>
                 </div>
 
@@ -53,7 +50,6 @@ class Detail extends Component {
                             if (error) {
                                 return 'error!'
                             }
-
                             return (
                                 <DetailRender data={data.productbyid} history={this.props.history}/>
                             )

+ 1 - 1
src/pages/home/kind/index.js

@@ -36,7 +36,7 @@ class Kind extends Component {
                         className='kind-navbar'
                         mode="light"
                         icon={<Icon type="left"/>}
-                        onLeftClick={() => {this.props.history.push({pathname: '/'})}}
+                        onLeftClick={() => {this.props.history.go(-1)}}
                     >商品分类</NavBar>
                 </div>
                 <div className='kind-search-wrap'>

+ 1 - 1
src/pages/my/order/detail/index.css

@@ -32,7 +32,7 @@
     left: 50%;
     width: 90%;
     transform: translate(-50%, -50%);
-    border-radius: 10px;
+    border-radius: 5px;
     border: 1px solid #F3F3F3;
     box-shadow: 0 1px 10px #F3F3F3;
     padding: 20px 5px;

+ 14 - 10
src/pages/my/order/detail/index.js

@@ -66,21 +66,25 @@ class Detail extends Component {
 
     productsRender = (data) => {
         return (
-            data.map(data=> (
-                <div onClick={()=>{
-                    this.props.history.push({
-                        pathname: '/home/detail',
-                        state: {
-                            id: data.id
-                        }
-                    })
-                }}>
+            data.map(data => (
+                <div
+                    key={data.id}
+                    onClick={() => {
+                        this.props.history.push({
+                            pathname: '/home/detail',
+                            state: {
+                                id: data.product_id.id
+                            }
+                        })
+                    }}>
                     <Row style={{width: '100%'}}>
                         <Col span={6} style={{height: '100px'}}>
-                            <div className='order-product-img' style={{backgroundImage: `url('${data.product_id.img}')`}}/>
+                            <div className='order-product-img'
+                                 style={{backgroundImage: `url('${data.product_id.img}')`}}/>
                         </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>
                         </Col>
                     </Row>
                 </div>

+ 2 - 3
src/utils/gql.js

@@ -164,9 +164,8 @@ const orderbyprops = `
     }
 `
 const orderProduct_by_props = `
-    query orderProductbyprops($remark: String, $updatedAt: String, $product_id: ID, $orderPay: Float, $createdAt: String, $order_id: ID, $count: Int, $productPay: Float, $user_id: ID) {
-        orderProductbyprops: orderProduct_by_props(remark: $remark updatedAt: $updatedAt product_id: $product_id orderPay: $orderPay createdAt: $createdAt order_id: $order_id count: $count productPay: $productPay user_id: $user_id) {
-            remark
+    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) {
             updatedAt
             unit
             product_id {