# wx.chooseAddress(Object object)
Start from base library version 1.1.0. Please remaining backward compatible.
with Promise style call: Supported
Mini Program plugin: Support, need to Mini Program base library version no less than 2.16.1
Gets the user's shipping address. Set up the user to edit the shipping address native interface and return to the address selected by the user after editing.
# parameter
# Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Interface calls the end of the callback function (call success or failure will be executed) |
# object.success callback
# parameter
# Object res
attribute | type | Introductions |
---|---|---|
userName | string | Name of consignee |
postalCode | string | postal code |
provinceName | string | GB receiving address first level address |
cityName | string | GB receiving address Level 2 address |
countyName | string | GB receiving address level 3 address |
detailInfo | string | Detailed Receipt Address Information |
nationalCode | string | Receiving address country code |
telNumber | string | Consignee mobile phone number |
errMsg | string | Error message |
# sample code
wx.chooseAddress({
success (res) {
console.log(res.userName)
console.log(res.postalCode)
console.log(res.province)
console.log(res.cityName)
console.log(res.countyName)
console.log(res.detailInfo)
console.log(res.nationalCode)
console.log(res.telNumber)
}
})