|
|
|
|
@ -6,37 +6,82 @@
|
|
|
|
|
<div class="avatarbox">
|
|
|
|
|
<i class="iconfont icon-morentouxiang"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="username">Hi,{{ 1 }}</div>
|
|
|
|
|
<div class="username" v-if="userinfo.userName">
|
|
|
|
|
Hi,{{ userinfo.userName }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="username" v-else>Hi,{{ userinfo.hidetel }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<ul>
|
|
|
|
|
<li>
|
|
|
|
|
<li
|
|
|
|
|
@click="pushto('/userinfo/accountsetting/loginpsw')"
|
|
|
|
|
:class="{ tagactive: activelist === 0 }"
|
|
|
|
|
>
|
|
|
|
|
<span><i class="iconfont icon-gerenzhongxin-mima"></i>登录密码</span
|
|
|
|
|
><i class="iconfont icon-youjiantou"></i>
|
|
|
|
|
><span
|
|
|
|
|
><span>已设置</span>
|
|
|
|
|
<i class="iconfont icon-youjiantou"></i>
|
|
|
|
|
</span>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<li
|
|
|
|
|
@click="pushto('/userinfo/accountsetting/boundtel')"
|
|
|
|
|
:class="{ tagactive: activelist === 1 }"
|
|
|
|
|
>
|
|
|
|
|
<span
|
|
|
|
|
><i class="iconfont icon-gerenzhongxin-bangdingshouji"></i
|
|
|
|
|
>绑定手机</span
|
|
|
|
|
><i class="iconfont icon-youjiantou"></i>
|
|
|
|
|
><span
|
|
|
|
|
><span>{{ userinfo.hidetel }}</span>
|
|
|
|
|
<i class="iconfont icon-youjiantou"></i>
|
|
|
|
|
</span>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<li
|
|
|
|
|
@click="pushto('/userinfo/accountsetting/boundwx')"
|
|
|
|
|
:class="{ tagactive: activelist === 2 }"
|
|
|
|
|
>
|
|
|
|
|
<span><i class="iconfont icon-weixin1"></i>绑定微信</span
|
|
|
|
|
><i class="iconfont icon-youjiantou"></i>
|
|
|
|
|
><span
|
|
|
|
|
><span>已绑定</span>
|
|
|
|
|
<i class="iconfont icon-youjiantou"></i>
|
|
|
|
|
</span>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<li
|
|
|
|
|
@click="pushto('/userinfo/accountsetting/boundbankcard')"
|
|
|
|
|
:class="{ tagactive: activelist === 3 }"
|
|
|
|
|
>
|
|
|
|
|
<span
|
|
|
|
|
><i class="iconfont icon-bangdingyinhangka"></i>绑定银行卡</span
|
|
|
|
|
><i class="iconfont icon-youjiantou"></i>
|
|
|
|
|
><span
|
|
|
|
|
><span>{{ userbanklist.length }}张</span>
|
|
|
|
|
<i class="iconfont icon-youjiantou"></i>
|
|
|
|
|
</span>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<ul>
|
|
|
|
|
<li
|
|
|
|
|
@click="pushto('/userinfo/accountsetting/realname')"
|
|
|
|
|
:class="{ tagactive: activelist === 4 }"
|
|
|
|
|
>
|
|
|
|
|
<span><i class="iconfont icon-shimingrenzheng"></i>实名认证</span
|
|
|
|
|
><span
|
|
|
|
|
><span v-if="userinfo.realName">已认证</span
|
|
|
|
|
><span v-else>未认证</span>
|
|
|
|
|
<i class="iconfont icon-youjiantou"></i>
|
|
|
|
|
</span>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="rightcontent"></div>
|
|
|
|
|
<div class="rightcontent">
|
|
|
|
|
<router-view
|
|
|
|
|
:userinfo="userinfo"
|
|
|
|
|
:userbanklist="userbanklist"
|
|
|
|
|
></router-view>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { userBaseInfoApi } from "../../../api/userinfo";
|
|
|
|
|
import { userBaseInfoApi, getUserBankListApi } from "../../../api/userinfo";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
// 组件名称
|
|
|
|
|
@ -47,18 +92,32 @@ export default {
|
|
|
|
|
props: {},
|
|
|
|
|
// 组件状态值
|
|
|
|
|
data() {
|
|
|
|
|
return {};
|
|
|
|
|
return {
|
|
|
|
|
userinfo: {}, // 用户基础信息
|
|
|
|
|
activelist: "",
|
|
|
|
|
userbanklist: [],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
// 计算属性
|
|
|
|
|
computed: {},
|
|
|
|
|
computed: {
|
|
|
|
|
path() {
|
|
|
|
|
return this.$route.fullPath;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
// 侦听器
|
|
|
|
|
watch: {},
|
|
|
|
|
watch: {
|
|
|
|
|
path() {
|
|
|
|
|
this.changeactive();
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
// 生命周期钩子 注:没用到的钩子请自行删除
|
|
|
|
|
/**
|
|
|
|
|
* 组件实例创建完成,属性已绑定,但DOM还未生成,$ el属性还不存在
|
|
|
|
|
*/
|
|
|
|
|
created() {
|
|
|
|
|
this.getUserInfo();
|
|
|
|
|
this.changeactive();
|
|
|
|
|
this.getuserbnak();
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* el 被新创建的 vm.el 替换,并挂载到实例上去之后调用该钩子。
|
|
|
|
|
@ -70,7 +129,46 @@ export default {
|
|
|
|
|
async getUserInfo() {
|
|
|
|
|
try {
|
|
|
|
|
const { data } = await userBaseInfoApi();
|
|
|
|
|
if (data.status === 200) {
|
|
|
|
|
this.userinfo = data.data;
|
|
|
|
|
console.log(this.userinfo);
|
|
|
|
|
const beforetel = this.userinfo.tel.substr(0, 3);
|
|
|
|
|
const aftertel = this.userinfo.tel.substr(7, 4);
|
|
|
|
|
this.userinfo.hidetel = beforetel + "****" + aftertel;
|
|
|
|
|
console.log(aftertel);
|
|
|
|
|
console.log(beforetel);
|
|
|
|
|
}
|
|
|
|
|
console.log(data);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
pushto(url) {
|
|
|
|
|
this.$router.push(url);
|
|
|
|
|
},
|
|
|
|
|
changeactive() {
|
|
|
|
|
if (this.path.indexOf("/loginpsw") > -1) {
|
|
|
|
|
this.activelist = 0;
|
|
|
|
|
} else if (this.path.indexOf("/boundtel") > -1) {
|
|
|
|
|
this.activelist = 1;
|
|
|
|
|
} else if (this.path.indexOf("/boundwx") > -1) {
|
|
|
|
|
this.activelist = 2;
|
|
|
|
|
} else if (this.path.indexOf("/boundbankcard") > -1) {
|
|
|
|
|
this.activelist = 3;
|
|
|
|
|
} else if (this.path.indexOf("/realname") > -1) {
|
|
|
|
|
this.activelist = 4;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getuserbnak() {
|
|
|
|
|
try {
|
|
|
|
|
const { data } = await getUserBankListApi();
|
|
|
|
|
console.log(data);
|
|
|
|
|
this.userbanklist = data.data;
|
|
|
|
|
this.userbanklist.forEach((ele) => {
|
|
|
|
|
ele.newbankNo = ele.bankNo.substr(14, 4);
|
|
|
|
|
});
|
|
|
|
|
// const newdata = this.userbanklist.bankNo.substr(14, 4);
|
|
|
|
|
// console.log(newdata);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
}
|
|
|
|
|
@ -83,12 +181,13 @@ export default {
|
|
|
|
|
.accountcontent {
|
|
|
|
|
height: 1000px;
|
|
|
|
|
margin-top: 16px;
|
|
|
|
|
background-color: pink;
|
|
|
|
|
// background-color: pink;
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
|
|
.accountSetList {
|
|
|
|
|
width: 346px;
|
|
|
|
|
height: 500px;
|
|
|
|
|
background-color: skyblue;
|
|
|
|
|
// background-color: skyblue;
|
|
|
|
|
margin-right: 16px;
|
|
|
|
|
.userinfobox {
|
|
|
|
|
width: 346px;
|
|
|
|
|
@ -96,14 +195,18 @@ export default {
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
padding: 24px 0;
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
|
|
.avatarbox {
|
|
|
|
|
text-align: center;
|
|
|
|
|
i {
|
|
|
|
|
font-size: 60px;
|
|
|
|
|
line-height: 60px;
|
|
|
|
|
font-size: 54px;
|
|
|
|
|
line-height: 54px;
|
|
|
|
|
color: #ff6a00;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.username {
|
|
|
|
|
margin-top: 18px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
> ul {
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
@ -111,6 +214,7 @@ export default {
|
|
|
|
|
// padding: 0 16px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
|
|
li {
|
|
|
|
|
position: relative;
|
|
|
|
|
display: flex;
|
|
|
|
|
@ -129,16 +233,26 @@ export default {
|
|
|
|
|
left: 16px;
|
|
|
|
|
background-color: #f3f4f4;
|
|
|
|
|
}
|
|
|
|
|
span {
|
|
|
|
|
> span:first-child {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
i {
|
|
|
|
|
margin-right: 12px;
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
> i {
|
|
|
|
|
color: #888;
|
|
|
|
|
font-size: 22px;
|
|
|
|
|
> span:last-child {
|
|
|
|
|
line-height: 22px;
|
|
|
|
|
span {
|
|
|
|
|
color: #999;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
}
|
|
|
|
|
> i {
|
|
|
|
|
color: #888;
|
|
|
|
|
margin-left: 12px;
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
|
|
|
|
|
font-size: 22px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -146,7 +260,8 @@ export default {
|
|
|
|
|
.rightcontent {
|
|
|
|
|
width: 838px;
|
|
|
|
|
height: 600px;
|
|
|
|
|
background-color: gray;
|
|
|
|
|
padding: 0 16px;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|