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.

133 lines
3.3 KiB

9 months ago
9 months ago
9 months ago
6 months ago
9 months ago
6 months ago
9 months ago
9 months ago
9 months ago
9 months ago
6 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" @click="goPage(2)">
  32. <view class="lab">用户协议</view>
  33. <view class="val"><u-icon name="arrow-right" color="#999" size="18"></u-icon></view>
  34. </view>
  35. </view>
  36. <view class="card">
  37. <view class="row" @click="goPage(1)">
  38. <view class="lab">隐私政策</view>
  39. <view class="val"><u-icon name="arrow-right" color="#999" size="18"></u-icon></view>
  40. </view>
  41. </view>
  42. <view class="btnBox">
  43. <view class="logout" @click="loginOut">退出登录</view>
  44. <!-- <view class="logout" @click="$goPage('/pages/userCenter/forgetPwd/forgetPwd')">修改密码</view> -->
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. methods: {
  53. hideMiddleDigits(phoneNumber) {
  54. if(!phoneNumber) return
  55. // 判断是否为有效的电话号码
  56. if (phoneNumber.length === 11) {
  57. // 获取号码的前三位和后四位
  58. const firstThreeDigits = phoneNumber.slice(0, 3);
  59. const lastFourDigits = phoneNumber.slice(-4);
  60. // 生成隐藏中间数字的字符串
  61. const hiddenDigits = '*'.repeat(3);
  62. // 拼接成最终的隐藏中间数字的电话号码
  63. const hiddenPhoneNumber = firstThreeDigits + hiddenDigits + lastFourDigits;
  64. return hiddenPhoneNumber;
  65. } else {
  66. // 如果不是有效的10位电话号码,可能需要进行错误处理
  67. console.error('Invalid phone number format');
  68. return phoneNumber;
  69. }
  70. },
  71. loginOut() {
  72. this.$store.commit('goLogin')
  73. },
  74. async goPage(type) {
  75. this.$goPage('/pages/login/privacyAgreement/privacyAgreement?type='+ type)
  76. }
  77. }
  78. }
  79. </script>
  80. <style lang="scss" scoped>
  81. .card {
  82. padding: 6rpx;
  83. margin-bottom: 20rpx;
  84. }
  85. .row {
  86. display: flex;
  87. align-items: center;
  88. justify-content: space-between;
  89. height: 98rpx;
  90. font-size: 28rpx;
  91. padding: 0 30rpx;
  92. &.border {
  93. border-bottom: 2rpx solid #E8E9EC;
  94. }
  95. }
  96. .btnBox {
  97. // display: flex;
  98. // justify-content: center;
  99. // flex-direction: column;
  100. // width: 100%;
  101. // align-items: center;
  102. // margin: 188rpx 0;
  103. position: fixed;
  104. bottom: 20rpx;
  105. left: 0;
  106. padding: 0 30rpx;
  107. width: 100%;
  108. }
  109. .logout {
  110. width: 100%;
  111. height: 100rpx;
  112. background: #FFFFFF;
  113. border-radius: 8rpx;
  114. border: 2rpx solid #E8E9EC;
  115. font-size: 28rpx;
  116. color: #ADADAD;
  117. text-align: center;
  118. line-height: 100rpx;
  119. }
  120. </style>