weapp-qrcode.js
链接:https://pan.baidu.com/s/1wK5fFRSdr5KFNSv1oC7G9Q
提取码:fa32
<template>
<view>
<view class="qrcode">
<canvas style="width: 200upx;height: 200upx;" canvas-id="couponQrcode"></canvas>
</view>
<view class="title">
生成二维码
</view>
</view>
</template>
<script>
const qrCode = require('./weapp-qrcode.js')
export default {
data() {
return {
}
},
onLoad() {
setTimeout(() => {
this.couponQrCode()
}, 500)
},
methods: {
// 二维码生成工具
couponQrCode() {
new qrCode('couponQrcode', {
text: "http://www.jingdong.com",
width: 100,
height: 100,
showLoading:true, // 是否显示loading
loadingText: '二维码生成中', // loading文字
colorDark: "#333333",
colorLight: "#FFFFFF",
correctLevel: qrCode.CorrectLevel.H
})
}
}
}
</script>
<style>
.qrcode {
padding: 50upx 0 20upx 0;
display: flex;
align-items: center;
justify-content: center;
}
.title {
text-align: center;
}
</style>
转载请注明原文地址:https://ipadbbs.8miu.com/read-57474.html