longz
2026-07-13 5882ba8863d77fdcc168b176c3ffb30e8a20556a
yuyueMiniProgram/src/pages/visitorCode/index.vue
@@ -7,6 +7,10 @@
  qrCode: string
}
function wait(ms: number) {
  return new Promise(resolve => setTimeout(resolve, ms))
}
definePage({
  name: 'visitorCode',
  layout: 'default',
@@ -56,7 +60,7 @@
    errorCorrectionLevel: 'M',
    margin: 1,
  })
  const size = 400
  const size = 448
  const moduleCount = qr.modules.size
  const tileSize = size / moduleCount
  const canvasId = 'sharedVisitorQrCanvas'
@@ -82,14 +86,16 @@
    }
    context.draw(false, () => {
      uni.canvasToTempFilePath({
        canvasId,
        width: size,
        height: size,
        destWidth: size * 2,
        destHeight: size * 2,
        success: res => resolve(res.tempFilePath),
        fail: reject,
      void wait(500).then(() => {
        uni.canvasToTempFilePath({
          canvasId,
          width: size,
          height: size,
          destWidth: size * 2,
          destHeight: size * 2,
          success: res => resolve(res.tempFilePath),
          fail: reject,
        })
      })
    })
  })
@@ -332,8 +338,8 @@
  position: fixed;
  left: -9999px;
  top: -9999px;
  width: 400px;
  height: 400px;
  width: 448px;
  height: 448px;
  opacity: 0;
  pointer-events: none;
}