创新互联小程序教程:微信小程序API收货地址
wx.chooseAddress(OBJECT)
基础库版本 1.1.0 开始支持,低版本需做兼容处理
成都创新互联公司主要从事成都网站建设、做网站、网页设计、企业做网站、公司建网站等业务。立足成都服务江陵,十余年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:028-86922220
调起用户编辑收货地址原生界面,并在编辑完成后返回用户选择的地址。
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
- tip:- wx.chooseAddress接口需要用户授权,请兼容用户拒绝授权的场景。
文章标题:创新互联小程序教程:微信小程序API收货地址
文章分享:http://jxruijie.cn/article/cdpiecs.html


 
                