wrongById.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. <template>
  2. <view class="safeArea">
  3. <nav-bar title="错题集"></nav-bar>
  4. <view class="sceenBox">
  5. <view :class="['item', {'active':sceenType===2} ]" @click="sceenType = !sceenType">全部试卷类型<u-icon class="icon" name="arrow-down" :class="sceenType ? 'animals':''" ></u-icon></view>
  6. </view>
  7. <view class="sceenModel" v-if="sceenType">
  8. <view class="sceenModelBg" @click="hideSceen"></view>
  9. <view class="sceenMain">
  10. <view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList2" :key="index" @click="choseType(index)">{{item.paperName}}</view>
  11. </view>
  12. </view>
  13. <view class="wrap">
  14. <view class="wrongTab">
  15. <view class="item" :class="{active:type == 1}" @click="selectType(1)">试卷归类</view>
  16. <view class="item" :class="{active:type == 2}" @click="selectType(2)">题型归类</view>
  17. </view>
  18. <view class="wrongHead">
  19. <view class="title">错题统计<text class="sub">(不含简答和案例题)</text></view>
  20. <view class="progress">
  21. <text>{{total}}</text>
  22. </view>
  23. </view>
  24. <view class="wrongList" v-if="type == 1">
  25. <view class="item" v-for="(item,index) in testList.rows" :key="index">
  26. <view class="title">{{item.examName}}</view>
  27. <view class="bt">
  28. <view class="left">错题数<text class="num">{{item.wrongQuestionNum}}</text></view>
  29. <view class="right">
  30. <navigator hover-class="none" :url="'/pages2/subject/wrongBank?examId='+item.examId">
  31. <view class="btn">重做</view>
  32. </navigator>
  33. <navigator hover-class="none" :url="'/pages2/subject/wrongBank?examId='+item.examId+'&explain=1'">
  34. <view class="btn">解析</view>
  35. </navigator>
  36. <!-- <view class="btn">解析</view> -->
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="wrongList" v-if="type == 2">
  42. <view class="item" v-for="(item,index) in typeList.rows" :key="index">
  43. <view class="title">
  44. <text v-if="item.type==1">单选题</text>
  45. <text v-if="item.type==2">多选题</text>
  46. <text v-if="item.type==3">判断题</text>
  47. <text v-if="item.type==4">案例题</text>
  48. <text v-if="item.type==5">简答题</text>
  49. </view>
  50. <view class="bt">
  51. <view class="left">错题数<text class="num">{{item.num}}</text></view>
  52. <view class="right">
  53. <navigator hover-class="none" :url="'/pages2/subject/wrongTypeBank?type='+item.type">
  54. <view class="btn">重做</view>
  55. </navigator>
  56. <navigator hover-class="none" :url="'/pages2/subject/wrongTypeBank?type='+item.type+'&explain=1'">
  57. <view class="btn">解析</view>
  58. </navigator>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. import { mapGetters } from 'vuex';
  68. export default {
  69. components: {},
  70. data() {
  71. return {
  72. sceenType: null,
  73. scennList2:[
  74. {paperId: '', paperName: '全部试卷类型', checked: true}
  75. ],
  76. type:1,
  77. testList:[],
  78. typeList:[],
  79. goodsid:'',
  80. paperid:'',
  81. total:0,
  82. };
  83. },
  84. onPullDownRefresh() {},
  85. onShow() {
  86. this.getData();
  87. },
  88. onLoad(option) {
  89. this.goodsid = option.goodsid
  90. this.examaperList();
  91. },
  92. methods: {
  93. getData() {
  94. if(this.type == 1) {
  95. this.wrongRecordList()
  96. } else if(this.type == 2) {
  97. this.wrongRecordTypeList();
  98. }
  99. },
  100. examaperList() {
  101. this.$api.examaperList({
  102. }).then(res => {
  103. this.scennList2 = [...this.scennList2,...res.data.rows];
  104. })
  105. },
  106. wrongRecordList() {
  107. this.$api.wrongRecordList({
  108. paperId:this.paperid,
  109. goodsId:this.goodsid
  110. }).then(res => {
  111. this.testList = res.data;
  112. let total = 0;
  113. this.testList.rows.forEach(item => {
  114. total += item.wrongQuestionNum;
  115. })
  116. this.total = total
  117. })
  118. },
  119. wrongRecordTypeList() {
  120. this.$api.wrongRecordTypeList({
  121. paperId:this.paperid,
  122. goodsId:this.goodsid
  123. }).then(res => {
  124. this.typeList = res.data;
  125. let total = 0;
  126. this.typeList.rows.forEach(item => {
  127. total += item.num;
  128. })
  129. this.total = total
  130. })
  131. },
  132. selectType(type) {
  133. this.type = type;
  134. this.getData();
  135. },
  136. showSceen(type){
  137. this.sceenType = type
  138. },
  139. hideSceen(){
  140. this.sceenType = null
  141. },
  142. choseType(index) {
  143. this.sceenType = null
  144. this.scennList2.forEach((item,idx)=>{
  145. this.$set(item, 'checked',false)
  146. if(index==idx){
  147. this.paperid = item.paperId
  148. this.$set(item, 'checked',true)
  149. }
  150. })
  151. this.getData()
  152. },
  153. }
  154. };
  155. </script>
  156. <style lang="scss">
  157. page {
  158. background: #EAEEF1;
  159. }
  160. </style>
  161. <style scoped lang="scss">
  162. .animals{
  163. transition: all 0.3s;
  164. transform: rotate(180deg);
  165. }
  166. .sceenBox {
  167. width:100%;
  168. height: 80rpx;
  169. background: #FFFFFF;
  170. display: flex;
  171. justify-content: center;
  172. align-items: center;
  173. font-size: 32rpx;
  174. font-family: PingFang SC;
  175. font-weight: 500;
  176. color: #999999;
  177. position: fixed;
  178. z-index: 999;
  179. border-bottom: 1px solid #eee;
  180. .item{
  181. flex:1;
  182. text-align: center;
  183. &.active{
  184. color:#333;
  185. font-weight: bold;
  186. .icon{
  187. transform: rotate(180deg);
  188. }
  189. }
  190. }
  191. }
  192. .sceenModel{
  193. width:100%;
  194. height:100%;
  195. position: fixed;
  196. z-index: 998;
  197. .sceenModelBg{
  198. width:100%;
  199. height:100%;
  200. position: fixed;
  201. background: rgba(0,0,0,.3);
  202. z-index: 998;
  203. }
  204. .sceenMain{
  205. position: relative;
  206. z-index: 999;
  207. background: #fff;
  208. margin-top: 80rpx;
  209. display: flex;
  210. flex-wrap: wrap;
  211. padding: 8rpx;
  212. justify-content: space-between;
  213. .item{
  214. width: 350rpx;
  215. background: #F5F5F5;
  216. border-radius: 16rpx;
  217. padding: 25rpx 19rpx;
  218. margin: 8rpx;
  219. font-size: 32rpx;
  220. font-family: PingFang SC;
  221. font-weight: bold;
  222. color: #666666;
  223. &.active{
  224. background: #007AFF;
  225. color:#fff;
  226. }
  227. &:first-child{
  228. width:100%;
  229. text-align: center;
  230. }
  231. }
  232. }
  233. }
  234. .wrap{
  235. padding:96rpx 16rpx 16rpx;
  236. }
  237. .wrongHead{
  238. background: #FFFFFF;
  239. border-radius: 16px;
  240. padding:24rpx;
  241. .title{
  242. font-size: 30rpx;
  243. font-family: PingFang SC;
  244. font-weight: bold;
  245. color: #333333;
  246. .sub{
  247. font-size: 20rpx;
  248. font-weight: 500;
  249. color: #999999;
  250. }
  251. }
  252. .progress{
  253. width: 180rpx;
  254. height: 180rpx;
  255. line-height: 140rpx;
  256. border: 20rpx solid #EEEEEE;
  257. border-radius: 50%;
  258. margin: 24rpx auto;
  259. font-size: 50rpx;
  260. text-align: center;
  261. }
  262. }
  263. .wrongTab{
  264. display: flex;
  265. margin: 24rpx 0;
  266. .item{
  267. width: 144rpx;
  268. height: 48rpx;
  269. line-height: 48rpx;
  270. text-align: center;
  271. background: #fff;
  272. border-radius: 16px;
  273. font-size: 28rpx;
  274. font-family: PingFang SC;
  275. font-weight: 500;
  276. color: #666666;
  277. margin-left: 15rpx;
  278. &.active{
  279. background: #007AFF;
  280. color: #fff;
  281. }
  282. }
  283. }
  284. .wrongList{
  285. margin-top:20rpx;
  286. .item{
  287. background: #FFFFFF;
  288. border-radius: 16rpx;
  289. padding: 0 30rpx;
  290. margin-bottom: 16rpx;
  291. overflow: hidden;
  292. .title{
  293. font-size: 32rpx;
  294. font-family: PingFang SC;
  295. font-weight: bold;
  296. color: #333333;
  297. margin: 40rpx 0 17rpx;
  298. }
  299. .bt{
  300. display: flex;
  301. justify-content: space-between;
  302. align-items: center;
  303. padding-bottom: 24rpx;
  304. .left{
  305. width: 176rpx;
  306. height: 40rpx;
  307. background: #FFFFFF;
  308. border: 1px solid #EEEEEE;
  309. border-radius: 16rpx;
  310. font-size: 26rpx;
  311. font-family: PingFang SC;
  312. font-weight: 500;
  313. color: #999999;
  314. display: flex;
  315. justify-content: center;
  316. align-items: center;
  317. .num{
  318. font-size: 26rpx;
  319. font-weight: bold;
  320. color: #FF3B30;
  321. margin-left: 16rpx;
  322. }
  323. }
  324. .right{
  325. display: flex;
  326. .btn{
  327. width: 100rpx;
  328. height: 48rpx;
  329. background: #FFFFFF;
  330. border: 1px solid #007AFF;
  331. border-radius: 16px;
  332. font-size: 24rpx;
  333. font-family: PingFang SC;
  334. font-weight: 500;
  335. color: #007AFF;
  336. margin-left:9rpx;
  337. display: flex;
  338. align-items: center;
  339. justify-content: center;
  340. }
  341. }
  342. }
  343. }
  344. }
  345. </style>