Commit 1e204885 authored by xinzhedeai's avatar xinzhedeai

商户详情二维码调整

parent be175b2e
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 @@
</div>
<div class="container">
<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>
<button class="save-btn" onclick="saveCanvas()" v-if="canvasReady">保存二维码</button>
</div>
......
......@@ -2,6 +2,12 @@ var VUE = null
window.addEventListener('load', function () {
const canvas = document.getElementById('mainCanvas')
const ctx = canvas.getContext('2d')
ctx.imageSmoothingEnabled = true;
ctx.imageSmoothingQuality = 'high';
ctx.fillStyle = '#1890ff'; // 或其他所需颜色
ctx.fillRect(0, 0, canvas.width, canvas.height);
// 在原有Vue实例中添加
VUE = new Vue({
el: '#app',
......@@ -158,7 +164,7 @@ window.addEventListener('load', function () {
// 绘制前景图标
const fgIconSize = 180 // 假设前景图标显示的尺寸
const fgX = (canvasWidth - fgIconSize) / 2
const fgY = (canvasHeight - fgIconSize) / 2
const fgY = ((canvasHeight - fgIconSize) / 2 ) + 15
// 绘制二维码
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