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.

124 lines
2.9 KiB

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