|
@@ -99,6 +99,37 @@ export default withLayout((props) => {
|
99
|
99
|
setDetailInfo(res || {})
|
100
|
100
|
if (res.mapJson) {
|
101
|
101
|
const pois = JSON.parse(res.mapJson).map(poi => ({ ...poi, data: JSON.parse(poi.data) }))
|
|
102
|
+ pois.map((item) => {
|
|
103
|
+ let target = []
|
|
104
|
+ if(item.key === 'Transport') {
|
|
105
|
+ target = (res.buildingTransport || '').split(',').map((subItem) => {
|
|
106
|
+ return { name: subItem }
|
|
107
|
+ })
|
|
108
|
+ } else if(item.key === 'Mall') {
|
|
109
|
+ target = (res.buildingMall || '').split(',').map((subItem) => {
|
|
110
|
+ return { name: subItem }
|
|
111
|
+ })
|
|
112
|
+ } else if(item.key === 'Edu') {
|
|
113
|
+ target = (res.buildingEdu || '').split(',').map((subItem) => {
|
|
114
|
+ return { name: subItem }
|
|
115
|
+ })
|
|
116
|
+ } else if(item.key === 'Hospital') {
|
|
117
|
+ target = (res.buildingHospital || '').split(',').map((subItem) => {
|
|
118
|
+ return { name: subItem }
|
|
119
|
+ })
|
|
120
|
+ } else if(item.key === 'Bank') {
|
|
121
|
+ target = (res.buildingBank || '').split(',').map((subItem) => {
|
|
122
|
+ return { name: subItem }
|
|
123
|
+ })
|
|
124
|
+ } else if(item.key === 'Restaurant') {
|
|
125
|
+ target = (res.buildingRestaurant || '').split(',').map((subItem) => {
|
|
126
|
+ return { name: subItem }
|
|
127
|
+ })
|
|
128
|
+ }
|
|
129
|
+ item.data = item.data.concat(target)
|
|
130
|
+ })
|
|
131
|
+ console.log(`pois is`, pois)
|
|
132
|
+ console.log(res)
|
102
|
133
|
setNavList(pois)
|
103
|
134
|
}
|
104
|
135
|
|