张延森 3 yıl önce
ebeveyn
işleme
6253ee40ee

BIN
src/assets/logo.png Dosyayı Görüntüle


+ 1
- 1
src/components/Loading/index.jsx Dosyayı Görüntüle

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

+ 2
- 0
src/components/Loading/style.scss Dosyayı Görüntüle

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

+ 2
- 1
src/components/ProjectListItem/index.jsx Dosyayı Görüntüle

3
 import '@/assets/css/iconfont.css'
3
 import '@/assets/css/iconfont.css'
4
 import Taro from '@tarojs/taro'
4
 import Taro from '@tarojs/taro'
5
 import { Image } from '@tarojs/components'
5
 import { Image } from '@tarojs/components'
6
+import { getImgURL } from '@/utils/image'
6
 
7
 
7
 export default function ProjectListItem (props) {
8
 export default function ProjectListItem (props) {
8
   const { Data = {} } = props
9
   const { Data = {} } = props
11
     <view className='components ProjectListItem flex-h' onClick={() => {Taro.navigateTo({ url: `/pages/index/buildingDetail/index?id=${Data.buildingId}` })}}>
12
     <view className='components ProjectListItem flex-h' onClick={() => {Taro.navigateTo({ url: `/pages/index/buildingDetail/index?id=${Data.buildingId}` })}}>
12
       <view className='Img'>
13
       <view className='Img'>
13
         <view>
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
         </view>
16
         </view>
16
       </view>
17
       </view>
17
       <view className='flex-item'>
18
       <view className='flex-item'>

+ 1
- 1
src/pages/index/activityDetail/index.jsx Dosyayı Görüntüle

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

+ 2
- 0
src/pages/index/activityDetail/index.scss Dosyayı Görüntüle

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

+ 2
- 2
src/pages/index/buildingDetail/components/DetailBottom/index.jsx Dosyayı Görüntüle

66
     if (Info.buildingId) {
66
     if (Info.buildingId) {
67
       // 请求看房活动
67
       // 请求看房活动
68
       queryActivityList({ buildingId: Info.buildingId, pageSize: 1, type: 'look' }).then((res) => {
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
   }, [Info.buildingId])
75
   }, [Info.buildingId])

+ 3
- 3
src/pages/index/buildingDetail/components/MarketingActivity/index.jsx Dosyayı Görüntüle

18
   useEffect(() => {
18
   useEffect(() => {
19
     if (buildingId) {
19
     if (buildingId) {
20
       queryActivityList({ buildingId, pageSize: 500, type: 'house' }).then((res) => {
20
       queryActivityList({ buildingId, pageSize: 500, type: 'house' }).then((res) => {
21
-        const { list } = res || {}
21
+        const { records } = res || {}
22
         
22
         
23
         // 只保留3场在进行中的活动
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
   }, [buildingId])
27
   }, [buildingId])
44
               dataList.map((item, index) => (
44
               dataList.map((item, index) => (
45
                 <SwiperItem key={`Banner-${index}`}>
45
                 <SwiperItem key={`Banner-${index}`}>
46
                   <view className='swiper-item' onClick={() => goDetail(item.dynamicId)}>
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
                   </view>
48
                   </view>
49
                 </SwiperItem>
49
                 </SwiperItem>
50
               ))
50
               ))

+ 8
- 11
src/pages/index/buildingDetail/components/Periphery/index.jsx Dosyayı Görüntüle

46
         longitude: loc[0],
46
         longitude: loc[0],
47
         latitude: loc[1],
47
         latitude: loc[1],
48
         iconPath: '',
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
           display: 'ALWAYS',
55
           display: 'ALWAYS',
55
         }
56
         }
56
       })
57
       })
81
         <view>
82
         <view>
82
           <Map
83
           <Map
83
             id='poi-around'
84
             id='poi-around'
84
-            show-location
85
+            // show-location
85
             scale={12}
86
             scale={12}
86
             markers={markers}
87
             markers={markers}
87
             longitude={loc[0]}
88
             longitude={loc[0]}
88
             latitude={loc[1]}
89
             latitude={loc[1]}
89
             // enable-enableScroll
90
             // enable-enableScroll
90
             // enable-zoom
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
         </view>
93
         </view>
97
       </view>
94
       </view>
98
 
95
 

+ 142
- 34
src/pages/index/findHouseFromMap/index.jsx Dosyayı Görüntüle

1
-import { useState } from 'react'
1
+import { useEffect, useRef, useState } from 'react'
2
+import Taro from '@tarojs/taro'
2
 import withLayout from '@/layout'
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
 import '@/assets/css/iconfont.css'
7
 import '@/assets/css/iconfont.css'
5
 import './index.scss'
8
 import './index.scss'
6
 
9
 
7
-export default withLayout(() => {
10
+export default withLayout((props) => {
11
+  const { city } = props
8
 
12
 
9
   const [ShowInfo, setShowInfo] = useState(false)
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
   return (
116
   return (
18
     <view className='Page findHouseFromMap'>
117
     <view className='Page findHouseFromMap'>
19
 
118
 
20
       {/* 地图 */}
119
       {/* 地图 */}
21
       <view className='MapContainer'>
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
       </view>
131
       </view>
24
 
132
 
25
       {/* 定位 */}
133
       {/* 定位 */}
26
-      <view className='Location'>
134
+      <view className='Location' onClick={changeCity}>
27
         <text className='iconfont icon-dingwei'></text>
135
         <text className='iconfont icon-dingwei'></text>
28
-        <text>南京市</text>
136
+        <text>{city.name}</text>
29
       </view>
137
       </view>
30
 
138
 
31
       {/* 分享 */}
139
       {/* 分享 */}
32
-      <view className='Share'>
140
+      <button className='Share' openType='share'>
33
         <text className='iconfont icon-fenxiang'></text>
141
         <text className='iconfont icon-fenxiang'></text>
34
-        <text>分享</text>
35
-      </view>
142
+        <text>分 享</text>
143
+      </button>
36
 
144
 
37
       {/* 附近楼盘 */}
145
       {/* 附近楼盘 */}
38
       <view className={ShowInfo ? 'AroundBuilding active' : 'AroundBuilding'}>
146
       <view className={ShowInfo ? 'AroundBuilding active' : 'AroundBuilding'}>
39
-        <view className='Go'>
147
+        <view className='Go' onClick={locationTo}>
40
           <text>立即</text>
148
           <text>立即</text>
41
           <text>前往</text>
149
           <text>前往</text>
42
         </view>
150
         </view>
43
         <view className='InfoContainer'>
151
         <view className='InfoContainer'>
44
-          <text className='Title' onClick={CutInfo(true)}>附近楼盘</text>
152
+          {/* <text className='Title' onClick={CutInfo(true)}>附近楼盘</text> */}
45
           <view className='InfoContent'>
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
             </view>
156
             </view>
49
             <view className='Name flex-h'>
157
             <view className='Name flex-h'>
50
               <view className='flex-item'>
158
               <view className='flex-item'>
51
-                <text>奥园金基天著尚居</text>
159
+                <text>{current.buildingName}</text>
52
               </view>
160
               </view>
53
-              <text>约</text>
54
-              <text>20000/㎡</text>
161
+              <text></text>
162
+              <text>{current.price}</text>
55
             </view>
163
             </view>
56
-            <text className='Address'>江宁禄口云熙99路号(诚信大道)</text>
164
+            <text className='Address'>{current.address}</text>
57
             <view className='Tag'>
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
             </view>
171
             </view>
62
             <view className='Views flex-h'>
172
             <view className='Views flex-h'>
63
               <view className='flex-item'>
173
               <view className='flex-item'>
64
                 <text className='iconfont icon-fenxiang'></text>
174
                 <text className='iconfont icon-fenxiang'></text>
65
-                <text>3次分享</text>
175
+                <text>{`${current.shareNum||0}次分享`}</text>
66
               </view>
176
               </view>
67
               <view className='Icons'>
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
               </view>
185
               </view>
78
-              <text>...9人围观</text>
186
+              <text>{`...${current.pvNum}人围观`}</text>
79
             </view>
187
             </view>
80
           </view>
188
           </view>
81
         </view>
189
         </view>

+ 7
- 0
src/pages/index/findHouseFromMap/index.scss Dosyayı Görüntüle

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

+ 5
- 14
src/pages/index/specialPriceHouse/index.jsx Dosyayı Görüntüle

13
 
13
 
14
 const defaultRuleImage = 'https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/index-icon19.jpg'
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
   const [PageList, setPageList] = useState([])
19
   const [PageList, setPageList] = useState([])
20
   const [IsPull, setPull] = useState(false)
20
   const [IsPull, setPull] = useState(false)
21
-  const [PersonId, setPersonId] = useState(null)
22
   const [pageNumber, setPageNumber] = useState(1)
21
   const [pageNumber, setPageNumber] = useState(1)
23
   const [HasNextPage, setHasNextPage] = useState(true)
22
   const [HasNextPage, setHasNextPage] = useState(true)
24
 
23
 
25
   useEffect(() => {
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
   const PageRefresh = () => { // 页面下拉刷新回调
28
   const PageRefresh = () => { // 页面下拉刷新回调
38
     setPull(true)
29
     setPull(true)
40
 
31
 
41
   const GetPageList = () => {
32
   const GetPageList = () => {
42
     setHasNextPage(false)
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
       setPageList(pageNumber === 1 ? res.records || [] : PageList.concat(res.records || []))
35
       setPageList(pageNumber === 1 ? res.records || [] : PageList.concat(res.records || []))
45
       setHasNextPage(res.current < res.pages)
36
       setHasNextPage(res.current < res.pages)
46
       setPull(false)
37
       setPull(false)