feat: 签名优化

- 解决签名异常的问题
This commit is contained in:
Huangzhe
2025-03-23 18:44:33 +08:00
parent 9265f2da79
commit 0886599a2f
2 changed files with 29 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
<script setup lang="ts">
import { computed, onMounted, ref, useTemplateRef } from 'vue';
import CommonApi from '@/api/common.js';
import { computed, onMounted, ref, useTemplateRef, watch } from 'vue';
import { showConfirmDialog } from 'vant';
// question 属性
const element = defineModel<question>('element', { default: {} });
// 属性框是否激活
@@ -185,15 +186,24 @@ const emitValue = () => {
emit('update:element', element.value);
};
let aIndex = 1;
/**
* 上传文件
*/
async function handleUploadImg() {
const file = new File([saveCanvas('blob')!], 'sign.png', { type: 'image/png' });
const res = await CommonApi.cosUpload(file);
console.log(`sign upload url`, res);
// 传递答案
answer.value = res;
// const file = new File([saveCanvas('blob')!], 'sign.png', { type: 'image/png' });
// const res = await CommonApi.cosUpload(file);
// console.log(`sign upload url`, res);
// // 传递答案
// answer.value = res;
showConfirmDialog({
title: '提示',
message: '上传成功',
showCancelButton: false
}).then(() => {
aIndex++;
answer.value = 'this is test' + aIndex;
});
}
</script>