From 777d6a8ba445189aec284522d1ff492d7598e8ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B0=8F?= <736883394@qq.com> Date: Wed, 30 Apr 2025 17:32:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ebike-maintenance/utils/config.js | 4 +- ebike-user/components/bike-info/bike-info.vue | 45 ++++++++++++++----- ebike-user/pages/user/home/home.vue | 28 ++++++------ ebike-user/utils/config.js | 4 +- 4 files changed, 52 insertions(+), 29 deletions(-) diff --git a/ebike-maintenance/utils/config.js b/ebike-maintenance/utils/config.js index ae82864..8d8c2c4 100644 --- a/ebike-maintenance/utils/config.js +++ b/ebike-maintenance/utils/config.js @@ -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 diff --git a/ebike-user/components/bike-info/bike-info.vue b/ebike-user/components/bike-info/bike-info.vue index 3bfad4a..a8883b4 100644 --- a/ebike-user/components/bike-info/bike-info.vue +++ b/ebike-user/components/bike-info/bike-info.vue @@ -44,24 +44,46 @@ \ No newline at end of file diff --git a/ebike-user/pages/user/home/home.vue b/ebike-user/pages/user/home/home.vue index f62fc43..41b0ca2 100644 --- a/ebike-user/pages/user/home/home.vue +++ b/ebike-user/pages/user/home/home.vue @@ -105,7 +105,7 @@
- +
@@ -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 diff --git a/ebike-user/utils/config.js b/ebike-user/utils/config.js index ae82864..8a54766 100644 --- a/ebike-user/utils/config.js +++ b/ebike-user/utils/config.js @@ -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