productBanner.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <div class="banner">
  3. <div class="imgBox">
  4. <img src="image/banner/banner_product.png" alt="">
  5. </div>
  6. <div class="banner-con bg-absolute">
  7. <span>{{lang===langType.cn?"产品中心":getAbbrText("产品中心")}}</span>
  8. <span class="subTitle">{{lang===langType.cn?"持续创新的软硬件产品":getLangText("持续创新的软硬件产品")}}</span>
  9. <span>1</span>
  10. </div>
  11. <div class="banner-con">
  12. <span>{{lang===langType.cn?"产品中心":getAbbrText("产品中心")}}</span>
  13. <span class="subTitle">{{lang===langType.cn?"持续创新的软硬件产品":getLangText("持续创新的软硬件产品")}}</span>
  14. <div class="search-box">
  15. <div class="search">
  16. <input type="text" :placeholder="`${lang===langType.cn?'输入产品名称':getLangText('输入产品名称')}`" v-model="key">
  17. <button type="button" @click="searchProduct">O</button>
  18. </div>
  19. </div>
  20. </div>
  21. </div>
  22. </template>
  23. <script>
  24. import langMap from "@/map/langMap";
  25. export default {
  26. name: "productBanner",
  27. props:{
  28. pKey:{},
  29. lang:{
  30. default: langMap.lang.cn
  31. },
  32. },
  33. data(){
  34. return {
  35. langType: langMap.lang,
  36. key:this.pKey?this.pKey:'',
  37. }
  38. },
  39. methods:{
  40. getLangText(str){
  41. return langMap.getText(this.lang,str);
  42. },
  43. getAbbrText(str){
  44. return langMap.getAbbrText(this.lang,str);
  45. },
  46. searchProduct(){
  47. this.$root.$emit('searchProductKey',this.key);
  48. }
  49. }
  50. }
  51. </script>
  52. <style scoped>
  53. .banner {
  54. width: 100%;
  55. position: relative;
  56. display: flex;
  57. overflow: hidden;
  58. height: 450px;
  59. justify-content: center;
  60. align-items: center;
  61. }
  62. .banner *{
  63. transition: all .4s;
  64. }
  65. .banner .imgBox{
  66. width: 100%;
  67. height: 100%;
  68. position: absolute;
  69. left: 0;
  70. top: 0;
  71. }
  72. .banner:hover .imgBox > img{
  73. left: -20px;
  74. top: -20px;
  75. max-width: calc(100% + 40px);
  76. width: calc(100% + 40px);
  77. height: calc(100% + 40px);
  78. }
  79. .banner-con{
  80. position: relative;
  81. padding: 15px 30px;
  82. display: flex;
  83. justify-content: center;
  84. flex-direction: column;
  85. margin-top: 100px;
  86. }
  87. .bg-absolute{
  88. position: absolute;
  89. filter: blur(5px);
  90. background-image: linear-gradient(rgba(0,0,0,0) 0,rgba(0,0,0,0.5) 60% );
  91. color: #b9b7b7;
  92. }
  93. .banner-con > span{
  94. width: 420px;
  95. font-size: 2.5em;
  96. color: white;
  97. font-weight: bold;
  98. cursor: default;
  99. display: flex;
  100. justify-content: center;
  101. }
  102. .banner:hover .banner-con > span{
  103. font-size: 2.6em;
  104. }
  105. .banner-con > .subTitle{
  106. font-size: 2em;
  107. }
  108. .banner:hover .banner-con > .subTitle{
  109. font-size: 1.9em;
  110. }
  111. .banner-con .search-box{
  112. width: 100%;
  113. display: flex;
  114. justify-content: center;
  115. }
  116. .banner-con .search{
  117. width: 340px;
  118. height: 40px;
  119. margin-top: 10px;
  120. /*background-color: #fff;*/
  121. box-shadow: 1px 1px 6px 4px #22b3e5;
  122. border-radius: 40px;
  123. cursor: pointer;
  124. overflow: hidden;
  125. position: relative;
  126. }
  127. .banner:hover .banner-con .search{
  128. width: 400px;
  129. border: 1px solid #ffffff;
  130. }
  131. .banner-con .search > *{
  132. display: block;
  133. }
  134. .banner-con .search-box .search input{
  135. width: 100%;
  136. height: 100%;
  137. border-radius: 40px;
  138. outline: #22b3e5;
  139. BACKGROUND-COLOR: transparent;
  140. padding-left: 15px;
  141. color: #b4b4b4;
  142. }
  143. .banner-con .search-box .search button{
  144. display: block;
  145. width: 40px;
  146. height: 40px;
  147. position: absolute;
  148. right: 0;
  149. top: 0;
  150. color: white;
  151. font-size: 1.4em;
  152. }
  153. .banner-con .search-box .search button:hover{
  154. font-size: 1.6em;
  155. color: orangered;
  156. }
  157. </style>