230320a303 1 year ago
parent
commit
9d8a950564
4 changed files with 110 additions and 11 deletions
  1. 3 0
      src/api/house.js
  2. 3 2
      src/pagesHouse/indexDtl.jsx
  3. 51 9
      src/pagesRoom/roomPriceXk.jsx
  4. 53 0
      src/pagesRoom/roomPriceXk.scss

+ 3 - 0
src/api/house.js

@@ -114,6 +114,9 @@ export default {
   apiestatelotterypriceedit: params => { // 一房一价 编辑
     return request('/api/estate/lottery/price/edit', params)
   },
+  apiestatelotterypricebatch: params => { // 一房一价 批量修改某单元的销控状态
+    return request('/api/estate/lottery/price/batch', params)
+  },
   apiestatelottery2batchinfo: params => { // 一房一价 - 摇号期数详情接口
     return request('/api/estate/lottery2/batch/info', params)
   },

+ 3 - 2
src/pagesHouse/indexDtl.jsx

@@ -852,7 +852,7 @@ class Index extends Component {
     return (
       <View className="scoped-entry-yh">
         {
-          uInfo.is_sale == 1 && curObj.sale_ctrl == 1
+          uInfo.is_sale == 1
           ?
           <Navigator url={`/pagesRoom/roomPriceXk?eId=${curObj.id}&name=${curObj.estate_name}&id=${lotteryObj.id}`} className="sey-wrap">
             <View className="sey-p1">
@@ -922,8 +922,9 @@ class Index extends Component {
               </View> */}
             </View>
           }
+           {/* && curObj.sale_ctrl == 1 */}
           {
-            uInfo.is_sale == 1 && curObj.sale_ctrl == 1
+            uInfo.is_sale == 1
             ?
             <Navigator url={`/pagesRoom/roomPriceXk?eId=${curObj.id}&name=${curObj.estate_name}&id=${lotteryObj.id}`} className="sy-img">
               <Image className="img" src={bg}></Image>

+ 51 - 9
src/pagesRoom/roomPriceXk.jsx

@@ -32,7 +32,7 @@ class Index extends Component {
       curNav: 0,
       roomArr: [],
       curRoomObj: {},
-      houseSaleStateArr: ['未售', '小定', '已定', '已售'],
+      houseSaleStateArr: ['未售', '小定', '已定', '已售', '洪楼售'],
       isDtlShow: false,
       buildingNumList: [],
     }
@@ -252,14 +252,21 @@ class Index extends Component {
                     if (two.house_sale_state === '小定') boxClassStr2 = `'srp-col t2 num'${oneDataLength}`
                     if (two.house_sale_state === '已定') boxClassStr2 = `'srp-col t3 num'${oneDataLength}`
                     if (two.house_sale_state === '已售') boxClassStr2 = `'srp-col t4 num'${oneDataLength}`
+                    if (two.house_sale_state === '洪楼售') boxClassStr2 = `'srp-col t5 num'${oneDataLength}`
                     return (
                       <View className={boxClassStr2} key={tIndex} onClick={this.openDtlPopup.bind(this, two)}>
                         {
-                          two.house_sale_state === '小定' || two.house_sale_state === '已定' || two.house_sale_state === '已售'
+                          two.house_sale_state === '小定' || two.house_sale_state === '已定' || two.house_sale_state === '已售' || two.house_sale_state === '洪楼售'
                           ? 
                           <View className="srp-tag">{two.house_sale_state}</View>
                           : ''
                         }
+                        {
+                          two.toward
+                          ?
+                          <View className="srp-tag2">{two.toward}</View>
+                          : ''
+                        }
                         <View className="srp-room">
                           <View className="srpr-p1">{two.room}
                             <View className="s">{'>>'}</View>
@@ -297,6 +304,7 @@ class Index extends Component {
     if (curRoomObj.house_sale_state === '小定') boxClassStr = `'p2 t2`
     if (curRoomObj.house_sale_state === '已定') boxClassStr = `'p2 t3`
     if (curRoomObj.house_sale_state === '已售') boxClassStr = `'p2 t4`
+    if (curRoomObj.house_sale_state === '洪楼售') boxClassStr = `'p2 t5`
     
     let newTotalPrice = curRoomObj.price
     if (curRoomObj.house_discount) {
@@ -321,14 +329,14 @@ class Index extends Component {
         <View className='lmb-bg'></View>
         <View className='lmb-body'>
           <View className="scoped-dtl">
-            <View className="sd-img">
+            {/* <View className="sd-img">
               <Image src={curRoomObj.house_img + '_xs'} className="img" onClick={this.previewImageHandle.bind(this, curRoomObj.house_img, [curRoomObj.house_img])}/>
               <View className="tips">
                 <View className="bg"></View>
                 <View className="t">查看大图</View>
               </View>
-            </View>
-            <View className="sd-p">
+            </View> */}
+            <View className="sd-p" onClick={this.previewImageHandle.bind(this, curRoomObj.house_img, [curRoomObj.house_img])}>
               <View className="p2">{curRoomObj.house_type}</View>
               <View className="p2">{curRoomObj.building_num}</View>
               <View className="p2">房号:{curRoomObj.room}</View>
@@ -356,13 +364,21 @@ class Index extends Component {
               <View className="p2">折扣:
                 <Input type='text' placeholder='请输入' value={curRoomObj.house_discount} onInput={this.inputCHnage.bind(this, 'house_discount')} />
               </View>
-              <View className="p2">备注
-                <Textarea placeholder='请输入' style='background:#fff;width:100%;min-height:50px;padding:0 30rpx;box-sizing: border-box;text-align: left;color: #666;' value={curRoomObj.house_sale_remark} autoHeight/>
+              <View className="p2">朝向
+                <Input type='text' placeholder='请输入' value={curRoomObj.toward} onInput={this.inputCHnage.bind(this, 'toward')} />
               </View>
               <View className="p2">
                 <View className="s">折后总价:{newTotalPrice || '暂无'}元</View>
                 <View className="s">折后单价:{newOnePrice || '暂无'}元/㎡</View>
               </View>
+              <View className="p">备注:
+                <Textarea placeholder='请输入' style='background:#fff;width:100%;min-height:50px;padding:0 30rpx;box-sizing: border-box;text-align: left;color: #666;' value={curRoomObj.house_sale_remark} autoHeight/>
+              </View>
+              <View className="p3">
+                <View className="t">输入验证码{curRoomObj.id},将本单元全部改为已售</View>
+                <Input type='text' className="i" placeholder='请输入' value={curRoomObj.inputId} onInput={this.inputCHnage.bind(this, 'inputId')} />
+                <View className="b" onClick={this.tagHandle.bind(this)}>本单元全部已售</View>
+              </View>
             </View>
             <View className="l-floor-footer t2">
               <View className="lff-flex">
@@ -375,6 +391,12 @@ class Index extends Component {
       </View>
     )
   }
+  // const { curNav, buildingNumList } = this.state
+  //   const {eId, name, id} = this.$router.params
+  //   Taro.api.house.apiestatelotterypricelist({
+  //     estate_id: eId,
+  //     lottery_id: buildingNumList[curNav].id,
+  //     building_num: buildingNumList[curNav].title,
   inputCHnage (str, e) {
     let { curRoomObj } = this.state
     curRoomObj[str] = e.target.value
@@ -382,7 +404,26 @@ class Index extends Component {
       curRoomObj
     })
   }
-
+  tagHandle () {
+    const { curNav, buildingNumList } = this.state
+    const {eId} = this.$router.params
+    let { curRoomObj } = this.state
+    if (curRoomObj.id == curRoomObj.inputId) {
+      Taro.$msgConfirm(`确定该单元全部改为已售?`, () => {
+        Taro.api.house.apiestatelotterypricebatch({
+          estate_id: eId,
+          house_sale_state: '已售',
+          building_num: buildingNumList[curNav].title
+        }).then(res => {
+          this.getDtl()
+          this.closeRulePopup()
+          Taro.$msg(`更新成功~`)
+        })
+      }, () => {})
+    } else {
+      Taro.$msg(`请输入正确的验证码`)
+    }
+  }
   // const { valStr, bc } = this.props
     // bc(valStr, strTrim())
   onSaleStateChange = e => {
@@ -406,11 +447,12 @@ class Index extends Component {
     })
     if (str === 'edit') {
       let { curRoomObj } = this.state
-      let house_discount = curRoomObj.house_discount.replace(/,|、|\/|\\/g, ',')
+      let house_discount = curRoomObj.house_discount ? curRoomObj.house_discount.replace(/,|、|\/|\\/g, ',') : ''
       Taro.api.house.apiestatelotterypriceedit({
         id: curRoomObj.id,
         house_sale_state: curRoomObj.house_sale_state,
         house_sale_remark: curRoomObj.house_sale_remark || '',
+        toward: curRoomObj.toward || '',
         house_discount,
       }).then(res => {
         this.getDtl()

+ 53 - 0
src/pagesRoom/roomPriceXk.scss

@@ -158,6 +158,14 @@
       color: #fff;
       font-size: 20px;
     }
+    .srp-tag2 {
+      position: absolute;
+      left: 0;
+      bottom: 0;
+      color: #f00;
+      font-size: 20px;
+      font-weight: bold;
+    }
     &.t2 {
       background-color: #ffc107;
       .srpr-p1 {
@@ -169,6 +177,9 @@
       .srpr-p2 {
         color: #fff!important;
       }
+      .srp-tag2 {
+        color: #fff!important;
+      }
     }
     &.t3 {
       background-color: #9e9e9e;
@@ -181,6 +192,9 @@
       .srpr-p2 {
         color: #fff!important;
       }
+      .srp-tag2 {
+        color: #fff!important;
+      }
     }
     &.t4 {
       background-color: #f44336;
@@ -193,6 +207,24 @@
       .srpr-p2 {
         color: #fff!important;
       }
+      .srp-tag2 {
+        color: #fff!important;
+      }
+    }
+    &.t5 {
+      background-color: #369af7;
+      .srpr-p1 {
+        color: #fff!important;
+        .s {
+          color: #fff!important;
+        }
+      }
+      .srpr-p2 {
+        color: #fff!important;
+      }
+      .srp-tag2 {
+        color: #fff!important;
+      }
     }
     &.num2 {
       width: 340px;
@@ -359,6 +391,23 @@
       width: 100%;
       font-size: 24px;
     }
+    .p3 {
+      width: 100%;
+      font-size: 24px;
+      .t {
+        color: #e94141;
+      }
+      .i {
+        height: 80px;
+      }
+      .b {
+        display: inline-block;
+        color: #fff;
+        background-color: #e94141;
+        padding: 16rpx 30rpx;
+        border-radius: 50rpx;
+      }
+    }
     .p2 {
       width: 50%;
       font-size: 24px;
@@ -385,6 +434,10 @@
         color: #f44336;
         font-weight: bold;
       }
+      &.t5 {
+        color: #369af7;
+        font-weight: bold;
+      }
     }
   }
 }