info.uvue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <script lang="ts" setup>
  2. import Back from '@/components/back.uvue'
  3. import userModal from './components/user.uvue'
  4. import conversion from './components/conversion.uvue'
  5. import setting from './components/set.uvue'
  6. import { ref, onMounted } from 'vue'
  7. import { useStore } from "@/.cool";
  8. const active = ref<'user' | 'conversion' | 'set'>('user')
  9. const { user } = useStore();
  10. onMounted(() => {
  11. if (!user.info.value?.userInfo) {
  12. user.logout()
  13. return
  14. }
  15. })
  16. </script>
  17. <template>
  18. <cl-page>
  19. <Back />
  20. <image mode="aspectFill" src="https://oss.xiaoxiongcode.com/static/个人中心/bg.png" alt=""
  21. class="w-full h-full object-cover" />
  22. <view class="content">
  23. <view class="flex flex-row justify-between items-center">
  24. <view
  25. class="flex flex-row items-center justify-center gap-2 w-[120px] bg-[#B1E5FE] rounded-xl px-[10px] py-[5px] text-[#00A9FF]"
  26. :class="{ 'bg-[#00A9FF] !text-white': active === 'user' }" @click="active = 'user'">
  27. <cl-image src="https://oss.xiaoxiongcode.com/static/个人中心/图层 506.png" mode="heightFix" height="20px"
  28. width="auto"></cl-image> 个人信息
  29. </view>
  30. <view
  31. class="flex flex-row items-center justify-center gap-2 w-[120px] bg-[#B1E5FE] rounded-xl px-[10px] py-[5px] text-[#00A9FF]"
  32. :class="{ 'bg-[#00A9FF] !text-white': active === 'conversion' }" @click="active = 'conversion'">
  33. <cl-image src="https://oss.xiaoxiongcode.com/static/个人中心/图层 503.png" mode="heightFix" height="20px"
  34. width="auto"></cl-image> 兑换记录
  35. </view>
  36. <view
  37. class="flex flex-row items-center justify-center gap-2 w-[120px] bg-[#B1E5FE] rounded-xl px-[10px] py-[5px] text-[#00A9FF]"
  38. :class="{ 'bg-[#00A9FF] !text-white': active === 'set' }" @click="active = 'set'">
  39. <cl-image src="https://oss.xiaoxiongcode.com/static/个人中心/图层 504.png" mode="heightFix" height="20px"
  40. width="auto"></cl-image> 设置
  41. </view>
  42. </view>
  43. <view class="w-full h-full ">
  44. <userModal v-if="active === 'user'" />
  45. <conversion v-else-if="active === 'conversion'" />
  46. <setting v-else-if="active === 'set'" />
  47. </view>
  48. </view>
  49. </cl-page>
  50. </template>
  51. <style lang="scss" scoped>
  52. .content {
  53. @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;
  54. }
  55. </style>