showingStand.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <div class="content">
  3. <div class="conBox big-title">
  4. <span>
  5. {{lang===langType.cn?"关于我们":getAbbrText("关于我们")}}
  6. </span>
  7. <div class="hr"></div>
  8. </div>
  9. <div class="conBox showing">
  10. <a
  11. v-for="(item,i) in chunkItems"
  12. :class="`chunk imgBox chunk${(i+1)}`"
  13. :key="item.id"
  14. :href="item.href"
  15. >
  16. <!-- 实时管理(物联网) -->
  17. <img :src="item.img" alt="imgNotFound">
  18. <p class="chunkText">
  19. <span class="title">{{lang===langType.cn?item.title:getAbbrText(item.title)}}</span>
  20. <span class="subTitle">{{lang===langType.cn?item.subTitle:getAbbrText(item.subTitle)}}</span>
  21. <span class="chunkMore">
  22. {{lang===langType.cn?"了解更多":getAbbrText("了解更多")}}
  23. </span>
  24. </p>
  25. </a>
  26. </div>
  27. </div>
  28. </template>
  29. <script>
  30. import langMap from "~/map/langMap";
  31. import {showingStandData} from "@/map/showingData";
  32. export default {
  33. name: "showingStand",
  34. props: {
  35. lang:{
  36. default: langMap.lang.cn
  37. },
  38. },
  39. data(){
  40. return {
  41. langType: langMap.lang,
  42. // chunk 1-7
  43. chunkItems:showingStandData
  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. }
  54. }
  55. </script>
  56. <style scoped>
  57. .showing{
  58. display: grid;
  59. grid-template-columns: repeat(3, 425px);
  60. grid-template-rows: repeat(3, 350px);
  61. grid-template-areas:
  62. 'a b c'
  63. 'd d c'
  64. 'e f g';
  65. grid-gap: 20px;
  66. }
  67. .showing .chunk {
  68. box-shadow: 1px 1px 3px black;
  69. /*box-sizing: border-box;*/
  70. /*padding:5px;*/
  71. position: relative;
  72. overflow: hidden;
  73. cursor: pointer;
  74. }
  75. .showing .chunk:hover{
  76. box-shadow: 1px 1px 3px deepskyblue;
  77. }
  78. .showing .chunk:hover > img{
  79. left: -20px;
  80. top: -20px;
  81. max-width: calc(100% + 40px);
  82. width: calc(100% + 40px);
  83. height: calc(100% + 40px);
  84. }
  85. .showing .chunk .chunkText{
  86. display: block;
  87. position: absolute;
  88. width: 100%;
  89. height: 150px;
  90. bottom: -50px;
  91. /*background: #000;*/
  92. color: white;
  93. transition: all .5s;
  94. padding: 0 15px;
  95. background-image: linear-gradient(rgba(0,0,0,0) 0,rgba(0,0,0,0.5) 75% );
  96. }
  97. .showing .chunk:hover .chunkText{
  98. bottom: 0;
  99. background-image: linear-gradient(rgba(0,0,0,0) 0,rgba(0,0,0,0.66) 66% 15% 80% );
  100. }
  101. .showing .chunk .chunkText .title{
  102. height: 40px;
  103. font-size: 1.5em;
  104. display: flex;
  105. /*justify-content: center;*/
  106. align-items: center;
  107. }
  108. .showing .chunk .chunkText .subTitle{
  109. padding: 5px 0;
  110. min-height: 35px;
  111. max-height: 80px;
  112. font-size: 1.2em;
  113. }
  114. .showing .chunk .chunkText .chunkMore{
  115. margin-top: 20px;
  116. height: 30px;
  117. font-size: 0.9em;
  118. color: #ff6e3f;
  119. }
  120. .showing .chunk .chunkText .chunkMore:hover{
  121. color: orangered;
  122. }
  123. .showing .chunk .chunkText > *{
  124. display: block;
  125. }
  126. .showing .chunk1 {
  127. grid-area: a;
  128. }
  129. .showing .chunk2{
  130. grid-area: b;
  131. }
  132. .showing .chunk3{
  133. grid-area: c;
  134. }
  135. .showing .chunk4{
  136. grid-area: d;
  137. }
  138. .showing .chunk5{
  139. grid-area: e;
  140. }
  141. .showing .chunk6{
  142. grid-area: f;
  143. }
  144. .showing .chunk7{
  145. grid-area: g;
  146. }
  147. </style>