我的需求 需求编辑,需求查看 需求发布 --完成

This commit is contained in:
郑茂强 2019-01-09 11:06:10 +08:00
parent 8f34d1416f
commit 85e2a028ad
9 changed files with 134 additions and 106 deletions

View File

@ -275,7 +275,6 @@ class GoodsTypeInteractionComp extends Component {
componentDidHide() { } componentDidHide() { }
render() { render() {
console.log('this.state.objectMultiArray[0]',this.state.objectMultiArray[0][this.state.multiIndex[0]].name)
return ( return (
<View class='page-section'> <View class='page-section'>
<Picker <Picker

View File

@ -36,7 +36,7 @@ class Interaction extends Component {
'X-Requested-With': 'XMLHttpRequest' 'X-Requested-With': 'XMLHttpRequest'
} }
}).then(res => { }).then(res => {
console.log('行业分类列表', res) // console.log('行业分类列表', res)
this.formatIndustryType(res.data.data) this.formatIndustryType(res.data.data)
this.formatIndustTypeInit(res.data.data) this.formatIndustTypeInit(res.data.data)
@ -48,7 +48,7 @@ class Interaction extends Component {
formatIndustryType(data) { formatIndustryType(data) {
const newIndustryType = [{ name: '全部', id: '-1', child: [{ name: '', id: '' }] }] const newIndustryType = [{ name: '全部', id: '-1', child: [{ name: '', id: '' }] }]
for (let outter of data) { for (let outter of data) {
let outterObject = { name: outter.class_name, id: outter.class_id, child: [] } let outterObject = { name: outter.class_name, id: outter.class_id, child: [{name:'可选',id:''}] }
if (outter.child.length) { if (outter.child.length) {
for (let inner of outter.child) { for (let inner of outter.child) {
outterObject.child.push({ name: inner.class_name, id: inner.class_id }) outterObject.child.push({ name: inner.class_name, id: inner.class_id })
@ -79,8 +79,7 @@ class Interaction extends Component {
//--------------------开始-行业分类picker //--------------------开始-行业分类picker
bindMultiPickerChange(e) { bindMultiPickerChange(e) {
//判断如果formatInWindow 的子类为空 那就取父类, 反之取子类 //判断如果formatInWindow 的子类为空 那就取父类, 反之取子类
console.log('index', this.state.multiIndex)
console.log('formatInWindow', this.state.formatInWindow)
let industryTypeSelected let industryTypeSelected
if (this.state.formatInWindow[e.detail.value[0]].child[e.detail.value[1]].id === '') { if (this.state.formatInWindow[e.detail.value[0]].child[e.detail.value[1]].id === '') {
industryTypeSelected = this.state.formatInWindow[e.detail.value[0]] industryTypeSelected = this.state.formatInWindow[e.detail.value[0]]
@ -88,7 +87,7 @@ class Interaction extends Component {
industryTypeSelected = this.state.formatInWindow[e.detail.value[0]].child[e.detail.value[1]] industryTypeSelected = this.state.formatInWindow[e.detail.value[0]].child[e.detail.value[1]]
} }
console.log('picker发送选择改变携带值为', e.detail.value) // console.log('picker发送选择改变携带值为', e.detail.value)
this.setState({ this.setState({
multiIndex: e.detail.value, multiIndex: e.detail.value,
@ -98,12 +97,11 @@ class Interaction extends Component {
} }
bindMulPickerColChge(e) { bindMulPickerColChge(e) {
console.log('修改的列为', e.detail.column, ',值为', e.detail.value) // console.log('修改的列为', e.detail.column, ',值为', e.detail.value)
const data = { const data = {
objectMultiArray: this.state.objectMultiArray, objectMultiArray: this.state.objectMultiArray,
multiIndex: this.state.multiIndex multiIndex: this.state.multiIndex
} }
console.log(' this.state.formatInWindow', this.state.formatInWindow)
data.multiIndex[e.detail.column] = e.detail.value data.multiIndex[e.detail.column] = e.detail.value
switch (e.detail.column) { switch (e.detail.column) {
case 0: case 0:
@ -165,8 +163,8 @@ class Interaction extends Component {
break break
} }
console.log(data.multiIndex) // console.log(data.multiIndex)
console.log('objectMultiArray', data.objectMultiArray) // console.log('objectMultiArray', data.objectMultiArray)
this.setState({ this.setState({
multiIndex: data.multiIndex, multiIndex: data.multiIndex,
objectMultiArray: data.objectMultiArray objectMultiArray: data.objectMultiArray

View File

@ -214,7 +214,6 @@ class ShopTypeInteractionComp extends Component {
componentDidHide() { } componentDidHide() { }
render() { render() {
console.log('tesst',this.state.objectMultiArray)
return ( return (
<View class='page-section'> <View class='page-section'>
<Picker <Picker

View File

@ -231,7 +231,6 @@ class GoodsPublish extends Component {
const imagePath = URL.Base + data.file_path const imagePath = URL.Base + data.file_path
const newPickerImageUrl = that.state.pickerImageUrl.concat({ url: imagePath }) const newPickerImageUrl = that.state.pickerImageUrl.concat({ url: imagePath })
const newImageInfo = that.state.ImagesInfo.concat(data) const newImageInfo = that.state.ImagesInfo.concat(data)
console.log('第一', newImageInfo)
that.setState({ pickerImageUrl: newPickerImageUrl, ImagesInfo: newImageInfo }, () => { that.setState({ pickerImageUrl: newPickerImageUrl, ImagesInfo: newImageInfo }, () => {
Taro.showToast({ Taro.showToast({
title: '上传成功', title: '上传成功',
@ -253,13 +252,7 @@ class GoodsPublish extends Component {
}) })
} }
} }
// 图片上传失败
onFail(mes) {
console.log(mes)
}
// 删除图片
onImageClick(index) {
}
onClickUploadGoods() { onClickUploadGoods() {
if (this.state.productName && if (this.state.productName &&
this.state.productPrice && this.state.productPrice &&
@ -318,11 +311,8 @@ class GoodsPublish extends Component {
render() { render() {
console.log("this.state.productCategoryList", this.state.productCategoryList)
return ( return (
<View className='goods-publish'> <View className='goods-publish'>
<View className='goods-category'> <View className='goods-category'>
{/* 商品分类开始 */} {/* 商品分类开始 */}
<GoodsTypeInteractionComp url={URL.GetProductCategoryList} onPassDataToChild={this.getDataFromGoodsChild.bind(this)}></GoodsTypeInteractionComp> <GoodsTypeInteractionComp url={URL.GetProductCategoryList} onPassDataToChild={this.getDataFromGoodsChild.bind(this)}></GoodsTypeInteractionComp>

View File

@ -23,15 +23,15 @@ class MyNeeds extends Component {
startDateSel: '', startDateSel: '',
endDateSel: '', endDateSel: '',
industryType: '', industryType: '',
industryTypeSelected: { name: '全部', id: '-1' }, industryTypeSelected: { name: '全部', id: '' },
needsType: [{ name: '业主需求', id: '4' }, { name: '效果图', id: '5' }], needsType: [{ name: '业主需求', id: '4' }, { name: '效果图', id: '5' }],
needsTypeSelected: { name: '业主需求', id: '4' }, needsTypeSelected: { name: '业主需求', id: '4' },
needsState: [ needsState: [
{ name: '全部', id: '' }, { name: '全部', id: '' },
{ name: '作废', id: '0' } { name: '作废', id: '0' }
, { name: '在用', id: '1' }, , { name: '在用', id: '1' },
{ name: '设计中', id: '2' }, { name: '已抢单', id: '2' },
{ name: '已设计', id: '3' }], { name: '已抢光', id: '3' }],
needsStateSelected: { name: '全部', id: '' }, needsStateSelected: { name: '全部', id: '' },
pageCount: 10,// 列表数量 pageCount: 10,// 列表数量
allNeedsList: [],// 我的需求列表 allNeedsList: [],// 我的需求列表
@ -46,20 +46,16 @@ class MyNeeds extends Component {
//请求我的需求列表 api GetMyNeedsList //请求我的需求列表 api GetMyNeedsList
getMyNeedsList({ curr_page = 1, getMyNeedsList({ curr_page = 1,
page_count = 10, page_count = 20,
sd_type = 4, sd_type = '4',
sd_title = '', sd_title = '',
update_dateL = '', update_dateL = '',
update_dateU = '', update_dateU = '',
class_id = '', class_id = '',
state = "" state = ''
}) { }) {
Taro.request({ //由于后台返回的问题, 所有当state为空的时候不传state反之传state
url: URL.GetMyNeedsList, const param=state?{param: JSON.stringify({
method: 'POST',
dataType: 'json',
data: {
param: JSON.stringify({
curr_page: curr_page, curr_page: curr_page,
page_count: page_count, page_count: page_count,
sd_type: sd_type, sd_type: sd_type,
@ -68,8 +64,21 @@ class MyNeeds extends Component {
update_dateU: update_dateU, update_dateU: update_dateU,
class_id: class_id, class_id: class_id,
state: state state: state
}) })}:{param: JSON.stringify({
}, curr_page: curr_page,
page_count: page_count,
sd_type: sd_type,
sd_title: sd_title,
update_dateL: update_dateL,
update_dateU: update_dateU,
class_id: class_id,
})}
Taro.request({
url: URL.GetMyNeedsList,
method: 'POST',
dataType: 'json',
data: param,
header: { header: {
'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'), 'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'),
'content-type': 'application/x-www-form-urlencoded', 'content-type': 'application/x-www-form-urlencoded',
@ -142,7 +151,7 @@ class MyNeeds extends Component {
sd_title: this.state.title, sd_title: this.state.title,
update_dateL: this.state.startDateSel, update_dateL: this.state.startDateSel,
update_dateU: this.state.endDateSel, update_dateU: this.state.endDateSel,
class_id: this.state.industryTypeSelected.id, class_id: this.state.industryTypeSelected.id==='-1'?'':this.state.industryTypeSelected.id,
state: this.state.needsStateSelected.id state: this.state.needsStateSelected.id
}) })
this.setState({ currentPage: 1 }) this.setState({ currentPage: 1 })
@ -157,6 +166,21 @@ class MyNeeds extends Component {
url: '/pages/myNeedsPublish/myNeedsPublish' url: '/pages/myNeedsPublish/myNeedsPublish'
}) })
} }
//清空筛选项
emptyFilter(){
this.setState({
title:'',
endDateSel:'',
startDateSel:'',
})
Taro.showToast({
title:'已清空',
icon:'success',
duration:1000
})
}
titleChange(event) { titleChange(event) {
this.setState({ title: event }) this.setState({ title: event })
} }
@ -207,7 +231,9 @@ class MyNeeds extends Component {
// 翻页导航 // 翻页导航
paginationNav(type) { paginationNav(type) {
console.log(type.current) Taro.showLoading({
title:'加载中'
})
this.setState({ currentPage: type.current, }, () => { this.setState({ currentPage: type.current, }, () => {
this.getMyNeedsList({ this.getMyNeedsList({
curr_page: this.state.currentPage, curr_page: this.state.currentPage,
@ -247,12 +273,12 @@ class MyNeeds extends Component {
return <View className='needs-box' key={index}> return <View className='needs-box' key={index}>
<View className='industy-type box'> <View className='industy-type box'>
<Text className='title'>行业分类</Text> <Text className='title'>行业分类</Text>
<Text className='content'>{item.sd_type}</Text> <Text className='content'>{item.class_name}</Text>
</View> </View>
<View className='needs-title box'> <View className='needs-title box'>
<Text className='title'>需求标题</Text> <Text className='title'>需求标题</Text>
<Text className='content'>{item.sd_title}</Text> <Text className='content' onClick={this.state.goToMyNeedsViewPage.bind(this,item.sd_id)}>{item.sd_title}</Text>
</View> </View>
<View className='needs-state box'> <View className='needs-state box'>
<Text className='title'>需求状态</Text> <Text className='title'>需求状态</Text>
@ -262,7 +288,7 @@ class MyNeeds extends Component {
<Text className='title'>更新时间</Text> <Text className='title'>更新时间</Text>
<Text className='content'>{item.update_date}</Text> <Text className='content'>{item.update_date}</Text>
</View> </View>
{item.state === '1' ? <View className='info-button-box'> {item.state === '0'||item.state === '1' ? <View className='info-button-box'>
<View className='button' onClick={this.goToMyNeedsViewPage.bind(this, item.sd_id)}> <View className='button' onClick={this.goToMyNeedsViewPage.bind(this, item.sd_id)}>
<AtButton type='primary' size='small'>查看</AtButton> <AtButton type='primary' size='small'>查看</AtButton>
</View> </View>
@ -272,8 +298,7 @@ class MyNeeds extends Component {
<View className='button-a' onClick={this.deleteButton.bind(this, item)}> <View className='button-a' onClick={this.deleteButton.bind(this, item)}>
<AtButton type='primary' size='small'>删除</AtButton> <AtButton type='primary' size='small'>删除</AtButton>
</View> </View>
</View > : </View > : <View className='info-button-box'>
<View className='info-button-box'>
<View className='button' onClick={this.goToMyNeedsViewPage.bind(this, item.sd_id)}> <View className='button' onClick={this.goToMyNeedsViewPage.bind(this, item.sd_id)}>
<AtButton type='primary' size='small'>查看</AtButton> <AtButton type='primary' size='small'>查看</AtButton>
</View> </View>
@ -368,6 +393,11 @@ class MyNeeds extends Component {
<AtIcon value='add' size='12' color='white'></AtIcon> <AtIcon value='add' size='12' color='white'></AtIcon>
新增</AtButton> 新增</AtButton>
</View> </View>
<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>
</View> </View>
<View className='total'> <View className='total'>
<Text className='count'>{this.state.totalNeeds}</Text> <Text className='count'>{this.state.totalNeeds}</Text>

View File

@ -99,6 +99,11 @@ $themeColor:#FF7142;
background-color:#5cb85c; background-color:#5cb85c;
border:1PX solid #5cb85c; border:1PX solid #5cb85c;
} }
.button-b{
background-color:#d9534f;
border:1PX solid #d9534f;
}
} }
} }
@ -116,7 +121,7 @@ $themeColor:#FF7142;
padding: 10px; padding: 10px;
.box{ .box{
margin-top: 5px; margin-top: 10px;
font-size: 28px; font-size: 28px;
} }
.needs-title{ .needs-title{
@ -135,7 +140,7 @@ $themeColor:#FF7142;
.button{ .button{
// flex:1; // flex:1;
text-align: right; text-align: right;
margin:1% 1% 0; margin:2% 1% 0;
.at-button--primary{ .at-button--primary{
background-color:#FF9500; background-color:#FF9500;
@ -145,7 +150,7 @@ $themeColor:#FF7142;
.button-a{ .button-a{
// flex:1; // flex:1;
text-align: right; text-align: right;
margin:1% 1% 0; margin:2% 1% 0;
.at-button--primary{ .at-button--primary{
background-color:#d9534f; background-color:#d9534f;

View File

@ -31,8 +31,8 @@ class MyNeedsEdit extends Component {
needsStateSelected: { name: '全部', id: '' }, needsStateSelected: { name: '全部', id: '' },
title: '', title: '',
sd_id: '', //需求id sd_id: '', //需求id
contactName: Taro.getStorageSync('user_identity').username, contactName: '',
contactNumber: Taro.getStorageSync('user_identity').userphone, contactNumber: '',
contactAddress: '', contactAddress: '',
content: '',//描述 content: '',//描述
pickerImageUrl: [], pickerImageUrl: [],
@ -76,6 +76,12 @@ class MyNeedsEdit extends Component {
break break
} }
} }
if(!Object.keys(industryType).length){
industryType.name = '全部'
industryType.id =''
}
const needsType = this.state.needsType.filter(item => { const needsType = this.state.needsType.filter(item => {
return item.id === res.data.sdInfo.sd_type return item.id === res.data.sdInfo.sd_type
@ -89,6 +95,8 @@ class MyNeedsEdit extends Component {
industryTypeSelected: industryType, industryTypeSelected: industryType,
needsTypeSelected: needsType, needsTypeSelected: needsType,
title: res.data.sdInfo.sd_title, title: res.data.sdInfo.sd_title,
contactName:res.data.sdInfo.user_name,
contactNumber:res.data.sdInfo.user_phone,
contactAddress: res.data.sdInfo.user_address, contactAddress: res.data.sdInfo.user_address,
content: res.data.sdInfo.sd_desc, content: res.data.sdInfo.sd_desc,
needsStateSelected: needsState, needsStateSelected: needsState,
@ -231,14 +239,14 @@ class MyNeedsEdit extends Component {
}) })
} }
} }
// 修改求类型 // 修改求类型
demandingSupplyCate = e => { needsTypeChange = e => {
this.setState({ this.setState({
demandingSupplyCateSelected: this.state.demandingSupplyCate[e.detail.value] needsTypeSelected: this.state.needsType[e.detail.value]
}) })
} }
// 修改供求状态 // 修改供求状态
demSupplyStateChange = e => { needsStateChange = e => {
this.setState({ this.setState({
needsStateSelected: this.state.needsState[e.detail.value] needsStateSelected: this.state.needsState[e.detail.value]
}) })
@ -297,7 +305,7 @@ class MyNeedsEdit extends Component {
{/* 需求类型 */} {/* 需求类型 */}
<View className='page-section'> <View className='page-section'>
<View> <View>
<Picker mode='selector' rangeKey='name' range={this.state.needsType} onChange={this.demandingSupplyCate.bind(this)}> <Picker mode='selector' rangeKey='name' range={this.state.needsType} onChange={this.needsTypeChange.bind(this)}>
<View className='picker'> <View className='picker'>
<View className='title-box'> <View className='title-box'>
<Text className='title'><Text className='require'>*</Text>:</Text> <Text className='selected'>{this.state.needsTypeSelected.name}</Text> <Text className='title'><Text className='require'>*</Text>:</Text> <Text className='selected'>{this.state.needsTypeSelected.name}</Text>
@ -380,7 +388,7 @@ class MyNeedsEdit extends Component {
<View className='page-section'> <View className='page-section'>
<View> <View>
<Picker mode='selector' rangeKey='name' range={this.state.needsState} onChange={this.demSupplyStateChange}> <Picker mode='selector' rangeKey='name' range={this.state.needsState} onChange={this.needsStateChange.bind(this)}>
<View className='picker'> <View className='picker'>
<View className='title-box'> <View className='title-box'>
<Text className='title'> <Text className='require'>*</Text>:</Text> <Text className='selected'>{this.state.needsStateSelected.name}</Text> <Text className='title'> <Text className='require'>*</Text>:</Text> <Text className='selected'>{this.state.needsStateSelected.name}</Text>

View File

@ -26,8 +26,8 @@ class MyNeedsPublish extends Component {
needsType: [{ name: '业主需求', id: '4' }, { name: '效果图', id: '5' }], needsType: [{ name: '业主需求', id: '4' }, { name: '效果图', id: '5' }],
needsTypeSelected: { name: '业主需求', id: '4' }, needsTypeSelected: { name: '业主需求', id: '4' },
title: '', title: '',
contactName: Taro.getStorageSync('userInfo').login_name, contactName: Taro.getStorageSync('user_identity').username,
contactNumber: Taro.getStorageSync('userInfo').user_phone, contactNumber: Taro.getStorageSync('user_identity').userphone,
contactAddress: '', contactAddress: '',
content: '', content: '',
pickerImageUrl: [], // 上传的图片 pickerImageUrl: [], // 上传的图片
@ -105,11 +105,11 @@ class MyNeedsPublish extends Component {
icon: 'success', icon: 'success',
duration: 1500 duration: 1500
}).then(() => { }).then(() => {
// setTimeout(() => { setTimeout(() => {
// Taro.navigateTo({ Taro.navigateTo({
// // url: '/pages/mySupplyDemand/mySupplyDemand' url: '/pages/myNeeds/myNeeds'
// }) })
// }, 1500); }, 1500);
}) })
} else { } else {
@ -228,7 +228,6 @@ class MyNeedsPublish extends Component {
componentDidHide() { } componentDidHide() { }
render() { render() {
return ( return (
<View className='supply-demand'> <View className='supply-demand'>

View File

@ -1,7 +1,7 @@
import Taro, { Component } from '@tarojs/taro' import Taro, { Component } from '@tarojs/taro'
import { View, Text, Image,Button } from '@tarojs/components' import { View, Text, Image, Button } from '@tarojs/components'
import { AtButton, AtIcon,AtModal,AtModalHeader, AtModalContent, AtModalAction } from 'taro-ui' import { AtButton, AtIcon, AtModal, AtModalHeader, AtModalContent, AtModalAction } from 'taro-ui'
import URL from '../../serviceAPI.config' import URL from '../../serviceAPI.config'
import CopyrightComponent from '../../component/copyrightComponent/copyrightComponent' import CopyrightComponent from '../../component/copyrightComponent/copyrightComponent'
@ -28,7 +28,7 @@ class SupplyDemandView extends Component {
], ],
needsStateSelected: { name: '全部', id: '' }, needsStateSelected: { name: '全部', id: '' },
title: '', title: '',
browsing:'', browsing: '',
sd_id: '', //需求id sd_id: '', //需求id
contactName: '', contactName: '',
contactNumber: '', contactNumber: '',
@ -41,7 +41,7 @@ class SupplyDemandView extends Component {
//获取需求信息api //获取需求信息api
getSingleMyNeedInfo() { getSingleMyNeedInfo() {
Taro.request({ Taro.request({
url: URL.ViewMyNeeds,//EditMyNeeds url: URL.EditMyNeeds,
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
data: { data: {
@ -58,7 +58,7 @@ class SupplyDemandView extends Component {
// const selectedType = this.state.demandingSupplyCate.filter(item => item.id == res.data.sdInfo.sd_type)[0] // const selectedType = this.state.demandingSupplyCate.filter(item => item.id == res.data.sdInfo.sd_type)[0]
// const selectedState = this.state.needsState.filter(item => item.id == res.data.sdInfo.state)[0] // const selectedState = this.state.needsState.filter(item => item.id == res.data.sdInfo.state)[0]
Taro.hideLoading() Taro.hideLoading()
let industryType={} let industryType = {}
const classId = res.data.sdInfo.class_id const classId = res.data.sdInfo.class_id
for (let outter of res.data.supplyTree) { for (let outter of res.data.supplyTree) {
if (outter.children) { if (outter.children) {
@ -85,7 +85,7 @@ class SupplyDemandView extends Component {
return item.id === res.data.sdInfo.state return item.id === res.data.sdInfo.state
})[0] })[0]
this.setState({ this.setState({
sd_id:res.data.sdInfo.sd_id, sd_id: res.data.sdInfo.sd_id,
industryTypeSelected: industryType, industryTypeSelected: industryType,
needsTypeSelected: needsType, needsTypeSelected: needsType,
title: res.data.sdInfo.sd_title, title: res.data.sdInfo.sd_title,
@ -97,7 +97,7 @@ class SupplyDemandView extends Component {
needsStateSelected: needsState, needsStateSelected: needsState,
pickerImageUrl: imageFile, pickerImageUrl: imageFile,
ImagesInfo: res.data.sdInfo.file_path, ImagesInfo: res.data.sdInfo.file_path,
isDeleteModal:false, isDeleteModal: false,
}) })
@ -153,9 +153,9 @@ class SupplyDemandView extends Component {
} }
goMyNeedEditPage() { goMyNeedEditPage() {
console.log('edit page') console.log('edit page')
console.log('id',this.state.sd_id) console.log('id', this.state.sd_id)
Taro.navigateTo({ Taro.navigateTo({
url: '/pages/myNeedsEdit/myNeedsEdit?id='+this.state.sd_id url: '/pages/myNeedsEdit/myNeedsEdit?id=' + this.state.sd_id
}) })
} }
@ -167,18 +167,18 @@ class SupplyDemandView extends Component {
} }
deleteButton() { deleteButton() {
this.setState({isDeleteModal:true}) this.setState({ isDeleteModal: true })
} }
handleWindowModCancel(){ handleWindowModCancel() {
this.setState({isDeleteModal:false}) this.setState({ isDeleteModal: false })
} }
handleWindowConfirm(){ handleWindowConfirm() {
this.setState({isDeleteModal:false}) this.setState({ isDeleteModal: false })
this.deleteMyNeeds({ demandId: this.state.sd_id }) this.deleteMyNeeds({ demandId: this.state.sd_id })
} }
componentDidMount() { componentDidMount() {
Taro.showLoading({title:'加载中'}) Taro.showLoading({ title: '加载中' })
this.getSingleMyNeedInfo() this.getSingleMyNeedInfo()
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
@ -192,14 +192,14 @@ class SupplyDemandView extends Component {
componentDidHide() { } componentDidHide() { }
render() { render() {
const deleteModalWindowElement= <AtModal isOpened={this.state.isDeleteModal}> const deleteModalWindowElement = <AtModal isOpened={this.state.isDeleteModal}>
<AtModalHeader>提示</AtModalHeader> <AtModalHeader>提示</AtModalHeader>
<AtModalContent> <AtModalContent>
确认删除{this.state.needsItem.sd_title} 确认删除{this.state.needsItem.sd_title}
</AtModalContent> </AtModalContent>
<AtModalAction> <Button onClick={this.handleWindowModCancel.bind(this)}>取消</Button> <Button className='orange' onClick={this.handleWindowConfirm.bind(this)}></Button> </AtModalAction> <AtModalAction> <Button onClick={this.handleWindowModCancel.bind(this)}>取消</Button> <Button className='orange' onClick={this.handleWindowConfirm.bind(this)}></Button> </AtModalAction>
</AtModal> </AtModal>
const imageArrayElement=this.state.ImagesInfo.map((item,index)=>{ const imageArrayElement = this.state.ImagesInfo.map((item, index) => {
return <Image key={index} className='image' mode='widthFix' src={URL.Base + item.file_path} style='max-width: 100%; max-height:100%;' /> return <Image key={index} className='image' mode='widthFix' src={URL.Base + item.file_path} style='max-width: 100%; max-height:100%;' />
}) })
@ -209,7 +209,7 @@ class SupplyDemandView extends Component {
{deleteModalWindowElement} {deleteModalWindowElement}
<View className='type box'> <View className='type box'>
<Text className='title'>行业分类</Text> <Text className='title'>行业分类</Text>
<Text className='content'>{this.state.industryTypeSelected.name}</Text> <Text className='content'>{this.state.industryTypeSelected.name?this.state.industryTypeSelected.name:'--'}</Text>
</View> </View>
<View className='needed-title box'> <View className='needed-title box'>
<Text className='title'>需求标题</Text> <Text className='title'>需求标题</Text>
@ -235,13 +235,13 @@ class SupplyDemandView extends Component {
<Text className='title'>业主需求内容</Text> <Text className='title'>业主需求内容</Text>
<Text className='content'>{this.state.content}</Text> <Text className='content'>{this.state.content}</Text>
</View> </View>
<View className='needed-image box'> {this.state.ImagesInfo.length?<View className='needed-image box'>
<Text className='title'>业主需求图片</Text> <Text className='title'>业主需求图片</Text>
<View className='img-box'> <View className='img-box'>
{imageArrayElement} {imageArrayElement}
</View> </View>
</View> </View>:null
}
<View className='button-box'> <View className='button-box'>
<View className='button' onClick={this.goMyNeedsPublishPage.bind(this)}> <View className='button' onClick={this.goMyNeedsPublishPage.bind(this)}>