|
@@ -724,7 +724,6 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
}
|
|
|
},
|
|
|
/*
|
|
@@ -810,8 +809,7 @@ export default {
|
|
|
w: canvasWidth,
|
|
|
h: canvasHeight
|
|
|
})
|
|
|
- let canvas = uni
|
|
|
- .createCanvasContext('canvas');
|
|
|
+ let canvas = uni.createCanvasContext('canvas');
|
|
|
canvas.width = canvasWidth
|
|
|
canvas.height = canvasHeight
|
|
|
canvas.clearRect(0, 0, canvasWidth,
|
|
@@ -821,8 +819,7 @@ export default {
|
|
|
canvas.save();
|
|
|
// 这里的画布drawImage是一种异步属性 可能存在未绘制全就执行了draw的问题 so添加延迟
|
|
|
setTimeout(e => {
|
|
|
- canvas.draw(true,
|
|
|
- () => {
|
|
|
+ canvas.draw(true,() => {
|
|
|
uni.canvasToTempFilePath({
|
|
|
canvasId: 'canvas',
|
|
|
fileType: 'JPEG',
|
|
@@ -832,11 +829,10 @@ export default {
|
|
|
success: function(
|
|
|
canvasPath
|
|
|
) {
|
|
|
- uploadImg
|
|
|
- (
|
|
|
+ uploadImg(
|
|
|
canvasPath
|
|
|
.tempFilePath
|
|
|
- )
|
|
|
+ )
|
|
|
}
|
|
|
})
|
|
|
});
|