效果展示 内置地图map
主要属性设置- 看代码
<map :latitude="allPositionDate.company.latitude"
:longitude="allPositionDate.company.longitude"
:markers="markers" class='mapv'
:enable-scroll="false" :enable-zoom="false"
@tap="jumpMap(allPositionDate.company.latitude, allPositionDate.company.longitude )"
>
</map>
属性名 | 属性类型 | 是否必填 | 属性说明 |
---|---|---|---|
longitude | number | 是 | 中心经度 |
latitude | number | 是 | 中心纬度 |
markers | Array | 否 | 标记点就是一个一个的标记点 |
enable-scroll | boolean | 否 | 是否支持滚动 |
enable-zoom | boolean | 否 | 是否支持缩放 |
data() {
return {
maskShow: false, //遮罩层是否显示
callShow: false, //电话弹窗的控制
resHaveShow: false, //已经有简历的弹窗
resNoneShow: false, //没有简历的弹窗
sendResume: false, //上传简历弹窗
//记录简历是否被选中的索引 没用循环 写6个效果
num: null,
currentIndex: null, //接受简历的Id
//默认有
isHaveRes: true, //
allPositionDate: [], //主页主要内容的数据
resumeList: [], // 主人简历列表的数据
positionCity: [], // 投递城市的数据
resume_id: null, //投递简历参数简历id---在点击简历列表的时候赋值
address_ids: [], //投递简历参数城市id---在点击城市列表的时候变成数组,最后在提交之前变成,
position_id: null ,//岗位id
detail_id: null, // 详情页面id 用于给确定用户留言上传的时候需要传入的id
webUrls_data: "",
markers: [], -------------------------》设置数组
}
},
/**
* 创建marker对象的方法 ---为什么要写一个方法, 因为可能又很多这样的小点点
*/
createMarker(point) {
let marker = {
iconPath: `${this.webUrls}/image/positionDetail/map.png`, //地图上的图标可以写网络路径
id: point.id || 0,
name: point.address || '',
latitude: point.latitude,
longitude: point.longitude,
width: 20,
height: 20,
callout: {
content: `${point.address}`,
color: "#333333",
fontSize: 13,
borderRadius: 20,
bgColor: "#ffffff",
textAlign: "center" ,
padding: 10,
display: 'ALWAYS'
}
};
return marker;
},
//请求数据咯、
getPositionDate(id) {
const _this = this
const positionDate = sign()
uni.request({
url: "https://zp.xxnmkj.cn/api/Index/positionInfo",
method: "GET",
data: {
time: positionDate.time,
salt: positionDate.salt,
checkCode: positionDate.checkCode,
token: positionDate.token,
tokenType: "XXC",
id: id
},
success: (res) => {
if (res.data.code !== 2000) {
uni.showToast({
title: '网络繁忙,请稍后重试',
icon: "none",
mask: true
})
} else {
console.log(res.data.data)
_this.allPositionDate = res.data.data
_this.position_id = res.data.data.id //岗位id
let masker = _this.createMarker(res.data.data.company)------》赋值
_this.markers.push(masker)
}
}
})
},