collectById.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. <template>
  2. <view class="safeArea">
  3. <nav-bar title="收藏集"></nav-bar>
  4. <view class="sceenBox">
  5. <view :class="['item', {'active':sceenType===2} ]" @click="sceenType = !sceenType">全部试卷类型<u-icon class="icon" :class="sceenType ? 'animals':''" 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. <view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList2" :key="index" @click="choseType(index)">{{item.paperName}}</view>
  11. </view>
  12. </view>
  13. <view class="wrap">
  14. <view class="wrongTab">
  15. <view class="item" :class="{active:type == 1}" @click="selectType(1)">试卷归类</view>
  16. <view class="item" :class="{active:type == 2}" @click="selectType(2)">题型归类</view>
  17. </view>
  18. <view class="wrongHead">
  19. <view class="title">收藏统计</view>
  20. <view class="progress">
  21. <text>{{total}}</text>
  22. </view>
  23. </view>
  24. <view class="wrongList" v-if="type == 1">
  25. <view class="item" v-for="(item,index) in testList.rows" :key="index">
  26. <view class="title">{{item.examName}}</view>
  27. <view class="bt">
  28. <view class="left">收藏数<text class="num">{{item.questionNum}}</text></view>
  29. <view class="right">
  30. <navigator hover-class="none" :url="'/pages2/subject/collectBank?orderGoodsId='+orderGoodsId+'&examId='+item.examId + '&distinction=1'+ '&doMode=' + item.doMode">
  31. <view class="btn">重做</view>
  32. </navigator>
  33. <navigator hover-class="none" :url="'/pages2/subject/collectBank?orderGoodsId='+orderGoodsId+'&examId='+item.examId+'&explain=1' + '&distinction=1'+ '&doMode=' + item.doMode">
  34. <view class="btn">解析</view>
  35. </navigator>
  36. <!-- <view class="btn">解析</view> -->
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="wrongList" v-if="type == 2">
  42. <view class="item" v-for="(item,index) in typeList.rows" :key="index">
  43. <view class="title">
  44. <text v-if="item.type==1">单选题</text>
  45. <text v-if="item.type==2">多选题</text>
  46. <text v-if="item.type==3">判断题</text>
  47. <text v-if="item.type==4">案例题</text>
  48. <text v-if="item.type==5">简答题</text>
  49. </view>
  50. <view class="bt">
  51. <view class="left">收藏数<text class="num">{{item.num}}</text></view>
  52. <view class="right">
  53. <!-- <navigator hover-class="none" :url="'/pages2/subject/collectTypeBank?orderGoodsId='+orderGoodsId+'&type='+item.type">
  54. <view class="btn">重做</view>
  55. </navigator>
  56. <navigator hover-class="none" :url="'/pages2/subject/collectTypeBank?orderGoodsId='+orderGoodsId+'&type='+item.type+'&explain=1'">
  57. <view class="btn">解析</view>
  58. </navigator> -->
  59. <navigator hover-class="none" :url="'/pages2/subject/collectTypeBank?orderGoodsId='+orderGoodsId+'&type='+item.type + '&distinction=2'">
  60. <view class="btn">重做</view>
  61. </navigator>
  62. <navigator hover-class="none" :url="'/pages2/subject/collectTypeBank?orderGoodsId='+orderGoodsId+'&type='+item.type+'&explain=1'+ '&distinction=2'">
  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. scennList2:[
  80. {paperId: '', paperName: '全部试卷类型', checked: true}
  81. ],
  82. type:1,
  83. testList:[],
  84. typeList:[],
  85. total:0,
  86. goodsid:'',
  87. orderGoodsId:'',
  88. paperid:''
  89. };
  90. },
  91. onPullDownRefresh() {},
  92. onLoad(option) {
  93. this.orderGoodsId = option.orderGoodsId || ''
  94. this.goodsid = option.goodsid
  95. this.examaperList();
  96. this.getData();
  97. },
  98. methods: {
  99. getData() {
  100. if(this.type == 1) {
  101. this.goodsCollectExamList()
  102. } else if(this.type == 2) {
  103. this.collectQuestionTypeList();
  104. }
  105. },
  106. examaperList() {
  107. this.$api.examaperList({
  108. }).then(res => {
  109. this.scennList2 = [...this.scennList2,...res.data.rows];
  110. })
  111. },
  112. goodsCollectExamList() {
  113. this.$api.goodsCollectExamList({
  114. paperId:this.paperid,
  115. goodsId:this.goodsid
  116. }).then(res => {
  117. this.testList = res.data
  118. let total = 0;
  119. this.testList.rows.forEach(item => {
  120. total += item.questionNum;
  121. })
  122. this.total = total
  123. })
  124. },
  125. collectQuestionTypeList() {
  126. this.$api.collectQuestionTypeList({
  127. paperId:this.paperid,
  128. goodsId:this.goodsid
  129. }).then(res => {
  130. this.typeList = res.data
  131. let total = 0;
  132. this.typeList.rows.forEach(item => {
  133. total += item.num;
  134. })
  135. this.total = total
  136. })
  137. },
  138. showSceen(type){
  139. this.sceenType = type
  140. },
  141. /**
  142. * @param {Object} tab切换
  143. */
  144. selectType(type) {
  145. this.type = type;
  146. this.getData();
  147. },
  148. hideSceen(){
  149. this.sceenType = null
  150. },
  151. choseType(index) {
  152. this.sceenType = null
  153. this.scennList2.forEach((item,idx)=>{
  154. this.$set(item, 'checked',false)
  155. if(index==idx){
  156. this.paperid = item.paperId
  157. this.$set(item, 'checked',true)
  158. }
  159. })
  160. this.getData()
  161. },
  162. }
  163. };
  164. </script>
  165. <style lang="scss">
  166. page {
  167. background: #EAEEF1;
  168. }
  169. </style>
  170. <style scoped lang="scss">
  171. .animals{
  172. transition: all 0.3s;
  173. transform: rotate(180deg);
  174. }
  175. .sceenBox {
  176. width:100%;
  177. height: 80rpx;
  178. background: #FFFFFF;
  179. display: flex;
  180. justify-content: center;
  181. align-items: center;
  182. font-size: 32rpx;
  183. font-family: PingFang SC;
  184. font-weight: 500;
  185. color: #999999;
  186. position: fixed;
  187. z-index: 999;
  188. border-bottom: 1px solid #eee;
  189. .item{
  190. flex:1;
  191. text-align: center;
  192. &.active{
  193. color:#333;
  194. font-weight: bold;
  195. .icon{
  196. transform: rotate(180deg);
  197. }
  198. }
  199. }
  200. }
  201. .sceenModel{
  202. width:100%;
  203. height:100%;
  204. position: fixed;
  205. z-index: 998;
  206. .sceenModelBg{
  207. width:100%;
  208. height:100%;
  209. position: fixed;
  210. background: rgba(0,0,0,.3);
  211. z-index: 998;
  212. }
  213. .sceenMain{
  214. position: relative;
  215. z-index: 999;
  216. background: #fff;
  217. margin-top: 80rpx;
  218. display: flex;
  219. flex-wrap: wrap;
  220. padding: 8rpx;
  221. justify-content: space-between;
  222. .item{
  223. width: 350rpx;
  224. background: #F5F5F5;
  225. border-radius: 16rpx;
  226. padding: 25rpx 19rpx;
  227. margin: 8rpx;
  228. font-size: 32rpx;
  229. font-family: PingFang SC;
  230. font-weight: bold;
  231. color: #666666;
  232. &.active{
  233. background: #007AFF;
  234. color:#fff;
  235. }
  236. &:first-child{
  237. width:100%;
  238. text-align: center;
  239. }
  240. }
  241. }
  242. }
  243. .wrap{
  244. padding:96rpx 16rpx 16rpx;
  245. }
  246. .wrongHead{
  247. background: #FFFFFF;
  248. border-radius: 16px;
  249. padding:24rpx;
  250. .title{
  251. font-size: 30rpx;
  252. font-family: PingFang SC;
  253. font-weight: bold;
  254. color: #333333;
  255. .sub{
  256. font-size: 20rpx;
  257. font-weight: 500;
  258. color: #999999;
  259. }
  260. }
  261. .progress{
  262. width: 180rpx;
  263. height: 180rpx;
  264. line-height: 140rpx;
  265. border: 20rpx solid #EEEEEE;
  266. border-radius: 50%;
  267. margin: 24rpx auto;
  268. font-size: 50rpx;
  269. text-align: center;
  270. }
  271. }
  272. .wrongTab{
  273. display: flex;
  274. margin: 24rpx 0;
  275. .item{
  276. width: 144rpx;
  277. height: 48rpx;
  278. line-height: 48rpx;
  279. text-align: center;
  280. background: #fff;
  281. border-radius: 16px;
  282. font-size: 28rpx;
  283. font-family: PingFang SC;
  284. font-weight: 500;
  285. color: #666666;
  286. margin-left: 15rpx;
  287. &.active{
  288. background: #007AFF;
  289. color: #fff;
  290. }
  291. }
  292. }
  293. .wrongList{
  294. margin-top:20rpx;
  295. .item{;
  296. background: #FFFFFF;
  297. border-radius: 16rpx;
  298. padding: 0 30rpx;
  299. margin-bottom: 16rpx;
  300. overflow: hidden;
  301. .title{
  302. font-size: 32rpx;
  303. font-family: PingFang SC;
  304. font-weight: bold;
  305. color: #333333;
  306. margin: 40rpx 0 17rpx;
  307. }
  308. .bt{
  309. display: flex;
  310. justify-content: space-between;
  311. align-items: center;
  312. padding-bottom: 24rpx;
  313. .left{
  314. width: 176rpx;
  315. height: 40rpx;
  316. background: #FFFFFF;
  317. border: 1px solid #EEEEEE;
  318. border-radius: 16rpx;
  319. font-size: 26rpx;
  320. font-family: PingFang SC;
  321. font-weight: 500;
  322. color: #999999;
  323. display: flex;
  324. justify-content: center;
  325. align-items: center;
  326. .num{
  327. font-size: 26rpx;
  328. font-weight: bold;
  329. color: #FF3B30;
  330. margin-left: 16rpx;
  331. }
  332. }
  333. .right{
  334. display: flex;
  335. .btn{
  336. width: 100rpx;
  337. height: 48rpx;
  338. background: #FFFFFF;
  339. border: 1px solid #007AFF;
  340. border-radius: 16px;
  341. font-size: 24rpx;
  342. font-family: PingFang SC;
  343. font-weight: 500;
  344. color: #007AFF;
  345. margin-left:9rpx;
  346. display: flex;
  347. align-items: center;
  348. justify-content: center;
  349. }
  350. }
  351. }
  352. }
  353. }
  354. </style>