张延森 3 年之前
父節點
當前提交
6253ee40ee

二進制
src/assets/logo.png 查看文件


+ 1
- 1
src/components/Loading/index.jsx 查看文件

@@ -3,7 +3,7 @@ import logo from '@/assets/logo.png'
3 3
 import './style.scss'
4 4
 
5 5
 export default (props) => {
6
-  const { width = '80px', logoVisible } = props
6
+  const { width = '64px', logoVisible } = props
7 7
   const height = width
8 8
 
9 9
   return (

+ 2
- 0
src/components/Loading/style.scss 查看文件

@@ -4,6 +4,8 @@
4 4
   position: relative;
5 5
 
6 6
   &-logo {
7
+    box-sizing: border-box;
8
+    padding: 12px;
7 9
     position: absolute;
8 10
     left: 0;
9 11
     transform: scale(.75, .75);

+ 2
- 1
src/components/ProjectListItem/index.jsx 查看文件

@@ -3,6 +3,7 @@ import './index.scss'
3 3
 import '@/assets/css/iconfont.css'
4 4
 import Taro from '@tarojs/taro'
5 5
 import { Image } from '@tarojs/components'
6
+import { getImgURL } from '@/utils/image'
6 7
 
7 8
 export default function ProjectListItem (props) {
8 9
   const { Data = {} } = props
@@ -11,7 +12,7 @@ export default function ProjectListItem (props) {
11 12
     <view className='components ProjectListItem flex-h' onClick={() => {Taro.navigateTo({ url: `/pages/index/buildingDetail/index?id=${Data.buildingId}` })}}>
12 13
       <view className='Img'>
13 14
         <view>
14
-          <Image mode='aspectFill' className='centerLabel' src={Data.buildingListImg?.length ? Data.buildingListImg[0].url : null} />
15
+          <Image mode='aspectFill' className='centerLabel' src={getImgURL(Data.buildingListImg?.length ? Data.buildingListImg[0].url : null)} />
15 16
         </view>
16 17
       </view>
17 18
       <view className='flex-item'>

+ 1
- 1
src/pages/index/activityDetail/index.jsx 查看文件

@@ -326,7 +326,7 @@ export default withLayout((props) => {
326 326
                   </view>
327 327
 
328 328
                   {detail.type == "dymic" && dymic()}
329
-                  {detail.type == "house" && house()}
329
+                  {detail.type !== "dymic" && house()}
330 330
                   <view className='ActivityIntro'>
331 331
                     <view className='Title'>
332 332
                       <text>活动介绍</text>

+ 2
- 0
src/pages/index/activityDetail/index.scss 查看文件

@@ -333,6 +333,8 @@
333 333
               overflow: hidden;
334 334
               text-align: center;
335 335
               font-size: 0;
336
+              margin-bottom: 30rpx;
337
+
336 338
               &::after {
337 339
                 content: '';
338 340
                 display: block;

+ 2
- 2
src/pages/index/buildingDetail/components/DetailBottom/index.jsx 查看文件

@@ -66,10 +66,10 @@ export default function DetailBottom (props) {
66 66
     if (Info.buildingId) {
67 67
       // 请求看房活动
68 68
       queryActivityList({ buildingId: Info.buildingId, pageSize: 1, type: 'look' }).then((res) => {
69
-        const { list } = res || {}
69
+        const { records } = res || {}
70 70
 
71 71
         // 只保留已发布的活动
72
-        setActList((list || []))
72
+        setActList((records || []))
73 73
       })
74 74
     }
75 75
   }, [Info.buildingId])

+ 3
- 3
src/pages/index/buildingDetail/components/MarketingActivity/index.jsx 查看文件

@@ -18,10 +18,10 @@ export default function MarketingActivity (props) {
18 18
   useEffect(() => {
19 19
     if (buildingId) {
20 20
       queryActivityList({ buildingId, pageSize: 500, type: 'house' }).then((res) => {
21
-        const { list } = res || {}
21
+        const { records } = res || {}
22 22
         
23 23
         // 只保留3场在进行中的活动
24
-        setDataList((list || []).filter((x) => (x.activityStatus === 0)).slice(0, 3))
24
+        setDataList((records || []).filter((x) => (x.activityStatus < 2)).slice(0, 3))
25 25
       })
26 26
     }
27 27
   }, [buildingId])
@@ -44,7 +44,7 @@ export default function MarketingActivity (props) {
44 44
               dataList.map((item, index) => (
45 45
                 <SwiperItem key={`Banner-${index}`}>
46 46
                   <view className='swiper-item' onClick={() => goDetail(item.dynamicId)}>
47
-                    <Image mode='aspectFill' className='centerLabel' src={getImgURL(item.bannerListImg || item.image || item.url || item.img || item.imgUrl || item.detailImg)} />
47
+                    <Image mode='aspectFill' className='centerLabel' src={getImgURL(item.imgUrl || item.image || item.url || item.img || item.imgUrl || item.detailImg)} />
48 48
                   </view>
49 49
                 </SwiperItem>
50 50
               ))

+ 8
- 11
src/pages/index/buildingDetail/components/Periphery/index.jsx 查看文件

@@ -46,11 +46,12 @@ export default function Periphery (props) {
46 46
         longitude: loc[0],
47 47
         latitude: loc[1],
48 48
         iconPath: '',
49
-        width: 24,
50
-        height: 36,
51
-        customCallout: {
52
-          anchorY: 0,
53
-          anchorX: 0,
49
+        width: 18,
50
+        height: 27,
51
+        callout: {
52
+          content: Info.buildingName,
53
+          color: '#333333',
54
+          padding: 6,
54 55
           display: 'ALWAYS',
55 56
         }
56 57
       })
@@ -81,18 +82,14 @@ export default function Periphery (props) {
81 82
         <view>
82 83
           <Map
83 84
             id='poi-around'
84
-            show-location
85
+            // show-location
85 86
             scale={12}
86 87
             markers={markers}
87 88
             longitude={loc[0]}
88 89
             latitude={loc[1]}
89 90
             // enable-enableScroll
90 91
             // enable-zoom
91
-          >
92
-            <CoverView slot='callout' className='marker-callout'>
93
-              <CoverView markerId={-1} className='marker-project'>{Info.buildingName}</CoverView>
94
-            </CoverView>
95
-          </Map>
92
+          />
96 93
         </view>
97 94
       </view>
98 95
 

+ 142
- 34
src/pages/index/findHouseFromMap/index.jsx 查看文件

@@ -1,81 +1,189 @@
1
-import { useState } from 'react'
1
+import { useEffect, useRef, useState } from 'react'
2
+import Taro from '@tarojs/taro'
2 3
 import withLayout from '@/layout'
3
-import { Image } from '@tarojs/components'
4
+import { Image, Map } from '@tarojs/components'
5
+import { getItemList } from '@/services/item'
6
+import { getImgURL } from '@/utils/image'
4 7
 import '@/assets/css/iconfont.css'
5 8
 import './index.scss'
6 9
 
7
-export default withLayout(() => {
10
+export default withLayout((props) => {
11
+  const { city } = props
8 12
 
9 13
   const [ShowInfo, setShowInfo] = useState(false)
14
+  const [list, setList] = useState([])
15
+  const [markers, setMarkers] = useState([])
16
+  const mapCtx = useRef()
17
+  const [current, setCurrent] = useState({})
10 18
 
11
-  const CutInfo = (status) => {
12
-    return () => {
13
-      setShowInfo(!!status)
19
+  const changeCity = () => {
20
+    Taro.navigateTo({ url: '/pages/index/location/index' })
21
+  }
22
+
23
+  const handleMarker = (e) => {
24
+    const { markerId } = e
25
+    const building = list[markerId - 1];
26
+    setCurrent(building||{});
27
+    setShowInfo(true)
28
+  }
29
+
30
+  const gotoDetail = () => {
31
+    if (current.buildingId) {
32
+      Taro.navigateTo({ url: `/pages/index/buildingDetail/index?id=${current.buildingId}` })
33
+    }
34
+  }
35
+
36
+  const locationTo = () => {
37
+    if (current.buildingId) {
38
+      const loc = current.coordinate.split(',')
39
+      Taro.openLocation({
40
+        longitude: loc[0] - 0,
41
+        latitude: loc[1] - 0,
42
+        name: current.buildingName,
43
+        address: current.address,
44
+        scale: 12,
45
+      })
14 46
     }
15 47
   }
16 48
 
49
+  useEffect(() => {
50
+    Taro.nextTick(() => {
51
+      mapCtx.current = Taro.createMapContext('map-buildings')
52
+    })
53
+  }, [])
54
+
55
+  useEffect(() => {
56
+    if (city?.id) {
57
+      // 先移除页面的 markers
58
+      if (mapCtx.current && markers.length) {
59
+        mapCtx.current.removeMarkers({ markerIds: markers.map(x => x.id) })
60
+        setMarkers([])
61
+      }
62
+
63
+      getItemList({
64
+        cityId: city.id,
65
+        pageSize: 100,
66
+      }).then((res) => {
67
+        const { records } = res
68
+        setList((records || []).filter(x => x.coordinate))
69
+      })
70
+    }
71
+  }, [city?.id])
72
+
73
+  useEffect(() => {
74
+    if (!list.length) return;
75
+
76
+    const mks = list.map((item, index) => {
77
+      const loc = item.coordinate.split(',')
78
+
79
+      return {
80
+        id: index + 1,
81
+        longitude: loc[0] - 0,
82
+        latitude: loc[1] - 0,
83
+        iconPath: '',
84
+        width: 18,
85
+        height: 27,
86
+        callout: {
87
+          content: item.buildingName,
88
+          color: '#333333',
89
+          fontSize: 14,
90
+          display: 'ALWAYS',
91
+          padding: 6,
92
+          borderRadius: 2,
93
+          borderColor: 'rgba(0,0,0, .1)',
94
+        }
95
+        // customCallout: {
96
+        //   anchorY: 0,
97
+        //   anchorX: 0,
98
+        //   display: 'ALWAYS',
99
+        // }
100
+      }
101
+    })
102
+
103
+    const points = mks.map(it => ({ longitude: it.longitude, latitude: it.latitude }))
104
+    setMarkers(mks)
105
+
106
+    const t = setInterval(() => {
107
+      if (mapCtx.current) {
108
+        mapCtx.current.includePoints({ points, padding: [32] })
109
+        clearInterval(t)
110
+      }
111
+    }, 300)
112
+
113
+    return () => clearInterval(t)
114
+  }, [list])
115
+
17 116
   return (
18 117
     <view className='Page findHouseFromMap'>
19 118
 
20 119
       {/* 地图 */}
21 120
       <view className='MapContainer'>
22
-
121
+        <Map
122
+          id='map-buildings'
123
+          show-location
124
+          scale={12}
125
+          longitude={city?.lng}
126
+          latitude={city?.lat}
127
+          markers={markers}
128
+          onMarkertap={handleMarker}
129
+          onTap={() => setShowInfo(false)}
130
+        />
23 131
       </view>
24 132
 
25 133
       {/* 定位 */}
26
-      <view className='Location'>
134
+      <view className='Location' onClick={changeCity}>
27 135
         <text className='iconfont icon-dingwei'></text>
28
-        <text>南京市</text>
136
+        <text>{city.name}</text>
29 137
       </view>
30 138
 
31 139
       {/* 分享 */}
32
-      <view className='Share'>
140
+      <button className='Share' openType='share'>
33 141
         <text className='iconfont icon-fenxiang'></text>
34
-        <text>分享</text>
35
-      </view>
142
+        <text>分 享</text>
143
+      </button>
36 144
 
37 145
       {/* 附近楼盘 */}
38 146
       <view className={ShowInfo ? 'AroundBuilding active' : 'AroundBuilding'}>
39
-        <view className='Go'>
147
+        <view className='Go' onClick={locationTo}>
40 148
           <text>立即</text>
41 149
           <text>前往</text>
42 150
         </view>
43 151
         <view className='InfoContainer'>
44
-          <text className='Title' onClick={CutInfo(true)}>附近楼盘</text>
152
+          {/* <text className='Title' onClick={CutInfo(true)}>附近楼盘</text> */}
45 153
           <view className='InfoContent'>
46
-            <view className='Img'>
47
-              <Image mode='scaleToFill' src={null} className='centerLabel'></Image>
154
+            <view className='Img' onClick={gotoDetail}>
155
+              <Image mode='scaleToFill' src={getImgURL(current.buildingListImg?.length ? current.buildingListImg[0].url : null)} className='centerLabel'></Image>
48 156
             </view>
49 157
             <view className='Name flex-h'>
50 158
               <view className='flex-item'>
51
-                <text>奥园金基天著尚居</text>
159
+                <text>{current.buildingName}</text>
52 160
               </view>
53
-              <text>约</text>
54
-              <text>20000/㎡</text>
161
+              <text></text>
162
+              <text>{current.price}</text>
55 163
             </view>
56
-            <text className='Address'>江宁禄口云熙99路号(诚信大道)</text>
164
+            <text className='Address'>{current.address}</text>
57 165
             <view className='Tag'>
58
-              <text>纯新盘</text>
59
-              <text>纯新盘</text>
60
-              <text>纯新盘</text>
166
+            {
167
+              (current.buildingTag || []).map((item, index) => (
168
+                <text key={`Tags-${index}`}>{item.tagName}</text>
169
+              ))
170
+            }
61 171
             </view>
62 172
             <view className='Views flex-h'>
63 173
               <view className='flex-item'>
64 174
                 <text className='iconfont icon-fenxiang'></text>
65
-                <text>3次分享</text>
175
+                <text>{`${current.shareNum||0}次分享`}</text>
66 176
               </view>
67 177
               <view className='Icons'>
68
-                <view>
69
-                  <Image mode='scaleToFill' src={null} className='centerLabel'></Image>
70
-                </view>
71
-                <view>
72
-                  <Image mode='scaleToFill' src={null} className='centerLabel'></Image>
73
-                </view>
74
-                <view>
75
-                  <Image mode='scaleToFill' src={null} className='centerLabel'></Image>
76
-                </view>
178
+                {
179
+                  (current.uvList?.records || []).slice(0, 3).map((item, index) => (
180
+                    <view key={`uv-${index}`}>
181
+                      <Image mode='scaleToFill' className='centerLabel' src={item.photoOravatar} />
182
+                    </view>
183
+                  ))
184
+                }
77 185
               </view>
78
-              <text>...9人围观</text>
186
+              <text>{`...${current.pvNum}人围观`}</text>
79 187
             </view>
80 188
           </view>
81 189
         </view>

+ 7
- 0
src/pages/index/findHouseFromMap/index.scss 查看文件

@@ -10,6 +10,11 @@
10 10
     overflow: hidden;
11 11
     z-index: 1;
12 12
     background: #eee;
13
+
14
+    map {
15
+      width: 100%;
16
+      height: 100%;
17
+    }
13 18
   }
14 19
   > .Location,
15 20
   > .Share {
@@ -22,6 +27,8 @@
22 27
     top: 30px;
23 28
     right: 30px;
24 29
     border-radius: 12px;
30
+    padding: 0;
31
+
25 32
     > text {
26 33
       display: block;
27 34
       text-align: center;

+ 5
- 14
src/pages/index/specialPriceHouse/index.jsx 查看文件

@@ -13,26 +13,17 @@ import './index.scss'
13 13
 
14 14
 const defaultRuleImage = 'https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/index-icon19.jpg'
15 15
 
16
-export default withLayout(() => {
16
+export default withLayout((props) => {
17
+  const { city } = props
17 18
   
18
-  const user = useSelector(state => state.user)
19 19
   const [PageList, setPageList] = useState([])
20 20
   const [IsPull, setPull] = useState(false)
21
-  const [PersonId, setPersonId] = useState(null)
22 21
   const [pageNumber, setPageNumber] = useState(1)
23 22
   const [HasNextPage, setHasNextPage] = useState(true)
24 23
 
25 24
   useEffect(() => {
26
-    if(user?.userInfo?.person?.personId) {
27
-      setPersonId(user.userInfo.person.personId)
28
-    }
29
-  }, [user])
30
-
31
-  useEffect(() => {
32
-    if(PersonId) {
33
-      GetPageList()
34
-    }
35
-  }, [pageNumber, PersonId])
25
+    GetPageList()
26
+  }, [pageNumber])
36 27
 
37 28
   const PageRefresh = () => { // 页面下拉刷新回调
38 29
     setPull(true)
@@ -40,7 +31,7 @@ export default withLayout(() => {
40 31
 
41 32
   const GetPageList = () => {
42 33
     setHasNextPage(false)
43
-    fetch({ url: API_SPECIAL_ROOM_LIST, method: 'get', payload: { pageNumber, pageSize: 10 } }).then((res) => {
34
+    fetch({ url: API_SPECIAL_ROOM_LIST, method: 'get', payload: { pageNumber, pageSize: 10, cityId: city?.id } }).then((res) => {
44 35
       setPageList(pageNumber === 1 ? res.records || [] : PageList.concat(res.records || []))
45 36
       setHasNextPage(res.current < res.pages)
46 37
       setPull(false)