From fbc074229fd4736f1ae2793c9daebf04726188b2 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期五, 22 五月 2026 18:27:27 +0800
Subject: [PATCH] 提交
---
small-program/pages/payment-success/payment-success.vue | 25 ++++++++++++++++---------
1 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/small-program/pages/payment-success/payment-success.vue b/small-program/pages/payment-success/payment-success.vue
index feacaff..cc52886 100644
--- a/small-program/pages/payment-success/payment-success.vue
+++ b/small-program/pages/payment-success/payment-success.vue
@@ -18,7 +18,7 @@
<view class="pickup-card">
<text class="pickup-title">鏍搁攢鐮�</text>
<view class="qrcode-box">
- <canvas canvas-id="qrcodeCanvas" id="qrcodeCanvas" style="width: 100px; height: 100px;"></canvas>
+ <canvas canvas-id="qrcodeCanvas" id="qrcodeCanvas" :style="'width: '+width+'px; height:'+height+'px;'"></canvas>
<image class="qrcode-image" :src="qrcodeImage" mode="widthFix"></image>
</view>
<text class="pickup-code">{{ orderDetail.memberVerifyCode }}</text>
@@ -33,7 +33,10 @@
export default {
data() {
+
return {
+ height:100,
+ width:100,
orderId: '',
orderDetail: null,
qrcodeImage: ''
@@ -45,6 +48,8 @@
title: '鏀粯鎴愬姛'
})
this.getOrderDetail()
+ this.width = this.rpxToPx(200)
+ this.height = this.rpxToPx(200)
},
methods: {
async getOrderDetail() {
@@ -56,22 +61,25 @@
}
}
},
+ rpxToPx(rpx) {
+ return rpx * wx.getSystemInfoSync().windowWidth / 750
+ },
generateQrcode(code) {
drawQrcode({
canvasId: 'qrcodeCanvas',
text: code,
- width: 100,
- height: 100,
+ width: this.width,
+ height: this.height,
correctLevel: 2
})
- setTimeout(() => {
+ this.$nextTick(() => {
uni.canvasToTempFilePath({
canvasId: 'qrcodeCanvas',
success: (res) => {
this.qrcodeImage = res.tempFilePath
}
}, this)
- }, 100)
+ })
},
goHome() {
uni.switchTab({
@@ -201,11 +209,10 @@
height: 360rpx;
border-radius: 8rpx;
box-sizing: border-box;
- position: relative;
canvas {
- position: absolute;
- top: 0;
- left: 0;
+ position: fixed;
+ top: -100%;
+ left: -100%;
opacity: 0;
}
}
--
Gitblit v1.9.3