index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <div class="item" @click="handleClick(item)" :data-id="item.id">
  3. <div class="card-img">
  4. <!-- <img class="full" :src="`data/${item.id}/${item.id}-1.jpg`" alt="" /> -->
  5. <img v-if="item.thumb" class="real" :src="`${$cdn}data/thumb/${item.id}.jpg`" alt=""/>
  6. <img v-else class="real" :src="`${$cdn}/${item.id}.jpg`" alt=""/>
  7. </div>
  8. <div class="card-txt">
  9. <div class="title">
  10. <span :title="item.name">{{ item.name }}</span>
  11. </div>
  12. <!-- <div class="tag">
  13. <span :title="item.material">{{ item.material }}</span>
  14. </div> -->
  15. <div class="icon_3d" :data="item.link" v-show="item.link"><img src="../../assets/img/icon3d.png" alt=""></div>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. import browser from "@/utils/browser.js";
  21. export default {
  22. props: ["item"],
  23. data() {
  24. return {
  25. isMobile: browser.mobile
  26. };
  27. },
  28. methods:{
  29. handleClick(item){
  30. this.$store.commit('getCurrentItem',item)
  31. this.$emit('handleItem',item)
  32. }
  33. }
  34. };
  35. </script>
  36. <style lang="less" scoped>
  37. @margin: 36px;
  38. .item {
  39. text-align: center;
  40. display: inline-block;
  41. /* width: calc((100% - @margin * 3) / 4); */
  42. width:15.9vw;
  43. height:12.2vw;
  44. margin-right: @margin;
  45. margin-bottom: 61px;
  46. background: #9f292d;
  47. border-radius: 10px;
  48. overflow: hidden;
  49. cursor: pointer;
  50. border:1px solid #997748;
  51. &:nth-of-type(4n) {
  52. margin-right: 0;
  53. }
  54. .card-img {
  55. width: 15.4vw;
  56. height: 9.47vw;
  57. position: relative;
  58. max-height: 182px;
  59. overflow: hidden;
  60. border-radius:10px 10px 0 0;
  61. margin:0 auto;
  62. img {
  63. width: 100%;
  64. }
  65. .full {
  66. opacity: 0;
  67. }
  68. .real {
  69. position: absolute;
  70. z-index: 99;
  71. top: 50%;
  72. left: 50%;
  73. transform: translate(-50%, -50%);
  74. }
  75. }
  76. .card-txt {
  77. display: flex;
  78. height:2.5vw;
  79. line-height:2.5vw;
  80. padding-top:0.26vw;
  81. box-sizing:border-box;
  82. justify-content: space-between;
  83. align-items: center;
  84. font-size: 14px;
  85. padding:0 10px;
  86. background:#9f292d;
  87. .tag {
  88. color: @theme;
  89. }
  90. div{
  91. /* overflow: hidden;
  92. text-overflow:ellipsis; */
  93. }
  94. .title {
  95. width:80%;
  96. overflow:hidden;
  97. span {
  98. font-size:19px;
  99. color:#e6d6c3;
  100. display:block;
  101. white-space: nowrap;
  102. &:hover {
  103. animation: marquee 3s linear infinite
  104. }
  105. }
  106. }
  107. .icon_3d {
  108. display:flex;
  109. font-size:0;
  110. margin-left:20px;
  111. }
  112. }
  113. }
  114. @keyframes marquee {
  115. from {
  116. transform: translateX(0%)
  117. }
  118. to {
  119. transform: translateX(-100%)
  120. }
  121. }
  122. @media screen and (min-width: 500px) and (max-width: 1400px) {
  123. }
  124. @media screen and (max-width: 500px) {
  125. }
  126. </style>