| | |
| | | const [key, params] = step; |
| | | if (key === 'drawImage') { |
| | | // 使用图片 |
| | | const img = new Image(); |
| | | const img = (() => { |
| | | if (typeof Image === 'undefined') { |
| | | console.log(this.$refs.canvas); |
| | | return this.$refs.canvas.createImage(); |
| | | } else { |
| | | return new Image(); |
| | | } |
| | | })(); |
| | | img.src = tempPath; |
| | | this.canvasContext.drawImage(img, ...params); |
| | | } else { |
| | |
| | | const needs = nextFiles |
| | | .map((file, needIndex) => { |
| | | const fileInfo = file.file; |
| | | // 没有 file 信息对象,或者不是 blob 类型 |
| | | if (!fileInfo || fileInfo.path.indexOf('blob') < 0) { |
| | | // 没有 file 信息对象,或者不是 blob、wxfile、tmp 类型 |
| | | if ( |
| | | !fileInfo || |
| | | (fileInfo.path.indexOf('blob') < 0 && |
| | | fileInfo.path.indexOf('wxfile') < 0 && |
| | | fileInfo.path.indexOf('http://tmp/') < 0) |
| | | ) { |
| | | return false; |
| | | } |
| | | // 尺寸小于 1M 的图片 |