collect.vue 6.9 KB

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