cgIndex.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <div id="home">
  3. <div class="title">
  4. <div class="logo"></div>
  5. <div class="fontSize">
  6. <div class="fontLogo"></div>
  7. </div>
  8. </div>
  9. <div class="list_box">
  10. <div class="list">
  11. <div v-for="(item, index) in list" class="item" @click="openUrl(item)">
  12. <div><img :src="item.img" /></div>
  13. <div>{{ item.name }}</div>
  14. </div>
  15. </div>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. import { getList } from '@/api/home';
  21. export default {
  22. data() {
  23. return {
  24. list: []
  25. };
  26. },
  27. created() {
  28. this.getPages();
  29. },
  30. methods: {
  31. openUrl(item) {
  32. let url = window.open('https://' + item.linkUrl, '_blank');
  33. },
  34. async getPages() {
  35. let { list } = await getList({ pageNum: 1, size: 9999 });
  36. this.list = list.map((item) => {
  37. return {
  38. ...item,
  39. img:
  40. window.location.origin +
  41. '/api/main/file/getFile?objectName=' +
  42. item.iconPath
  43. };
  44. });
  45. }
  46. }
  47. };
  48. </script>
  49. <style lang="scss" scoped>
  50. @font-face {
  51. font-family: '优设标题黑';
  52. src: url('@/assets/font_icon/优设标题黑.ttf');
  53. }
  54. #home {
  55. height: calc(100vh - 96px);
  56. width: 100%;
  57. display: flex;
  58. flex-direction: column;
  59. background: url('@/assets/boxBg.png');
  60. background-size: 100% 100%;
  61. background-repeat: no-repeat;
  62. .title {
  63. flex: 2;
  64. display: flex;
  65. justify-content: center;
  66. align-items: center;
  67. position: relative;
  68. .fontSize {
  69. margin-top: 7rem;
  70. .fontLogo {
  71. width: 25vw;
  72. aspect-ratio: 9.7/1;
  73. background: url('@/assets/fontTitle.png');
  74. background-size: 100% 100%;
  75. background-repeat: no-repeat;
  76. }
  77. }
  78. .logo {
  79. position: absolute;
  80. left: 30px;
  81. top: 30px;
  82. width: 14vw;
  83. aspect-ratio: 5.6/1;
  84. // background: url('@/assets/cglogo.png');
  85. // background-size: 100% 100%;
  86. // background-repeat: no-repeat;
  87. }
  88. }
  89. .list_box {
  90. flex: 4;
  91. .list {
  92. padding: 10px;
  93. box-sizing: border-box;
  94. display: flex;
  95. justify-content: center;
  96. .item {
  97. background: url('@/assets/bg.png');
  98. background-repeat: no-repeat;
  99. background-size: 100% 100%;
  100. display: inline-block;
  101. width: 10vw;
  102. aspect-ratio: 0.7/1;
  103. padding: 10px;
  104. box-sizing: border-box;
  105. margin-right: 2rem;
  106. border-radius: 5px;
  107. cursor: pointer;
  108. display: flex;
  109. flex-direction: column;
  110. > div:first-child {
  111. flex: 1;
  112. display: flex;
  113. align-items: center;
  114. justify-content: center;
  115. > img {
  116. width: 100%;
  117. aspect-ratio: 16/16;
  118. }
  119. }
  120. > div:last-child {
  121. flex: 1;
  122. font-family: '优设标题黑';
  123. color: #1383f1;
  124. font-size: 2.8rem;
  125. display: flex;
  126. align-items: center;
  127. justify-content: center;
  128. }
  129. }
  130. .margin_0 {
  131. margin-right: 0;
  132. }
  133. }
  134. }
  135. }
  136. </style>