当前位置: 首页 > news >正文

牙科医院网站源码外贸seo

牙科医院网站源码,外贸seo,如何上传网页到网站,新建网站seo优化怎么做uniapp 调用手机上安装的app (高德地图 百度地图 Apple地图 谷歌地图) 效果 思路 获取手机类型(安卓/iOS)let platform uni.getSystemInfoSync().platform判断手机有没有安装需要的应用plus.runtime.isApplicationExist({action: ""}))打开应用 跳转过去plus.runt…

uniapp 调用手机上安装的app (高德地图 百度地图 Apple地图 谷歌地图)

效果

效果图

思路

  1. 获取手机类型(安卓/iOS)
    let platform = uni.getSystemInfoSync().platform
    
  2. 判断手机有没有安装需要的应用
    plus.runtime.isApplicationExist({action: ""}))
    
  3. 打开应用 跳转过去
    plus.runtime.openURL()
    

核心代码

<view slot="value" class="u-slot-title" @click="goMap"><u--image :src="goMapImgSrc" width="18px" height="20px"></u--image>
</view>
data() {return {latitude: 23.763780,longitude: -45.831800,shopAddress: "XXXXXXXXXXX",}}goMap() {const _this = thisif (!this.latitude || !this.longitude || !this.shopAddress) return// 判断系统安装的地图应用有哪些, 并生成菜单按钮let _mapName = [{title: this.$t('my.order.Gaode Maps'),name: 'amap',androidName: 'com.autonavi.minimap',iosName: 'iosamap://'},{title: this.$t('my.order.Baidu Maps'),name: 'baidumap',androidName: 'com.baidu.BaiduMap',iosName: 'baidumap://'}{title: this.$t('my.order.Google Maps'),name: 'googlemap',androidName: 'com.google.android.apps.maps',iosName: 'comgooglemaps://'},{title: this.$t('my.order.Apple Maps'),name: 'applemap',androidName: 'com.apple.Maps',iosName: 'maps://'},]// 根据真机安装的地图软件 生成操作菜单let buttons = []let platform = uni.getSystemInfoSync().platformplatform === 'android' && _mapName.forEach(item => {if (plus.runtime.isApplicationExist({pname: item.androidName})) {buttons.push(item)}})platform === 'ios' && _mapName.forEach(item => {console.log(item)if (plus.runtime.isApplicationExist({action: item.iosName})) {buttons.push(item)}})if (buttons.length) {plus.nativeUI.actionSheet({ //选择菜单title: this.$t('my.order.select'),cancel: this.$t('pages.predetermine.predetermine.Cancel'),buttons: buttons}, function(e) {let _map = buttons[e.index - 1]_this.openURL(_map, platform)})} else {uni.showToast({title: '请安装地图软件',icon: 'none'})return}
},
// 打开第三方应用
openURL(map, platform) {console.log(map, platform);let _defaultUrl = {android: {"amap": `amapuri://route/plan/?sid=&did=&dlat=${this.latitude}&dlon=${this.longitude}&dname=${this.shopAddress}&dev=0&t=0`,'baidumap': `baidumap://map/direction?origin=${this.latitude},${this.longitude}&destination=name:${this.shopAddress}|latlng:${this.latitude},${this.longitude}&coord_type=wgs84&mode=driving&src=andr.baidu.openAPIdemo"`,'googlemap': `geo: + ${this.latitude} + ',' + ${this.longitude} + '?q=' + encodeURIComponent(${this.shopAddress})`},ios: {"amap": `iosamap://path?sourceApplication=fuxishan_uni_client&dlat=${this.latitude}&dlon=${this.longitude}&dname=${this.shopAddress}&dev=0&t=0`,'baidumap': `baidumap://map/direction?origin=${this.latitude},${this.longitude}&destination=name:${this.shopAddress}|latlng:${this.latitude},${this.longitude}&mode=driving&src=ios.baidu.openAPIdemo`,'googlemap': `comgooglemaps://?q=${this.shopAddress}`,'applemap': `maps://?q=${this.shopAddress}&sll=${this.latitude}+ ',' + ${this.longitude}&z=10&t=s`}}let newurl = encodeURI(_defaultUrl[platform][map.name]);plus.runtime.openURL(newurl, function(res) {uni.showModal({content: res.message})}, map.androidName ? map.androidName : '');
},

重点

要是需要打开谷歌地图的话, 需要在manifest.json中配置应用访问白名单
步骤
uniapp为了方便开发者调用一些常用的第三方应用,云端打包时默认已经一部分白名单但不包含谷歌地图,所以需要单独添加一下

http://www.hkea.cn/news/462967/

相关文章:

  • 菏泽网站建设哪好怎样做平台推广
  • 网上有做logo的网站吗网络营销的核心是什么
  • 自建网站怎么做推广微信营销策略
  • 跳网站查询的二维码怎么做的关键词排名点击软件网站
  • 兼容手机的网站百度怎么推广自己的视频
  • 宝安中心医院入职体检跟我学seo
  • 企业网站后端模板石家庄疫情最新情况
  • 沈阳哪家网站做的好网络营销是指什么
  • 我的网站模板网站建设主要推广方式
  • 国外app素材网站seo运营是做什么的
  • 企业网站seo怎么做百度帐号个人中心
  • 郑州网站建设亅汉狮网络百度网盘seo优化
  • 模板型网站seo优化平台
  • 官方网站下载免费软件培训机构有哪些?哪个比较好
  • 网站导航怎么做的惠州seo计费管理
  • 建设公司网站模板全国唯一一个没有疫情的城市
  • 网站怎么做seo_南京百度提升优化
  • 旅游网站开发与设计论文怎么样建网站
  • 北京网站推广排名公司企业网站的搜索引擎推广与优化
  • 动态网站期末设计广告营销策略
  • 山东网站营销推广费用旺道seo推广
  • 邢台网站建设服务周到百度数据分析工具
  • 周口网站建设竞价恶意点击犯法吗
  • 网站建设没有预付款seo快速提升排名
  • 网站开发者的设计构想网络推广平台软件
  • 做立体字的网站重庆seo公司排名
  • 电子商务网站的建设包含哪些流程搜索引擎关键词怎么优化
  • 将自己做的网站发布到谷歌推广新手教程
  • 深圳保障性住房管理办法seo排名优化方法
  • 2022注册公司取名推荐网络营销的优化和推广方式