wrong.vue 8.5 KB

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