prodListShow.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <div>
  3. <div class="products-tab-box">
  4. <ul>
  5. <li class="products-kind-list" v-for="(item,index) in prodList" :key="index">
  6. <div class="products-kind-list-img">
  7. <nuxt-link
  8. target="_blank"
  9. :to="{name: 'prod-pdV-id',params:{id: item.proId},query: {typeId: item.proPositionId,classId: item.proTypeId}}"
  10. >
  11. <img :src="item.proImgs[0].proImgSrc" :alt="item.proImgs[0].proImgAlt">
  12. </nuxt-link>
  13. </div>
  14. <div class="products-kind-name">
  15. <nuxt-link
  16. target="_blank"
  17. :to="{name: 'prod-pdV-id',params:{id: item.proId},query: {typeId: item.proPositionId,classId: item.proTypeId}}"
  18. >
  19. <b>{{item.proName}}</b>
  20. </nuxt-link>
  21. </div>
  22. <div class="products-kind-price">¥
  23. <span class="price-num">{{item.proPrice}}</span>
  24. </div>
  25. </li>
  26. </ul>
  27. </div>
  28. <div class="products-more" v-if="showMore">
  29. <nuxt-link target="_blank" :to="{name: 'prod-typeId',params: {typeId: typeId}}">了解更多 ></nuxt-link>
  30. </div>
  31. <div class="products-more" v-if="showNewMore">
  32. <nuxt-link target="_blank" to="prod/newPro">了解更多 ></nuxt-link>
  33. </div>
  34. </div>
  35. </template>
  36. <script>
  37. export default {
  38. name: "prodListShow",
  39. props: {
  40. prodList: {
  41. type: Array,
  42. },
  43. showMore: {
  44. type: Boolean,
  45. default: false,
  46. },
  47. showNewMore: {
  48. type: Boolean,
  49. default: false,
  50. },
  51. typeId: {
  52. type: Number,
  53. default: 1,
  54. },
  55. },
  56. };
  57. </script>
  58. <style scoped>
  59. .products-tab-box {
  60. overflow: hidden;
  61. width: 100%;
  62. padding-bottom: 72px;
  63. }
  64. .products-tab-content .products-tab-box:first-child {
  65. display: block;
  66. }
  67. .products-tab-box ul {
  68. overflow: hidden;
  69. width: 100%;
  70. height: 100%;
  71. }
  72. li.products-kind-list {
  73. float: left;
  74. width: 300px;
  75. height: 333px;
  76. border: 3px solid transparent;
  77. box-sizing: border-box;
  78. -webkit-transition: all 0.5s ease;
  79. -o-transition: all 0.5s ease;
  80. transition: all 0.5s ease;
  81. cursor: pointer;
  82. }
  83. li.products-kind-list:hover {
  84. border: 3px solid #dcdcdc;
  85. }
  86. .products-kind-list-img {
  87. display: flex;
  88. overflow: hidden;
  89. width: 75%;
  90. height: 236px;
  91. margin: 0 auto;
  92. justify-content: center;
  93. align-items: center;
  94. }
  95. .products-kind-list-img img {
  96. width: 100%;
  97. height: 100%;
  98. -webkit-transition: all 1s ease;
  99. -o-transition: all 1s ease;
  100. transition: all 1s ease;
  101. }
  102. .products-kind-list-img img:hover {
  103. -webkit-transform: scale(1.1);
  104. -ms-transform: scale(1.1);
  105. -o-transform: scale(1.1);
  106. transform: scale(1.1);
  107. }
  108. .products-kind-name {
  109. overflow: hidden;
  110. width: 100%;
  111. height: 38px;
  112. }
  113. .products-kind-name a {
  114. display: block;
  115. overflow: hidden;
  116. width: 100%;
  117. height: 100%;
  118. padding: 0 20px;
  119. color: #979797;
  120. font-size: 14px;
  121. line-height: 38px;
  122. text-align: center;
  123. text-overflow: ellipsis;
  124. white-space: nowrap;
  125. box-sizing: border-box;
  126. -webkit-transition: all 0.5s ease;
  127. -o-transition: all 0.5s ease;
  128. transition: all 0.5s ease;
  129. }
  130. .products-kind-name a b {
  131. display: block;
  132. overflow: hidden;
  133. width: 100%;
  134. height: 100%;
  135. font-weight: normal;
  136. text-overflow: ellipsis;
  137. white-space: nowrap;
  138. }
  139. .products-kind-name a:hover {
  140. color: #22202b;
  141. }
  142. .products-kind-price {
  143. overflow: hidden;
  144. width: 100%;
  145. height: 40px;
  146. color: #22202b;
  147. text-align: center;
  148. }
  149. span.price-num {
  150. font-size: 24px;
  151. font-weight: bold;
  152. line-height: 40px;
  153. }
  154. .products-more {
  155. overflow: hidden;
  156. width: 163px;
  157. height: 40px;
  158. margin: 0 auto;
  159. border: 3px solid #000;
  160. font-size: 14px;
  161. line-height: 40px;
  162. text-align: center;
  163. -webkit-transition: all 0.5s ease;
  164. -o-transition: all 0.5s ease;
  165. transition: all 0.5s ease;
  166. }
  167. .products-more:hover {
  168. -webkit-transform: translateY(-5px);
  169. -ms-transform: translateY(-5px);
  170. -o-transform: translateY(-5px);
  171. transform: translateY(-5px);
  172. }
  173. .products-more a {
  174. display: block;
  175. width: 100%;
  176. height: 100%;
  177. color: #22202b;
  178. font-weight: bold;
  179. -webkit-transition: all 0.5s ease;
  180. -o-transition: all 0.5s ease;
  181. transition: all 0.5s ease;
  182. }
  183. .products-more:hover a {
  184. background: #22202b;
  185. color: #feeabd;
  186. }
  187. </style>