page-exam-item-detail.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <div class="page-exam-item-detial-box">
  3. <van-nav-bar v-if="env!=='pro'" title="考试详情" />
  4. <div class="page-exam-item-detial-body">
  5. <div class="exam-item-detial-div">
  6. <div class="exam-item-detial">
  7. <div class="exam-item-detial-title">{{ examItemData.name }}</div>
  8. <div class="exam-item-detial-txt">
  9. 考试时间:{{
  10. formateDateTimeFun(examItemData.startTime) ||
  11. examItemData.startTime
  12. }}
  13. </div>
  14. <div class="exam-item-detial-txt">
  15. 考试时长:{{ examItemData.examTimeMinsTxt }}
  16. </div>
  17. <div class="exam-item-detial-describe">
  18. 考试描述:<span style="letter-spacing:0.05rem">{{ examItemData.description }}</span>
  19. </div>
  20. </div>
  21. </div>
  22. <div class="exam-item-detial-button-box">
  23. <van-button
  24. class="exam-item-detial-button"
  25. type="primary"
  26. color="#0088e9"
  27. @click="handleBackFun"
  28. >返回</van-button
  29. >
  30. <van-button
  31. class="exam-item-detial-button"
  32. type="primary"
  33. color="#0088e9"
  34. @click="handleStartExamFun"
  35. >开始考试</van-button
  36. >
  37. </div>
  38. </div>
  39. </div>
  40. </template>
  41. <script>
  42. import { mapState } from "vuex";
  43. export default {
  44. name: "page-exam-item-detial",
  45. components: {},
  46. data() {
  47. return {
  48. examItemData: {}, // 当前考试的信息
  49. env: "pro"
  50. };
  51. },
  52. created() {
  53. this.env = process.env.VUE_APP_ENV;
  54. this.getExamItemDataFun(); // 查询:当前考试的信息
  55. this.setLanXinNavigator();
  56. },
  57. activated() {
  58. this.setLanXinNavigator();
  59. },
  60. computed: {
  61. ...mapState({
  62. examItem: state => state.exam.examItem
  63. })
  64. },
  65. methods: {
  66. // 设置蓝信navigator
  67. setLanXinNavigator() {
  68. lx.ui.setNavigationBarTitle({
  69. title: "考试详情"
  70. });
  71. },
  72. // 查询:当前考试的信息
  73. getExamItemDataFun() {
  74. this.examItemData = this.examItem;
  75. // this.$store.commit("toggleLoading", true);
  76. // this.$_http
  77. // .get(
  78. // this.$pathParams(this.$_API.GET_JTXT_GET_EXAMS_ONE_DETAIL, {
  79. // examId: this.examItem.id
  80. // })
  81. // )
  82. // .then(res => {
  83. // console.log(res);
  84. // this.$store.commit("toggleLoading", false);
  85. // })
  86. // .catch(() => {
  87. // this.$store.commit("toggleLoading", false);
  88. // });
  89. },
  90. // 操作:开始考试
  91. handleStartExamFun() {
  92. this.$router.replace({ name: "Exam" });
  93. },
  94. // 操作:返回
  95. handleBackFun() {
  96. this.$router.back();
  97. }
  98. }
  99. };
  100. </script>
  101. <style lang="scss" scoped>
  102. @import "~@/styles/mixin";
  103. .page-exam-item-detial-box {
  104. width: 100%;
  105. height: 100%;
  106. .page-exam-item-detial-body {
  107. width: 100%;
  108. height: 100%;
  109. overflow-y: auto;
  110. overflow-x: hidden;
  111. font-size: 0.6rem;
  112. .exam-item-detial-div {
  113. padding: 0.5rem 0.5rem;
  114. .exam-item-detial {
  115. padding: 0 0.5rem 0.5rem;
  116. margin-bottom: 0.7rem;
  117. background-color: #fff;
  118. border-radius: 4px;
  119. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
  120. .exam-item-detial-title {
  121. padding: 0.5rem 0;
  122. border-bottom: 1px solid #e4e8eb;
  123. font-size: 0.7rem;
  124. font-weight: bold;
  125. color: #000;
  126. }
  127. .exam-item-detial-txt {
  128. margin-top: 0.5rem;
  129. font-size: 0.65rem;
  130. }
  131. .exam-item-detial-describe {
  132. margin-top: 0.5rem;
  133. font-size: 0.65rem;
  134. span {
  135. letter-spacing: 0.2rem;
  136. }
  137. }
  138. }
  139. }
  140. .exam-item-detial-button-box {
  141. display: flex;
  142. justify-content: space-between;
  143. align-items: center;
  144. padding: 0 0.5rem;
  145. .exam-item-detial-button {
  146. width: 48%;
  147. height: auto;
  148. padding: 0.5rem 0.5rem;
  149. font-size: 0.65rem;
  150. }
  151. }
  152. }
  153. }
  154. </style>