From e91147ca515b2684409d4232ca16fea898f2e329 Mon Sep 17 00:00:00 2001
From: Tevin <tingquanren@163.com>
Date: Wed, 26 Feb 2025 18:26:20 +0800
Subject: [PATCH] 知识库文档,项目介绍,文案优化

---
 plugins/qrcode/CQRCode.vue |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/plugins/qrcode/CQRCode.vue b/plugins/qrcode/CQRCode.vue
index de005a7..5658468 100644
--- a/plugins/qrcode/CQRCode.vue
+++ b/plugins/qrcode/CQRCode.vue
@@ -6,22 +6,27 @@
 <template>
     <view class="c-qr-code">
         <canvas ref="canvas"></canvas>
-        <button
+        <AtButton
             v-if="downloadable"
-            @tap="evt => handleSaveToAlbum()"
-        >保存到手机</button>
+            type="primary"
+            full
+            :onClick="evt => handleSaveToAlbum()"
+        >保存到手机</AtButton>
     </view>
 </template>
 
 <script>
 import Taro from '@tarojs/taro';
 import { $ } from '@tarojs/extend';
+import { AtButton } from 'taro-ui-vue';
 import QRCode from 'qrcode';
 import './cQrCode.scss';
 
 export default {
     name: 'CQRCode',
-    components: {},
+    components: {
+        AtButton,
+    },
     props: {
         content: {
             type: String,
@@ -65,7 +70,7 @@
                 canvasDom,
                 this.content,
                 {
-                    width: this.size,
+                    width: this.size * 2,
                     margin: this.margin,
                 },
                 err => {
@@ -73,14 +78,14 @@
                         console.error(err);
                         return;
                     }
-                }
+                },
             );
         },
     },
     mounted() {
         if (process.env.TARO_ENV === 'h5') {
             const canvasBox = $(this.$refs.canvas.$el);
-            const finderTimer = setInterval(() => {
+            this.finderTimer = setInterval(() => {
                 const canvasDom = canvasBox.find('canvas');
                 if (canvasDom.length === 0) {
                     return;
@@ -90,10 +95,13 @@
                 }
                 this._renderQRCodeH5(canvasDom[0]);
                 this.lastContent = this.content;
-            }, 10);
+            }, 100);
         } else {
             // TODO: 小程序中获取canvas
         }
     },
+    beforeDestroy() {
+        clearInterval(this.finderTimer);
+    },
 };
 </script>
\ No newline at end of file

--
Gitblit v1.9.1