|
@@ -160,7 +160,10 @@
|
|
src: res.data.signImg,
|
|
src: res.data.signImg,
|
|
success(res) {
|
|
success(res) {
|
|
var ctx = uni.createCanvasContext('handWriting')
|
|
var ctx = uni.createCanvasContext('handWriting')
|
|
- ctx.drawImage(res.path, 0, 0, 330, 244)
|
|
|
|
|
|
+ console.log(res.width);
|
|
|
|
+ console.log(res.height);
|
|
|
|
+ ctx.drawImage(res.path, 0, 0)
|
|
|
|
+ // ctx.drawImage(res.path, 0, 0, 330, 244)
|
|
ctx.save()
|
|
ctx.save()
|
|
ctx.draw()
|
|
ctx.draw()
|
|
},
|
|
},
|
|
@@ -196,10 +199,15 @@
|
|
// })
|
|
// })
|
|
// return
|
|
// return
|
|
// }
|
|
// }
|
|
|
|
+
|
|
uni.canvasToTempFilePath({
|
|
uni.canvasToTempFilePath({
|
|
canvasId: 'handWriting',
|
|
canvasId: 'handWriting',
|
|
fileType: 'png',
|
|
fileType: 'png',
|
|
quality: 1, //图片质量
|
|
quality: 1, //图片质量
|
|
|
|
+ width:330,
|
|
|
|
+ height:244,
|
|
|
|
+ destWidth:330,
|
|
|
|
+ destHeight:244,
|
|
success(res) {
|
|
success(res) {
|
|
console.log(res.tempFilePath, 'canvas生成图片地址');
|
|
console.log(res.tempFilePath, 'canvas生成图片地址');
|
|
uploadImage('image', res.tempFilePath, 'appData/',
|
|
uploadImage('image', res.tempFilePath, 'appData/',
|
|
@@ -207,8 +215,6 @@
|
|
// 上传成功
|
|
// 上传成功
|
|
console.log('图片地址', result)
|
|
console.log('图片地址', result)
|
|
that.dataDetails.cargoOwnerAutograph = result
|
|
that.dataDetails.cargoOwnerAutograph = result
|
|
-
|
|
|
|
-
|
|
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
title: '加载中',
|
|
title: '加载中',
|
|
mask: true
|
|
mask: true
|