From 53914f088aeef353830529f89f7ee41e47b3e6a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=85=E4=BF=9D=E5=90=8C=E5=AD=A6?= <3228274159@qq.com> Date: Thu, 27 Jun 2024 02:47:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E7=82=B9=E5=87=BB=E5=9B=9E?= =?UTF-8?q?=E5=88=B0=E5=BD=93=E5=89=8D=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.vue | 9 ++++++--- unpackage/dist/dev/mp-weixin/pages/index/index.js | 13 ++++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 6157474..20460da 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -200,8 +200,10 @@ const navindex = ref(0) const isMap = ref(0) const homeScro = ref(null) - const longitude = uni.getStorageSync('longitude') - const latitude = uni.getStorageSync('latitude') + const longitude = ref() + const latitude =ref() + longitude.value=uni.getStorageSync('longitude') + latitude.value = uni.getStorageSync('latitude') const active = ref(0) h.getgps() const scroll = (e) => { @@ -281,7 +283,8 @@ }) } const myGps = () => { - console.log(1); + longitude.value=uni.getStorageSync('longitude') + latitude.value = uni.getStorageSync('latitude') } const iiii = () => { uni.navigateTo({ diff --git a/unpackage/dist/dev/mp-weixin/pages/index/index.js b/unpackage/dist/dev/mp-weixin/pages/index/index.js index 540c084..76a52b5 100644 --- a/unpackage/dist/dev/mp-weixin/pages/index/index.js +++ b/unpackage/dist/dev/mp-weixin/pages/index/index.js @@ -30,8 +30,10 @@ const _sfc_main = { const navindex = common_vendor.ref(0); const isMap = common_vendor.ref(0); common_vendor.ref(null); - const longitude = common_vendor.index.getStorageSync("longitude"); - const latitude = common_vendor.index.getStorageSync("latitude"); + const longitude = common_vendor.ref(); + const latitude = common_vendor.ref(); + longitude.value = common_vendor.index.getStorageSync("longitude"); + latitude.value = common_vendor.index.getStorageSync("latitude"); const active = common_vendor.ref(0); h.getgps(); const scroll = (e) => { @@ -110,7 +112,8 @@ const _sfc_main = { }); }; const myGps = () => { - console.log(1); + longitude.value = common_vendor.index.getStorageSync("longitude"); + latitude.value = common_vendor.index.getStorageSync("latitude"); }; const iiii = () => { common_vendor.index.navigateTo({ @@ -180,8 +183,8 @@ const _sfc_main = { n: common_vendor.o(($event) => netWorkDetails(index), item.id) }); }), - j: common_vendor.unref(longitude), - k: common_vendor.unref(latitude), + j: longitude.value, + k: latitude.value, l: scale.value, m: common_vendor.unref(markers), n: common_vendor.o(onMarkerTap),