Browse Source

修改成新的一房一价模式

230320a303 11 months ago
parent
commit
373f15fb8c

+ 1 - 1
.vscode/settings.json

@@ -1,3 +1,3 @@
 {
-    "stockCode": "sz002460,sz000333,sz300346"
+    "stockCode": "sz002460,sz000333,sz300346,sh560980"
 }

+ 3 - 0
src/api/room.js

@@ -102,6 +102,9 @@ export default {
   apirenthouseedit: params => { // 二手房 出租 编辑
     return request('/api/rent/house/edit', params, 'loading')
   },
+  apinewhousepricelist: params => { // 房源表 一房一价新
+    return request('/api/new/house/price/list', params, 'loading')
+  },
   apibuildingunitlist: params => { // 房源表 单元 列表
     return request('/api/building/unit/list', params, 'loading')
   },

+ 15 - 31
src/pagesHouse/indexDtl.jsx

@@ -868,12 +868,11 @@ class Index extends Component {
     const i2 = require('./img/yfyj/yfyj02.png')
     const bg = require('./img/yfyj/yfyj03s.jpg')
     const { curObj } = this.state
-    const lotteryObj = curObj.estate_lottery || {}
     const { userInfo } = this.state
     const uInfo = userInfo || Taro.getStorageSync('APP_userInfo')
     return (
       <View className={uInfo.is_sale == 1 ? 'scoped-entry-yh' : 'scoped-entry-yh hide'}>
-        <Navigator url={`/pagesRoom/roomPrice2?eId=${curObj.id}&name=${curObj.estate_name}&id=${lotteryObj.id}`} className="sey-wrap">
+        <Navigator url={`/pagesRoom/roomPrice2?eId=${curObj.id}&name=${curObj.estate_name}`} className="sey-wrap">
           <View className="sey-img">
             <Image className="img" src={bg}></Image>
           </View>
@@ -887,36 +886,30 @@ class Index extends Component {
     const i2 = require('./img/yfyj/yfyj02.png')
     const bg = require('./img/yfyj/yfyj03s.jpg')
     const { curObj } = this.state
-    const lotteryObj = curObj.estate_lottery || {}
+    const estateBuildingObj = curObj.estate_building || {}
     const { userInfo } = this.state
     const uInfo = userInfo || Taro.getStorageSync('APP_userInfo')
     return (
       <View className="scoped-entry-yh">
         {
-          uInfo.is_sale == 1
+          uInfo.is_sale == 2
           ?
-          <Navigator url={`/pagesRoom/roomPriceXk?eId=${curObj.id}&name=${curObj.estate_name}&id=${lotteryObj.id}`} className="sey-wrap">
-            <View className="sey-p1">
-              <Image className="i" src={i1}></Image>
-              <View className="t">最新更新:{lotteryObj.building_num}</View>
-            </View>
-            <View className="sey-p1">
-              <Image className="i" src={i2}></Image>
-              <View className="t2">{lotteryObj.update_at}</View>
-            </View>
-            <View className="sey-img">
-              <Image className="img" src={bg}></Image>
-            </View>
-          </Navigator> 
+          <View className={'scoped-entry-yh'}>
+            <Navigator url={`/pagesRoom/roomPrice2?eId=${curObj.id}&name=${curObj.estate_name}`} className="sey-wrap">
+              <View className="sey-img">
+                <Image className="img" src={bg}></Image>
+              </View>
+            </Navigator>
+          </View>
           : 
-          <Navigator url={`/pagesRoom/roomPrice?eId=${curObj.id}&name=${curObj.estate_name}&id=${lotteryObj.id}`} className="sey-wrap">
+          <Navigator url={`/pagesRoom/roomPrice?eId=${curObj.id}&name=${curObj.estate_name}`} className="sey-wrap">
             <View className="sey-p1">
               <Image className="i" src={i1}></Image>
-              <View className="t">最新更新:{lotteryObj.building_num}</View>
+              <View className="t">最新更新:{`${estateBuildingObj.building}栋${estateBuildingObj.unit}单元`}</View>
             </View>
             <View className="sey-p1">
               <Image className="i" src={i2}></Image>
-              <View className="t2">{lotteryObj.update_at}</View>
+              <View className="t2">{estateBuildingObj.create_at}</View>
             </View>
             <View className="sey-img">
               <Image className="img" src={bg}></Image>
@@ -1115,7 +1108,7 @@ class Index extends Component {
     const pagesLength = pages.length
     const schoolList = curObj.school_list || {}
     const { YH } = this.$router.params
-    const lotteryObj = curObj.estate_lottery || {}
+    const estateBuildingObj = curObj.estate_building || {}
     const channelList = curObj.estate_channel || []
     const { viewId } = this.state
     return (
@@ -1142,20 +1135,11 @@ class Index extends Component {
              : this.renderAdBanner2()
             }
             
-            {/* {
-              lotteryObj.lottery_res
-              ? this.renderYH()
-              :
-              lotteryObj.under_way
-              ?
-              this.renderEntryYH()
-              : ''
-            } */}
             {
               curObj.estate_tag === '二手'
               ? this.renderEntryYH2()
               :
-              lotteryObj.building_num
+              estateBuildingObj.id
               ?
               this.renderEntryYH()
               : ''

+ 1 - 2
src/pagesHouse/indexDtl.scss

@@ -360,9 +360,8 @@ page {
     padding: 20px 0 0;
   }
   .sey-p1 {
-    padding-bottom: 10px;
     display: flex;
-    padding: 0 20px 20px;
+    padding: 0 20px 10px;
     .t2 {
       display: inline-block;
       vertical-align: top;

+ 26 - 20
src/pagesRoom/roomPrice.jsx

@@ -49,25 +49,21 @@ class Index extends Component {
     //   title: name + '-一房一价表' || '一房一价表'
     // })
     const {eId, id} = this.$router.params
-    Taro.api.house.apiestatelottery2batchinfo({
-      lottery_id: id,
+    Taro.api.room.apibuildingunitlist({
       estate_id: eId,
     }).then(res => {
-      let ll = res.lottery_list || []
+      let ll = res.list || []
       let buildingNumList = []
       ll.forEach(item => {
-        const arr = item.building_num.split(',')
-        arr.forEach(sub => {
-          buildingNumList.push({
-            id: item.id,
-            title: sub,
-            lottery_time: item.lottery_time
-          })
+        buildingNumList.push({
+          id: item.id,
+          title: `${item.building}栋${item.unit}单元`,
+          lottery_time: item.lottery_time
         })
       })
       this.setState({
         buildingNumList,
-        curObj: res || {}
+        curObj: buildingNumList[0] || {}
       }, () => {
         this.getDtl()
       })
@@ -77,10 +73,9 @@ class Index extends Component {
   getDtl = () => {
     const { curNav, buildingNumList } = this.state
     const {eId, name, id} = this.$router.params
-    Taro.api.house.apiestatelotterypricelist({
+    Taro.api.room.apinewhousepricelist({
       estate_id: eId,
-      lottery_id: buildingNumList[curNav].id,
-      building_num: buildingNumList[curNav].title,
+      building_id: buildingNumList[curNav].id,
     }).then(res => {
       this.setState({
         roomArr: res || []
@@ -96,12 +91,13 @@ class Index extends Component {
     if (curObj.id === buildingNumList[curNav].id) {
       return
     }
-    Taro.api.house.apiestatelottery2batchinfo({
-      lottery_id: buildingNumList[curNav].id,
+    Taro.api.room.apinewhousepricelist({
+      building_id: buildingNumList[curNav].id,
       estate_id: eId,
     }).then(res => {
       this.setState({
-        curObj: res || {}
+        curObj: buildingNumList[curNav] || {},
+        roomArr: res || []
       })
     })
   }
@@ -128,7 +124,7 @@ class Index extends Component {
     const bg = require('./img/yfyj/bg.jpg')
     return (
       <View className="scoped-header">
-        <View className="scoped-top">
+        {/* <View className="scoped-top">
           <Image src={bg} className="bg"></Image>
           <View className="st-wrap">
             <View className="st-header">
@@ -154,6 +150,17 @@ class Index extends Component {
             </View>
             {this.renderQrcode()}
           </View>
+        </View> */}
+        <View className="scoped-top">
+          <View className="st-wrap">
+            <View className="st-header">
+              <View className="text">
+                <Image src={nameIcon} className="i"></Image>
+                <View className="t">{name}</View>
+              </View>
+              <View className="r" onClick={this.urlDtlLink.bind(this)}>返回楼盘详情</View>
+            </View>
+          </View>
         </View>
         <View className="sh-nav">
           <AtTabs
@@ -179,9 +186,8 @@ class Index extends Component {
   }
   navClick (value) {
     this.setState({
-      curNav: value
+      curNav: value,
     }, () => {
-      this.getDtl()
       this.onceGetInfo()
     })
   }

+ 7 - 6
src/pagesRoom/roomPrice.scss

@@ -9,8 +9,8 @@
   left: 0;
   z-index: 9;
   width: 750px;
-  height: 450px;
-  box-shadow: 0 6px 6px #ccc;
+  height: 190px;
+  box-shadow: 0 6px 6px #eee;
   background: #fff;
   .sh-nav {
     height: 88px;
@@ -18,12 +18,13 @@
 }
 .scoped-top {
   width: 750px;
-  height: 362px;
+  height: 100px;
   position: relative;
+  background-color: #369af7;
   .bg {
     position: absolute;
     width: 750px;
-    height: 362px;
+    height: 100px;
     top: 0;
     left: 0;
     z-index: 1;
@@ -31,7 +32,7 @@
   .st-wrap {
     position: absolute;
     width: 750px;
-    height: 362px;
+    height: 100px;
     top: 0;
     left: 0;
     z-index: 2;
@@ -139,7 +140,7 @@
 
 
 .scoped-room-price {
-  padding-top: 460px;
+  padding-top: 190px;
   .srp-row {
     display: flex;
   }