Browse Source

数据错位

傅行帆 5 years ago
parent
commit
61479a8563

+ 1
- 1
src/pages/project/detail/Around/Tab.js View File

@@ -6,7 +6,7 @@ export default function Tab(props) {
6 6
   
7 7
   const [current, setCurrent] = useState(props.default || 0)
8 8
   
9
-  const tabList = props.dataset ? props.dataset.filter(x => x.num) : []
9
+  const tabList = props.dataset ? props.dataset : []
10 10
   
11 11
   const handleClick = index => () => {
12 12
     setCurrent(index)

+ 2
- 4
src/pages/project/detail/Around/index.js View File

@@ -7,7 +7,7 @@ import './style.scss'
7 7
 
8 8
 export default function Around(props) {
9 9
   const detail = props.building || {}
10
-  console.log(detail,"detaildetaildetaildetail")
10
+  
11 11
   const [lat, lng] = (detail.coordinate || '').split(',')
12 12
   const poiDatas = detail.mapJson ? JSON.parse(detail.mapJson) : []
13 13
   const ty = Object.prototype.toString
@@ -17,15 +17,13 @@ export default function Around(props) {
17 17
     const key = item.key
18 18
     const manualData = (detail[`building${key}`] === '' ? [] : detail[`building${key}`].split(','))
19 19
     
20
-    console.log(manualData,"manualDatamanualData")
21 20
     return {
22 21
       ...item,
23 22
       manualData,
24 23
       num: (ty.call(item.data) === '[object String]' ? JSON.parse(item.data) : []).length + manualData.length,
25 24
     }
26
-  })
25
+  }).filter(x => x.num)
27 26
 
28
-  
29 27
   // 所有的 markers
30 28
   const markersList = dataList.map((item) => {
31 29
     const mapJson = JSON.parse(item.data)