|
@@ -329,20 +329,36 @@ export default {
|
|
|
return
|
|
|
} else {
|
|
|
// await this.submitApi()
|
|
|
- uni.request({
|
|
|
- url: this.commitment_electr_signature, //临时路径
|
|
|
- responseType: 'arraybuffer', //设置返回的数据格式为arraybuffer
|
|
|
+ uni.getFileSystemManager().readFile({
|
|
|
+ filePath: this.commitment_electr_signature, //临时路径
|
|
|
+ encoding: 'base64', //编码格式
|
|
|
success: res => {
|
|
|
- const base64 = "data:image/png;base64," + uni.arrayBufferToBase64(res.data)
|
|
|
+ console.log('返回结果', res)
|
|
|
+ const base64 = "data:image/png;base64," + res.data
|
|
|
console.log('sfs签名转成base64', base64)
|
|
|
this.baseAddress = base64
|
|
|
+ // return
|
|
|
this.submits()
|
|
|
},
|
|
|
fail: err => {
|
|
|
- console.log(err)
|
|
|
+ console.log('转base64错误', err)
|
|
|
this.isUploading = false
|
|
|
}
|
|
|
})
|
|
|
+ // uni.request({
|
|
|
+ // url: this.commitment_electr_signature, //临时路径
|
|
|
+ // responseType: 'arraybuffer', //设置返回的数据格式为arraybuffer
|
|
|
+ // success: res => {
|
|
|
+ // const base64 = "data:image/png;base64," + uni.arrayBufferToBase64(res.data)
|
|
|
+ // console.log('sfs签名转成base64', base64)
|
|
|
+ // this.baseAddress = base64
|
|
|
+ // this.submits()
|
|
|
+ // },
|
|
|
+ // fail: err => {
|
|
|
+ // console.log('转base64错误', err)
|
|
|
+ // this.isUploading = false
|
|
|
+ // }
|
|
|
+ // })
|
|
|
}
|
|
|
} else {
|
|
|
this.submits()
|
|
@@ -459,26 +475,6 @@ export default {
|
|
|
|
|
|
});
|
|
|
},
|
|
|
- //提交表单
|
|
|
- // async submitApi() {
|
|
|
- // if (this.commitment_electr_signature) {
|
|
|
- // // this.commitment_electr_signature = await this.$method.uploadFile(
|
|
|
- // // this.commitment_electr_signature,
|
|
|
- // // 0
|
|
|
- // // );
|
|
|
- // var res = await uni.request({
|
|
|
- // url: this.commitment_electr_signature, //临时路径
|
|
|
- // responseType: 'arraybuffer', //设置返回的数据格式为arraybuffer
|
|
|
- // success: res => {
|
|
|
- // const base64 = "data:image/png;base64," + uni.arrayBufferToBase64(res.data)
|
|
|
- // console.log('sfs签名转成base64', base64)
|
|
|
- // this.baseAddress = base64
|
|
|
- // }
|
|
|
- // })
|
|
|
- // console.log('----commitment_electr_signature',res, this.commitment_electr_signature)
|
|
|
- // }
|
|
|
-
|
|
|
- // },
|
|
|
},
|
|
|
};
|
|
|
</script>
|