homePage_gyt.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <!--
  2. * @FileDescription: 管乐迷首页
  3. * @Author: 黄琪勇
  4. * @Date:2024-03-20 17:26:35
  5. -->
  6. <template>
  7. <navContainer class="navContainer" :headImg="headImg" :navs="navs">
  8. <div class="homePage">
  9. <div class="classTypes">
  10. <div class="classType" v-for="item in classTypes" :key="item.name" @click="handleRouter(item.url)">
  11. <img :src="item.img" />
  12. <div>{{ item.name }}</div>
  13. </div>
  14. </div>
  15. <div class="courseBoard">
  16. <div class="details">
  17. <el-empty :image-size="360" :image="require('@/img/layout/empty.png')" description="您还没有待上课程哦~" />
  18. </div>
  19. </div>
  20. </div>
  21. </navContainer>
  22. </template>
  23. <script setup lang="ts">
  24. import navContainer from "./components/navContainer"
  25. import { useRouter } from "vue-router"
  26. import useDialogConfirm from "@/hooks/useDialogConfirm"
  27. const router = useRouter()
  28. const headImg = {
  29. img: require("@/img/homePage/home.png")
  30. }
  31. const navs = [
  32. {
  33. name: "主页"
  34. }
  35. ]
  36. const classTypes = [
  37. {
  38. img: require("@/img/homePage/kb.png"),
  39. name: "课表",
  40. url: ""
  41. },
  42. {
  43. img: require("@/img/homePage/xl.png"),
  44. name: "课后作业",
  45. url: ""
  46. },
  47. {
  48. img: require("@/img/homePage/jdzc.png"),
  49. name: "阶段自测",
  50. url: ""
  51. },
  52. {
  53. img: require("@/img/homePage/xltj.png"),
  54. name: "练习情况",
  55. url: ""
  56. },
  57. {
  58. img: require("@/img/homePage/yjl.png"),
  59. name: "云练习",
  60. url: ""
  61. },
  62. {
  63. img: require("@/img/homePage/yjc.png"),
  64. name: "云教材",
  65. url: "/cloudTextbooks"
  66. }
  67. ]
  68. function handleRouter(url?: string) {
  69. url
  70. ? router.push(url)
  71. : useDialogConfirm({
  72. headImg: require("@/img/homePage/ts.png"),
  73. text: "该功能暂未开放,请敬请期待哦~",
  74. btnShow: [true]
  75. })
  76. }
  77. </script>
  78. <style lang="scss" scoped>
  79. .navContainer :deep(.navImg > img) {
  80. top: 72% !important;
  81. }
  82. .homePage {
  83. width: 100%;
  84. height: 100%;
  85. padding: 50px;
  86. display: flex;
  87. .classTypes {
  88. flex-grow: 1;
  89. display: flex;
  90. flex-wrap: wrap;
  91. margin-bottom: -30px;
  92. margin-left: -30px;
  93. .classType {
  94. background: #feffff;
  95. box-shadow: 0px 2px 14px 0px #f1e3cc;
  96. border-radius: 34px;
  97. margin-left: 30px;
  98. margin-bottom: 30px;
  99. width: calc(33.33% - 30px);
  100. display: flex;
  101. justify-content: center;
  102. align-items: center;
  103. flex-direction: column;
  104. cursor: pointer;
  105. &:hover {
  106. opacity: $opacity-hover;
  107. }
  108. > div {
  109. margin-top: 10px;
  110. font-family: AlimamaFangYuanTiVF, AlimamaFangYuanTiVF;
  111. font-weight: bold;
  112. font-size: 28px;
  113. color: #393939;
  114. }
  115. > img {
  116. width: 100%;
  117. max-width: 254px;
  118. }
  119. }
  120. }
  121. .courseBoard {
  122. flex-shrink: 0;
  123. margin-left: 50px;
  124. margin-top: -35px;
  125. width: 572px;
  126. height: calc(100% + 35px);
  127. background: url("@/img/homePage/bg.png") no-repeat;
  128. background-size: cover;
  129. position: relative;
  130. .details {
  131. width: 100%;
  132. position: absolute;
  133. display: flex;
  134. justify-content: center;
  135. align-items: center;
  136. top: 168px;
  137. }
  138. }
  139. }
  140. </style>