更新记录
100(2025-12-30)
首次提交,如有不懂直接***:1457958490,备注来意
平台兼容性
uni-app(3.7.8)
| Vue2 |
Vue3 |
Chrome |
Safari |
app-vue |
app-nvue |
Android |
iOS |
鸿蒙 |
| √ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
| 微信小程序 |
支付宝小程序 |
抖音小程序 |
百度小程序 |
快手小程序 |
京东小程序 |
鸿蒙元服务 |
QQ小程序 |
飞书小程序 |
快应用-华为 |
快应用-联盟 |
| √ |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
其他
直接下载,在父组件引入
import sign from './sign.vue'
<sign ref="signatureRef" @saveSuccess="handleSaveSuccess">
const handleSaveSuccess =async (a) => {
let rotatedSignatureBase64 = a;
try {
// ========== 显式指定:逆时针旋转90° ==========
rotatedSignatureBase64 = await rotateSignature90(a, false); // false=逆时针 不需要旋转的话直接传a
uni.showToast({title: '签名已逆时针旋转90°', icon: 'none'});
} catch (err) {
}
signatureImages.value = rotatedSignatureBase64;
showQm.value = false;
// 用旋转后的base64生成文件
const blob = base64ToBlob(rotatedSignatureBase64);
const file = blobToFile(blob, '个人签名_逆时针90度.png'); // 改名便于识别
uni.showLoading({
title: '正在上传签名'
})
uploadQm({
file: file,
// 签名方式:1:pc,2:app
v_type: 2,
img_id: getImgId()
}).then(res => {
if (res.success == true) {
uni.hideLoading()
v_sig_path.value = res.result
uni.showToast({
title: '上传成功',
icon: 'none',
duration: 3000
})
}
}).catch((err) => {
uni.hideLoading()
})
// 赋值给父组件变量
}