业主全部需求完成
This commit is contained in:
parent
aa3eaccf8e
commit
9e1f708f73
@ -3,6 +3,11 @@ $themeColor: #FF7142;
|
||||
.orange{
|
||||
color:#FF7142,
|
||||
}
|
||||
.blur{
|
||||
color:#FF7142;
|
||||
opacity: .65;
|
||||
|
||||
}
|
||||
.orange-bg{
|
||||
background-color:#FF7142,
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import Taro, { Component } from '@tarojs/taro'
|
||||
import { View, Text, Image, Button } from '@tarojs/components'
|
||||
import { AtInput, AtButton, Picker, AtIcon, AtLoadMore, AtModal, AtToast, AtModalHeader, AtModalContent, AtModalAction, AtPagination } from 'taro-ui'
|
||||
import { AtInput, AtButton, Picker, AtIcon, AtModal, AtToast, AtModalHeader, AtModalContent, AtModalAction, AtPagination } from 'taro-ui'
|
||||
import CopyrightComponent from '../../component/copyrightComponent/copyrightComponent'
|
||||
|
||||
import InteractionComponent from '../../component/interactionComponent/interactionComponent'
|
||||
@ -20,14 +20,12 @@ class AllDemanding extends Component {
|
||||
super(...arguments)
|
||||
this.state = {
|
||||
supplys: [], // 需求列表
|
||||
isMore: 'more', // 加载状态
|
||||
demandingState: [{ name: '全部', id: '' }, { name: '在用', id: '1' }, { name: '已抢单', id: '2' }, { name: '已抢光', id: '3' },], // 供求状态选择
|
||||
demandingStateSelected: { name: '全部', id: '' }, // 当前供求状态
|
||||
industryTypeSelected: { name: '全部', id: '' },// 当前行业分类
|
||||
title: '',
|
||||
startDateSel: '',
|
||||
endDateSel: '',
|
||||
classId: '',
|
||||
isOpenedGrabModal: false,
|
||||
grabOrderId: '',//抢到订单的id
|
||||
isGrabOrderSuccess: false,// 是否显示轻提示
|
||||
@ -38,43 +36,7 @@ class AllDemanding extends Component {
|
||||
|
||||
}
|
||||
}
|
||||
//加载更多业主需求函数
|
||||
loadMoreDemanding(
|
||||
{ curr_page = 1, page_count = 20,
|
||||
state = this.state.demandingStateSelected.id,
|
||||
update_dateL = this.state.startDateSel,
|
||||
update_dateU = this.state.endDateSel,
|
||||
class_id = this.state.industryTypeSelected.id
|
||||
}
|
||||
) {
|
||||
Taro.request({
|
||||
url: URL.GetAllDemanding,
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
param: JSON.stringify({
|
||||
curr_page: curr_page,
|
||||
page_count: page_count,
|
||||
state: state,
|
||||
update_dateL: update_dateL,
|
||||
update_dateU: update_dateU,
|
||||
class_id: class_id
|
||||
}),
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
if (res.data.supplys.length) {
|
||||
Taro.hideLoading()
|
||||
this.setState({ supplys: this.state.supplys.concat(res.data.supplys), isMore: 'more' })
|
||||
} else {
|
||||
this.setState({ isMore: 'noMore' })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 搜索业主需求函数
|
||||
searchDemanding({ curr_page = 1, page_count = 10,
|
||||
sd_title = this.state.title,
|
||||
@ -122,14 +84,7 @@ class AllDemanding extends Component {
|
||||
|
||||
})
|
||||
}
|
||||
// 向上拉升延迟一秒加载数据
|
||||
handleLoadMore() {
|
||||
this.setState({ isMore: 'loading' })
|
||||
setTimeout(() => {
|
||||
currentPage += 1
|
||||
this.loadMoreDemanding({ curr_page: currentPage })
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
// 改变需求选项
|
||||
changeDemandingState = e => {
|
||||
this.setState({
|
||||
@ -226,7 +181,8 @@ class AllDemanding extends Component {
|
||||
title: '加载中'
|
||||
})
|
||||
this.setState({ currentPage: type.current, }, () => {
|
||||
this.searchDemanding({ curr_page :this.state.currentPage, page_count : 10,
|
||||
this.searchDemanding({
|
||||
curr_page: this.state.currentPage, page_count: 10,
|
||||
sd_title: this.state.title,
|
||||
state: this.state.demandingStateSelected.id,
|
||||
update_dateL: this.state.startDateSel,
|
||||
@ -290,13 +246,16 @@ class AllDemanding extends Component {
|
||||
<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' className='orange'> {item.state_name === '在用' ? '抢单' : '已抢单'}</AtButton>
|
||||
{item.state_name === '在用' ? <View className='button' onClick={this.grabOrder.bind(this, item.sd_id)}>
|
||||
<AtButton type='primary' size='small' className='orange'>抢单</AtButton>
|
||||
</View> : <View className='button' >
|
||||
<AtButton type='primary' size='small' className='blur'> 已抢单</AtButton>
|
||||
</View>
|
||||
}
|
||||
</View>
|
||||
</View>
|
||||
<View className='footer'>
|
||||
<View className='location'><AtIcon value='map-pin' size='12' color='black'></AtIcon>没有数据</View>
|
||||
<View className='location'><AtIcon value='map-pin' size='12' color='black'></AtIcon>{item.user_address}</View>
|
||||
<View className='time'>更新日期:{item.update_date}</View>
|
||||
</View>
|
||||
|
||||
|
@ -37,8 +37,8 @@ class Index extends Component {
|
||||
// url:'/pages/myNeeds/myNeeds',
|
||||
//url:'/pages/myNeedsPublish/myNeedsPublish'
|
||||
// url:'/pages/mySupplyDemand/mySupplyDemand'
|
||||
// url:'/pages/home/home'
|
||||
url:'/pages/allDemanding/allDemanding'
|
||||
url:'/pages/home/home'
|
||||
// url:'/pages/allDemanding/allDemanding'
|
||||
|
||||
|
||||
})
|
||||
|
@ -142,6 +142,7 @@ class Shop extends Component {
|
||||
}
|
||||
//侧边筛选商品类型
|
||||
if (data.goods_type) {
|
||||
// console.log('数据',data.goods_type)
|
||||
let goodTypeArray = []
|
||||
Object.keys(data.goods_type).forEach(key => {
|
||||
goodTypeArray.push({ id: data.goods_type[key].goods_type_id, name: data.goods_type[key].goods_type_ch_name, checked: false })
|
||||
|
@ -34,4 +34,3 @@ bug: 商品编辑 增加图片后 图片顺序乱了
|
||||
等待后台--- 单个我的商品页面的图片顺序,单个我的需求页面的接口, 当个我哦的需求编辑页面的接口
|
||||
|
||||
|
||||
// switch ---- shopTypeInteractionComp
|
Loading…
Reference in New Issue
Block a user