230320a303 10 months ago
parent
commit
784966cba7

+ 6 - 0
src/api/room.js

@@ -105,6 +105,12 @@ export default {
   apinewhousepricelist: params => { // 房源表 一房一价新
     return request('/api/new/house/price/list', params, 'loading')
   },
+  apinewhousepriceedit: params => { // 房源表 销控编辑
+    return request('/api/new/house/price/edit', params, 'loading')
+  },
+  apinewhousepricebatch: params => { // 房源表 销控编辑 批量已售
+    return request('/api/new/house/price/batch', params, 'loading')
+  },
   apibuildingunitlist: params => { // 房源表 单元 列表
     return request('/api/building/unit/list', params, 'loading')
   },

+ 1 - 1
src/pages/index/index.jsx

@@ -993,8 +993,8 @@ class Index extends Component {
                 <View className="w2">{weatherObj.temperature}℃-{weatherObj.direct}({weatherObj.power})</View>
               </View>
             }
-            {/* {this.renderBanner()} */}
           </View>
+            {/* {this.renderBanner()} */}
           {/* {this.renderHouseList()} */}
 
           {/* 

+ 1 - 1
src/pages/index/index.scss

@@ -14,7 +14,7 @@ page {
 }
 
 .index-banner {
-  margin: 120px 20px 0;
+  margin: 20px 20px 0;
   border-radius: 10px;
   overflow: hidden;
   background: #fff;

+ 1 - 1
src/pagesHouse/indexDtl.jsx

@@ -895,7 +895,7 @@ class Index extends Component {
           uInfo.is_sale == 1
           ?
           <View className={'scoped-entry-yh'}>
-            <Navigator url={`/pagesRoom/roomPrice2?eId=${curObj.id}&name=${curObj.estate_name}`} className="sey-wrap">
+            <Navigator url={`/pagesRoom/roomPriceXk?eId=${curObj.id}&name=${curObj.estate_name}`} className="sey-wrap">
               <View className="sey-img">
                 <Image className="img" src={bg}></Image>
               </View>

+ 3 - 2
src/pagesRoom/roomPrice.scss

@@ -145,7 +145,7 @@
     display: flex;
   }
   .srp-col {
-    width: 170px;
+    flex: 1;
     background: #fff8eb;
     border-bottom: 1PX solid #fff;
     border-right: 1PX solid #fff;
@@ -161,7 +161,8 @@
       width: 680px;
     }
     &:nth-child(1) {
-      width: 70px;
+      width: 70px!important;
+      flex: none;
       background: #eceff6;
       box-sizing: border-box;
       padding: 70px 20px 0;

+ 15 - 1
src/pagesRoom/roomPrice2.jsx

@@ -230,10 +230,20 @@ class Index extends Component {
                         curTwo = {...r}
                       }
                     })
-                    if (curTwo.final_price) boxClassStr2 = `'srp-col t4 num'${oneDataLength}`
+                    if (curTwo.price && curTwo.final_price == 0 && curTwo.listing_price == 0) {
+                      boxClassStr2 = `'srp-col t3 num'${oneDataLength}`
+                    } else {
+                      if (curTwo.final_price) {
+                        boxClassStr2 = `'srp-col t4 num'${oneDataLength}`
+                      }
+                    }
                     return (
                       <View className={boxClassStr2} key={tIndex} onClick={this.openDtlPopup.bind(this, curTwo, cArr, oIndex, tIndex)}>
                         {
+                          curTwo.price && curTwo.final_price == 0 && curTwo.listing_price == 0
+                          ? 
+                          <View className="srp-tag">一房一价</View>
+                          :
                           curTwo.final_price
                           ? 
                           <View className="srp-tag">已售</View>
@@ -253,6 +263,10 @@ class Index extends Component {
                             <View>
                               <View className="srpr-p2">面积:{curTwo.built}㎡</View>
                               {
+                                curTwo.price && curTwo.final_price == 0 && curTwo.listing_price == 0
+                                ?
+                                <View className="srpr-p2">{curTwo.price}元<View>¥{(curTwo.price / curTwo.built).toFixed(2) }/㎡</View></View>
+                                : 
                                 curTwo.final_price
                                 ? <View className="srpr-p2">成交:{curTwo.final_price}万<View>¥{(curTwo.final_price * 10000 / curTwo.built).toFixed(2) }/㎡</View></View>
                                 : <View className="srpr-p2">挂牌:{curTwo.listing_price}万<View>¥{(curTwo.listing_price * 10000 / curTwo.built).toFixed(2) }/㎡</View></View>

+ 3 - 2
src/pagesRoom/roomPrice2.scss

@@ -162,7 +162,7 @@
     display: flex;
   }
   .srp-col {
-    width: 170px;
+    flex: 1;
     background: #fff8eb;
     border-bottom: 1PX solid #fff;
     border-right: 1PX solid #fff;
@@ -254,7 +254,8 @@
       width: 680px;
     }
     &:nth-child(1) {
-      width: 70px;
+      width: 70px!important;
+      flex: none;
       background: #eceff6;
       box-sizing: border-box;
       padding: 70px 20px 0;

+ 22 - 59
src/pagesRoom/roomPriceXk.jsx

@@ -53,25 +53,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()
       })
@@ -81,14 +77,12 @@ class Index extends Component {
   getDtl = () => {
     const { curNav, buildingNumList } = this.state
     const {eId, name, id} = this.$router.params
-    Taro.api.house.apiestatelotterypricelist2({
+    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({
-        allData: res || {},
-        roomArr: res.data || []
+        roomArr: res || []
       })
       if (this.subChat) {
         this.subChat.getData({name, id: eId}, 'pt')
@@ -101,12 +95,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 || []
       })
     })
   }
@@ -120,25 +115,12 @@ class Index extends Component {
   componentDidHide () { }
 
   renderTop () {
-    const {eId, id, name} = this.$router.params
-    const curParams = `eId=${eId}&id=${id}&name=${name}`
-    const { allData, curObj, curNav, buildingNumList } = 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 { name} = this.$router.params
+    const { curNav, buildingNumList } = this.state
     const nameIcon = require('./img/yfyj/yfyj04.png')
-    const i1 = require('./img/yfyj/yfyj05.png')
-    const i2 = require('./img/yfyj/yfyj06.png')
-    const op1 = require('./img/yfyj/yfyj_icon1.png')
-    const op2 = require('./img/yfyj/yfyj_icon2.png')
-    const op3 = require('./img/yfyj/yfyj_icon3.png')
-    const op4 = require('./img/yfyj/yfyj_icon4.png')
-    const bg = require('./img/yfyj/bg.jpg')
     return (
       <View className="scoped-header">
         <View className="scoped-top">
-          <Image src={bg} className="bg"></Image>
           <View className="st-wrap">
             <View className="st-header">
               <View className="text">
@@ -147,28 +129,13 @@ class Index extends Component {
               </View>
               <View className="r" onClick={this.urlDtlLink.bind(this)}>返回楼盘详情</View>
             </View>
-            <View className="st-p1">
-              <Image className="i" src={i1}></Image>
-              <View className="t">{curObj.under_way}</View>
-            </View>
-            <View className="st-p1">
-              <Image className="i" src={i2}></Image>
-              <View className="t2">{curObj.lottery_time}</View>
-            </View>
-            <View className="st-p2">
-              <Image src={op1} className="op1" onClick={this.urlLink.bind(this, '/pagesRoom/roomPriceList', curParams)}></Image>
-              <Image src={op2} className="op2" onClick={this.urlLink.bind(this, '/pagesRoom/roomPriceImg', curParams)}></Image>
-              <Image src={op3} className="op3" onClick={this.previewImageHandle.bind(this, curObj.project_img, [curObj.project_img])}></Image>
-              <Image src={op4} className="op4" onClick={this.previewQrcodeImageHandle.bind(this, 'http://icon.honglounews.com/ncfxw2.jpg', ['http://icon.honglounews.com/ncfxw2.jpg'])}></Image>
-            </View>
-            {this.renderQrcode()}
           </View>
         </View>
         <View className="sh-nav">
           <AtTabs
             current={curNav}
             scroll
-            tabList={newTabList}
+            tabList={buildingNumList}
             onClick={this.navClick.bind(this)}>
           </AtTabs>
         </View>
@@ -213,16 +180,13 @@ class Index extends Component {
   }
 
   renderInfo () {
-    const { roomArr, allData } = this.state
-    const house_type_total = allData.house_type_total || {}
-    const htaArr = house_type_total.house_type_avg || []
+    const { roomArr } = this.state
     let cArr = roomArr || []
     const htArr = cArr[0] ? cArr[0].data : []
     const htArrIndex = htArr.length
     const htitems = htArr.map((item, index) => {
-      let boxClassStr = `'srp-col num'${htArrIndex}`
       return (
-        <View className={boxClassStr} key={index}>
+        <View className={'srp-col num' + htArrIndex} key={index}>
           <View className="srp-ht">
             <View className="srp-img">
               <Image src={item.house_img + '_xs'} className="img" onClick={this.previewImageHandle.bind(this, item.house_img, [item.house_img])}/>
@@ -233,7 +197,6 @@ 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%'
               ? ''
@@ -420,10 +383,10 @@ class Index extends Component {
     let { curRoomObj } = this.state
     if (curRoomObj.id == curRoomObj.inputId) {
       Taro.$msgConfirm(`确定该单元全部改为已售?`, () => {
-        Taro.api.house.apiestatelotterypricebatch({
+        Taro.api.room.apinewhousepricebatch({
           estate_id: eId,
           house_sale_state: '已售',
-          building_num: buildingNumList[curNav].title
+          building_id: buildingNumList[curNav].id
         }).then(res => {
           this.getDtl()
           this.closeRulePopup()
@@ -458,7 +421,7 @@ class Index extends Component {
     if (str === 'edit') {
       let { curRoomObj } = this.state
       let house_discount = curRoomObj.house_discount ? curRoomObj.house_discount.replace(/,|、|\/|\\/g, ',') : ''
-      Taro.api.house.apiestatelotterypriceedit({
+      Taro.api.room.apinewhousepriceedit({
         id: curRoomObj.id,
         house_sale_state: curRoomObj.house_sale_state,
         house_sale_remark: curRoomObj.house_sale_remark || '',

+ 9 - 7
src/pagesRoom/roomPriceXk.scss

@@ -9,7 +9,7 @@
   left: 0;
   z-index: 9;
   width: 750px;
-  height: 450px;
+  height: 190px;
   box-shadow: 0 6px 6px #ccc;
   background: #fff;
   .sh-nav {
@@ -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,12 +140,12 @@
 
 
 .scoped-room-price {
-  padding-top: 460px;
+  padding-top: 190px;
   .srp-row {
     display: flex;
   }
   .srp-col {
-    width: 170px;
+    flex: 1;
     background: #fff8eb;
     border-bottom: 1PX solid #fff;
     border-right: 1PX solid #fff;
@@ -236,7 +237,8 @@
       width: 680px;
     }
     &:nth-child(1) {
-      width: 70px;
+      width: 70px!important;
+      flex: none;
       background: #eceff6;
       box-sizing: border-box;
       padding: 70px 20px 0;