productCenter.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <div class="content">
  3. <div class="conBox big-title">
  4. <span>
  5. {{lang===langType.cn?"产品中心":getAbbrText("产品中心")}}
  6. </span>
  7. <div class="hr"></div>
  8. </div>
  9. <div class="conBox productCenter">
  10. <a class="product"
  11. v-for="(product,i) in products"
  12. :key="'pro-'+product.key"
  13. >
  14. <span class="imgBox">
  15. <img :src="product.img" :alt="product.title" class="img">
  16. </span>
  17. <span class="more">
  18. {{lang===langType.cn?"了解更多":getAbbrText("了解更多")}}
  19. </span>
  20. <p class="product-info">
  21. <span class="title">
  22. {{lang===langType.cn?product.title:getAbbrText(product.title)}}
  23. </span>
  24. <span class="description" v-if="product.sellPointer">
  25. <span v-for="sell in product.sellPointer">
  26. {{sell}}
  27. </span>
  28. </span>
  29. </p>
  30. </a>
  31. </div>
  32. </div>
  33. </template>
  34. <script>
  35. import langMap from "~/map/langMap";
  36. export default {
  37. name: "productCenter",
  38. props: {
  39. lang:{
  40. default: langMap.lang.cn
  41. },
  42. },
  43. data(){
  44. return {
  45. langType: langMap.lang,
  46. products:[
  47. {
  48. title: '20倍自动变焦摄像头',
  49. img: 'image/product/20Cam.png',
  50. key: 'p1',
  51. sellPointer: [
  52. '20倍超级变焦',
  53. '高清影像',
  54. '多种可选倍率'
  55. ]
  56. },
  57. {
  58. title: '车牌识别摄像头',
  59. key: 'p2',
  60. img: 'image/product/car.jpg',
  61. sellPointer: [
  62. 'ai识别',
  63. '智能联动',
  64. ]
  65. },
  66. {
  67. title: '火情识别摄像头',
  68. key: 'p3',
  69. img: 'image/product/fire.png',
  70. sellPointer: [
  71. '烟火识别',
  72. '自动巡检',
  73. ]
  74. },
  75. {
  76. title: '4G低功耗智能摄像头',
  77. key: 'p4',
  78. img: 'image/showing/lowCam.jpg'
  79. },
  80. {
  81. title: '4G电力摄像头模组',
  82. key: 'p5',
  83. img: 'image/product/20Cam.png',
  84. description: ''
  85. },
  86. {
  87. title: '多目协同摄像头',
  88. key: 'p6',
  89. img: 'image/product/20Cam.png'
  90. },
  91. {
  92. title: '电气火灾模块',
  93. key: 'p7',
  94. img: 'image/product/20Cam.png'
  95. },
  96. {
  97. title: 'm2m产品',
  98. key: 'p8',
  99. img: 'image/product/20Cam.png'
  100. }
  101. ]
  102. }
  103. },
  104. methods:{
  105. getLangText(str) {
  106. return langMap.getText(this.lang, str);
  107. },
  108. getAbbrText(str) {
  109. return langMap.getAbbrText(this.lang, str);
  110. },
  111. }
  112. }
  113. </script>
  114. <style scoped>
  115. .productCenter{
  116. display: grid;
  117. grid-template-columns: repeat(4,310px);
  118. grid-gap: 25px;
  119. box-sizing: border-box;
  120. }
  121. .product{
  122. display: block;
  123. height: 380px;
  124. background-color: #fff;
  125. box-shadow: 1px 1px 3px black;
  126. border-radius: 3px;
  127. overflow: hidden;
  128. cursor: pointer;
  129. position: relative;
  130. }
  131. .product:hover{
  132. box-shadow: 1px 1px 5px #3a3838;
  133. }
  134. .product .more{
  135. background-color: #912b02;
  136. padding: 0 30px;
  137. border-radius: 4px;
  138. display: block;
  139. position: absolute;
  140. left: 50%;
  141. transform: translate(-50%,0);
  142. top: 250px;
  143. opacity: 0;
  144. transition:all 0.5s;
  145. color: white;
  146. }
  147. .product:hover .more{
  148. opacity: 1;
  149. background-color: orangered;
  150. }
  151. .product .more:hover{
  152. box-shadow: 1px 1px 5px white;
  153. padding: 0 25px;
  154. }
  155. .product .product-info{
  156. display: block;
  157. padding: 5px;
  158. height: calc(100% - 270px);
  159. box-sizing: border-box;
  160. }
  161. .product .imgBox{
  162. display: block;
  163. width: 310px;
  164. height: 270px;
  165. }
  166. .product:hover .imgBox img{
  167. left: -10px;
  168. top: -10px;
  169. max-width: calc(100% + 20px);
  170. width: calc(100% + 20px);
  171. height: calc(100% + 20px);
  172. }
  173. .product .title{
  174. height: 40px;
  175. display: flex;
  176. align-items: center;
  177. font-size: 1.6em;
  178. }
  179. .product-info .description{
  180. display: block;
  181. height: calc(100% - 40px);
  182. border-top: 1px solid beige;
  183. font-size: 0.9em;
  184. color: #444343;
  185. }
  186. .product-info .description > span{
  187. display: block;
  188. }
  189. </style>