本文实例为大家分享了微信小程序手势图案锁屏的具体代码,供大家参考,具体内容如下
参考
H5lock
效果图
WXML
<view class="container"> <view class="reset" bindtap="resetPwd">重置密码</view> <view class="title">{{title}}</view> <canvas canvas-id="canvas" class="canvas" bindtouchend="onTouchEnd" bindtouchstart="onTouchStart" bindtouchmove="onTouchMove"></canvas> </view>
JS
var Locker = class { constructor(page,opt){ var obj = opt || {}; this.page = page; this.width = obj.width || 300; this.height = obj.height || 300; this.canvasId = obj.id || 'canvas'; this.cleColor = obj.cleColor || '#CFE6FF'; this.cleCenterColor = obj.cleCenterColor || '#CFE6FF'; var chooseType = obj.chooseType || 3; // 判断是否缓存有chooseType,有就用缓存,没有就用传入的值 this.chooseType = Number(wx.getStorageSync('chooseType')) || chooseType; this.init(); } init(){ this.pswObj = wx.getStorageSync('passwordxx') "_blank" href="http://xiazai.jb51.net/201801/yuanma/WenxinGestureslock(jb51.net).rar">下载以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。