index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <Container title="学习本">
  3. <view class="header">
  4. <view class="stats">
  5. <text>10000/20000</text>
  6. <text>正确率50%</text>
  7. </view>
  8. <view class="tabs">
  9. <view class="tab active">法规</view>
  10. <view class="tab">药一</view>
  11. <view class="tab">药综</view>
  12. <!-- 其他标签 -->
  13. </view>
  14. <view class="sub-tabs">
  15. <view class="sub-tab active">答案正确(2301)</view>
  16. <view class="sub-tab">答案错误(2301)</view>
  17. </view>
  18. </view>
  19. <view class="content">
  20. <view class="question-card" v-for="(question, index) in questions" :key="index">
  21. <view class="question-header">
  22. <text class="question-type">单选题</text>
  23. <text class="question-date">2025-03-20 20:30:20</text>
  24. </view>
  25. <view class="question-text">
  26. 根据中药七情配伍理论,属于相畏的药组是?
  27. </view>
  28. <view class="options">
  29. <view class="option" v-for="(option, i) in ['A', 'B', 'C', 'D', 'E']" :key="i">
  30. <text>{{ option }}</text>
  31. <text>选项内容</text>
  32. </view>
  33. </view>
  34. <view class="footer">
  35. <button class="explain-btn">查看解析与考点</button>
  36. </view>
  37. </view>
  38. </view>
  39. </Container>
  40. </template>
  41. <script setup>
  42. import Container from "@/components/Container/Container.vue";
  43. // 示例数据
  44. const questions = Array(2).fill({});
  45. </script>
  46. <style scoped lang="scss">
  47. @import '@/uni.scss';
  48. .header {
  49. padding: 16rpx;
  50. background-color: #fff;
  51. .stats {
  52. display: flex;
  53. justify-content: space-between;
  54. margin-bottom: 8rpx;
  55. }
  56. .tabs, .sub-tabs {
  57. display: flex;
  58. margin-bottom: 8rpx;
  59. .tab, .sub-tab {
  60. padding: 8rpx 16rpx;
  61. border-radius: 8rpx;
  62. &.active {
  63. background-color: $uni-primary;
  64. color: #fff;
  65. }
  66. }
  67. }
  68. }
  69. .content {
  70. padding: 16rpx;
  71. .question-card {
  72. background-color: #fff;
  73. border-radius: 8rpx;
  74. margin-bottom: 16rpx;
  75. padding: 16rpx;
  76. .question-header {
  77. display: flex;
  78. justify-content: space-between;
  79. margin-bottom: 8rpx;
  80. .question-type {
  81. color: $uni-primary;
  82. }
  83. }
  84. .options {
  85. margin-top: 8rpx;
  86. .option {
  87. display: flex;
  88. align-items: center;
  89. margin-bottom: 4rpx;
  90. text {
  91. margin-right: 8rpx;
  92. }
  93. }
  94. }
  95. .footer {
  96. margin-top: 8rpx;
  97. .explain-btn {
  98. background-color: $uni-primary;
  99. color: #fff;
  100. padding: 8rpx 16rpx;
  101. border-radius: 8rpx;
  102. text-align: center;
  103. }
  104. }
  105. }
  106. }
  107. .bottom-nav {
  108. display: flex;
  109. justify-content: space-around;
  110. padding: 16rpx 0;
  111. background-color: #fff;
  112. .nav-item {
  113. flex: 1;
  114. text-align: center;
  115. &.active {
  116. color: $uni-primary;
  117. }
  118. }
  119. }
  120. </style>