answersheet.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view class="pages">
  3. <view class="bg"></view>
  4. <view class="content">
  5. <view class="title">答题卡</view>
  6. <view class="list u-flex u-flex-wrap">
  7. <view
  8. class="item"
  9. :class="{error:item.status==0,undo:item.status==2}"
  10. @click="topicClick(item)"
  11. v-for="(item,index) in pagerResult.topicList" :key="item.paperAnswerId">
  12. {{index+1}}
  13. </view>
  14. </view>
  15. <view class="statistics u-flex">
  16. <view class="item">
  17. 答对:<text class="num">{{pagerResult.topicTrueCount}}</text>
  18. </view>
  19. <view class="item">
  20. 答错:<text class="num" style="color: #FFB100;">{{pagerResult.topicFalseCount}}</text>
  21. </view>
  22. <view class="item">
  23. 未答:<text class="num" style="color: #999;">{{ pagerResult.topicList.length - pagerResult.answerTopicCount}}</text>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. id:'',
  34. pagerResult:{
  35. topicList:[]
  36. }
  37. }
  38. },
  39. onShow() {
  40. },
  41. onLoad(page) {
  42. this.id = page.id;
  43. this.findPagerResult();
  44. },
  45. methods: {
  46. findPagerResult(){
  47. this.$u.api.findPagerResult({paperScoreId:this.id}).then(res=>{
  48. this.pagerResult = res.data;
  49. // console.log('findPagerResult',res.data);
  50. }).catch(err=>{
  51. console.log('findPagerResult',err);
  52. })
  53. },
  54. topicClick(item){
  55. console.log('topicClick',item);
  56. uni.$u.route('/examination/question', {
  57. paperScoreId: this.id,
  58. paperTopicId: item.paperTopicId
  59. });
  60. }
  61. }
  62. }
  63. </script>
  64. <style lang="scss" scoped>
  65. .bg{
  66. position: fixed;
  67. top: 0;
  68. left: 0;
  69. width: 100%;
  70. height: 200rpx;
  71. background-color: #009AEF;
  72. z-index: -1;
  73. }
  74. .content{
  75. background: #FFFFFF;
  76. border-radius: 24rpx;
  77. padding: 40rpx 0;
  78. margin-top: 40rpx;
  79. .title{
  80. margin-bottom: 30rpx;
  81. font-size: 34rpx;
  82. font-weight: 400;
  83. color: #333333;
  84. line-height: 48rpx;
  85. margin-left: 46rpx;
  86. }
  87. .list{
  88. .item{
  89. width: 72rpx;
  90. height: 72rpx;
  91. line-height: 72rpx;
  92. text-align: center;
  93. background: #009AEF;
  94. color: #fff;
  95. border-radius: 8rpx;
  96. margin-left: 46rpx;
  97. margin-bottom: 46rpx;
  98. &.error{
  99. background: #FFB100;
  100. }
  101. &.undo{
  102. background: #F5F9FC;
  103. color: #999;
  104. }
  105. }
  106. }
  107. .statistics{
  108. margin: 20rpx 30rpx;
  109. padding: 40rpx 20rpx;
  110. background: #F5F9FC;
  111. border-radius: 24rpx;
  112. text-align: center;
  113. font-size: 30rpx;
  114. font-weight: 400;
  115. color: #999999;
  116. .item{
  117. flex: 1;
  118. & + .item{
  119. border-left: 1px solid #eee;
  120. }
  121. .num{
  122. font-weight: 600;
  123. color: #009AEF ;
  124. }
  125. }
  126. }
  127. }
  128. </style>