|
|
@@ -8,8 +8,8 @@ import {getSlidesByProps} from './api/graphql/slides'
|
|
|
|
|
|
import TabBarBottom from './components/App/TabBarBottom'
|
|
|
import HomePage from './components/HomePage/HomePage'
|
|
|
-
|
|
|
import UserPage from './components/UserPage/userPage'
|
|
|
+import StoreDetailPage from './components/StoreDetailPage/StoreDetailPage'
|
|
|
|
|
|
|
|
|
class OrderApp extends Component {
|
|
|
@@ -19,9 +19,11 @@ class OrderApp extends Component {
|
|
|
this.state={
|
|
|
page:'home',
|
|
|
store:[],
|
|
|
- slide:[]
|
|
|
+ slide:[],
|
|
|
+ currentStore:{}
|
|
|
}
|
|
|
this.changePage=this.changePage.bind(this)
|
|
|
+ this.setCurrentStore=this.setCurrentStore.bind(this)
|
|
|
}
|
|
|
|
|
|
componentDidMount(){
|
|
|
@@ -32,6 +34,11 @@ class OrderApp extends Component {
|
|
|
changePage(page){
|
|
|
this.setState({page})
|
|
|
}
|
|
|
+ //
|
|
|
+ setCurrentStore(store){
|
|
|
+ console.log(store)
|
|
|
+ this.setState({currentStore:store})
|
|
|
+ }
|
|
|
|
|
|
getStores(){
|
|
|
//获取所有商家
|
|
|
@@ -59,7 +66,7 @@ class OrderApp extends Component {
|
|
|
return(
|
|
|
<div className="pageWrap">
|
|
|
<div className="scrollPage">
|
|
|
- <HomePage changePage={this.changePage} store={this.state.store} slide={this.state.slide}/>
|
|
|
+ <HomePage changePage={this.changePage} store={this.state.store} slide={this.state.slide} setCurrentStore={this.setCurrentStore}/>
|
|
|
</div>
|
|
|
</div>
|
|
|
)
|
|
|
@@ -72,6 +79,15 @@ class OrderApp extends Component {
|
|
|
</div>
|
|
|
</div>
|
|
|
)
|
|
|
+
|
|
|
+ case ('detail'):
|
|
|
+ return(
|
|
|
+ <div className="pageWrap">
|
|
|
+ <div className="scrollPage">
|
|
|
+ <StoreDetailPage changePage={this.changePage} store={this.state.currentStore}/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
|
|
|
default:
|
|
|
return(
|