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