当前位置: 首页 > wzjs >正文

广东做网站的公司资阳市网站seo

广东做网站的公司,资阳市网站seo,陕西网站建设方案,wordpress后台管理插件效果&#xff1a; 功能&#xff1a;实现重签 退出 保存 等功能 解决的问题: 电子签名画布抖动问题解 注意&#xff1a; 保存的时候上传到自己的服务器地址&#xff0c;后端返回图片地址 代码&#xff1a; <template><view><view class"signature&qu…

效果:

功能:实现重签  退出  保存 等功能

解决的问题:  电子签名画布抖动问题解

注意: 保存的时候上传到自己的服务器地址,后端返回图片地址

代码:

<template><view><view class="signature" v-show="showCanvas"><canvas class="mycanvas" canvas-id="drawCanvas" id="drawCanvas" @touchstart="touchstart"@touchmove="touchmove" @touchend="touchend" @touchcancel="touchend" disable-scroll></canvas></view><view class="footer"><view class="invite left" @tap="finish">保存</view><view class="invite close" @click="close">退出</view><view class="invite right" @click="clear">重签</view></view></view>
</template><script>export default {data() {return {height: "",showCanvas: true,ctx: '', // 绘图图像points: [], // 路径点集合signature: '',canvasWidth: 0,canvasHeight: 0}},created() {const res = uni.getSystemInfoSync();this.height = res.windowHeight;this.canvasWidth = res.windowWidth;this.canvasHeight = res.windowHeight - 100; // 估算高度,保留底部按钮空间},methods: {close() {this.clear();uni.navigateBack({delta: 1,});},createCanvas() {this.showCanvas = true;this.ctx = uni.createCanvasContext("drawCanvas", this);this.ctx.lineWidth = 4;this.ctx.lineCap = "round";this.ctx.lineJoin = "round";},touchstart(e) {e.preventDefault();let startX = e.changedTouches[0].x;let startY = e.changedTouches[0].y;let startPoint = {X: startX,Y: startY};this.points.push(startPoint);this.ctx.beginPath();},touchmove(e) {e.preventDefault(); // 阻止默认滚动行为let moveX = e.changedTouches[0].x;let moveY = e.changedTouches[0].y;let movePoint = {X: moveX,Y: moveY};this.points.push(movePoint);if (this.points.length >= 2) {this.draw();}},touchend() {this.points = [];},draw() {let point1 = this.points[0];let point2 = this.points[1];this.points.shift();this.ctx.moveTo(point1.X, point1.Y);this.ctx.lineTo(point2.X, point2.Y);this.ctx.stroke();this.ctx.draw(true);},clear() {this.ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight);this.ctx.draw(true);},finish() {let that = this;uni.canvasToTempFilePath({destWidth: 112.5,destHeight: 180,canvasId: 'drawCanvas',success: function(res) {console.log("res", res);let path = res.tempFilePath;that.$emit("store", path);},fail(res) {console.log("err", res);}}, this);}},mounted() {this.createCanvas();}}
</script><style scoped>.signature {z-index: 0;width: 100vw;touch-action: none;/* 禁用默认触摸行为 */}page {background: #fff;}.mycanvas {width: 750rpx;height: calc(100vh - 200upx);touch-action: none;/* 禁用默认触摸行为 */}.footer {display: flex;flex-direction: row-reverse;position: fixed;bottom: 0;width: 100%;padding: 10px 0;margin-bottom: 20px;}.invite {width: 72px;height: 32px;font-size: 12px;text-align: center;line-height: 32px;color: #fff;border-radius: 3px;background-color: #1e7061;margin: 0 10px;}.left {background: #316f60;}.right {background: #8c8c8c;}.close {background: #cd6666;}
</style>

http://www.dtcms.com/wzjs/112887.html

相关文章:

  • 网站推广系统合肥新闻 今天 最新消息
  • 做美食的网站网站推广常用方法
  • 电子商务类网站模板青岛网站建设公司哪家好
  • 电子商务网站开发技术支持电子商务网站建设规划方案
  • 怎样做阿里巴巴网站seo推广灰色词
  • 网站建设的流程该怎么确定站长友情链接平台
  • 怎么做网站app营销计划
  • 高端科技网站建设外链大全
  • 网站安全管理制度建设网盘资源大全
  • 中国建设银行网站用户名是什么意思免费网络推广公司
  • 升级网站网站推广四个阶段
  • 中国诚乡建设部网站怎么设计一个网页
  • 哪个网站做原创歌曲seo引流什么意思
  • 军人可以做网站吗seo推广方法
  • 做金融看哪些网站有哪些产品推广文案范文
  • 做网站最小的字体是多少钱淘宝运营培训班
  • 合肥建设银行招聘网站千锋教育靠谱吗
  • B2C网站开发工程师招聘成都网站建设方案推广
  • 网站建设相关的网站国家重大新闻
  • 韩国女足出线seo整站优化外包
  • 网站快速被百度收录写文章免费的软件
  • 昆明建个网站哪家便宜网络营销是干什么的
  • php python WordPress长春百度网站优化
  • 有什么好用的模拟建站软件数据分析培训班
  • 广州市番禺区住房和建设局网站百度资源分享网
  • 一流高职院校建设专题网站北京推广
  • 罗湖网站建设公司天津seo排名收费
  • 赣州网站建设精英百度关键词优化技巧
  • 网站空间域名知乎推广
  • ps怎么做华为网站界面推广资讯