solutionTypes.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <div class="content">
  3. <big-title>{{lang===langType.cn?"解决方案":getAbbrText("解决方案")}}</big-title>
  4. <div class="conBox product-type">
  5. <p
  6. v-for="(item,i) in types"
  7. :key="item.key"
  8. :class="`type-item ${item.key===type?'type-selected':''}`"
  9. @click="selectType(item.key)"
  10. >
  11. <span class="icon-box">
  12. <svg-icon :icon-class="item.icon"/>
  13. </span>
  14. <span class="type-name">{{lang===langType.cn?item.text:getAbbrText(item.text)}}</span>
  15. </p>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. import langMap from "@/map/langMap";
  21. import {sTypes} from "~/map/solutionMap";
  22. export default {
  23. name: "solutionTypes",
  24. props: {
  25. lang:{
  26. default: langMap.lang.cn
  27. },
  28. type:{
  29. default: 'all'
  30. }
  31. },
  32. data(){
  33. return {
  34. langType: langMap.lang,
  35. types: sTypes
  36. }
  37. },
  38. methods:{
  39. getLangText(str) {
  40. return langMap.getText(this.lang, str);
  41. },
  42. getAbbrText(str) {
  43. return langMap.getAbbrText(this.lang, str);
  44. },
  45. selectType(nextType){
  46. console.log(nextType)
  47. if (this.type === nextType){
  48. return 0;
  49. }
  50. this.$root.$emit('changeSolutionType',nextType);
  51. }
  52. }
  53. }
  54. </script>
  55. <style scoped>
  56. .content{
  57. cursor: default;
  58. }
  59. .content .big-title{
  60. margin-top: 10px;
  61. margin-bottom: 30px;
  62. }
  63. .product-type{
  64. height: 120px;
  65. display: grid;
  66. grid-template-columns: repeat(4,1fr);
  67. }
  68. .product-type .type-item{
  69. width: auto;
  70. height: 100%;
  71. cursor: pointer;
  72. }
  73. .product-type .type-item:hover{
  74. color: orangered;
  75. }
  76. .content .product-type .type-selected{
  77. color: #f88330;
  78. }
  79. .product-type .type-item .icon-box{
  80. width: 100%;
  81. height: 50px;
  82. display: flex;
  83. justify-content: center;
  84. align-items: center;
  85. font-size: 4rem;
  86. padding-bottom: 20px;
  87. }
  88. .content .product-type .type-selected .icon-box{
  89. border-bottom: 1px solid deepskyblue;
  90. }
  91. .product-type .type-item .type-name{
  92. width: 100%;
  93. height: 60px;
  94. font-size: 1.3rem;
  95. display: flex;
  96. justify-content: center;
  97. align-items: center;
  98. }
  99. </style>