From ac0c95dbe751efa069f754e96ffa42b0e317cfe8 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 9 Jul 2026 14:36:43 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=B0=B4=E5=8D=B0=E7=9B=B8?= =?UTF-8?q?=E6=9C=BA=EF=BC=8C=E5=9C=B0=E5=9B=BE=E5=88=87=E6=8D=A2=E6=88=90?= =?UTF-8?q?=E5=A4=A9=E5=9C=B0=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/dev/mp-weixin/INDEX/watermark_camera/index.js | 2 +- dist/dev/mp-weixin/common/libraries/map.js | 12 ++++++------ src/INDEX/watermark_camera/index.vue | 6 +++--- src/common/libraries/map.ts | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dist/dev/mp-weixin/INDEX/watermark_camera/index.js b/dist/dev/mp-weixin/INDEX/watermark_camera/index.js index c5cedf0..c7ee31b 100644 --- a/dist/dev/mp-weixin/INDEX/watermark_camera/index.js +++ b/dist/dev/mp-weixin/INDEX/watermark_camera/index.js @@ -16,7 +16,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({ __name: "index", setup(__props) { common_vendor.onLoad((e) => { - let address = common_libraries_map.getShowApiAddress(); + let address = common_libraries_map.getMapAddress(); INDEX_watermark_camera_model.useModel.source.value = (e == null ? void 0 : e.source) || "save"; address.then((res) => { INDEX_watermark_camera_model.useModel.address.value = res; diff --git a/dist/dev/mp-weixin/common/libraries/map.js b/dist/dev/mp-weixin/common/libraries/map.js index 0548502..e424628 100644 --- a/dist/dev/mp-weixin/common/libraries/map.js +++ b/dist/dev/mp-weixin/common/libraries/map.js @@ -1,7 +1,7 @@ "use strict"; const common_vendor = require("../vendor.js"); -function getShowApiAddress() { - const SHOWAPI_APP_KEY = "C59885FE214644168eB4197eFe9a48b9"; +function getMapAddress() { + const TIANDITU_KEY = "ee3611ed7d1e3061a5271f6e40cda354"; return new Promise((resolve, reject) => { common_vendor.index.getLocation({ type: "wgs84", @@ -9,17 +9,17 @@ function getShowApiAddress() { isHighAccuracy: true, success(res) { console.log(res, "经纬度"); - const url = `https://route.showapi.com/238-3?appKey=${SHOWAPI_APP_KEY}&lng=${res.longitude}&lat=${res.latitude}&from=5`; + const url = `https://api.tianditu.gov.cn/geocoder?postStr={'lon':${res.longitude},'lat':${res.latitude},'ver':2}&type=geocode&tk=${TIANDITU_KEY}`; common_vendor.index.request({ url, method: "GET", success(res2) { var _a, _b; + resolve({ address: ((_b = (_a = res2 == null ? void 0 : res2.data) == null ? void 0 : _a.result) == null ? void 0 : _b.formatted_address) || "" }); console.log(res2, "address"); - resolve({ formatted_address: ((_b = (_a = res2 == null ? void 0 : res2.data) == null ? void 0 : _a.showapi_res_body) == null ? void 0 : _b.formatted_address) || "" }); }, fail(res2) { - resolve({ formatted_address: "拒绝定位" }); + resolve({ address: "拒绝定位" }); console.error("获取地址失败:", res2); common_vendor.index.showModal({ title: "提示", @@ -42,4 +42,4 @@ function getShowApiAddress() { }); }); } -exports.getShowApiAddress = getShowApiAddress; +exports.getMapAddress = getMapAddress; diff --git a/src/INDEX/watermark_camera/index.vue b/src/INDEX/watermark_camera/index.vue index 219fa00..c81d6e4 100644 --- a/src/INDEX/watermark_camera/index.vue +++ b/src/INDEX/watermark_camera/index.vue @@ -33,14 +33,14 @@