Commit 14c6a87a authored by liujiangnan's avatar liujiangnan

feat

parent 231fd68e
...@@ -29,7 +29,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -29,7 +29,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
async login(phone, password, passCode = '') { async login(phone, password, passCode = '') {
if (!this.checkPhone(phone)) { if (!this.loginCheckPhone(phone)) {
console.log('请输入正确的手机号码'); console.log('请输入正确的手机号码');
this.middleLayer.showTips(languageString[this.localLanguage].phone_error); this.middleLayer.showTips(languageString[this.localLanguage].phone_error);
return; return;
...@@ -152,6 +152,15 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -152,6 +152,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
} }
loginCheckPhone(phone) {
const test1 = /^[1]([3-9])[0-9]{9}$/;
const test2 = /^([3-9])[0-9]{9}$/;
if (!test1.test(phone)&&!test2.test(phone)) {
return false;
}
return true;
}
checkPhone(phone) { checkPhone(phone) {
let test = /^[1]([3-9])[0-9]{9}$/; let test = /^[1]([3-9])[0-9]{9}$/;
if(this.localLanguage == "ru-ru") { if(this.localLanguage == "ru-ru") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment