|
@@ -81,8 +81,10 @@ class Index extends Component {
|
|
|
estate_id: eId,
|
|
|
building_id: buildingNumList[curNav].id,
|
|
|
}).then(res => {
|
|
|
+ const data = res.data || {}
|
|
|
this.setState({
|
|
|
- roomArr: res || []
|
|
|
+ allData: res || {},
|
|
|
+ roomArr: data || []
|
|
|
})
|
|
|
if (this.subChat) {
|
|
|
this.subChat.getData({name, id: eId}, 'pt')
|
|
@@ -99,9 +101,11 @@ class Index extends Component {
|
|
|
building_id: buildingNumList[curNav].id,
|
|
|
estate_id: eId,
|
|
|
}).then(res => {
|
|
|
+ const data = res.data || {}
|
|
|
this.setState({
|
|
|
+ allData: res || {},
|
|
|
curObj: buildingNumList[curNav] || {},
|
|
|
- roomArr: res || []
|
|
|
+ roomArr: data || []
|
|
|
})
|
|
|
})
|
|
|
}
|
|
@@ -116,7 +120,11 @@ class Index extends Component {
|
|
|
|
|
|
renderTop () {
|
|
|
const { name} = this.$router.params
|
|
|
- const { curNav, buildingNumList } = this.state
|
|
|
+ const { curNav, buildingNumList, allData } = this.state
|
|
|
+ let newTabList = JSON.parse(JSON.stringify(buildingNumList))
|
|
|
+ if (newTabList[curNav] && newTabList[curNav].title) {
|
|
|
+ newTabList[curNav].title = `${newTabList[curNav].title}(${allData.avg_price}/㎡)`
|
|
|
+ }
|
|
|
const nameIcon = require('./img/yfyj/yfyj04.png')
|
|
|
return (
|
|
|
<View className="scoped-header">
|
|
@@ -135,7 +143,7 @@ class Index extends Component {
|
|
|
<AtTabs
|
|
|
current={curNav}
|
|
|
scroll
|
|
|
- tabList={buildingNumList}
|
|
|
+ tabList={newTabList}
|
|
|
onClick={this.navClick.bind(this)}>
|
|
|
</AtTabs>
|
|
|
</View>
|
|
@@ -180,7 +188,9 @@ class Index extends Component {
|
|
|
}
|
|
|
|
|
|
renderInfo () {
|
|
|
- const { roomArr } = this.state
|
|
|
+ const { roomArr, allData } = this.state
|
|
|
+ const house_type_total = allData.house_type_total || {}
|
|
|
+ const htaArr = house_type_total.house_type_avg || []
|
|
|
let cArr = roomArr || []
|
|
|
const htArr = cArr[0] ? cArr[0].data : []
|
|
|
const htArrIndex = htArr.length
|
|
@@ -197,6 +207,7 @@ class Index extends Component {
|
|
|
</View>
|
|
|
<View className="p1">{item.house_type}</View>
|
|
|
<View className="p2">{item.built}㎡</View>
|
|
|
+ <View className="p2">¥{htaArr[index]}/㎡</View>
|
|
|
{
|
|
|
item.house_rate === '100%'
|
|
|
? ''
|