zhaoxiaoqiang
2021-07-27 d1425aa67c0c6c0e087ce32b1779ee02bbcdc4c6
src/components/old/upload/uploadImgTl.vue
@@ -126,7 +126,6 @@
    ...mapMutations([SET_APP_LOADING]),
    //删除照片
    deletPhoto(item, i) {
      //console.log(item);
      this.picList.splice(i, 1);
    },
    // 处理图片上传的事件(deleteIndex---删除图片的索引)
@@ -174,10 +173,8 @@
            }
            // 图片的路径获取成功后
            function callback() {
              console.log(img.width,img.height)
              // 压缩后的图片的base64字符串
              let data = that.compress(img);
              console.log(that.getFile(data))
              
              // 调取接口上传图片
              that.submitUploadImg(that.fileType, data, that.deleteIndex);
@@ -305,7 +302,6 @@
        let maxWidthOrHeight = 1024;
        let drawWidth = this.naturalWidth;
        let drawHeight = this.naturalHeight;
        console.log(drawWidth,drawHeight)
        // 以下改变图片大小,控制最大宽度为1024
        var maxSide = Math.max(drawWidth, drawHeight);
        if (maxSide > maxWidthOrHeight) {
@@ -347,8 +343,6 @@
        ctx.drawImage(this, 0, 0, resultWidth, resultHeight);
        // 返回校正图片
        next(canvas.toDataURL("image/jpg", 0.8));
        console.log(image.width,image.height)
      };
      image.src = img;