Browse Source

购物车为空时,增加调试文字以及跳转按钮

wly 7 years ago
parent
commit
a427cee3ee

+ 1 - 0
src/case/ShopApp/src/components/AddressPage/AddressPage.jsx

@@ -24,6 +24,7 @@ class AddressPage extends Component {
     this.getAddress=this.getAddress.bind(this)
   }
 
+
   componentDidMount(){
     let user_id=sessionStorage.getItem('openid')  
     this.getAddress({user_id})

+ 8 - 8
src/case/ShopApp/src/components/ShopCarPage/ShopCarPage.jsx

@@ -59,19 +59,19 @@ class ShopCarPage extends Component{
     }
 
     
-    // renderShopCarList(){
-    //     return this.state.shopCarList||[].map((item)=>{
-    //         return (<div>
-    //             <ShopCarCard car={item} key={item.id} deleteCarById={this.deleteCarById}/>
-    //             </div>)
-    //     })
-    // }
-    
     render(){
         return(
             <div className="shopCarPage">
                 <ActivityIndicator toast text="loading" animating={this.state.loading}/>
                 <NavBars navBarText="购物车" changePage={this.props.changePage} page="detail"/>
+                {
+                    this.state.shopCarList.length===0 ?
+                        <div style={{marginTop:'200px',padding:'1px',position:'relative',zIndex:'10',display:'flex',justifyContent:'center'}}>
+                            <div>购物车空空如也<span onClick={()=>this.props.changePage('index')} style={{color:'#108ee9'}}>去购物</span></div>
+                        </div>
+                        :
+                        ''
+                }
                 <div className="ShopCarList">
                     {/*this.renderShopCarList()*/}
                     <ShopCarCard shopCarList={this.state.shopCarList} deleteCarById={this.deleteCarById}/>