English
获取用户收货地址。调起用户编辑收货地址原生界面,并在编辑完成后返回用户选择的地址,需要用户授权 scope.address。
Platform Difference Description
| App | H5 | 微信小程序 | 支付宝小程序 | 百度小程序 | 抖音小程序 | 飞书小程序 | QQ小程序 | 快手小程序 | 京东小程序 | 元服务 | 小红书小程序 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| x | x | √ | √ | √ | √ | x | x | x | x | √ | √ |
OBJECT parameter description
| 属性 | 类型 | 必填 | 说明 |
|---|---|---|---|
| success | function | No | Callback function for successful interface call |
| fail | function | No | Callback function for interface call failure |
| complete | function | No | The callback function for the end of the interface call (the call will be executed if the call succeeds or fails) |
success return parameter description
| Properties | Type | Description | Platform Difference Description |
|---|---|---|---|
| userName | string | consignee name | |
| postalCode | string | Postal Code | |
| provinceName | string | National standard delivery address first-level address | |
| cityName | string | The second-level address of the national standard delivery address | |
| countyName | string | 国标收货地址第三级地址 | |
| streetName | string | 国标收货地址第四级地址 | 微信小程序、小红书小程序 |
| detailInfo | string | 详细收货地址信息 | |
| detailInfoNew | string | 新选择器详细收货地址信息 | 微信小程序、小红书小程序 |
| nationalCode | string | Shipping address country code | |
| telNumber | string | 收货人手机号码 | |
| errMsg | string | 错误信息 | 微信小程序、小红书小程序 |
Sample code
uni.chooseAddress({
success(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)
}
})