Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small program API receiving address


May 19, 2021 WeChat Mini Program Development Document


Table of contents


wx.chooseAddress(OBJECT)


Base library version 1.1.0 starts to support, and low versions need to be compatible

Call up the native interface where the user edits the receiving address and return the address selected by the user when the edit is complete.

OBJECT parameter description:

Parameters Type Required Return
success Function Whether Returns the receiving address information selected by the user
fail Function Whether The interface calls the failed callback function
complete Function Whether Callback function at end of interface call (call succeeds, fails are executed)

Success returns a description of the parameters:

Parameters Type Description
errMsg String The result of the call
userName String The name of the conseer
postalCode String Zip
provinceName String The first-level address of the national standard receiving address
cityName String The second-level address of the national standard receiving address
countyName String The third-level address of the national standard receiving address
detailInfo String Detailed shipping address information
nationalCode String The country code of the receiving address
telNumber String The receiving person's mobile phone number

Example code:

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 user authorization, so be compatible with scenarios in which the user refuses authorization.