add goods page and goodpublish page

This commit is contained in:
2018-12-06 17:24:34 +08:00
parent d1d31e00d5
commit 1b48b7b55a
14 changed files with 800 additions and 54 deletions

View File

@@ -19,10 +19,18 @@ class bottomNav extends Component {
}
handleClick(value){
this.setState({
current: value
})
let path=this.props.otherData.menu[value].url
const otherData = [
{ name: '首页', url: '/pages/home/home' },
{ name: '商品发布', url: '/pages/goodsPublish/goodsPublish' },
{ name: '供求发布', url: '/pages/supplyDemandPubish/supplyDemandPubish' },
{ name: '我的供求', url: '/pages/mySupplyDemand/mySupplyDemand' },
{ name: '更多', url: '' },
]
let path=otherData[value].url
Taro.navigateTo({
url: path,
})
@@ -40,10 +48,17 @@ class bottomNav extends Component {
componentDidHide() { }
render() {
const otherDataElementsArray = this.props.otherData? this.props.otherData.menu.map((item, index) => {
const otherData=[
{ name: '首页', url:'pages/home/home'},
{ name: '商品发布', url:'pages/shop/shop'},
{name:'供求发布',url:''},
{name:'我的供求',url:''},
{name:'更多',url:''},
]
// const otherDataElementsArray = this.props.otherData? this.props.otherData.menu.map((item, index) => {
const otherDataElementsArray = otherData.map((item, index) => {
return { title: item.name, iconType: 'clock' }
}):null
})
return (
<View >
<AtTabBar className='bottom-nav'

View File

@@ -41,8 +41,8 @@ class recommondShop extends Component {
const ads = this.props.shop ? this.props.shop.ads:null
// const consultText = this.props.shop.wx_open
const voucherLeft = this.props.shop?this.props.shop.left_nums:null
const goodsElementsArray=goods!==null?goods.slice(1).map((item,index)=>{
const slicedGoods = goods !==null?goods.slice(1):null
const goodsElementsArray = goods !== null ? slicedGoods.map((item,index)=>{
return <View className='goods-img-box' key={index}>
<Image className='goods-img' src={URL.Base+item.goods_url} />
</View>

View File

@@ -11,6 +11,12 @@ class ShopItem extends Component {
shopOnClickHanlder(){
Taro.navigateTo({
url: '/pages/goods/goods?id=123&name=michael'
})
}
render() {
const imgURL =this.props.item? URL.Base +this.props.item.goods_url:null
const newPrice = this.props.item ? this.props.item.goods_price : null
@@ -19,7 +25,7 @@ class ShopItem extends Component {
const browseTimes = this.props.item ? this.props.item.browse_times : null
return (
<View className='shopitem-box'>
<View className='shopitem-box' onClick={this.shopOnClickHanlder.bind(this)}>
<View className='image-box'>
<Image className='img' src={imgURL}/>
</View>