question-answer-sheet-1.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view>
  3. <view class="order-pay-z" @tap="$emit('show_choice_timu_list',false)" style="position: fixed;"></view>
  4. <view class="tika" style="position: fixed;">
  5. <view class="order-pay1">
  6. <view class="questionBankAnswer-dc" v-if="question_type == 'test' && my_res.right_num != undefined">
  7. <view class="questionBankAnswer-dc-flex">
  8. <view class="iconfont icon-dui"></view>
  9. <view>{{ my_res.right_num }}</view>
  10. </view>
  11. <view class="questionBankAnswer-dc-flex">
  12. <view class="iconfont icon-cuo"></view>
  13. <view>{{ my_res.error_num }}</view>
  14. </view>
  15. </view>
  16. <view v-else-if="question_type == 'exam'" class="questionBankAnswer-r" style="color: #000;"
  17. @tap="jiaojuan1">
  18. <view class="iconfont icon-bianjisekuai"></view>
  19. <view>交卷</view>
  20. </view>
  21. <block v-if="show_remove">
  22. <question-remove class="questionBankAnswer-bottom" @removeError="removeError"></question-remove>
  23. </block>
  24. <block v-if="type != '' && show_fav">
  25. <question-fav class="questionBankAnswer-bottom" :current_timu="current_timu"
  26. @collect_opt="collect_opt" :type="type"></question-fav>
  27. <view class="questionBankAnswer-dc">
  28. </view>
  29. </block>
  30. <view v-else></view>
  31. <view class="questionBankAnswer-r">
  32. <view class="iconfont icon-fenlei"></view>
  33. <view class="questionBankAnswer-r-menu">
  34. <span>{{ timu_order }}</span>
  35. /{{ total_num }}
  36. </view>
  37. </view>
  38. </view>
  39. <view class="tika-content">
  40. <block v-for="(item, index) in timu_list" :key="index">
  41. <!-- 章节练习 -->
  42. <block v-if="question_type == 'test'">
  43. <view @tap="choice_timu_by_id(index)" class="tika-content-n green-background"
  44. v-if="item.state === 2">{{ index+1 }}
  45. </view>
  46. <view @tap="choice_timu_by_id(index)" class="tika-content-n red-background"
  47. v-else-if="item.state === 1">{{ index+1 }}
  48. </view>
  49. <view class="tika-content-n" v-else-if="item.state === 3" @tap="choice_timu_by_id(index)">
  50. {{ index+1 }}
  51. </view>
  52. </block>
  53. <!-- 考试 -->
  54. <block v-else>
  55. <view @tap="choice_timu_by_id(index)" class="tika-content-n orange-background"
  56. v-if="item.state === 1">{{ index + 1 }}
  57. </view>
  58. <view class="tika-content-n" v-else-if="item.state === 0" @tap="choice_timu_by_id(index)">
  59. {{ index + 1 }}
  60. </view>
  61. </block>
  62. </block>
  63. </view>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. export default {
  69. props: {
  70. show_remove: {
  71. type: Boolean,
  72. default: false,
  73. },
  74. show_fav: {
  75. type: Boolean,
  76. default: false,
  77. },
  78. current_timu: {
  79. type: Object,
  80. default: function() {
  81. return {}
  82. },
  83. },
  84. type: {
  85. type: String,
  86. default: ''
  87. },
  88. question_type: {
  89. type: String,
  90. default: 'test'
  91. },
  92. my_res: {
  93. type: Object,
  94. default: function() {
  95. return {}
  96. },
  97. },
  98. timu_list: {
  99. type: Array,
  100. default: function() {
  101. return [];
  102. },
  103. },
  104. timu_order: {
  105. type: Number,
  106. default: 0,
  107. },
  108. total_num: {
  109. type: Number,
  110. default: 0,
  111. },
  112. },
  113. watch: {
  114. current_timu: {
  115. handler(newVal, oldVal) {
  116. // console.log(newVal)
  117. },
  118. deep: true,
  119. immediate: true
  120. }
  121. },
  122. data() {
  123. return {
  124. show_choice_timu_list: false
  125. }
  126. },
  127. methods: {
  128. choice_timu_by_id(index) {
  129. this.$emit('choice_timu_by_id', index)
  130. },
  131. //考试交卷
  132. jiaojuan1() {
  133. this.$emit('jiaojuan1')
  134. },
  135. collect_opt() {
  136. this.$emit('collect_opt')
  137. },
  138. removeError() {
  139. this.$emit('removeError')
  140. },
  141. }
  142. }
  143. </script>
  144. <style>
  145. </style>