userInfo.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <view class="layout-container">
  3. <!-- 顶部填充区 -->
  4. <view class="top-fill" :style="{height: safeArea.statusBarHeight+'px'}"></view>
  5. <!-- 顶部胶囊区 -->
  6. <view class="capsule-container"
  7. :style="{
  8. height: safeArea.capsuleBarHeight+'px',
  9. width: safeArea.capsuleBarLeft+'px',
  10. 'padding-top': safeArea.capsuleBarMarginTop+'px',
  11. 'padding-bottom': safeArea.capsuleBarMarginBottom+'px'}">
  12. <view class="back-container" :style="{
  13. height: safeArea.capsuleBarContentHeight+'px',
  14. width: safeArea.capsuleBarContentHeight+'px',
  15. }">
  16. <navigator url="/pages/index/index">
  17. <uni-icons type="back" :size="safeArea.capsuleBarContentHeight" color="#FFFFFF"></uni-icons>
  18. </navigator>
  19. </view>
  20. </view>
  21. <!-- 内容区 -->
  22. <view class="content-container">
  23. <view class="login-container">
  24. <view class="avator-container">
  25. <uni-icons type="person" size="130" color="#FFFFFF"></uni-icons>
  26. </view>
  27. <view class="btn-container" @click="logout">注销</view>
  28. </view>
  29. </view>
  30. <!-- 底部填充区 -->
  31. <view class="bottom-fill" :style="{height: safeArea.bottomHeight+'px'}"></view>
  32. </view>
  33. </template>
  34. <script setup>
  35. import safeArea from '@/utils/system.js';
  36. const logout = () => {
  37. uni.removeStorageSync("token");
  38. uni.reLaunch({
  39. url: "/pages/index/index"
  40. });
  41. }
  42. </script>
  43. <style lang="scss" scoped>
  44. .back-container {
  45. border-radius: 50%;
  46. background-color: rgba(0, 0, 0, 0.1);
  47. display: flex;
  48. justify-content: center;
  49. align-items: center;
  50. }
  51. .login-container {
  52. width: 100%;
  53. height: 100%;
  54. display: flex;
  55. justify-content: center;
  56. align-items: center;
  57. flex-direction: column;
  58. .avator-container {
  59. left: 222rpx;
  60. top: 254rpx;
  61. width: 307rpx;
  62. height: 307rpx;
  63. background: #D2EFF3;
  64. border-radius: 50%;
  65. box-shadow: 0px 2px 2px 0px #DBDBDB;
  66. display: flex;
  67. justify-content: center;
  68. align-items: center;
  69. }
  70. .btn-container {
  71. margin-top: 57rpx;
  72. width: 500rpx;
  73. height: 100rpx;
  74. border-radius: 20rpx;
  75. background: #FA2525;
  76. font-size: 48rpx;
  77. font-weight: 700;
  78. letter-spacing: 0rpx;
  79. line-height: 69.5rpx;
  80. color: #FFFFFF;
  81. display: flex;
  82. justify-content: center;
  83. align-items: center;
  84. }
  85. }
  86. </style>