solutionList.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <div class="content productList">
  3. <div class="conBox solutionCenter">
  4. <a class="solution"
  5. v-for="(item,i) in solutionList"
  6. :key="'pro-'+i"
  7. @click="clickSolutionHandle(item)"
  8. >
  9. <span class="imgBox">
  10. <img :src="'/public/'+item.image" :alt="item.name" class="img">
  11. </span>
  12. <span class="more">
  13. {{lang===langType.cn?"了解更多":getAbbrText("了解更多")}}
  14. </span>
  15. <p class="solution-info">
  16. <span class="title">
  17. {{lang===langType.cn?item.name:getAbbrText(item.name)}}
  18. </span>
  19. <span class="description" v-if="item.remark">
  20. {{item.remark}}
  21. </span>
  22. </p>
  23. </a>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. import langMap from "~/map/langMap";
  29. export default {
  30. name: "solutionList",
  31. props: {
  32. lang:{
  33. default: langMap.lang.cn
  34. },
  35. solutionList: {
  36. default(){
  37. return []
  38. }
  39. },
  40. parentType: {
  41. default: 'solution'
  42. }
  43. },
  44. data(){
  45. return {
  46. langType: langMap.lang,
  47. }
  48. },
  49. methods: {
  50. getLangText(str) {
  51. return langMap.getText(this.lang, str);
  52. },
  53. getAbbrText(str) {
  54. return langMap.getAbbrText(this.lang, str);
  55. },
  56. clickSolutionHandle(solution){
  57. console.log(solution);
  58. let url = ""
  59. if(solution.sourceType === "1"){
  60. url = solution.source;
  61. }else{
  62. url = `/${this.parentType}/info/${solution.type_key}?id=${solution.id}`
  63. }
  64. window.location.href = url;
  65. }
  66. }
  67. }
  68. </script>
  69. <style scoped>
  70. /*@import "~/assets/productList.css";*/
  71. .solutionCenter{
  72. margin: 10px auto;
  73. display: flex;
  74. justify-content: center;
  75. flex-direction: column;
  76. }
  77. .solution{
  78. display: flex;
  79. height: 360px;
  80. margin-bottom: 30px;
  81. border-radius: 3px;
  82. position: relative;
  83. box-shadow: 1px 1px 5px black;
  84. justify-content: space-between;
  85. cursor: pointer;
  86. padding: 5px;
  87. box-sizing: content-box;
  88. }
  89. .solution .imgBox{
  90. display: flex;
  91. /*position: relative;*/
  92. width: 40%;
  93. height: 360px;
  94. overflow: hidden;
  95. justify-content: center;
  96. flex-shrink: 1;
  97. }
  98. .solution .imgBox img{
  99. display: block;
  100. max-width: 100%;
  101. width: auto;
  102. height: 100%;
  103. position: relative;
  104. }
  105. .solution .more{
  106. background-color: #912b02;
  107. padding: 0 30px;
  108. border-radius: 4px;
  109. display: block;
  110. position: absolute;
  111. right: 20px;
  112. bottom: 20px;
  113. opacity: 0;
  114. transition:all 0.5s;
  115. color: white;
  116. }
  117. .solution:hover .more{
  118. opacity: 1;
  119. background-color: orangered;
  120. }
  121. .solution .more:hover{
  122. box-shadow: 1px 1px 5px white;
  123. padding: 0 25px;
  124. }
  125. .solution .solution-info{
  126. display: block;
  127. width: calc(60% - 15px);
  128. padding: 5px;
  129. margin-left: 15px;
  130. box-sizing: border-box;
  131. }
  132. .solution .solution-info .title{
  133. font-size: 2rem;
  134. display: block;
  135. }
  136. .solution .solution-info .escription{
  137. display: block;
  138. text-indent: 2em;
  139. }
  140. </style>