liujq 2 роки тому
батько
коміт
2f613cf317

BIN
src/pagesHouse/components/indexDtl/header/img/bg_ed1.png


BIN
src/pagesHouse/components/indexDtl/header/img/bg_ed2.png


+ 12 - 0
src/pagesHouse/components/indexDtl/header/index.jsx

@@ -101,6 +101,8 @@ export default class List extends Component {
     const { curObj, navVal } = this.state
     const iconPk = require('./img/PK.png')
     const iconShare = require('./img/share.png')
+    const ed1 = require('./img/bg_ed1.png')
+    const ed2 = require('./img/bg_ed2.png')
     const hpI1 = require('@img/icon_hp_1.png')
     const vrhx = require('@img/icon_vr.png')
     const hpI2 = require('@img/icon_hp_2.gif')
@@ -119,6 +121,16 @@ export default class List extends Component {
           </View>
           : ''
         }
+        {
+          curObj.tagDefine1 === '现房'
+          ? <Image src={ed1} className="bg-t-r" />
+          : ''
+        }
+        {
+          curObj.tagDefine1 === '准现房'
+          ? <Image src={ed2} className="bg-t-r" />
+          : ''
+        }
         {
           curObj.custom_tag && curObj.custom_tag.indexOf('户型VR') > -1
           ? 

+ 8 - 0
src/pagesHouse/components/indexDtl/header/index.scss

@@ -2,6 +2,14 @@
 .scoped-header {
   position: relative;
   height: 500px;
+  .bg-t-r {
+    position: absolute;
+    top: 0;
+    right: 0;
+    width: 133px;
+    height: 110px;
+    z-index: 999999;
+  }
   .view-num {
     position: absolute;
     bottom: 20px;

+ 20 - 19
src/pagesHouse/indexDtl.jsx

@@ -149,6 +149,23 @@ class Index extends Component {
       let curObj = res || {}
       curObj.longitude = Number(curObj.longitude)
       curObj.latitude = Number(curObj.latitude)
+      const deliverTime = curObj.deliver_time
+      let tagDefine1 = ''
+      if (deliverTime && curObj.estate_tag !== '二手') {
+        const d = new Date()
+        const year = d.getFullYear()
+        const month = d.getMonth() + 1
+        const curDS = +new Date(`${year}-${month > 9 ? month : '0'+month}`)
+        const estateDS = +new Date(deliverTime)
+        if (curDS >= estateDS) {
+          tagDefine1 = '现房'
+        } else {
+          if ( curDS+(30 * 24 * 60 * 60 * 1000 * 6.5) > estateDS ) {
+            tagDefine1 = '准现房'
+          }
+        }
+      }
+      curObj.tagDefine1 = tagDefine1
       this.setState({
         curObj
       }, () => {
@@ -255,23 +272,7 @@ class Index extends Component {
 
 
   renderInfo () {
-    const { curId, curObj, token } = this.state
-    const deliverTime = curObj.deliver_time
-    let tagDefine1 = ''
-    if (deliverTime && curObj.estate_tag !== '二手') {
-      const d = new Date()
-      const year = d.getFullYear()
-      const month = d.getMonth() + 1
-      const curDS = +new Date(`${year}-${month > 9 ? month : '0'+month}`)
-      const estateDS = +new Date(deliverTime)
-      if (curDS >= estateDS) {
-        tagDefine1 = '现房'
-      } else {
-        if ( curDS+(30 * 24 * 60 * 60 * 1000 * 6.5) > estateDS ) {
-          tagDefine1 = '准现房'
-        }
-      }
-    }
+    const { curId, curObj } = this.state
     const iconPos = require('@img/i_g_pos.png')
     const iconHeart = require('@img/i_g_heart.png')
     const iconHeartGif = require('@img/i_g_warn.gif')
@@ -288,9 +289,9 @@ class Index extends Component {
         <View className="di-sign">
           <View className="l">¥{curObj.price_range || 'loading'}/㎡</View>
           {
-            tagDefine1
+            curObj.tagDefine1
             ?
-            <View className="s c2">{tagDefine1}</View>
+            <View className="s c2">{curObj.tagDefine1}</View>
             : ''
           }
           {