230320a303 10 月之前
父節點
當前提交
77f87798bd
共有 4 個文件被更改,包括 60 次插入21 次删除
  1. 1 1
      .vscode/settings.json
  2. 3 0
      src/api/room.js
  3. 35 20
      src/pagesMore/center/uploadRoom2.jsx
  4. 21 0
      src/pagesMore/center/uploadRoom2.scss

+ 1 - 1
.vscode/settings.json

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

+ 3 - 0
src/api/room.js

@@ -90,6 +90,9 @@ export default {
   apieshousecheck: params => { // 二手房 房源 检测唯一
     return request('/api/eshouse/check', params, 'loading')
   },
+  apieshouseprice: params => { // 二手房 房源 修改价格
+    return request('/api/eshouse/price', params, 'loading')
+  },
   apirenthouselist: params => { // 二手房 出租 列表
     return request('/api/rent/house/list', params, 'loading')
   },

+ 35 - 20
src/pagesMore/center/uploadRoom2.jsx

@@ -76,8 +76,6 @@ class Index extends Component {
           this.getPtData(cObj.estate_id)
         }
         setTimeout(() => {
-          console.log(`${cObj.product_type}--${cObj.house_type.replace(/-/g, '')}--${cObj.area}--${cObj.house_img}`)
-          console.log(cObj.hide_album)
           this.setState({
             dtlObj: cObj,
             formObj: {
@@ -288,9 +286,13 @@ class Index extends Component {
     })
   }
   ptChange (key, val, arr) {
+    let { formObj } = this.state
+    if (formObj.id) {
+      Taro.$msg('已有房源,不能修改产品规格')
+      return
+    }
     const ptArr = val.split('--')
     const htSub = ptArr[1].split('')
-    let { formObj } = this.state
     formObj.product_type = ptArr[0]
     formObj.area = ptArr[2]
     formObj.house_img = ptArr[3]
@@ -505,14 +507,14 @@ class Index extends Component {
 
 
   renderAddr () {
-    const { addr1, addr2, addr3 } = this.state
+    const { addr1, addr2, addr3, formObj } = this.state
     return (
-      <View className="scoped-addr-box">
-        <Input type="number" value={addr1} onInput={this.changeAddrInput.bind(this, 'addr1')}  className="i" placeholder="__" />
+      <View className={formObj.id ? 'scoped-addr-box dis' : 'scoped-addr-box'}>
+        <Input type="number" disabled={formObj.id} value={addr1} onInput={this.changeAddrInput.bind(this, 'addr1')}  className="i" placeholder="__" />
         <View className='t'>栋座</View>
-        <Input type="number" value={addr2} onInput={this.changeAddrInput.bind(this, 'addr2')}  className="i" placeholder="__" />
+        <Input type="number" disabled={formObj.id} value={addr2} onInput={this.changeAddrInput.bind(this, 'addr2')}  className="i" placeholder="__" />
         <View className='t'>单元</View>
-        <Input type="number" value={addr3} onInput={this.changeAddrInput.bind(this, 'addr3')}  className="i" placeholder="__" />
+        <Input type="number" disabled={formObj.id} value={addr3} onInput={this.changeAddrInput.bind(this, 'addr3')}  className="i" placeholder="__" />
         <View className='t'>室号</View>
       </View>
     )
@@ -542,14 +544,14 @@ class Index extends Component {
     )
   }
   renderHouseType () {
-    const { hType1, hType2, hType3 } = this.state
+    const { hType1, hType2, hType3, formObj } = this.state
     return (
-      <View className="scoped-addr-box">
-        <Input type="number" value={hType1} onInput={this.changeAddrInput.bind(this, 'hType1')}  className="i" placeholder="__" />
+      <View className={formObj.id ? 'scoped-addr-box dis' : 'scoped-addr-box'}>
+        <Input type="number" value={hType1} disabled={formObj.id} onInput={this.changeAddrInput.bind(this, 'hType1')}  className="i" placeholder="__" />
         <View className='t'>室</View>
-        <Input type="number" value={hType2} onInput={this.changeAddrInput.bind(this, 'hType2')}  className="i" placeholder="__" />
+        <Input type="number" value={hType2} disabled={formObj.id} onInput={this.changeAddrInput.bind(this, 'hType2')}  className="i" placeholder="__" />
         <View className='t'>厅</View>
-        <Input type="number" value={hType3} onInput={this.changeAddrInput.bind(this, 'hType3')}  className="i" placeholder="__" />
+        <Input type="number" value={hType3} disabled={formObj.id} onInput={this.changeAddrInput.bind(this, 'hType3')}  className="i" placeholder="__" />
         <View className='t'>卫</View>
       </View>
     )
@@ -562,12 +564,12 @@ class Index extends Component {
   
 
   renderStairsRate () {
-    const { sRate1, sRate2 } = this.state
+    const { sRate1, sRate2, formObj } = this.state
     return (
-      <View className='scoped-floor-height-box'>
-        <Input type="number" value={sRate1} onInput={this.changeAddrInput.bind(this, 'sRate1')}  className="i" placeholder="__" />
+      <View className={formObj.id ? 'scoped-floor-height-box dis' : 'scoped-floor-height-box'}>
+        <Input type="number" disabled={formObj.id} value={sRate1} onInput={this.changeAddrInput.bind(this, 'sRate1')}  className="i" placeholder="__" />
         <View className='t'>梯</View>
-        <Input type="number" value={sRate2} onInput={this.changeAddrInput.bind(this, 'sRate2')}  className="i" placeholder="__" />
+        <Input type="number" disabled={formObj.id} value={sRate2} onInput={this.changeAddrInput.bind(this, 'sRate2')}  className="i" placeholder="__" />
         <View className='t'>户</View>
       </View>
     )
@@ -575,10 +577,10 @@ class Index extends Component {
   renderFloorHeight () {
     const { formObj } = this.state
     return (
-      <View className='scoped-floor-height-box'>
-        <Input type="number" value={formObj.floor} onInput={this.changeFormObjInput.bind(this, 'floor')}  className="i" placeholder="所在楼层" />
+      <View className={formObj.id ? 'scoped-floor-height-box dis' : 'scoped-floor-height-box'}>
+        <Input type="number" disabled={formObj.id} value={formObj.floor} onInput={this.changeFormObjInput.bind(this, 'floor')}  className="i" placeholder="所在楼层" />
         <View className='t'>/</View>
-        <Input type="number" value={formObj.storeys} onInput={this.changeFormObjInput.bind(this, 'storeys')}  className="i" placeholder="总楼层" />
+        <Input type="number" disabled={formObj.id} value={formObj.storeys} onInput={this.changeFormObjInput.bind(this, 'storeys')}  className="i" placeholder="总楼层" />
         <View className='t'>层</View>
       </View>
     )
@@ -667,6 +669,18 @@ class Index extends Component {
     })
   }
 
+  showPriceEdit () {
+    const { formObj } = this.state
+    Taro.$msgConfirm(`确定修改成${formObj.price}万元的对外展示总价吗`, () => {
+      Taro.api.room.apieshouseprice({
+        id: formObj.id,
+        price: formObj.price,
+      }).then(res => {
+        Taro.$msg(res.errmsg)
+      })
+    })
+  }
+
 
   render () {
     const {id} = this.$router.params
@@ -824,6 +838,7 @@ class Index extends Component {
             inputFont="万"
             bc={this.baseFormChange.bind(this)}
           />
+          <View className="scoped-edit-btn" onClick={this.showPriceEdit.bind(this)}>修改展示的总价</View>
         </View>
         <View className="l-floor-pos2">
           <LFormGroup

+ 21 - 0
src/pagesMore/center/uploadRoom2.scss

@@ -62,6 +62,10 @@
   background: #fff;
   display: flex;
   height: 90px;
+  &.dis {
+    background-color: #f2f2f2;
+    border-radius: 10px;
+  }
   // border-bottom: 1PX solid #f2f2f2;
   .i {
     flex: 3;
@@ -89,6 +93,10 @@
   display: flex;
   height: 90px;
   z-index: 2;
+  &.dis {
+    background-color: #f2f2f2;
+    border-radius: 10px;
+  }
   .i {
     flex: 2;
     font-size: 28px;
@@ -163,4 +171,17 @@
   color: #f00;
   font-weight: bold;
   font-size: 24rpx;
+}
+
+
+.scoped-edit-btn {
+  position: absolute;
+  z-index: 999;
+  bottom: -10px;
+  right: 20px;
+  font-size: 24rpx;
+  background-color: #369af7;
+  color: #fff;
+  padding: 5px 20px;
+  border-radius: 6px;
 }