Skip to content

Commit

Permalink
新增匹配手机号的正则函数
Browse files Browse the repository at this point in the history
  • Loading branch information
youngjuning committed Apr 28, 2018
1 parent 1baadc6 commit f766eed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions wxPromise.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ const wxPromise = () => {
}
}
}
// 匹配手机号码
wx.pro.matchPhoneNumber = (phoneNumber) => {
let reg = /^(0|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]{8}$/
if (reg.test(phoneNumber)) {
return true
} else {
return false
}
},

// 顶部提示框
wx.pro.showTopTips = (option,that) => {
Expand Down
2 changes: 1 addition & 1 deletion wxPromise.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f766eed

Please sign in to comment.