diff --git a/common/js/request.js b/common/js/request.js index 037f8d8..a330c34 100644 --- a/common/js/request.js +++ b/common/js/request.js @@ -167,6 +167,30 @@ export default { }) return res[1].data; }, + async sendVertifyCode(params = {}) { + let res = await uni.request({ + url: '/tool/sms/send', + method: 'POST', + data: params + }) + return res[1].data; + }, + async realRegisterUser(params = {}) { + let res = await uni.request({ + url: '/worker/register', + method: 'POST', + data: params + }) + return res[1].data; + }, + async appLogin(params = {}) { + let res = await uni.request({ + url: '/worker/login', + method: 'POST', + data: params + }) + return res[1].data; + }, async qryUserInfo(openId) { let res = await uni.request({ url: '/wx/getWorkerInfo', diff --git a/common/js/validate.js b/common/js/validate.js index 0806fc4..68423e4 100644 --- a/common/js/validate.js +++ b/common/js/validate.js @@ -10,7 +10,10 @@ export default { }, validContactNum: function(contactNum) { - return contactNumRegex.test(contactNum); + if (!contactNum || contactNum.length !== 11) { + return false; + } + return true; }, validIdCard: function(idCardNum) { diff --git a/pages.json b/pages.json index f8bd462..234eca9 100644 --- a/pages.json +++ b/pages.json @@ -5,6 +5,11 @@ "path": "pages/index/msg-dialog" }], "subPackages": [{ + "root": "pages/login", + "pages": [{ + "path": "login" + }] + }, { "root": "pages/area-proxy/", "pages": [{ "path": "my-team" diff --git a/pages/index/index-home.vue b/pages/index/index-home.vue index f3fcfd4..9c73afb 100644 --- a/pages/index/index-home.vue +++ b/pages/index/index-home.vue @@ -103,7 +103,7 @@ - + @@ -179,16 +179,24 @@ } else { this.$refs.vertifyLogin.hideModal(); } - // 校验提示获取手机号码 + // 校验是否注册过 if (!curUserInfo.phone) { - this.$refs.vertifyPhone.showModal(); + uni.reLaunch({ + url: '/pages/login/login?operType=1' + }) return false; - } else { - this.$refs.vertifyPhone.hideModal(); } + // 校验提示获取手机号码 + // if (!curUserInfo.phone) { + // this.$refs.vertifyPhone.showModal(); + // return false; + // } else { + // this.$refs.vertifyPhone.hideModal(); + // } // 提示选择师傅类型 if (curUserInfo.type == null) { this.$refs.vertifyWorkerType.showModal(); + return false; } this.loadData(); return true; diff --git a/pages/index/index.vue b/pages/index/index.vue index 6208eca..2ae675b 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -10,7 +10,7 @@ - + @@ -89,16 +89,24 @@ } else { this.$refs.vertifyLogin.hideModal(); } - // 校验提示获取手机号码 + // 校验是否注册过 if (!curUserInfo.phone) { - this.$refs.vertifyPhone.showModal(); + uni.reLaunch({ + url: '/pages/login/login?operType=1' + }) return false; - } else { - this.$refs.vertifyPhone.hideModal(); } + // 校验提示获取手机号码 + // if (!curUserInfo.phone) { + // this.$refs.vertifyPhone.showModal(); + // return false; + // } else { + // this.$refs.vertifyPhone.hideModal(); + // } // 提示选择师傅类型 if (curUserInfo.type == null) { this.$refs.vertifyWorkerType.showModal(); + return false; } return true; }, diff --git a/pages/login/login.vue b/pages/login/login.vue new file mode 100644 index 0000000..690b1dc --- /dev/null +++ b/pages/login/login.vue @@ -0,0 +1,299 @@ + + + + +