diff --git a/src/app.scss b/src/app.scss index 10652a9..dd215cb 100644 --- a/src/app.scss +++ b/src/app.scss @@ -1,3 +1,5 @@ + +$themeColor: #FF7142; .orange{ color:#FF7142, } diff --git a/src/component/searchBarComponent/searchBarComponent.js b/src/component/searchBarComponent/searchBarComponent.js deleted file mode 100644 index 13b62f3..0000000 --- a/src/component/searchBarComponent/searchBarComponent.js +++ /dev/null @@ -1,52 +0,0 @@ - -import Taro, { Component } from '@tarojs/taro' -import { View } 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 deleted file mode 100644 index 9a9d789..0000000 --- a/src/component/searchBarComponent/searchBarComponent.scss +++ /dev/null @@ -1,17 +0,0 @@ - -// 整个样式和shoppage 一样但是不生效 -// .searchBarComponent{ -// .search-button{ -// .at-search-bar__action{ -// background-color:#FF9900 -// } -// } - -// } - - -// - -.search-button{ - font-size: 100px -} \ No newline at end of file diff --git a/src/pages/allDemanding/allDemanding.js b/src/pages/allDemanding/allDemanding.js index 7a87cca..8815c55 100644 --- a/src/pages/allDemanding/allDemanding.js +++ b/src/pages/allDemanding/allDemanding.js @@ -1,6 +1,6 @@ import Taro, { Component } from '@tarojs/taro' -import { View, Text, Image } from '@tarojs/components' -import { AtInput, AtButton, Picker, AtIcon, AtLoadMore, AtModal, AtToast } from 'taro-ui' +import { View, Text, Image,Button } from '@tarojs/components' +import { AtInput, AtButton, Picker, AtIcon, AtLoadMore, AtModal, AtToast,AtModalHeader ,AtModalContent ,AtModalAction } from 'taro-ui' import copyrightComponent from '../../component/copyrightComponent/copyrightComponent' import URL from '../../serviceAPI.config' @@ -25,7 +25,6 @@ class AllDemanding extends Component { industryCateSelected: '全部', // 当前行业分类状态 startDateSel: '2018-04-22', endDateSel: '2018-04-22', - startValidDate:'', isOpenedGrabModal: false, grabOrderId: '',//抢到订单的id isGrabOrderSuccess: false,// 是否显示轻提示 @@ -153,21 +152,20 @@ class AllDemanding extends Component { render() { // 提示模态弹窗element - const modalMessageGrabElement = + + + const modalMessageGrabElement= + 提示 + + 确认抢单? + + + // 抢单返回轻提示 const grabOrderSuccessElement = const allDemandingElementArray = this.state.supplys ? this.state.supplys.map((item, index) => { return @@ -183,13 +181,13 @@ class AllDemanding extends Component { - + {item.sd_title} {item.sd_desc} - {item.state_name === '在用' ? '抢单' : '已抢单'} + {item.state_name === '在用' ? '抢单' : '已抢单'} @@ -223,12 +221,12 @@ class AllDemanding extends Component { * {/* 开始和结束日期选择 */} @@ -274,10 +272,10 @@ class AllDemanding extends Component { {allDemandingElementArray} diff --git a/src/pages/allDemanding/allDemanding.scss b/src/pages/allDemanding/allDemanding.scss index ee01aa6..0f2cfef 100644 --- a/src/pages/allDemanding/allDemanding.scss +++ b/src/pages/allDemanding/allDemanding.scss @@ -1,3 +1,5 @@ + +$themeColor: #FF7142; .allDemanding{ padding: 10px 20px; font-size: 32rpx; @@ -57,8 +59,8 @@ text-align: center; .at-button--primary{ - background-color:#FF9500; - border:1PX solid #FF9500; + background-color:$themeColor; + border:1PX solid $themeColor; } } @@ -95,7 +97,7 @@ border-bottom: 1px solid #F2F2F2; margin:20px 0; .image-container{ - padding: 10px; + margin: 20px; flex:1; } .detail{ @@ -144,3 +146,10 @@ } } +.button{ + .at-button--primary{ + background-color:$themeColor; + border:1PX solid $themeColor; + } + +} diff --git a/src/pages/goods/goods.js b/src/pages/goods/goods.js index 60ceb50..e40802b 100644 --- a/src/pages/goods/goods.js +++ b/src/pages/goods/goods.js @@ -1,7 +1,7 @@ import Taro, { Component } from '@tarojs/taro' import { View, Text, Image , Swiper, SwiperItem} from '@tarojs/components' -import { AtTabs, AtTabsPane, AtSegmentedControl, AtIcon, AtToast, Picker,AtSearchBar } from 'taro-ui' +import { AtTabs, AtTabsPane, AtSegmentedControl, AtIcon, AtToast, Picker } from 'taro-ui' import copyrightComponent from '../../component/copyrightComponent/copyrightComponent' import URL from '../../serviceAPI.config' @@ -32,10 +32,9 @@ class Goods extends Component { monthSold: '',//月销量 totalSold: '',//总销量 browsingCount: '',// 浏览数 - - } } + // 商品详情api getShopDescription() { Taro.request({ @@ -129,14 +128,7 @@ class Goods extends Component { }) return ( - - - + {/* */} const productUploadSuccess = return ( {imageUploadSuccess} {productUploadSuccess} - - - + *商品分类: - {this.state.objectMultiArray[0][this.state.multiIndex[0]].class_name}{this.state.objectMultiArray[1][this.state.multiIndex[1]].class_name}{this.state.objectMultiArray[2][this.state.multiIndex[2]].class_name} + {this.state.objectMultiArray[0]?this.state.objectMultiArray[0][this.state.multiIndex[0]].class_name:''} + &{this.state.objectMultiArray[1]?this.state.objectMultiArray[1][this.state.multiIndex[1]].class_name:''} + &{this.state.objectMultiArray[2]?this.state.objectMultiArray[2][this.state.multiIndex[2]].class_name:''} + @@ -486,32 +481,32 @@ class GoodsPublish extends Component { * * * {/* 图片上传 */} @@ -522,11 +517,11 @@ class GoodsPublish extends Component { @@ -553,10 +548,10 @@ class GoodsPublish extends Component { diff --git a/src/pages/goodsPublish/goodsPublish.scss b/src/pages/goodsPublish/goodsPublish.scss index ebecd5b..ece2140 100644 --- a/src/pages/goodsPublish/goodsPublish.scss +++ b/src/pages/goodsPublish/goodsPublish.scss @@ -1,8 +1,5 @@ -.search-button{ - .at-search-bar__action{ -background-color:#FF7142 - } -} +$themeColor:#FF7142; + .goods-category{ @@ -85,8 +82,8 @@ background-color:#FF7142 flex:1; text-align: center; .at-button--primary{ - background-color:#FF7142; - border:1PX solid #FF7142; + background-color:$themeColor; + border:1PX solid $themeColor; } .button-a{ background-color:#5cb85c; diff --git a/src/pages/home/home.scss b/src/pages/home/home.scss index dc2fdfd..6a8ad19 100644 --- a/src/pages/home/home.scss +++ b/src/pages/home/home.scss @@ -1,3 +1,4 @@ +$themeColor: #FF7142; .home{ overflow: hidden; .first-banner ,.third-banner{ @@ -14,7 +15,7 @@ .at-modal-footer--simple{ .at-modal-action{ button:last-child:nth-child(2){ - color:#FF7142 + color:$themeColor } } } @@ -60,14 +61,14 @@ text-align: right; .item-tag-text{ padding:5px; - background-color: #FF7142; + background-color: $themeColor; } } .item-title{ font-size: 50px; min-height: 21px; clear: both; - color: #FF7142; + color: $themeColor; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; diff --git a/src/pages/index/index.js b/src/pages/index/index.js index 583039f..1f3b902 100644 --- a/src/pages/index/index.js +++ b/src/pages/index/index.js @@ -28,8 +28,8 @@ class Index extends Component { //http://ihome6.com/Shop-supplyShops componentDidMount(){ Taro.navigateTo({ - url: '/pages/goodsPublish/goodsPublish' - // url: '/pages/mySupplyDemand/mySupplyDemand' + // url: '/pages/goodsPublish/goodsPublish' + url: '/pages/home/home' // url:'/pages/supplyDemandPublish/supplyDemandPublish' }) } diff --git a/src/pages/mySupplyDemand/mySupplyDemand.js b/src/pages/mySupplyDemand/mySupplyDemand.js index 9710b8c..8cad573 100644 --- a/src/pages/mySupplyDemand/mySupplyDemand.js +++ b/src/pages/mySupplyDemand/mySupplyDemand.js @@ -1,6 +1,6 @@ import Taro, { Component } from '@tarojs/taro' import { View, Text } from '@tarojs/components' -import { AtInput, AtButton, Picker, AtIcon, AtModal, AtToast ,AtSearchBar} from 'taro-ui' +import { AtInput, AtButton, Picker, AtIcon, AtModal, AtToast } from 'taro-ui' import URL from '../../serviceAPI.config' import copyrightComponent from '../../component/copyrightComponent/copyrightComponent' @@ -282,14 +282,7 @@ class MySupplyDemand extends Component { {toastElement} - - - + {/* 供求类型 */} @@ -339,7 +332,7 @@ class MySupplyDemand extends Component { - + *结束日期: {this.state.endDateSel} diff --git a/src/pages/mySupplyDemand/mySupplyDemand.scss b/src/pages/mySupplyDemand/mySupplyDemand.scss index 584868b..68690da 100644 --- a/src/pages/mySupplyDemand/mySupplyDemand.scss +++ b/src/pages/mySupplyDemand/mySupplyDemand.scss @@ -1,3 +1,5 @@ +$themeColor:#FF7142; + .mySupplyDemand{ padding: 10px 20px; font-size: 32rpx; @@ -6,11 +8,7 @@ line-height:100rpx; } -.search-button{ - .at-search-bar__action{ -background-color:#FF7142 - } -} + .total-count{ text-align: right; margin: 20px; @@ -77,8 +75,8 @@ background-color:#FF7142 flex:1; text-align: center; .at-button--primary{ - background-color:#FF7142; - border:1PX solid #FF7142; + background-color:$themeColor; + border:1PX solid $themeColor; } .button-a{ diff --git a/src/pages/shop/shop.js b/src/pages/shop/shop.js index 1045873..6b3d0f7 100644 --- a/src/pages/shop/shop.js +++ b/src/pages/shop/shop.js @@ -1,6 +1,6 @@ import Taro, { Component } from '@tarojs/taro' import { View, Button, Text, Image } from '@tarojs/components' -import { AtSearchBar, AtTag, AtIcon, AtPagination } from 'taro-ui' +import { AtTag, AtIcon, AtPagination, AtActionSheet, AtActionSheetItem } from 'taro-ui' import URL from '../../serviceAPI.config' @@ -54,20 +54,13 @@ class Shop extends Component { filterCondition: '',// 筛选条件 total: 0,// 信息条数 currentPage: 1,// 当前页 - - - + isShowShopAllCate: false, + shopAllInnerCate: '', + isBlurWindow:false, } } - // 搜索栏值的改变方法 - onChange(value) { - this.setState({ - value: value - }, () => { - console.log(this.state.value) - }) - } + //api 搜索栏的方法请求 getSearchBarkeyWords() { Taro.request({ @@ -150,7 +143,7 @@ class Shop extends Component { }) } - + // api 得到店铺详情请求 getShopDescription({ shopID = 808 }) { Taro.request({ @@ -173,15 +166,52 @@ class Shop extends Component { contactNumber: res.data.userRes.phone, shopDescription: res.data.data.shop_desc }, () => { - // console.log(this.state.shopDescriptionData) + // console.log(this.state.shopDescriptionData) }) } ) } + // api 获取店铺内的店铺分类请求 GetShopCategoryList + getShopInnerCate({ id = 808 }) { + Taro.request({ + url: URL.GetShopCategoryList, + method: 'POST', + dataType: 'json', + data: { + id: id, + }, + header: { + 'content-type': 'application/x-www-form-urlencoded', + 'X-Requested-With': 'XMLHttpRequest' + } + }) + .then(res => { + if (res.statusCode === 200) { + const originalData = res.data.data + const sortedData = [] + for (let item in originalData) { + let each = originalData[item] + each['id'] = item + sortedData.push(each) + } + console.log('sorteddata', sortedData) + this.setState({ shopAllInnerCate: sortedData }) + + } else { + console.log('获取店铺内部分类失败') + } + + + } + ) + } - // 产品排序 - accendingDescending(value) { + + + + // 产品排序 + accendingDescending(value) { this.setState({ selectedFilterValue: value }) if (value == 0) { this.setState({ @@ -295,30 +325,40 @@ class Shop extends Component { showDescriptionPage() { this.setState({ showShopHomePage: false }) } + isShowShopAllCate() { + this.setState({ isShowShopAllCate: !this.state.isShowShopAllCate,isBlurWindow:true }) + } + handleShopInnerCate(id){ + this.setState({ + isShowShopAllCate: false,isBlurWindow:false + }) + this.goodsSearch({shop_class_id:id,shop_id: this.$router.params.id}) + + } + closeBgWindow(){ + this.setState({ + isShowShopAllCate: false,isBlurWindow:false + }) + } componentWillMount() { } componentDidMount() { - this.setState({ shopId: this.$router.params.id, shopName: this.$router.params.name }) // 输出 { id: 2, type: 'test' } //页面加载之后 得到指定店铺的商品 和 筛选标签 - this.goodsSearch({}) - this.getSearchParams({}) - this.getShopDescription({}) + this.goodsSearch({ shop_id: this.$router.params.id }) // 加载店铺商品 + this.getSearchParams({})// 加载筛选项 + this.getShopDescription({ shopID: this.$router.params.id }) // 加载店铺说明 // this.getSearchBarkeyWords() - + this.getShopInnerCate({id:this.$router.params.id}) } componentDidShow() { } componentDidHide() { } - - render() { - - const ShopItemElementsArray = this.state.shopItem.length ? this.state.shopItem.map((item, index) => { return @@ -463,31 +503,29 @@ class Shop extends Component { - - + + const shopAllCateElementArray = this.state.shopAllInnerCate.map((item, index) => { + return {item.n} + }) return ( - - - - + + + - {shopName} + {this.state.shopName} - + 店铺全部分类 + + {shopAllCateElementArray} 首页 diff --git a/src/pages/shop/shop.scss b/src/pages/shop/shop.scss index ef0e8b2..8ce4d7d 100644 --- a/src/pages/shop/shop.scss +++ b/src/pages/shop/shop.scss @@ -1,11 +1,6 @@ +$themeColor:#FF7142; + -.shop{ - .search-button{ - .at-search-bar__action{ - background-color:#FF7142 - } - } -} .banner-box{ position: relative; .shop-name{ @@ -16,9 +11,36 @@ } } +.show-blur{ + background-color: white; + opacity: 0; + z-index: 9; + position: absolute; + height: 100%; + width: 100% +} .nav-box{ background-color: black; + position: relative; + .shopcate-selection{ + z-index: 10; + position: absolute ; + top:55px; + width: 30%; + background-color: red; + display: none; + } + .show{ + display: block; + .item{ + background-color: #777; + text-align: center; + color: white; + font-size: 25px; + } + } + .nav{ display: flex; line-height: 55px; diff --git a/src/pages/supplyDemandPublish/supplyDemandPublish.js b/src/pages/supplyDemandPublish/supplyDemandPublish.js index 09e5882..cd05bb8 100644 --- a/src/pages/supplyDemandPublish/supplyDemandPublish.js +++ b/src/pages/supplyDemandPublish/supplyDemandPublish.js @@ -1,7 +1,7 @@ import Taro, { Component } from '@tarojs/taro' import { View, Text } from '@tarojs/components' -import { AtInput, AtImagePicker, AtTextarea, AtButton, Picker, AtToast,AtSearchBar } from 'taro-ui' +import { AtInput, AtImagePicker, AtTextarea, AtButton, Picker, AtToast } from 'taro-ui' import copyrightComponent from '../../component/copyrightComponent/copyrightComponent' import URL from '../../serviceAPI.config' @@ -139,6 +139,11 @@ class SupplyDemand extends Component { contentChange(event) { this.setState({ content: event.target.value }) } + goToMyDemSupPage(){ + Taro.navigateTo({ + url: '/pages/mySupplyDemand/mySupplyDemand' + }) + } componentDidMount() { @@ -171,14 +176,7 @@ class SupplyDemand extends Component { {imageUploadSuccessElement} {/* 商品发布模态框 */} {demandSupplyUploadSuccessElement} - - - + @@ -252,6 +250,7 @@ class SupplyDemand extends Component { 发布并新增 - - 商品列表 + + 我的供求 diff --git a/src/pages/supplyDemandPublish/supplyDemandPublish.scss b/src/pages/supplyDemandPublish/supplyDemandPublish.scss index eee7163..06b4839 100644 --- a/src/pages/supplyDemandPublish/supplyDemandPublish.scss +++ b/src/pages/supplyDemandPublish/supplyDemandPublish.scss @@ -1,10 +1,8 @@ +$themeColor:#FF7142; + .supply-demand{ padding: 10px 20px; - .search-button{ - .at-search-bar__action{ - background-color:#FF7142 - } - } + .border-box{ border-bottom: 1Px solid #d6e4ef; display: flex @@ -33,8 +31,8 @@ flex:1; text-align: center; .at-button--primary{ - background-color:#FF7142,; - border:1PX solid #FF7142,; + background-color:$themeColor,; + border:1PX solid $themeColor,; } .button-a{ background-color:#5cb85c; diff --git a/src/serviceAPI.config.js b/src/serviceAPI.config.js index 17b60a1..62367ef 100644 --- a/src/serviceAPI.config.js +++ b/src/serviceAPI.config.js @@ -5,8 +5,11 @@ const URL = { Login: LOCALURL + 'Applet-login', //登入接口 ShopWxStore: LOCALURL + 'Shop-wxStore', //商城首页信息 ShopSupplyShops: LOCALURL + 'Shop-supplyShops',// 商城店铺信息 + // 店铺信息 GoodsSearch: LOCALURL + 'GoodsSearch-search',// 店铺页面的信息 GetSearchParam: LOCALURL + 'GoodsSearch-getSearchParam',// sidebar筛选的字段 + GetShopCategoryList: LOCALURL + 'Shop-ajaxShopCartgory',// 店铺内分类目录 + GetProductCategoryList: LOCALURL + 'applet-getGoodsClass',// 商品分类目录 SearchResult: LOCALURL + 'GoodsSearch-search',// 得到搜索结果 SearchBarKeyWords: LOCALURL + 'Search-getKeywords',// 搜索栏接口 GetAllDemanding: LOCALURL + 'supply-allDemandList',// 获取所有业主需求 @@ -19,8 +22,7 @@ const URL = { GetShopItemDetail: LOCALURL + 'GoodsQuery-wxGoodsDetail',// 商品详情 // 商品发布api接口 - GetShopCategoryList: LOCALURL + 'Shop-ajaxShopCartgory',// 商品分类目录 - GetProductCategoryList: LOCALURL + 'applet-getGoodsClass',// 商品分类目录 + UploadPorductImage: LOCALURL + 'Goods-fileUpload',// 上传商品图片 UploadProduct: LOCALURL + 'Goods-phonePost',// 上传商品 UploadSupplyDemand: LOCALURL + 'Supply-post',// 上传供求 diff --git a/src/todo list.txt b/src/todo list.txt index 7c3135d..120ef25 100644 --- a/src/todo list.txt +++ b/src/todo list.txt @@ -1,13 +1,24 @@ todo list: - 搜索栏的search button 样式 - 首页: - 优惠卷和询价接口 - 商品发布页面: - 商品分类三级联动 // 改变新的multiObject 之后 三级联动就失效了 - 商品价格无法设定为数字 +首页: + 优惠卷和询价接口 + 联系人和联系电话 改动? +店铺页面: + 侧边筛选 + +商品发布页面: + 商品分类三级联动 // 有bug + 店铺分类选项 二级联动// 需要修改 + 商品价格无法设定为数字 // 有bug + + 需要写商品列表页面吗? + +供求发布页面 + 等待后台- 供求类型 和供求状态 + 联系电话无法设置为数字 // 有bug type=‘password’ 可以 全部业主需求页面: 供求状态 和行业分类--等待后台接口 - 搜索api + 我的供求页面: - 搜索接口--等待后台 \ No newline at end of file + 搜索接口--等待后台 + 我的供求 -查看和编辑页面