diff --git a/src/component/filteredShopComponent/filteredShopComponent.js b/src/component/filteredShopComponent/filteredShopComponent.js index 39a03cc..732d958 100644 --- a/src/component/filteredShopComponent/filteredShopComponent.js +++ b/src/component/filteredShopComponent/filteredShopComponent.js @@ -44,7 +44,7 @@ class recommondShop extends Component { const slicedGoods = goods !==null?goods.slice(1):null const goodsElementsArray = goods !== null ? slicedGoods.map((item,index)=>{ return - + }):null return ( @@ -62,7 +62,7 @@ class recommondShop extends Component { - + {goods.length !== 1 ? goodsElementsArray: 商品: {ProductName} diff --git a/src/component/filteredShopComponent/filteredShopComponent.scss b/src/component/filteredShopComponent/filteredShopComponent.scss index bdd3bc5..8ee7b19 100644 --- a/src/component/filteredShopComponent/filteredShopComponent.scss +++ b/src/component/filteredShopComponent/filteredShopComponent.scss @@ -48,34 +48,33 @@ .body{ border-bottom:1px solid #F2F2F2; display: flex; + flex-wrap: nowrap; font-size: 35px; .shop-img{ - padding: 20px; - Image{ - height: 200px; + margin:20px; + text-align: center; + height: 200px; width: 200px; - } + } .details{ font-size: 30px; margin-left: 30px; .details-block{ margin-top: 30px; - .details-text{ - font-weight: bold; } } } .goods-img-box{ - display: flex; - flex-wrap: nowrap; + flex:1; margin-top: 20px; + .goods-img{ border: 1px solid #ddd; - width: 80px; - height: 80px; + width: 90px; + height: 90px; margin: 10px } } diff --git a/src/component/searchBarComponent/searchBarComponent.js b/src/component/searchBarComponent/searchBarComponent.js index f6cc35d..560017e 100644 --- a/src/component/searchBarComponent/searchBarComponent.js +++ b/src/component/searchBarComponent/searchBarComponent.js @@ -8,12 +8,14 @@ import './searchBarComponent.scss' -class searchBarComponent extends Component { +class SearchBarComponent extends Component { + config = { navigationBarTitleText: 'searchBarComponent' } constructor() { + super(...arguments) this.state = { value: '' @@ -41,4 +43,4 @@ class searchBarComponent extends Component { } } -export default searchBarComponent +export default SearchBarComponent diff --git a/src/component/searchBarComponent/searchBarComponent.scss b/src/component/searchBarComponent/searchBarComponent.scss index 34a3c6d..b0d7519 100644 --- a/src/component/searchBarComponent/searchBarComponent.scss +++ b/src/component/searchBarComponent/searchBarComponent.scss @@ -1,10 +1,8 @@ -.searchBarComponent{ - - .search-button{ - .at-search-bar__action { - background-color:#FF9900; - } - } +.search-button{ + .at-search-bar__action{ + background-color: #FF9900 + } + } diff --git a/src/component/shopItemComponent/shopItemComponent.js b/src/component/shopItemComponent/shopItemComponent.js index c66f92e..cbb7b31 100644 --- a/src/component/shopItemComponent/shopItemComponent.js +++ b/src/component/shopItemComponent/shopItemComponent.js @@ -16,18 +16,20 @@ class ShopItem extends Component { 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 const oldPrice = this.props.item ? this.props.item.goods_org_price : null const name = this.props.item ? this.props.item.goods_name : null const browseTimes = this.props.item ? this.props.item.browse_times : null - + const goodType = this.props.item ? this.props.item.goods_type_name:null return ( + + {goodType} + - + ¥{newPrice+' '} @@ -40,15 +42,14 @@ class ShopItem extends Component { - - 0 + + 0 + | - - {browseTimes} + + {browseTimes} - - diff --git a/src/component/shopItemComponent/shopItemComponent.scss b/src/component/shopItemComponent/shopItemComponent.scss index 52e14d8..622d12c 100644 --- a/src/component/shopItemComponent/shopItemComponent.scss +++ b/src/component/shopItemComponent/shopItemComponent.scss @@ -2,18 +2,29 @@ .shopitem-box{ padding:5%; border:1px solid #eee; + position: relative; + box-shadow: 0 10px 10px #ddd; + border-radius: 6px; + .goods-type{ + position: absolute; + top:0; + right: 0; + font-size: 25px; + padding: 0 10px; + background: #999; + color: #fff; + } .image-box{ text-align: center; - .img{ - width: 80%; - height:400px; + height: 400px; + width: 100%; - } } .price-box{ + font-weight: bold; .new-price{ - color:red; - font-size: 28px + color:#c00; + font-size: 30px } .old-price{ color:#999; @@ -22,26 +33,35 @@ } } .itemname-box{ + border-bottom: 1px solid #DADADA; + margin-top: 10px; .name{ - font-size: 30px + font-size: 30px; + } } .addon-box{ display: flex; font-size: 30px; margin-top: 10px; + color: #999; .basket{ margin:0 5px; - .title{ - margin-left: 5px + + .amount{ + color:#c49173; + margin-left: 5px; + vertical-align:middle; } } .browse-time{ margin:0 5px; - .title{ - margin-left: 5px + + .amount{ + margin-left: 5px; + vertical-align:middle; } } diff --git a/src/pages/goods/goods.js b/src/pages/goods/goods.js index 5b43e8f..ccb6be2 100644 --- a/src/pages/goods/goods.js +++ b/src/pages/goods/goods.js @@ -1,8 +1,10 @@ import Taro, { Component } from '@tarojs/taro' import { View, Button, Text, Image } from '@tarojs/components' -import { AtSearchBar, AtTabs, AtTabsPane,AtSegmentedControl } from 'taro-ui' +import { AtSearchBar, AtTabs, AtTabsPane, AtSegmentedControl, AtIcon, AtToast ,Picker } from 'taro-ui' import copyrightComponent from '../../component/copyrightComponent/copyrightComponent' +import SearchBarComponent from '../../component/searchBarComponent/searchBarComponent' +import URL from '../../serviceAPI.config' import './goods.scss' @@ -20,6 +22,9 @@ class Goods extends Component { value:'', current: 0, subCurrent:0, + isOpened:false, + selector: ['0', '1', '2', '3'], + selectorChecked: '0', }} @@ -29,12 +34,24 @@ class Goods extends Component { current: value }) } - subHandleClick(value) { + onClick(value) { this.setState({ subCurrent: value }) } - + goShopPage(){ + Taro.navigateTo({ + url: '/pages/shop/shop' + }) + } + saveItem(){ + this.setState({isOpened:true}) + } + onChange = e => { + this.setState({ + selectorChecked: this.state.selector[e.detail.value] + }) + } componentDidMount() { } @@ -54,16 +71,9 @@ class Goods extends Component { return ( - - - + - + @@ -111,54 +121,67 @@ class Goods extends Component { - + {/* 可选规格 >点击 + */} + + + + 可选规格: + + {this.state.selectorChecked} + + + + - - - 标签页一的内容 + + + 商品细节: { /*子标签Tab*/} - { - this.state.current === 0 - ? 标签1的内容 + this.state.subCurrent === 0 + ? + 全部 + : null } { - this.state.current === 1 - ? 标签2的内容 + this.state.subCurrent === 1 + ? 好评 : null } { - this.state.current === 2 - ? 标签3的内容 + this.state.subCurrent === 2 + ? 中评 : null } { - this.state.current === 3 - ? 标签4的内容 + this.state.subCurrent === 3 + ? 差评 : null } { - this.state.current === 4 - ? 标签5的内容 + this.state.subCurrent === 4 + ? 公开 : null } { - this.state.current === 5 - ? 标签6的内容 + this.state.subCurrent === 5 + ? 匿名 : null } @@ -175,11 +198,18 @@ class Goods extends Component { - - 进店 + + + 进店 - - 收藏商品 + + + + 收藏商品 加入购物车 @@ -187,8 +217,6 @@ class Goods extends Component { - - ) } diff --git a/src/pages/goods/goods.scss b/src/pages/goods/goods.scss index 4e321a0..40bd867 100644 --- a/src/pages/goods/goods.scss +++ b/src/pages/goods/goods.scss @@ -3,7 +3,7 @@ .img-box{ border: 1px solid #ddd; - padding: 5px 0; + padding: 20px 0; text-align: center; .img{ height: 700px; @@ -48,7 +48,8 @@ } .price{ font-size: 40px; - color:red + color: #c00; + } } } @@ -72,6 +73,7 @@ } .counter-box{ + width: 100%; display: flex; flex-direction: row; flex-wrap: nowrap; @@ -84,7 +86,7 @@ .amount{ display: inline-block; margin-left: 20px; - color:red; + color: #c00; font-weight: bold } } @@ -93,14 +95,16 @@ } } .standard-box{ - border: 1px solid #ddd; + + .picker{ + border: 1px solid #ddd; padding: 10px 0; color:#999; font-size: 25px; - display: flex; + display: flex; flex-direction: row; flex-wrap: nowrap; - .title{ + .title{ flex:1; font-weight: bold; margin-left: 20px; @@ -113,6 +117,9 @@ margin-right: 20px; } + } + + } .copyright-box{ @@ -137,8 +144,8 @@ flex-wrap: nowrap; flex-direction: row; text-align: center; - height: 60px; - line-height: 60px; + height: 90px; + line-height: 90px; font-size: 30px; .to-shop{ @@ -151,6 +158,13 @@ flex:1; background-color: #FF9500; color: white; + .icon{ + vertical-align: middle + } + .title{ + display: inline-block; + margin-left: 10px; + } } .add-cart{ @@ -159,7 +173,5 @@ color: white; } } - } - diff --git a/src/pages/goodsPublish/goodsPublish.js b/src/pages/goodsPublish/goodsPublish.js index 7c56903..2970e0e 100644 --- a/src/pages/goodsPublish/goodsPublish.js +++ b/src/pages/goodsPublish/goodsPublish.js @@ -1,7 +1,8 @@ import Taro, { Component } from '@tarojs/taro' import { View, Button, Text, Input, Radio, RadioGroup, Label } from '@tarojs/components' -import { AtInput, AtForm, AtImagePicker, AtTextarea, AtRadio, AtButton } from 'taro-ui' +import { AtInput, AtForm, AtImagePicker, AtTextarea, AtRadio, AtButton, Picker } from 'taro-ui' +import SearchBarComponent from '../../component/searchBarComponent/searchBarComponent' import copyrightComponent from '../../component/copyrightComponent/copyrightComponent' @@ -15,6 +16,8 @@ class GoodsPublish extends Component { constructor() { super(...arguments) this.state = { + selector: ['需求', '供应', '人才'], + selectorChecked: '需求', files: [{ url: 'https://jimczj.gitee.io/lazyrepay/aragaki1.jpeg', }, @@ -49,7 +52,11 @@ class GoodsPublish extends Component { ] } } - + onChange1 = e => { + this.setState({ + selectorChecked: this.state.selector[e.detail.value] + }) + } onChange(files) { this.setState({ files @@ -75,21 +82,37 @@ class GoodsPublish extends Component { render() { return ( + + - - + + + + + + + *商品分类: {this.state.selectorChecked} + + + + + + + + + * - - + + * + + + * + + + + * 上传图片: @@ -123,9 +153,11 @@ class GoodsPublish extends Component { + - 商品分类: + * + 店铺分类: @@ -194,10 +226,10 @@ class GoodsPublish extends Component { 发布 - 发布并新增 + 发布并新增 - 商品列表 + 商品列表 diff --git a/src/pages/goodsPublish/goodsPublish.scss b/src/pages/goodsPublish/goodsPublish.scss index 047708c..99f59dc 100644 --- a/src/pages/goodsPublish/goodsPublish.scss +++ b/src/pages/goodsPublish/goodsPublish.scss @@ -80,5 +80,27 @@ } + .button-a{ + background-color:#5cb85c; + border:1PX solid #5cb85c; + } } +} +.page-section{ + border-bottom: 1Px solid #d6e4ef; + +} +.selected{ + display: inline-block; + margin-left: 20%; + font-size: 32rpx +} +.input-box{ + border-bottom: 1Px solid #d6e4ef; + display: flex; +} +.require{ + color:red; + line-height:100rpx; + } \ No newline at end of file diff --git a/src/pages/home/home.js b/src/pages/home/home.js index aaf1948..eb62d9a 100644 --- a/src/pages/home/home.js +++ b/src/pages/home/home.js @@ -18,6 +18,7 @@ class Home extends Component { shopsDetails: '', ads: '', categories: '', + subCate:[], demanding: '', otherData:'' } @@ -110,7 +111,7 @@ class Home extends Component { {item.sd_title} - {item.user_address} + {item.user_address||'无地址'} 业主:{item.user_name} @@ -124,20 +125,20 @@ class Home extends Component { const adsImgElementsArray = this.state.ads?this.state.ads.map((item, index) => { return - + }):null // 这里应该代码可以优化----- const categoriesElementsArray1 = this.state.categories?this.state.categories[0].map((item, index) => { return - + {item.class_name} }):null const categoriesElementsArray2 = this.state.categories?this.state.categories[1].map((item, index) => { return - + {item.class_name} }):null @@ -145,22 +146,22 @@ class Home extends Component { return }):null - const subCateElementsArray = this.state.subCate?this.state.subCate.map((item, index) => { + const subCateElementsArray = this.state.subCate.length?this.state.subCate.map((item, index) => { return {item.class_name} }):null - + console.log(this.state.subCate) return ( - {/* 第一行图片滚动条 */} + // autoplay + > {categoriesElementsArray1} @@ -196,6 +198,7 @@ class Home extends Component { {/* 第三行图片滚动条 */} - + + + + @@ -233,19 +239,18 @@ class Home extends Component { {demandingElemensArray} - - - - - + {this.state.subCate.length ? 4.5 ? 4.5 : this.state.subCate.length} > {subCateElementsArray} - + :null} diff --git a/src/pages/home/home.scss b/src/pages/home/home.scss index d0b62be..fd8b6c7 100644 --- a/src/pages/home/home.scss +++ b/src/pages/home/home.scss @@ -1,8 +1,13 @@ .home{ overflow: hidden; - .banner-img{ - width: 100% + .first-banner ,.third-banner{ + .banner-img{ + height: 100%; + width: 100%; } + + } + } @@ -110,27 +115,32 @@ flex-wrap: wrap; flex-direction: row; text-align: center; - font-size:30px; + font-size:28px; + margin-top: 10px; .category-item{ width: 20%; - margin-top: 20px; + height: 50%; + margin-top: 10px; + Image{ + height: 75px; + width: 75px; + } } } } .second-banner-level2{ .swipper{ - height: 80px; text-align: center; font-size: 30px; border-bottom:1px solid #F2F2F2; + .text{ margin-top: 20px } } + } -.swipper{ - margin-bottom: 20px; -} + .swiper-sub{ margin-bottom: 0px; } \ No newline at end of file diff --git a/src/pages/index/index.js b/src/pages/index/index.js index d1d7917..4bb4943 100644 --- a/src/pages/index/index.js +++ b/src/pages/index/index.js @@ -21,7 +21,6 @@ import './index.scss' } })) class Index extends Component { - config = { navigationBarTitleText: '首页' } @@ -29,7 +28,9 @@ class Index extends Component { //http://ihome6.com/Shop-supplyShops componentDidMount(){ Taro.navigateTo({ - url: '/pages/home/home' + // url: '/pages/home/home' + // url: '/pages/goodsPublish/goodsPublish' + url: '/pages/goods/goods' }) } componentWillReceiveProps (nextProps) { diff --git a/src/pages/mySupplyDemand/mySupplyDemand.js b/src/pages/mySupplyDemand/mySupplyDemand.js index 426d373..77d186a 100644 --- a/src/pages/mySupplyDemand/mySupplyDemand.js +++ b/src/pages/mySupplyDemand/mySupplyDemand.js @@ -125,7 +125,7 @@ class MySupplyDemand extends Component { 搜索 - + 新增 @@ -166,7 +166,7 @@ class MySupplyDemand extends Component { 编辑 - 删除 + 删除 diff --git a/src/pages/mySupplyDemand/mySupplyDemand.scss b/src/pages/mySupplyDemand/mySupplyDemand.scss index bc1eee8..9ade668 100644 --- a/src/pages/mySupplyDemand/mySupplyDemand.scss +++ b/src/pages/mySupplyDemand/mySupplyDemand.scss @@ -73,8 +73,11 @@ .at-button--primary{ background-color:#FF9500; border:1PX solid #FF9500; - - + } + .button-a{ + + background-color:#5cb85c; + border:1PX solid #5cb85c; } } } @@ -88,6 +91,9 @@ View{ margin:10px } + .demand-title{ + .info{color:#337ab7; } + } .info-button-box{ display: flex; flex-wrap: nowrap; @@ -103,6 +109,11 @@ background-color:#FF9500; border:1PX solid #FF9500; } + .button-a{ + + background-color:#d9534f; + border:1PX solid #d9534f; + } } } diff --git a/src/pages/shop/shop.js b/src/pages/shop/shop.js index 99362ba..a890d5a 100644 --- a/src/pages/shop/shop.js +++ b/src/pages/shop/shop.js @@ -23,7 +23,7 @@ class Shop extends Component { FilterText:'', filterBar:['综合排序','销量','新品','价格','人气'], selectedFilterValue:0, - isShowFilter:true, + isShowFilter:false, 综合排序:true, 销量:false, 新品:false, @@ -266,8 +266,8 @@ class Shop extends Component { /> - - {shopName} + + {/* {shopName} */} diff --git a/src/pages/shop/shop.scss b/src/pages/shop/shop.scss index 5fd8a7d..b8a31e6 100644 --- a/src/pages/shop/shop.scss +++ b/src/pages/shop/shop.scss @@ -15,7 +15,6 @@ font-size: 50px } } - .nav-box{ background-color: black; @@ -115,7 +114,7 @@ .shop-item{ box-sizing:border-box; width: 50%; - padding:5px; + padding:10px; } diff --git a/src/pages/supplyDemandPubish/supplyDemandPubish.js b/src/pages/supplyDemandPubish/supplyDemandPubish.js index b927b88..385b435 100644 --- a/src/pages/supplyDemandPubish/supplyDemandPubish.js +++ b/src/pages/supplyDemandPubish/supplyDemandPubish.js @@ -2,6 +2,8 @@ import Taro, { Component } from '@tarojs/taro' import { View, Button, Text } from '@tarojs/components' import { AtInput, AtForm, AtImagePicker, AtTextarea, AtRadio, AtButton, Picker} from 'taro-ui' +import SearchBarComponent from '../../component/searchBarComponent/searchBarComponent' + import copyrightComponent from '../../component/copyrightComponent/copyrightComponent' @@ -21,20 +23,52 @@ class SupplyDemand extends Component { selectorChecked: '需求', selector1: ['上架', '下架'], selectorChecked1: '上架', + addImg:true, + files: [{ + url: 'https://jimczj.gitee.io/lazyrepay/aragaki1.jpeg', + }, + { + url: 'https://jimczj.gitee.io/lazyrepay/aragaki2.jpeg', + }, + { + url: 'https://jimczj.gitee.io/lazyrepay/aragaki3.png', + }] } } - onChange = e => { - this.setState({ - selectorChecked: this.state.selector[e.detail.value] - }) - } + // onChange = e => { + // this.setState({ + // selectorChecked: this.state.selector[e.detail.value] + // }) + // } onChange1 = e => { this.setState({ selectorChecked1: this.state.selector1[e.detail.value] }) } + onChange(files, operationType,index) { + console.log(files, operationType,index) + if (operationType==='add'){ + this.setState({ + files + }, () => { + if (this.state.files.length === 4) { + this.setState({ addImg: false }) + } + }) + } + if (operationType === 'remove'){ + this.state.files.splice(index, 1); + this.setState({ files: this.state.files }); + } + } + onFail(mes) { + console.log(mes) + } + onImageClick(index, file) { + console.log(index, file) + } componentWillReceiveProps(nextProps) { console.log(this.props, nextProps) } @@ -48,6 +82,7 @@ class SupplyDemand extends Component { render() { return ( + @@ -92,16 +127,13 @@ class SupplyDemand extends Component { onChange={this.handleChange.bind(this)} /> - - - 联系地址: - + @@ -114,7 +146,7 @@ class SupplyDemand extends Component { value={this.state.value} onChange={this.handleChange.bind(this)} maxlength='200' - placeholder='你的产品简介' + placeholder='' /> @@ -125,13 +157,12 @@ class SupplyDemand extends Component { - @@ -156,10 +187,11 @@ class SupplyDemand extends Component { 发布 - 发布并新增 + + 发布并新增 - 商品列表 + 商品列表 diff --git a/src/pages/supplyDemandPubish/supplyDemandPubish.scss b/src/pages/supplyDemandPubish/supplyDemandPubish.scss index 451f0de..3487ea3 100644 --- a/src/pages/supplyDemandPubish/supplyDemandPubish.scss +++ b/src/pages/supplyDemandPubish/supplyDemandPubish.scss @@ -30,8 +30,10 @@ .at-button--primary{ background-color:#FF9500; border:1PX solid #FF9500; - - + } + .button-a{ + background-color:#5cb85c; + border:1PX solid #5cb85c; } } } @@ -57,9 +59,7 @@ } .page-section{ border-bottom: 1Px solid #d6e4ef; - .picker{ - padding: 24rpx 0 - } + } .selected{ display: inline-block;