question_record.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <template>
  2. <view>
  3. <view class="tabs">
  4. <view class="tab" :class="{active:index==1}" data-index="1" @click="tab">全部题库记录</view>
  5. <view class="tab" :class="{active:index==2}" data-index="2" @click="tab">全部试卷类型</view>
  6. </view>
  7. <view class="record">
  8. <view class="item" v-for="record in recordList">
  9. <view class="note">{{record.paperName}}</view>
  10. <view class="title">{{record.examName}}</view>
  11. <view class="desc">
  12. <view>
  13. <image src="/static/icon/wk_icon2.png"></image>
  14. <text>{{$method.timestampToTime(record.updateTime,false)}}</text>
  15. </view>
  16. <view>
  17. <image src="/static/icon/wk_icon2.png"></image>
  18. <text>总共 {{record.totalQuestionNum}} 题 做对 {{record.rightQuestionNum}} 题</text>
  19. </view>
  20. </view>
  21. <view class="btns">
  22. <view class="btn">
  23. 重做
  24. </view>
  25. <view class="btn">
  26. 解析
  27. </view>
  28. <view class="btn" v-if="record.status == 1">
  29. 报告
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="modal" v-if="index==1">
  35. <view class="content">
  36. <view class="top">全部题库记录</view>
  37. <view class="list">
  38. <view class="item" v-for="listItem in list" @click="testClick(listItem)">{{listItem.goodsName}}</view>
  39. </view>
  40. </view>
  41. <view class="modal_wrap" @click="index=0"></view>
  42. </view>
  43. <view class="modal" v-if="index==2">
  44. <view class="content">
  45. <view class="top">全部试卷类型</view>
  46. <view class="list">
  47. <view class="item" v-for="listItem in list1" @click="paperClick(listItem)">{{listItem.paperName}}</view>
  48. </view>
  49. </view>
  50. <view class="modal_wrap" @click="index=0"></view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. export default {
  56. data() {
  57. return {
  58. index:0,
  59. list:[],
  60. list1:[],
  61. recordList:[]
  62. }
  63. },
  64. onLoad(option) {
  65. this.listGoodsUserQuestion();
  66. this.examaperList();
  67. this.$api.examRecordList({}).then(res => {
  68. this.recordList = res.data.rows
  69. })
  70. },
  71. onShow(){
  72. },
  73. methods: {
  74. testClick(item) {
  75. this.index = 0
  76. this.$api.examRecordList({
  77. goodsId:item.goodsId
  78. }).then(res => {
  79. this.recordList = res.data.rows
  80. })
  81. },
  82. paperClick(item) {
  83. this.index = 0
  84. this.$api.examRecordList({
  85. paperId:item.paperId
  86. }).then(res => {
  87. this.recordList = res.data.rows
  88. })
  89. },
  90. tab(e) {
  91. this.index = e.currentTarget.dataset.index;
  92. },
  93. examaperList() {
  94. this.$api.examaperList({
  95. }).then(res => {
  96. this.list1 = res.data.rows;
  97. })
  98. },
  99. listGoodsUserQuestion() {
  100. this.$api.listGoodsUserQuestion({
  101. }).then(res => {
  102. this.list = res.data.rows;
  103. })
  104. },
  105. },
  106. }
  107. </script>
  108. <style >
  109. page {
  110. background: #EAEEF1;
  111. }
  112. </style>
  113. <style lang="scss" scope>
  114. .tabs {
  115. position:fixed;
  116. left:0;
  117. width:100%;
  118. top:0;
  119. display: flex;
  120. z-index: 10;
  121. .tab {
  122. flex:1;
  123. height: 80rpx;
  124. text-align: center;
  125. line-height: 80rpx;
  126. background: #FFFFFF;
  127. font-size: 32rpx;
  128. color: #999999;
  129. &.active {
  130. color:#333333;
  131. }
  132. }
  133. }
  134. .record {
  135. margin-top:80rpx;
  136. padding:16rpx 8rpx;
  137. -moz-column-count:2; /* Firefox */
  138. -webkit-column-count:2; /* Safari 和 Chrome */
  139. column-count:2;
  140. -moz-column-gap: 16rpx;
  141. -webkit-column-gap: 16rpx;
  142. column-gap: 16rpx;
  143. .item {
  144. margin-bottom:16rpx;
  145. -moz-page-break-inside: avoid;
  146. -webkit-column-break-inside: avoid;
  147. break-inside: avoid;
  148. background: #FFFFFF;
  149. border-radius: 16rpx;
  150. padding:65rpx 20rpx 22rpx;
  151. position: relative;
  152. overflow: hidden;
  153. .note {
  154. color:#fff;
  155. position:absolute;
  156. left:0;
  157. top:0;
  158. width: 112rpx;
  159. height: 40rpx;
  160. text-align: center;
  161. line-height: 40rpx;
  162. background: linear-gradient(0deg, #4FACFE, #007AFF);
  163. border-radius: 16rpx 0px 16rpx 0rpx;
  164. }
  165. .title {
  166. font-size: 32rpx;
  167. color: #333333;
  168. font-weight: bold;
  169. }
  170. .desc {
  171. margin-top:26rpx;
  172. view {
  173. margin:16rpx 0;
  174. image {
  175. width: 23rpx;
  176. height: 24rpx;
  177. }
  178. text {
  179. margin-left:15rpx;
  180. font-size: 24rpx;
  181. color: #999999;
  182. line-height: 36rpx;
  183. }
  184. }
  185. }
  186. .btns {
  187. margin-top:26rpx;
  188. display: flex;
  189. justify-content: space-around;
  190. .btn {
  191. width: 100rpx;
  192. height: 48rpx;
  193. line-height: 48rpx;
  194. text-align: center;
  195. color:#007AFF;
  196. background: #FFFFFF;
  197. border: 1rpx solid #007AFF;
  198. border-radius: 16rpx;
  199. }
  200. }
  201. }
  202. }
  203. .modal {
  204. position:fixed;
  205. left:0;
  206. width:100%;
  207. top:80rpx;
  208. bottom:0;
  209. .content {
  210. position: relative;
  211. z-index: 10;
  212. background:#fff;
  213. padding:8rpx 12rpx 20rpx;
  214. display: flex;
  215. flex-wrap: wrap;
  216. .top {
  217. margin:0 auto;
  218. width: 726rpx;
  219. height: 80rpx;
  220. background: #007AFF;
  221. border-radius: 16rpx;
  222. color:#fff;
  223. text-align: center;
  224. line-height: 80rpx;
  225. font-size: 32rpx;
  226. }
  227. .list {
  228. margin-top:16rpx;
  229. display: flex;
  230. flex-wrap: wrap;
  231. justify-content: space-between;
  232. .item {
  233. padding:25rpx 20rpx;
  234. width: 359rpx;
  235. background: #F5F5F5;
  236. border-radius: 16rpx;
  237. font-size: 32rpx;
  238. color: #666666;
  239. margin:8rpx 0;
  240. }
  241. }
  242. }
  243. .modal_wrap {
  244. position: absolute;
  245. left:0;
  246. width:100%;
  247. top:0;
  248. height:100%;
  249. background:rgba(0,0,0,0.3)
  250. }
  251. }
  252. </style>