diff --git a/dist/dev/mp-weixin/INDEX/watermark_camera/index.js b/dist/dev/mp-weixin/INDEX/watermark_camera/index.js index de7b94b..c5cedf0 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.getMapLbs(); + let address = common_libraries_map.getShowApiAddress(); 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 3980e46..0548502 100644 --- a/dist/dev/mp-weixin/common/libraries/map.js +++ b/dist/dev/mp-weixin/common/libraries/map.js @@ -1,25 +1,25 @@ "use strict"; const common_vendor = require("../vendor.js"); -function getMapLbs() { - const AMAP_KEY = "be262c006216c542747fce766130cee3"; +function getShowApiAddress() { + const SHOWAPI_APP_KEY = "C59885FE214644168eB4197eFe9a48b9"; return new Promise((resolve, reject) => { common_vendor.index.getLocation({ - type: "gcj02", + type: "wgs84", altitude: true, isHighAccuracy: true, success(res) { console.log(res, "经纬度"); - const url = `https://restapi.amap.com/v3/geocode/regeo?location=${res.longitude},${res.latitude}&key=${AMAP_KEY}`; + const url = `https://route.showapi.com/238-3?appKey=${SHOWAPI_APP_KEY}&lng=${res.longitude}&lat=${res.latitude}&from=5`; common_vendor.index.request({ url, method: "GET", success(res2) { - var _a; + var _a, _b; console.log(res2, "address"); - resolve((_a = res2 == null ? void 0 : res2.data) == null ? void 0 : _a.regeocode); + 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({ address: "拒绝定位" }); + resolve({ formatted_address: "拒绝定位" }); console.error("获取地址失败:", res2); common_vendor.index.showModal({ title: "提示", @@ -42,4 +42,4 @@ function getMapLbs() { }); }); } -exports.getMapLbs = getMapLbs; +exports.getShowApiAddress = getShowApiAddress; diff --git a/src/INDEX/watermark_camera/index.vue b/src/INDEX/watermark_camera/index.vue index 498f4cf..0e11722 100644 --- a/src/INDEX/watermark_camera/index.vue +++ b/src/INDEX/watermark_camera/index.vue @@ -33,12 +33,12 @@