MicroCommunityWeb/public/components/inspection/inspectionPointQrCode/inspectionPointQrCode.js
2024-06-15 14:29:38 +08:00

34 lines
1.3 KiB
JavaScript

(function (vc) {
vc.extends({
data: {
inspectionPointQrCodeInfo: {
url: '',
inspectionName: '',
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on('inspectionPointQrCode', 'openInspectionPointQrCodeModal', function (_param) {
vc.copyObject(_param, $that.inspectionPointQrCodeInfo);
$('#inspectionPointQrCodeModel').modal('show');
$that._viewQr($that.inspectionPointQrCodeInfo.url);
});
},
methods: {
// 两分钟后显示遮罩层
_viewQr: function (_url) {
document.getElementById("qrcode").innerHTML = "";
let qrcode = new QRCode(document.getElementById("qrcode"), {
text: "213", //你想要填写的文本
width: 200, //生成的二维码的宽度
height: 200, //生成的二维码的高度
colorDark: "#000000", // 生成的二维码的深色部分
colorLight: "#ffffff", //生成二维码的浅色部分
correctLevel: QRCode.CorrectLevel.L
});
qrcode.makeCode(_url);
}
}
});
})(window.vc);