From 6f83e8078c222c2b3fffaf3d6d66fd097f92d6bb Mon Sep 17 00:00:00 2001
From: 18650502300 <18650502300@163.com>
Date: Thu, 20 Jun 2024 15:09:30 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/system/device.js | 6 +-
src/components/Map/location/LocationMap.vue | 39 +++++-
src/views/system/device/index.vue | 12 +-
src/views/system/fee/index.vue | 39 ++++--
src/views/system/order/index.vue | 145 +++++++++++++++++++-
src/views/system/refund/index.vue | 61 +-------
src/views/user/user/index.vue | 32 ++++-
7 files changed, 249 insertions(+), 85 deletions(-)
diff --git a/src/api/system/device.js b/src/api/system/device.js
index 5d32769..8ac2fe7 100644
--- a/src/api/system/device.js
+++ b/src/api/system/device.js
@@ -54,7 +54,7 @@ export function allDevice() {
// 开锁
export function handleUnlocking(data){
return request({
- url: '/appVerify/admin/unlocking?sn='+data.sn,
+ url: '/system/device/admin/unlockingByMac?mac='+data.mac,
method: 'post'
})
}
@@ -62,7 +62,7 @@ export function handleUnlocking(data){
// 关锁
export function handleLock(data){
return request({
- url: '/appVerify/admin/lock?sn='+data.sn,
+ url: '/system/device/admin/lockByMac?mac='+data.mac,
method: 'post'
})
}
@@ -70,7 +70,7 @@ export function handleLock(data){
// 响铃寻车
export function ring(data){
return request({
- url: '/app/device/ring?sn='+data.sn,
+ url: '/app/device/ringByMac?mac='+data.mac,
method: 'post'
})
}
diff --git a/src/components/Map/location/LocationMap.vue b/src/components/Map/location/LocationMap.vue
index e8f4559..8a3dc24 100644
--- a/src/components/Map/location/LocationMap.vue
+++ b/src/components/Map/location/LocationMap.vue
@@ -40,11 +40,19 @@ export default {
},
initLng: {
type: String,
- default: 120.250452
+ default: '120.250452'
},
initLat: {
type: String,
- default: 27.101745
+ default: '27.101745'
+ },
+ status: {
+ type: String,
+ default: '0'
+ },
+ onlineStatus: {
+ type: String,
+ default: '0'
},
},
data() {
@@ -115,7 +123,8 @@ export default {
this.getGeoAddress(this.initLng, this.initLat).then(res => {
// 标点
this.removeAllMarker();
- this.addMarker(this.initLng, this.initLat, res.regeocode.formattedAddress);
+ console.log("添加标记点")
+ this.addMarker(this.initLng, this.initLat, res.regeocode.formattedAddress, this.status, this.onlineStatus);
this.$emit('map-geo', res, this.initLng, this.initLat);
// 地区
@@ -129,16 +138,38 @@ export default {
})
}
},
- addMarker(lng, lat, title) {
+ addMarker(lng, lat, title,status,onlineStatus) {
//创建一个 Marker 实例:
let marker = new AMap.Marker({
position: new AMap.LngLat(lng, lat), //经纬度对象
+ icon: this.formarStatus(status,onlineStatus),
title: title,
});
//将创建的点标记添加到已有的地图实例:
this.map.add(marker);
this.markers.push(marker);
},
+ formarStatus(status,onlineStatus){
+ if(onlineStatus == "0"){
+ return globalConfig.icon.red;
+ }else{
+ if(status == "0"){
+ return globalConfig.icon.gray;
+ }else if(status == "1"){
+ return globalConfig.icon.blue;
+ }else if(status == "2"){
+ return globalConfig.icon.yellow;
+ }else if(status == "3"){
+ return globalConfig.icon.yellow;
+ }else if(status == "4"){
+ return globalConfig.icon.light_blue;
+ }else if(status == "8"){
+ return globalConfig.icon.gray;
+ }else if(status == "9"){
+ return globalConfig.icon.gray;
+ }
+ }
+ },
// 删除所有的标记点
removeAllMarker() {
this.map.remove(this.markers);
diff --git a/src/views/system/device/index.vue b/src/views/system/device/index.vue
index 9ed6750..0a27717 100644
--- a/src/views/system/device/index.vue
+++ b/src/views/system/device/index.vue
@@ -302,7 +302,15 @@