index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <Container
  3. title="首页"
  4. :showBack="false"
  5. :scrollStyle="{
  6. paddingLeft: 0,
  7. paddingRight: 0,
  8. }"
  9. >
  10. <view class="home">
  11. <!-- 倒计时 -->
  12. <view class="time">
  13. <view>倒计时</view>
  14. <view>151天</view>
  15. </view>
  16. <!-- 轮播图 -->
  17. <swiper class="swiper" circular autoplay>
  18. <swiper-item>
  19. <view class="swiper-item">A</view>
  20. </swiper-item>
  21. <swiper-item>
  22. <view class="swiper-item">B</view>
  23. </swiper-item>
  24. <swiper-item>
  25. <view class="swiper-item">C</view>
  26. </swiper-item>
  27. </swiper>
  28. <!-- 公告 -->
  29. <view class="notice">
  30. <view class="title">公告</view>
  31. <view>这是公告</view>
  32. </view>
  33. <!-- 2025新大纲 -->
  34. <view class="new_outline">
  35. <uni-section title="基础用法" type="line">
  36. <view class="p-20">
  37. <uni-segmented-control
  38. :flex="false"
  39. :current="current"
  40. :values="items"
  41. style-type="text"
  42. @clickItem="(e) => (current = e.currentIndex)"
  43. />
  44. <!-- 执业药师 -->
  45. <view v-if="current === 0" class="grid">
  46. <view v-for="item in 7" class="flex" @click="clickClass">
  47. <view class="bg-red"></view>
  48. <view> 执业药师{{ item }} </view>
  49. </view>
  50. </view>
  51. <!-- 药学职称 -->
  52. <view v-if="current === 1" class="grid"
  53. ><view v-for="item in 7" class="flex" @click="clickClass">
  54. <view class="bg-red"></view>
  55. <view> 药学职称{{ item }} </view>
  56. </view></view
  57. >
  58. </view>
  59. </uni-section>
  60. </view>
  61. </view>
  62. <uni-section title="往年真题" type="line">
  63. <!-- 往年真题 -->
  64. <view class="grid-3">
  65. <view v-for="item in 7" class="flex">
  66. <view class="bg-red"></view>
  67. <view> 执业药师{{ item }} </view>
  68. </view>
  69. </view>
  70. </uni-section>
  71. </Container>
  72. </template>
  73. <script setup>
  74. import { ref } from "vue";
  75. import Container from "../../components/Container/Container.vue";
  76. import { router } from "../../utils/router";
  77. const current = ref(0);
  78. const items = ref(["标签1", "标签2"]);
  79. const clickClass = () => {
  80. router.push({
  81. url: '/pages/regulations/index'
  82. })
  83. }
  84. </script>
  85. <style scoped lang="scss">
  86. .home {
  87. display: flex;
  88. flex-direction: column;
  89. gap: 20rpx;
  90. .time {
  91. display: flex;
  92. align-items: center;
  93. justify-content: center;
  94. gap: 80rpx;
  95. }
  96. .swiper {
  97. height: 320rpx;
  98. border: 1rpx solid #000000;
  99. width: 100%;
  100. .swiper-item {
  101. display: block;
  102. height: 320rpx;
  103. line-height: 320rpx;
  104. text-align: center;
  105. background-color: red;
  106. }
  107. }
  108. .notice {
  109. display: flex;
  110. align-items: center;
  111. gap: 20rpx;
  112. padding-left: 26rpx;
  113. }
  114. .new_outline {
  115. border: 1rpx solid #000000;
  116. }
  117. }
  118. .title {
  119. font-family: "PingFang SC, PingFang SC";
  120. font-weight: 700;
  121. font-size: 32rpx;
  122. color: #000000;
  123. }
  124. .p-20 {
  125. padding: 0 30rpx 30rpx;
  126. display: flex;
  127. flex-direction: column;
  128. gap: 20rpx;
  129. }
  130. .grid {
  131. display: grid;
  132. grid-template-columns: repeat(4, 1fr);
  133. gap: 20rpx;
  134. }
  135. .grid-3 {
  136. display: grid;
  137. grid-template-columns: repeat(3, 1fr);
  138. gap: 20rpx;
  139. height: 100%;
  140. }
  141. .flex {
  142. display: flex;
  143. flex-direction: column;
  144. gap: 20rpx;
  145. align-items: center;
  146. justify-content: center;
  147. }
  148. .bg-red {
  149. width: 149rpx;
  150. height: 80rpx;
  151. background: #d9d9d9;
  152. }
  153. </style>