history.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <Container title="往年真题" bgColor="#f8f8f8">
  3. <view class="user">
  4. <image
  5. class="avatar"
  6. :src="userInfo.userpic"
  7. width="40"
  8. height="40"
  9. v-if="userInfo.userpic"
  10. />
  11. <view class="name">{{ userInfo.username }}</view>
  12. </view>
  13. <view class="exam-info">
  14. <view class="item">
  15. <view class="score">100分</view>
  16. <view class="title">总分</view>
  17. </view>
  18. <view class="item">
  19. <view class="score">100题</view>
  20. <view class="title">题量</view>
  21. </view>
  22. <view class="item">
  23. <view class="score">150分钟</view>
  24. <view class="title">时长</view>
  25. </view>
  26. </view>
  27. <view class="tip"
  28. >注:题型可能会含有单选题、多选题、配伍题、综合分析题;请注意考试时长,无论答题是否完全,到时自动交卷。</view
  29. >
  30. <view class="title-exam">考试记录</view>
  31. <view class="exam-history">
  32. <view
  33. class="i"
  34. :class="index !== 3 && 'no-laster'"
  35. v-for="(item, index) in 4"
  36. >
  37. <view>2025-05-31</view>
  38. <view>90分钟</view>
  39. <view>50/100题</view>
  40. <view class="score">100分<uni-icons type="right" /></view>
  41. </view>
  42. </view>
  43. <template #footer>
  44. <button @click="onClick">开始考试</button>
  45. </template>
  46. </Container>
  47. </template>
  48. <script setup name="history">
  49. import { ref, onMounted } from "vue";
  50. import Container from "../../components/Container/Container.vue";
  51. import { getRoute, router } from "../../utils/router";
  52. const userInfo = ref({
  53. userpic: "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/uni@2x.png",
  54. username: "Hi, 这里是历史题库",
  55. });
  56. const onClick = () => {
  57. router.push({
  58. url: "/pages/real/exam",
  59. params: {
  60. title: "考试",
  61. id: getRoute().params.id, // 考试id
  62. },
  63. });
  64. };
  65. onMounted(() => {
  66. userInfo.value = uni.getStorageSync("userInfo");
  67. });
  68. </script>
  69. <style scoped lang="scss">
  70. @import "@/uni.scss";
  71. .user {
  72. display: flex;
  73. align-items: center;
  74. gap: 20rpx;
  75. padding: 30rpx 20rpx;
  76. background: #eff4ff;
  77. border-radius: 24rpx;
  78. .avatar {
  79. border-radius: 50%;
  80. height: 96rpx;
  81. width: 96rpx;
  82. }
  83. }
  84. .exam-info {
  85. display: grid;
  86. grid-template-columns: repeat(3, 1fr);
  87. gap: 20rpx;
  88. padding: 20rpx;
  89. background: #eff4ff;
  90. border-radius: 24rpx;
  91. .item {
  92. display: flex;
  93. align-items: center;
  94. flex-direction: column;
  95. gap: 30rpx;
  96. .title {
  97. font-family: PingFang SC, PingFang SC;
  98. font-weight: 500;
  99. font-size: 28rpx;
  100. color: #999999;
  101. }
  102. }
  103. }
  104. .title-exam {
  105. font-family: PingFang SC, PingFang SC;
  106. font-weight: 500;
  107. font-size: 32rpx;
  108. color: #333333;
  109. }
  110. .exam-history {
  111. background: #fff;
  112. border-radius: 24rpx;
  113. padding: 16rpx;
  114. .i {
  115. display: flex;
  116. font-family: PingFang SC, PingFang SC;
  117. font-size: 28rpx;
  118. color: #333;
  119. align-items: center;
  120. justify-content: space-between;
  121. .score {
  122. color: $error;
  123. }
  124. }
  125. .no-laster {
  126. padding-bottom: 16rpx;
  127. margin-bottom: 8rpx;
  128. border-bottom: 1rpx solid #dddddd;
  129. }
  130. }
  131. </style>