export default {
methods: {
avigaToShop(item) {
let shop_latitude = item.latitude //目的地纬度
et shop_longtude = item.longitude //目的地经度
let shop_address = item.stationname //目的地地址
let current_latitude = this.latitude //当前纬度
let current_longitude = this.longitude //当前经度
var packageName = 'com.autonavi.minimap'
var main = plus.android.runtimeMainActivity()
var packageManager = main.getPackageManager()
var PackageManager = plus.android.importClass(packageManager)
var packageInfo = packageManager.getPackageInfo(
packageName,
PackageManager.GET_ACTIVITIES
)
if (packageInfo) {
var Uri = plus.android.importClass('android.net.Uri')
var url =
'amapuri://route/plan?sourceApplication=maxuslife' +
'&sid=A&slat=' +
current_latitude +
'&slon=' +
current_longitude +
'&sname=' +
current_address +
'&did=B&dlat=' +
shop_latitude +
'&dlon=' +
shop_longtude +
'&dname=' +
shop_address +
'D10&dev=0&t=0'
var Intent = plus.android.importClass('android.content.Intent')
var intent = new Intent()
intent.setAction(Intent.ACTION_VIEW)
intent.addCategory(Intent.CATEGORY_DEFAULT)
var uri = Uri.parse(url)
//将功能Scheme以URI的方式传入
intent.setData(uri)
intent.setPackage('com.autonavi.minimap')
var main = plus.android.runtimeMainActivity()
main.startActivity(intent)
} else {
uni.showToast({ icon: 'none', title: 未安装高德导航APP,请先安装
})
}
}
}
}