history.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <Container title="往年真题">
  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. <template #footer>
  31. <button @click="onClick">开始考试</button>
  32. </template>
  33. </Container>
  34. </template>
  35. <script setup name="history">
  36. import { ref, onMounted } from "vue";
  37. import Container from "../../components/Container/Container.vue";
  38. import { router } from "../../utils/router";
  39. const userInfo = ref({
  40. userpic: "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/uni@2x.png",
  41. username: "Hi, 这里是历史题库",
  42. });
  43. const onClick = () => {
  44. router.push({
  45. url: "/pages/real/exam",
  46. params: {
  47. title: "考试",
  48. },
  49. });
  50. };
  51. onMounted(() => {
  52. userInfo.value = uni.getStorageSync("userInfo");
  53. });
  54. </script>
  55. <style scoped lang="scss">
  56. .user {
  57. display: flex;
  58. align-items: center;
  59. gap: 20rpx;
  60. padding-left: 20rpx;
  61. .avatar {
  62. border-radius: 50%;
  63. height: 96rpx;
  64. width: 96rpx;
  65. }
  66. }
  67. .exam-info {
  68. display: grid;
  69. grid-template-columns: repeat(3, 1fr);
  70. gap: 20rpx;
  71. padding: 20rpx;
  72. .item {
  73. display: flex;
  74. align-items: center;
  75. flex-direction: column;
  76. gap: 30rpx;
  77. .title {
  78. font-family: PingFang SC, PingFang SC;
  79. font-weight: 500;
  80. font-size: 28rpx;
  81. color: #999999;
  82. }
  83. }
  84. }
  85. </style>