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