h5唤醒手机拨号
index.html中添加
<meta name="format-detection" content="telephone=yes"/>
点击事件
window.location.href = 'tel:4000-000-000';
h5调用手机高德地图
https://lbs.amap.com/api/uri-api/gettingstarted
判断手机是ios还是安卓
let browser = {
versions: function () {
let u = navigator.userAgent,
app = navigator.appVersion;
return {
trident: u.indexOf('Trident') > -1, /*IE内核*/
presto: u.indexOf('Presto') > -1, /*opera内核*/
webKit: u.indexOf('AppleWebKit') > -1, /*苹果、谷歌内核*/
gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, /*火狐内核*/
mobile: !!u.match(/AppleWebKit.*Mobile.*/), /*是否为移动终端*/
ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), /*ios终端*/
// android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, /*android终端或者uc浏览器*/
android: u.indexOf('Android') > -1 || u.indexOf('Adr') > -1,
iPhone: u.indexOf('iPhone') > -1, /*是否为iPhone或者QQHD浏览器*/
iPad: u.indexOf('iPad') > -1, /*是否iPad*/
webApp: u.indexOf('Safari') == -1, /*是否web应该程序,没有头部与底部*/
souyue: u.indexOf('souyue') > -1,
superapp: u.indexOf('superapp') > -1,
weixin: u.toLowerCase().indexOf('micromessenger') > -1,
Safari: u.indexOf('Safari') > -1,
uc: u.indexOf('Linux') > -1
};
}(),
language: (navigator.browserLanguage || navigator.language).toLowerCase()
};
调用方式:
http://uri.amap.com/marker?position=lng,lat&name=address&coordinate=gaode&callnative=1
其中lat、lng、address分别为经纬度和详细地址三个参数,其中经纬度为必填参数,注意区别腾讯地图,此两者调用方式中经度和纬度的位置是相反的,高德地图URI API详细参数及说明可在高德开放平台找到:https://lbs.amap.com/api/uri-api/gettingstarted