230320a303 1 年之前
父節點
當前提交
218aad747a

+ 3 - 0
src/api/house.js

@@ -129,4 +129,7 @@ export default {
   apiestatecooperatelist: params => { // 楼盘渠道列表接口
     return request('/api/estate/cooperate/list', params)
   },
+  apiestatevrhistorylist: params => { // 楼盘 航拍 vr 历史记录
+    return request('/api/estate/vr/history/list', params)
+  },
 }

+ 1 - 0
src/app.jsx

@@ -47,6 +47,7 @@ class App extends Component {
           // 'indexDtlMap',
           'produceType',
           'vr',
+          'vrList',
           'photo',
           'photoin',
           'news',

+ 1 - 1
src/pagesHouse/components/indexDtl/header/index.jsx

@@ -146,7 +146,7 @@ export default class List extends Component {
         {
           navVal === 'hp'
           ?
-          <Navigator url={`/pagesHouse/vr?id=${curObj.vr_key}&estateName=${curObj.estate_name}`} className="sh-img">
+          <Navigator url={`/pagesHouse/vrList?eid=${curObj.id}&id=${curObj.vr_key}&estateName=${curObj.estate_name}`} className="sh-img">
             <View className="icon">
               <Image src={hpI1} className="i i1" />
               <Image src={hpI2} className="i i2" />

+ 115 - 0
src/pagesHouse/vrList.jsx

@@ -0,0 +1,115 @@
+import Taro, { Component } from '@tarojs/taro'
+import { View } from '@tarojs/components'
+import { comGetTime } from '@utils'
+import ListMore from '@/c/pageDataList/listMore'
+
+import './vrList.scss'
+
+class Index extends Component {
+  onShareAppMessage() {
+    const { id, estateName, eid } = this.$router.params
+    return {
+      title: `来看看${estateName}的航拍历史`,
+      path: `/pagesHouse/vrList?eid=${eid}&id=${id}&estateName=${estateName}`
+    }
+  }
+  onShareTimeline () {
+    const { id, estateName, eid } = this.$router.params
+    return {
+      title: `来看看${estateName}的航拍历史`,
+      path: `/pagesHouse/vrList?eid=${eid}&id=${id}&estateName=${estateName}`
+    }
+  }
+
+  constructor (props) {
+    super(props)
+    const {eid: curId} = this.$router.params
+    this.state = {
+      curId,
+      dataList: [],
+    }
+  }
+
+  config = {
+    navigationBarTitleText: '航拍历史记录',
+  }
+
+  componentWillMount () {
+    Taro.$AHU(this)
+    this.getDtl()
+    const { estateName } = this.$router.params
+    Taro.setNavigationBarTitle({
+      title: `${estateName}的航拍历史`
+    })
+  }
+
+  getDtl () {
+    const { curId } = this.state
+    Taro.api.house.apiestatevrhistorylist({estate_id: curId}).then(res => {
+      let list = res.list || []
+      this.setState({
+        dataList: list
+      })
+    })
+  }
+
+  componentDidShow () { }
+
+  componentDidHide () { }
+
+  renderList () {
+    const { dataList } = this.state
+    const itemsList = dataList.map((item, index) => {
+      const cDateStr = comGetTime(new Date(Number(item.vr_key)))
+      return (
+        <View className="sl-item">
+          <View className="left">
+            <View className="line"></View>
+            <View className="dot"></View>
+          </View>
+          <View className="right" onClick={this.linkVrDtl.bind(this, item)}>
+            <View className="p1">航拍时间:{cDateStr}</View>
+            <Image src={item.vr_image} className="img"/>
+          </View>
+        </View>
+      )
+    })
+    return (
+      <View className="scoped-list">
+        {itemsList}
+      </View>
+    )
+  }
+  linkVrDtl (item) {
+    const { id, estateName, eid } = this.$router.params
+    Taro.navigateTo({
+      url: `/pagesHouse/vr?eid=${eid}&id=${id}&estateName=${estateName}`
+    })
+  }
+
+  renderShare () {
+    const iconShare = require('@img/images/icon_g_share6.png')
+    return (
+      <Button className="g-icon-share btn-to-div" openType="share">
+        <Image className="img" src={iconShare} />
+      </Button>
+    )
+  }
+
+  render () {
+    const { dataList  } = this.state
+    return (
+      <View className="l-box">
+        {this.renderList()}
+        {this.renderShare()}
+        {
+          dataList.length === 0
+          &&
+          <ListMore isOther={true} text="VR在路上"/>
+        }
+      </View>
+    )
+  }
+}
+
+export default Index

+ 61 - 0
src/pagesHouse/vrList.scss

@@ -0,0 +1,61 @@
+@import '@css/mixin.scss';
+.scoped-list {
+    padding: 30px 20px;
+    .sl-item {
+        display: flex;
+        min-height: 300px;
+        &:first-child {
+            .dot {
+                background: $mainColor2!important;
+            }
+        }
+        &:last-child {
+            .line {
+                height: 100px!important;
+            }
+            .right {
+                border-bottom: none;
+            }
+        }
+        .left {
+            width: 100px;
+            text-align: center;
+            position: relative;
+            .line {
+                position: absolute;
+                left: 50%;
+                margin-left: -2px;
+                height: 100%;
+                width: 4px;
+                background-color: $mainColor;
+            }
+            .dot {
+                position: absolute;
+                left: 50%;
+                margin-left: -10px;
+                top: 100px;
+                width: 20px;
+                height: 20px;
+                border-radius: 50%;
+                background-color: $mainColor;
+            }
+        }
+        .right {
+            flex: 1;
+            border-bottom: 1PX solid #f2f2f2;
+            margin-bottom: 30px;
+            padding-bottom: 20px;
+            .p1 {
+                color: #333;
+                padding-bottom: 20px;
+                font-weight: bold;
+                font-size: 28px;
+            }
+            .img {
+                width: 300px;
+                height: 200px;
+                border-radius: 6px;
+            }
+        }
+    }
+}

+ 32 - 6
src/pagesRoom/dtl.jsx

@@ -8,17 +8,33 @@ import './dtl.scss'
 
 class Index extends Component {
   onShareAppMessage() {
+    const userInfo = Taro.getStorageSync('APP_userInfo') || {}
     const { curId, curObj } = this.state
-    return {
-      title: `${curObj.title}`,
-      path: `/pagesRoom/dtl?id=${curId}`,
+    if (userInfo.is_sale == 1) {
+      return {
+        title: `${userInfo.nickname}给您推荐:${curObj.title}`,
+        path: `/pagesRoom/dtl?id=${curId}&referrer=${userInfo.user_id}`,
+      }
+    } else {
+      return {
+        title: `${curObj.title}`,
+        path: `/pagesRoom/dtl?id=${curId}`,
+      }
     }
   }
   onShareTimeline () {
+    const userInfo = Taro.getStorageSync('APP_userInfo') || {}
     const { curId, curObj } = this.state
-    return {
-      title: `${curObj.title}`,
-      path: `/pagesRoom/dtl?id=${curId}`,
+    if (userInfo.is_sale == 1) {
+      return {
+        title: `${userInfo.nickname}给您推荐:${curObj.title}`,
+        path: `/pagesRoom/dtl?id=${curId}&referrer=${userInfo.user_id}`,
+      }
+    } else {
+      return {
+        title: `${curObj.title}`,
+        path: `/pagesRoom/dtl?id=${curId}`,
+      }
     }
   }
 
@@ -26,6 +42,7 @@ class Index extends Component {
     super(props)
     const {id: curId} = this.$router.params
     this.state = {
+      referrer: '',
       saleUserObj: {},
       curId,
       curObj: {},
@@ -41,6 +58,15 @@ class Index extends Component {
   componentWillMount () {
     Taro.$AHU(this)
     this.getDtl()
+    Taro.removeStorageSync('APP_MY_REFERRER')
+    const {referrer} = this.$router.params
+    if (referrer) {
+      this.setState({
+        referrer
+      })
+      Taro.removeStorageSync('APP_cur_sale')
+      Taro.setStorageSync("APP_MY_REFERRER", referrer)
+    }
     // this.popupOpen()
   }
   

+ 0 - 1
src/pagesRoom/list.jsx

@@ -528,7 +528,6 @@ class Index extends Component {
       } else {
         isListEmpty = false
       }
-      console.log(dataList)
       this.setState({
         dataList,
         isListEnd,