[WeChat Mini Program] Mini program breaks through the limit on the number of mini program QR codes

We often need to scan the QR code to enter the designated page to perform related operations. The official also provides an interface for generating mini program codes.

Officially generated mini program QR code

Get the mini program code | WeChat open document

1 - To generate a circular QR code, you can use the following two interfaces

 Interface A: wxacode.get | WeChat open document

Interface B: wxacode.getUnlimited | WeChat Open Document

2 - If you want to generate a square QR code, you can use the following interface

wxacode.createQRCode | WeChat Open Document

 But you can see that the number of this interface is limited. Interface A plus interface C, the total number of codes generated is limited to 100,000.

And there is this [Scan] prompt under the square QR code. Sometimes our demand is more than 100,000 quantities and we don’t want to

Let him generate a QR code with the applet logo and text, you can use the following method:

Scan the QR code of the ordinary link to open the mini program | WeChat open document

1-Log in to the mini program backend, go to "Settings - Development Settings - Scan the QR code of a normal link to open the mini program". After turning on the function, you can configure the QR code rules. After configuration, you can use tools to convert links into QR codes, and you can also carry parameters.

2-When you scan the code to enter the mini program, you can get the parameters carried by the QR code in onload.

Page({
  onLoad(query) {
    const q = decodeURIComponent(query.q) // 获取到二维码原始链接内容
    const scancode_time = parseInt(query.scancode_time) // 获取用户扫码时间 UNIX 时间戳
  }
})

In this way, we can break through the limit of the number of QR codes. We can generate as many QR codes as we want and can carry parameters.

[Note] A mini program account can be configured with no more than 100 QR code prefix rules (but it seems that it is not common for a mini program to have 100 pages hahaha~)

Guess you like

Origin blog.csdn.net/wuguidian1114/article/details/125964446