|
@@ -32,6 +32,8 @@ class Index extends Component {
|
|
|
hType1: '',
|
|
|
hType2: '',
|
|
|
hType3: '',
|
|
|
+ sRate1: '',
|
|
|
+ sRate2: '',
|
|
|
formObj: {
|
|
|
hide_status: '1',
|
|
|
},
|
|
@@ -54,8 +56,9 @@ class Index extends Component {
|
|
|
Taro.api.room.apieshousedetail({id}).then(res => {
|
|
|
let cObj = res || {}
|
|
|
// console.log(cObj)
|
|
|
- const addr = cObj.house_no.split('-')
|
|
|
- const hType = cObj.house_type.split('-')
|
|
|
+ const addr = cObj.house_no ? cObj.house_no.split('-') : []
|
|
|
+ const hType = cObj.house_type ? cObj.house_type.split('-') : []
|
|
|
+ const sRate = cObj.stairs_rate ? cObj.stairs_rate.split('-') : []
|
|
|
Taro.setNavigationBarTitle({
|
|
|
title: cObj.sale_user.sale_name + '-编辑房源'
|
|
|
})
|
|
@@ -81,6 +84,8 @@ class Index extends Component {
|
|
|
remarked: cObj.remarked || '',
|
|
|
pri_image: cObj.pri_image || '',
|
|
|
house_img: cObj.house_img || '',
|
|
|
+ position: cObj.position || '',
|
|
|
+ floor_price: cObj.floor_price || '',
|
|
|
},
|
|
|
imgArr: (cObj.images && cObj.images.length > 0) ? cObj.images.split(',') : [],
|
|
|
addr1: addr[0],
|
|
@@ -89,6 +94,8 @@ class Index extends Component {
|
|
|
hType1: hType[0],
|
|
|
hType2: hType[1],
|
|
|
hType3: hType[2],
|
|
|
+ sRate1: sRate[0],
|
|
|
+ sRate2: sRate[1],
|
|
|
})
|
|
|
})
|
|
|
}
|
|
@@ -97,7 +104,7 @@ class Index extends Component {
|
|
|
|
|
|
|
|
|
saveHandle () {
|
|
|
- const { formObj, imgArr, addr1, addr2, addr3, hType1, hType2, hType3 } = this.state
|
|
|
+ const { formObj, imgArr, addr1, addr2, addr3, hType1, hType2, hType3, sRate1, sRate2 } = this.state
|
|
|
let house_no = ''
|
|
|
if (addr1 && addr2 && addr3) {
|
|
|
house_no = `${addr1}-${addr2}-${addr3}`
|
|
@@ -109,6 +116,11 @@ class Index extends Component {
|
|
|
if (hType1 && hType2 && hType3) {
|
|
|
house_type = `${hType1}-${hType2}-${hType3}`
|
|
|
}
|
|
|
+ let stairs_rate = ''
|
|
|
+ if (sRate1 && sRate2) {
|
|
|
+ stairs_rate = `${sRate1}-${sRate1}`
|
|
|
+ }
|
|
|
+
|
|
|
// console.log(formObj.estate_id, formObj.title, formObj.pri_image)
|
|
|
let apiStr = 'apieshouseadd'
|
|
|
let params = {
|
|
@@ -117,6 +129,7 @@ class Index extends Component {
|
|
|
house_no,
|
|
|
delivery_at: formObj.delivery_at,
|
|
|
house_type,
|
|
|
+ stairs_rate,
|
|
|
price: formObj.price,
|
|
|
area: formObj.area,
|
|
|
full_year: formObj.full_year,
|
|
@@ -131,6 +144,8 @@ class Index extends Component {
|
|
|
hide_status: formObj.hide_status,
|
|
|
pri_image: formObj.pri_image,
|
|
|
house_img: formObj.house_img,
|
|
|
+ position: formObj.position,
|
|
|
+ floor_price: formObj.floor_price,
|
|
|
images: imgArr.join(','),
|
|
|
}
|
|
|
if (formObj.id) {
|
|
@@ -164,14 +179,14 @@ class Index extends Component {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- dealImgHandle (key) {
|
|
|
+ dealImgHandle (key, moreStr) {
|
|
|
this.uploadComImg((val) => {
|
|
|
let { formObj } = this.state
|
|
|
formObj[key] = val
|
|
|
this.setState({
|
|
|
formObj
|
|
|
})
|
|
|
- })
|
|
|
+ }, 1, moreStr)
|
|
|
}
|
|
|
|
|
|
addImg () {
|
|
@@ -181,9 +196,9 @@ class Index extends Component {
|
|
|
this.setState({
|
|
|
imgArr
|
|
|
})
|
|
|
- }, 2)
|
|
|
+ }, 9)
|
|
|
}
|
|
|
- uploadComImg (bc, count) {
|
|
|
+ uploadComImg (bc, count, moreStr) {
|
|
|
const that = this
|
|
|
Taro.chooseImage({
|
|
|
count: count ? count : 1, // 默认9
|
|
@@ -194,7 +209,7 @@ class Index extends Component {
|
|
|
if (tempFilePaths.length > 0) {
|
|
|
let imgBcArr = []
|
|
|
tempFilePaths.forEach((p, i) => {
|
|
|
- that.diyUploadFile(p).then(url => {
|
|
|
+ that.diyUploadFile(p, moreStr).then(url => {
|
|
|
imgBcArr.push(url)
|
|
|
if (bc && imgBcArr.length === tempFilePaths.length) {
|
|
|
bc(imgBcArr)
|
|
@@ -205,11 +220,13 @@ class Index extends Component {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- diyUploadFile (filePath) {
|
|
|
+ diyUploadFile (filePath, moreStr) {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
let token = Taro.getStorageSync('APP_token')
|
|
|
+ let url = `https://api.honglouplus.com/api/upload/cloudpir`
|
|
|
+ if (moreStr === 'noSign') url = `https://api.honglouplus.com/api/upload/cloud`
|
|
|
Taro.uploadFile({
|
|
|
- url: `https://api.honglouplus.com/api/upload/cloudpir`,
|
|
|
+ url,
|
|
|
filePath,
|
|
|
name: 'upload',
|
|
|
formData: {
|
|
@@ -282,7 +299,19 @@ class Index extends Component {
|
|
|
[str]: e.detail.value
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
|
|
|
+ renderStairsRate () {
|
|
|
+ const { sRate1, sRate2 } = this.state
|
|
|
+ return (
|
|
|
+ <View className='scoped-floor-height-box'>
|
|
|
+ <Input type="number" value={sRate1} onInput={this.changeAddrInput.bind(this, 'sRate1')} className="i" placeholder="__" />
|
|
|
+ <View className='t'>梯</View>
|
|
|
+ <Input type="number" value={sRate2} onInput={this.changeAddrInput.bind(this, 'sRate2')} className="i" placeholder="__" />
|
|
|
+ <View className='t'>户</View>
|
|
|
+ </View>
|
|
|
+ )
|
|
|
+ }
|
|
|
renderFloorHeight () {
|
|
|
const { formObj } = this.state
|
|
|
return (
|
|
@@ -376,6 +405,7 @@ class Index extends Component {
|
|
|
const houseRoomYearMoreOptions = {arr: dictData.house_room_year}
|
|
|
const yesnoMoreOptions = {arr: [...dictData.sys_yesno]}
|
|
|
const hideStatusoMoreOptions = {arr: [...dictData.hide_status]}
|
|
|
+ const roomPositionMoreOptions = {arr: [...dictData.room_position]}
|
|
|
const addIcon = require('@img/icon_upload_img.png')
|
|
|
const closeIcon = require('@img/icon_g_close.png')
|
|
|
const imgItems = imgArr.map((src, index) => {
|
|
@@ -396,11 +426,33 @@ class Index extends Component {
|
|
|
return (
|
|
|
<View className="l-box">
|
|
|
{/* {this.renderCutImg()} */}
|
|
|
- <View className="l-floor-pos2">
|
|
|
+ {
|
|
|
+ formObj.estate_name
|
|
|
+ ?
|
|
|
+ <View className="l-floor-pos2">
|
|
|
+ <Navigator url={`/pagesHouse/indexDtl?id=${formObj.estate_id}`} className='scoped-estate-name'>{formObj.estate_name}{'>'}</Navigator>
|
|
|
+ <LFormGroup
|
|
|
+ val={formObj.estate_id}
|
|
|
+ valStr="estate_id"
|
|
|
+ keyStr="当前楼盘"
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+ :
|
|
|
+ <LFormGroup
|
|
|
+ val={formObj.estate_id}
|
|
|
+ valStr="estate_id"
|
|
|
+ keyStr="选楼盘(必填)"
|
|
|
+ keyStr2="请选择"
|
|
|
+ typeStr="radio"
|
|
|
+ moreOptions={moreEstateOptions}
|
|
|
+ bc={this.baseFormChange.bind(this)}
|
|
|
+ />
|
|
|
+ }
|
|
|
+ {/* <View className="l-floor-pos2">
|
|
|
{
|
|
|
formObj.estate_name
|
|
|
?
|
|
|
- <Navigator url={`/pagesHouse/indexDtl?id=${formObj.estate_id}`} className='scoped-estate-name'>{formObj.estate_name}[只读]</Navigator>
|
|
|
+ <View className='scoped-estate-name'>{formObj.estate_name}[{formObj.estate_id}]</View>
|
|
|
: ''
|
|
|
}
|
|
|
<LFormGroup
|
|
@@ -412,7 +464,7 @@ class Index extends Component {
|
|
|
moreOptions={moreEstateOptions}
|
|
|
bc={this.baseFormChange.bind(this)}
|
|
|
/>
|
|
|
- </View>
|
|
|
+ </View> */}
|
|
|
<View className="l-floor-pos2">
|
|
|
<LFormGroup
|
|
|
val={formObj.title}
|
|
@@ -426,7 +478,7 @@ class Index extends Component {
|
|
|
<LFormGroup
|
|
|
val={formObj.house_no}
|
|
|
valStr="house_no"
|
|
|
- keyStr="地址"
|
|
|
+ keyStr="地址(必填)"
|
|
|
/>
|
|
|
{this.renderAddr()}
|
|
|
</View>
|
|
@@ -446,11 +498,19 @@ class Index extends Component {
|
|
|
/>
|
|
|
{this.renderFloorHeight()}
|
|
|
</View>
|
|
|
+ <View className="l-floor-pos2">
|
|
|
+ <LFormGroup
|
|
|
+ val={formObj.stairs_rate}
|
|
|
+ valStr="stairs_rate"
|
|
|
+ keyStr="梯户比"
|
|
|
+ />
|
|
|
+ {this.renderStairsRate()}
|
|
|
+ </View>
|
|
|
<View className="l-floor-pos2">
|
|
|
<LFormGroup
|
|
|
val={formObj.area}
|
|
|
valStr="area"
|
|
|
- keyStr="建筑面积"
|
|
|
+ keyStr="房屋面积"
|
|
|
keyStr2="请输入"
|
|
|
typeStr="inputFont"
|
|
|
inputFont="㎡"
|
|
@@ -468,6 +528,18 @@ class Index extends Component {
|
|
|
bc={this.baseFormChange.bind(this)}
|
|
|
/>
|
|
|
</View>
|
|
|
+ <View className="l-floor-pos2">
|
|
|
+ <LFormGroup
|
|
|
+ val={formObj.floor_price}
|
|
|
+ valStr="floor_price"
|
|
|
+ keyStr="实际底价"
|
|
|
+ keyStr2="请输入"
|
|
|
+ typeStr="inputFont"
|
|
|
+ inputFont="万"
|
|
|
+ bc={this.baseFormChange.bind(this)}
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+
|
|
|
<View className="l-floor-pos2">
|
|
|
<LFormGroup
|
|
|
val={formObj.owner}
|
|
@@ -541,6 +613,17 @@ class Index extends Component {
|
|
|
bc={this.baseFormChange.bind(this)}
|
|
|
/>
|
|
|
</View>
|
|
|
+ <View className="l-floor-pos2">
|
|
|
+ <LFormGroup
|
|
|
+ val={formObj.position}
|
|
|
+ valStr="position"
|
|
|
+ keyStr="户型方位"
|
|
|
+ keyStr2="请选择"
|
|
|
+ typeStr="select"
|
|
|
+ moreOptions={roomPositionMoreOptions}
|
|
|
+ bc={this.baseFormChange.bind(this)}
|
|
|
+ />
|
|
|
+ </View>
|
|
|
<View className='scoped-has-right'>
|
|
|
<View className="scoped-box">
|
|
|
<View className="sb-title">封面主图片(必填)</View>
|
|
@@ -575,11 +658,11 @@ class Index extends Component {
|
|
|
{
|
|
|
formObj.house_img
|
|
|
?
|
|
|
- <View className="si-op" onClick={this.dealImgHandle.bind(this, 'house_img')}>
|
|
|
- <Image src={formObj.house_img + '_plus'} className="img"/>
|
|
|
+ <View className="si-op" onClick={this.dealImgHandle.bind(this, 'house_img', 'noSign')}>
|
|
|
+ <Image src={formObj.house_img} className="img"/>
|
|
|
</View>
|
|
|
:
|
|
|
- <View className="si-op" onClick={this.dealImgHandle.bind(this, 'house_img')}>
|
|
|
+ <View className="si-op" onClick={this.dealImgHandle.bind(this, 'house_img', 'noSign')}>
|
|
|
<Image src={addIcon} className="img"/>
|
|
|
</View>
|
|
|
}
|