|
@@ -1,18 +1,37 @@
|
|
|
<template>
|
|
|
<div class="pb_content">
|
|
|
- <div class="pb_head">
|
|
|
+ <div
|
|
|
+ class="pb_head"
|
|
|
+ style="
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ "
|
|
|
+ >
|
|
|
<div>
|
|
|
<span>我的资料</span>
|
|
|
</div>
|
|
|
+ <div>
|
|
|
+ <el-button @click="goTo('/eventCenter')" type="primary" size="small"
|
|
|
+ >返回</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="pb_content_body" style="position: relative; width: 100%">
|
|
|
<div style="width: 100%; margin: 0px auto">
|
|
|
- <!-- <div class="data_nav">
|
|
|
+ <div class="data_nav">
|
|
|
<span @click="type = 1" :class="{ active: type == 1 }">我的资料</span>
|
|
|
<span @click="type = 2" :class="{ active: type == 2 }">修改密码</span>
|
|
|
- </div> -->
|
|
|
- <el-form v-if="type == 1" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px"
|
|
|
- class="demo-ruleForm">
|
|
|
+ </div>
|
|
|
+ <el-form
|
|
|
+ v-if="type == 1"
|
|
|
+ :model="ruleForm"
|
|
|
+ :rules="rules"
|
|
|
+ ref="ruleForm"
|
|
|
+ label-width="100px"
|
|
|
+ class="demo-ruleForm"
|
|
|
+ >
|
|
|
<!-- <el-form-item label="姓名" prop="teacherName">
|
|
|
<el-input
|
|
|
v-model="ruleForm.name"
|
|
@@ -21,39 +40,98 @@
|
|
|
></el-input>
|
|
|
</el-form-item> -->
|
|
|
<el-form-item label="姓名" prop="name">
|
|
|
- <el-input v-model="ruleForm.name" style="width: 300px" placeholder="请输入昵称"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="ruleForm.name"
|
|
|
+ style="width: 300px"
|
|
|
+ placeholder="请输入昵称"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="手机号码" prop="phone">
|
|
|
- <el-input v-model="ruleForm.phone" style="width: 300px" placeholder="请输入手机号码"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="ruleForm.phone"
|
|
|
+ style="width: 300px"
|
|
|
+ placeholder="请输入手机号码"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="账号">
|
|
|
- <el-input v-model="ruleForm.username" disabled style="width: 300px" placeholder="请输入昵称"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="ruleForm.username"
|
|
|
+ disabled
|
|
|
+ style="width: 300px"
|
|
|
+ placeholder="请输入昵称"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="地区" prop="sBySchool">
|
|
|
- <el-input v-model="ruleForm.region" disabled style="width: 300px" placeholder=""></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="ruleForm.region"
|
|
|
+ disabled
|
|
|
+ style="width: 300px"
|
|
|
+ placeholder=""
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="学校" prop="sBySchool">
|
|
|
- <el-input v-model="ruleForm.school" disabled style="width: 300px" placeholder=""></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="ruleForm.school"
|
|
|
+ disabled
|
|
|
+ style="width: 300px"
|
|
|
+ placeholder=""
|
|
|
+ ></el-input>
|
|
|
<!-- <el-select v-model="ruleForm.sBySchool" clearable placeholder="请选择学校" disabled>
|
|
|
<el-option :value="ruleForm.sBySchool"> </el-option>
|
|
|
</el-select> -->
|
|
|
</el-form-item>
|
|
|
<el-form-item label="个人简介" prop="intro">
|
|
|
- <el-input v-model="ruleForm.remark" type="textarea" :rows="5" resize="none" placeholder="想说点什么..."
|
|
|
- style="width: 300px"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="ruleForm.remark"
|
|
|
+ type="textarea"
|
|
|
+ :rows="5"
|
|
|
+ resize="none"
|
|
|
+ placeholder="想说点什么..."
|
|
|
+ style="width: 300px"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" @click="submitForm('ruleForm')">修改</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm('ruleForm')"
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div class="password" v-if="type == 2">
|
|
|
<div class="input_box">
|
|
|
<span>原密码</span>
|
|
|
- <el-input class="input" v-model="opassword" placeholder="请输入原密码"></el-input>
|
|
|
+ <el-input
|
|
|
+ class="input"
|
|
|
+ v-model="opassword"
|
|
|
+ placeholder="请输入原密码"
|
|
|
+ ></el-input>
|
|
|
</div>
|
|
|
<div class="input_box">
|
|
|
- <span>修改密码</span>
|
|
|
- <el-input class="input" v-model="password" placeholder="请输入修改密码"></el-input>
|
|
|
+ <span>输入新密码</span>
|
|
|
+ <div style="position: relative">
|
|
|
+ <el-input
|
|
|
+ :type="isLook ? 'type' : 'password'"
|
|
|
+ class="input"
|
|
|
+ v-model="password"
|
|
|
+ placeholder="请输入修改密码"
|
|
|
+ ></el-input>
|
|
|
+ <div class="eye" @click="changeEye">
|
|
|
+ <img :src="isLook ? eye : eyeOff" alt="" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="input_box">
|
|
|
+ <span>再次输入新密码</span>
|
|
|
+ <div style="position: relative">
|
|
|
+ <el-input
|
|
|
+ :type="isLook ? 'type' : 'password'"
|
|
|
+ class="input"
|
|
|
+ v-model="password1"
|
|
|
+ placeholder="请再次输入修改密码"
|
|
|
+ ></el-input>
|
|
|
+ <div class="eye" @click="changeEye">
|
|
|
+ <img :src="isLook ? eye : eyeOff" alt="" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="input_box">
|
|
|
<span></span>
|
|
@@ -102,9 +180,13 @@ export default {
|
|
|
},
|
|
|
opassword: "",
|
|
|
password: "",
|
|
|
+ password1: "",
|
|
|
userinfo: "",
|
|
|
schoolJuri: [],
|
|
|
orgJuri: [],
|
|
|
+ isLook: false,
|
|
|
+ eyeOff: require("../../../assets/icon/eyeOff.png"),
|
|
|
+ eye: require("../../../assets/icon/eye.png"),
|
|
|
userid: this.$store.state.userInfo.userid,
|
|
|
rules: {
|
|
|
pass: [{ validator: validatePass, trigger: "blur" }],
|
|
@@ -129,6 +211,9 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ goTo(path) {
|
|
|
+ this.$router.push(path);
|
|
|
+ },
|
|
|
submitForm(formName) {
|
|
|
this.$refs[formName];
|
|
|
this.$refs[formName].validate((valid) => {
|
|
@@ -139,7 +224,6 @@ export default {
|
|
|
phone: this.ruleForm.phone,
|
|
|
intro: this.ruleForm.remark,
|
|
|
userid: this.userid,
|
|
|
-
|
|
|
},
|
|
|
];
|
|
|
this.ajax
|
|
@@ -159,7 +243,9 @@ export default {
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+ },
|
|
|
+ changeEye() {
|
|
|
+ this.isLook = !this.isLook;
|
|
|
},
|
|
|
getUser() {
|
|
|
let params = { uid: this.userid };
|
|
@@ -194,6 +280,9 @@ export default {
|
|
|
if (this.password.length < 6) {
|
|
|
this.$message.error("密码长度不少于6位");
|
|
|
return;
|
|
|
+ } else if (this.password != this.password1) {
|
|
|
+ this.$message.error("两次新密码不相同");
|
|
|
+ return;
|
|
|
}
|
|
|
let params = [
|
|
|
{
|
|
@@ -233,7 +322,7 @@ export default {
|
|
|
margin: 20px 0;
|
|
|
}
|
|
|
|
|
|
-.formTop>>>.el-form {
|
|
|
+.formTop >>> .el-form {
|
|
|
margin: 0 auto;
|
|
|
}
|
|
|
|
|
@@ -249,8 +338,8 @@ export default {
|
|
|
margin-right: 5px;
|
|
|
}
|
|
|
|
|
|
-.tx>img,
|
|
|
-.emailImg>img {
|
|
|
+.tx > img,
|
|
|
+.emailImg > img {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
}
|
|
@@ -282,8 +371,9 @@ export default {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
justify-content: center;
|
|
|
- align-items: flex-start;
|
|
|
+ align-items: center;
|
|
|
background: #fff;
|
|
|
+ margin-top: 30px;
|
|
|
}
|
|
|
|
|
|
/* .demo-ruleForm >>> .el-form-item__label:before {
|
|
@@ -294,7 +384,7 @@ export default {
|
|
|
.demo-ruleForm >>> .el-form-item__label:nth-child(3) {
|
|
|
content: "";
|
|
|
} */
|
|
|
-.demo-ruleForm>>>.el-form-item__content {
|
|
|
+.demo-ruleForm >>> .el-form-item__content {
|
|
|
width: 300px;
|
|
|
}
|
|
|
|
|
@@ -303,7 +393,7 @@ export default {
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
width: 100%;
|
|
|
- margin: 10px 0;
|
|
|
+ margin: 60px 0 10px 0;
|
|
|
}
|
|
|
|
|
|
.data_nav span {
|
|
@@ -314,8 +404,8 @@ export default {
|
|
|
height: 35px;
|
|
|
}
|
|
|
|
|
|
-.data_nav span+span {
|
|
|
- margin-left: 10px;
|
|
|
+.data_nav span + span {
|
|
|
+ margin-left: 20px;
|
|
|
}
|
|
|
|
|
|
.data_nav .active {
|
|
@@ -350,7 +440,21 @@ export default {
|
|
|
width: 300px;
|
|
|
}
|
|
|
|
|
|
-.input_box+.input_box {
|
|
|
+.input_box + .input_box {
|
|
|
margin-top: 20px;
|
|
|
}
|
|
|
+
|
|
|
+.eye {
|
|
|
+ position: absolute;
|
|
|
+ right: 10px;
|
|
|
+ top: 8px;
|
|
|
+ width: 25px;
|
|
|
+ height: 25px;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.eye > img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+}
|
|
|
</style>
|