From e56792f78e4df0df2f12552d1a61dd8ca1db5c67 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期一, 27 四月 2026 22:26:28 +0800
Subject: [PATCH] app
---
small-program/pages/payment-success/payment-success.vue | 70 ++++++++++++++++++++++++++++++----
1 files changed, 61 insertions(+), 9 deletions(-)
diff --git a/small-program/pages/payment-success/payment-success.vue b/small-program/pages/payment-success/payment-success.vue
index 4c23426..feacaff 100644
--- a/small-program/pages/payment-success/payment-success.vue
+++ b/small-program/pages/payment-success/payment-success.vue
@@ -16,33 +16,79 @@
</view>
<view class="pickup-card">
- <text class="pickup-title">鑷彁鐮�</text>
+ <text class="pickup-title">鏍搁攢鐮�</text>
<view class="qrcode-box">
- <image class="qrcode-image" src="" mode="aspectFit"></image>
+ <canvas canvas-id="qrcodeCanvas" id="qrcodeCanvas" style="width: 100px; height: 100px;"></canvas>
+ <image class="qrcode-image" :src="qrcodeImage" mode="widthFix"></image>
</view>
- <text class="pickup-code">38389</text>
- <text class="pickup-tip" @tap="copyCode">鐐瑰嚮澶嶅埗鑷彁鐮�</text>
+ <text class="pickup-code">{{ orderDetail.memberVerifyCode }}</text>
+ <text class="pickup-tip" @tap="copyCode">鐐瑰嚮澶嶅埗鏍搁攢鐮�</text>
</view>
</view>
</view>
</template>
<script>
+ import drawQrcode from 'weapp-qrcode'
+
export default {
+ data() {
+ return {
+ orderId: '',
+ orderDetail: null,
+ qrcodeImage: ''
+ }
+ },
+ onLoad(options) {
+ this.orderId = options.orderId
+ uni.setNavigationBarTitle({
+ title: '鏀粯鎴愬姛'
+ })
+ this.getOrderDetail()
+ },
methods: {
+ async getOrderDetail() {
+ const res = await this.$u.api.getOrderDetail(this.orderId)
+ if (res.code === 200) {
+ this.orderDetail = res.data
+ if (this.orderDetail.memberVerifyCode) {
+ this.generateQrcode(this.orderDetail.memberVerifyCode)
+ }
+ }
+ },
+ generateQrcode(code) {
+ drawQrcode({
+ canvasId: 'qrcodeCanvas',
+ text: code,
+ width: 100,
+ height: 100,
+ correctLevel: 2
+ })
+ setTimeout(() => {
+ uni.canvasToTempFilePath({
+ canvasId: 'qrcodeCanvas',
+ success: (res) => {
+ this.qrcodeImage = res.tempFilePath
+ }
+ }, this)
+ }, 100)
+ },
goHome() {
uni.switchTab({
url: '/pages/index/index'
})
},
viewOrder() {
- uni.switchTab({
- url: '/pages/itinerary/itinerary'
+ uni.navigateTo({
+ url:'/pages/delivery-order-detail/delivery-order-detail?userType=0&id='+this.orderId
})
},
copyCode() {
+ if (!this.orderDetail || !this.orderDetail.memberVerifyCode) {
+ return
+ }
uni.setClipboardData({
- data: '38389',
+ data: this.orderDetail.memberVerifyCode,
success: () => {
uni.showToast({
title: '宸插鍒惰嚜鎻愮爜',
@@ -50,7 +96,7 @@
})
}
})
- }
+ }
}
}
</script>
@@ -155,12 +201,18 @@
height: 360rpx;
border-radius: 8rpx;
box-sizing: border-box;
+ position: relative;
+ canvas {
+ position: absolute;
+ top: 0;
+ left: 0;
+ opacity: 0;
+ }
}
.qrcode-image {
width: 100%;
height: 100%;
- background: #f4f6fa;
}
.pickup-code {
--
Gitblit v1.9.3