手写签名软件手机版下载 手写签名软件( 二 )

<0>.clientX - this.stageInfo.left, e.changedTouches<0>.clientY - this.stageInfo.top ) //计算、描绘划过的路径 this.path.endX = e.changedTouches<0>.clientX - this.stageInfo.left; this.path.endY = e.changedTouches<0>.clientY - this.stageInfo.top; this.cxt.stroke() this.isCanvas = true } drawEnd(){ document.removeEventListener("touchstart",preHandler,false) document.removeEventListener("touchend",preHandler,false) document.removeEventListener("touchmove",preHandler,false) } clear(btn){ this.isCanvas = false this.cxt.clearRect(0,0,500,800) } save(){ return canvas.toDataURL("image/png") } getIsCanvas(){ return this.isCanvas } } export default{ data(){ return { msg: "welcome to your haiguan App", val: true, url: "", canvasUrl:'', isCanvas : false, xValue:0, yValue:0, pdfUrl:'' } }, created(){ }, activated() {}, mounted(){//加载 draw = new Draw("canvas") var width = document.body.clientWidth || document.documentElement.clientWidth var height = document.body.clientHeight || document.documentElement.clientHeight var canvasElement = document.getElementById('canvas') canvasElement.width = width - 2 canvasElement.height = height - 102 draw.init() }, methods:{。。。。。图片合并逻辑接口,暂时删除clear: function(){//清除画布,当用户书写完后,发现不好看,可以进入清除画面,重新书写签名 draw.clear() this.isCanvas = false }, save: function(){//书写完签名后,进入保存 this.isCanvas = draw.getIsCanvas() if(!this.isCanvas){ this.$message.error('请签名') return } 。。。。。。签名完后面的逻辑,暂时删除 } } }</script><style lang="stylus" scoped>@import '../../common/stylus/variable'.resisterSign height: 100% .container padding-top: 40px height: calc(100% - 40px) #canvas background: white cursor:default border:1px dashed #666 display:block // width: calc(100% - 2px) // height: calc(100% - 62px) .btns-bottom height: 40px padding: 10px 5px .but background: $color-btn1 border-radius: $cont-border-radius width: calc(50% - 10px) float: left margin: 0 5px .but-orange background: $color-btn4 #keyword-box margin:10px 0</style>

推荐阅读