result.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <template>
  2. <div class="com-bg topic">
  3. <div class="com-title"></div>
  4. <div class="com-card">
  5. <div class="result">
  6. <div class="top">
  7. <p>本次答对题目数</p>
  8. <h6>{{ num || 0 }}</h6>
  9. </div>
  10. <div class="text">
  11. <div class="li">正确率:{{ Math.round(num/all * 100) }}%</div>
  12. <div class="li">错题数:{{ all - num }}</div>
  13. </div>
  14. <div class="btn-cont">
  15. <div class="com-btn" @click="fnGoTopic">再来一组</div>
  16. <div class="com-btn" @click="fnGoOut">点击进入</div>
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. </template>
  22. <script>
  23. export default {
  24. name: "Result",
  25. data() {
  26. return {
  27. all: 0,
  28. num: 0,
  29. }
  30. },
  31. created() {
  32. this.all = this.$route.query.all ? Number(this.$route.query.all) : 0;
  33. this.num = this.$route.query.num ? Number(this.$route.query.num) : 0;
  34. },
  35. methods: {
  36. fnGoTopic() {
  37. this.$router.push(`/topic`);
  38. },
  39. fnGoOut() {
  40. // 跳转到安徽小康
  41. // window.location.href = 'http://wap.ahjlxkgc.cn';
  42. window.parent.postMessage('quiz over', '*')
  43. }
  44. }
  45. };
  46. </script>
  47. <style lang="less" scoped>
  48. .topic {
  49. min-height: 100vh;
  50. box-sizing: border-box;
  51. padding: 29px 16px;
  52. text-align: right;
  53. }
  54. .result {
  55. .top {
  56. min-height: 144px;
  57. background: url(../../assets/images/contbg.png) top center no-repeat;
  58. background-size: 100% auto;
  59. box-sizing: border-box;
  60. padding: 30px 0 0 33px;
  61. font-size: 16px;
  62. font-weight: 400;
  63. color: #56390F;
  64. line-height: 24px;
  65. h6 {
  66. font-size: 40px;
  67. font-weight: 400;
  68. color: #56390F;
  69. line-height: 50px;
  70. margin-top: 15px;
  71. }
  72. }
  73. .text {
  74. font-size: 16px;
  75. font-weight: 400;
  76. color: #181E24;
  77. line-height: 26px;
  78. margin-top: 30px;
  79. margin-bottom: 60px;
  80. box-sizing: border-box;
  81. padding: 0 30px;
  82. .li {
  83. display: inline-block;
  84. width: 50%;
  85. box-sizing: border-box;
  86. padding-left: 10px;
  87. }
  88. }
  89. .btn-cont {
  90. .com-btn {
  91. width: 145px;
  92. height: 43px;
  93. line-height: 43px;
  94. margin-left: 18px;
  95. &:nth-child(2n+1) {
  96. box-sizing: border-box;
  97. border: 1px solid #B4A387;
  98. background: #ffffff;
  99. color: #B59F87;
  100. line-height: 41px;
  101. }
  102. }
  103. }
  104. }
  105. .com-title {
  106. height: 18px;
  107. background: url(../../assets/images/title.png) center no-repeat;
  108. background-size: auto 100%;
  109. margin-bottom: 26px;
  110. }
  111. .com-bg {
  112. background: #F6F6F6 url(../../assets/images/bg.png) center top no-repeat;
  113. background-size: 100% auto;
  114. }
  115. .com-btn {
  116. cursor: pointer;
  117. display: inline-block;
  118. min-width: 70px;
  119. text-align: center;
  120. box-sizing: border-box;
  121. padding: 0 14px;
  122. background: #b59f87;
  123. border-radius: 4px;
  124. height: 32px;
  125. line-height: 32px;
  126. font-size: 14px;
  127. font-weight: 500;
  128. color: #ffffff;
  129. margin-left: 10px;
  130. }
  131. .com-card {
  132. margin-top: 17px;
  133. background: #ffffff;
  134. box-shadow: 0px 4px 4px 0px rgba(225, 225, 225, 0.5);
  135. border-radius: 4px;
  136. box-sizing: border-box;
  137. padding-bottom: 15px;
  138. font-size: 16px;
  139. font-weight: 400;
  140. color: #181e24;
  141. line-height: 30px;
  142. text-align: left;
  143. .title {
  144. font-size: 19px;
  145. font-weight: 600;
  146. color: #181e24;
  147. line-height: 58px;
  148. overflow: hidden;
  149. box-sizing: border-box;
  150. padding: 0 12px 0 25px;
  151. border-bottom: 1px solid #ededed;
  152. position: relative;
  153. &::before {
  154. content: "";
  155. position: absolute;
  156. left: 14px;
  157. top: 20px;
  158. width: 3px;
  159. height: 18px;
  160. background: #e51d0e;
  161. }
  162. .right {
  163. float: right;
  164. font-size: 19px;
  165. color: #999999;
  166. line-height: 50px;
  167. & > span {
  168. font-size: 35px;
  169. font-weight: 500;
  170. color: #181e24;
  171. line-height: 50px;
  172. }
  173. }
  174. }
  175. .content {
  176. box-sizing: border-box;
  177. padding: 20px 12px 0;
  178. .tit {
  179. margin-bottom: 25px;
  180. }
  181. }
  182. }
  183. .com-option {
  184. background: #fbfcfe;
  185. border: 1px solid #f3f4f6;
  186. border-radius: 4px;
  187. box-sizing: border-box;
  188. margin-bottom: 12px;
  189. padding: 11px 19px;
  190. font-size: 16px;
  191. font-weight: 400;
  192. color: #999999;
  193. line-height: 28px;
  194. overflow: hidden;
  195. &>span {
  196. float: left;
  197. width: 28px;
  198. height: 28px;
  199. text-align: right;
  200. box-sizing: border-box;
  201. padding-right: 10px;
  202. }
  203. &.act {
  204. background: #F6F5F3;
  205. border: 1px solid #B4A387;
  206. font-weight: 500;
  207. color: #B7A08B;
  208. &>span {
  209. color: #ffffff;
  210. background: url(../../assets/images/fingerprint.png) left center no-repeat;
  211. background-size: auto 100%;
  212. }
  213. }
  214. &.true {
  215. background: #E7F7EC;
  216. font-weight: 500;
  217. color: #2CC638;
  218. border-color: #E7F7EC;
  219. &>span {
  220. color: transparent;
  221. background: url(../../assets/images/true.png) left center no-repeat;
  222. background-size: 15px auto;
  223. }
  224. }
  225. &.false {
  226. background: #FBEDED;
  227. font-weight: 500;
  228. color: #E55352;
  229. border-color: #FBEDED;
  230. &>span {
  231. color: transparent;
  232. background: url(../../assets/images/false.png) left center no-repeat;
  233. background-size: 15px auto;
  234. }
  235. }
  236. }
  237. </style>