layoutHome.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <div class="one">
  3. <!-- 首页 -->
  4. <video class="container" autoplay muted loop width="100%" height="100%">
  5. <source src="@/assets/img/pcImg/业.mp4" type="video/mp4" />
  6. </video>
  7. <div class="container" :style="{ height: bodyHeight }">
  8. <LayoutHeader></LayoutHeader>
  9. <div class="container_main">
  10. <img class="center_img" src="@/assets/img/pcImg/组47.png" alt="" />
  11. <span class="main_text first_text ellipsis"
  12. >南岸区位于重庆市都市区、中心城区、两江四岸核心区,面积262平方公里,</span
  13. >
  14. <span class="main_text ellipsis">常住人口约120万,是最能体现重庆山水之城、美丽之地的区域。</span>
  15. <div class="main_texts ellipsis">面朝大江,波涛江畔的人文盛景</div>
  16. </div>
  17. </div>
  18. </div>
  19. </template>
  20. <script>
  21. import LayoutHeader from '@/components/layoutHeader.vue';
  22. import bodyHeightMixins from '@/mixins/bodyHeight';
  23. export default {
  24. mixins: [bodyHeightMixins],
  25. components: {
  26. LayoutHeader
  27. },
  28. data() {
  29. return {
  30. activeName: 'first'
  31. };
  32. },
  33. methods: {
  34. handleClick(tab, event) {
  35. console.log(tab, event);
  36. }
  37. }
  38. };
  39. </script>
  40. <style scoped lang="less">
  41. .one{
  42. width: 100%;
  43. height: 100%;
  44. }
  45. .container {
  46. position: fixed;
  47. top: 0;
  48. left: 0;
  49. display: flex;
  50. width: 100%;
  51. // background-image: url('~@/assets/img/pcImg/矩形1拷贝3.png');
  52. background-size: 100% 100%;
  53. flex-direction: column;
  54. z-index: -10;
  55. object-fit: fill;
  56. }
  57. .container_main {
  58. flex: 1;
  59. display: flex;
  60. flex-direction: column;
  61. align-items: center;
  62. justify-content: center;
  63. z-index: 1000;
  64. // position: absolute;
  65. // left: 50%;
  66. // margin-top: 236px;
  67. // transform: translate(-50%, -50%);
  68. .center_img {
  69. width: 870px;
  70. height: 119px;
  71. }
  72. .main_text {
  73. font-size: 24px;
  74. color: #fff;
  75. }
  76. .first_text {
  77. margin: 32px 0 17px 0;
  78. }
  79. .main_texts {
  80. width: 462px;
  81. height: 66px;
  82. margin-top: 58px;
  83. overflow: hidden;
  84. font-size: 24px;
  85. line-height: 66px;
  86. color: #ffffff;
  87. text-align: center;
  88. text-overflow: ellipsis;
  89. white-space: nowrap;
  90. background: #bfa254;
  91. border-radius: 6px;
  92. }
  93. }
  94. .ellipsis {
  95. overflow: hidden;
  96. text-overflow: ellipsis;
  97. white-space: nowrap;
  98. /* 非必须,只是为了制造一行放不下的效果 */
  99. // max-width: 375px;
  100. }
  101. </style>