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.

150 lines
3.8 KiB

7 months ago
7 months ago
4 months ago
7 months ago
4 months ago
7 months ago
7 months ago
7 months ago
4 months ago
7 months ago
7 months ago
7 months ago
7 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 cancel" @click="cancellationFn"> </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. let _this = this
  71. uni.showModal({
  72. content:'确定要退出登录吗?',
  73. success(val) {
  74. if(val.confirm) {
  75. _this.$store.commit('goLogin')
  76. }
  77. }
  78. })
  79. },
  80. cancellationFn() {
  81. uni.showModal({
  82. content:'您的账号注销后将无法再登录该APP,并且账号注销后,各项信息将被清空且无法恢复,请谨慎使用此功能。如您还需要注销账号,请联系您所在驾校的管理后台的管理员,为您操作注销',
  83. success() {
  84. console.log('哈哈哈')
  85. }
  86. })
  87. },
  88. async goPage(type) {
  89. this.$goPage('/pages/login/privacyAgreement/privacyAgreement?type='+ type)
  90. }
  91. }
  92. }
  93. </script>
  94. <style lang="scss" scoped>
  95. .card {
  96. padding: 6rpx;
  97. margin-bottom: 20rpx;
  98. }
  99. .row {
  100. display: flex;
  101. align-items: center;
  102. justify-content: space-between;
  103. height: 98rpx;
  104. font-size: 28rpx;
  105. padding: 0 30rpx;
  106. &.border {
  107. border-bottom: 2rpx solid #E8E9EC;
  108. }
  109. }
  110. .btnBox {
  111. // display: flex;
  112. // justify-content: center;
  113. // flex-direction: column;
  114. // width: 100%;
  115. // align-items: center;
  116. // margin: 188rpx 0;
  117. position: fixed;
  118. bottom: 20rpx;
  119. left: 0;
  120. padding: 0 30rpx;
  121. width: 100%;
  122. }
  123. .logout {
  124. width: 100%;
  125. height: 100rpx;
  126. background: #FFFFFF;
  127. border-radius: 8rpx;
  128. border: 2rpx solid #E8E9EC;
  129. font-size: 28rpx;
  130. color: #ADADAD;
  131. text-align: center;
  132. line-height: 100rpx;
  133. margin-top: 30rpx;
  134. &.cancel {
  135. background: none;
  136. }
  137. }
  138. </style>