prodList.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <div class="product-list">
  3. <div
  4. class="product-list-item"
  5. v-for="(item, index) in productList"
  6. :key="index"
  7. >
  8. <div class="product-list-item-img">
  9. <a :href="item.linkUrl" target="_black" >
  10. <img :src="item.imgUrl" :alt="item.title" srcset="">
  11. </a>
  12. <div class="product-tag">{{ item.tag }}
  13. </div>
  14. </div>
  15. <div class="product-list-info">
  16. <div class="product-list-title">
  17. <a :href="item.linkUrl" target="_black">
  18. {{ item.title }}
  19. </a>
  20. <!-- <nuxt-link to="/">{{ item.title }}</nuxt-link> -->
  21. </div>
  22. <div class="product-list-content">
  23. <div class="product-list-price">
  24. <span class="price-num">{{ item.price }}</span>
  25. </div>
  26. <div class="product-list-btn">
  27. <a :href="item.linkUrl" target="_black">
  28. 查看产品
  29. </a>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </template>
  36. <script>
  37. export default {
  38. props: {
  39. productList: {
  40. type: Array,
  41. default: function() {
  42. return [];
  43. }
  44. }
  45. },
  46. data() {
  47. return {
  48. }
  49. }
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. @import "~static/common/style.sass";
  54. .product-list {
  55. display: flex;
  56. align-items: center;
  57. flex-wrap: wrap;
  58. .product-list-item {
  59. position: relative;
  60. box-sizing: border-box;
  61. width: 374px;
  62. margin-bottom: 42px;
  63. margin-right: 36px;
  64. &:nth-child(3n) {
  65. margin-right: 0px;
  66. }
  67. &:hover {
  68. transform: scale(1.1);
  69. transition: transform 1s;
  70. }
  71. .product-list-item-img {
  72. width: 374px;
  73. height: 250px;
  74. font-size: 0;
  75. overflow: hidden;
  76. &:hover {
  77. img {
  78. // transform: scale(1.2);
  79. // transition: transform 1s;
  80. }
  81. .product-tag {
  82. // border-radius: 0px 0px 0px 0px;
  83. // transition: border-radius .3s;
  84. }
  85. }
  86. img {
  87. border-radius: 18px 18px 0px 0px;
  88. width: 100%;
  89. }
  90. }
  91. }
  92. .product-tag {
  93. padding: 0 6px 0 10px;
  94. background: $theme_color_fu;
  95. position: absolute;
  96. top: 0;
  97. left: 0;
  98. font-size: 12px;
  99. color: #ffffff;
  100. height: 24px;
  101. line-height: 24px;
  102. font-family: PingFangSC-Semibold, PingFang SC;
  103. font-weight: 600;
  104. border-radius: 18px 0px 7px 0px;
  105. }
  106. }
  107. .product-list-info {
  108. box-sizing: border-box;
  109. background: #ffffff;
  110. height: 90px;
  111. box-shadow: 0px 5px 21px 0px rgba(232, 243, 243, 1);
  112. border-radius: 0px 0px 18px 18px;
  113. padding: 10px 22px;
  114. .product-list-title {
  115. font-family: PingFangSC-Regular, PingFang SC;
  116. font-weight: 400;
  117. color: #343E30;
  118. font-size: 20px;
  119. font-weight: 400;
  120. line-height: 28px;
  121. overflow: hidden;//超出一行文字自动隐藏
  122. text-overflow: ellipsis;//文字隐藏后添加省略号
  123. white-space: nowrap;//强制不换行
  124. a {
  125. color: #343e30;
  126. }
  127. }
  128. .product-list-content {
  129. display: flex;
  130. align-items: center;
  131. justify-content: space-between;
  132. margin-top: 6px;
  133. }
  134. .product-list-price {
  135. color: #ea0b4a;
  136. font-size: 20px;
  137. line-height: 38px;
  138. .price-num {
  139. font-size: 30px;
  140. font-weight: 600;
  141. line-height: 28px;
  142. }
  143. }
  144. .product-list-btn {
  145. font-size: 13px;
  146. font-family: PingFangSC-Regular, PingFang SC;
  147. font-weight: 400;
  148. border: 1px solid rgba(60, 142, 255, 1);
  149. height: 28px;
  150. line-height: 28px;
  151. border-radius: 14px;
  152. a {
  153. padding: 0 15px;
  154. color: #3e8eff;
  155. }
  156. }
  157. }
  158. </style>