Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/pages/cart/index.js
Csy817 6 năm trước cách đây
mục cha
commit
a3cde72139

+ 6 - 2
src/pages/my/all/index.js

@@ -70,7 +70,7 @@ class All extends Component {
     }
 
     render() {
-        let {changePageInMy} = this.props;
+        let {changePageInMy, changeTabBar} = this.props;
         return (
             <div className='my-wrap all'>
                 <div className='avatar-area'>
@@ -101,7 +101,11 @@ class All extends Component {
                               columnNum={4}
                               hasLine={false}
                               onClick={(tools) => {
-                                  changePageInMy('tools', {id: tools.id})
+                                  if(tools.id === 'cart') {
+                                      changeTabBar('cart')
+                                  } else {
+                                      changePageInMy('tools', {id: tools.id})
+                                  }
                               }}
                         />
                     </div>

+ 2 - 2
src/pages/my/index.js

@@ -24,10 +24,10 @@ class My extends Component {
 
     renderPage = () => {
         let {page, param} = this.state
-
+        let {changeTabBar} = this.props
         switch (page) {
             case 'all':
-                return <All changePageInMy={this.changePageInMy} {...param}/>
+                return <All changePageInMy={this.changePageInMy} changeTabBar={changeTabBar} {...param}/>
             case 'order':
                 return <Order changePageInMy={this.changePageInMy} {...param}/>
             case 'tools':

+ 0 - 0
src/pages/my/tools/address/index.css


+ 21 - 0
src/pages/my/tools/address/index.js

@@ -0,0 +1,21 @@
+import {Component} from "react"
+import React from "react"
+
+class Address extends Component {
+    constructor(props) {
+        super(props)
+        this.state = {
+
+        }
+    }
+
+    render() {
+        return (
+            <div>
+                Address
+            </div>
+        )
+    }
+}
+
+export default Address

+ 34 - 3
src/pages/my/tools/index.js

@@ -1,15 +1,43 @@
 import React, {Component} from 'react'
 import './index.css'
 import {NavBar, Icon} from 'antd-mobile'
+import Message from './message'
+import Address from './address'
 
 class Tools extends Component {
     constructor(props) {
         super(props)
-        this.state = {}
+        this.state = {
+            page: ''
+        }
+    }
+
+    renderPage = (id) => {
+        switch (id) {
+            case 'address':
+                return <Address />
+            case 'message':
+                return <Message />
+            default:
+                return <div>此页面后不该出现</div>
+        }
     }
 
     render() {
-        let {changePageInMy} = this.props
+        let {changePageInMy, id} = this.props
+        let navTitle = ''
+        switch (id) {
+            case 'address':
+                navTitle = '地址管理'
+                break
+            case 'message':
+                navTitle = '系统通知'
+                break
+            default:
+                navTitle = '无效页面'
+                break
+        }
+
         return (
             <div className='tools-wrap'>
                 <div className='tools-navbar-wrap'>
@@ -21,8 +49,11 @@ class Tools extends Component {
                         rightContent={[
                             <Icon key="1" type="ellipsis"/>,
                         ]}
-                    >工具详情</NavBar>
+                    >{navTitle}</NavBar>
                 </div>
+                {
+                    this.renderPage(id)
+                }
             </div>
         )
     }

+ 0 - 0
src/pages/my/tools/message/index.css


+ 21 - 0
src/pages/my/tools/message/index.js

@@ -0,0 +1,21 @@
+import {Component} from "react"
+import React from "react"
+
+class Message extends Component {
+    constructor(props) {
+        super(props)
+        this.state = {
+
+        }
+    }
+
+    render() {
+        return (
+            <div>
+                Message
+            </div>
+        )
+    }
+}
+
+export default Message