收藏
回答

wx.getLocation?

jWeixin.ready(() => {
    jWeixin.getLocation({
        type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
        success: (res) => {
            console.log('location success: ', res)
            this.locationInfo.latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90
            this.locationInfo.longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。
            this.locationInfo.customerId = this.customerId
            this.locationInfo.platform = 'dzy'
            this.locationInfo.contractType = this.contractType // 合同类型type
            this.locationInfo.order = this.contractType // 合同类型type
            this.locationInfo.name = _item.name // 客户姓名
            this.locationInfo.cardNo = _item.cardNo // 身份证号
            this.locationInfo.phone = _item.phone // 手机号
            this.locationInfo.type = _item.type // 关系人类型
            this.locationInfo.openid = this.openid
            this.locationInfo.miniPhone = this.miniPhone
            this.locationInfo.deviceModel = this.deviceModel
            this.locationInfo.deviceCode = this.deviceCode
            console.log('locationInfo: ', this.locationInfo)
            API_INVOICE.getAddrResolve(this.locationInfo).then(res => {
                console.log('获取成功')
            }).catch(err => {
                console.log(err)
                this.$u.toast(err)
            })
        },fail(res){
            console.log('location fail: ', res)
        }
    })
w我在本地测试时,用微信内置浏览器,是不是无法获取到定位?还是说是因为域名白名单的原因?希望哪位大佬可以解答
回答关注问题邀请回答
收藏

2 个回答

  • 社区技术运营专员--许涛
    社区技术运营专员--许涛
    2025-11-05

    你好,打印config入参和fail,fail吐出来的完整报错信息

    2025-11-05
    有用
    回复 1
    • 二进制²
      二进制²
      2025-11-05
      好嘞,谢谢
      2025-11-05
      回复
  • 智能回答 智能回答 本次回答由AI生成
    2025-11-05
    有用
登录 后发表内容