This commit is contained in:
Iruka 2025-01-16 11:37:13 +08:00
parent b7bb7a4ef2
commit 9287a5f6c0

View File

@ -10,7 +10,7 @@
:change:mapType="leaflet.switchLayerEmitHandler" :centerPoint="mapObj.centerPoint"
:change:centerPoint="leaflet.centerPointEmitHandler" :landMap="mapObj.landMap"
:change:landMap="leaflet.drawEmitHandler" :davice="mapObj.davice" :change:davice="leaflet.markerEmitHandler"
:updateMarker="mapObj.updateMarker" :change:updateMarker="leaflet.updateMarkerEmitHandler">
:updateMarker="mapObj.updateMarker" :change:updateMarker="leaflet.updateMarkerEmitHandler"
</view>
<!-- 工具 -->
@ -23,6 +23,9 @@
<view @click="mapToCenterPoint">
<i class="iconfont icon-dingwei"></i>
</view>
<view @click="navigation">
<i class="iconfont icon-luxian"></i>
</view>
</view>
<view class="tdt">
<image src="../static/images/map/logo.png"></image>GS20240568 - 甲测资字1100471
@ -125,7 +128,7 @@
</view>
<view class="control" v-if="dc.dataObj[pop.item.dataKey]">
<u-row v-if="pop.item.device.deviceTypeKey == 'station'">
基站
<image :src="valveImg.jz" mode="widthFix" />
</u-row>
<u-row v-else-if="pop.item.device.deviceTypeKey == 'valve'">
<u-col span="3">
@ -381,6 +384,7 @@
未知的设备
</u-row>
</view>
<view v-if="pop.item.type != 'jz'">
<view class="expand5" @click="pop.showbox = !pop.showbox">
<view class="icon">
<view class="iconfont icon-jt-b"></view>
@ -437,6 +441,7 @@
</view>
</view>
</view>
</view>
</u-popup>
<!-- 地块选择 -->
@ -450,6 +455,8 @@
<custom-index-mp ref="mpRef" />
</template>
<script>
import config from '@/config.js'
const appInfo = config.appInfo;
import store from "@/store"
import {
timestampFormat
@ -461,6 +468,14 @@
import {
getOtherDevice
} from "@/api/system/controlOtherInterface"
//
import {
requestPermissions
} from "@/js_sdk/yu-app-permission/yu-app-permission.js"
// IOS
import {
goSetting
} from "@/js_sdk/yu-app-permission/yu-app-permission.js"
export default {
data() {
@ -683,6 +698,40 @@
//
mapToCenterPoint() {
this.mapObj.centerPoint++;
},
//
navigation() {
this.$showConfirm(`导航至"${this.title}"`).then(res => {
if (res.confirm) {
const centerPoint = JSON.parse(this.mapObj.landMap.centerPoint);
const lat = centerPoint[1]
const lng = centerPoint[0]
let url = '';
const appName = appInfo.name; //
const name = this.title; //
//
if (uni.getSystemInfoSync().platform === 'android') { // Android
url =
`androidamap://route/plan/?sourceApplication=${appName}&sid=BGVIS1&did=BGVIS2&dlat=${lat}&dlon=${lng}&dname=${encodeURIComponent(name)}&mode=driving`;
// `androidamap://route/plan/?sourceApplication=${appName}&sid=BGVIS1&did=BGVIS2&dlat=${lat}&dlon=${lng}&mode=driving`;
} else if (uni.getSystemInfoSync().platform === 'ios') { // iOS
url = `iosamap://path?sourceApplication=${appName}&mldl=${lat},${lng}`;
}
// // modedrivingwalkingtransit
// url = `baidumap://map/direction?destination=latlng:${lat},${lng}|name:${encodeURIComponent(name)}&mode=driving`;
//
plus.runtime.openURL(url, function(err) {
uni.showToast({
title: '未安装应用',
icon: 'none'
});
});
}
});
},
toNavigation() {
},
//
mapUpdateMarker(e) {
@ -720,6 +769,8 @@
break;
case 'sfj':
case 'sb':
this.$showConfirm("确定打开首部设备?").then(res => {
if (res.confirm) {
uni.showLoading()
getHeadDevice(e.device.deviceId).then((res) => {
uni.hideLoading()
@ -739,12 +790,17 @@
});
}
});
}
})
break;
case 'qxz':
case 'bc':
case 'bz':
case 'sxt':
case 'scd':
this.$showConfirm("确定打开农情设备?").then(res => {
if (res.confirm) {
uni.showLoading()
getOtherDevice(e.device.deviceId).then((res) => {
uni.hideLoading()
@ -772,6 +828,8 @@
});
}
});
}
});
break;
case 'sq':
this.$refs.mpRef.show(this.ijs.land, e.device.id);