| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <template>
- <div class="content">
- <big-title>
- {{lang===langType.cn?"新闻中心":getAbbrText("新闻中心")}}
- </big-title>
- <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.title:getAbbrText(item.title)}}</span>
- </p>
- </div>
- </div>
- </template>
- <script>
- import langMap from "@/map/langMap";
- import {sTypes} from "~/map/newMap";
- import BigTitle from "~/components/public/bigTitle.vue";
- export default {
- name: "newsTypes",
- components: {BigTitle},
- props: {
- lang:{
- default: langMap.lang.cn
- },
- type:{
- default: 'all'
- }
- },
- data(){
- return {
- langType: langMap.lang,
- types: sTypes
- }
- },
- 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('changeNewsType',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(4,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;
- }
- .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>
|