js_ryl 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/build.js +1 -1
- package/package.json +1 -1
- package/src/App.vue +1 -1
- package/src/reg/index.js +11 -3
package/README.md
CHANGED
package/dist/build.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("js_ryl",[],e):"object"==typeof exports?exports.js_ryl=e():t.js_ryl=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=1)}([function(t,e,n){"use strict";var r={throole:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=0;return function(){var r=this,o=Date.now();o-n>e&&(t.call(r,arguments),n=o)}},debounce:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=null;return function(){var r=arguments,o=this;clearTimeout(n),n=setTimeout(function(){t.apply(o,r)},e)}}};e.a=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),o=n(3),a=n(4),i=n(0),u=n(5),c=n(6);e.default={reg:r.a,time:o.a,cookie:a.a,fun:i.a,num:u.a,copy:c.a}},function(t,e,n){"use strict";var r=!1,o=null,a={Email:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"请输入邮箱",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"邮箱格式有误",r=/^([0-9A-Za-z\-_\.]+)@([0-9a-z]+\.[a-z]{2,3}(\.[a-z]{2})?)$/g;return t?!!r.test(t)||n:e},IdCard:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"请输入身份证号码",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"身份证号码格式有误",r=/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;return t?!!r.test(t)||n:e},Common:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"请输入包含数字、字母以及下划线的内容",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"只能包含数字、字母以及下划线",r=/^[a-zA-Z0-9_]+$/;return t?!!r.test(t)||n:e},QQ:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"请输入QQ号码",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"QQ号码格式错误",r=/^[1-9][0-9]{4,10}$/gim;return t?!!r.test(t)||n:e},Money:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"请输入金额(最多保留2位小数点)",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"金额格式错误",r=/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;return t?!!r.test(t)||n:e},Phone:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"请输入手机号码",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"手机号码格式有误",r=/^[1][3,4,5,7,8,9][0-9]{9}$/;return t?!!r.test(t)||n:e},PhoneCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:60,
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("js_ryl",[],e):"object"==typeof exports?exports.js_ryl=e():t.js_ryl=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=1)}([function(t,e,n){"use strict";var r={throole:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=0;return function(){var r=this,o=Date.now();o-n>e&&(t.call(r,arguments),n=o)}},debounce:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=null;return function(){var r=arguments,o=this;clearTimeout(n),n=setTimeout(function(){t.apply(o,r)},e)}}};e.a=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),o=n(3),a=n(4),i=n(0),u=n(5),c=n(6);e.default={reg:r.a,time:o.a,cookie:a.a,fun:i.a,num:u.a,copy:c.a}},function(t,e,n){"use strict";var r=!1,o=null,a="",i=null,u={Email:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"请输入邮箱",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"邮箱格式有误",r=/^([0-9A-Za-z\-_\.]+)@([0-9a-z]+\.[a-z]{2,3}(\.[a-z]{2})?)$/g;return t?!!r.test(t)||n:e},IdCard:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"请输入身份证号码",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"身份证号码格式有误",r=/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;return t?!!r.test(t)||n:e},Common:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"请输入包含数字、字母以及下划线的内容",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"只能包含数字、字母以及下划线",r=/^[a-zA-Z0-9_]+$/;return t?!!r.test(t)||n:e},QQ:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"请输入QQ号码",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"QQ号码格式错误",r=/^[1-9][0-9]{4,10}$/gim;return t?!!r.test(t)||n:e},Money:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"请输入金额(最多保留2位小数点)",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"金额格式错误",r=/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;return t?!!r.test(t)||n:e},Phone:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"请输入手机号码",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"手机号码格式有误",r=/^[1][3,4,5,7,8,9][0-9]{9}$/;return t?!!r.test(t)||n:e},PhoneCode:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:60,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"后重新获取";if(a=t.target.innerText,i=t,!r){r=!0,t.target.innerText=n-1+"s"+u;var c=n-1;o=setInterval(function(){c--,c<=0?(t.target.innerText=a,e.PhoneCodeClear()):t.target.innerText=c+"s"+u},1e3)}},PhoneCodeClear:function(){r=!1,i.target.innerText=a,clearInterval(o)},phoneCodeStatus:function(){return r}};e.a=u},function(t,e,n){"use strict";function r(t){return t<10?"0"+t:t}var o={toDate:function(t,e){var n="";n=10==String(t).length?new Date(1e3*t):new Date(t);var o=n.getFullYear(),a=n.getMonth()+1,i=n.getDate(),u=n.getHours(),c=n.getMinutes(),s=n.getSeconds();return"yyyy-MM-dd"==e?o+"-"+r(a)+"-"+r(i):"yyyy-MM-dd HH:mm"==e?o+"-"+r(a)+"-"+r(i)+" "+r(u)+":"+r(c):o+"-"+r(a)+"-"+r(i)+" "+r(u)+":"+r(c)+":"+r(s)},toStamp:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=new Date(t.replace(/-/g,"/")).getTime().toString();return 10==e&&(n=n.substr(0,10)),parseInt(n)}};e.a=o},function(t,e,n){"use strict";var r={set:function(t,e,n){n=n||{};var r=n.path?";Path="+n.path:"",o="";n.expires&&(n.expires=10==String(n.expires).length?new Date(1e3*n.expires):new Date(n.expires),o=";expires="+n.expires),document.cookie=t+"="+e+r+o},get:function(t){for(var e=document.cookie,n=e.split("; "),r=0;r<n.length;r++)if(n[r].split("=")[0]===t)return n[r].split("=")[1];return""},remove:function(t,e){e=e||{},e.expires=-1,r.set(t,null,e)}};e.a=r},function(t,e,n){"use strict";var r=(n(0),function(t){var e=0;try{t=Number(t);var n=t.toString().toUpperCase();if(2===n.split("E").length){var r=!1;2===n.split(".").length&&(n=n.split(".")[1],0!==parseInt(n.split("E")[0])&&(r=!0));var o=n.split("E");r&&(e=o[0].length),e-=parseInt(o[1])}else 2===n.split(".").length&&0!==parseInt(n.split(".")[1])&&(e=n.split(".")[1].length)}catch(t){throw t}finally{return(isNaN(e)||e<0)&&(e=0),e}}),o=function(t){t=Number(t);var e=r(t),n=t.toString().toUpperCase();return 2===n.split("E").length?Math.round(t*Math.pow(10,e)):Number(n.replace(".",""))},a=function(t,e,n,r){var o=0;switch(t){case"add":o=e+n;break;case"sub":o=e-n;break;case"div":o=e/n;break;case"mul":o=e*n}return Math.abs(r-o)>1?o:r},i={add:function(t,e){t=Number(t),e=Number(e);var n,o,i;try{n=r(t)+1}catch(t){n=0}try{o=r(e)+1}catch(t){o=0}i=Math.pow(10,Math.max(n,o));var u=(this.mul(t,i)+this.mul(e,i))/i;return a("add",t,e,u)},sub:function(t,e){t=Number(t),e=Number(e);var n,o,i;try{n=r(t)+1}catch(t){n=0}try{o=r(e)+1}catch(t){o=0}i=Math.pow(10,Math.max(n,o));var u=Number((this.mul(t,i)-this.mul(e,i))/i);return a("sub",t,e,u)},div:function(t,e){t=Number(t),e=Number(e);var n,i,u=0,c=0;try{u=r(t)}catch(t){}try{c=r(e)}catch(t){}n=o(t),i=o(e);var s=this.mul(n/i,Math.pow(10,c-u));return a("div",t,e,s)},mul:function(t,e){t=Number(t),e=Number(e);var n=0,i=t.toString(),u=e.toString();try{n+=r(i)}catch(t){}try{n+=r(u)}catch(t){}var c=o(i)*o(u)/Math.pow(10,n);return a("mul",t,e,c)}};e.a=i},function(t,e,n){"use strict";function r(t,e){var n=document.createElement("input");n.setAttribute("readonly","readonly"),n.setAttribute("value",t),document.body.appendChild(n),document.execCommand("copy")?(n.select(),document.execCommand("copy"),e({code:200,msg:"复制成功"})):e({code:100,msg:"当前浏览器不支持,请更换浏览器后重试"}),document.body.removeChild(n)}e.a=r}])});
|
package/package.json
CHANGED
package/src/App.vue
CHANGED
package/src/reg/index.js
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
var phoneCodeStatus = false
|
|
3
3
|
// 验证码计时器
|
|
4
4
|
var phoneCodeTimer = null
|
|
5
|
+
// 验证码的文本
|
|
6
|
+
var phoneCodeName = ''
|
|
7
|
+
// 验证码按钮本身
|
|
8
|
+
var phoneCodeSelf = null
|
|
5
9
|
// 正则匹配
|
|
6
10
|
let reg = {
|
|
7
11
|
// 邮箱验证
|
|
@@ -104,7 +108,10 @@ let reg = {
|
|
|
104
108
|
},
|
|
105
109
|
// 手机验证码
|
|
106
110
|
PhoneCode(e,ss=60,cc='后重新获取'){
|
|
107
|
-
|
|
111
|
+
// 存储按钮文案
|
|
112
|
+
phoneCodeName = e.target.innerText
|
|
113
|
+
// 存储按钮本身
|
|
114
|
+
phoneCodeSelf = e
|
|
108
115
|
if (!phoneCodeStatus) {
|
|
109
116
|
phoneCodeStatus = true
|
|
110
117
|
e.target.innerText = `${ss-1}s${cc}`
|
|
@@ -113,8 +120,8 @@ let reg = {
|
|
|
113
120
|
timer--
|
|
114
121
|
if (timer <= 0) {
|
|
115
122
|
// 时间归0后,设置按钮名称
|
|
116
|
-
e.target.innerText =
|
|
117
|
-
|
|
123
|
+
e.target.innerText = phoneCodeName
|
|
124
|
+
this.PhoneCodeClear()
|
|
118
125
|
} else {
|
|
119
126
|
e.target.innerText = `${timer}s${cc}`
|
|
120
127
|
}
|
|
@@ -124,6 +131,7 @@ let reg = {
|
|
|
124
131
|
// 清除手机验证码
|
|
125
132
|
PhoneCodeClear(){
|
|
126
133
|
phoneCodeStatus = false
|
|
134
|
+
phoneCodeSelf.target.innerText = phoneCodeName
|
|
127
135
|
clearInterval(phoneCodeTimer)
|
|
128
136
|
},
|
|
129
137
|
// 验证码状态是否已经发送
|