zs
litian
2024-09-24 3af1a4c3f1712445a17376205b9ee3c4d7768da6
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,
    })
    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)
          },
        })
      },