diff --git a/src/app.js b/src/app.js index 7178312..b411d8e 100644 --- a/src/app.js +++ b/src/app.js @@ -23,8 +23,9 @@ class App extends Component { 'pages/shop/shop', 'pages/goods/goods', 'pages/goodsPublish/goodsPublish', - // 'pages/supplyDemandPubish/supplyDemandPubish', - // 'pages/mySupplyDemand/mySupplyDemand', + 'pages/supplyDemandPubish/supplyDemandPubish', + 'pages/mySupplyDemand/mySupplyDemand', + 'pages/allDemanding/allDemanding', ], window: { backgroundTextStyle: 'light', diff --git a/src/component/bottomNav/bottomNav.js b/src/component/bottomNav/bottomNav.js index 9b5f071..7f48ecf 100644 --- a/src/component/bottomNav/bottomNav.js +++ b/src/component/bottomNav/bottomNav.js @@ -51,7 +51,7 @@ class bottomNav extends Component { const otherData=[ { name: '首页', url:'pages/home/home'}, { name: '商品发布', url:'pages/shop/shop'}, - {name:'供求发布',url:''}, + { name: '供求发布', url:'pages/supplyDemandPubish/supplyDemandPubish'}, {name:'我的供求',url:''}, {name:'更多',url:''}, ] diff --git a/src/component/copyrightComponent/copyrightComponent.js b/src/component/copyrightComponent/copyrightComponent.js new file mode 100644 index 0000000..1413b9b --- /dev/null +++ b/src/component/copyrightComponent/copyrightComponent.js @@ -0,0 +1,33 @@ + +import Taro, { Component } from '@tarojs/taro' +import { View, Button, Text } from '@tarojs/components' + + +import './copyrightComponent.scss' + + + +class CopyrightComponent extends Component { + + config = { + navigationBarTitleText: 'copyrightComponent' + } + + render() { + return ( + + + + Copyright © 晨丰全屋定制商城 闽ICP备16007300号-2 + + + + + + + + ) + } +} + +export default CopyrightComponent diff --git a/src/component/copyrightComponent/copyrightComponent.scss b/src/component/copyrightComponent/copyrightComponent.scss new file mode 100644 index 0000000..e466605 --- /dev/null +++ b/src/component/copyrightComponent/copyrightComponent.scss @@ -0,0 +1,15 @@ +.copyright-box{ + + padding:0 20px; + .title{ + text-align: center; + line-height: 100px; + font-size: 25px; + + } + +} +.gap{ + + height:150px; + } \ No newline at end of file diff --git a/src/component/searchBarComponent/searchBarComponent.js b/src/component/searchBarComponent/searchBarComponent.js new file mode 100644 index 0000000..f6cc35d --- /dev/null +++ b/src/component/searchBarComponent/searchBarComponent.js @@ -0,0 +1,44 @@ + +import Taro, { Component } from '@tarojs/taro' +import { View, Button, Text } from '@tarojs/components' +import { AtSearchBar } from 'taro-ui' + + +import './searchBarComponent.scss' + + + +class searchBarComponent extends Component { + + config = { + navigationBarTitleText: 'searchBarComponent' + } + constructor() { + super(...arguments) + this.state = { + value: '' + } + } + onChange(value) { + this.setState({ + value: value + }) + } + + render() { + return ( + + + + + + ) + } +} + +export default searchBarComponent diff --git a/src/component/searchBarComponent/searchBarComponent.scss b/src/component/searchBarComponent/searchBarComponent.scss new file mode 100644 index 0000000..34a3c6d --- /dev/null +++ b/src/component/searchBarComponent/searchBarComponent.scss @@ -0,0 +1,10 @@ + +.searchBarComponent{ + + .search-button{ + .at-search-bar__action { + background-color:#FF9900; + } + } + +} diff --git a/src/pages/allDemanding/allDemanding.js b/src/pages/allDemanding/allDemanding.js new file mode 100644 index 0000000..ff0828b --- /dev/null +++ b/src/pages/allDemanding/allDemanding.js @@ -0,0 +1,209 @@ +import Taro, { Component } from '@tarojs/taro' +import { View, Text, Image } from '@tarojs/components' +import { AtInput, AtButton, Picker, AtIcon, AtLoadMore } from 'taro-ui' +import copyrightComponent from '../../component/copyrightComponent/copyrightComponent' + +import URL from '../../serviceAPI.config' +import './allDemanding.scss' + +import eyeIcon from '../../icons/eye.png' + + +let currentPage=1 +class AllDemanding extends Component { + config = { + navigationBarTitleText: '全部业主需求' + } + constructor() { + super(...arguments) + this.state = { + supplys:[], + isMore:'more', + selector: ['全部', '需求', '供应', '人才'], + selectorChecked: '全部', + selector1: ['全部', '上架', '下架'], + selectorChecked1: '全部', + dateSel: '2018-04-22', + + } + } + GetAllDemanding({ curr_page=1, page_count=20}) { + Taro.request({ + url: URL.GetAllDemanding, + method: 'POST', + dataType: 'json', + data: { + param: JSON.stringify({ + curr_page: curr_page, + page_count: page_count + }), + }, + header: { + 'content-type': 'application/x-www-form-urlencoded', + 'X-Requested-With': 'XMLHttpRequest' + } + }) + .then(res => { + if (res.data.supplys.length){ + const newSupplys=this.state.supplys.concat(res.data.supplys) + this.setState({ supplys: newSupplys, isMore: 'more'}) + }else{ + this.setState({ isMore:'noMore'}) + } + }) + } + handleLoadMore(){ + this.setState({isMore:'loading'}) + setTimeout(() => { + currentPage += 1 + this.GetAllDemanding({ curr_page: currentPage }) + + }, 1000); + + } + onChange = e => { + this.setState({ + selectorChecked: this.state.selector[e.detail.value] + }) + } + + onDateChange = e => { + this.setState({ + dateSel: e.detail.value + }) + } + + + componentWillReceiveProps(nextProps) { + console.log(this.props, nextProps) + } + componentDidMount(){ + this.GetAllDemanding({}) + + } + + componentWillUnmount() { } + + componentDidShow() { } + + componentDidHide() { } + + render() { + const allDemandingElementArray=this.state.supplys?this.state.supplys.map((item,index)=>{ + + return + + 业主:{item.user_name} + + {item.class_name+' '} + | + + {item.browse_times} + + + + + + + + {item.sd_title} + {item.sd_desc} + + + 抢单 + + + + + + + 没有数据 + 更新日期:{item.update_date} + + + + }):null + return ( + + + + + + + + *供求状态: {this.state.selectorChecked1} + + + + + + + + * + + + + + + + + + + + *开始日期: {this.state.dateSel} + + + + + + + + *结束日期: {this.state.dateSel} + + + + + + + + + + + + + + *供求状态: {this.state.selectorChecked1} + + + + + + + + + + + 搜索 + + + + {allDemandingElementArray} + + + + + ) + } +} + +export default AllDemanding diff --git a/src/pages/allDemanding/allDemanding.scss b/src/pages/allDemanding/allDemanding.scss new file mode 100644 index 0000000..5e18d3f --- /dev/null +++ b/src/pages/allDemanding/allDemanding.scss @@ -0,0 +1,129 @@ +.allDemanding{ + padding: 10px 20px; + font-size: 32rpx; + .require{ + color:red; + line-height:100rpx; +} + .at-input__container{ + color:black; + font-weight: bold; + .at-input__input{ + font-weight: normal + } + } + .page-section{ + border-bottom: 1Px solid #d6e4ef; + + .picker{ + // padding: 24rpx 0; + .selected{ + display: inline-block; + margin-left: 20%; + font-size: 32rpx + } + .title-box{ + .title{ + //color: #333; + margin-right:16rpx; + width:172rpx; + font-size:32rpx; + line-height:1.5; + vertical-align:middle; + text-align:left; + font-weight: bold; + } +} + } +} +.input-box{ + display: flex; + border-bottom: 1Px solid #d6e4ef; +} + +} +.picker-box{ + display: flex; + flex-wrap: nowrap; + flex-direction: row; + .picker-container{ + flex:1 + } +} +.button-box{ + .button{ + margin-top: 50px; + margin-bottom: 50px; + text-align: center; + + .at-button--primary{ + background-color:#FF9500; + border:1PX solid #FF9500; + } + } + +} +.demanding-box{ + .demanding-info{ + border: 1px solid #ddd; + border-radius: 3px; + box-shadow: 0 10px 10px #ddd; + margin-bottom: 20px; + font-size: 28rpx; + .header{ + display: flex; + padding:20px 20px 5px; + border-bottom: 1px solid #F2F2F2; + .name{ + flex:1 + } + .others{ + flex:1; + text-align: right; + .cate{ + color:#2196F3 + } + + } + } + .body{ + display: flex; + border-bottom: 1px solid #F2F2F2; + margin:20px 0; + .image-container{ + padding: 10px; + flex:1; + } + .detail{ + flex:2; + position: relative; + padding-right: 20px; + .title{ + font-weight: bold; + } + .button{ + position: absolute; + bottom: 0px; + right:20px; + } + } + + + } + .footer{ + display: flex; + margin:20px; + color:#999; + font-size: 25rpx; + .location{ + flex:1 + } + .time{ + flex:1 + } + + } + + } + +} diff --git a/src/pages/goods/goods.js b/src/pages/goods/goods.js index f7996a8..5b43e8f 100644 --- a/src/pages/goods/goods.js +++ b/src/pages/goods/goods.js @@ -1,6 +1,7 @@ import Taro, { Component } from '@tarojs/taro' import { View, Button, Text, Image } from '@tarojs/components' import { AtSearchBar, AtTabs, AtTabsPane,AtSegmentedControl } from 'taro-ui' +import copyrightComponent from '../../component/copyrightComponent/copyrightComponent' @@ -170,15 +171,8 @@ class Goods extends Component { - - - Copyright © 晨丰全屋定制商城 闽ICP备16007300号-2 - + - - - - diff --git a/src/pages/goodsPublish/goodsPublish.js b/src/pages/goodsPublish/goodsPublish.js index cbf75bb..7c56903 100644 --- a/src/pages/goodsPublish/goodsPublish.js +++ b/src/pages/goodsPublish/goodsPublish.js @@ -2,6 +2,7 @@ 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 copyrightComponent from '../../component/copyrightComponent/copyrightComponent' import './goodsPublish.scss' @@ -183,7 +184,7 @@ class GoodsPublish extends Component { value={this.state.value} onChange={this.handleChange.bind(this)} maxlength='200' - placeholder='你的问题是...' + placeholder='你的产品简介' /> @@ -203,7 +204,8 @@ class GoodsPublish extends Component { - + + ) } diff --git a/src/pages/goodsPublish/goodsPublish.scss b/src/pages/goodsPublish/goodsPublish.scss index aa5d7e3..047708c 100644 --- a/src/pages/goodsPublish/goodsPublish.scss +++ b/src/pages/goodsPublish/goodsPublish.scss @@ -2,8 +2,13 @@ padding: 10px 20px; .border-box{ border-bottom: 1Px solid #d6e4ef; + } + .at-input__container{ + color:black; + font-weight: bold; + } .img-box{ margin-top:10Px; .img-container{ @@ -46,13 +51,14 @@ } .title-box{ .title{ - color: #333; - margin-right:16rpx; + //color: #333; + margin-right:16rpx; width:172rpx; font-size:32rpx; line-height:1.5; vertical-align:middle; text-align:left; + font-weight: bold } diff --git a/src/pages/home/home.js b/src/pages/home/home.js index 5dbf187..aaf1948 100644 --- a/src/pages/home/home.js +++ b/src/pages/home/home.js @@ -93,7 +93,11 @@ class Home extends Component { onClickChildCate(item) { this.getShops(item.parent_class_id, item.class_id, 2) } - + goToAllDemandingPage(){ + Taro.navigateTo({ + url: '/pages/allDemanding/allDemanding' + }) + } render() { const demandingElemensArray = this.state.demanding?this.state.demanding.map((item, index) => { @@ -213,7 +217,7 @@ class Home extends Component { 业主需求 - + 更多>> diff --git a/src/pages/index/index.js b/src/pages/index/index.js index a951bd3..d1d7917 100644 --- a/src/pages/index/index.js +++ b/src/pages/index/index.js @@ -31,12 +31,6 @@ class Index extends Component { Taro.navigateTo({ url: '/pages/home/home' }) - - // Taro.request({ - // url:'http://192.168.1.230/Shop-wxStore', - - // }) - // .then(res => console.log(res.data)) } componentWillReceiveProps (nextProps) { console.log(this.props, nextProps) diff --git a/src/pages/mySupplyDemand/mySupplyDemand.js b/src/pages/mySupplyDemand/mySupplyDemand.js new file mode 100644 index 0000000..426d373 --- /dev/null +++ b/src/pages/mySupplyDemand/mySupplyDemand.js @@ -0,0 +1,188 @@ +import Taro, { Component } from '@tarojs/taro' +import { View, Button, Text } from '@tarojs/components' +import { AtInput, AtButton, Picker,AtIcon } from 'taro-ui' + +import copyrightComponent from '../../component/copyrightComponent/copyrightComponent' +import searchBarComponent from '../../component/searchBarComponent/searchBarComponent' + + +import './mySupplyDemand.scss' + + +console.log('hi') +class MySupplyDemand extends Component { + + config = { + navigationBarTitleText: '我的供求' + } + constructor() { + super(...arguments) + this.state = { + selector: ['全部','需求', '供应', '人才'], + selectorChecked: '全部', + selector1: ['全部','上架', '下架'], + selectorChecked1: '全部', + dateSel: '2018-04-22', + + } + } + onChange = e => { + this.setState({ + selectorChecked: this.state.selector[e.detail.value] + }) + } + onChange1 = e => { + this.setState({ + selectorChecked1: this.state.selector1[e.detail.value] + }) + } + onDateChange = e => { + this.setState({ + dateSel: e.detail.value + }) + } + + + + componentWillReceiveProps(nextProps) { + console.log(this.props, nextProps) + } + + componentWillUnmount() { } + + componentDidShow() { } + + componentDidHide() { } + + render() { + return ( + + + + + + + + + *供求类型: {this.state.selectorChecked} + + + + + + + + + + + + + *供求状态: {this.state.selectorChecked1} + + + + + + + + * + + + + + + + + + *开始日期: {this.state.dateSel} + + + + + + + + *结束日期: {this.state.dateSel} + + + + + + + + + + + + + 搜索 + + + + + 新增 + + + 一共20 条记录 + + + + + 需求类型: + 1 + + + 需求标题: + 1 + + + 联系人: + 1 + + + 电话号码: + 1 + + + 需求状态: + + + + 更新时间: + 1 + + + + 查看 + + + 编辑 + + + 删除 + + + + + + + + + + + + + + + ) + } +} + +export default MySupplyDemand diff --git a/src/pages/mySupplyDemand/mySupplyDemand.scss b/src/pages/mySupplyDemand/mySupplyDemand.scss new file mode 100644 index 0000000..bc1eee8 --- /dev/null +++ b/src/pages/mySupplyDemand/mySupplyDemand.scss @@ -0,0 +1,111 @@ +.mySupplyDemand{ + padding: 10px 20px; + font-size: 32rpx; + .require{ + color:red; + line-height:100rpx; +} +.total-count{ + text-align: right; + margin: 20px; + .number{ + color:red; +} + +} + + .at-input__container{ + color:black; + font-weight: bold; + .at-input__input{ + font-weight: normal + } + } + .page-section{ + border-bottom: 1Px solid #d6e4ef; + + .picker{ + // padding: 24rpx 0; + .selected{ + display: inline-block; + margin-left: 20%; + font-size: 32rpx + } + .title-box{ + .title{ + //color: #333; + margin-right:16rpx; + width:172rpx; + font-size:32rpx; + line-height:1.5; + vertical-align:middle; + text-align:left; + font-weight: bold; + } + +} + } +} +.input-box{ + display: flex; + border-bottom: 1Px solid #d6e4ef; +} +} + +.picker-box{ + display: flex; + flex-wrap: nowrap; + flex-direction: row; + .picker-container{ + flex:1 + } + +} +.button-box{ + display: flex; + flex-wrap: nowrap; + flex-direction: row; + margin: 40px 0; + padding: 0 120px; + .button{ + flex:1; + text-align: center; + .at-button--primary{ + background-color:#FF9500; + border:1PX solid #FF9500; + + + } + } +} +.info-box{ + font-size: 30px; + .info-container{ + border: 1px solid #ddd; + margin-bottom: 8px; + box-shadow: 0 8px 8px #ddd; + padding: 10px; + View{ + margin:10px + } + .info-button-box{ + display: flex; + flex-wrap: nowrap; + justify-content:flex-end; + margin: 20px 0 0 0; + padding: 0 20px; + border-top: 1px solid #ddd; + .button{ + // flex:1; + text-align: center; + margin: 0 0; + .at-button--primary{ + background-color:#FF9500; + border:1PX solid #FF9500; + } + } +} + + } +} + diff --git a/src/pages/shop/shop.js b/src/pages/shop/shop.js index d3f4ee7..99362ba 100644 --- a/src/pages/shop/shop.js +++ b/src/pages/shop/shop.js @@ -6,6 +6,7 @@ import URL from '../../serviceAPI.config' import './shop.scss' import ShopItem from '../../component/shopItemComponent/shopItemComponent' import bottomNav from '../../component/bottomNav/bottomNav' +import copyrightComponent from '../../component/copyrightComponent/copyrightComponent' class Shop extends Component { // 项目配置 @@ -22,7 +23,7 @@ class Shop extends Component { FilterText:'', filterBar:['综合排序','销量','新品','价格','人气'], selectedFilterValue:0, - isShowFilter:false, + isShowFilter:true, 综合排序:true, 销量:false, 新品:false, @@ -320,6 +321,7 @@ class Shop extends Component { + @@ -329,15 +331,8 @@ class Shop extends Component { {ShopItemElementsArray} - - - Copyright © 晨丰全屋定制商城 闽ICP备16007300号-2 - - - - + - diff --git a/src/pages/shop/shop.scss b/src/pages/shop/shop.scss index 238b7fc..5fd8a7d 100644 --- a/src/pages/shop/shop.scss +++ b/src/pages/shop/shop.scss @@ -95,6 +95,9 @@ .button{ margin:0 20px } + .gap{ + height: 100px; + } } } } diff --git a/src/pages/supplyDemandPubish/supplyDemandPubish.js b/src/pages/supplyDemandPubish/supplyDemandPubish.js new file mode 100644 index 0000000..b927b88 --- /dev/null +++ b/src/pages/supplyDemandPubish/supplyDemandPubish.js @@ -0,0 +1,176 @@ + +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 copyrightComponent from '../../component/copyrightComponent/copyrightComponent' + + +import './supplyDemandPubish.scss' + + + +class SupplyDemand extends Component { + + config = { + navigationBarTitleText: '供求发布' + } + constructor() { + super(...arguments) + this.state = { + selector: ['需求', '供应', '人才'], + selectorChecked: '需求', + selector1: ['上架', '下架'], + selectorChecked1: '上架', + + } + } + onChange = e => { + this.setState({ + selectorChecked: this.state.selector[e.detail.value] + }) + } + onChange1 = e => { + this.setState({ + selectorChecked1: this.state.selector1[e.detail.value] + }) + } + + componentWillReceiveProps(nextProps) { + console.log(this.props, nextProps) + } + + componentWillUnmount() { } + + componentDidShow() { } + + componentDidHide() { } + + render() { + return ( + + + + + + + + *供求类型: {this.state.selectorChecked} + + + + + + + + + + * + + + * + + + + * + + + + + 联系地址: + + + + + + + + *需求内容: + + + + + + + + 需求图片: + (最多4张) + + + + + + + + + + + + + + + + *状态: {this.state.selectorChecked1} + + + + + + + + + + 发布 + + + 发布并新增 + + + 商品列表 + + + + + + + + + + ) + } +} + +export default SupplyDemand diff --git a/src/pages/supplyDemandPubish/supplyDemandPubish.scss b/src/pages/supplyDemandPubish/supplyDemandPubish.scss new file mode 100644 index 0000000..451f0de --- /dev/null +++ b/src/pages/supplyDemandPubish/supplyDemandPubish.scss @@ -0,0 +1,77 @@ +.supply-demand{ + padding: 10px 20px; + .border-box{ + border-bottom: 1Px solid #d6e4ef; + display: flex + } + .at-input__container{ + color:black; + font-weight: bold; + .at-input__input{ + font-weight: normal + } + } + .img-box{ + margin-top:10Px; + .img-container{ + border: 1Px solid #d6e4ef; + border-radius:8rpx; + } + } + .button-box{ + display: flex; + flex-wrap: nowrap; + flex-direction: row; + margin: 40px 0; + padding: 0 120px; + .button{ + flex:1; + text-align: center; + .at-button--primary{ + background-color:#FF9500; + border:1PX solid #FF9500; + + + } + } +} + +} + +.title-box{ + .title{ + //color: #333; + margin-right:16rpx; + width:172rpx; + font-size:32rpx; + line-height:1.5; + vertical-align:middle; + text-align:left; + font-weight: bold; + } + +} +.warn{ + font-size: 25px; + color:red; + } +.page-section{ + border-bottom: 1Px solid #d6e4ef; + .picker{ + padding: 24rpx 0 + } +} +.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/serviceAPI.config.js b/src/serviceAPI.config.js index 8d17e97..43290ac 100644 --- a/src/serviceAPI.config.js +++ b/src/serviceAPI.config.js @@ -8,6 +8,7 @@ const URL = { GetSearchParam: LOCALURL + 'GoodsSearch-getSearchParam',// sidebar筛选的字段 SearchResult: LOCALURL + 'GoodsSearch-search',// 得到搜索结果 SearchBarKeyWords: LOCALURL + 'Search-getKeywords',// 搜索栏接口 + GetAllDemanding: LOCALURL + 'supply-allDemandList',// 获取所有业主需求 }