info.uvue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <script lang="ts" setup>
  2. import Back from '@/components/back.uvue'
  3. import userModal from './components/user.uvue'
  4. import notice from './components/notice.uvue'
  5. import setting from './components/set.uvue'
  6. import { ref, onMounted } from 'vue'
  7. import { useStore, router } from "@/.cool";
  8. const active = ref<string>('user')
  9. const { user } = useStore();
  10. onMounted(() => {
  11. if (!user.info.value?.userInfo) {
  12. user.logout()
  13. return
  14. }
  15. if (router.query().type != null) {
  16. active.value = router.query().type as string
  17. }
  18. })
  19. </script>
  20. <template>
  21. <cl-page>
  22. <Back />
  23. <image mode="aspectFill" src="https://oss.xiaoxiongcode.com/static/个人中心/bg.jpg" alt=""
  24. class="w-full h-full object-cover" />
  25. <view class="content">
  26. <view class="flex flex-row justify-between items-center">
  27. <view
  28. class="flex flex-row items-center justify-center gap-2 w-[120px] bg-[#B1E5FE] rounded-xl px-[10px] py-[5px] text-[#00A9FF]"
  29. :class="{ 'bg-[#00A9FF] !text-white': active === 'user' }" @click="active = 'user'">
  30. <cl-image src="https://oss.xiaoxiongcode.com/static/个人中心/图层 506.png" mode="heightFix" height="20px"
  31. width="auto"></cl-image> 个人信息
  32. </view>
  33. <view
  34. class="flex flex-row items-center justify-center gap-2 w-[120px] bg-[#B1E5FE] rounded-xl px-[10px] py-[5px] text-[#00A9FF]"
  35. :class="{ 'bg-[#00A9FF] !text-white': active === 'notice' }" @click="active = 'notice'">
  36. <cl-image src="https://oss.xiaoxiongcode.com/static/个人中心/图层 503.png" mode="heightFix" height="20px"
  37. width="auto"></cl-image> 公告通知
  38. </view>
  39. <view
  40. class="flex flex-row items-center justify-center gap-2 w-[120px] bg-[#B1E5FE] rounded-xl px-[10px] py-[5px] text-[#00A9FF]"
  41. :class="{ 'bg-[#00A9FF] !text-white': active === 'set' }" @click="active = 'set'">
  42. <cl-image src="https://oss.xiaoxiongcode.com/static/个人中心/图层 504.png" mode="heightFix" height="20px"
  43. width="auto"></cl-image> 设置
  44. </view>
  45. </view>
  46. <view class="w-full h-full ">
  47. <userModal v-if="active === 'user'" />
  48. <notice v-else-if="active === 'notice'" />
  49. <setting v-else-if="active === 'set'" />
  50. </view>
  51. </view>
  52. </cl-page>
  53. </template>
  54. <style lang="scss" scoped>
  55. .content {
  56. @apply absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-[#76DAF9] w-[80vw] h-[80vh] max-w-[1000px] max-h-[620px] rounded-[30px] p-[20px] text-white;
  57. }
  58. </style>