| | |
| | | class="c-signature-layer" |
| | | title="手写板 / 请书写签名" |
| | | :isOpened="layerOpened" |
| | | :onClose="evt => null" |
| | | :onClose="evt => handleClose()" |
| | | > |
| | | <view class="c-signature-layer-draw"> |
| | | <view class="size-box-top"></view> |
| | |
| | | this._initDraw(); |
| | | this.layerOpened = true; |
| | | this._callback = callback; |
| | | this.handleRestDraw(); |
| | | setTimeout(() => { |
| | | this.handleRestDraw(); |
| | | }, 10); |
| | | }, |
| | | handleRestDraw() { |
| | | this.firstTouch = true; |
| | | this.curLine = []; |
| | | this.chirography = []; |
| | | this.canvasContext.clearRect(0, 0, this.cavWidth, this.cavHeight); |
| | | this.canvasContext.setFillStyle('#ffffff'); |
| | | this.canvasContext.fillRect(0, 0, this.cavWidth, this.cavHeight); |
| | | this.canvasContext.draw(); |
| | | }, |
| | | handleClose() { |
| | | this.layerOpened = false; |
| | | }, |
| | | handleWriteStart(evt) { |
| | | if (evt.type != 'touchstart') { |
| | |
| | | point[1].r, |
| | | point[2].x, |
| | | point[2].y, |
| | | point[2].r |
| | | point[2].r, |
| | | ); |
| | | this._bethelDraw(a, true); |
| | | point = [{ x: x, y: y, r: r }]; |
| | |
| | | point[i].c2x, |
| | | point[i].c2y, |
| | | point[i].ex, |
| | | point[i].ey |
| | | point[i].ey, |
| | | ); |
| | | } |
| | | ctx.stroke(); |