<template>
  <div class="banner">
    <div class="imgBox">
      <img src="/image/banner/banner_product.png" alt="">
    </div>
    <div class="banner-con bg-absolute">
      <span>{{lang===langType.cn?"产品中心":getAbbrText("产品中心")}}</span>
      <span class="subTitle">{{lang===langType.cn?"持续创新的软硬件产品":getLangText("持续创新的软硬件产品")}}</span>
      <span>1</span>
    </div>
    <div class="banner-con">
      <span>{{lang===langType.cn?"产品中心":getAbbrText("产品中心")}}</span>
      <span class="subTitle">{{lang===langType.cn?"持续创新的软硬件产品":getLangText("持续创新的软硬件产品")}}</span>
      <div class="search-box">
        <div class="search">
          <input type="text" :placeholder="`${lang===langType.cn?'输入产品名称':getLangText('输入产品名称')}`" v-model="key">
          <button type="button" @click="searchProduct">O</button>
        </div>
      </div>

    </div>


  </div>
</template>

<script>
import langMap from "@/map/langMap";

export default {
  name: "productBanner",
  props:{
    pKey:{},
    lang:{
      default: langMap.lang.cn
    },
  },
  data(){
    return {
      langType: langMap.lang,
      key:this.pKey?this.pKey:'',
    }
  },

  methods:{
    getLangText(str){
      return langMap.getText(this.lang,str);
    },
    getAbbrText(str){
      return langMap.getAbbrText(this.lang,str);
    },
    searchProduct(){
      this.$root.$emit('searchProductKey',this.key);
    }
  }
}
</script>

<style scoped>
@import "@/assets/publicBanner.css";
</style>
