index.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <div class="min-h-screen bg-[#f8f8f8]">
  3. <div
  4. class="h-250 relative w-full bg-[url('~/assets/img/profile/profile_banner.png')] bg-no-repeat bg-cover"
  5. >
  6. <div class="absolute left-20 bottom-10 right-20 text-black-3">
  7. <NuxtLink to="/profile/userInfo" class="flex items-center space-x-10">
  8. <van-image
  9. :src="userInfo.headImageUrl"
  10. class="shrink-0"
  11. width="75px"
  12. height="75px"
  13. fit="cover"
  14. radius="37.5px"
  15. />
  16. <span class="text-2xl flex-1 break-all font-semibold">
  17. {{ userInfo.showName }}</span
  18. >
  19. </NuxtLink>
  20. <div class="text-xl break-all font-semibold mt-15">
  21. 个性签名:{{ userInfo.personalSign || "暂未填写" }}
  22. </div>
  23. </div>
  24. </div>
  25. <div class="bg-white rounded-xl mx-20 mt-20 p-20">
  26. <div class="text-xl font-semibold">常用功能</div>
  27. <div class="grid grid-cols-3 gap-y-15 mt-20">
  28. <NuxtLink
  29. :to="item.to"
  30. class="flex flex-col items-center"
  31. v-for="item in menuData"
  32. :key="item.to"
  33. >
  34. <img :src="item.icon" class="w-40 h-40" alt="" srcset="" />
  35. <div class="text-black-3 text-sm mt-5">{{ item.label }}</div>
  36. </NuxtLink>
  37. </div>
  38. </div>
  39. </div>
  40. </template>
  41. <script setup>
  42. import profile_travel_order from "~/assets/img/profile/profile_travel_order.png";
  43. import profile_labour_order from "~/assets/img/profile/profile_labour_order.png";
  44. import profile_travel_note from "~/assets/img/profile/profile_travel_note.png";
  45. import profile_colection from "~/assets/img/profile/profile_colection.png";
  46. import profile_car_order from "~/assets/img/profile/profile_car_order.png";
  47. import profile_visa_order from "~/assets/img/profile/profile_visa_order.png";
  48. const userInfoStore = useUserInfoStore();
  49. const { userInfo } = storeToRefs(userInfoStore);
  50. onMounted(() => {
  51. userInfoStore.getUserInfo();
  52. });
  53. const menuData = [
  54. {
  55. icon: profile_travel_order,
  56. label: "旅游订单",
  57. to: "/profile/travel-orders",
  58. },
  59. {
  60. icon: profile_travel_note,
  61. label: "我的游记",
  62. to: "/profile/notes",
  63. },
  64. {
  65. icon: profile_colection,
  66. label: "我的收藏",
  67. to: "/profile/collection",
  68. },
  69. ];
  70. </script>
  71. <style lang="scss" scoped></style>