liujq 2 年之前
父节点
当前提交
951b5ee92d
共有 2 个文件被更改,包括 27 次插入0 次删除
  1. 22 0
      src/pagesHouse/indexDtl.jsx
  2. 5 0
      src/pagesHouse/indexDtl.scss

+ 22 - 0
src/pagesHouse/indexDtl.jsx

@@ -256,6 +256,22 @@ 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 iconPos = require('@img/i_g_pos.png')
     const iconHeart = require('@img/i_g_heart.png')
     const iconHeartGif = require('@img/i_g_warn.gif')
@@ -271,6 +287,12 @@ class Index extends Component {
         <View className="di-title">{curObj.estate_name}</View>
         <View className="di-sign">
           <View className="l">¥{curObj.price_range || 'loading'}/㎡</View>
+          {
+            tagDefine1
+            ?
+            <View className="s c2">{tagDefine1}</View>
+            : ''
+          }
           {
             curObj.estate_tag === '售罄'
             ? <View className="s t4">{curObj.estate_tag}</View>

+ 5 - 0
src/pagesHouse/indexDtl.scss

@@ -125,6 +125,11 @@ page {
       margin-right: 4px;
       border-radius: 10px;
       padding: 2px 4px;
+      &.c2 {
+        background: #2d8cf0;
+        color: #fff;
+        padding: 2px 8px;
+      }
       &.t2 {
         color: #2d8cf0;
         background: #e6f1fe;