|
@@ -5,8 +5,8 @@
|
|
|
<div class="signature-container">
|
|
|
<vue-signature-pad ref="signaturePad" :options="signaturePadOptions" class="signature-pad" />
|
|
|
<div class="signature-btns">
|
|
|
- <van-button type="primary" @click="handleClear">重新签名</van-button>
|
|
|
- <van-button type="info" @click="handleConfirm">确认签名</van-button>
|
|
|
+ <van-button plain @click="handleClear">重新签名</van-button>
|
|
|
+ <van-button type="primary" @click="handleConfirm">确认签名</van-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</van-popup>
|
|
@@ -79,8 +79,9 @@
|
|
|
// 关闭弹窗
|
|
|
const getImg = () => {
|
|
|
const response = signaturePad.value.saveSignature();
|
|
|
+ console.log('子组件:', response);
|
|
|
if (response.isEmpty) {
|
|
|
- return response;
|
|
|
+ return response.data;
|
|
|
} else {
|
|
|
// 转成二进制形式
|
|
|
const binaryData = convertBase64ToBinary(response.data);
|
|
@@ -93,7 +94,10 @@
|
|
|
// 确认签名(可根据需求将签名数据传递给父组件等)
|
|
|
const handleConfirm = () => {
|
|
|
let img = getImg();
|
|
|
- emit('submit', blobToFile(img, '签名图片.png'));
|
|
|
+ console.log('子组件:', img);
|
|
|
+ if(img){
|
|
|
+ emit('submit', blobToFile(img, '签名图片.png'));
|
|
|
+ }
|
|
|
isShowSignature.value = false;
|
|
|
};
|
|
|
|