|
@@ -1,4 +1,5 @@
|
|
|
import React, { Component } from 'react';
|
|
import React, { Component } from 'react';
|
|
|
|
|
+import Card from './Card'
|
|
|
|
|
|
|
|
import {graphqls} from '../../api/graphql_request'
|
|
import {graphqls} from '../../api/graphql_request'
|
|
|
import {getProductById} from '../../api/graphql/product'
|
|
import {getProductById} from '../../api/graphql/product'
|
|
@@ -20,13 +21,15 @@ export default class ProductDetail extends Component{
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- componentDidMount(){
|
|
|
|
|
|
|
+ componentWillMount(){
|
|
|
this.getProduct()
|
|
this.getProduct()
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
render(){
|
|
render(){
|
|
|
return(
|
|
return(
|
|
|
<div>
|
|
<div>
|
|
|
- 商品详情页
|
|
|
|
|
|
|
+ <Card product={this.state.product}/>
|
|
|
</div>
|
|
</div>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|