|
@@ -15,11 +15,15 @@ class Index extends Component {
|
|
|
onShareAppMessage() {
|
|
|
return {
|
|
|
title: `自助上传房源`,
|
|
|
+ path: `/pagesMore/center/uploadRoom`,
|
|
|
+ imageUrl: 'https://img2.honglounews.com/20240717120305-2731.jpg'
|
|
|
}
|
|
|
}
|
|
|
onShareTimeline () {
|
|
|
return {
|
|
|
title: `自助上传房源`,
|
|
|
+ path: `/pagesMore/center/uploadRoom`,
|
|
|
+ imageUrl: 'https://img2.honglounews.com/20240717120305-2731.jpg'
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -40,10 +44,12 @@ class Index extends Component {
|
|
|
},
|
|
|
dtlObj: {},
|
|
|
imgArr: [],
|
|
|
+ hideAlbumArr: [],
|
|
|
cutImgTempUrl: '',
|
|
|
cutImgShow: false,
|
|
|
curProductTypeName: '',
|
|
|
productHouseList: [],
|
|
|
+ custObj: {},
|
|
|
}
|
|
|
}
|
|
|
config = {
|
|
@@ -55,7 +61,7 @@ class Index extends Component {
|
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
|
|
- const {id} = this.$router.params
|
|
|
+ const {id, cid} = this.$router.params
|
|
|
if (id) {
|
|
|
Taro.api.room.apieshousedetail({id}).then(res => {
|
|
|
let cObj = res || {}
|
|
@@ -70,6 +76,8 @@ class Index extends Component {
|
|
|
this.getPtData(cObj.estate_id)
|
|
|
}
|
|
|
setTimeout(() => {
|
|
|
+ console.log(`${cObj.product_type}--${cObj.house_type.replace(/-/g, '')}--${cObj.area}--${cObj.house_img}`)
|
|
|
+ console.log(cObj.hide_album)
|
|
|
this.setState({
|
|
|
dtlObj: cObj,
|
|
|
formObj: {
|
|
@@ -100,8 +108,9 @@ class Index extends Component {
|
|
|
video: cObj.video || '',
|
|
|
product_type: cObj.product_type || '',
|
|
|
},
|
|
|
- curProductTypeName: cObj.product_type && cObj.house_type ? `${cObj.product_type}-${cObj.house_type.replace(/-/g, '')}` : '',
|
|
|
+ curProductTypeName: cObj.product_type && cObj.house_type ? `${cObj.product_type}--${cObj.house_type.replace(/-/g, '')}--${cObj.area}--${cObj.house_img}` : '',
|
|
|
imgArr: (cObj.images && cObj.images.length > 0) ? cObj.images.split(',') : [],
|
|
|
+ hideAlbumArr: (cObj.hide_album && cObj.hide_album.length > 0) ? cObj.hide_album.split(',') : [],
|
|
|
addr1: addr[0],
|
|
|
addr2: addr[1],
|
|
|
addr3: addr[2],
|
|
@@ -114,6 +123,25 @@ class Index extends Component {
|
|
|
}, 1000)
|
|
|
})
|
|
|
}
|
|
|
+ if (cid) {
|
|
|
+ Taro.api.base.apiuserhouselist({id: cid}).then(res => {
|
|
|
+ const list = res.list || []
|
|
|
+ const custObj = list[0] || {}
|
|
|
+ Taro.setNavigationBarTitle({
|
|
|
+ title: `房东${custObj.phone}的新增房源`
|
|
|
+ })
|
|
|
+ const imgArr = custObj.images ? custObj.images.split(',') : []
|
|
|
+ this.setState({
|
|
|
+ custObj,
|
|
|
+ imgArr,
|
|
|
+ hideAlbumArr: [custObj.house_cert],
|
|
|
+ formObj: {
|
|
|
+ owner_phone: custObj.phone,
|
|
|
+ introduce: custObj.remark,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -132,7 +160,7 @@ class Index extends Component {
|
|
|
|
|
|
|
|
|
saveHandle (pStr) {
|
|
|
- const { formObj, imgArr, addr1, addr2, addr3, hType1, hType2, hType3, sRate1, sRate2, dtlObj } = this.state
|
|
|
+ const { formObj, imgArr, hideAlbumArr, addr1, addr2, addr3, hType1, hType2, hType3, sRate1, sRate2, dtlObj } = this.state
|
|
|
let house_no = ''
|
|
|
if (!formObj.product_type) {
|
|
|
Taro.$msg('请选择产品规格')
|
|
@@ -193,6 +221,7 @@ class Index extends Component {
|
|
|
floor_price: formObj.floor_price,
|
|
|
video: formObj.video || '',
|
|
|
images: imgArr.join(','),
|
|
|
+ hide_album: hideAlbumArr.join(','),
|
|
|
}
|
|
|
if (pStr === 'is_sold') {
|
|
|
params.is_sold = 1
|
|
@@ -241,9 +270,10 @@ class Index extends Component {
|
|
|
list.forEach(one => {
|
|
|
const htList = one.house_type_list || []
|
|
|
htList.forEach(two => {
|
|
|
+ let areaObj = two.area_list && two.area_list.length > 0 ? two.area_list[0] : {}
|
|
|
productHouseList.push({
|
|
|
key: `${ptObj[one.product_type_val]}-${htObj[two.house_type_val]}`,
|
|
|
- val: `${one.product_type_val}-${two.house_type_val}`
|
|
|
+ val: `${one.product_type_val}--${two.house_type_val}--${areaObj.area}--${areaObj.img_url}_plus`
|
|
|
})
|
|
|
})
|
|
|
})
|
|
@@ -252,11 +282,14 @@ class Index extends Component {
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
- ptChange (key, val) {
|
|
|
- const ptArr = val.split('-')
|
|
|
+ ptChange (key, val, arr) {
|
|
|
+ console.log(arrToObjarr)
|
|
|
+ const ptArr = val.split('--')
|
|
|
const htSub = ptArr[1].split('')
|
|
|
let { formObj } = this.state
|
|
|
formObj.product_type = ptArr[0]
|
|
|
+ formObj.area = ptArr[2]
|
|
|
+ formObj.house_img = ptArr[3]
|
|
|
this.setState({
|
|
|
formObj,
|
|
|
curProductTypeName: val,
|
|
@@ -357,6 +390,36 @@ class Index extends Component {
|
|
|
}, 1, moreStr)
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ addHideAlbum () {
|
|
|
+ this.uploadComImg((arr) => {
|
|
|
+ let { hideAlbumArr } = this.state
|
|
|
+ hideAlbumArr = [...hideAlbumArr, ...arr]
|
|
|
+ this.setState({
|
|
|
+ hideAlbumArr
|
|
|
+ })
|
|
|
+ }, 9)
|
|
|
+ }
|
|
|
+ delHideAlbum (index) {
|
|
|
+ let { hideAlbumArr } = this.state
|
|
|
+ hideAlbumArr.splice(index, 1)
|
|
|
+ this.setState({
|
|
|
+ hideAlbumArr
|
|
|
+ })
|
|
|
+ }
|
|
|
+ previewHideAlbumHandle (current, arr) {
|
|
|
+ const { hideAlbumArr } = this.state
|
|
|
+ let nArr = hideAlbumArr.map(item => {
|
|
|
+ return item + '_plus'
|
|
|
+ })
|
|
|
+ Taro.previewImage({
|
|
|
+ current,
|
|
|
+ urls: nArr
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
addImg () {
|
|
|
this.uploadComImg((arr) => {
|
|
|
let { imgArr } = this.state
|
|
@@ -603,7 +666,7 @@ class Index extends Component {
|
|
|
|
|
|
render () {
|
|
|
const {id} = this.$router.params
|
|
|
- const { formObj, imgArr, dtlObj, curProductTypeName, productHouseList } = this.state
|
|
|
+ const { formObj, imgArr, hideAlbumArr, dtlObj, curProductTypeName, productHouseList } = this.state
|
|
|
const dictData = Taro.getStorageSync('dictData')
|
|
|
const roomDecMoreOptions = {arr: dictData.room_dec}
|
|
|
const houseRoomYearMoreOptions = {arr: dictData.house_room_year}
|
|
@@ -622,6 +685,14 @@ class Index extends Component {
|
|
|
</View>
|
|
|
)
|
|
|
})
|
|
|
+ const hideAlbumItems = hideAlbumArr.map((src, index) => {
|
|
|
+ return (
|
|
|
+ <View className="si-op" key={index}>
|
|
|
+ <Image src={src + '_plus'} className="img" onClick={this.previewHideAlbumHandle.bind(this, src + '_plus')} />
|
|
|
+ <Image src={closeIcon} className="i" onClick={this.delHideAlbum.bind(this, index)}/>
|
|
|
+ </View>
|
|
|
+ )
|
|
|
+ })
|
|
|
let moreEstateOptions = {
|
|
|
api: 'house.admestatelist',
|
|
|
opKey: 'estate_name',
|
|
@@ -661,7 +732,7 @@ class Index extends Component {
|
|
|
val={curProductTypeName}
|
|
|
valStr="curProductTypeName"
|
|
|
keyStr="产品(必填)"
|
|
|
- keyStr2="请选择"
|
|
|
+ keyStr2=" "
|
|
|
typeStr="select"
|
|
|
moreOptions={ptMoreOptions}
|
|
|
bc={this.ptChange.bind(this)}
|
|
@@ -958,6 +1029,21 @@ class Index extends Component {
|
|
|
placeholder='仅编辑查看,房源内部备注信息(300字以内)'
|
|
|
/>
|
|
|
</View>
|
|
|
+ <View className="scoped-box">
|
|
|
+ <View className="sb-title">隐藏相册
|
|
|
+ <View className="s">(如房产证等,最多9张)</View>
|
|
|
+ </View>
|
|
|
+ <View className="scoped-img">
|
|
|
+ {hideAlbumItems}
|
|
|
+ {
|
|
|
+ hideAlbumArr.length < 9
|
|
|
+ &&
|
|
|
+ <View className="si-op" onClick={this.addHideAlbum.bind(this)}>
|
|
|
+ <Image src={addIcon} className="img"/>
|
|
|
+ </View>
|
|
|
+ }
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
{/* <View className="scoped-box">
|
|
|
<View className="sb-title">跟进记录备注</View>
|
|
|
<AtTextarea
|
|
@@ -972,11 +1058,16 @@ class Index extends Component {
|
|
|
<View className="lff-flex">
|
|
|
<View className="lff-btn full" onClick={this.saveHandle.bind(this)}>提交</View>
|
|
|
</View>
|
|
|
- <View className="lff-flex" style="padding-top: 10px;padding-bottom: 16px;position:relative;">
|
|
|
- <View className="lff-btn full t2" onClick={this.linkAddRecord.bind(this)}>添加跟进记录
|
|
|
+ {
|
|
|
+ id
|
|
|
+ ?
|
|
|
+ <View className="lff-flex" style="padding-top: 10px;padding-bottom: 16px;position:relative;">
|
|
|
+ <View className="lff-btn full t2" onClick={this.linkAddRecord.bind(this)}>添加跟进记录
|
|
|
+ </View>
|
|
|
+ <View className="scoped-footer-btn-tips">创建人15天未跟进信息,房源将进入自由池,解除锁定</View>
|
|
|
</View>
|
|
|
- <View className="scoped-footer-btn-tips">创建人15天未跟进信息,房源将进入自由池,解除锁定</View>
|
|
|
- </View>
|
|
|
+ : ''
|
|
|
+ }
|
|
|
{
|
|
|
id
|
|
|
?
|