uni-app内置应用拨打电话与地图

uni-app内置应用拨打电话与地图

地图(map)

  • longitude经度
  • latitude纬度
  • markers标记点数组
  • scale图标缩放

一般地址写公司地址是写死的,通过百度地图搜索然后赋值经纬度是随便写的

//map标签就是内置地图 longitude经度 latitude纬度 markers标记点
<map :longitude="longitude" :latitude="latitude" :scale="scale" :markers="markers"></map>
data(){
    
    
	return{
    
    
		longitude:数值,
		latitude:数值,
		scale:number,
		markers:[
			{
    
    
				longitude:数值,
				latitude:数值,
				iconPath:路径 //标记点显示的图标
				width:number,
				height:number,	
			}
		]
	}
}

拨打电话(uni.makePhoneCall())

  • phoneNumber调用手机拨打电话的功能
//首先定义一个拨打电话的方法
<view @click="phone"></view>

methods:{
    
    
	phone(){
    
    
		uni.makePhoneCall({
    
    
			phoneNumber:'电话号码'
		})
	}
}

猜你喜欢

转载自blog.csdn.net/weixin_48255917/article/details/110223218
今日推荐