WeChat Mini Program QR Code Generation Tool weapp-qrcode Detailed Explanation

WeChat Mini Program QR Code Generation Tool weapp-qrcode Detailed Explanation

WeChat Mini Program - QR Code Generator

Download: weapp-qrcode.js file

github:https://github.com/Pudon/weapp-qrcode-base64

Introduce the weapp-qrcode.js file into the project

js

const app = getApp();
const QR = require('../../lib/weapp-qrcode.js'); // Import weapp-qrcode

Page({
    /**
     * Initial data of the page */
    data: {
        QrCodeURL:'', // QR code image path},
    // QR code drawImg: function (){
        let that = this,
            params = "https://www.baidu.com/"; // QR code parameters var imgData = QR.drawImg(params, {
            typeNumber: 4, // density errorCorrectLevel: 'L', // error correction level size: 800, // white border })
        
        this.setData({
            qrcodeURL: imgData
        })
    },
})

html

<view style="text-align:center;">
    <image style="width:500rpx;height:500rpx;" src="{{ qrcodeURL }}" ></image>
</view>

This is the end of this article about the WeChat Mini Program QR Code Generation Tool weapp-qrcode. For more related WeChat Mini Program QR Code Generation Tool content, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to use cloud functions to generate QR codes in WeChat applet cloud development
  • How to generate a sharing poster using WeChat applet (with QR code generation)
  • Sample code for generating QR code in WeChat applet
  • Example of node implementing the function of generating a small program QR code with parameters and saving it locally
  • WeChat applet dynamically generates QR code implementation code
  • How to generate a QR code image from a string in WeChat applet

<<:  Detailed steps for running springboot project in Linux Docker

>>:  The difference and advantages and disadvantages of Mysql primary key UUID and auto-increment primary key

Recommend

mysql5.7 create user authorization delete user revoke authorization

1. Create a user: Order: CREATE USER 'usernam...

MySQL database operations (create, select, delete)

MySQL Create Database After logging into the MySQ...

Summary of MySQL time statistics methods

When doing database statistics, you often need to...

Index Skip Scan in MySQL 8.0

Preface MySQL 8.0.13 began to support index skip ...

How to use the realip module in Nginx basic learning

Preface There are two types of nginx modules, off...

CentOS 7 configuration Tomcat9+MySQL solution

Configure Tomcat First install Tomcat Installing ...

Summary of basic knowledge points of MySql database

Table of contents Basic database operations 2) Vi...

How to embed other web pages in a web page using iframe

How to use iframe: Copy code The code is as follo...

SELinux Getting Started

Back in the Kernel 2.6 era, a new security system...

Vertical and horizontal splitting of MySQL tables

Vertical Split Vertical splitting refers to the s...

CSS text alignment implementation code

When making forms, we often encounter the situati...

Detailed explanation of the MySQL MVCC mechanism principle

Table of contents What is MVCC Mysql lock and tra...

uniapp dynamic modification of element node style detailed explanation

Table of contents 1. Modify by binding the style ...