|
@@ -17,7 +17,7 @@ onMounted(() => {
|
17
|
17
|
const qrcode = new QRCode("qrcode");
|
18
|
18
|
qrcode.makeCode(location.origin + origin.path);
|
19
|
19
|
|
20
|
|
- const qrImage = document.querySelector('#qrcode img');
|
|
20
|
+ const qrCanvas = document.querySelector('#qrcode canvas');
|
21
|
21
|
const canvas = cvsRef.value;
|
22
|
22
|
|
23
|
23
|
// 绘制地图 + 二维码
|
|
@@ -30,8 +30,10 @@ onMounted(() => {
|
30
|
30
|
|
31
|
31
|
// 绘制地图
|
32
|
32
|
ctx.drawImage(mapImage,0,0);
|
|
33
|
+ ctx.save();
|
33
|
34
|
// 绘制二维码, 160 是二维码的大小
|
34
|
|
- ctx.drawImage(qrImage, 1000, 2620, 160, 160);
|
|
35
|
+ ctx.drawImage(qrCanvas, 1000, 2620, 160, 160);
|
|
36
|
+ ctx.save();
|
35
|
37
|
// 保存到 store
|
36
|
38
|
changeImage(canvas.toDataURL('image/png', 0.9));
|
37
|
39
|
};
|
|
@@ -46,6 +48,7 @@ onMounted(() => {
|
46
|
48
|
max-width: 1px;
|
47
|
49
|
max-height: 1px;
|
48
|
50
|
overflow: hidden;
|
|
51
|
+ // z-index: 1000;
|
49
|
52
|
|
50
|
53
|
.qrcode {
|
51
|
54
|
width:160px;
|