@@ -1,4 +1,6 @@
var api = require('../../../config/api.js');
+var check = require('../../../utils/check.js');
+
var app = getApp();
Page({
data: {
@@ -65,6 +67,15 @@ Page({
return false;
}
+ if (!check.isValidPhone(this.data.mobile)) {
+ wx.showModal({
+ title: '错误信息',
+ content: '手机号输入不正确',
+ showCancel: false
+ });
+ return false;
+ }
wx.request({
url: api.AuthRegister,
@@ -90,7 +101,13 @@ Page({
});
-
+ else{
+ content: res.data.errmsg,
@@ -46,6 +48,15 @@ Page({
if (this.data.password.length < 3) {
wx.showModal({
title: '错误信息',
@@ -0,0 +1,12 @@
+function isValidPhone(str) {
+ var myreg = /^[1][3,4,5,7,8][0-9]{9}$/;
+ if (!myreg.test(str)) {
+ } else {
+ return true;
+}
+module.exports = {
+ isValidPhone