Commit 7a0a13e0 authored by lei's avatar lei

Merge branch 'gaoqucodecheck' of...

Merge branch 'gaoqucodecheck' of http://h.gemho.cn:7099/zhaojunbao/gaoquyingjih5-asd into gaoqucodecheck
parents d3056002 1e204885
image/code/erweimabg.png

80.7 KB | W: | H:

image/code/erweimabg.png

527 KB | W: | H:

image/code/erweimabg.png
image/code/erweimabg.png
image/code/erweimabg.png
image/code/erweimabg.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -46,7 +46,11 @@ ...@@ -46,7 +46,11 @@
</div> </div>
<div class="container"> <div class="container">
<div class="qr-card"> <div class="qr-card">
<canvas id="mainCanvas" width="300" height="400"></canvas> <!-- <canvas id="mainCanvas" width="3000" height="4000"></canvas> -->
<!-- 基础调试确认版 -->
<canvas id="mainCanvas" width="420" height="594"></canvas>
<!-- 不晃动rev -->
<!-- <canvas id="mainCanvas" width="375" height="530"></canvas> -->
</div> </div>
<button class="save-btn" onclick="saveCanvas()" v-if="canvasReady">保存二维码</button> <button class="save-btn" onclick="saveCanvas()" v-if="canvasReady">保存二维码</button>
</div> </div>
......
...@@ -2,6 +2,12 @@ var VUE = null ...@@ -2,6 +2,12 @@ var VUE = null
window.addEventListener('load', function () { window.addEventListener('load', function () {
const canvas = document.getElementById('mainCanvas') const canvas = document.getElementById('mainCanvas')
const ctx = canvas.getContext('2d') const ctx = canvas.getContext('2d')
ctx.imageSmoothingEnabled = true;
ctx.imageSmoothingQuality = 'high';
ctx.fillStyle = '#1890ff'; // 或其他所需颜色
ctx.fillRect(0, 0, canvas.width, canvas.height);
// 在原有Vue实例中添加 // 在原有Vue实例中添加
VUE = new Vue({ VUE = new Vue({
el: '#app', el: '#app',
...@@ -158,7 +164,7 @@ window.addEventListener('load', function () { ...@@ -158,7 +164,7 @@ window.addEventListener('load', function () {
// 绘制前景图标 // 绘制前景图标
const fgIconSize = 180 // 假设前景图标显示的尺寸 const fgIconSize = 180 // 假设前景图标显示的尺寸
const fgX = (canvasWidth - fgIconSize) / 2 const fgX = (canvasWidth - fgIconSize) / 2
const fgY = (canvasHeight - fgIconSize) / 2 const fgY = ((canvasHeight - fgIconSize) / 2 ) + 15
// 绘制二维码 // 绘制二维码
ctx.drawImage(img4erweima, fgX, fgY, fgIconSize, fgIconSize) ctx.drawImage(img4erweima, fgX, fgY, fgIconSize, fgIconSize)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment