Scan the QR code to enter the mini program
Although it is mentioned in the document, there are still a few pitfalls. At the end of the article, scan the common link QR code to open the applet | WeChat Open Documentation
Scan the common link QR code to open the applet | WeChat open document
1. Development configuration
Enter the Mini Program page, Development Management->Development Settings->Scan the common link QR code to open the Mini Program
The setting here is mainly to scan the function of WeChat, read this QR code address, and you can enter the page of the applet.
2. Configuration rules
! ! ! There is also a verification file, which must be thrown on the server and placed in the root directory of the domain name. As long as the address under the QR code rules can be accessed, it can be placed in the root directory of the domain name. The address under the code rules can be accessed, otherwise the scan code jump applet verification will not pass
3. Link to obtain parameters
The passed parameters are in the onLoad event of the redirected page. In the following code, option.q is the passed parameters. If you want to get the data, you have to decodeURIComponent to get the data.
onLoad(option) {
//这里是直接获取到二维码原生链接:即http://www.baidu.com/code/?id=xxx&name=xxx
const url = decodeURIComponent(option.q)
console.log(url)
}
4. Trample record
1. The verification file must be placed in the root directory of the domain name on the server, so as to pass the file verification
2. The test link is very important, the following situations are pitfalls
(1) The scope of the test is the development version or the experience version
The link to scan the code is inconsistent with the test link, if not, a blank page will appear
(2) The test scope is the online version, only in this case can dynamic parameters be passed, and the applet must be online at the same time
3. After scanning the QR code, it may not be the version you want to jump to. Exit the mini program at this time, pull down on the main interface of WeChat, and check which version you are jumping to by checking the recently used mini program
4. The trial version does not open the debug mode, and cannot access interfaces and webview pages that are not configured on the platform
There are three dots in the upper right corner of the page, click
In development mode, you can see what is printed