收藏
回答

为什么调用失败,已经添加到隐私策略里面了?

wx.getLocation({

      type: 'gcj02',

      success: () => {

        // 调用微信选择位置API

        wx.chooseLocation({

          success: (res) => {

            // 获取到经纬度后,调用逆地理编码获取省市区信息

            console.log('选择位置:', res);


            this.getLocationInfo(res.latitude, res.longitude, res.address, res.name);

          },

          fail: (err) => {

            console.error('选择位置失败:', err);

            if (err.errMsg !== 'chooseLocation:fail cancel') {

              wx.showToast({

                title: '获取位置失败',

                icon: 'none'

              });

            }

          }

        });

      },

      fail: (err) => {

        console.error('获取定位失败:', err);

        wx.showToast({

          title: '请授权位置权限',

          icon: 'none'

        });

      }

    });

回答关注问题邀请回答
收藏

1 个回答

  • 智能回答 智能回答 本次回答由AI生成
    2025-10-14
    有用
    回复 2
    • Cyan
      Cyan
      2025-10-14
      appid:wx743cc99a4fb76355,9月底就申请通过了
      2025-10-14
      回复
    • 智能回答 智能回答 本次回答由AI生成
      2025-10-14回复Cyan
登录 后发表内容