wrongById.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  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. orderGoodsId:'',
  83. };
  84. },
  85. onPullDownRefresh() {},
  86. onShow() {
  87. this.getData();
  88. },
  89. onLoad(option) {
  90. this.orderGoodsId = option.orderGoodsId || ''
  91. this.goodsid = option.goodsid
  92. this.examaperList();
  93. },
  94. methods: {
  95. getData() {
  96. if(this.type == 1) {
  97. this.wrongRecordList()
  98. } else if(this.type == 2) {
  99. this.wrongRecordTypeList();
  100. }
  101. },
  102. examaperList() {
  103. this.$api.examaperList({
  104. }).then(res => {
  105. this.scennList2 = [...this.scennList2,...res.data.rows];
  106. })
  107. },
  108. wrongRecordList() {
  109. this.$api.wrongRecordList({
  110. paperId:this.paperid,
  111. goodsId:this.goodsid
  112. }).then(res => {
  113. this.testList = res.data;
  114. let total = 0;
  115. this.testList.rows.forEach(item => {
  116. total += item.wrongQuestionNum;
  117. })
  118. this.total = total
  119. })
  120. },
  121. wrongRecordTypeList() {
  122. this.$api.wrongRecordTypeList({
  123. paperId:this.paperid,
  124. goodsId:this.goodsid
  125. }).then(res => {
  126. this.typeList = res.data;
  127. let total = 0;
  128. this.typeList.rows.forEach(item => {
  129. total += item.num;
  130. })
  131. this.total = total
  132. })
  133. },
  134. selectType(type) {
  135. this.type = type;
  136. this.getData();
  137. },
  138. showSceen(type){
  139. this.sceenType = type
  140. },
  141. hideSceen(){
  142. this.sceenType = null
  143. },
  144. choseType(index) {
  145. this.sceenType = null
  146. this.scennList2.forEach((item,idx)=>{
  147. this.$set(item, 'checked',false)
  148. if(index==idx){
  149. this.paperid = item.paperId
  150. this.$set(item, 'checked',true)
  151. }
  152. })
  153. this.getData()
  154. },
  155. }
  156. };
  157. </script>
  158. <style lang="scss">
  159. page {
  160. background: #EAEEF1;
  161. }
  162. </style>
  163. <style scoped lang="scss">
  164. .animals{
  165. transition: all 0.3s;
  166. transform: rotate(180deg);
  167. }
  168. .sceenBox {
  169. width:100%;
  170. height: 80rpx;
  171. background: #FFFFFF;
  172. display: flex;
  173. justify-content: center;
  174. align-items: center;
  175. font-size: 32rpx;
  176. font-family: PingFang SC;
  177. font-weight: 500;
  178. color: #999999;
  179. position: fixed;
  180. z-index: 999;
  181. border-bottom: 1px solid #eee;
  182. .item{
  183. flex:1;
  184. text-align: center;
  185. &.active{
  186. color:#333;
  187. font-weight: bold;
  188. .icon{
  189. transform: rotate(180deg);
  190. }
  191. }
  192. }
  193. }
  194. .sceenModel{
  195. width:100%;
  196. height:100%;
  197. position: fixed;
  198. z-index: 998;
  199. .sceenModelBg{
  200. width:100%;
  201. height:100%;
  202. position: fixed;
  203. background: rgba(0,0,0,.3);
  204. z-index: 998;
  205. }
  206. .sceenMain{
  207. position: relative;
  208. z-index: 999;
  209. background: #fff;
  210. margin-top: 80rpx;
  211. display: flex;
  212. flex-wrap: wrap;
  213. padding: 8rpx;
  214. justify-content: space-between;
  215. .item{
  216. width: 350rpx;
  217. background: #F5F5F5;
  218. border-radius: 16rpx;
  219. padding: 25rpx 19rpx;
  220. margin: 8rpx;
  221. font-size: 32rpx;
  222. font-family: PingFang SC;
  223. font-weight: bold;
  224. color: #666666;
  225. &.active{
  226. background: #007AFF;
  227. color:#fff;
  228. }
  229. &:first-child{
  230. width:100%;
  231. text-align: center;
  232. }
  233. }
  234. }
  235. }
  236. .wrap{
  237. padding:96rpx 16rpx 16rpx;
  238. }
  239. .wrongHead{
  240. background: #FFFFFF;
  241. border-radius: 16px;
  242. padding:24rpx;
  243. .title{
  244. font-size: 30rpx;
  245. font-family: PingFang SC;
  246. font-weight: bold;
  247. color: #333333;
  248. .sub{
  249. font-size: 20rpx;
  250. font-weight: 500;
  251. color: #999999;
  252. }
  253. }
  254. .progress{
  255. width: 180rpx;
  256. height: 180rpx;
  257. line-height: 140rpx;
  258. border: 20rpx solid #EEEEEE;
  259. border-radius: 50%;
  260. margin: 24rpx auto;
  261. font-size: 50rpx;
  262. text-align: center;
  263. }
  264. }
  265. .wrongTab{
  266. display: flex;
  267. margin: 24rpx 0;
  268. .item{
  269. width: 144rpx;
  270. height: 48rpx;
  271. line-height: 48rpx;
  272. text-align: center;
  273. background: #fff;
  274. border-radius: 16px;
  275. font-size: 28rpx;
  276. font-family: PingFang SC;
  277. font-weight: 500;
  278. color: #666666;
  279. margin-left: 15rpx;
  280. &.active{
  281. background: #007AFF;
  282. color: #fff;
  283. }
  284. }
  285. }
  286. .wrongList{
  287. margin-top:20rpx;
  288. .item{
  289. background: #FFFFFF;
  290. border-radius: 16rpx;
  291. padding: 0 30rpx;
  292. margin-bottom: 16rpx;
  293. overflow: hidden;
  294. .title{
  295. font-size: 32rpx;
  296. font-family: PingFang SC;
  297. font-weight: bold;
  298. color: #333333;
  299. margin: 40rpx 0 17rpx;
  300. }
  301. .bt{
  302. display: flex;
  303. justify-content: space-between;
  304. align-items: center;
  305. padding-bottom: 24rpx;
  306. .left{
  307. width: 176rpx;
  308. height: 40rpx;
  309. background: #FFFFFF;
  310. border: 1px solid #EEEEEE;
  311. border-radius: 16rpx;
  312. font-size: 26rpx;
  313. font-family: PingFang SC;
  314. font-weight: 500;
  315. color: #999999;
  316. display: flex;
  317. justify-content: center;
  318. align-items: center;
  319. .num{
  320. font-size: 26rpx;
  321. font-weight: bold;
  322. color: #FF3B30;
  323. margin-left: 16rpx;
  324. }
  325. }
  326. .right{
  327. display: flex;
  328. .btn{
  329. width: 100rpx;
  330. height: 48rpx;
  331. background: #FFFFFF;
  332. border: 1px solid #007AFF;
  333. border-radius: 16px;
  334. font-size: 24rpx;
  335. font-family: PingFang SC;
  336. font-weight: 500;
  337. color: #007AFF;
  338. margin-left:9rpx;
  339. display: flex;
  340. align-items: center;
  341. justify-content: center;
  342. }
  343. }
  344. }
  345. }
  346. }
  347. </style>