index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <view>
  3. <view class="tan">
  4. <view class="tan-mask" @tap="tap_handler(0)"></view>
  5. <view class="tan-modal">
  6. <view class="tan-title">
  7. <view>是否退出</view>
  8. </view>
  9. <view class="tan-content">
  10. <view class="exam-tan-content">
  11. <view class="exam-tan-content-flex">
  12. <span>答题数</span>
  13. <view>{{timuinfo.yida_num}}题</view>
  14. </view>
  15. <view class="exam-tan-content-flex">
  16. <span>正确率</span>
  17. <view>{{timuinfo.zhengquelv}}%</view>
  18. </view>
  19. <view class="exam-tan-content-flex">
  20. <span>正确</span>
  21. <view class="pub-green">{{timuinfo.right_num}}</view>
  22. </view>
  23. <view class="exam-tan-content-flex">
  24. <span>错误</span>
  25. <view class="pub-red">{{timuinfo.error_num}}</view>
  26. </view>
  27. </view>
  28. <view class="exam-tan-button">
  29. <view class="exam-tan-button-l" @tap="tap_handler(0)">继续答题</view>
  30. <view class="exam-tan-button-r" @tap="tap_handler(1)">结束答题</view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. data() {
  40. return {}
  41. },
  42. props: {
  43. timuinfo: {
  44. type: Object,
  45. default: {
  46. library_name: '',
  47. total_num: 0,
  48. zhengquelv: 0,
  49. right_num: 0,
  50. error_num: 0,
  51. yida_num: 0
  52. }
  53. }
  54. },
  55. computed: {},
  56. methods: {
  57. tap_handler(type) {
  58. this.$emit('tap_handler', type)
  59. }
  60. }
  61. }
  62. </script>
  63. <style>
  64. /*弹窗*/
  65. .tan-mask {
  66. position: fixed;
  67. z-index: 999;
  68. top: 0;
  69. right: 0;
  70. left: 0;
  71. bottom: 0;
  72. background: rgba(0, 0, 0, 0.6);
  73. }
  74. .tan-modal {
  75. position: fixed;
  76. z-index: 999;
  77. width: 80%;
  78. max-width: 300px;
  79. top: 50%;
  80. left: 50%;
  81. -webkit-transform: translate(-50%, -50%);
  82. transform: translate(-50%, -50%);
  83. background-color: #fff;
  84. text-align: center;
  85. border-radius: 3px;
  86. overflow: hidden;
  87. }
  88. .tan-title {
  89. padding: 15px 0;
  90. border-bottom: solid 1px #f4f4f4;
  91. }
  92. .tan-title view {
  93. font-weight: 400;
  94. font-size: 17px;
  95. word-wrap: break-word;
  96. word-break: break-all;
  97. overflow: hidden;
  98. text-overflow: ellipsis;
  99. display: -webkit-box;
  100. -webkit-line-clamp: 2;
  101. -webkit-box-orient: vertical;
  102. }
  103. .tan-content {
  104. width: 90%;
  105. margin: 0 auto;
  106. font-size: 14px;
  107. }
  108. .exam-tan-content-flex {
  109. display: flex;
  110. width: 91%;
  111. margin: 0 auto;
  112. padding: 13px 0;
  113. border-bottom: solid 1px #f4f4f4;
  114. }
  115. .exam-tan-content-flex span {
  116. color: #767676;
  117. width: 42%;
  118. text-align: left;
  119. }
  120. .exam-tan-button {
  121. color: #fff;
  122. padding: 12px 0;
  123. margin: 10px 0;
  124. border-radius: 4px;
  125. font-size: 16px;
  126. display: flex;
  127. justify-content: space-between;
  128. width: 100%;
  129. }
  130. .exam-tan-button-l {
  131. background: #3c7bfc;
  132. width: 48%;
  133. padding: 8px 0;
  134. border-radius: 2px;
  135. }
  136. .exam-tan-button-r {
  137. background: #e4e4e4;
  138. color: #000;
  139. width: 48%;
  140. padding: 8px 0;
  141. border-radius: 2px;
  142. }
  143. </style>