You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

302 lines
6.7 KiB

3 months ago
  1. <template>
  2. <view class="content">
  3. <up-navbar leftText=" " :leftIconColor="'#fff'" :safeAreaInsetTop="true" :autoBack="true" title="我的学习" :bgColor="'transparent'" :titleStyle="{color: '#fff'}">
  4. </up-navbar>
  5. <view class="studyDay">已坚持学习8天</view>
  6. <view class="card">
  7. <view class="tabs">
  8. <view class="tab" @click="changeNav(1)" :class="{active: currentNav==1}">科一</view>
  9. <view class="tab" @click="changeNav(2)" :class="{active: currentNav==2}">科四</view>
  10. </view>
  11. <view class="pd20">
  12. <view class="statistics">
  13. <view class="statisticsItem" v-for="(item,index) in statisticsData" :key="index">
  14. <view class="num">{{ item.num }}</view>
  15. <view class="text">{{ item.name }}</view>
  16. </view>
  17. </view>
  18. <view class="h3">刷题进度</view>
  19. <view class="bgCard_row">
  20. <view class="bgCard">
  21. <view class="lab">顺序练习</view>
  22. <view class="tps">已完成</view>
  23. <view class="num">140/500</view>
  24. </view>
  25. <view class="bgCard">
  26. <view class="lab">精选试题</view>
  27. <view class="tps">已完成</view>
  28. <view class="num">110/500</view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="card card2">
  34. <view class="chartTab">
  35. <view class="h3">刷题进度</view>
  36. <view class="btn_row">
  37. <view class="btn" @click="changeChart(1)" :class="{bg: currentChart==1}">曲线</view>
  38. <view class="btn" @click="changeChart(2)" :class="{bg: currentChart==2}">明细</view>
  39. </view>
  40. </view>
  41. <view class="tip">近30次科目一模拟考试成绩</view>
  42. <view class="con" v-if="currentChart==1">
  43. 图表
  44. <view class="tips">按住可左右滑动查看更多成绩</view>
  45. </view>
  46. <view class="con" v-if="currentChart==2">
  47. <view class="tables">
  48. <view class="fristTab li">
  49. <view class="item">考试成绩</view>
  50. <view class="item">考试用时</view>
  51. <view class="item">考试时间</view>
  52. </view>
  53. <view class="li">
  54. <view class="item">90</view>
  55. <view class="item">10分30秒</view>
  56. <view class="item">2024-8-28</view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. <!-- 如果是科目四并且没有数据 -->
  62. <view class="subject4 card2 card" v-if="currentNav==2">
  63. <view class="h3">模拟考试</view>
  64. <nodata>暂无考试记录</nodata>
  65. <view class="btnE">
  66. <oneBtn text="去考试" @oneBtnClick="$goPage('/pages/exercises/beforeExam/beforeExam')"></oneBtn>
  67. </view>
  68. </view>
  69. </view>
  70. </template>
  71. <script setup>
  72. import { ref } from 'vue'
  73. import nodata from '@/components/nodata/nodata.vue'
  74. const value = ref(false)
  75. const currentNav = ref(1)
  76. function changeNav(val) {
  77. currentNav.value = val
  78. }
  79. const statisticsData = ref([
  80. {name: '我的收藏', num: 0},
  81. {name: '我的错题', num: 1},
  82. {name: '考试记录', num: 2},
  83. {name: '预计合格率', num: '100%'},
  84. ])
  85. const currentChart = ref(1)
  86. function changeChart(num) {
  87. currentChart.value = num
  88. }
  89. </script>
  90. <style lang="scss" scoped>
  91. .u-nav-slot {
  92. display: flex;
  93. .btn {
  94. color: #fff;
  95. position: relative;
  96. padding: 0 20rpx;
  97. &.active {
  98. &::before {
  99. content: '';
  100. position: absolute;
  101. left: 50%;
  102. bottom: -20rpx;
  103. width: 30rpx;
  104. height: 4rpx;
  105. background: #F6F7F8;
  106. border-radius: 2rpx;
  107. transform: translateX(-50%);
  108. }
  109. }
  110. }
  111. }
  112. .content {
  113. width: 100%;
  114. // background-color: #F6F7FA;
  115. min-height: 100vh;
  116. padding: 100rpx 30rpx 30rpx 30rpx;
  117. background: url('../../../static/images/topbg.png') #F6F7FA no-repeat;
  118. background-size: 100% 410rpx;
  119. .studyDay {
  120. font-weight: bold;
  121. font-size: 36rpx;
  122. color: #FFFFFF;
  123. padding: 40rpx 0;
  124. }
  125. .card {
  126. background: #FFFFFF;
  127. border-radius: 20rpx;
  128. overflow: hidden;
  129. margin-top: 20rpx;
  130. &.card2 {
  131. padding: 20rpx;
  132. }
  133. .pd20 {
  134. padding: 20rpx;
  135. }
  136. .tabs {
  137. height: 84rpx;
  138. background: #F6F7FA;
  139. border-radius: 20rpx 20rpx 0px 0px;
  140. display: flex;
  141. line-height: 84rpx;
  142. text-align: center;
  143. .tab {
  144. width: 160rpx;
  145. font-weight: 500;
  146. font-size: 28rpx;
  147. &.active {
  148. background: #fff;
  149. }
  150. }
  151. }
  152. .statistics {
  153. display: flex;
  154. .statisticsItem {
  155. width: 25%;
  156. display: flex;
  157. flex-direction: column;
  158. align-items: center;
  159. justify-content: center;
  160. height: 152rpx;
  161. &:last-child {
  162. background: linear-gradient(0deg, rgba(55,118,255,0) 0%, #EDF3FF 100%);
  163. border-radius: 10px;
  164. color: $themC;
  165. .text {
  166. color: $themC;
  167. }
  168. }
  169. .num {
  170. font-family: DIN;
  171. font-weight: bold;
  172. font-size: 38rpx;
  173. margin-bottom: 6rpx;
  174. }
  175. .text {
  176. font-size: 24rpx;
  177. color: #CCCCCC;
  178. margin-bottom: 16rpx;
  179. }
  180. }
  181. }
  182. .h3 {
  183. font-weight: 500;
  184. font-size: 30rpx;
  185. }
  186. .bgCard_row {
  187. display: flex;
  188. justify-content: space-between;
  189. margin-top: 20rpx;
  190. .bgCard {
  191. padding: 20rpx 0 0 30rpx;
  192. height: 172rpx;
  193. width: 48%;
  194. &:first-child {
  195. background: url('../../../static/images/mystudy1.png') no-repeat;
  196. background-size: 100% 100%;
  197. color: #24CBBA;
  198. }
  199. &:last-child {
  200. background: url('../../../static/images/mystudy2.png') no-repeat;
  201. background-size: 100% 100%;
  202. color: #F07634;
  203. }
  204. .lab {
  205. font-size: 28rpx;
  206. }
  207. .tps {
  208. font-size: 24rpx;
  209. opacity: 0.3;
  210. padding: 6rpx 0;
  211. }
  212. .num {
  213. font-family: DIN;
  214. font-weight: bold;
  215. font-size: 36rpx;
  216. }
  217. }
  218. }
  219. }
  220. .tip {
  221. font-size: 24rpx;
  222. color: #ccc;
  223. padding: 10rpx 0 30rpx;
  224. }
  225. .tips {
  226. width: 360rpx;
  227. height: 48rpx;
  228. background: #DCE7FF;
  229. border-radius: 24rpx;
  230. font-size: 24rpx;
  231. color: $themC;
  232. text-align: center;
  233. line-height: 48rpx;
  234. margin-top: 30rpx;
  235. }
  236. .chartTab {
  237. display: flex;
  238. justify-content: space-between;
  239. .btn_row {
  240. display: flex;
  241. width: 170rpx;
  242. height: 44rpx;
  243. border-radius: 8rpx;
  244. overflow: hidden;
  245. border: 1px solid $themC;
  246. .btn.bg {
  247. background: #3776FF;
  248. color: #fff;
  249. }
  250. .btn {
  251. color: $themC;
  252. text-align: center;
  253. font-size: 28rpx;
  254. flex: 1;
  255. }
  256. }
  257. }
  258. .tables {
  259. width: 100%;
  260. .fristTab.li {
  261. background: #F4F4F4;
  262. border-radius: 8rpx 8rpx 0 0;
  263. .item {
  264. color: $themC;
  265. }
  266. }
  267. .li {
  268. height: 76rpx;
  269. line-height: 76rpx;
  270. border-bottom: 1rpx solid #F4F4F4;
  271. display: flex;
  272. .item {
  273. text-align: center;
  274. flex: 1;
  275. font-size: 28rpx;
  276. }
  277. }
  278. }
  279. }
  280. .btnE {
  281. width: 240rpx;
  282. margin: 30rpx auto 60rpx auto;
  283. }
  284. </style>