|
@@ -76,8 +76,6 @@ 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: {
|
|
@@ -288,9 +286,13 @@ class Index extends Component {
|
|
|
})
|
|
|
}
|
|
|
ptChange (key, val, arr) {
|
|
|
+ let { formObj } = this.state
|
|
|
+ if (formObj.id) {
|
|
|
+ Taro.$msg('已有房源,不能修改产品规格')
|
|
|
+ return
|
|
|
+ }
|
|
|
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]
|
|
@@ -505,14 +507,14 @@ class Index extends Component {
|
|
|
|
|
|
|
|
|
renderAddr () {
|
|
|
- const { addr1, addr2, addr3 } = this.state
|
|
|
+ const { addr1, addr2, addr3, formObj } = this.state
|
|
|
return (
|
|
|
- <View className="scoped-addr-box">
|
|
|
- <Input type="number" value={addr1} onInput={this.changeAddrInput.bind(this, 'addr1')} className="i" placeholder="__" />
|
|
|
+ <View className={formObj.id ? 'scoped-addr-box dis' : 'scoped-addr-box'}>
|
|
|
+ <Input type="number" disabled={formObj.id} value={addr1} onInput={this.changeAddrInput.bind(this, 'addr1')} className="i" placeholder="__" />
|
|
|
<View className='t'>栋座</View>
|
|
|
- <Input type="number" value={addr2} onInput={this.changeAddrInput.bind(this, 'addr2')} className="i" placeholder="__" />
|
|
|
+ <Input type="number" disabled={formObj.id} value={addr2} onInput={this.changeAddrInput.bind(this, 'addr2')} className="i" placeholder="__" />
|
|
|
<View className='t'>单元</View>
|
|
|
- <Input type="number" value={addr3} onInput={this.changeAddrInput.bind(this, 'addr3')} className="i" placeholder="__" />
|
|
|
+ <Input type="number" disabled={formObj.id} value={addr3} onInput={this.changeAddrInput.bind(this, 'addr3')} className="i" placeholder="__" />
|
|
|
<View className='t'>室号</View>
|
|
|
</View>
|
|
|
)
|
|
@@ -542,14 +544,14 @@ class Index extends Component {
|
|
|
)
|
|
|
}
|
|
|
renderHouseType () {
|
|
|
- const { hType1, hType2, hType3 } = this.state
|
|
|
+ const { hType1, hType2, hType3, formObj } = this.state
|
|
|
return (
|
|
|
- <View className="scoped-addr-box">
|
|
|
- <Input type="number" value={hType1} onInput={this.changeAddrInput.bind(this, 'hType1')} className="i" placeholder="__" />
|
|
|
+ <View className={formObj.id ? 'scoped-addr-box dis' : 'scoped-addr-box'}>
|
|
|
+ <Input type="number" value={hType1} disabled={formObj.id} onInput={this.changeAddrInput.bind(this, 'hType1')} className="i" placeholder="__" />
|
|
|
<View className='t'>室</View>
|
|
|
- <Input type="number" value={hType2} onInput={this.changeAddrInput.bind(this, 'hType2')} className="i" placeholder="__" />
|
|
|
+ <Input type="number" value={hType2} disabled={formObj.id} onInput={this.changeAddrInput.bind(this, 'hType2')} className="i" placeholder="__" />
|
|
|
<View className='t'>厅</View>
|
|
|
- <Input type="number" value={hType3} onInput={this.changeAddrInput.bind(this, 'hType3')} className="i" placeholder="__" />
|
|
|
+ <Input type="number" value={hType3} disabled={formObj.id} onInput={this.changeAddrInput.bind(this, 'hType3')} className="i" placeholder="__" />
|
|
|
<View className='t'>卫</View>
|
|
|
</View>
|
|
|
)
|
|
@@ -562,12 +564,12 @@ class Index extends Component {
|
|
|
|
|
|
|
|
|
renderStairsRate () {
|
|
|
- const { sRate1, sRate2 } = this.state
|
|
|
+ const { sRate1, sRate2, formObj } = 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={formObj.id ? 'scoped-floor-height-box dis' : 'scoped-floor-height-box'}>
|
|
|
+ <Input type="number" disabled={formObj.id} 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="__" />
|
|
|
+ <Input type="number" disabled={formObj.id} value={sRate2} onInput={this.changeAddrInput.bind(this, 'sRate2')} className="i" placeholder="__" />
|
|
|
<View className='t'>户</View>
|
|
|
</View>
|
|
|
)
|
|
@@ -575,10 +577,10 @@ class Index extends Component {
|
|
|
renderFloorHeight () {
|
|
|
const { formObj } = this.state
|
|
|
return (
|
|
|
- <View className='scoped-floor-height-box'>
|
|
|
- <Input type="number" value={formObj.floor} onInput={this.changeFormObjInput.bind(this, 'floor')} className="i" placeholder="所在楼层" />
|
|
|
+ <View className={formObj.id ? 'scoped-floor-height-box dis' : 'scoped-floor-height-box'}>
|
|
|
+ <Input type="number" disabled={formObj.id} value={formObj.floor} onInput={this.changeFormObjInput.bind(this, 'floor')} className="i" placeholder="所在楼层" />
|
|
|
<View className='t'>/</View>
|
|
|
- <Input type="number" value={formObj.storeys} onInput={this.changeFormObjInput.bind(this, 'storeys')} className="i" placeholder="总楼层" />
|
|
|
+ <Input type="number" disabled={formObj.id} value={formObj.storeys} onInput={this.changeFormObjInput.bind(this, 'storeys')} className="i" placeholder="总楼层" />
|
|
|
<View className='t'>层</View>
|
|
|
</View>
|
|
|
)
|
|
@@ -667,6 +669,18 @@ class Index extends Component {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ showPriceEdit () {
|
|
|
+ const { formObj } = this.state
|
|
|
+ Taro.$msgConfirm(`确定修改成${formObj.price}万元的对外展示总价吗`, () => {
|
|
|
+ Taro.api.room.apieshouseprice({
|
|
|
+ id: formObj.id,
|
|
|
+ price: formObj.price,
|
|
|
+ }).then(res => {
|
|
|
+ Taro.$msg(res.errmsg)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
render () {
|
|
|
const {id} = this.$router.params
|
|
@@ -824,6 +838,7 @@ class Index extends Component {
|
|
|
inputFont="万"
|
|
|
bc={this.baseFormChange.bind(this)}
|
|
|
/>
|
|
|
+ <View className="scoped-edit-btn" onClick={this.showPriceEdit.bind(this)}>修改展示的总价</View>
|
|
|
</View>
|
|
|
<View className="l-floor-pos2">
|
|
|
<LFormGroup
|