效果图
<view class="" style="margin-left: 32rpx;">
<view class="username" style="font-size: 32rpx;">您好:{{userinfo.phone||''}}</view>
<view class="editbtn" @click="editUser">修改个人资料</view>
</view>
// 用户信息
getuserinfo() {
let params = {
login: true
}
this.$api.userinfo(params).then(res => {
this.userinfo = res.data
let number = this.userinfo.phone; //获取到手机号码字段
console.log('手机号', this.userinfo.phone)
let mphone = number.substring(0, 3) + '****' + number.substring(7);
this.userinfo.phone = mphone
})
},
邮箱星号加密
我们向{{ email }}发送了验证邮件
<template>
<view class="">
<view class="">我们向123****@qq.com发送了验证邮件</view>
</view>
</template>
<script>
export default {
data() {
return {
email: '123456789@qq.com',
}
},
onShow() {
this.settingemail()
},
methods: {
//隐藏邮箱
settingemail() {
let that = this;
let email = this.email; //获取到邮箱字段
console.log('邮箱', this.email)
let memail = email.substring(0, 3) + '****' + email.substring(9);
that.email = memail
},
}
}
</script>
<style lang="scss" scoped>
</style>