微信小程序API收货地址,调起用户编辑收货地址原生界面

wx.chooseAddress(OBJECT)


基础库版本 1.1.0 开始支持,低版本需做兼容处理

调起用户编辑收货地址原生界面,并在编辑完成后返回用户选择的地址。

OBJECT参数说明:

参数 类型 必填 返回
success Function 返回用户选择的收货地址信息
fail Function 接口调用失败的回调函数
complete Function 接口调用结束的回调函数(调用成功、失败都会执行)

success返回参数说明:

参数 类型 说明
errMsg String 调用结果
userName String 收货人姓名
postalCode String 邮编
provinceName String 国标收货地址第一级地址
cityName String 国标收货地址第二级地址
countyName String 国标收货地址第三级地址
detailInfo String 详细收货地址信息
nationalCode String 收货地址国家码
telNumber String 收货人手机号码

示例代码:

wx.chooseAddress({
  success: function (res) {
    console.log(res.userName)
    console.log(res.postalCode)
    console.log(res.provinceName)
    console.log(res.cityName)
    console.log(res.countyName)
    console.log(res.detailInfo)
    console.log(res.nationalCode)
    console.log(res.telNumber)
  }
})

Bug & Tip

  1. tip:wx.chooseAddress接口需要用户授权,请兼容用户拒绝授权的场景。
更多微信小程序开发教程,可以关注多程序。
上一篇 包你说小程序如何发到朋友圈 下一篇 微信小程序怎么测试,微信小程序测试用例
论坛资讯同步说明,本文同步自论坛:bbs.miaozhizuo.com,如您在论坛注册成为会员用户并且发帖,则默认论坛文章同步协议,协议内容请移步论坛查看!

          在线客服

            点击这里给我发消息

          VIP咨询
         点击这里给我发消息

          咨询热线

   17080039991

      (免费拨打)

          代理招商

   178-9531-8531

[关闭]
随手APP微信

官方微信自助客服

[关闭]