collect-detail.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <div class="main">
  3. <div class="content">
  4. <sub-header />
  5. <div class="left">
  6. <hero-sub-title :type="3" />
  7. <div class="detail">
  8. <div class="detail-wrapper">
  9. <div class="back" @click="$router.go(-1)"></div>
  10. <!-- {{ files }}
  11. {{ entity }} -->
  12. <div class="info">
  13. <!-- <div class="show-case"></div> -->
  14. <show-case
  15. :video="video"
  16. :gallery="gallery"
  17. :audio="audio"
  18. :model="model"
  19. />
  20. <h3 class="title">{{ entity.name }}</h3>
  21. <div class="label-list">
  22. <span>时代:{{ entity.dictAge }}</span>
  23. <span>来源:{{ entity.dictSource }}</span>
  24. <span>质地:{{ entity.dictTexture }}</span>
  25. <span>级别:{{ entity.dictLevel }}</span>
  26. </div>
  27. <div class="text">
  28. {{ entity.description }}
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. <side-menu />
  35. </div>
  36. </div>
  37. </template>
  38. <script setup>
  39. import { computed, unref, onMounted } from "vue";
  40. import subHeader from "../components/subHeader";
  41. import sideMenu from "../components/sideMenu";
  42. import heroSubTitle from "../components/heroSubTitle";
  43. import showCase from "../components/showCase";
  44. import { useCollectStore } from "../store/collect";
  45. const collectStore = useCollectStore();
  46. const entity = computed(() => collectStore.entity);
  47. const files = computed(() => collectStore.files);
  48. const video = computed(() => collectStore.video);
  49. const gallery = computed(() => collectStore.gallery);
  50. const audio = computed(() => collectStore.audio);
  51. const model = computed(() => collectStore.model);
  52. const props = defineProps({
  53. id: {
  54. type: [String, Number],
  55. default: () => null,
  56. required: true,
  57. },
  58. });
  59. onMounted(() => {
  60. if (props.id) {
  61. collectStore.getDetail(props.id);
  62. }
  63. });
  64. watchEffect(() => {
  65. if (unref(entity).name) {
  66. document.title = unref(entity).name;
  67. }
  68. });
  69. ;
  70. </script>
  71. <style lang="scss" scoped>
  72. .detail {
  73. --main-show-case-background: #ddd5d5;
  74. --main-detail-margin: 1.875rem;
  75. --main-detail-padding: 1.875rem;
  76. // box-shadow: var(--main-box-shadow);
  77. margin: var(--main-detail-margin);
  78. margin-bottom: 0;
  79. flex: 1;
  80. border-radius: 0.8125rem;
  81. background-color: transparent;
  82. // padding: 2rem 3rem 4rem 3rem;
  83. background-image: var(--main-detail-background-img);
  84. background-size: cover;
  85. background-position: top center;
  86. background-repeat: no-repeat;
  87. overflow: hidden;
  88. .detail-wrapper {
  89. display: block;
  90. width: 100%;
  91. flex: 1;
  92. height: calc(100% - var(--main-detail-margin) - 10px);
  93. margin-top: var(--main-detail-margin);
  94. overflow-y: scroll;
  95. &::-webkit-scrollbar {
  96. display: none;
  97. }
  98. }
  99. .back {
  100. background-image: url("/img/back_arrow.png");
  101. width: 7.5rem;
  102. height: 1.875rem;
  103. background-repeat: no-repeat;
  104. background-size: contain;
  105. margin-bottom: 0.75rem;
  106. margin-left: 3rem;
  107. }
  108. .info {
  109. max-width: 66.8125rem;
  110. margin: 0 auto;
  111. font-size: 20px;
  112. padding-bottom: 5rem;
  113. .title {
  114. font-size: 1.875rem;
  115. line-height: 3.75rem;
  116. margin: 1.2rem 0;
  117. }
  118. .label-list {
  119. margin-bottom: 1.5rem;
  120. display: inline-flex;
  121. flex-direction: row;
  122. justify-content: space-between;
  123. gap: 0 1.875rem;
  124. span {
  125. padding-left: 1.5625rem;
  126. background-image: url("/img/dot.png");
  127. background-repeat: no-repeat;
  128. background-size: 1.25rem 1.25rem;
  129. background-position: left center;
  130. }
  131. }
  132. .text {
  133. font-weight: 400;
  134. color: #6e6e6e;
  135. line-height: 2.125rem;
  136. font-size: 1.25rem;
  137. }
  138. }
  139. .show-case {
  140. max-width: 66.8125rem;
  141. height: 34.1875rem;
  142. background: var(--main-show-case-background);
  143. }
  144. }
  145. </style>