WeChat Mini Programs custom component. The canvas picture has been drawn successfully, but it is not displayed on the page.

using canvas, images in custom components has been drawn, and printing is successful. Using the image tag on the page to render also did not render. Answer
clipboard.png

clipboard.png

problem description

the environmental background of the problems and what methods you have tried

related codes

const QR = require (".. /.. / libs/qrcode.js");
Component ({
/ *

)
  • component property list

* /
properties: {


cardNo:{
  type:Number,
  value:{}
},
startDt:{
  type: String,
  value: {}
},
endDt:{
  type: String,
  value: {}
},
cardCode: {
  type: Object,
  value: {},
  observer:function(val){
    if(val && this.data.cardNo){
      this.createQrCode(this.data.cardNo, "mycanvas", 150, 150)
    }
  }
}

},

methods: {

createQrCode(url, canvasId, cavW, cavH) {
  //draw
  QR.api.draw(url, canvasId, cavW, cavH);
  setTimeout(() => { this.canvasToTempImage(this); }, 1000);
},
//data
canvasToTempImage() {
  wx.canvasToTempFilePath({
    canvasId: "mycanvas",
    success: (res) => {
      console.log("",res)
      var tempFilePath = res.tempFilePath;
      this.setData({
        imagePath: tempFilePath,
      });
    },
    fail: function (res) {
      console.log("",res)
    }
  },this);
},

}
})

what result do you expect? What is the error message actually seen?

Sep.16,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b691-2c297.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b691-2c297.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?