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),