| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- <template>
- <div class="content">
- <div class="conBox big-title">
- <span>
- {{lang===langType.cn?"产品类别":getAbbrText("产品类别")}}
- </span>
- <div class="hr"></div>
- </div>
- <div class="conBox product-type">
- <p
- v-for="(item,i) in types"
- :key="item.key"
- :class="`type-item ${item.key===type?'type-selected':''}`"
- @click="selectType(item.key)"
- >
- <span class="icon-box">
- <svg-icon :icon-class="item.icon"/>
- </span>
- <span class="type-name">{{lang===langType.cn?item.text:getAbbrText(item.text)}}</span>
- </p>
- </div>
- </div>
- </template>
- <script>
- import langMap from "@/map/langMap";
- export default {
- name: "productTypes",
- props: {
- lang:{
- default: langMap.lang.cn
- },
- type:{
- default: 'all'
- }
- },
- data(){
- return {
- langType: langMap.lang,
- types:[
- {
- key: 'all',
- icon: 'all',
- text: '所有产品'
- },
- {
- key: 'cam',
- icon: 'camera2',
- text: '多目协同摄像头'
- },
- {
- key: 'aiCam',
- icon: 'camera',
- text: 'AI摄像头'
- },
- {
- key: 'low',
- icon: 'lowPower',
- text: '低功耗产品'
- },
- {
- key: 'm2m',
- icon: 'm2m',
- text: 'm2m产品'
- },
- {
- key: 'sm',
- icon: 'smartDev',
- text: '智能终端'
- },
- ]
- }
- },
- methods:{
- getLangText(str) {
- return langMap.getText(this.lang, str);
- },
- getAbbrText(str) {
- return langMap.getAbbrText(this.lang, str);
- },
- selectType(nextType){
- console.log(nextType)
- if (this.type === nextType){
- return 0;
- }
- this.$root.$emit('changeProductType',nextType);
- }
- }
- }
- </script>
- <style scoped>
- .content{
- cursor: default;
- }
- .content .big-title{
- margin-top: 10px;
- margin-bottom: 30px;
- }
- .product-type{
- height: 120px;
- display: grid;
- grid-template-columns: repeat(6,1fr);
- }
- .product-type .type-item{
- width: auto;
- height: 100%;
- cursor: pointer;
- }
- .product-type .type-item:hover{
- color: orangered;
- }
- .content .product-type .type-selected{
- color: #f88330;
- }
- .product-type .type-item .icon-box{
- width: 100%;
- height: 50px;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 4rem;
- padding-bottom: 20px;
- }
- .content .product-type .type-selected .icon-box{
- border-bottom: 1px solid deepskyblue;
- }
- .product-type .type-item .type-name{
- width: 100%;
- height: 60px;
- font-size: 1.3rem;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- </style>
|