You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

115 lines
2.7 KiB

<template>
<view class="pageBgImg">
<topNavbar title="人个中心"></topNavbar>
<view class="pad">
<view class="card">
<view class="row">
<view class="lab">手机号</view>
<view class="val"> {{ hideMiddleDigits(vuex_userInfo.phone) }} </view>
</view>
</view>
<!-- <view class="card">
<view class="row border">
<view class="lab">我的驾校</view>
<view class="val">江西海正驾校</view>
</view>
<view class="row border">
<view class="lab">我的教练</view>
<view class="val">xxx</view>
</view>
<view class="row border">
<view class="lab">所学车型</view>
<view class="val">xxx</view>
</view>
<view class="row">
<view class="lab">报名时间</view>
<view class="val">xxx</view>
</view>
</view> -->
<!-- <view class="card">
<view class="row">
<view class="lab">收款银行卡</view>
<view class="val">48372*****03928</view>
</view>
</view> -->
<view class="btnBox">
<view class="logout" @click="$goPage('/pages/login/login')">退出登录</view>
<view class="logout" @click="$goPage('/pages/userCenter/forgetPwd/forgetPwd')">修改密码</view>
</view>
</view>
</view>
</template>
<script>
export default {
methods: {
hideMiddleDigits(phoneNumber) {
if(!phoneNumber) return
// 判断是否为有效的电话号码
if (phoneNumber.length === 11) {
// 获取号码的前三位和后四位
const firstThreeDigits = phoneNumber.slice(0, 3);
const lastFourDigits = phoneNumber.slice(-4);
// 生成隐藏中间数字的字符串
const hiddenDigits = '*'.repeat(3);
// 拼接成最终的隐藏中间数字的电话号码
const hiddenPhoneNumber = firstThreeDigits + hiddenDigits + lastFourDigits;
return hiddenPhoneNumber;
} else {
// 如果不是有效的10位电话号码,可能需要进行错误处理
console.error('Invalid phone number format');
return phoneNumber;
}
}
}
}
</script>
<style lang="scss" scoped>
.card {
padding: 6rpx;
margin-bottom: 20rpx;
}
.row {
display: flex;
align-items: center;
justify-content: space-between;
height: 98rpx;
font-size: 28rpx;
padding: 0 30rpx;
&.border {
border-bottom: 2rpx solid #E8E9EC;
}
}
.btnBox {
display: flex;
justify-content: center;
flex-direction: column;
width: 100%;
align-items: center;
margin: 188rpx 0;
}
.logout {
width: 396rpx;
height: 72rpx;
background: #FFFFFF;
border-radius: 8rpx;
border: 2rpx solid #E8E9EC;
font-size: 28rpx;
color: #ADADAD;
text-align: center;
line-height: 72rpx;
margin-bottom: 30rpx;
}
</style>