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.

114 lines
2.7 KiB

8 months ago
8 months ago
8 months ago
  1. <template>
  2. <view class="pageBgImg">
  3. <topNavbar title="人个中心"></topNavbar>
  4. <view class="pad">
  5. <view class="card">
  6. <view class="row">
  7. <view class="lab">手机号</view>
  8. <view class="val"> {{ hideMiddleDigits(vuex_userInfo.phone) }} </view>
  9. </view>
  10. </view>
  11. <!-- <view class="card">
  12. <view class="row border">
  13. <view class="lab">我的驾校</view>
  14. <view class="val">江西海正驾校</view>
  15. </view>
  16. <view class="row border">
  17. <view class="lab">我的教练</view>
  18. <view class="val">xxx</view>
  19. </view>
  20. <view class="row border">
  21. <view class="lab">所学车型</view>
  22. <view class="val">xxx</view>
  23. </view>
  24. <view class="row">
  25. <view class="lab">报名时间</view>
  26. <view class="val">xxx</view>
  27. </view>
  28. </view> -->
  29. <!-- <view class="card">
  30. <view class="row">
  31. <view class="lab">收款银行卡</view>
  32. <view class="val">48372*****03928</view>
  33. </view>
  34. </view> -->
  35. <view class="btnBox">
  36. <view class="logout" @click="$goPage('/pages/login/login')">退出登录</view>
  37. <view class="logout" @click="$goPage('/pages/userCenter/forgetPwd/forgetPwd')">修改密码</view>
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. export default {
  44. methods: {
  45. hideMiddleDigits(phoneNumber) {
  46. if(!phoneNumber) return
  47. // 判断是否为有效的电话号码
  48. if (phoneNumber.length === 11) {
  49. // 获取号码的前三位和后四位
  50. const firstThreeDigits = phoneNumber.slice(0, 3);
  51. const lastFourDigits = phoneNumber.slice(-4);
  52. // 生成隐藏中间数字的字符串
  53. const hiddenDigits = '*'.repeat(3);
  54. // 拼接成最终的隐藏中间数字的电话号码
  55. const hiddenPhoneNumber = firstThreeDigits + hiddenDigits + lastFourDigits;
  56. return hiddenPhoneNumber;
  57. } else {
  58. // 如果不是有效的10位电话号码,可能需要进行错误处理
  59. console.error('Invalid phone number format');
  60. return phoneNumber;
  61. }
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="scss" scoped>
  67. .card {
  68. padding: 6rpx;
  69. margin-bottom: 20rpx;
  70. }
  71. .row {
  72. display: flex;
  73. align-items: center;
  74. justify-content: space-between;
  75. height: 98rpx;
  76. font-size: 28rpx;
  77. padding: 0 30rpx;
  78. &.border {
  79. border-bottom: 2rpx solid #E8E9EC;
  80. }
  81. }
  82. .btnBox {
  83. display: flex;
  84. justify-content: center;
  85. flex-direction: column;
  86. width: 100%;
  87. align-items: center;
  88. margin: 188rpx 0;
  89. }
  90. .logout {
  91. width: 396rpx;
  92. height: 72rpx;
  93. background: #FFFFFF;
  94. border-radius: 8rpx;
  95. border: 2rpx solid #E8E9EC;
  96. font-size: 28rpx;
  97. color: #ADADAD;
  98. text-align: center;
  99. line-height: 72rpx;
  100. margin-bottom: 30rpx;
  101. }
  102. </style>