|
|
@@ -4,20 +4,38 @@ import './App.css';
|
|
|
|
|
|
import NavBars from './components/App/NavBar'
|
|
|
import TabBarBottom from './components/App/TabBarBottom'
|
|
|
+import ProductDetail from './components/ProductDetailPage/ProductDetail'
|
|
|
|
|
|
class ShopApp extends Component {
|
|
|
//showComponent
|
|
|
+ constructor(props){
|
|
|
+ super(props)
|
|
|
+ this.state={
|
|
|
+ page:'',
|
|
|
+ product_id:''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ renderPage(page=""){
|
|
|
+ if(page==='detail'){
|
|
|
+ return(<div className="pageWrap"><ProductDetail product_id={this.state.product_id}/></div>)
|
|
|
+ }else{
|
|
|
+ return(<div><TabBarBottom changePage={this.changePage.bind(this)}/></div>)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ changePage(page='',product_id){
|
|
|
+ this.setState({page,product_id})
|
|
|
+ }
|
|
|
render() {
|
|
|
return (
|
|
|
<div className="AppWrap">
|
|
|
<div className="phone6s">
|
|
|
<div className="App">
|
|
|
- <NavBars />
|
|
|
- <TabBarBottom />
|
|
|
+ <NavBars changePage={this.changePage.bind(this)}/>
|
|
|
+ {this.renderPage(this.state.page)}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
);
|
|
|
}
|
|
|
}
|