Wx. chooseAddres: Get the shipping address of the user

ChooseAddres (wx. ChooseAddres) does not pop up a popup asking the user to choose whether to authorize or not. The default is authorization. Note that wechat development tools will still pop up the authorization popup window

2. Support async&await

Wechat applet does not support ES7 async&await. To support this, you can use the following methods:

  • Create a new directory, lib/runtime/runtime.js, and copy the code linked below.

    Github.com/facebook/re…

  • To import the following code into the page using async&await, the path should be modified according to the corresponding directory (cannot be imported globally, otherwise invalid).

    import regeneratorRuntime from '.. /.. /lib/runtime/runtime';Copy the code
  • Some of the older models and earlier versions of applets may have compatibility problems, please use them at your discretion.

3, how to obtain the page address parameter in the life cycle onShow function

  • The options parameter of the onLoad function can be obtained directly, but the onShow function cannot be obtained this way. You can get this by calling getCurrentPages().

  • GetCurrentPages () is the page stack of the applet, of type array, with a maximum length of 10 pages. The largest index in the array is the current page.

    const pages = getCurrentPages(); const currentPage = pages[pages.length – 1]; const { options } = currentPage; console.log(options); / / print the value