HeaderTabBox.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <div class="tab_exam__header">
  3. <div class="title">{{ examInfo.examName }}</div>
  4. <div class="tab_box">
  5. <div class="text">
  6. 已完成 <span>{{ num }}</span>/{{ allNum || examInfo.questionNum }} 道题
  7. </div>
  8. <div class="header_btns">
  9. <div class="btn" @click="$emit('prevQuestion')">上一题</div>
  10. <div class="btn" @click="$emit('nextQuestion')">下一题</div>
  11. </div>
  12. </div>
  13. </div>
  14. </template>
  15. <script>
  16. export default {
  17. props: {
  18. examId: { type: String },
  19. num: {
  20. type: Number,
  21. },
  22. allNum: {
  23. type: Number,
  24. default: 0,
  25. },
  26. },
  27. data() {
  28. return {
  29. examInfo: {},
  30. };
  31. },
  32. mounted() {
  33. if (this.examId || this.$route.query.examId * 1) {
  34. this.$request
  35. .bankExam(this.examId || this.$route.query.examId)
  36. .then((res) => {
  37. console.log(res,666)
  38. this.examInfo = res.data;
  39. });
  40. }
  41. },
  42. };
  43. </script>
  44. <style lang="scss" scoped>
  45. .tab_exam__header {
  46. height: 60px;
  47. padding: 0 22px;
  48. border-bottom: 1px solid #eeeeee;
  49. display: flex;
  50. align-items: center;
  51. justify-content: space-between;
  52. .title {
  53. font-weight: 500;
  54. color: #222222;
  55. font-size: 16px;
  56. }
  57. .tab_box {
  58. display: flex;
  59. align-items: center;
  60. }
  61. .header_btns {
  62. display: flex;
  63. justify-content: space-around;
  64. align-items: center;
  65. border: 1px solid #3f8dfd;
  66. border-radius: 4px;
  67. .btn {
  68. cursor: pointer;
  69. width: 66px;
  70. height: 28px;
  71. background: #ffffff;
  72. line-height: 28px;
  73. text-align: center;
  74. color: #3f8dfd;
  75. border-radius: 4px;
  76. &:nth-of-type(2) {
  77. background: #3f8dfd;
  78. color: #ffffff;
  79. border-radius: 0;
  80. }
  81. }
  82. }
  83. .text {
  84. margin-right: 20px;
  85. font-size: 14px;
  86. span {
  87. font-family: Microsoft YaHei;
  88. font-weight: bold;
  89. color: #3f8dfd;
  90. line-height: 24px;
  91. }
  92. }
  93. }
  94. </style>