|
|
@@ -6,13 +6,13 @@
|
|
|
{{ dataSource.devName }}
|
|
|
</view> </block
|
|
|
><view slot="right">
|
|
|
- <view class="ntoNative" @tap="toNavigation">
|
|
|
+ <!-- <view class="ntoNative" @tap="toNavigation">
|
|
|
<image :src="location" class="icon"></image>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
</view>
|
|
|
</custom-card>
|
|
|
<view class="greenhouse-top">
|
|
|
- <device-card :dataSource="dataSource" />
|
|
|
+ <device-card :dataSource="dataSource" @navigation="toNavigation" />
|
|
|
</view>
|
|
|
<view class="greenhouse-bottom">
|
|
|
<!-- <Element /> -->
|
|
|
@@ -161,37 +161,46 @@ export default {
|
|
|
this.dataSource.devLngalign || this.dataSource.devLng;
|
|
|
const roundedLatitude =
|
|
|
this.dataSource.devLatalign || this.dataSource.devLat;
|
|
|
- if (!roundedLongitude) {
|
|
|
- uni.showToast({
|
|
|
- title: '当前设备无定位信息',
|
|
|
- icon: 'none',
|
|
|
- duration: 3000,
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
- if (
|
|
|
- plus.runtime.isApplicationExist({
|
|
|
- pname: 'com.autonavi.minimap',
|
|
|
- action: 'iosamap://',
|
|
|
- })
|
|
|
- ) {
|
|
|
- let url = `amapuri://route/plan?sourceApplication=yourAppName&dlat=${roundedLatitude}&dlon=${roundedLongitude}&dev=0&t=0&style=0&start=&auto=1&rtdType=1&coordinate=wgs84`;
|
|
|
- plus.runtime.openURL(url);
|
|
|
- } else if (
|
|
|
- plus.runtime.isApplicationExist({
|
|
|
- pname: 'com.baidu.BaiduMap',
|
|
|
- action: 'baidumap://',
|
|
|
- })
|
|
|
- ) {
|
|
|
- let url = `baidumap://map/direction?destination=${roundedLongitude},${roundedLatitude}&mode=navigation&output=html&coord_type=wgs84`;
|
|
|
- plus.runtime.openURL(url);
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- title: '当前未安装 高德地图或百度地图 无法导航',
|
|
|
- icon: 'none',
|
|
|
- duration: 3000,
|
|
|
- });
|
|
|
- }
|
|
|
+ uni.openLocation({
|
|
|
+ latitude: Number(roundedLatitude || 0),
|
|
|
+ longitude: Number(roundedLongitude || 0),
|
|
|
+ name: '',
|
|
|
+ address: '',
|
|
|
+ scale: 18, // 地图缩放级别
|
|
|
+ success: () => console.log('导航启动成功'),
|
|
|
+ fail: (err) => console.error('导航失败:', err),
|
|
|
+ });
|
|
|
+ // if (!roundedLongitude) {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: '当前设备无定位信息',
|
|
|
+ // icon: 'none',
|
|
|
+ // duration: 3000,
|
|
|
+ // });
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // if (
|
|
|
+ // plus.runtime.isApplicationExist({
|
|
|
+ // pname: 'com.autonavi.minimap',
|
|
|
+ // action: 'iosamap://',
|
|
|
+ // })
|
|
|
+ // ) {
|
|
|
+ // let url = `amapuri://route/plan?sourceApplication=yourAppName&dlat=${roundedLatitude}&dlon=${roundedLongitude}&dev=0&t=0&style=0&start=&auto=1&rtdType=1&coordinate=wgs84`;
|
|
|
+ // plus.runtime.openURL(url);
|
|
|
+ // } else if (
|
|
|
+ // plus.runtime.isApplicationExist({
|
|
|
+ // pname: 'com.baidu.BaiduMap',
|
|
|
+ // action: 'baidumap://',
|
|
|
+ // })
|
|
|
+ // ) {
|
|
|
+ // let url = `baidumap://map/direction?destination=${roundedLongitude},${roundedLatitude}&mode=navigation&output=html&coord_type=wgs84`;
|
|
|
+ // plus.runtime.openURL(url);
|
|
|
+ // } else {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: '当前未安装 高德地图或百度地图 无法导航',
|
|
|
+ // icon: 'none',
|
|
|
+ // duration: 3000,
|
|
|
+ // });
|
|
|
+ // }
|
|
|
},
|
|
|
// 获取卷膜设备列表
|
|
|
async getDpdevicedpkzgjuanmoList(tf) {
|