From 3af1a4c3f1712445a17376205b9ee3c4d7768da6 Mon Sep 17 00:00:00 2001
From: litian <C21AF165>
Date: 星期二, 24 九月 2024 19:29:33 +0800
Subject: [PATCH] zs

---
 pages/personalCenter/certificate/index.js |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/pages/personalCenter/certificate/index.js b/pages/personalCenter/certificate/index.js
index fc8bae3..d17a777 100644
--- a/pages/personalCenter/certificate/index.js
+++ b/pages/personalCenter/certificate/index.js
@@ -4,6 +4,7 @@
 import {
   getPublicImage
 } from "../../../assets/js/middleGround/tool.js";
+import wxbarcode from 'wxbarcode'
 Page({
 
   /**
@@ -41,14 +42,14 @@
     images: [],
     pubCertificateHide: false,
     contentData: {},
-    rzzsImg: ''
+    rzzsImg: '',
+    imgUrl: '',
   },
 
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
    */
   onLoad(options) {
-    console.log(options);
     this.getDataList(false);
   },
 
@@ -126,12 +127,28 @@
       .catch(() => {})
   },
   goBookDetails(e) {
+    let that = this;
     let productList = e.currentTarget.dataset.book.productList
     this.setData({
       contentData: productList,
       pubCertificateHide: true,
     })
-    this.drawImage1()
+    wxbarcode.qrcode('qrcode', productList.wxShareUrl, 160, 160);
+    setTimeout(() => {
+      wx.canvasToTempFilePath({
+        canvasId: 'qrcode',
+        success: function (res) {
+          // res.tempFilePath 鍖呭惈鐢熸垚鐨勫浘鐗囨枃浠惰矾寰�
+          that.setData({
+            imgUrl: res.tempFilePath
+          })
+        }
+      });
+      setTimeout(() => {
+        this.drawImage1()
+      }, 100)
+    }, 100)
+
   },
   drawImage1() {
     let that = this;
@@ -158,7 +175,7 @@
                 showIndex: true,
                 visible: true,
               })
-            }, 1000)
+            }, 100)
           },
         })
       },

--
Gitblit v1.9.1