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

How to deploy MySQL 5.7 & 8.0 master-slave cluster using Docker

> Deploy MySQL 5.7 cluster master & slave ...

An article teaches you how to use Vue's watch listener

Table of contents Listener watch Format Set up th...

Gearman + MySQL to achieve persistence operation example

This article uses the gearman+mysql method to imp...

Getting the creation time of a file under Linux and a practical tutorial

background Sometimes we need to get the creation ...

18 Amazing Connections Between Interaction Design and Psychology

Designers need to understand psychology reading n...

Detailed tutorial on distributed operation of jmeter in docker environment

1. Build the basic image of jmeter The Dockerfile...

How to manually encapsulate paging components in Vue3.0

This article shares the specific code of the vue3...

Docker /var/lib/docker/aufs/mnt directory cleaning method

The company's service uses docker, and the di...

Nginx operation and maintenance domain name verification method example

When configuring the interface domain name, each ...

How to run JavaScript in Jupyter Notebook

Later, I also added how to use Jupyter Notebook i...