submit.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <view class="web_box vflex jbetween">
  3. <view class="top">
  4. <u-navbar height="44" leftIcon="arrow-left" leftIconColor="#000" leftText="考试成绩" @leftClick="leftClick" :autoBack="true" bgColor="#fff">
  5. </u-navbar>
  6. <view class="box vflex acenter jcenter">
  7. <view v-if="course.is_pass == 0" class="title">考试未合格</view>
  8. <view v-else class="title">
  9. <image :src="course.certificate" mode="widthFix" style="width: 660rpx;" @click="clickImg"></image>
  10. </view>
  11. <view class="hflex aend">
  12. <view v-if="course.is_pass == 0" class="score">{{course.score}}</view>
  13. <view v-else class="score" style="color: #3DA1FE;">{{course.score}}</view>
  14. <view class="score_total">/{{course.all_score}}</view>
  15. </view>
  16. <view class="name hflex acenter jbetween">
  17. <view>{{course.name}}</view>
  18. <view>{{date}}</view>
  19. </view>
  20. </view>
  21. <view class="box vflex acenter jcenter">
  22. <view class="hflex acenter jbetween" style="width: 100%;">
  23. <view class="box_title">答题卡</view>
  24. <view class="hflex acenter">
  25. <!-- <view class="item1"></view>
  26. <view class="text">未答</view> -->
  27. <view class="item2"></view>
  28. <view class="text">答对</view>
  29. <view class="item3"></view>
  30. <view class="text">答错</view>
  31. </view>
  32. </view>
  33. <view class="hflex acenter fwrap">
  34. <block v-for="(item,index) in course.log_info" :key="index">
  35. <!-- <view class="item hflex acenter jcenter" v-if="item.is_right == 0">
  36. {{index + 1}}
  37. </view> -->
  38. <view class="item hflex acenter jcenter blue" v-if="item.is_right == 1">
  39. {{index + 1}}
  40. </view>
  41. <view class="item hflex acenter jcenter red" v-if="item.is_right == 0">
  42. {{index + 1}}
  43. </view>
  44. </block>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="bottom hflex acenter jcenter">
  49. <view class="leftBtn" @click="parse(1)">全部解析</view>
  50. <view class="rightBtn" @click="parse(2)">错题解析</view></strong>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import $api from '@/static/js/api.js'
  56. export default {
  57. data() {
  58. return {
  59. course: {},
  60. date: '',
  61. state: {},
  62. log_id: 0
  63. }
  64. },
  65. onLoad(option) {
  66. this.state = JSON.parse(option.data)
  67. this.log_id = option.log_id
  68. this.sellQuestionsLog()
  69. this.getDate()
  70. },
  71. methods: {
  72. leftClick() {
  73. },
  74. sellQuestionsLog() {
  75. var that = this
  76. $api.req({
  77. url: '/api/User/sellQuestionsLog',
  78. data: {
  79. log_id: that.log_id,
  80. state: 1
  81. }
  82. }, function(res) {
  83. console.log("试卷成绩",res)
  84. if (res.code == 1) {
  85. that.course = res.data
  86. }
  87. })
  88. },
  89. // 获取当前时间
  90. getDate() {
  91. const nowDate = new Date();
  92. const date = {
  93. year: nowDate.getFullYear(),
  94. month: nowDate.getMonth() + 1,
  95. date: nowDate.getDate(),
  96. }
  97. const newmonth = date.month >= 10 ? date.month : '0' + date.month
  98. const day = date.date >= 10 ? date.date : '0' + date.date
  99. this.date = date.year + '-' + newmonth + '-' + day
  100. console.log("当前时间:",this.date);
  101. },
  102. // 查看解析
  103. parse(state) {
  104. $api.jump('/pages/index/exam/parse?state=' + state + '&log_id=' + this.log_id)
  105. },
  106. clickImg() {
  107. var that = this
  108. uni.previewImage({
  109. urls: [that.course.certificate],
  110. current: '',
  111. success:function(res){
  112. },
  113. fail:function(res){
  114. }
  115. })
  116. }
  117. }
  118. }
  119. </script>
  120. <style lang="scss" scoped>
  121. .web_box::v-deep {
  122. .top {
  123. width: 100%;
  124. box-sizing: border-box;
  125. padding: 0 30rpx;
  126. }
  127. .u-navbar {
  128. width: 100%;
  129. box-sizing: border-box;
  130. padding: 36px 16px 58rpx 0;
  131. }
  132. .box {
  133. width: 100%;
  134. margin-top: 20rpx;
  135. background-color: #FFFFFF;
  136. box-sizing: border-box;
  137. padding: 24rpx 32rpx;
  138. }
  139. .title {
  140. font-size: 36rpx;
  141. font-weight: 500;
  142. color: #FA6400;
  143. padding: 10rpx 0 15rpx;
  144. }
  145. .score {
  146. font-size: 72rpx;
  147. font-weight: 500;
  148. color: #FA6400;
  149. }
  150. .score_total {
  151. font-size: 32rpx;
  152. color: #333;
  153. padding-bottom: 10rpx;
  154. }
  155. .name {
  156. width: 100%;
  157. font-size: 32rpx;
  158. font-weight: 500;
  159. color: #333333;
  160. margin-top: 44rpx;
  161. }
  162. .box_title {
  163. font-size: 36rpx;
  164. font-weight: 500;
  165. color: #333333;
  166. }
  167. .item1 {
  168. width: 24rpx;
  169. height: 24rpx;
  170. background: #D8D8D8;
  171. border-radius: 50%;
  172. }
  173. .item2 {
  174. width: 24rpx;
  175. height: 24rpx;
  176. background: #09BBD0;
  177. border-radius: 50%;
  178. }
  179. .item3 {
  180. width: 24rpx;
  181. height: 24rpx;
  182. background: #FD6076;
  183. border-radius: 50%;
  184. }
  185. .text {
  186. font-size: 24rpx;
  187. font-weight: 500;
  188. color: #999999;
  189. padding: 0 16rpx 0 6rpx;
  190. }
  191. .item {
  192. width: 72rpx;
  193. height: 72rpx;
  194. background: #D8D8D8;
  195. border-radius: 50%;
  196. margin: 54rpx 66rpx 0 0;
  197. font-size: 40rpx;
  198. font-weight: 600;
  199. color: #FFFFFF;
  200. }
  201. .item:nth-child(5n) {
  202. margin: 54rpx 0 0 0;
  203. }
  204. .blue {
  205. background: #09BBD0;
  206. }
  207. .red {
  208. background: #FD6076;
  209. }
  210. .bottom {
  211. margin-top: 20rpx;
  212. width: 100%;
  213. height: 83px;
  214. background: #FFFFFF;
  215. }
  216. .leftBtn {
  217. width: 344rpx;
  218. height: 80rpx;
  219. background: rgba(41,136,254,0.2);
  220. border-radius: 20px 0 0 20px;
  221. font-size: 36rpx;
  222. font-weight: 500;
  223. color: #2988FE;
  224. text-align: center;
  225. line-height: 80rpx;
  226. }
  227. .rightBtn {
  228. width: 344rpx;
  229. height: 80rpx;
  230. background: linear-gradient(135deg, #53BDFF 0%, #2988FE 100%);
  231. border-radius: 0px 20px 20px 0px;
  232. font-size: 36rpx;
  233. font-weight: 500;
  234. color: #FFFFFF;
  235. text-align: center;
  236. line-height: 80rpx;
  237. }
  238. }
  239. </style>