wrong.vue 8.5 KB

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