index.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <Page title="我的" styleReset="backNone">
  3. <template v-slot:body>
  4. <div class="w-full h-full flex flex-col items-center">
  5. <div class="headPortrait">
  6. <img src="/src/assets/image/camera.png" class="w-full h-full">
  7. </div>
  8. <div class="flex-1">
  9. <div class="xinming">
  10. <TranslationComponent :openId="userInfo.userInfo.name" />
  11. </div>
  12. <div class="flex flex-col justify-center text-[#5D5D5D] leading-6">
  13. <div class="text-center">公司: {{ userInfo.userInfo?.company?.companyName }}</div>
  14. <div class="text-center">角色: {{ userInfo.userInfo?.roleName }}</div>
  15. </div>
  16. </div>
  17. <div class="w-full mb-40 px-24">
  18. <van-button type="primary" @click="signOut" class="w-full">退出登录</van-button>
  19. </div>
  20. </div>
  21. <!-- <van-button type="primary" @click="signOut">退出</van-button> -->
  22. </template>
  23. <template v-slot:footer>
  24. <Footer />
  25. </template>
  26. </Page>
  27. </template>
  28. <script setup>
  29. import { ref } from "vue";
  30. import { useLifecycle } from "@hooks/useCommon.js";
  31. import useRouterStore from "@store/useRouterStore.js";
  32. import useInfoStore from "@store/useInfoStore.js";
  33. import Footer from "@components/page/footer.vue";
  34. const router = useRouterStore()
  35. const userInfo = useInfoStore()
  36. function signOut() {
  37. router.redirectTo({
  38. pathName: 'login',
  39. success: () => {
  40. localStorage.clear()
  41. sessionStorage.clear()
  42. window.location.reload();
  43. }
  44. })
  45. }
  46. useLifecycle({
  47. load: () => {
  48. }
  49. });
  50. </script>
  51. <style lang="scss" scoped>
  52. .backNone {
  53. background: linear-gradient(to bottom, #E0EFFF, #F8F8F8 30%) !important;
  54. :deep(.van-nav-bar) {
  55. background: none;
  56. }
  57. }
  58. .headPortrait {
  59. width: 80px;
  60. height: 80px;
  61. border-radius: 50%;
  62. position: relative;
  63. margin-top: 20px;
  64. margin-bottom: 10px;
  65. &::after {
  66. content: "";
  67. width: 24px;
  68. height: 24px;
  69. background-image: url('@/assets/image/camera.png');
  70. background-size: cover;
  71. position: absolute;
  72. bottom: 0;
  73. right: 0;
  74. }
  75. }
  76. .xinming {
  77. color: #000000;
  78. font-family: PingFang SC;
  79. font-weight: semibold;
  80. font-size: 18px;
  81. line-height: normal;
  82. letter-spacing: 0px;
  83. text-align: left;
  84. margin-bottom: 6px;
  85. text-align: center;
  86. }
  87. </style>