董国庆
2025-05-23 29844c9063e57aa923fe5d492ea91eb1c1c0f87b
加打印
2个文件已修改
11 ■■■■ 已修改文件
H5/main.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/pages/location/location.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/main.js
@@ -7,8 +7,8 @@
const jweixin = require('jweixin-module')
window.wx = {}
/*引入,注释可关闭*/
// import vconsole from "vconsole";
// Vue.prototype.vconsole = new vconsole();
import vconsole from "vconsole";
Vue.prototype.vconsole = new vconsole();
Vue.config.productionTip = false
Vue.prototype.$store = store
Vue.prototype.$jweixin = jweixin
H5/pages/location/location.vue
@@ -112,7 +112,11 @@
            navigator.geolocation.getCurrentPosition(success, error, options);
            function success(position) {
                geoconv({coords:`${position.coords.longitude},${position.coords.latitude}`}).then(res=>{
                console.log('position', position)
                geoconv({
                    coords: `${position.coords.longitude},${position.coords.latitude}`
                }).then(res => {
                    console.log('res', res)
                    const latitude = res.data.result[0].y;
                    const longitude = res.data.result[0].x;
                    var point = new BMapGL.Point(longitude, latitude); // 创建点坐标
@@ -134,6 +138,7 @@
            }
            function error(err) {
                console.log('err', err)
                switch (err.code) {
                    case err.PERMISSION_DENIED:
                        console.error("用户拒绝了位置请求。");