NurseStationPersonAppletUl/pages/signature/signature.vue

49 lines
954 B
Vue
Raw Normal View History

2023-03-28 10:02:47 +08:00
<template>
2023-04-12 14:57:18 +08:00
<view class="" style="background-color: #F4F5F7;">
2023-03-28 10:02:47 +08:00
<Signature @init="onSignInit" style='background-color: #fff;'></Signature>
<view class="btns">
<button @click="clear">清空</button>
<button @click="revoke">撤回</button>
<button @click="saveTempFilePath">保存</button>
</view>
</view>
</template>
<script>
import Signature from '@/components/v-sign/v-sign.vue'
export default {
components: {
Signature
},
methods: {
onSignInit(signCtx) {
this.signCtx = signCtx
},
// 清空
clear() {
this.signCtx.clear()
},
// 撤回
revoke() {
this.signCtx.revoke()
},
// 保存为临时图片路径h5返回 base64
async saveTempFilePath() {
const res = await this.signCtx.canvasToTempFilePath()
this.$emit('userSignaturePictureUrl', res)
},
}
}
</script>
<style lang='scss'>
.btns {
margin-top: 50rpx;
display: flex;
}
button {
width: 30%;
}
</style>