How to display Mini Program's QR code directly on the page

return a piece of data through Mini Program"s QR code api
estimated to be binary

how to convert this data into a picture and display it on the page

can it be done without sending it to the server for processing

Mar.13,2021

let that = this;
wx.downloadFile({
      url: '',
      header:{
        'Content-Type':'image',
      },
      success: function (res) {
        if (res.statusCode === 200) {
          that.setData({
            imageData:res.tempFilePath
          })
        }
      },fail:function(err){
        console.log(err)
      }
    })
filePathsrc;
If

is not sent to the server, you will have to convert the binary. Parse the binary image


directly add
header ('content-type:image/jpg') to the program;
the output type is the picture

.
Menu