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 use mysql to complete the data generation in excel

Excel is the most commonly used tool for data ana...

Implementation ideas for docker registry image synchronization

Intro Previously, our docker images were stored i...

Summary of MySql index, lock, and transaction knowledge points

This article summarizes the knowledge points of M...

A brief discussion on the design of Tomcat multi-layer container

Table of contents Container Hierarchy The process...

Issues with upgrading Python and installing Mongodb drivers under Centos

Check the Python version python -V If it is below...

JavaScript BOM location object + navigator object + history object

Table of contents 1. Location Object 1. URL 2. Pr...

Should I use UTF-8 or GB2312 encoding when building a website?

Often when we open foreign websites, garbled char...

Ubuntu compiles kernel modules, and the content is reflected in the system log

Table of contents 1.Linux login interface 2. Writ...

Detailed explanation of React component communication

Table of contents Component Communication Introdu...

Appreciation of the low-key and elegant web design in black, white and gray

Among classic color combinations, probably no one...

Bootstrap3.0 study notes table related

This article mainly explains tables, which are no...

Detailed explanation of the solution to the nginx panic problem

Regarding the nginx panic problem, we first need ...

getdata table table data join mysql method

public function json_product_list($where, $order)...

Vue image cropping component example code

Example: tip: This component is based on vue-crop...

Detailed process of Vue front-end packaging

Table of contents 1. Add packaging command 2. Run...