From fa4c7baec36d58b4bdca66159ece743b5a45a9c8 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期四, 11 六月 2026 10:15:45 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 small-program/pages/payment-success/payment-success.vue |   56 ++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 36 insertions(+), 20 deletions(-)

diff --git a/small-program/pages/payment-success/payment-success.vue b/small-program/pages/payment-success/payment-success.vue
index cc52886..889aa83 100644
--- a/small-program/pages/payment-success/payment-success.vue
+++ b/small-program/pages/payment-success/payment-success.vue
@@ -18,8 +18,8 @@
 			<view class="pickup-card">
 				<text class="pickup-title">鏍搁攢鐮�</text>
 				<view class="qrcode-box">
-					<canvas canvas-id="qrcodeCanvas" id="qrcodeCanvas" :style="'width: '+width+'px; height:'+height+'px;'"></canvas>
-					<image class="qrcode-image" :src="qrcodeImage" mode="widthFix"></image>
+					<canvas v-if="!qrcodeImage" canvas-id="qrcodeCanvas" id="qrcodeCanvas" :style="'width: '+width+'px; height:'+height+'px;'+'opacity: 0;'"></canvas>
+					<image v-else class="qrcode-image" :src="qrcodeImage" mode="widthFix"></image>
 				</view>
 				<text class="pickup-code">{{ orderDetail.memberVerifyCode }}</text>
 				<text class="pickup-tip" @tap="copyCode">鐐瑰嚮澶嶅埗鏍搁攢鐮�</text>
@@ -35,8 +35,8 @@
 		data() {
 			
 			return {
-				height:100,
-				width:100,
+				height:180,
+				width:180,
 				orderId: '',
 				orderDetail: null,
 				qrcodeImage: ''
@@ -65,20 +65,33 @@
 			  return rpx * wx.getSystemInfoSync().windowWidth / 750
 			},
 			generateQrcode(code) {
-				drawQrcode({
-					canvasId: 'qrcodeCanvas',
-					text: code,
-					width: this.width,
-					height: this.height,
-					correctLevel: 2
-				})
 				this.$nextTick(() => {
-					uni.canvasToTempFilePath({
+					drawQrcode({
 						canvasId: 'qrcodeCanvas',
-						success: (res) => {
-							this.qrcodeImage = res.tempFilePath
-						}
-					}, this)
+						text: code,
+						width: this.width,
+						height: this.height,
+						correctLevel: 2
+					})
+					setTimeout(() => {
+						uni.canvasToTempFilePath({
+							canvasId: 'qrcodeCanvas',
+							x: 0,
+							y: 0,
+							width: this.width,
+							height: this.height,
+							destWidth: this.width,
+							destHeight: this.height,
+							success: (res) => {
+								this.qrcodeImage = res.tempFilePath
+							},
+							fail: (err) => {
+								console.error('鐢熸垚浜岀淮鐮佸浘鐗囧け璐�:', err)
+								// 濡傛灉澶辫触锛屼娇鐢� canvas 鐩存帴鏄剧ず
+								this.qrcodeImage = ''
+							}
+						}, this)
+					}, 300)
 				})
 			},
 			goHome() {
@@ -209,11 +222,14 @@
 		height: 360rpx;
 		border-radius: 8rpx;
 		box-sizing: border-box;
+		position: relative;
+		overflow: hidden;
+		display: flex;
+		align-items: center;
+		justify-content: center;
 		canvas {
-			position: fixed;
-			top: -100%;
-			left: -100%;
-			opacity: 0;
+			width: 200px;
+			height: 200px;
 		}
 	}
 

--
Gitblit v1.9.3