车辆信息
This commit is contained in:
parent
ca4fb5cd88
commit
777d6a8ba4
@ -1,6 +1,6 @@
|
|||||||
const config = {
|
const config = {
|
||||||
//apiUrl: "http://192.168.2.156:10010/",
|
apiUrl: "http://192.168.2.156:10010/",
|
||||||
apiUrl: "https://www.cdzhuojing.cn/",
|
//apiUrl: "https://www.cdzhuojing.cn/",
|
||||||
cdnPath: "/",
|
cdnPath: "/",
|
||||||
ERR_OK: 200,
|
ERR_OK: 200,
|
||||||
sm2PublicKey: "04f5084ee12767d932f293508e30e3b0100185042ec0f061dedaf92b793b93f79fd6179d5e47e25b7aec98e00cf90dd56df1f8191012537187e7bbfd2d1de299fc", //f8209a2ebe6691e41e1f2b667bfe71f0b511716cc0f7c4452502fc12ec3957e4
|
sm2PublicKey: "04f5084ee12767d932f293508e30e3b0100185042ec0f061dedaf92b793b93f79fd6179d5e47e25b7aec98e00cf90dd56df1f8191012537187e7bbfd2d1de299fc", //f8209a2ebe6691e41e1f2b667bfe71f0b511716cc0f7c4452502fc12ec3957e4
|
||||||
|
|||||||
@ -44,24 +44,46 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import {
|
||||||
ref,onMounted
|
ref,
|
||||||
|
onMounted,
|
||||||
|
watch
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import {
|
import {
|
||||||
showModelMessage
|
showModelMessage
|
||||||
} from "@/utils/tools.js";
|
} from "@/utils/tools.js";
|
||||||
const props = defineProps(["bikecode"]);
|
import {
|
||||||
|
onShow,
|
||||||
|
onLoad
|
||||||
|
} from "@dcloudio/uni-app";
|
||||||
|
const props = defineProps(["bikedata"]);
|
||||||
const methods = defineEmits(["close"])
|
const methods = defineEmits(["close"])
|
||||||
const color = ref("#61D145");
|
const color = ref("#61D145");
|
||||||
const data = ref({
|
const data = ref({});
|
||||||
bikeCode: props.bikecode,
|
|
||||||
zt: 1,
|
|
||||||
dl: "86%",
|
|
||||||
jl: "50km"
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(()=>{
|
function loadData(bikedata) {
|
||||||
showModelMessage("该功能暂未实现!")
|
const {
|
||||||
|
bikeCode,
|
||||||
|
status,
|
||||||
|
mileage,
|
||||||
|
soc
|
||||||
|
} = bikedata;
|
||||||
|
data.value = {
|
||||||
|
bikeCode,
|
||||||
|
zt: status == "正常" ? "1" : "0",
|
||||||
|
dl: soc + "%",
|
||||||
|
jl: mileage
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
loadData(props.bikedata)
|
||||||
})
|
})
|
||||||
|
watch(() => props.bikedata, (newValue, oldValue) => {
|
||||||
|
if (newValue.ecuSn != oldValue.ecuSn) {
|
||||||
|
loadData(newValue)
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
deep: true
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@ -80,5 +102,4 @@
|
|||||||
.lbImg {
|
.lbImg {
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@ -105,7 +105,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-if="showBikeInfo" style="position: absolute;z-index: 2000;bottom: 0;width: 100vw;">
|
<div v-if="showBikeInfo" style="position: absolute;z-index: 2000;bottom: 0;width: 100vw;">
|
||||||
|
|
||||||
<bike-info bikecode="123456" @close="closeBikeInfo" />
|
<bike-info :bikedata="bikeData" @close="closeBikeInfo" />
|
||||||
</div>
|
</div>
|
||||||
<div v-if="showOrderPay" style="position: absolute;z-index: 2000;bottom: 0;width: 100vw;">
|
<div v-if="showOrderPay" style="position: absolute;z-index: 2000;bottom: 0;width: 100vw;">
|
||||||
<bike-pay :orderid="orderData.orderId" />
|
<bike-pay :orderid="orderData.orderId" />
|
||||||
@ -181,6 +181,7 @@
|
|||||||
//车辆
|
//车辆
|
||||||
let arrBikeData = [];
|
let arrBikeData = [];
|
||||||
const showBikeInfo = ref(false);
|
const showBikeInfo = ref(false);
|
||||||
|
const bikeData=ref({});
|
||||||
|
|
||||||
//加载数据
|
//加载数据
|
||||||
function getLoalcationData() {
|
function getLoalcationData() {
|
||||||
@ -193,7 +194,7 @@
|
|||||||
latitude,
|
latitude,
|
||||||
longitude
|
longitude
|
||||||
};
|
};
|
||||||
oMap.moveToLocation()
|
oMap.moveToLocation({})
|
||||||
const params = {
|
const params = {
|
||||||
latitude,
|
latitude,
|
||||||
longitude,
|
longitude,
|
||||||
@ -212,18 +213,13 @@
|
|||||||
}
|
}
|
||||||
arrBikeData = data || [];
|
arrBikeData = data || [];
|
||||||
const arrData = markers.value || [];
|
const arrData = markers.value || [];
|
||||||
arrBikeData.map((item) => {
|
arrBikeData.map((item,index) => {
|
||||||
const {
|
const {
|
||||||
longitude,
|
longitude,
|
||||||
latitude
|
latitude
|
||||||
} = item;
|
} = item;
|
||||||
let index = findIndex(arrData, {
|
arrData.push( map.addMarker(index, longitude, latitude, "mapbike.png",
|
||||||
longitude,
|
true));
|
||||||
latitude
|
|
||||||
});
|
|
||||||
index = index == -1 ? arrData.length : index;
|
|
||||||
arrData[index] = map.addMarker(index, longitude, latitude, "mapbike.png",
|
|
||||||
true);
|
|
||||||
})
|
})
|
||||||
markers.value = arrData;
|
markers.value = arrData;
|
||||||
});
|
});
|
||||||
@ -539,14 +535,20 @@
|
|||||||
|
|
||||||
//查看车辆信息
|
//查看车辆信息
|
||||||
function openBikeInfo(e) {
|
function openBikeInfo(e) {
|
||||||
showModelMessage("该功能暂未实现!");
|
|
||||||
if (!oUser) {
|
if (!oUser) {
|
||||||
tologin();
|
tologin();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log("33333333333333333", e);
|
const {
|
||||||
|
markerId
|
||||||
|
} = e.detail;
|
||||||
|
if(markerId==pointEnd || markerId==pointStart){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
bikeData.value=arrBikeData[markerId];
|
||||||
showBikeInfo.value = true;
|
showBikeInfo.value = true;
|
||||||
showTools.value = false;
|
showTools.value = false;
|
||||||
|
showOrderPay.value=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//关闭车辆信息
|
//关闭车辆信息
|
||||||
@ -560,11 +562,11 @@
|
|||||||
oMap = uni.createMapContext("mapRef", {
|
oMap = uni.createMapContext("mapRef", {
|
||||||
this: instance.proxy
|
this: instance.proxy
|
||||||
});
|
});
|
||||||
|
getLoalcationData();
|
||||||
})
|
})
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
oUser = uni.getStorageSync("wechat_user");
|
oUser = uni.getStorageSync("wechat_user");
|
||||||
console.log("7777777777777777777777","oUser", oUser)
|
console.log("7777777777777777777777","oUser", oUser)
|
||||||
getLoalcationData();
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
userId
|
userId
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
const config = {
|
const config = {
|
||||||
//apiUrl: "http://192.168.2.156:10010/",
|
apiUrl: "http://192.168.2.151:10010/",
|
||||||
apiUrl: "https://www.cdzhuojing.cn/",
|
//apiUrl: "https://www.cdzhuojing.cn/",
|
||||||
cdnPath: "/",
|
cdnPath: "/",
|
||||||
ERR_OK: 200,
|
ERR_OK: 200,
|
||||||
sm2PublicKey: "04f5084ee12767d932f293508e30e3b0100185042ec0f061dedaf92b793b93f79fd6179d5e47e25b7aec98e00cf90dd56df1f8191012537187e7bbfd2d1de299fc", //f8209a2ebe6691e41e1f2b667bfe71f0b511716cc0f7c4452502fc12ec3957e4
|
sm2PublicKey: "04f5084ee12767d932f293508e30e3b0100185042ec0f061dedaf92b793b93f79fd6179d5e47e25b7aec98e00cf90dd56df1f8191012537187e7bbfd2d1de299fc", //f8209a2ebe6691e41e1f2b667bfe71f0b511716cc0f7c4452502fc12ec3957e4
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user