提交 57222d0f authored 作者: JaxBBLL's avatar JaxBBLL

fix

上级 4c1091e0
...@@ -115,18 +115,19 @@ export default { ...@@ -115,18 +115,19 @@ export default {
// 生成签字图片 // 生成签字图片
uni.canvasToTempFilePath({ uni.canvasToTempFilePath({
canvasId: "signatureCanvas", canvasId: "signatureCanvas",
fileType: 'jpg', // 不使用png是因为预览的时候黑底,字也是黑色,导致看不见图片签字
success: async (res) => { success: async (res) => {
const tempFilePath = res.tempFilePath; const tempFilePath = res.tempFilePath;
// 存储照片到本地 // 存储照片到本地
uni.saveImageToPhotosAlbum({ // uni.saveImageToPhotosAlbum({
filePath: tempFilePath, // filePath: tempFilePath,
success: function () { // success: function () {
console.log("图片已成功保存到相册"); // console.log("图片已成功保存到相册");
}, // },
fail: function (err) { // fail: function (err) {
console.error("保存图片到相册失败:", err); // console.error("保存图片到相册失败:", err);
}, // },
}); // });
const base64 = await this.convertFileToBase64(tempFilePath); const base64 = await this.convertFileToBase64(tempFilePath);
// console.log("base64",base64) // console.log("base64",base64)
// 这里可以将 tempFilePath 上传到服务器或进行其他处理 // 这里可以将 tempFilePath 上传到服务器或进行其他处理
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论