wrongById.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. <template>
  2. <view class="safeArea">
  3. <view class="sceenBox">
  4. <view :class="['item', {'active':sceenType===2} ]" @click="sceenType = !sceenType">全部试卷类型<u-icon class="icon" name="arrow-down" :class="sceenType ? 'animals':''" ></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. .animals{
  162. transition: all 0.3s;
  163. transform: rotate(180deg);
  164. }
  165. .sceenBox {
  166. width:100%;
  167. height: 80rpx;
  168. background: #FFFFFF;
  169. display: flex;
  170. justify-content: center;
  171. align-items: center;
  172. font-size: 32rpx;
  173. font-family: PingFang SC;
  174. font-weight: 500;
  175. color: #999999;
  176. position: fixed;
  177. z-index: 999;
  178. border-bottom: 1px solid #eee;
  179. .item{
  180. flex:1;
  181. text-align: center;
  182. &.active{
  183. color:#333;
  184. font-weight: bold;
  185. .icon{
  186. transform: rotate(180deg);
  187. }
  188. }
  189. }
  190. }
  191. .sceenModel{
  192. width:100%;
  193. height:100%;
  194. position: fixed;
  195. z-index: 998;
  196. .sceenModelBg{
  197. width:100%;
  198. height:100%;
  199. position: fixed;
  200. background: rgba(0,0,0,.3);
  201. z-index: 998;
  202. }
  203. .sceenMain{
  204. position: relative;
  205. z-index: 999;
  206. background: #fff;
  207. margin-top: 80rpx;
  208. display: flex;
  209. flex-wrap: wrap;
  210. padding: 8rpx;
  211. justify-content: space-between;
  212. .item{
  213. width: 350rpx;
  214. background: #F5F5F5;
  215. border-radius: 16rpx;
  216. padding: 25rpx 19rpx;
  217. margin: 8rpx;
  218. font-size: 32rpx;
  219. font-family: PingFang SC;
  220. font-weight: bold;
  221. color: #666666;
  222. &.active{
  223. background: #007AFF;
  224. color:#fff;
  225. }
  226. &:first-child{
  227. width:100%;
  228. text-align: center;
  229. }
  230. }
  231. }
  232. }
  233. .wrap{
  234. padding:96rpx 16rpx 16rpx;
  235. }
  236. .wrongHead{
  237. background: #FFFFFF;
  238. border-radius: 16px;
  239. padding:24rpx;
  240. .title{
  241. font-size: 30rpx;
  242. font-family: PingFang SC;
  243. font-weight: bold;
  244. color: #333333;
  245. .sub{
  246. font-size: 20rpx;
  247. font-weight: 500;
  248. color: #999999;
  249. }
  250. }
  251. .progress{
  252. width: 180rpx;
  253. height: 180rpx;
  254. line-height: 140rpx;
  255. border: 20rpx solid #EEEEEE;
  256. border-radius: 50%;
  257. margin: 24rpx auto;
  258. font-size: 50rpx;
  259. text-align: center;
  260. }
  261. }
  262. .wrongTab{
  263. display: flex;
  264. margin: 24rpx 0;
  265. .item{
  266. width: 144rpx;
  267. height: 48rpx;
  268. line-height: 48rpx;
  269. text-align: center;
  270. background: #fff;
  271. border-radius: 16px;
  272. font-size: 28rpx;
  273. font-family: PingFang SC;
  274. font-weight: 500;
  275. color: #666666;
  276. margin-left: 15rpx;
  277. &.active{
  278. background: #007AFF;
  279. color: #fff;
  280. }
  281. }
  282. }
  283. .wrongList{
  284. margin-top:20rpx;
  285. .item{;
  286. background: #FFFFFF;
  287. border-radius: 16rpx;
  288. padding: 0 30rpx;
  289. margin-bottom: 16rpx;
  290. overflow: hidden;
  291. .title{
  292. font-size: 32rpx;
  293. font-family: PingFang SC;
  294. font-weight: bold;
  295. color: #333333;
  296. margin: 40rpx 0 17rpx;
  297. }
  298. .bt{
  299. display: flex;
  300. justify-content: space-between;
  301. align-items: center;
  302. padding-bottom: 24rpx;
  303. .left{
  304. width: 176rpx;
  305. height: 40rpx;
  306. background: #FFFFFF;
  307. border: 1px solid #EEEEEE;
  308. border-radius: 16rpx;
  309. font-size: 26rpx;
  310. font-family: PingFang SC;
  311. font-weight: 500;
  312. color: #999999;
  313. display: flex;
  314. justify-content: center;
  315. align-items: center;
  316. .num{
  317. font-size: 26rpx;
  318. font-weight: bold;
  319. color: #FF3B30;
  320. margin-left: 16rpx;
  321. }
  322. }
  323. .right{
  324. display: flex;
  325. .btn{
  326. width: 100rpx;
  327. height: 48rpx;
  328. background: #FFFFFF;
  329. border: 1px solid #007AFF;
  330. border-radius: 16px;
  331. font-size: 24rpx;
  332. font-family: PingFang SC;
  333. font-weight: 500;
  334. color: #007AFF;
  335. margin-left:9rpx;
  336. display: flex;
  337. align-items: center;
  338. justify-content: center;
  339. }
  340. }
  341. }
  342. }
  343. }
  344. </style>