solutionList.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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. },
  41. data(){
  42. return {
  43. langType: langMap.lang,
  44. }
  45. },
  46. methods: {
  47. getLangText(str) {
  48. return langMap.getText(this.lang, str);
  49. },
  50. getAbbrText(str) {
  51. return langMap.getAbbrText(this.lang, str);
  52. },
  53. clickSolutionHandle(solution){
  54. console.log(solution);
  55. let url = ""
  56. if(solution.sourceType === "1"){
  57. url = solution.source;
  58. }else{
  59. url = `/solution/item/${solution.type_key}?id=${solution.id}`
  60. }
  61. window.location.href = url;
  62. }
  63. }
  64. }
  65. </script>
  66. <style scoped>
  67. /*@import "~/assets/productList.css";*/
  68. .solutionCenter{
  69. margin: 10px auto;
  70. display: flex;
  71. justify-content: center;
  72. flex-direction: column;
  73. }
  74. .solution{
  75. display: flex;
  76. height: 360px;
  77. margin-bottom: 30px;
  78. border-radius: 3px;
  79. position: relative;
  80. box-shadow: 1px 1px 5px black;
  81. justify-content: space-between;
  82. cursor: pointer;
  83. padding: 5px;
  84. box-sizing: content-box;
  85. }
  86. .solution .imgBox{
  87. display: flex;
  88. /*position: relative;*/
  89. width: 40%;
  90. height: 360px;
  91. overflow: hidden;
  92. justify-content: center;
  93. flex-shrink: 1;
  94. }
  95. .solution .imgBox img{
  96. display: block;
  97. max-width: 100%;
  98. width: auto;
  99. height: 100%;
  100. position: relative;
  101. }
  102. .solution .more{
  103. background-color: #912b02;
  104. padding: 0 30px;
  105. border-radius: 4px;
  106. display: block;
  107. position: absolute;
  108. right: 20px;
  109. bottom: 20px;
  110. opacity: 0;
  111. transition:all 0.5s;
  112. color: white;
  113. }
  114. .solution:hover .more{
  115. opacity: 1;
  116. background-color: orangered;
  117. }
  118. .solution .more:hover{
  119. box-shadow: 1px 1px 5px white;
  120. padding: 0 25px;
  121. }
  122. .solution .solution-info{
  123. display: block;
  124. width: calc(60% - 15px);
  125. padding: 5px;
  126. margin-left: 15px;
  127. box-sizing: border-box;
  128. }
  129. .solution .solution-info .title{
  130. font-size: 2rem;
  131. display: block;
  132. }
  133. .solution .solution-info .escription{
  134. display: block;
  135. text-indent: 2em;
  136. }
  137. </style>