collect.vue 7.7 KB

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