|
|
@@ -82,10 +82,10 @@
|
|
|
<img src="/static/img/qiye/yonghu@2x.png" alt="">
|
|
|
</div>
|
|
|
<div class="left gr-right" style="margin-bottom: 50px;">
|
|
|
- <ul>
|
|
|
+ <ul style="padding:0">
|
|
|
<li>
|
|
|
<span>姓名</span>
|
|
|
- <span>{{mytoken.realname}}</span>
|
|
|
+ <span style="display: inline-block;width:200px">{{mytoken.realname}}</span>
|
|
|
<button class="modifyname dianji" @click="modify">修改</button>
|
|
|
</li>
|
|
|
<li>
|
|
|
@@ -109,8 +109,8 @@
|
|
|
<ul>
|
|
|
<li>
|
|
|
<span><span class="xinghao" style="width:5px">*</span>姓名</span>
|
|
|
- <input @change="regname" class="realname" type="text" ref="realname" :value="mytoken.realname">
|
|
|
- <p class="usname" ref="usname"></p>
|
|
|
+ <input @blur="regname" @focus="hideregname" class="realname" type="text" ref="realname" value="">
|
|
|
+ <span v-show="isusname" class="usname" ref="usname"></span>
|
|
|
</li>
|
|
|
<li>
|
|
|
<span>UU号</span><span>{{mytoken.uu}}</span>
|
|
|
@@ -220,6 +220,7 @@ import { setTimeout } from 'timers';
|
|
|
mobile: null,
|
|
|
ismodifyname:true,
|
|
|
isname:true,//姓名验证
|
|
|
+ isusname:false,
|
|
|
reg: new RegExp(/[\@\#\$\%\&\*!!\¥]/),//非法字符
|
|
|
isheigh:false,//默认高度
|
|
|
isnews: false,
|
|
|
@@ -372,33 +373,42 @@ import { setTimeout } from 'timers';
|
|
|
},
|
|
|
//修改姓名
|
|
|
modify(){
|
|
|
- this.ismodifyname = false
|
|
|
+ this.ismodifyname = false;
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.$refs.realname.value = this.mytoken.realname;
|
|
|
+ },10)
|
|
|
},
|
|
|
//取消修改姓名
|
|
|
cancel(){
|
|
|
this.ismodifyname = true
|
|
|
},
|
|
|
regname(){
|
|
|
+ this.isusname = true;
|
|
|
let name = this.$refs.realname.value.replace(/\s+/g, "");
|
|
|
if (name == '') {
|
|
|
- this.$refs.usname.innerHTML = '个人姓名不能为空'
|
|
|
- this.isname = false
|
|
|
+ this.$refs.usname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt=""> 个人姓名不能为空'
|
|
|
+ // this.isname = false
|
|
|
} else {
|
|
|
- this.isname = true
|
|
|
+ // this.isname = true
|
|
|
if (this.reg.test(name)) {
|
|
|
- this.$refs.usname.innerHTML = '不能包含非法字符'
|
|
|
+ this.$refs.usname.innerHTML = '<img style="width:14px" src="/static/img/warning.png" alt=""> 不能包含非法字符'
|
|
|
this.isname = false
|
|
|
} else {
|
|
|
- this.$refs.usname.innerHTML = ''
|
|
|
+ this.$refs.usname.innerHTML = '<img style="width:14px" src="/static/img/ok.png" alt="">'
|
|
|
this.isname = true
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ hideregname(){
|
|
|
+ this.isusname = false;
|
|
|
+ },
|
|
|
// 保存修改姓名
|
|
|
Preservation(){
|
|
|
- if (this.isname) {
|
|
|
- let name = this.$refs.realname.value.replace(/\s+/g, "");
|
|
|
- let id = this.mytoken.id;
|
|
|
+ let name = this.$refs.realname.value.replace(/\s+/g, "");
|
|
|
+ let id = this.mytoken.id;
|
|
|
+ if (name == '') {
|
|
|
+ this.$message.error('个人姓名不能为空');
|
|
|
+ } else if (this.isname) {
|
|
|
this.$ajax({
|
|
|
url: this.$url.api+"/api/account/account/update",
|
|
|
method :'post',
|
|
|
@@ -418,10 +428,9 @@ import { setTimeout } from 'timers';
|
|
|
this.$router.go(0);
|
|
|
}
|
|
|
})
|
|
|
- .catch(err=>{
|
|
|
- // console.log("请求错误",err);
|
|
|
- })
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ this.$message.error('姓名不能包含非法字符');
|
|
|
+ }
|
|
|
},
|
|
|
//ele常见问题
|
|
|
handleSelect(){
|
|
|
@@ -503,13 +512,13 @@ import { setTimeout } from 'timers';
|
|
|
background: #1E88F5 !important;
|
|
|
}
|
|
|
.modifyname {
|
|
|
- margin-left: 80px;
|
|
|
+ margin-left: 20px;
|
|
|
font-family: PingFangSC-Regular;
|
|
|
font-size: 14px;
|
|
|
color: #FFFFFF;
|
|
|
letter-spacing: 0.25px;
|
|
|
text-align: center;
|
|
|
- padding: 5px 20px;
|
|
|
+ padding: 5px 30px;
|
|
|
background: #1E88F5;
|
|
|
border-radius: 2px;
|
|
|
border: 0
|
|
|
@@ -534,8 +543,7 @@ import { setTimeout } from 'timers';
|
|
|
padding-left: 5px;
|
|
|
}
|
|
|
.usname {
|
|
|
- height: 0px;
|
|
|
- margin-left: 85px;
|
|
|
+ margin-left: 10px;
|
|
|
color: red;
|
|
|
font-size: 12px;
|
|
|
}
|
|
|
@@ -574,10 +582,10 @@ import { setTimeout } from 'timers';
|
|
|
white-space: nowrap;
|
|
|
}
|
|
|
.gs-news > ul > li > span:nth-child(1) {
|
|
|
- width: 58%;
|
|
|
+ width: 63%;
|
|
|
}
|
|
|
.gs-news > ul > li > span:nth-child(2) {
|
|
|
- width: 20%;
|
|
|
+ width: 15%;
|
|
|
}
|
|
|
.gs-news > ul > li > span:nth-child(3) {
|
|
|
width: 20%;
|