kz-grade-result.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view>
  3. <view class="cu-card article">
  4. <view class="cu-item shadow">
  5. <view class="title">
  6. <text class="text-green">{{tips}}</text>
  7. </view>
  8. <view class="tui-progress-box">
  9. <tui-circular-progress
  10. :fontShow="false"
  11. :percentage="score / 2"
  12. :sAngle="sAngle"
  13. :diam="240"
  14. :height="130"
  15. :lineWidth="12"
  16. :progressColor="color"
  17. :fontColor="color"
  18. defaultColor="rgba(25,190,107,0.1)"
  19. @change="change"
  20. >
  21. <view class="tui-progress-text">
  22. <view>分数</view>
  23. <view class="tui-progress-num">{{ score }} 分</view>
  24. </view>
  25. </tui-circular-progress>
  26. </view>
  27. </view>
  28. <view class="cu-list menu card-menu margin-top sm-border" v-if="gradeResult">
  29. <view class="cu-item">
  30. <view class="content">
  31. <text class="cuIcon-my text-green"></text>
  32. <text class="text-grey">考生昵称</text>
  33. </view>
  34. <view class="action">
  35. <text class="text-grey">{{user.nickname}}</text>
  36. </view>
  37. </view>
  38. <view class="cu-item">
  39. <view class="content">
  40. <text class="cuIcon-time text-green"></text>
  41. <text class="text-grey">考试时长</text>
  42. </view>
  43. <view class="action">
  44. <text class="text-grey">{{gradeResult.grade_time|format_second}}</text>
  45. </view>
  46. </view>
  47. <view class="cu-item">
  48. <view class="content">
  49. <text class="cuIcon-info text-green"></text>
  50. <text class="text-grey">试卷总分</text>
  51. </view>
  52. <view class="action">
  53. <text class="text-grey">{{gradeResult.total_score}}</text>
  54. </view>
  55. </view>
  56. <view class="cu-item">
  57. <view class="content">
  58. <text class="cuIcon-filter text-green"></text>
  59. <text class="text-grey">及格分数</text>
  60. </view>
  61. <view class="action">
  62. <text class="text-grey">{{gradeResult.pass_score}}</text>
  63. </view>
  64. </view>
  65. <view class="cu-item">
  66. <view class="content">
  67. <text class="cuIcon-text text-green"></text>
  68. <text class="text-grey">题目数量</text>
  69. </view>
  70. <view class="action">
  71. <text class="text-grey">{{gradeResult.total_count}}</text>
  72. </view>
  73. </view>
  74. <view class="cu-item" v-if="gradeResult && gradeResult.error_count > 0">
  75. <view class="content">
  76. <text class="cuIcon-warn text-yellow"></text>
  77. <text class="text-grey">错误题数</text>
  78. </view>
  79. <view class="action">
  80. <button class="cu-btn round bg-yellow shadow" @click="goWrong()">去查看</button>
  81. </view>
  82. </view>
  83. </view>
  84. <view class="padding flex flex-direction">
  85. <button class="cu-btn block bg-green margin-tb-sm lg radius10" @click="goIndex()">返回首页</button>
  86. </view>
  87. </view>
  88. </view>
  89. </template>
  90. <script>
  91. export default {
  92. name:"kz-grade-result",
  93. props: {
  94. score: {
  95. type: Number,
  96. default: null
  97. },
  98. gradeResult: {
  99. type: Object,
  100. default: null
  101. },
  102. examMode: {
  103. type: String,
  104. default: 'PAPER'
  105. },
  106. },
  107. data() {
  108. return {
  109. sAngle: -Math.PI,
  110. color: '#19be6b',
  111. tips: '',
  112. // score: this.gradeScore,
  113. user: this.utils.getData('user')
  114. };
  115. },
  116. watch: {
  117. // gradeScore: function() {
  118. // console.log('watch gradeScore', this.gradeScore)
  119. // this.score = this.gradeScore
  120. // },
  121. gradeResult: function() {
  122. console.log('watch gradeResult', this.gradeResult)
  123. if (this.gradeResult) {
  124. // this.score = this.gradeResult.score
  125. // setTimeout(() => {this.score = this.gradeResult.score}, 500)
  126. if (this.gradeResult.is_pass) {
  127. this.tips = '恭喜您,考试通过啦!'
  128. this.color = '#19be6b'
  129. } else {
  130. this.tips = '很遗憾,考试没通过,请再接再厉!'
  131. this.color = '#ff6667'
  132. }
  133. }
  134. },
  135. },
  136. methods: {
  137. change(e) {
  138. //半圆 进度 * 2
  139. // this.score = e.percentage * 2;
  140. },
  141. goIndex() {
  142. this.utils.gotore('/pages/index/index')
  143. },
  144. goWrong() {
  145. this.utils.goto('/pages/wrong/index?question_ids=' + this.gradeResult.error_ids)
  146. }
  147. }
  148. }
  149. </script>
  150. <style>
  151. .title {
  152. font-size: 36upx;
  153. font-weight: 900;
  154. line-height: 100upx;
  155. padding: 0 30upx;
  156. text-align: center;
  157. }
  158. .tui-progress-box {
  159. width: 100%;
  160. padding: 0 30rpx;
  161. box-sizing: border-box;
  162. display: flex;
  163. align-items: center;
  164. justify-content: center;
  165. }
  166. .tui-progress-text {
  167. width: 100%;
  168. height: 130px;
  169. display: flex;
  170. align-items: center;
  171. justify-content: center;
  172. flex-direction: column;
  173. padding-top: 40rpx;
  174. position: absolute;
  175. left: 0;
  176. top: 0;
  177. }
  178. .tui-progress-num {
  179. font-size: 60rpx;
  180. padding-top: 20rpx;
  181. }
  182. </style>