userInfo.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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 { ref } from 'vue';
  36. import { onLoad } from "@dcloudio/uni-app";
  37. import { getSafeArea } from '@/utils/system.js';
  38. /**
  39. * 安全区
  40. */
  41. const safeArea = ref({});
  42. onLoad(() => {
  43. safeArea.value = getSafeArea();
  44. });
  45. const logout = () => {
  46. uni.removeStorageSync("token");
  47. uni.reLaunch({
  48. url: "/pages/index/index"
  49. });
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. .back-container {
  54. border-radius: 50%;
  55. background-color: rgba(0, 0, 0, 0.1);
  56. display: flex;
  57. justify-content: center;
  58. align-items: center;
  59. }
  60. .login-container {
  61. width: 100%;
  62. height: 100%;
  63. display: flex;
  64. justify-content: center;
  65. align-items: center;
  66. flex-direction: column;
  67. .avator-container {
  68. left: 222rpx;
  69. top: 254rpx;
  70. width: 307rpx;
  71. height: 307rpx;
  72. background: #D2EFF3;
  73. border-radius: 50%;
  74. box-shadow: 0px 2px 2px 0px #DBDBDB;
  75. display: flex;
  76. justify-content: center;
  77. align-items: center;
  78. }
  79. .btn-container {
  80. margin-top: 57rpx;
  81. width: 500rpx;
  82. height: 100rpx;
  83. border-radius: 20rpx;
  84. background: #FA2525;
  85. font-size: 48rpx;
  86. font-weight: 700;
  87. letter-spacing: 0rpx;
  88. line-height: 69.5rpx;
  89. color: #FFFFFF;
  90. display: flex;
  91. justify-content: center;
  92. align-items: center;
  93. }
  94. }
  95. </style>