wrongById.vue 7.4 KB

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