Bladeren bron

添加 平台广告

230320a303 1 jaar geleden
bovenliggende
commit
5365dfe0f2
5 gewijzigde bestanden met toevoegingen van 215 en 4 verwijderingen
  1. 3 0
      src/api/house.js
  2. 1 0
      src/app.jsx
  3. 14 4
      src/pagesHouse/indexDtl.jsx
  4. 139 0
      src/pagesHouse/photoin.jsx
  5. 58 0
      src/pagesHouse/photoin.scss

+ 3 - 0
src/api/house.js

@@ -57,6 +57,9 @@ export default {
   estatephotolist: params => { // 楼盘相册接口
     return request('/api/estate/photo/list', params, 'loading')
   },
+  apiestateprivimglist: params => { // 内部 楼盘相册接口
+    return request('/api/estate/privimg/list', params, 'loading')
+  },
   apiestatenewslist: params => { // 楼盘动态列表接口
     return request('/api/estate/news/list', params)
   },

+ 1 - 0
src/app.jsx

@@ -48,6 +48,7 @@ class App extends Component {
           'produceType',
           'vr',
           'photo',
+          'photoin',
           'news',
           'follow',
           'history',

+ 14 - 4
src/pagesHouse/indexDtl.jsx

@@ -333,6 +333,7 @@ class Index extends Component {
   }
 
   renderEntry () {
+    const userInfo = Taro.getStorageSync('APP_userInfo') || {}
     const { curId, curObj } = this.state
     const icon1 = require('./img/dtl/icon1.png')
     const icon2 = require('./img/dtl/icon2.png')
@@ -393,10 +394,19 @@ class Index extends Component {
             <View className="t">团购报名</View>
           </Navigator>
         }
-        <Navigator url={`/pagesMore/center/feedback?eId=${curId}&eName=${curObj.estate_name}`} className="de-op">
-          <Image className="i" src={icon8} />
-          <View className="t">纠错补图</View>
-        </Navigator>
+        {
+          userInfo.is_sale == 1
+          ?
+          <Navigator url={'/pagesHouse/photoin?id=' + curId + '&name=' + curObj.estate_name} className="de-op">
+            <Image className="i" src={icon8} />
+            <View className="t">洪楼相册</View>
+          </Navigator>
+          :
+          <Navigator url={`/pagesMore/center/feedback?eId=${curId}&eName=${curObj.estate_name}`} className="de-op">
+            <Image className="i" src={icon8} />
+            <View className="t">纠错补图</View>
+          </Navigator>
+        }
         <Navigator url="/pagesMore/news/indexDtl?id=2262" className="de-op">
           <Image className="i" src={icon9} />
           <View className="t">房友群</View>

+ 139 - 0
src/pagesHouse/photoin.jsx

@@ -0,0 +1,139 @@
+import Taro, { Component } from '@tarojs/taro'
+import { View } from '@tarojs/components'
+import ListMore from '@/c/pageDataList/listMore'
+
+import './photoin.scss'
+
+class Index extends Component {
+  
+
+  constructor (props) {
+    super(props)
+    const {id: curId} = this.$router.params
+    this.state = {
+      curId,
+      curObj: [],
+      curIndex: 0,
+    }
+  }
+
+  config = {
+    navigationBarTitleText: '洪楼相册',
+  }
+
+  componentWillMount () {
+    Taro.$AHU(this)
+    this.getDtl()
+  }
+
+  getDtl () {
+    const { curId } = this.state
+    Taro.api.house.apiestateprivimglist({estate_id: curId}).then(res => {
+      const cArr = res.data ? JSON.parse(res.data) : []
+      this.setState({
+        curObj: cArr
+      })
+    })
+  }
+
+  componentDidShow () { }
+
+  componentDidHide () { }
+
+  renderHeader () {
+    const { curObj, curIndex } = this.state
+    const navItems = curObj.map((item, index) => {
+      return (
+        <View onClick={this.navHandle.bind(this, index, item.val)} className={curIndex === index ? 'sh-op cur' : 'sh-op'} key={index}>{item.key}</View>
+      )
+    })
+    return (
+      <View className="scoped-header">
+        {navItems}
+      </View>
+    )
+  }
+  navHandle (index, val) {
+    Taro.pageScrollTo({
+      selector: `#${val}`
+    })
+    this.setState({
+      curIndex: index
+    })
+  }
+
+  renderInfo () {
+    const { curObj } = this.state
+    return (
+      <View className="scoped-photo">
+        {
+          curObj.map((one, index) => {
+            return (
+              <View className="sp-item" key={index} id={one.val}>
+                <View className="sp-title">{one.key}({one.urls.length})</View>
+                <View className="sp-main">
+                  {
+                    one.urls.map((two, twoIndex) => {
+                      return (
+                        <View className="sp-op" key={twoIndex}>
+                          <Image src={two + '_xs'} className="sp-img" onClick={this.previewImageHandle.bind(this, two, one.urls)} />
+                        </View>
+                      )
+                    })
+                  }
+                </View>
+              </View>
+            )
+          })
+        }
+      </View>
+    )
+  }
+  previewImageHandle (cur, arr) {
+    const current = `${cur}_plus`
+    const urls = arr.map(item => {
+      return `${item}_plus`
+    })
+    Taro.previewImage({
+      current,
+      urls
+    })
+  }
+
+
+  renderQaAdd () {
+    const iconGif = require('@img/icon_g_qa.gif')
+    return (
+      <Navigator url={'/pagesQa/add'} className="scoped-fix-q2 t2">
+        <Image className="img" src={iconGif} />
+      </Navigator>
+    )
+  }
+  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 { curObj  } = this.state
+    return (
+      <View className="l-box">
+        {this.renderQaAdd()}
+        {this.renderShare()}
+        {this.renderHeader()}
+        {this.renderInfo()}
+        {
+          curObj.length === 0
+          &&
+          <ListMore isOther={true} text="相册在路上"/>
+        }
+      </View>
+    )
+  }
+}
+
+export default Index

+ 58 - 0
src/pagesHouse/photoin.scss

@@ -0,0 +1,58 @@
+@import '@css/mixin.scss';
+@import '@css/list-box.scss';
+@import '@css/comment-box.scss';
+.l-box {
+  padding-top: 120px;
+}
+.scoped-header {
+  display: flex;
+  padding: 20px;
+  top: 0;
+  left: 0;
+  width: 100%;
+  position: fixed;
+  background: #fff;
+  border-bottom: 1px solid #f2f2f2;
+  box-sizing: border-box;
+  // flex-wrap: wrap;
+  // width: calc(160px * 5 + 20px * 6);
+  // overflow-x: scroll;
+  .sh-op {
+    width: 160px;
+    height: 70px;
+    line-height: 70px;
+    text-align: center;
+    background: #f2f2f2;
+    color: #666;
+    font-size: 26px;
+    margin-right: 20px;
+    &:last-child {
+      margin-right: 0;
+    }
+    &.cur {
+      background: #e0eefd;
+      color: #2d8cf0;
+    }
+  }
+}
+.scoped-photo {
+  padding: 0 20px 20px;
+  .sp-title {
+    color: #666;
+    font-size: 28px;
+    padding-bottom: 10px;
+  }
+  .sp-main {
+    display: flex;
+    flex-wrap: wrap;
+  }
+  .sp-op {
+    width: 25%;
+    margin-bottom: 10px;
+  }
+  .sp-img {
+    width: 160px;
+    height: 160px;
+    border: 1PX solid #f2f2f2;
+  }
+}