wrong.vue 7.0 KB

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