<block v-for="item in subList" :key="item.id">
<cover-view :class="{ 'sub-item': true, 'active': currentIndex == item.id }"
@click="handleSubItem(item)">
{{ item.name }}
</cover-view>
</block>
</cover-view>
</map>
//地图点位获取
const getlocaition = () => {
const params = {
longitude: mapInfor.latitude,
latitude: mapInfor.latitude,
// categoryId:catageryId.value
};
uni.showLoading()
queryLifrcycle(params).then(res => {
const marker = res.data.map((item) => {
return Object.assign({}, {
id: item.id,
joinCluster: true,
latitude: Number(item.latitude), //纬度
longitude: Number(item.longitude),//经度
iconPath: '../../static/icons/gift.png', //显示的图标
rotate: 100, // 旋转度数
width: 15, //宽
height: 15, //高
alpha: 0.5,
title: '',
callout: {//自定义标记点上方的气泡窗口 点击有效
content: item.name,//文本
markerId: item.id,
color: '#fff',//文字颜色
fontSize: 12,//文本大小
borderRadius: 15,//边框圆角
borderWidth: '10',
anchorX: 20,
anchorY: 10,
bgColor: '#4b96f3',//背景颜色
display: 'ALWAYS',//常显
},
})
})
setTimeout(_ => {
mapInfor.markers=[...marker];
},1000)
})
}
//点击标记点时触发
const markertap = (e) => {
console.log(e, '点击标记点')
emits('showPopup', true)
emits('customSkip', { currentIndex, currentId, detail: e.detail })
// proxy.$refs.popup.open();
}
//点击子级分类
const handleSubItem = (item) => {
catageryId.value = currentIndex.value = item.id
getlocaition()
}
0 个回复