This is the second day of my participation in Gwen Challenge

background

Company project requirements, users scan the TWO-DIMENSIONAL code to open the corresponding small program.

Scan wechat to open wechat mini program

Official document write very detailed, developers.weixin.qq.com/miniprogram… Let me give you some tips.

1 scan the ordinary link two-dimensional code to open small program, always open the web page without jumping small program?

A: The QR code used for the test is inconsistent with the website written by the test link.

2. Scan code to open the display page does not exist?

A: After the rule is issued, even if there is A test link, take the test link two-dimensional code two-dimensional code will be accessed online.

3 have opened the small program after entering the background, then scan the qr code with parameters to open the small program can not receive parameters?

A: Parameters can be normally obtained through the onLaunch function in app.js or the onload function of the relevant page when the small program is not opened for scanning startup. However, if the small program has been opened and is just cut to the background, then scan the code and enter the hot startup. The onShow function of the app.js page will be executed to obtain the parameters.

4. How to obtain parameters of onLaunch and onload?

Options.query. q options.q in onload

Two, pay treasure sweep open pay treasure small program

Options.query.qrcode in onLaunch options.qrcode in onload. Since onload is not included in the page generated by alipay developer tool by default, it needs to be filled.

The end of the

The project needs to change and change, feel that scan code is not fast enough and requires external web pages to open small procedures…… Wechat external webpage

way disadvantages
The scheme open chain Indefinite limited number, limited time limit, can only be opened from outside wechat
Cloud developed static site open To put a web page on a cloud development environment, you need to know cloud development
Opened by wechat open TAB The interface provided by the back end is not easy to adjust due to the requirements of the system version and wechat version. The webView in the small program cannot be opened
Small program webView jump back Background Configuration