![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
微信小程序
JRJ || 575
记录日常
展开
-
微信小程序中的图形验证码
可以在utils中新建一个mcaptcha.js代码如下module.exports = class Mcaptcha {constructor(options) {this.options = options;this.fontSize = options.height * 3 / 6;this.init();this.refresh();}init() {this.ctx = wx.createCanvasContext(this.options.el);this.ctx.setT转载 2021-07-14 10:53:36 · 1701 阅读 · 0 评论 -
微信小程序弹窗禁止页面滚动的实现代码
在小程序弹窗时,外部页面禁止滚动, 可以在最外部容器设置catchtouchmove但是如果弹窗内部也需要滚动,需要用scroll-view包裹,并设置scroll-ycatchtouchmove需要接收个方法,不然会一直警告<view class="box">占位</view><view class="pop" catchtouchmove="touchMove"> <view class="popbg"></view> <v.转载 2021-07-14 10:40:32 · 708 阅读 · 0 评论 -
微信小程序实现类似picker多选
版本迭代picker单选改为多选,官方文档只有多列选择器没有多选,自己写呗最终实现效果图实现思路:1.自己画模态框2.遍历初始数据push新增参数checked:false3.点击改变checked值来实现多选上代码:whtml:modalName变量控制模态框显隐 <view class="picker flex" bindtap='radioChange'> <view class="cen">等级 <view class="count原创 2021-04-01 18:40:31 · 2315 阅读 · 1 评论 -
wx小程序实现左滑删除
实现一、wxml布局这里我是先用了一个大盒子包裹小盒子,然后小盒子里面进行左右布局(左边为内容部分,右边为删除按钮)的方式实现的<view class="cart"> <view > <!-- 通过 isTouchMove 的值来对应移动位置--> <view class="item {{item.isTouchMove ? 'touch-move-active' : ''}}" wx:key="item" wx:f原创 2021-03-16 11:05:46 · 111 阅读 · 0 评论 -
微信小程序获取当前年月日
getNowDate(){ var timestamp = Date.parse(new Date()); var date = new Date(timestamp); //获取年份 var Y =date.getFullYear(); //获取月份 var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1); //获取当日日期 var D = date.get原创 2020-10-22 10:16:56 · 2123 阅读 · 0 评论