Browse Source

Merge remote-tracking branch 'origin/master'

Csy817 6 years ago
parent
commit
9b69be7471
5 changed files with 52 additions and 14 deletions
  1. 8 6
      src/App.js
  2. 4 0
      src/app.css
  3. 1 1
      src/pages/cart/empty/index.js
  4. 1 1
      src/pages/home/detail/index.js
  5. 38 6
      src/pages/my/order/index.js

+ 8 - 6
src/App.js

@@ -123,12 +123,14 @@ class App extends Component {
                         </Col>
                     </Row>
                 </div>
-                <Switch>
-                    <Route exact path="/" component={Home}/>
-                    <Route path="/home" component={Home}/>
-                    <Route path="/cart" component={Cart}/>
-                    <Route path="/my" component={My}/>
-                </Switch>
+                <div className='tabbar-route-content'>
+                    <Switch>
+                        <Route exact path="/" component={Home}/>
+                        <Route path="/home" component={Home}/>
+                        <Route path="/cart" component={Cart}/>
+                        <Route path="/my" component={My}/>
+                    </Switch>
+                </div>
             </div>
 
         )

+ 4 - 0
src/app.css

@@ -42,4 +42,8 @@ a {
 
 .navbar {
     border-bottom: 1px solid #f5f5f9;
+}
+
+.tabbar-route-content {
+    margin-bottom: 50px;
 }

+ 1 - 1
src/pages/cart/empty/index.js

@@ -18,7 +18,7 @@ class Empty extends Component {
                 <div>
                     <img src={cart_empty} alt="img" width={100}/>
                 </div>
-                <div>购物空空如也</div>
+                <div>购物空空如也</div>
                 <div>
                     <button className="empty-button"
                             onClick={() => {

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

@@ -88,7 +88,7 @@ class DetailRender extends Component {
                 </div>
                 <div className='detail-complicate-show'>详情详情</div>
                 <div className='detail-bottom'>
-                    <span className='detail-bottom-cart' onClick={()=>{this.props.history.push({pathname: '/cart'})}}><div className='detail-icon-wrap'><div className='detail-icon detail-icon-cart'/><div>购物</div></div></span>
+                    <span className='detail-bottom-cart' onClick={()=>{this.props.history.push({pathname: '/cart'})}}><div className='detail-icon-wrap'><div className='detail-icon detail-icon-cart'/><div>购物</div></div></span>
                     <span className='detail-bottom-home' onClick={()=>{this.props.history.push({pathname: '/home'})}}><div className='detail-icon-wrap'><div className='detail-icon detail-icon-shop'/><div>店铺</div></div></span>
                     <span className='detail-bottom-add' onClick={()=>{}}>加入购物车</span>
                     <span className='detail-bottom-buy' onClick={()=>{}}>立即购买</span>

+ 38 - 6
src/pages/my/order/index.js

@@ -6,10 +6,43 @@ import {withRouter} from 'react-router-dom'
 class Order extends Component {
     constructor(props) {
         super(props)
-        this.state = {}
+        this.state = {
+            navTitle: '',
+            page: 'pay'
+        }
+    }
+
+    componentWillMount() {
+        let {location} = this.props
+        if (location && location.state) {
+            let navTitle = ''
+            let page = location.state.page
+            switch (page) {
+                case 'pay':
+                    navTitle = '待付款'
+                    break
+                case 'ship':
+                    navTitle = '待发货'
+                    break
+                case 'unbox':
+                    navTitle = '待收货'
+                    break
+                case 'judge':
+                    navTitle = '待评价'
+                    break
+                default:
+                    navTitle = '无效页面'
+                    break
+            }
+            this.setState({
+                navTitle,
+                page
+            })
+        }
     }
 
     render() {
+        let {navTitle} = this.state
         return (
             <div className='order-wrap'>
                 <div className='order-navbar-wrap'>
@@ -17,11 +50,10 @@ class Order extends Component {
                         className='order-navbar'
                         mode="light"
                         icon={<Icon type="left"/>}
-                        onLeftClick={() => {this.props.history.push({pathname: '/my/all'})}}
-                        rightContent={[
-                            <Icon key="1" type="ellipsis"/>,
-                        ]}
-                    >订单详情</NavBar>
+                        onLeftClick={() => {
+                            this.props.history.push({pathname: '/my/all'})
+                        }}
+                    >{navTitle}</NavBar>
                 </div>
             </div>
         )