当前位置:网站首页>Uni app uses canvas to draw QR code
Uni app uses canvas to draw QR code
2022-06-26 19:06:00 【gblfy】

List of articles
1. Plug in selection
uqrCode
Click Install
https://ext.dcloud.net.cn/search?q=uqrCode
2. Page part
template:
<view class="canvas-qrcode-box" style="align-self: center;">
<canvas id="qrcode" canvas-id="qrcode" style="width: 170px;height: 170px;align-self: center;" />
</view>
3. Event part
<script>
var system = uni.getSystemInfoSync();
import uQRCode from '@/uni_modules/Sansnn-uQRCode/components/uqrcode/common/uqrcode.js'
export default {
data() {
return {
vlogId: "",
// screenHeight: system.screenHeight,
screenHeight: system.safeArea.bottom,
statusBarHeight: system.statusBarHeight
}
},
onReady() {
var vlogId = this.vlogId;
var content = {
type: "vlog",
content: vlogId
};
var contentStr = JSON.stringify(content);
uQRCode.make({
canvasId: 'qrcode',
componentInstance: this,
size: 170,
margin: 10,
text: contentStr,
backgroundColor: '#ffffff',
foregroundColor: '#0f0827',
fileType: 'png',
errorCorrectLevel: uQRCode.errorCorrectLevel.H
})
.then(res => {
})
},
onLoad(params) {
var vlogId = params.vlogId;
this.vlogId = vlogId;
},
methods: {
close() {
uni.navigateBack({
delta: 1,
animationType: "slide-out-bottom"
})
},
}
}
</script>
边栏推荐
- To: Apple CEO Cook: great ideas come from constantly rejecting the status quo
- NFTGameFi链游系统开发详解方案丨链游系统开发原理解析
- (multi threading knowledge points that must be mastered) understand threads, create threads, common methods and properties of using threads, and the meaning of thread state and state transition
- 品达通用权限系统(Day 3~Day 4)
- Pinda general permission system (day 3~day 4)
- 【Kubernetes】Kubernetes 原理剖析与实战应用(更新中)
- 50 lines of code to crawl TOP500 books and import TXT documents
- 成功解决之微服务@Value获取配置文件乱码问题
- Filebeat安装及使用
- 【Mysql系列】工作常用sql集锦(持续更新)
猜你喜欢

Microservice architecture

Boot指标监测

Leetcode interview question 29 clockwise print matrix

Logstash安装及使用

On the escape of inequality value

威胁猎人必备的六个威胁追踪工具

Tag dynamic programming - preliminary knowledge for question brushing -2 0-1 knapsack theory foundation and two-dimensional array solution template

交叉编译环境出现.so链接文件找不到问题

微信小程序 自定义 弹框组件

项目实战四:用户登录及token访问验证(reids+jwt)
随机推荐
Analysis on development technology of NFT meta universe chain game system
Chain game development finished product source code chain game system development details
爬取豆瓣读书Top250,导入sqlist数据库(或excel表格)中
Xlua get button registration click event of ugui
ROS query topic specific content common instructions
Using cache in vuex to solve the problem of data loss in refreshing state
关于不等式取值转义的思路
知识点总结
Interview key points that must be mastered index and affairs (with B-tree and b+ tree)
DAPP丨LP单双币流动性质押挖矿系统开发原理分析及源码
Basic and necessary common plug-ins of vscade
Wechat applet uniapp left slide delete with Delete Icon
Take you to resolve hash conflicts and implement a simple hash table,
Project practice 4: user login and token access verification (reids+jwt)
How to create and enforce indexes
刷新三观的HP-UX系统中的强指针赋值出core问题
Refresh the strong pointer assignment problem in the HP-UX system of Sanguan
Kubernetes 资源拓扑感知调度优化
Tree array
9. Intelligent transportation project (2)
