2018-12-07 17:17:46 +08:00
|
|
|
|
import Taro, { Component } from '@tarojs/taro'
|
2018-12-26 17:32:35 +08:00
|
|
|
|
import { View, Text, Button } from '@tarojs/components'
|
2019-01-09 16:46:57 +08:00
|
|
|
|
import { AtInput, AtButton, Picker, AtIcon, AtModal, AtModalHeader, AtModalContent, AtModalAction, AtPagination } from 'taro-ui'
|
2018-12-14 17:10:23 +08:00
|
|
|
|
import URL from '../../serviceAPI.config'
|
2018-12-07 17:17:46 +08:00
|
|
|
|
|
2018-12-29 17:15:59 +08:00
|
|
|
|
import CopyrightComponent from '../../component/copyrightComponent/copyrightComponent'
|
2018-12-07 17:17:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import './mySupplyDemand.scss'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MySupplyDemand extends Component {
|
|
|
|
|
|
|
|
|
|
config = {
|
|
|
|
|
navigationBarTitleText: '我的供求'
|
|
|
|
|
}
|
|
|
|
|
constructor() {
|
|
|
|
|
super(...arguments)
|
|
|
|
|
this.state = {
|
2018-12-29 17:15:59 +08:00
|
|
|
|
demandSupplyCate: [{ name: '全部', id: '' }, { name: '需求', id: '1' }, { name: '供应', id: '2' }, { name: '人才', id: '3' },],
|
|
|
|
|
demandSupplyCateSelected: { name: '全部', id: '' },
|
|
|
|
|
demandSupplyState: [{ name: '全部', id: '' }, { name: '上架', id: '1' }, { name: '下架', id: '0' }],
|
|
|
|
|
demandSupplyStatesSelected: { name: '全部', id: '' },
|
2018-12-19 17:40:32 +08:00
|
|
|
|
title: '',
|
2018-12-26 17:32:35 +08:00
|
|
|
|
startDateSel: '',
|
|
|
|
|
endDateSel: '',
|
2018-12-19 17:40:32 +08:00
|
|
|
|
allDemandSupply: [],
|
2018-12-24 17:35:51 +08:00
|
|
|
|
isConfirmWindow: false, // 是否显示确认弹窗
|
|
|
|
|
demandSupplyItemName: '',// 确认框提示时 使用的供求名
|
|
|
|
|
demandSupplyId: '',// 删除我的供求时的供求id
|
2019-01-09 16:46:57 +08:00
|
|
|
|
totalDemandSupply: 0,//所有供求
|
|
|
|
|
currentPage: 1 //当前页数
|
2018-12-19 17:40:32 +08:00
|
|
|
|
|
2018-12-07 17:17:46 +08:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-01-03 17:36:59 +08:00
|
|
|
|
//获取我的供求列表API
|
2019-01-02 17:31:07 +08:00
|
|
|
|
getMySupplyDemand({ curr_page = 1, page_count = 10 }) {
|
2018-12-14 17:10:23 +08:00
|
|
|
|
Taro.request({
|
|
|
|
|
url: URL.MySupplyDemand,
|
|
|
|
|
method: 'POST',
|
|
|
|
|
dataType: 'json',
|
2018-12-19 17:40:32 +08:00
|
|
|
|
|
2018-12-14 17:10:23 +08:00
|
|
|
|
data: {
|
2018-12-19 17:40:32 +08:00
|
|
|
|
param: JSON.stringify({
|
|
|
|
|
curr_page: curr_page,
|
|
|
|
|
page_count: page_count
|
|
|
|
|
})
|
2018-12-14 17:10:23 +08:00
|
|
|
|
},
|
|
|
|
|
header: {
|
2018-12-19 17:40:32 +08:00
|
|
|
|
'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'),
|
2018-12-14 17:10:23 +08:00
|
|
|
|
'content-type': 'application/x-www-form-urlencoded',
|
|
|
|
|
'X-Requested-With': 'XMLHttpRequest'
|
|
|
|
|
}
|
|
|
|
|
}).then(res => {
|
2018-12-19 17:40:32 +08:00
|
|
|
|
if (res.data.err_msg === "success") {
|
2018-12-26 17:32:35 +08:00
|
|
|
|
// 判断是否有res.data.supplys , 如果没有就是空数组[]
|
2018-12-29 17:15:59 +08:00
|
|
|
|
Taro.hideLoading()
|
2019-01-09 16:46:57 +08:00
|
|
|
|
const totalCount = Number(res.data.count)
|
|
|
|
|
this.setState({ allDemandSupply: res.data.supplys || [], totalDemandSupply: totalCount })
|
2018-12-19 17:40:32 +08:00
|
|
|
|
}
|
2018-12-24 17:35:51 +08:00
|
|
|
|
})
|
2018-12-19 17:40:32 +08:00
|
|
|
|
|
2018-12-24 17:35:51 +08:00
|
|
|
|
}
|
|
|
|
|
//搜索我的供求api
|
2018-12-29 17:15:59 +08:00
|
|
|
|
searchDemandSupply({ curr_page = 1, page_count = 20,
|
|
|
|
|
sd_type = this.state.demandSupplyCateSelected.id,
|
|
|
|
|
state = this.state.demandSupplyStatesSelected.id, sd_title = this.state.title, update_dateL = this.state.startDateSel, update_dateU = this.state.endDateSel }) {
|
2018-12-24 17:35:51 +08:00
|
|
|
|
Taro.request({
|
|
|
|
|
url: URL.SearchDemandSupply,
|
|
|
|
|
method: 'POST',
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
data: {
|
|
|
|
|
param: JSON.stringify({
|
|
|
|
|
curr_page: curr_page,
|
|
|
|
|
page_count: page_count,
|
|
|
|
|
sd_type: sd_type,
|
|
|
|
|
state: state,
|
|
|
|
|
sd_title: sd_title,
|
|
|
|
|
update_dateL: update_dateL,
|
|
|
|
|
update_dateU: update_dateU
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
header: {
|
|
|
|
|
'content-type': 'application/x-www-form-urlencoded',
|
|
|
|
|
'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'),
|
|
|
|
|
'X-Requested-With': 'XMLHttpRequest'
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.then(res => {
|
|
|
|
|
//this.setState({ grabOrderSuccess: res.data.err_msg,isGrabOrderSuccess: true })
|
|
|
|
|
console.log('我的供求搜索结果', res)
|
2018-12-29 17:15:59 +08:00
|
|
|
|
Taro.hideLoading()
|
|
|
|
|
this.setState({ allDemandSupply: res.data.supplys || [], totalDemandSupply: res.data.count })
|
2018-12-24 17:35:51 +08:00
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
2018-12-29 17:15:59 +08:00
|
|
|
|
}
|
2019-01-02 17:31:07 +08:00
|
|
|
|
onSearchButtonHandler() {
|
2019-01-09 16:46:57 +08:00
|
|
|
|
Taro.showLoading({ title: '加载中' })
|
2018-12-29 17:15:59 +08:00
|
|
|
|
|
2019-01-09 16:46:57 +08:00
|
|
|
|
this.setState({ currentPage: 1 }, () => {
|
|
|
|
|
this.searchDemandSupply({})
|
2018-12-29 17:15:59 +08:00
|
|
|
|
})
|
2019-01-02 17:31:07 +08:00
|
|
|
|
|
2018-12-24 17:35:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 删除我的供求api
|
|
|
|
|
onDelete({ sdID = 0 }) {
|
|
|
|
|
Taro.request({
|
|
|
|
|
url: URL.DeleteDemandSupply,
|
|
|
|
|
method: 'POST',
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
data: {
|
|
|
|
|
sdID: sdID
|
|
|
|
|
},
|
|
|
|
|
header: {
|
|
|
|
|
'content-type': 'application/x-www-form-urlencoded',
|
|
|
|
|
'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'),
|
|
|
|
|
'X-Requested-With': 'XMLHttpRequest'
|
|
|
|
|
}
|
2018-12-14 17:10:23 +08:00
|
|
|
|
})
|
2018-12-24 17:35:51 +08:00
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.data.err_msg == 'success') {
|
|
|
|
|
console.log('删除成功')
|
2018-12-29 17:15:59 +08:00
|
|
|
|
Taro.showToast({
|
|
|
|
|
title: '删除成功'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.getMySupplyDemand({})
|
2018-12-24 17:35:51 +08:00
|
|
|
|
})
|
2018-12-29 17:15:59 +08:00
|
|
|
|
|
2018-12-26 17:32:35 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
2018-12-29 17:15:59 +08:00
|
|
|
|
Taro.showToast({
|
|
|
|
|
title: res.data.err_msg,
|
|
|
|
|
icon: 'none'
|
2018-12-24 17:35:51 +08:00
|
|
|
|
})
|
2018-12-29 17:15:59 +08:00
|
|
|
|
|
2018-12-24 17:35:51 +08:00
|
|
|
|
}
|
2018-12-14 17:10:23 +08:00
|
|
|
|
|
2018-12-24 17:35:51 +08:00
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
.catch(error => {
|
2018-12-29 17:15:59 +08:00
|
|
|
|
|
|
|
|
|
Taro.showToast({
|
|
|
|
|
title: '删除失败',
|
|
|
|
|
icon: 'none'
|
2018-12-24 17:35:51 +08:00
|
|
|
|
})
|
|
|
|
|
})
|
2018-12-14 17:10:23 +08:00
|
|
|
|
}
|
2018-12-24 17:35:51 +08:00
|
|
|
|
//搜索我的供求
|
|
|
|
|
|
2018-12-14 17:10:23 +08:00
|
|
|
|
|
2018-12-19 17:40:32 +08:00
|
|
|
|
|
2018-12-24 17:35:51 +08:00
|
|
|
|
// 新增我的供求
|
|
|
|
|
addDemandSupply() {
|
|
|
|
|
Taro.navigateTo({
|
|
|
|
|
url: '/pages/supplyDemandPublish/supplyDemandPublish'
|
|
|
|
|
})
|
|
|
|
|
}
|
2019-01-09 16:46:57 +08:00
|
|
|
|
//清空筛选项
|
|
|
|
|
emptyFilter() {
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
title: '',
|
|
|
|
|
endDateSel: '',
|
|
|
|
|
startDateSel: '',
|
|
|
|
|
demandSupplyCateSelected: { name: '全部', id: '' },
|
|
|
|
|
demandSupplyStatesSelected: { name: '全部', id: '' },
|
|
|
|
|
})
|
|
|
|
|
Taro.showToast({
|
|
|
|
|
title: '已清空',
|
|
|
|
|
icon: 'success',
|
|
|
|
|
duration: 1000
|
|
|
|
|
})
|
|
|
|
|
}
|
2018-12-24 17:35:51 +08:00
|
|
|
|
|
2018-12-19 17:40:32 +08:00
|
|
|
|
|
2018-12-11 17:34:06 +08:00
|
|
|
|
//修改供求类型
|
|
|
|
|
demSupplyCateChange = e => {
|
2018-12-07 17:17:46 +08:00
|
|
|
|
this.setState({
|
2018-12-11 17:34:06 +08:00
|
|
|
|
demandSupplyCateSelected: this.state.demandSupplyCate[e.detail.value]
|
2018-12-29 17:15:59 +08:00
|
|
|
|
}, () => {
|
|
|
|
|
console.log(this.state.demandSupplyCateSelected)
|
2018-12-07 17:17:46 +08:00
|
|
|
|
})
|
|
|
|
|
}
|
2018-12-11 17:34:06 +08:00
|
|
|
|
// 修改供求状态
|
|
|
|
|
demSupplyStateChange = e => {
|
2018-12-07 17:17:46 +08:00
|
|
|
|
this.setState({
|
2018-12-11 17:34:06 +08:00
|
|
|
|
demandSupplyStatesSelected: this.state.demandSupplyState[e.detail.value]
|
2018-12-07 17:17:46 +08:00
|
|
|
|
})
|
|
|
|
|
}
|
2018-12-19 17:40:32 +08:00
|
|
|
|
titleChange(event) {
|
|
|
|
|
this.setState({ title: event })
|
2018-12-11 17:34:06 +08:00
|
|
|
|
}
|
|
|
|
|
// 修改开始日期
|
|
|
|
|
onStartDateChange = e => {
|
|
|
|
|
this.setState({
|
|
|
|
|
startDateSel: e.detail.value
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 修改结束日期
|
|
|
|
|
onEndDateChange = e => {
|
2018-12-07 17:17:46 +08:00
|
|
|
|
this.setState({
|
2018-12-11 17:34:06 +08:00
|
|
|
|
endDateSel: e.detail.value
|
2018-12-07 17:17:46 +08:00
|
|
|
|
})
|
|
|
|
|
}
|
2018-12-24 17:35:51 +08:00
|
|
|
|
handleWindowModClose() {
|
|
|
|
|
this.setState({ isConfirmWindow: false })
|
|
|
|
|
}
|
|
|
|
|
handleWindowModCancel() {
|
|
|
|
|
this.setState({ isConfirmWindow: false })
|
|
|
|
|
}
|
|
|
|
|
handleWindowConfirm() {
|
|
|
|
|
this.setState({ isConfirmWindow: false })
|
|
|
|
|
this.onDelete({ sdID: this.state.demandSupplyId })
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 删除我的供求
|
|
|
|
|
handleOnDelete(id, itemName) {
|
|
|
|
|
this.setState({ isConfirmWindow: true, demandSupplyItemName: itemName, demandSupplyId: id })
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-09 16:46:57 +08:00
|
|
|
|
|
2018-12-24 17:35:51 +08:00
|
|
|
|
// 编辑我的供求
|
|
|
|
|
|
2018-12-26 17:32:35 +08:00
|
|
|
|
// 跳转到我的供求编辑页面
|
2019-01-02 17:31:07 +08:00
|
|
|
|
goToMyDSEditPage(sdId) {
|
2018-12-26 17:32:35 +08:00
|
|
|
|
Taro.navigateTo({
|
2019-01-02 17:31:07 +08:00
|
|
|
|
url: '/pages/myDemandSupplyEdit/myDemandSupplyEdit?sdId=' + sdId
|
2018-12-29 17:15:59 +08:00
|
|
|
|
})
|
2018-12-26 17:32:35 +08:00
|
|
|
|
|
|
|
|
|
}
|
2018-12-29 17:15:59 +08:00
|
|
|
|
// 转到供求查看页面
|
2019-01-09 16:46:57 +08:00
|
|
|
|
goSupplyDemandView(sdId) {
|
2018-12-29 17:15:59 +08:00
|
|
|
|
Taro.navigateTo({
|
2019-01-02 17:31:07 +08:00
|
|
|
|
url: '/pages/supplyDemandView/supplyDemandView?sdId=' + sdId
|
|
|
|
|
})
|
2018-12-29 17:15:59 +08:00
|
|
|
|
}
|
2019-01-09 16:46:57 +08:00
|
|
|
|
// 翻页导航
|
|
|
|
|
paginationNav(type) {
|
|
|
|
|
Taro.showLoading({ title: '加载中' })
|
|
|
|
|
this.setState({ currentPage: type.current, }, () => {
|
|
|
|
|
this.getMySupplyDemand({ curr_page: this.state.currentPage })
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
2018-12-24 17:35:51 +08:00
|
|
|
|
|
2019-01-02 17:31:07 +08:00
|
|
|
|
|
2018-12-07 17:17:46 +08:00
|
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
|
|
console.log(this.props, nextProps)
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-19 17:40:32 +08:00
|
|
|
|
componentDidMount() {
|
2019-01-02 17:31:07 +08:00
|
|
|
|
Taro.showLoading({ title: '加载中' }).then(() => {
|
|
|
|
|
this.getMySupplyDemand({})
|
|
|
|
|
})
|
2018-12-14 17:10:23 +08:00
|
|
|
|
}
|
2018-12-07 17:17:46 +08:00
|
|
|
|
componentWillUnmount() { }
|
|
|
|
|
|
|
|
|
|
componentDidShow() { }
|
|
|
|
|
|
|
|
|
|
componentDidHide() { }
|
|
|
|
|
|
|
|
|
|
render() {
|
2018-12-26 17:32:35 +08:00
|
|
|
|
|
|
|
|
|
|
2018-12-24 17:35:51 +08:00
|
|
|
|
// 提示模态弹窗element
|
2018-12-26 17:32:35 +08:00
|
|
|
|
const modalMessageConfirmElement = <AtModal isOpened={this.state.isConfirmWindow}>
|
|
|
|
|
<AtModalHeader>提示</AtModalHeader>
|
|
|
|
|
<AtModalContent>
|
|
|
|
|
确认删除{this.state.demandSupplyItemName}?
|
|
|
|
|
</AtModalContent>
|
|
|
|
|
<AtModalAction> <Button onClick={this.handleWindowModCancel.bind(this)}>取消</Button> <Button className='orange' onClick={this.handleWindowConfirm.bind(this)}>确定</Button> </AtModalAction>
|
|
|
|
|
</AtModal>
|
2019-01-09 16:46:57 +08:00
|
|
|
|
|
2019-01-02 17:31:07 +08:00
|
|
|
|
|
2018-12-19 17:40:32 +08:00
|
|
|
|
const demandSupplyElementArray = this.state.allDemandSupply.length ? this.state.allDemandSupply.map((item, index) => {
|
2019-01-09 16:46:57 +08:00
|
|
|
|
const SDState = this.state.demandSupplyState.filter(stateItem => {
|
|
|
|
|
return stateItem.id == item.state
|
2019-01-02 17:31:07 +08:00
|
|
|
|
})[0].name
|
2019-01-09 16:46:57 +08:00
|
|
|
|
|
|
|
|
|
return <View key={index} className='info-container'>
|
2018-12-19 17:40:32 +08:00
|
|
|
|
<View className='type'>
|
|
|
|
|
<Text className='title'>需求类型:</Text>
|
|
|
|
|
<Text className='info'>{item.type_name}</Text>
|
|
|
|
|
</View>
|
|
|
|
|
<View className='demand-title'>
|
|
|
|
|
<Text className='title'>需求标题:</Text>
|
2019-01-09 16:46:57 +08:00
|
|
|
|
<Text className='info' onClick={this.goSupplyDemandView.bind(this, item.sd_id)}>{item.sd_title}</Text>
|
2018-12-19 17:40:32 +08:00
|
|
|
|
</View>
|
|
|
|
|
<View className='contact-name'>
|
|
|
|
|
<Text className='title'>联系人:</Text>
|
|
|
|
|
<Text className='info'>{item.user_name}</Text>
|
|
|
|
|
</View>
|
|
|
|
|
<View className='contact-number'>
|
|
|
|
|
<Text className='title'>电话号码:</Text>
|
|
|
|
|
<Text className='info'>{item.user_phone}</Text>
|
|
|
|
|
</View>
|
|
|
|
|
<View className='demand-status'>
|
|
|
|
|
<Text className='title'>需求状态:</Text>
|
2019-01-02 17:31:07 +08:00
|
|
|
|
<Text className='info'>{SDState}</Text>
|
2018-12-19 17:40:32 +08:00
|
|
|
|
</View>
|
|
|
|
|
<View className='update-time'>
|
|
|
|
|
<Text className='title'>更新时间:</Text>
|
|
|
|
|
<Text className='info'>{item.update_date}</Text>
|
|
|
|
|
</View>
|
|
|
|
|
<View className='info-button-box'>
|
2019-01-09 16:46:57 +08:00
|
|
|
|
<View className='button' onClick={this.goSupplyDemandView.bind(this, item.sd_id)}>
|
2018-12-19 17:40:32 +08:00
|
|
|
|
<AtButton type='primary' size='small'>查看</AtButton>
|
|
|
|
|
</View>
|
2019-01-02 17:31:07 +08:00
|
|
|
|
<View className='button' onClick={this.goToMyDSEditPage.bind(this, item.sd_id)} >
|
2018-12-19 17:40:32 +08:00
|
|
|
|
<AtButton type='primary' size='small'>编辑</AtButton>
|
|
|
|
|
</View>
|
2018-12-24 17:35:51 +08:00
|
|
|
|
<View className='button' onClick={this.handleOnDelete.bind(this, item.sd_id, item.sd_title)}>
|
2018-12-19 17:40:32 +08:00
|
|
|
|
<AtButton type='primary' className='button-a' size='small'>删除</AtButton>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</View>
|
2018-12-24 17:35:51 +08:00
|
|
|
|
}) : <View className='title' >
|
|
|
|
|
没有更多了....
|
|
|
|
|
</View >
|
2018-12-07 17:17:46 +08:00
|
|
|
|
return (
|
|
|
|
|
<View className='mySupplyDemand'>
|
2018-12-24 17:35:51 +08:00
|
|
|
|
{/* 是否删除供求确认框 */}
|
|
|
|
|
{modalMessageConfirmElement}
|
2019-01-02 17:31:07 +08:00
|
|
|
|
|
2018-12-24 17:35:51 +08:00
|
|
|
|
|
2018-12-11 17:34:06 +08:00
|
|
|
|
{/* 供求类型 */}
|
2018-12-07 17:17:46 +08:00
|
|
|
|
<View className='page-section'>
|
|
|
|
|
<View>
|
2018-12-29 17:15:59 +08:00
|
|
|
|
<Picker mode='selector' rangeKey='name' range={this.state.demandSupplyCate} onChange={this.demSupplyCateChange.bind(this)}>
|
2018-12-07 17:17:46 +08:00
|
|
|
|
<View className='picker'>
|
|
|
|
|
<View className='title-box'>
|
2018-12-29 17:15:59 +08:00
|
|
|
|
<Text className='title'><Text className='require'>*</Text>供求类型:</Text> <Text className='selected'>{this.state.demandSupplyCateSelected.name}</Text>
|
2018-12-07 17:17:46 +08:00
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</Picker>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
2018-12-11 17:34:06 +08:00
|
|
|
|
{/* 供求状态 */}
|
2018-12-07 17:17:46 +08:00
|
|
|
|
<View className='page-section'>
|
|
|
|
|
|
|
|
|
|
<View>
|
2018-12-29 17:15:59 +08:00
|
|
|
|
<Picker mode='selector' rangeKey='name' range={this.state.demandSupplyState} onChange={this.demSupplyStateChange.bind(this)}>
|
2018-12-07 17:17:46 +08:00
|
|
|
|
<View className='picker'>
|
|
|
|
|
<View className='title-box'>
|
2018-12-29 17:15:59 +08:00
|
|
|
|
<Text className='title'> <Text className='require'>*</Text>供求状态:</Text> <Text className='selected'>{this.state.demandSupplyStatesSelected.name}</Text>
|
2018-12-07 17:17:46 +08:00
|
|
|
|
</View>
|
|
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
</Picker>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
2018-12-11 17:34:06 +08:00
|
|
|
|
{/* 供求标题 */}
|
2018-12-07 17:17:46 +08:00
|
|
|
|
<View className='input-box'>
|
|
|
|
|
<Text className='require'>*</Text>
|
|
|
|
|
<AtInput
|
2018-12-29 17:15:59 +08:00
|
|
|
|
name='value'
|
|
|
|
|
title='供求标题:'
|
|
|
|
|
placeholder='供求标题·'
|
|
|
|
|
type='text'
|
|
|
|
|
value={this.state.title}
|
|
|
|
|
onChange={this.titleChange.bind(this)}
|
2018-12-07 17:17:46 +08:00
|
|
|
|
/>
|
|
|
|
|
</View>
|
2018-12-11 17:34:06 +08:00
|
|
|
|
{/* 开始和结束日期 */}
|
2018-12-07 17:17:46 +08:00
|
|
|
|
<View className='page-section'>
|
|
|
|
|
<View className='picker-box'>
|
2018-12-11 17:34:06 +08:00
|
|
|
|
<Picker mode='date' className='picker-container' onChange={this.onStartDateChange}>
|
2018-12-07 17:17:46 +08:00
|
|
|
|
<View className='picker'>
|
|
|
|
|
<View className='title-box'>
|
2019-01-09 16:46:57 +08:00
|
|
|
|
<Text className='title'><Text className='require'>*</Text>开始日期:</Text> <Text className='date'>{this.state.startDateSel}</Text>
|
2018-12-07 17:17:46 +08:00
|
|
|
|
</View>
|
2018-12-19 17:40:32 +08:00
|
|
|
|
|
2018-12-07 17:17:46 +08:00
|
|
|
|
</View>
|
|
|
|
|
</Picker>
|
2018-12-26 17:32:35 +08:00
|
|
|
|
<Picker className='picker-container' mode='date' start={this.state.startDateSel} onChange={this.onEndDateChange}>
|
2018-12-07 17:17:46 +08:00
|
|
|
|
<View className='picker'>
|
|
|
|
|
<View className='title-box'>
|
2019-01-09 16:46:57 +08:00
|
|
|
|
<Text className='title'><Text className='require'>*</Text>结束日期:</Text> <Text className='date'>{this.state.endDateSel}</Text>
|
2018-12-07 17:17:46 +08:00
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</Picker>
|
2018-12-19 17:40:32 +08:00
|
|
|
|
|
2018-12-07 17:17:46 +08:00
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
|
|
<View className='button-box'>
|
2018-12-29 17:15:59 +08:00
|
|
|
|
<View className='button' onClick={this.onSearchButtonHandler.bind(this)}>
|
2018-12-07 17:17:46 +08:00
|
|
|
|
<AtButton type='primary' size='small'>
|
|
|
|
|
<AtIcon value='search' size='12' color='white'></AtIcon>
|
2018-12-19 17:40:32 +08:00
|
|
|
|
搜索</AtButton>
|
2018-12-07 17:17:46 +08:00
|
|
|
|
</View>
|
2018-12-24 17:35:51 +08:00
|
|
|
|
<View className='button' onClick={this.addDemandSupply.bind(this)}>
|
2018-12-10 17:38:17 +08:00
|
|
|
|
<AtButton type='primary' className='button-a' size='small'>
|
2018-12-07 17:17:46 +08:00
|
|
|
|
<AtIcon value='add' size='12' color='white'></AtIcon>
|
2018-12-19 17:40:32 +08:00
|
|
|
|
新增</AtButton>
|
2018-12-07 17:17:46 +08:00
|
|
|
|
</View>
|
2019-01-09 16:46:57 +08:00
|
|
|
|
<View className='button' onClick={this.emptyFilter.bind(this)}>
|
|
|
|
|
<AtButton type='primary' className='button-b' size='small'>
|
|
|
|
|
<AtIcon value='trash' size='12' color='white'></AtIcon>
|
|
|
|
|
清空</AtButton>
|
|
|
|
|
</View>
|
2018-12-07 17:17:46 +08:00
|
|
|
|
</View>
|
2018-12-19 17:40:32 +08:00
|
|
|
|
<View className='total-count'>一共<Text className='number'>{this.state.totalDemandSupply}</Text> 条记录</View>
|
2018-12-11 17:34:06 +08:00
|
|
|
|
{/* 我的供求信息 */}
|
2018-12-07 17:17:46 +08:00
|
|
|
|
<View className='info-box'>
|
2018-12-19 17:40:32 +08:00
|
|
|
|
{demandSupplyElementArray}
|
2018-12-07 17:17:46 +08:00
|
|
|
|
</View>
|
2019-01-02 17:31:07 +08:00
|
|
|
|
<View className='pagination-box'>
|
2019-01-09 16:46:57 +08:00
|
|
|
|
<AtPagination
|
|
|
|
|
total={this.state.totalDemandSupply}
|
|
|
|
|
pageSize={10}
|
|
|
|
|
current={this.state.currentPage}
|
|
|
|
|
onPageChange={this.state.paginationNav.bind(this)}
|
|
|
|
|
>
|
|
|
|
|
</AtPagination>
|
|
|
|
|
|
|
|
|
|
</View>
|
2018-12-19 17:40:32 +08:00
|
|
|
|
|
2018-12-07 17:17:46 +08:00
|
|
|
|
|
|
|
|
|
|
2018-12-29 17:15:59 +08:00
|
|
|
|
<CopyrightComponent></CopyrightComponent>
|
2018-12-07 17:17:46 +08:00
|
|
|
|
|
|
|
|
|
</View>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default MySupplyDemand
|