230320a303 10 months ago
parent
commit
a03370d4ec
2 changed files with 17 additions and 6 deletions
  1. 1 1
      src/api/room.js
  2. 16 5
      src/pagesRoom/roomPriceXk.jsx

+ 1 - 1
src/api/room.js

@@ -106,7 +106,7 @@ export default {
     return request('/api/rent/house/edit', params, 'loading')
   },
   apinewhousepricelist: params => { // 房源表 一房一价新
-    return request('/api/new/house/price/list', params, 'loading')
+    return request('/api/new/house/price/list', params, 'allData')
   },
   apinewhousepriceedit: params => { // 房源表 销控编辑
     return request('/api/new/house/price/edit', params, 'loading')

+ 16 - 5
src/pagesRoom/roomPriceXk.jsx

@@ -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%'
               ? ''