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.
 
 
 

134 lines
3.3 KiB

<template>
<view class="pageBg">
<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" @click="goPage(2)">
<view class="lab">用户协议</view>
<view class="val"><u-icon name="arrow-right" color="#999" size="18"></u-icon></view>
</view>
</view>
<view class="card">
<view class="row" @click="goPage(1)">
<view class="lab">隐私政策</view>
<view class="val"><u-icon name="arrow-right" color="#999" size="18"></u-icon></view>
</view>
</view>
<view class="btnBox">
<view class="logout" @click="loginOut">退出登录</view>
<!-- <view class="logout" @click="$goPage('/pages/userCenter/forgetPwd/forgetPwd')">修改密码</view> -->
</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;
}
},
loginOut() {
this.$store.commit('goLogin')
},
async goPage(type) {
this.$goPage('/pages/login/privacyAgreement/privacyAgreement?type='+ type)
}
}
}
</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;
position: fixed;
bottom: 20rpx;
left: 0;
padding: 0 30rpx;
width: 100%;
}
.logout {
width: 100%;
height: 100rpx;
background: #FFFFFF;
border-radius: 8rpx;
border: 2rpx solid #E8E9EC;
font-size: 28rpx;
color: #ADADAD;
text-align: center;
line-height: 100rpx;
}
</style>