微信小程序
一个躺平的小趴菜
这个作者很懒,什么都没留下…
展开
-
多个活动倒计时(小程序版)
大佬请绕路 calculateTime(that, time, fn = () => { }, fn1 = () => { },t = false) { //that 页面this //time 当前时间 //fn与fn1 可以不写 //t 当没有时间传入时获取时间↓ ↓ ↓ ↓ ↓ if(t =...原创 2019-11-04 18:28:50 · 233 阅读 · 0 评论 -
对象排序
最近有个需求是 设置会员等级与折扣 要求是:更低的金额(等级 )不能有更高的折扣 如 :普通会员 要求达到1000元 折扣0.8折 黄金会员 要求达到2000元 折扣0.9折 这个就是有问题的在用户确定时要提醒用户了 下面方法判断出正在设置的金额的 折扣区间 isCorrect(num) { ...原创 2019-11-02 17:10:54 · 85 阅读 · 0 评论 -
利用函数防抖和函数节流提高小程序性能
函数防抖 const _.debounce = (func, wait) => { let timer; return () => { clearTimeout(timer); timer = setTimeout(func, wait); }; }; 函...转载 2019-01-14 18:27:56 · 797 阅读 · 0 评论 -
小程序解析openid php版
bindGetUserInfo: function (e) { let that = this; that.setData({ 'userInfo.nickName': e.detail.userInfo.nickName, 'userInfo.Avatar': e.detail.userInfo.avatarUrl, 'userInfo.province': e.detail.user...原创 2019-01-09 13:35:31 · 299 阅读 · 0 评论