record.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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="pubuBox">
  19. <view class="pubuItem">
  20. <view class="item-masonry" v-for="(item, index) in comList" :key="index">
  21. <view class="type">{{item.type}}</view>
  22. <view class="title">{{ item.title }}</view>
  23. <view class="info"><u-icon class="icon" name="file-text"></u-icon>{{ item.time }}</view>
  24. <view class="info"><u-icon class="icon" name="file-text"></u-icon>总共 {{ item.count }} 题 做对 {{item.trueNum}} 道</view>
  25. <view class="btnBox">
  26. <view class="btn">重做</view>
  27. <view class="btn">解析</view>
  28. <view class="btn">报告</view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import { mapGetters } from 'vuex';
  37. export default {
  38. components: {},
  39. data() {
  40. return {
  41. sceenType: null,
  42. scennList1:[
  43. {id: 1, name: '全部题库记录', checked: true},{id: 1, name: '试卷名称可换行并完整显示'},{id: 1, name: '试卷名称可换行并完整显示'},{id: 1, name: '试卷名称可换行并完整显示'}
  44. ],
  45. scennList2:[
  46. {id: 1, name: '全部试卷类型', checked: true},{id: 1, name: '模拟卷'},{id: 1, name: '真题'},{id: 1, name: '练习'}
  47. ],
  48. comList: [{
  49. type: '模拟卷',
  50. title: '试卷名称可换不知道最多多少个字行',
  51. time: '2021/12/20 14:30',
  52. count: 95,
  53. trueNum: 2
  54. }, {
  55. type: '真题',
  56. title: '试卷名称可换不知道最多多少个字行',
  57. time: '2021/12/20 14:30',
  58. count: 95,
  59. trueNum: 2
  60. },{
  61. type: '练习',
  62. title: '试卷名称可换',
  63. time: '2021/12/20 14:30',
  64. count: 95,
  65. trueNum: 2
  66. }, {
  67. type: '模拟卷',
  68. title: '试卷名称可换行我也不知道最多多少个字',
  69. time: '2021/12/20 14:30',
  70. count: 95,
  71. trueNum: 2
  72. } ]
  73. };
  74. },
  75. onPullDownRefresh() {},
  76. onLoad(option) {},
  77. methods: {
  78. showSceen(type){
  79. this.sceenType = type
  80. },
  81. hideSceen(){
  82. this.sceenType = null
  83. },
  84. choSceen(index,type){
  85. if(type==='tk'){
  86. this.scennList1.forEach((item,idx)=>{
  87. this.$set(item, 'checked',false)
  88. if(index===idx){
  89. this.$set(item, 'checked',true)
  90. }
  91. })
  92. }
  93. if(type==='sj'){
  94. this.scennList2.forEach((item,idx)=>{
  95. this.$set(item, 'checked',false)
  96. if(index===idx){
  97. this.$set(item, 'checked',true)
  98. }
  99. })
  100. }
  101. this.sceenType = null
  102. }
  103. }
  104. };
  105. </script>
  106. <style lang="scss">
  107. page {
  108. background: #EAEEF1;
  109. }
  110. </style>
  111. <style scoped lang="scss">
  112. .sceenBox {
  113. width:100%;
  114. height: 80rpx;
  115. background: #FFFFFF;
  116. display: flex;
  117. justify-content: center;
  118. align-items: center;
  119. font-size: 32rpx;
  120. font-family: PingFang SC;
  121. font-weight: 500;
  122. color: #999999;
  123. position: fixed;
  124. z-index: 999;
  125. border-bottom: 1px solid #eee;
  126. .item{
  127. flex:1;
  128. text-align: center;
  129. &.active{
  130. color:#333;
  131. font-weight: bold;
  132. .icon{
  133. transform: rotate(180deg);
  134. }
  135. }
  136. }
  137. }
  138. .sceenModel{
  139. width:100%;
  140. height:100%;
  141. position: fixed;
  142. z-index: 998;
  143. .sceenModelBg{
  144. width:100%;
  145. height:100%;
  146. position: fixed;
  147. background: rgba(0,0,0,.3);
  148. z-index: 998;
  149. }
  150. .sceenMain{
  151. position: relative;
  152. z-index: 999;
  153. background: #fff;
  154. margin-top: 80rpx;
  155. display: flex;
  156. flex-wrap: wrap;
  157. padding: 8rpx;
  158. justify-content: space-between;
  159. .item{
  160. width: 350rpx;
  161. background: #F5F5F5;
  162. border-radius: 16rpx;
  163. padding: 25rpx 19rpx;
  164. margin: 8rpx;
  165. font-size: 32rpx;
  166. font-family: PingFang SC;
  167. font-weight: bold;
  168. color: #666666;
  169. &.active{
  170. background: #007AFF;
  171. color:#fff;
  172. }
  173. &:first-child{
  174. width:100%;
  175. text-align: center;
  176. }
  177. }
  178. }
  179. }
  180. .pubuBox {
  181. padding: 96rpx 8rpx 30rpx;
  182. .pubuItem {
  183. column-count: 2;
  184. column-gap: 16rpx;
  185. }
  186. .item-masonry {
  187. border-radius: 16rpx;
  188. overflow: hidden;
  189. background-color: #fff;
  190. break-inside: avoid;
  191. box-sizing: border-box;
  192. margin-bottom: 16rpx;
  193. position: relative;
  194. padding: 0 19rpx;
  195. .type{
  196. width: 112rpx;
  197. height: 40rpx;
  198. line-height: 40rpx;
  199. background: linear-gradient(0deg, #4FACFE, #007AFF);
  200. border-radius: 16rpx 0px 16rpx 0px;
  201. position: absolute;
  202. top:0;
  203. left:0;
  204. text-align: center;
  205. font-size: 24rpx;
  206. font-family: PingFang SC;
  207. font-weight: 500;
  208. color: #FFFFFF;
  209. }
  210. .title{
  211. font-size: 32rpx;
  212. font-family: PingFang SC;
  213. font-weight: bold;
  214. color: #333333;
  215. margin: 65rpx 0 26rpx;
  216. }
  217. .info{
  218. font-size: 24rpx;
  219. font-family: PingFang SC;
  220. font-weight: 500;
  221. color: #999999;
  222. line-height: 36rpx;
  223. .icon{
  224. color:#007AFF;
  225. margin-right: 14rpx;
  226. }
  227. }
  228. .btnBox{
  229. display: flex;
  230. justify-content: center;
  231. margin: 22rpx 0;
  232. .btn{
  233. width: 100rpx;
  234. height: 48rpx;
  235. line-height: 48rpx;
  236. text-align: center;
  237. background: #FFFFFF;
  238. border: 1px solid #007AFF;
  239. border-radius: 16rpx;
  240. font-size: 24rpx;
  241. font-family: PingFang SC;
  242. font-weight: 500;
  243. color: #007AFF;
  244. margin: 0 9rpx;
  245. }
  246. }
  247. }
  248. }
  249. </style>