index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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 class="text-center text-[#075985] mt-2" @click="applicationMarket()">应用市场</div>
  16. </div>
  17. </div>
  18. <div class="w-full mb-40 px-24" v-if="!isCorpWX">
  19. <van-button type="primary" @click="signOut" class="w-full">退出登录</van-button>
  20. </div>
  21. </div>
  22. <!-- <van-button type="primary" @click="signOut">退出</van-button> -->
  23. </template>
  24. <template v-slot:footer>
  25. <Footer />
  26. </template>
  27. </Page>
  28. </template>
  29. <script setup>
  30. import { ref } from "vue";
  31. import { useLifecycle } from "@hooks/useCommon.js";
  32. import useRouterStore from "@store/useRouterStore.js";
  33. import useInfoStore from "@store/useInfoStore.js";
  34. import Footer from "@components/page/footer.vue";
  35. const router = useRouterStore()
  36. const userInfo = useInfoStore()
  37. const isCorpWX = ref(false)
  38. function signOut() {
  39. router.redirectTo({
  40. pathName: 'login',
  41. success: () => {
  42. localStorage.clear()
  43. sessionStorage.clear()
  44. window.location.reload();
  45. }
  46. })
  47. }
  48. function judgingTheEnvironment() {
  49. const currentEnvironment = navigator.userAgent.toLowerCase();
  50. isCorpWX.value = currentEnvironment.indexOf("wxwork") > 0 ? true : false
  51. }
  52. const applicationMarket = () => {
  53. window.location.href = 'https://www.ttkuaiban.com/appMarket.html'
  54. // window.open('https://www.ttkuaiban.com/appMarket.html', '_blank');
  55. }
  56. useLifecycle({
  57. load: () => {
  58. judgingTheEnvironment()
  59. }
  60. });
  61. </script>
  62. <style lang="scss" scoped>
  63. .backNone {
  64. background: linear-gradient(to bottom, #E0EFFF, #F8F8F8 30%) !important;
  65. :deep(.van-nav-bar) {
  66. background: none;
  67. }
  68. }
  69. .headPortrait {
  70. width: 80px;
  71. height: 80px;
  72. border-radius: 50%;
  73. position: relative;
  74. margin-top: 20px;
  75. margin-bottom: 10px;
  76. &::after {
  77. content: "";
  78. width: 24px;
  79. height: 24px;
  80. background-image: url('@/assets/image/camera.png');
  81. background-size: cover;
  82. position: absolute;
  83. bottom: 0;
  84. right: 0;
  85. }
  86. }
  87. .xinming {
  88. color: #000000;
  89. font-family: PingFang SC;
  90. font-weight: semibold;
  91. font-size: 18px;
  92. line-height: normal;
  93. letter-spacing: 0px;
  94. text-align: left;
  95. margin-bottom: 6px;
  96. text-align: center;
  97. }
  98. </style>