230320a303 7 months ago
parent
commit
4686848531

+ 1 - 1
.vscode/settings.json

@@ -1,3 +1,3 @@
 {
-    "stockCode": "sh560980,sz159819,sz300803,sz300450,sz300919"
+    "stockCode": "sz159819,sh560980,sz159967"
 }

BIN
src/assets/img/icon_g_lock.png


+ 1 - 1
src/components/footer/index.js

@@ -147,7 +147,7 @@ export default class Footer extends Component {
     
     const edClick = Taro.getStorageSync('APP_edClick')
     const currentTime = Date.now()
-    const twentyFourHoursAgo = currentTime - (60 * 60 * 1000)
+    const twentyFourHoursAgo = currentTime - (2 * 60 * 1000)
     if (edClick) {
       if (edClick <= twentyFourHoursAgo) {
         Taro.removeStorageSync('APP_edClick')

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

@@ -934,7 +934,7 @@ class Index extends Component {
   testClick () {
     const edClick = Taro.getStorageSync('APP_edClick')
     const currentTime = Date.now()
-    const twentyFourHoursAgo = currentTime - (60 * 60 * 1000)
+    const twentyFourHoursAgo = currentTime - (2 * 60 * 1000)
     if (edClick) {
       if (edClick <= twentyFourHoursAgo) {
         Taro.removeStorageSync('APP_edClick')

+ 66 - 7
src/pagesHouse/price.jsx

@@ -33,6 +33,7 @@ class Index extends Component {
       isListLoading: false,
       isListEmpty: false,
       dataList: [],
+      isLock: true,
     }
   }
 
@@ -46,23 +47,45 @@ class Index extends Component {
     Taro.setNavigationBarTitle({
       title: `${name}的历史成交价`
     })
-    this.getDataList(() => {
-      if (this.subChat) this.subChat.getData({name, id}, 'pt')
-    })
+    
   }
 
   refChat = (ref) => {
     this.subChat = ref
   }
 
-  componentDidShow () { }
+  componentDidShow () { 
+    let isLock = true
+    const edClick = Taro.getStorageSync('APP_edChat')
+    const currentTime = Date.now()
+    const sixHoursAgo = currentTime - (6 * 60 * 1000)
+    if (edClick) {
+      if (edClick <= sixHoursAgo) { // 超过时间,锁定
+        isLock = true
+        Taro.removeStorageSync('APP_edClick')
+      } else {
+        isLock = false
+      }
+    } else { // 锁定
+      isLock = true
+    }
+    this.setState({
+      isLock,
+    }, () => {
+      const {id, name } = this.$router.params
+      this.getDataList(() => {
+        if (this.subChat) this.subChat.getData({name, id}, 'pt')
+      })
+    })
+    
+  }
 
   componentDidHide () { }
 
 
   getDataList (bc) {
     const {id: estate_id} = this.$router.params
-    let { page_size, page, dataList, isListEmpty } = this.state
+    let { page_size, page, dataList, isListEmpty, isLock } = this.state
     Taro.api.house.apiestatepricelist({
       page,
       page_size,
@@ -73,7 +96,8 @@ class Index extends Component {
       let isListEnd = false
       if (curData.length > 0) {
         if (page === 1) {
-          dataList = curData
+          // dataList = curData
+          dataList = isLock ? curData.splice(3) : curData
           lineData = JSON.parse(JSON.stringify(curData))
         } else {
           dataList = dataList.concat(curData)
@@ -116,7 +140,8 @@ class Index extends Component {
   }
 
   renderList () {
-    const { dataList, isListEnd, isListLoading, isListEmpty } = this.state
+    const iconLock = require('@img/icon_g_lock.png')
+    const { dataList, isListEnd, isListLoading, isListEmpty, isLock } = this.state
     const {id, name} = this.$router.params
     const itemsList = dataList.map((item, index) => {
       const FH = Number(item.cur_layer) || 1
@@ -170,6 +195,33 @@ class Index extends Component {
         <View className="scoped-list">
           <Navigator url={`/pagesHouse/priceChart?id=${id}&name=${name}`} className="sl-top-tips">查看图表分析{'>>'}</Navigator>
           <AtNoticebar icon='volume-plus'>查询结果仅供参考</AtNoticebar>
+          {
+            isLock
+            ? 
+            <View className="sl-item dis">
+              <View className="slid-tips" onClick={this.unlockHandle.bind(this)}>
+                <Image className="icon" src={iconLock}></Image>
+                <View className="t">最新成交价,点击咨询解锁</View>
+              </View>
+              <View className="slid-main">
+                <View className="sl-p1">**/**层<View className="s">******</View></View>
+                <View className="sl-p2">
+                  <View className="op">
+                    <View className="k">总面积</View>
+                    <View className="v">*****㎡</View>
+                  </View>
+                  <View className="op t2">
+                    <View className="k">单价</View>
+                    <View className="v">******元/㎡</View>
+                  </View>
+                </View>
+                <View className="sl-p3">签约中介:**********</View>
+                <View className="sl-p3">签约日期:**********</View>
+                <View className="sl-r1"><View className="n">***</View>万</View>
+              </View>
+            </View>
+            : ''
+          }
           {itemsList}
         </View>
         <ListMore isListEnd={isListEnd} isListLoading={isListLoading} isListEmpty={isListEmpty} />
@@ -179,6 +231,13 @@ class Index extends Component {
   }
 
 
+  unlockHandle () {
+    const currentTime = Date.now()
+    Taro.setStorageSync('APP_edChat', currentTime)
+    this.subChat.countHandle('chat')
+  }
+
+
   renderTop () {
     const { name } = this.$router.params
     const bg = require('./img/bg_house.jpg')

+ 29 - 0
src/pagesHouse/price.scss

@@ -28,6 +28,35 @@ page {
     @include itemBox(20px);
     background: #fff;
     position: relative;
+    &.dis {
+      .slid-main {
+        background: #f2f2f2;
+        opacity: .2;
+      }
+      .slid-tips {
+        position: absolute;
+        top: 0;
+        left: 0;
+        width: 100%;
+        height: 100%;
+        text-align: center;
+        line-height: 200px;
+        color: #DE8C17;
+        font-size: 30px;
+        z-index: 2;
+        font-weight: bold;
+        .icon {
+          display: inline-block;
+          vertical-align: middle;
+          width: 32px;
+          height: 32px;
+        }
+        .t {
+          display: inline-block;
+          vertical-align: middle;
+        }
+      }
+    }
   }
   .sl-p1 {
     font-size: 30px;