Selaa lähdekoodia

Merge branch 'main' of http://git.ycjcjy.com/marketing/miniapp into main

张延森 3 vuotta sitten
vanhempi
commit
256d006b29

+ 1
- 1
project.config.json Näytä tiedosto

@@ -27,7 +27,7 @@
27 27
 			"outputPath": ""
28 28
 		},
29 29
 		"useIsolateContext": true,
30
-		"useCompilerModule": false,
30
+		"useCompilerModule": true,
31 31
 		"userConfirmedUseCompilerModuleSwitch": false
32 32
 	},
33 33
 	"compileType": "miniprogram",

+ 10
- 6
src/assets/css/iconfont.css
File diff suppressed because it is too large
Näytä tiedosto


BIN
src/assets/css/iconfont.eot Näytä tiedosto


+ 1
- 1
src/assets/css/iconfont.js
File diff suppressed because it is too large
Näytä tiedosto


+ 7
- 0
src/assets/css/iconfont.json Näytä tiedosto

@@ -5,6 +5,13 @@
5 5
   "css_prefix_text": "icon-",
6 6
   "description": "",
7 7
   "glyphs": [
8
+    {
9
+      "icon_id": "11930508",
10
+      "name": "餐饮",
11
+      "font_class": "canyin",
12
+      "unicode": "e642",
13
+      "unicode_decimal": 58946
14
+    },
8 15
     {
9 16
       "icon_id": "1167166",
10 17
       "name": "交通",

+ 3
- 0
src/assets/css/iconfont.svg Näytä tiedosto

@@ -20,6 +20,9 @@ Created by iconfont
20 20
   />
21 21
     <missing-glyph />
22 22
     
23
+    <glyph glyph-name="canyin" unicode="&#58946;" d="M439.34082031 776.89746094c-13.09570313 0-21.84082031-8.72753906-21.84082031-21.82324219v-152.81542969h-0.08789062v-7.25976562c0.00878906-12.05859375-9.76464844-21.83203125-21.81445313-21.84082031-12.05859375-0.00878906-21.83203125 9.76464844-21.84082031 21.81445312V755.07421875c-0.00878906 12.05859375-9.78222656 21.82324219-21.84082031 21.81445313-12.04980469-0.00878906-21.81445313-9.7734375-21.81445313-21.81445313v-160.07519531c0.00878906-12.05859375-9.76464844-21.83203125-21.81445312-21.84082032-12.05859375-0.00878906-21.83203125 9.76464844-21.84082032 21.81445313V755.15332031c0 13.05175781-8.75390625 21.75292969-21.82324218 21.75292969s-21.84082031-8.72753906-21.84082032-21.82324219v-297.59765625c0-43.69921875 58.20996094-88.04003906 58.20996094-88.04003906V42.01757812000005c0-28.125 22.80761719-50.92382813 50.94140625-50.92382812 28.125 0 50.92382813 22.79882813 50.92382813 50.92382813V369.43652344s58.31542969 44.49902344 58.31542968 85.8515625V755.0390625c0.00878906 13.13085938-8.72753906 21.85839844-21.83203125 21.85839844z m341.87695313-356.51953125V737.6015625c0 21.50683594-17.31445313 38.99707031-38.8125 39.21679688-106.75195313 0-150.44238281-145.265625-150.44238282-196.45312501v-285.14355468l87.38964844-85.86035156v-167.34375c0-28.125 22.80761719-50.92382813 50.94140625-50.92382813 28.125 0 50.92382813 22.79882813 50.92382813 50.92382813V420.37792969z"  horiz-adv-x="1024" />
24
+
25
+    
23 26
     <glyph glyph-name="jiaotong" unicode="&#58932;" d="M869.76159781 95.83633499999996l-19.94871469 576.56141156c0 51.59190094-44.65868156 93.41186719-99.74453343 93.41186719L271.29248 765.80961281c-55.08681094 0-99.74357344-41.82092531-99.74357344-93.41186719L151.59923187 95.83633499999996l69.13840407 0c-0.50173969-2.63629219-0.81928406-5.34165844-0.81928407-8.12569125l0-18.960585c0-23.93385281 19.40188594-43.33669781 43.33669782-43.33669781l62.29824187 0c23.93673094 0 43.33861687 19.40380406 43.33861688 43.33669781L368.8919075 87.71064375000003c0 2.78307281-0.31754437 5.48843906-0.81928406 8.12569125l285.21750281 0c-0.50173969-2.63629219-0.81928406-5.34165844-0.81928406-8.12569125l0-18.960585c0-23.93385281 19.402845-43.33669781 43.33861687-43.33669781l62.29824188 0c23.93481188 0 43.33861687 19.40380406 43.33861687 43.33669781L801.446315 87.71064375000003c0 2.78307281-0.31754437 5.48843906-0.81928406 8.12569125L869.76159781 95.83633499999996zM274.68953656 186.18020156c-30.24829125 0-54.77118469 24.52289344-54.77118469 54.77310375 0 30.25021031 24.52289344 54.77310375 54.77118469 54.77310375 30.25212937 0 54.77310375-24.52289344 54.77310375-54.77310375C329.46264031 210.70309499999996 304.94166594 186.18020156 274.68953656 186.18020156zM235.89727719 385.01115469l7.4224875 236.69552062c0 52.20204656 19.01047125 72.85012781 67.06716843 72.85012781l400.3212225 0c48.05669719 0 67.06716844-20.64808031 67.06716844-72.85012781l7.68918656-236.69552062L235.89727719 385.01115469zM746.67129313 186.18020156c-30.25021031 0-54.77310375 24.52289344-54.77310376 54.77310375 0 30.25021031 24.52289344 54.77310375 54.77310375 54.77310375 30.25021031 0 54.77310375-24.52289344 54.77310376-54.77310375C801.44439687 210.70309499999996 776.92150344 186.18020156 746.67129313 186.18020156z"  horiz-adv-x="1024" />
24 27
 
25 28
     

BIN
src/assets/css/iconfont.ttf Näytä tiedosto


BIN
src/assets/css/iconfont.woff Näytä tiedosto


BIN
src/assets/css/iconfont.woff2 Näytä tiedosto


+ 6
- 0
src/constants/api.js Näytä tiedosto

@@ -12,6 +12,12 @@ export const pathname = '/api/wx'
12 12
 
13 13
 const resolvePath = api => `${host + pathname}/${api}`
14 14
 
15
+// 特价房源
16
+export const API_SPECIAL_ROOM_LIST = resolvePath('specialRoomList') // 特价房源列表
17
+
18
+// 项目动态
19
+export const API_PROJECT_TREND_LIST = resolvePath('trendList') // 项目动态
20
+
15 21
 // 帮我找房
16 22
 export const API_HELP_FIND_HOUSE_QUESTION = resolvePath('houseProperty') // 问卷列表
17 23
 export const API_HELP_FIND_HOUSE_SUBMIT = resolvePath('searchHouse') // 问卷提交

+ 18
- 14
src/pages/index/buildingDetail/components/Banner/index.jsx Näytä tiedosto

@@ -1,19 +1,23 @@
1
-import React from 'react'
2
-import { Swiper, SwiperItem } from '@tarojs/components'
3 1
 
4
-import img1 from '@/assets/tmp/1.png'
5
-import img2 from '@/assets/tmp/2.png'
6
-import img3 from '@/assets/tmp/3.jpg'
7
-import img4 from '@/assets/tmp/4.jpg'
2
+import { Swiper, SwiperItem, Image } from '@tarojs/components'
3
+import { getImgURL } from '@/utils/image'
4
+import './index.scss'
8 5
 
9
-
10
-export default (props) => {
6
+export default function Banner (props) {
7
+  const { List = [] } = props
11 8
   return (
12
-    <Swiper interval={2000} duration={500} style={{ height: '100%' }}>
13
-      <SwiperItem><image src={img1} mode='aspectFill' style={{width: '100%', height: '100%'}} /></SwiperItem>
14
-      <SwiperItem><image src={img2} mode='aspectFill' style={{width: '100%', height: '100%'}} /></SwiperItem>
15
-      <SwiperItem><image src={img3} mode='aspectFill' style={{width: '100%', height: '100%'}} /></SwiperItem>
16
-      <SwiperItem><image src={img4} mode='aspectFill' style={{width: '100%', height: '100%'}} /></SwiperItem>
17
-    </Swiper>
9
+    <view className='components Banner'>
10
+      <Swiper autoplay interval={2000} indicator-dots>
11
+        {
12
+          List.map((item, index) => (
13
+            <SwiperItem key={`Banner-${index}`}>
14
+              <view className='swiper-item'>
15
+                <Image mode='aspectFill' className='centerLabel' src={getImgURL(item.image || item.coverImg || item.url || item.img)} />
16
+              </view>
17
+            </SwiperItem>
18
+          ))
19
+        }
20
+      </Swiper>
21
+    </view>
18 22
   )
19 23
 }

+ 21
- 0
src/pages/index/buildingDetail/components/Banner/index.scss Näytä tiedosto

@@ -0,0 +1,21 @@
1
+.components.Banner {
2
+  width: 100%;
3
+  height: 100%;
4
+  background: #eee;
5
+  position: relative;
6
+  overflow: hidden;
7
+  > swiper {
8
+    width: 100%;
9
+    height: 100%;
10
+    .swiper-item {
11
+      width: 100%;
12
+      height: 100%;
13
+      position: relative;
14
+      overflow: hidden;
15
+      > image {
16
+        width: 100%;
17
+        height: 100%;
18
+      }
19
+    }
20
+  }
21
+}

+ 9
- 10
src/pages/index/buildingDetail/components/HouseTypeIntro/index.jsx Näytä tiedosto

@@ -1,17 +1,17 @@
1
-import React, { useState, useEffect } from 'react'
1
+
2 2
 import { ScrollView, Image } from '@tarojs/components'
3 3
 import '@/assets/css/iconfont.css'
4 4
 import './index.scss'
5 5
 
6 6
 export default function HouseTypeIntro (props) {
7
-  const { Data = {} } = props
8
-  const [PageList, setPageList] = useState(['', '', '', '', ''])
7
+  const { Info = [] } = props
8
+  
9 9
   return (
10 10
     <view className='components HouseTypeIntro'>
11 11
 
12 12
       <view className='Title flex-h'>
13 13
         <view className='flex-item'>
14
-          <text>户型介绍(5)</text>
14
+          <text>户型介绍({Info.length})</text>
15 15
         </view>
16 16
         <text>更多</text>
17 17
         <text className='iconfont icon-jiantouright'></text>
@@ -20,17 +20,16 @@ export default function HouseTypeIntro (props) {
20 20
       <view className='ProjectList'>
21 21
         <ScrollView scroll-x>
22 22
           {
23
-            PageList.map((item, index) => (
23
+            Info.map((item, index) => (
24 24
               <view className='ListItem' key={`List-${index}`}>
25 25
                 <view className='Img'>
26
-                  <Image mode='aspectFill' src={null}></Image>
26
+                  <Image mode='aspectFill' src={item.buildingImgList.length ? item.buildingImgList[0].url : null}></Image>
27 27
                 </view>
28 28
                 <view className='Title'>
29
-                  <text>290平</text>
30
-                  <text>户型</text>
29
+                  <text>{item.apartmentName}</text>
31 30
                 </view>
32
-                <text>建面290m²</text>
33
-                <text>套内288m²</text>
31
+                <text>建面{item.buildingArea || `-`}m²</text>
32
+                <text>套内{item.insideArea || `-`}m²</text>
34 33
               </view>
35 34
             ))
36 35
           }

+ 6
- 6
src/pages/index/buildingDetail/components/LivingActivity/index.jsx Näytä tiedosto

@@ -1,11 +1,11 @@
1
-import React, { useState, useEffect } from 'react'
1
+
2 2
 import { Image } from '@tarojs/components'
3 3
 import '@/assets/css/iconfont.css'
4
+import { getImgURL } from '@/utils/image'
4 5
 import './index.scss'
5 6
 
6 7
 export default function LivingActivity (props) {
7
-  const { Data = {} } = props
8
-  const [PageList, setPageList] = useState(['', ''])
8
+  const { List = [] } = props
9 9
   return (
10 10
     <view className='components LivingActivity'>
11 11
 
@@ -19,10 +19,10 @@ export default function LivingActivity (props) {
19 19
 
20 20
       <view className='List flex-h'>
21 21
         {
22
-          PageList.map((item, index) => (
22
+          List.map((item, index) => (
23 23
             <view className='flex-item' key={`ListItem-${index}`}>
24
-              <view>
25
-                <Image mode='aspectFill' src={null} className='centerLabel'></Image>
24
+              <view style={{display: item.images ? 'block' : 'none'}}>
25
+                <Image mode='aspectFill' src={getImgURL(item.images)} className='centerLabel'></Image>
26 26
               </view>
27 27
             </view>
28 28
           ))

+ 3
- 3
src/pages/index/buildingDetail/components/MarketingActivity/index.jsx Näytä tiedosto

@@ -1,11 +1,11 @@
1
-import React, { useState, useEffect } from 'react'
1
+
2 2
 import { Swiper, SwiperItem, Image } from '@tarojs/components'
3 3
 import { getImgURL } from '@/utils/image'
4 4
 import '@/assets/css/iconfont.css'
5 5
 import './index.scss'
6 6
 
7 7
 export default function MarketingActivity (props) {
8
-  const { List = ['', '', ''] } = props
8
+  const { List = [] } = props
9 9
   return (
10 10
     <view className='components MarketingActivity'>
11 11
 
@@ -24,7 +24,7 @@ export default function MarketingActivity (props) {
24 24
               List.map((item, index) => (
25 25
                 <SwiperItem key={`Banner-${index}`}>
26 26
                   <view className='swiper-item'>
27
-                    <Image mode='aspectFill' className='centerLabel' src={getImgURL(item?.image)} />
27
+                    <Image mode='aspectFill' className='centerLabel' src={getImgURL(item.bannerListImg || item.image || item.url || item.img || item.imgUrl || item.detailImg)} />
28 28
                   </view>
29 29
                 </SwiperItem>
30 30
               ))

+ 6
- 7
src/pages/index/buildingDetail/components/News/index.jsx Näytä tiedosto

@@ -1,11 +1,10 @@
1
-import React, { useState, useEffect } from 'react'
1
+
2 2
 import { Image } from '@tarojs/components'
3 3
 import '@/assets/css/iconfont.css'
4 4
 import './index.scss'
5 5
 
6 6
 export default function News (props) {
7
-  const { Data = {} } = props
8
-  const [PageList, setPageList] = useState(['', ''])
7
+  const { List = [] } = props
9 8
   return (
10 9
     <view className='components News'>
11 10
 
@@ -19,12 +18,12 @@ export default function News (props) {
19 18
 
20 19
       <view className='List flex-h'>
21 20
         {
22
-          PageList.map((item, index) => (
21
+          List.map((item, index) => (
23 22
             <view className='flex-item' key={`ListItem-${index}`}>
24
-              <view className='Img'>
25
-                <Image mode='aspectFill' src={null} className='centerLabel'></Image>
23
+              <view className='Img' style={{display: item.newsImg || item.newsName ? 'block' : 'none'}}>
24
+                <Image mode='aspectFill' src={item.newsImg} className='centerLabel'></Image>
26 25
               </view>
27
-              <text className='Title'>一方山营销中心盛大样板间开盘活动</text>
26
+              <text className='Title'>{item.newsName}</text>
28 27
             </view>
29 28
           ))
30 29
         }

+ 48
- 24
src/pages/index/buildingDetail/components/Periphery/index.jsx Näytä tiedosto

@@ -1,9 +1,36 @@
1
-import React, { useState, useEffect } from 'react'
1
+
2
+import { Map } from '@tarojs/components'
3
+import '@/assets/css/iconfont.css'
2 4
 import './index.scss'
3
-import '../../../../../assets/css/iconfont.css'
4 5
 
5 6
 export default function Periphery (props) {
6
-  const { Data = {} } = props
7
+  const { List = [] } = props
8
+
9
+  const CutTab = () => {
10
+    return () => {
11
+      
12
+    }
13
+  }
14
+
15
+  const ClassName = (label) => {
16
+    switch (label) {
17
+      case '交通':
18
+        return 'iconfont icon-jiaotong'
19
+      case '商业':
20
+        return 'iconfont icon-shangye'
21
+      case '学校':
22
+        return 'iconfont icon-xuexiao'
23
+      case '医院':
24
+        return 'iconfont icon-yiyuan'
25
+      case '银行':
26
+        return 'iconfont icon-yinhang'
27
+      case '餐饮':
28
+        return 'iconfont icon-canyin'
29
+      default:
30
+        return ''
31
+    }
32
+  }
33
+
7 34
   return (
8 35
     <view className='components Periphery'>
9 36
 
@@ -14,30 +41,27 @@ export default function Periphery (props) {
14 41
       </view>
15 42
 
16 43
       <view className='Map'>
17
-        <view></view>
44
+        <view>
45
+          <Map
46
+            id='poi-around'
47
+            show-location
48
+            scale={12}
49
+            markers={[]}
50
+            enable-enableScroll
51
+            enable-zoom
52
+          ></Map>
53
+        </view>
18 54
       </view>
19 55
 
20 56
       <view className='List flex-h'>
21
-        <view className='flex-item'>
22
-          <text className='iconfont icon-jiaotong'></text>
23
-          <text>交通(10)</text>
24
-        </view>
25
-        <view className='flex-item'>
26
-          <text className='iconfont icon-shangye'></text>
27
-          <text>商业(10)</text>
28
-        </view>
29
-        <view className='flex-item'>
30
-          <text className='iconfont icon-xuexiao'></text>
31
-          <text>学校(10)</text>
32
-        </view>
33
-        <view className='flex-item'>
34
-          <text className='iconfont icon-yiyuan'></text>
35
-          <text>医院(10)</text>
36
-        </view>
37
-        <view className='flex-item'>
38
-          <text className='iconfont icon-yinhang'></text>
39
-          <text>银行(10)</text>
40
-        </view>
57
+        {
58
+          List.map((item, index) => (
59
+            <view className='flex-item' key={`Item-${index}`} onClick={CutTab(index)}>
60
+              <text className={ClassName(item.label)}></text>
61
+              <text>{item.label}({item.data.length})</text>
62
+            </view>
63
+          ))
64
+        }
41 65
       </view>
42 66
 
43 67
     </view>

+ 4
- 0
src/pages/index/buildingDetail/components/Periphery/index.scss Näytä tiedosto

@@ -33,6 +33,10 @@
33 33
       top: 0;
34 34
       bottom: 0;
35 35
       overflow: hidden;
36
+      >map{
37
+        width: 100%;
38
+        height: 100%;
39
+      }
36 40
     }
37 41
   }
38 42
   >.List {

+ 5
- 6
src/pages/index/buildingDetail/components/Pictures/index.jsx Näytä tiedosto

@@ -1,11 +1,10 @@
1
-import React, { useState, useEffect } from 'react'
1
+
2 2
 import '@/assets/css/iconfont.css'
3 3
 import { ScrollView, Image } from '@tarojs/components'
4 4
 import './index.scss'
5 5
 
6 6
 export default function Pictures (props) {
7
-  const { Data = {} } = props
8
-  const [PageList, setPageList] = useState(['', '', '', '', ''])
7
+  const { List = [] } = props
9 8
   return (
10 9
     <view className='components Pictures'>
11 10
 
@@ -18,12 +17,12 @@ export default function Pictures (props) {
18 17
       <view className='ProjectList'>
19 18
         <ScrollView scroll-x>
20 19
           {
21
-            PageList.map((item, index) => (
20
+            List.map((item, index) => (
22 21
               <view className='ListItem' key={`List-${index}`}>
23 22
                 <view className='Img'>
24
-                  <Image mode='aspectFill' className='centerLabel' src={null}></Image>
23
+                  <Image mode='aspectFill' className='centerLabel' src={item.buildingImgList.length ? item.buildingImgList[0].url : null}></Image>
25 24
                 </view>
26
-                <text className='Title'>效果图(6)</text>
25
+                <text className='Title'>{item.apartmentName}({item.buildingImgList.length})</text>
27 26
               </view>
28 27
             ))
29 28
           }

+ 12
- 8
src/pages/index/buildingDetail/components/PropertyConsultant/index.jsx Näytä tiedosto

@@ -1,18 +1,22 @@
1
-import React, { useState, useEffect } from 'react'
1
+import { useState } from 'react'
2 2
 import { Image } from '@tarojs/components'
3
+import Taro from '@tarojs/taro'
3 4
 import '@/assets/css/iconfont.css'
4 5
 import './index.scss'
5 6
 
6 7
 export default function PropertyConsultant (props) {
7 8
 
8
-  const { Data = {} } = props
9
+  const { List = [] } = props
9 10
   const [TipsList] = useState([
10 11
     {name: '官方保障', icon: 'icon-baozhang'},
11 12
     {name: '免费咨询', icon: 'icon-zixun'},
12 13
     {name: '户型解读', icon: 'icon-jiedu'},
13 14
     {name: '贴心服务', icon: 'icon-tiexin'}
14 15
   ])
15
-  const [PageList, setPageList] = useState(['', '', ''])
16
+
17
+  const CallPhone = (phone) => { // 拨打电话
18
+    Taro.makePhoneCall({ phoneNumber: phone })
19
+  }
16 20
 
17 21
   return (
18 22
     <view className='components PropertyConsultant'>
@@ -38,17 +42,17 @@ export default function PropertyConsultant (props) {
38 42
 
39 43
       <view className='PersonList'>
40 44
         {
41
-          PageList.map((item, index) => (
45
+          List.map((item, index) => (
42 46
             <view key={`PersonItem-${index}`} className='flex-h'>
43 47
               <view className='Icon'>
44
-                <Image mode='aspectFill' src={null}></Image>
48
+                <Image mode='aspectFill' src={item.photo || item.avatar}></Image>
45 49
               </view>
46 50
               <view className='flex-item'>
47
-                <text>陶虹</text>
48
-                <text>好评经纪人,熟悉楼盘特色</text>
51
+                <text>{item.userName}</text>
52
+                <text>{item.description || ''}</text>
49 53
               </view>
50 54
               <text className='iconfont icon-liaotian Chat'></text>
51
-              <text className='iconfont icon-dianhua Phone'></text>
55
+              <text className='iconfont icon-dianhua Phone' onClick={CallPhone(item.phone || item.tel)}></text>
52 56
             </view>
53 57
           ))
54 58
         }

+ 78
- 19
src/pages/index/buildingDetail/index.jsx Näytä tiedosto

@@ -4,9 +4,10 @@ import { ScrollView } from '@tarojs/components'
4 4
 import '@/assets/css/iconfont.css'
5 5
 import { useSelector } from 'react-redux'
6 6
 import { fetch } from '@/utils/request'
7
-import { API_ITEMS_DETAIL } from '@/constants/api'
7
+import { API_ITEMS_DETAIL, API_SPECIAL_ROOM_LIST, API_PROJECT_TREND_LIST, API_ACTIVITY_GROUP, API_LIVE_LIST, API_NEWS_LIST } from '@/constants/api'
8 8
 import './index.scss'
9 9
 import DetailBottom from './components/DetailBottom/index'
10
+import Banner from './components/Banner/index'
10 11
 import BasicInfo from './components/BasicInfo/index'
11 12
 import SpecialPriceHouse from './components/SpecialPriceHouse/index'
12 13
 import ProjectDynamic from './components/ProjectDynamic/index'
@@ -17,34 +18,92 @@ import MarketingActivity from './components/MarketingActivity/index'
17 18
 import LivingActivity from './components/LivingActivity/index'
18 19
 import News from './components/News/index'
19 20
 import Pictures from './components/Pictures/index'
20
-import Banner from './components/Banner'
21 21
 
22 22
 export default withLayout((props) => {
23
-  
23
+
24 24
   const user = useSelector(state => state.user)
25 25
   const [PersonId, setPersonId] = useState(null)
26 26
   const [DetailInfo, setDetailInfo] = useState({})
27
+  const [ActivityList, setActivityList] = useState([])
28
+  const [PictureList, setPictureList] = useState([])
29
+  const [NewsList, setNewsList] = useState([])
30
+  const [LiveList, setLiveList] = useState([])
31
+  const [MapList, setMapList] = useState([])
27 32
   const [IsPull, setPull] = useState(false)
28 33
   const [PullTimer, setPullTimer] = useState(null)
29 34
 
30 35
   useEffect(() => {
31
-    if(user?.userInfo?.person?.personId) {
36
+    if (user?.userInfo?.person?.personId) {
32 37
       setPersonId(user.userInfo.person.personId)
33 38
     }
34 39
   }, [user])
35 40
 
36 41
   useEffect(() => {
37
-    if(PersonId) {
42
+    if (PersonId) {
38 43
       GetBuildingDetail()
44
+      GetSpecialRoomList()
45
+      GetProjectTrendList()
46
+      GetActivityList()
47
+      GetLiveList()
48
+      GetNewsList()
39 49
     }
40 50
   }, [PersonId])
41 51
 
52
+  useEffect(() => {
53
+    if (DetailInfo.buildingApartment) {
54
+      const List = DetailInfo.buildingApartment.filter(item => item.apartmentType === 'photo')
55
+      setPictureList(List.filter(item => item.buildingImgList.length > 0))
56
+    }
57
+    if(DetailInfo.mapJson) {
58
+      setMapList(JSON.parse(DetailInfo.mapJson))
59
+    }
60
+  }, [DetailInfo])
61
+
42 62
   const GetBuildingDetail = () => { // 获取楼盘信息
43
-    fetch({ url: `${API_ITEMS_DETAIL}/${props.router.params.id}`, method: 'get'}).then((res) => {
63
+    fetch({ url: `${API_ITEMS_DETAIL}/${props.router.params.id}`, method: 'get' }).then((res) => {
44 64
       setDetailInfo(res || {})
45 65
     })
46 66
   }
47 67
 
68
+  const GetSpecialRoomList = () => { // 获取特价房源列表
69
+    fetch({ url: API_SPECIAL_ROOM_LIST, method: 'get' }).then((res) => {
70
+      console.log(res)
71
+    })
72
+  }
73
+
74
+  const GetProjectTrendList = () => { // 获取项目动态
75
+    fetch({ url: API_PROJECT_TREND_LIST, method: 'get' }).then((res) => {
76
+      console.log(res)
77
+    })
78
+  }
79
+
80
+  const GetActivityList = () => { // 获取活动列表
81
+    fetch({ url: `${API_ACTIVITY_GROUP}?buildingId=${props.router.params.id}`, method: 'get' }).then((res) => {
82
+      const ResArr = res || []
83
+      setActivityList(ResArr.filter((item) => { return item.type !== 'help' && item.type !== 'group' }))
84
+    })
85
+  }
86
+
87
+  const GetLiveList = () => { // 获取直播列表
88
+    fetch({ url: `${API_LIVE_LIST}?buildingId=${props.router.params.id}`, method: 'get' }).then((res) => {
89
+      let ResArr = res.records.slice(0, 2)
90
+      if (ResArr.length === 1) {
91
+        ResArr.push({})
92
+      }
93
+      setLiveList(ResArr || [])
94
+    })
95
+  }
96
+
97
+  const GetNewsList = () => { // 获取资讯列表
98
+    fetch({ url: `${API_NEWS_LIST}?buildingId=${props.router.params.id}&pageSize=2&pageNum=1`, method: 'get' }).then((res) => {
99
+      let ResArr = res.records.slice(0, 2)
100
+      if (ResArr.length === 1) {
101
+        ResArr.push({})
102
+      }
103
+      setNewsList(ResArr || [])
104
+    })
105
+  }
106
+
48 107
   const PageRefresh = () => { // 页面下拉刷新回调
49 108
     setPull(true)
50 109
   }
@@ -70,7 +129,7 @@ export default withLayout((props) => {
70 129
               <view className='BannerContainer'>
71 130
                 <view>
72 131
                   <view>
73
-                    <Banner />
132
+                    <Banner List={DetailInfo?.panoramaList}></Banner>
74 133
                   </view>
75 134
                 </view>
76 135
               </view>
@@ -94,38 +153,38 @@ export default withLayout((props) => {
94 153
                 </view>
95 154
 
96 155
                 {/* 置业顾问 */}
97
-                <view className='PropertyConsultant'>
98
-                  <PropertyConsultant></PropertyConsultant>
156
+                <view className='PropertyConsultant' style={{ display: DetailInfo?.consultants?.length ? 'block' : 'none' }}>
157
+                  <PropertyConsultant List={DetailInfo?.consultants}></PropertyConsultant>
99 158
                 </view>
100 159
 
101 160
                 {/* 位置及周边 */}
102 161
                 <view className='Periphery'>
103
-                  <Periphery></Periphery>
162
+                  <Periphery List={MapList} Info={DetailInfo}></Periphery>
104 163
                 </view>
105 164
 
106 165
                 {/* 户型介绍 */}
107 166
                 <view className='HouseTypeIntro'>
108
-                  <HouseTypeIntro></HouseTypeIntro>
167
+                  <HouseTypeIntro Info={DetailInfo?.buildingApartment}></HouseTypeIntro>
109 168
                 </view>
110 169
 
111 170
                 {/* 营销活动 */}
112
-                <view className='MarketingActivity'>
113
-                  <MarketingActivity></MarketingActivity>
171
+                <view className='MarketingActivity' style={{ display: ActivityList.length ? 'block' : 'none' }}>
172
+                  <MarketingActivity List={ActivityList}></MarketingActivity>
114 173
                 </view>
115 174
 
116 175
                 {/* 直播活动 */}
117
-                <view className='LivingActivity'>
118
-                  <LivingActivity></LivingActivity>
176
+                <view className='LivingActivity' style={{ display: LiveList.length ? 'block' : 'none' }}>
177
+                  <LivingActivity List={LiveList}></LivingActivity>
119 178
                 </view>
120 179
 
121 180
                 {/* 新鲜资讯 */}
122
-                <view className='News'>
123
-                  <News></News>
181
+                <view className='News' style={{ display: NewsList.length ? 'block' : 'none' }}>
182
+                  <News List={NewsList}></News>
124 183
                 </view>
125 184
 
126 185
                 {/* 相册 */}
127
-                <view className='Pictures'>
128
-                  <Pictures></Pictures>
186
+                <view className='Pictures' style={{ display: PictureList.length ? 'block' : 'none' }}>
187
+                  <Pictures List={PictureList}></Pictures>
129 188
                 </view>
130 189
 
131 190
               </view>

+ 40
- 0
src/utils/amap.js Näytä tiedosto

@@ -0,0 +1,40 @@
1
+const POI_TYPES = [
2
+  {
3
+    key: 'Transport',
4
+    label: '交通',
5
+    types: ['150100', '150200', '150300', '150400', '150500', '150600'],
6
+  },
7
+  {
8
+    key: 'Mall',
9
+    label: '商业',
10
+    types: ['060100', '060200', '060300', '060400', '060500', '060600',
11
+            '060700', '060800', '060900', '061000', '061100', '061200',
12
+            '061300', '061400', '080100', '080200', '080300', '080400',
13
+            '080500', '080600'],
14
+  },
15
+  {
16
+    key: 'Edu',
17
+    label: '学校',
18
+    types: ['141200'],
19
+  },
20
+  {
21
+    key: 'Hospital',
22
+    label: '医院',
23
+    types: ['090100', '090200', '090300', '090400', '090500', '090600', '090700'],
24
+  },
25
+  {
26
+    key: 'Bank',
27
+    label: '银行',
28
+    types: ['160100'],
29
+  },
30
+  {
31
+    key: 'Restaurant',
32
+    label: '餐饮',
33
+    types: ['050100', '050200', '050300', '050400', '050500', '050600',
34
+            '050700', '050800', '050900'],
35
+  },
36
+]
37
+
38
+export {
39
+  POI_TYPES,
40
+}