function checkPhone(value) { var myreg=/^1[3-9]\d{9}$/; console.log(myreg.test(value),'=====222') if (!myreg.test(value)) { return false; } else { return true; } } // 防止处理多次点击 function noMultipleClicks(methods, info) { // methods是点击后需要执行的函数, info是函数需要传的参数 let that = this; if (that.noClick) { // 第一次点击 that.noClick= false; if((info && info !== '') || info ==0) { // info是执行函数需要传的参数 methods(info); } else { methods(); } setTimeout(()=> { that.noClick= true; }, 5000) } else { // 这里是重复点击的判断 } } module.exports = { checkPhone, noMultipleClicks }