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.

130 lines
3.2 KiB

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