收藏
回答

实用uni.compressImage压缩png透明图片,压缩后为什么变成黑色背景了?

uni.compressImage({
  src: tempFilePaths[0],
  quality: 60,
  success: res => {
   uni.uploadFile({
     url: env.BASEURL + '/sys/file/upload',
     filePath: res.tempFilePath,
     formData: {tableName:that.tableName, filePath: that.tableName,fieldType:that.fieldType},
     name: 'file',
     success: (uploadFileRes) => {
    let res = JSON.parse(uploadFileRes.data);
    if (res && res.code == 0) {
      //回显给附件
    } else {
      //上传接口调用失败处理提醒
    }

     }
   });
   that.showChooseFile = true;
  }
})


回答关注问题邀请回答
收藏
登录 后发表内容