接入api 和店铺页面的店铺所有分类
This commit is contained in:
parent
6c6f3df246
commit
48894c62fe
@ -1,3 +1,5 @@
|
||||
|
||||
$themeColor: #FF7142;
|
||||
.orange{
|
||||
color:#FF7142,
|
||||
}
|
||||
|
@ -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 (
|
||||
<View className='searchBarComponent'>
|
||||
<View className='searchBar-box'>
|
||||
<AtSearchBar className='search-button'
|
||||
showActionButton
|
||||
actionName='搜索'
|
||||
value={this.state.value}
|
||||
onChange={this.onChange.bind(this)}
|
||||
onActionClick={this.onActionClick.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default SearchBarComponent
|
@ -1,17 +0,0 @@
|
||||
|
||||
// 整个样式和shoppage 一样但是不生效
|
||||
// .searchBarComponent{
|
||||
// .search-button{
|
||||
// .at-search-bar__action{
|
||||
// background-color:#FF9900
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
//
|
||||
|
||||
.search-button{
|
||||
font-size: 100px
|
||||
}
|
@ -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 = <AtModal className='modal'
|
||||
isOpened={this.state.isOpenedGrabModal}
|
||||
title='提示'
|
||||
cancelText='取消'
|
||||
confirmText='确认'
|
||||
onClose={this.handleGrabModalClose}
|
||||
onCancel={this.handleGrabModalCancel}
|
||||
onConfirm={this.handleGrabConfirm.bind(this)}
|
||||
content='确认抢单?\n'
|
||||
/>
|
||||
|
||||
|
||||
const modalMessageGrabElement=<AtModal isOpened={this.state.isOpenedGrabModal}>
|
||||
<AtModalHeader>提示</AtModalHeader>
|
||||
<AtModalContent>
|
||||
确认抢单?
|
||||
</AtModalContent>
|
||||
<AtModalAction> <Button onClick={this.handleGrabModalCancel.bind(this)}>取消</Button> <Button className='orange' onClick={this.handleGrabConfirm.bind(this)}>确定</Button> </AtModalAction>
|
||||
</AtModal>
|
||||
// 抢单返回轻提示
|
||||
const grabOrderSuccessElement = <AtToast
|
||||
isOpened={this.state.isGrabOrderSuccess}
|
||||
text={this.state.grabOrderSuccess}
|
||||
duration={2000}
|
||||
isOpened={this.state.isGrabOrderSuccess}
|
||||
text={this.state.grabOrderSuccess}
|
||||
duration={2000}
|
||||
></AtToast>
|
||||
const allDemandingElementArray = this.state.supplys ? this.state.supplys.map((item, index) => {
|
||||
return <View className='demanding-info' key={index}>
|
||||
@ -183,13 +181,13 @@ class AllDemanding extends Component {
|
||||
</View>
|
||||
<View className='body'>
|
||||
<View className='image-container'>
|
||||
<Image style='width:90px;height:60px' src={URL.Base + item.file_path[0].thumb_path} />
|
||||
<Image style='width:110px;height:80px' src={URL.Base + item.file_path[0].thumb_path} />
|
||||
</View>
|
||||
<View className='detail'>
|
||||
<View className='title'>{item.sd_title}</View>
|
||||
<View className='para'>{item.sd_desc}</View>
|
||||
<View className='button' onClick={this.grabOrder.bind(this, item.sd_id)}>
|
||||
<AtButton type='primary' size='small'> {item.state_name === '在用' ? '抢单' : '已抢单'}</AtButton>
|
||||
<AtButton type='primary' size='small' className='orange'> {item.state_name === '在用' ? '抢单' : '已抢单'}</AtButton>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
@ -223,12 +221,12 @@ class AllDemanding extends Component {
|
||||
<View className='input-box'>
|
||||
<Text className='require'>*</Text>
|
||||
<AtInput
|
||||
name='value'
|
||||
title='需求标题:'
|
||||
type='text'
|
||||
placeholder='需求标题'
|
||||
value={this.state.value}
|
||||
onChange={this.handleChange.bind(this)}
|
||||
name='value'
|
||||
title='需求标题:'
|
||||
type='text'
|
||||
placeholder='需求标题'
|
||||
value={this.state.value}
|
||||
onChange={this.handleChange.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
{/* 开始和结束日期选择 */}
|
||||
@ -274,10 +272,10 @@ class AllDemanding extends Component {
|
||||
{allDemandingElementArray}
|
||||
</View>
|
||||
<AtLoadMore
|
||||
onClick={this.handleLoadMore.bind(this)}
|
||||
status={this.state.isMore}
|
||||
loadingText='加载中'
|
||||
noMoreText='没有更多了'
|
||||
onClick={this.handleLoadMore.bind(this)}
|
||||
status={this.state.isMore}
|
||||
loadingText='加载中'
|
||||
noMoreText='没有更多了'
|
||||
/>
|
||||
<copyrightComponent></copyrightComponent>
|
||||
</View>
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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 (
|
||||
<View className='gooods=container'>
|
||||
<View className='searchBar-box'>
|
||||
<AtSearchBar className='search-button'
|
||||
actionName='搜索'
|
||||
value={this.state.value}
|
||||
onChange={this.onChange.bind(this)}
|
||||
onActionClick={this.onActionClick.bind(this)}
|
||||
/>
|
||||
</View> <View className='img-box'>
|
||||
<View className='img-box'>
|
||||
{/* <Image className='img' src={URL.Base + this.state.productImagesUrl}></Image> */}
|
||||
<Swiper
|
||||
className='swipper'
|
||||
|
@ -1,10 +1,8 @@
|
||||
// border: 1px solid #ddd;
|
||||
// padding: 5px 0;
|
||||
.search-button{
|
||||
.at-search-bar__action{
|
||||
background-color:#FF7142
|
||||
}
|
||||
}
|
||||
|
||||
$themeColor:#FF7142;
|
||||
|
||||
.img-box{
|
||||
// border: 1px solid #ddd;
|
||||
padding: 20px 0;
|
||||
@ -126,7 +124,7 @@
|
||||
.at-tabs{
|
||||
|
||||
.at-tabs__item--active{
|
||||
color:#FF7142
|
||||
color:$themeColor
|
||||
}
|
||||
}
|
||||
.description-title{
|
||||
|
@ -1,6 +1,6 @@
|
||||
import Taro, { Component } from '@tarojs/taro'
|
||||
import { View, Text, Radio, RadioGroup, Label } 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 URL from '../../serviceAPI.config'
|
||||
|
||||
@ -189,7 +189,6 @@ class GoodsPublish extends Component {
|
||||
for (let innerItem of middleItem.children) {
|
||||
thirdColumn.push({ id: innerItem.class_id, class_name: innerItem.class_name })
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -439,42 +438,38 @@ class GoodsPublish extends Component {
|
||||
|
||||
render() {
|
||||
const imageUploadSuccess = <AtToast
|
||||
isOpened={this.state.isUploadImageSuccess}
|
||||
text={this.state.uploadImageTextTip}
|
||||
duration={2000}
|
||||
isOpened={this.state.isUploadImageSuccess}
|
||||
text={this.state.uploadImageTextTip}
|
||||
duration={2000}
|
||||
></AtToast>
|
||||
const productUploadSuccess = <AtToast
|
||||
isOpened={this.state.isUploadProductSuccess}
|
||||
text={this.state.uploadProductTextTip}
|
||||
duration={2000}
|
||||
isOpened={this.state.isUploadProductSuccess}
|
||||
text={this.state.uploadProductTextTip}
|
||||
duration={2000}
|
||||
></AtToast>
|
||||
return (
|
||||
<View className='goods-publish'>
|
||||
{imageUploadSuccess}
|
||||
{productUploadSuccess}
|
||||
<View className='searchBar-box'>
|
||||
<AtSearchBar className='search-button'
|
||||
actionName='搜索'
|
||||
value={this.state.value}
|
||||
onChange={this.onChange.bind(this)}
|
||||
onActionClick={this.onActionClick.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<View className='goods-category'>
|
||||
<View className='page-section'>
|
||||
<View>
|
||||
<Picker
|
||||
range={this.state.objectMultiArray}
|
||||
onChange={this.bindMultiPickerChange.bind(this)}
|
||||
rangeKey='class_name'
|
||||
mode='multiSelector'
|
||||
onColumnchange={this.bindMultiPickerCol.bind(this)}
|
||||
value={this.state.multiIndex}
|
||||
range={this.state.objectMultiArray}
|
||||
onChange={this.bindMultiPickerChange.bind(this)}
|
||||
rangeKey='class_name'
|
||||
mode='multiSelector'
|
||||
onColumnchange={this.bindMultiPickerCol.bind(this)}
|
||||
value={this.state.multiIndex}
|
||||
>
|
||||
<View className='picker'>
|
||||
<View className='title-box'>
|
||||
<Text className='title'><Text className='require'>*</Text>商品分类:</Text> <Text className='selected'>
|
||||
{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:''}
|
||||
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
@ -486,32 +481,32 @@ class GoodsPublish extends Component {
|
||||
<View className='input-box'>
|
||||
<Text className='require'>*</Text>
|
||||
<AtInput
|
||||
name='value'
|
||||
title='商品名称:'
|
||||
type='text'
|
||||
value={this.state.productName}
|
||||
onChange={this.productNameChange.bind(this)}
|
||||
name='productName'
|
||||
title='商品名称:'
|
||||
type='text'
|
||||
value={this.state.productName}
|
||||
onChange={this.productNameChange.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
<View className='input-box'>
|
||||
<Text className='require'>*</Text>
|
||||
<AtInput
|
||||
name='value'
|
||||
title='商品价格:'
|
||||
type='number'
|
||||
placeholder='¥'
|
||||
value={this.state.productPrice}
|
||||
onChange={this.productPriceChange.bind(this)}
|
||||
name='productPrice'
|
||||
title='商品价格:'
|
||||
type='number'
|
||||
placeholder='¥'
|
||||
value={this.state.productPrice}
|
||||
onChange={this.productPriceChange.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
<View className='input-box'>
|
||||
<Text className='require'>*</Text>
|
||||
<AtInput
|
||||
name='value'
|
||||
title='商品单位:'
|
||||
type='text'
|
||||
value={this.state.productUnit}
|
||||
onChange={this.productUnitChange.bind(this)}
|
||||
name='productUnit'
|
||||
title='商品单位:'
|
||||
type='text'
|
||||
value={this.state.productUnit}
|
||||
onChange={this.productUnitChange.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
{/* 图片上传 */}
|
||||
@ -522,11 +517,11 @@ class GoodsPublish extends Component {
|
||||
</View>
|
||||
<View className='img-container'>
|
||||
<AtImagePicker
|
||||
multiple
|
||||
files={this.state.pickerImageUrl}
|
||||
onChange={this.onChangeImg.bind(this)}
|
||||
onFail={this.onFail.bind(this)}
|
||||
onImageClick={this.onImageClick.bind(this)}
|
||||
multiple
|
||||
files={this.state.pickerImageUrl}
|
||||
onChange={this.onChangeImg.bind(this)}
|
||||
onFail={this.onFail.bind(this)}
|
||||
onImageClick={this.onImageClick.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
@ -553,10 +548,10 @@ class GoodsPublish extends Component {
|
||||
</View>
|
||||
|
||||
<AtTextarea
|
||||
value={this.state.productDescript}
|
||||
onChange={this.productDescriptChange.bind(this)}
|
||||
maxlength='200'
|
||||
placeholder='你的产品简介'
|
||||
value={this.state.productDescript}
|
||||
onChange={this.productDescriptChange.bind(this)}
|
||||
maxlength='200'
|
||||
placeholder='你的产品简介'
|
||||
/>
|
||||
|
||||
</View>
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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'
|
||||
})
|
||||
}
|
||||
|
@ -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}
|
||||
|
||||
|
||||
<View className='searchBar-box'>
|
||||
<AtSearchBar className='search-button'
|
||||
actionName='搜索'
|
||||
value={this.state.value}
|
||||
onChange={this.onChange.bind(this)}
|
||||
onActionClick={this.onActionClick.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
|
||||
{/* 供求类型 */}
|
||||
<View className='page-section'>
|
||||
<View>
|
||||
@ -339,7 +332,7 @@ class MySupplyDemand extends Component {
|
||||
|
||||
</View>
|
||||
</Picker>
|
||||
<Picker className='picker-container' mode='date' onChange={this.onEndDateChange}>
|
||||
<Picker className='picker-container' mode='date' start={this.state.startDateSel} onChange={this.onEndDateChange}>
|
||||
<View className='picker'>
|
||||
<View className='title-box'>
|
||||
<Text className='title'><Text className='require'>*</Text>结束日期:</Text> <Text className='selected'>{this.state.endDateSel}</Text>
|
||||
|
@ -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{
|
||||
|
||||
|
@ -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({
|
||||
@ -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 })
|
||||
|
||||
// 产品排序
|
||||
accendingDescending(value) {
|
||||
} else {
|
||||
console.log('获取店铺内部分类失败')
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 产品排序
|
||||
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 <View key={index} className='shop-item' >
|
||||
<ShopItem item={item}></ShopItem>
|
||||
@ -463,31 +503,29 @@ class Shop extends Component {
|
||||
<View className='img-box'> <Image mode='aspectFit' src={URL.Base + 'Public/images/shop/bg_banner.png'} style='max-width: 100%;max-height:100%;' /></View>
|
||||
|
||||
</View>
|
||||
|
||||
|
||||
</View>
|
||||
|
||||
const shopAllCateElementArray = this.state.shopAllInnerCate.map((item, index) => {
|
||||
return <View key={index} className='item' onClick={this.handleShopInnerCate.bind(this,item.id)}> <Text>{item.n}</Text> </View>
|
||||
})
|
||||
return (
|
||||
<View className='shop' >
|
||||
<View className='searchBar-box'>
|
||||
<AtSearchBar className='search-button'
|
||||
actionName='搜索'
|
||||
value={this.state.value}
|
||||
onChange={this.onChange.bind(this)}
|
||||
onActionClick={this.onActionClick.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
<View className='shop' >
|
||||
|
||||
<View onClick={this.state.closeBgWindow.bind(this)} className={this.state.isBlurWindow?'show-blur':''}></View>
|
||||
<View className='banner-box'>
|
||||
<Image src={URL.Base + 'Public/visual_editing/img/ksh_bg.jpg'} mode='aspectFill' style='height:120px' />
|
||||
<View className='shop-name'>{shopName}</View>
|
||||
<View className='shop-name'>{this.state.shopName}</View>
|
||||
</View>
|
||||
<View className='nav-box'>
|
||||
<View className='nav'>
|
||||
<View className='shop-cate'>
|
||||
<View className='shop-cate' onClick={this.isShowShopAllCate.bind(this)}>
|
||||
<Text className='text'>
|
||||
店铺全部分类
|
||||
</Text>
|
||||
<AtIcon value='menu' size='10' color='white'></AtIcon>
|
||||
</View>
|
||||
<View className={this.state.isShowShopAllCate ? 'shopcate-selection show' : 'shopcate-selection'}>
|
||||
{shopAllCateElementArray}</View>
|
||||
<View className='homepage-link' onClick={this.showHomePage.bind()}>
|
||||
<Text className='text'>
|
||||
首页
|
||||
|
@ -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;
|
||||
|
@ -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}
|
||||
<View className='searchBar-box'>
|
||||
<AtSearchBar className='search-button'
|
||||
actionName='搜索'
|
||||
value={this.state.value}
|
||||
onChange={this.onChange.bind(this)}
|
||||
onActionClick={this.onActionClick.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<View className='page-section'>
|
||||
<View>
|
||||
<Picker mode='selector' range={this.state.demandingSupplyCate} onChange={this.demandingSupplyCate.bind(this)}>
|
||||
@ -252,6 +250,7 @@ class SupplyDemand extends Component {
|
||||
<View className='img-container'>
|
||||
<AtImagePicker
|
||||
multiple
|
||||
showAddBtn={this.state.pickerImageUrl.length<4}
|
||||
files={this.state.pickerImageUrl}
|
||||
onChange={this.onChangeImg.bind(this)}
|
||||
onFail={this.onFail.bind(this)}
|
||||
@ -282,8 +281,8 @@ class SupplyDemand extends Component {
|
||||
|
||||
<AtButton type='primary' className='button-a' size='small'>发布并新增</AtButton>
|
||||
</View>
|
||||
<View className='button'>
|
||||
<AtButton type='primary' className='button-a' size='small'>商品列表</AtButton>
|
||||
<View className='button' onClick={this.goToMyDemSupPage.bind(this)}>
|
||||
<AtButton type='primary' className='button-a' size='small'>我的供求</AtButton>
|
||||
</View>
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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',// 上传供求
|
||||
|
@ -1,13 +1,24 @@
|
||||
todo list:
|
||||
|
||||
搜索栏的search button 样式
|
||||
首页:
|
||||
首页:
|
||||
优惠卷和询价接口
|
||||
商品发布页面:
|
||||
商品分类三级联动 // 改变新的multiObject 之后 三级联动就失效了
|
||||
商品价格无法设定为数字
|
||||
联系人和联系电话 改动?
|
||||
店铺页面:
|
||||
侧边筛选
|
||||
|
||||
商品发布页面:
|
||||
商品分类三级联动 // 有bug
|
||||
店铺分类选项 二级联动// 需要修改
|
||||
商品价格无法设定为数字 // 有bug
|
||||
|
||||
需要写商品列表页面吗?
|
||||
|
||||
供求发布页面
|
||||
等待后台- 供求类型 和供求状态
|
||||
联系电话无法设置为数字 // 有bug type=‘password’ 可以
|
||||
全部业主需求页面:
|
||||
供求状态 和行业分类--等待后台接口
|
||||
搜索api
|
||||
|
||||
我的供求页面:
|
||||
搜索接口--等待后台
|
||||
我的供求 -查看和编辑页面
|
||||
|
Loading…
Reference in New Issue
Block a user