| | |
| | | import { |
| | | getPublicImage |
| | | } from "../../../assets/js/middleGround/tool.js"; |
| | | import wxbarcode from 'wxbarcode' |
| | | Page({ |
| | | |
| | | /** |
| | |
| | | images: [], |
| | | pubCertificateHide: false, |
| | | contentData: {}, |
| | | rzzsImg: '' |
| | | rzzsImg: '', |
| | | imgUrl: '', |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | console.log(options); |
| | | this.getDataList(false); |
| | | }, |
| | | |
| | |
| | | .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; |
| | |
| | | showIndex: true, |
| | | visible: true, |
| | | }) |
| | | }, 1000) |
| | | }, 100) |
| | | }, |
| | | }) |
| | | }, |