diff --git a/src/components/page/Login.vue b/src/components/page/Login.vue
index b24bbc7..05f11f7 100644
--- a/src/components/page/Login.vue
+++ b/src/components/page/Login.vue
@@ -12,8 +12,49 @@
-
-
密码登录
+
+
+
+
+
+
+
+
+
+
+
+ 登录
+
+
+
+
+
+
+
+
+
+
+
+
+ 登录
+
+
+
+
+ 前往注册
+ 忘记密码?
+
+
-
+ -->
@@ -59,7 +89,8 @@
@@ -115,6 +146,7 @@ import register from './RegisterForm';
export default {
data: function() {
return {
+ activeName: '0',
isReg: false,
loginForm: {
username: '15794146134',
@@ -124,6 +156,14 @@ export default {
username: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
},
+ phoneParam: {
+ userphone: '',
+ phonePassword: ''
+ },
+ phoneRules: {
+ userphone: [{ required: true, message: '请输入手机号/邮箱', trigger: 'blur' }],
+ phonePassword: [{ required: true, message: '请输入密码', trigger: 'blur' }],
+ },
roleDialog: false,
userId: '',
schoolId: '',
@@ -159,13 +199,14 @@ export default {
})
},
methods: {
- getSchool() {
- this.$refs.login.validate(valid => {
+ getSchool(form) {
+ this.$refs[form].validate(valid => {
if (valid) {
let data = {
- account: this.loginForm.username,
- password: this.loginForm.password,
- schoolId: 2105
+ account: this.activeName == '0' ? this.loginForm.username : this.phoneParam.userphone,
+ password: this.activeName == '0' ? this.loginForm.password : this.phoneParam.phonePassword,
+ schoolId: 2105,
+ source: this.activeName
};
this.$get(this.api.loginSchool, data)
.then(res => {
@@ -182,7 +223,7 @@ export default {
this.studentId = this.schoolList[0].studentId
// this.getRole()
this.roleId = 4
- this.submitForm()
+ this.submitForm(form)
}else{
this.$message.error('账号不存在')
}
@@ -197,7 +238,7 @@ export default {
}
});
},
- getRole() {
+ getRole(form) {
// this.userId = this.schoolList.find((n,k) => {
// return n.schoolId == this.schoolId
// }).userId
@@ -230,7 +271,7 @@ export default {
this.roleDialog = true
}else{
this.roleId = this.roleList[0].roleId
- this.submitForm()
+ this.submitForm(form)
}
})
.catch(res => {});
@@ -239,15 +280,15 @@ export default {
this.loginForm.username = data.username
this.loginForm.password = data.password
},
- roleSure(){
+ roleSure(form){
if(this.roleId){
- this.submitForm()
+ this.submitForm(form)
}else{
this.$message.error('请选择角色!');
}
},
- submitForm() {
- this.$refs.login.validate(valid => {
+ submitForm(form) {
+ this.$refs[form].validate(valid => {
if (valid) {
let data = {
roleId: this.roleId,
@@ -485,17 +526,6 @@ export default {
border-radius: 23px;
border: 0;
}
- .links{
- margin: 20px 0 20px;
- }
- .ques{
- color: #105cb2;
- font-size: 14px;
- }
- .forget{
- color: #ffa94e;
- font-size: 14px;
- }
.login-tips{
margin-bottom: 20px;
font-size: 16px;
@@ -529,4 +559,15 @@ export default {
color: #9076FF;
}
}
+ .links{
+ margin: 20px 0 20px;
+ }
+ .ques{
+ color: #105cb2;
+ font-size: 14px;
+ }
+ .forget{
+ color: #ffa94e;
+ font-size: 14px;
+ }
\ No newline at end of file
diff --git a/src/styles/common.scss b/src/styles/common.scss
index 77e7453..48e9dec 100644
--- a/src/styles/common.scss
+++ b/src/styles/common.scss
@@ -195,7 +195,7 @@
opacity: 0;
}
.ms-login .el-tabs__item{
- padding: 0 90px;
+ padding: 0 40px;
color: #999;
}
.ms-login .el-tabs__item:hover{
@@ -214,12 +214,12 @@
justify-content: center;
}
-.ms-login .el-input__inner{
- height: 80px;
- line-height: 80px;
- border:1px solid rgba(220,220,220,1);
- border-radius:2px;
-}
+// .ms-login .el-input__inner{
+// height: 80px;
+// line-height: 80px;
+// border:1px solid rgba(220,220,220,1);
+// border-radius:2px;
+// }
.header_tab .el-tabs__nav-wrap::after{
background-color: #fff;