main.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <div class="app-back">
  3. <div class="banner">
  4. <el-image :src="`${$imgBase}index/banner/daoxue_banner.png`" fit="cover"></el-image>
  5. </div>
  6. <div class="fx-column fx-cen-cen pb20">
  7. <index-card title="在线试卷" class="mt20 index-block" v-if="role">
  8. <el-row :gutter="20">
  9. <el-col :span="8" v-for="item in onLinePaper">
  10. <div class="wrap-item fx-row jc-between ai-center">
  11. <div class="left mr30">
  12. <el-image :src="item.img"></el-image>
  13. </div>
  14. <div>
  15. <div class="fx-row ai-center">
  16. <el-image :src="`${$imgBase}index/daoxue/icon_paper.png`"></el-image>
  17. <p class="bold">{{ item.title }}</p>
  18. </div>
  19. <p class="mt20 mb20" style="color:#CECECE">少儿数字内容</p>
  20. <div>
  21. <el-button type="primary" @click="$router.push(item.path)">立即查询</el-button>
  22. </div>
  23. </div>
  24. </div>
  25. </el-col>
  26. </el-row>
  27. </index-card>
  28. <index-card title="学情分析" class="mt20 index-block">
  29. <el-row :gutter="20">
  30. <el-col :span="8" v-for="item in idcFormatList" @click="$router.push(item.path)">
  31. <div class="wrap-item fx-row jc-between ai-center">
  32. <div class="left mr30">
  33. <el-image :src="item.img"></el-image>
  34. </div>
  35. <div>
  36. <div class="fx-row ai-center">
  37. <el-image :src="`${$imgBase}index/daoxue/icon_paper.png`"></el-image>
  38. <p class="bold">{{ item.title }}</p>
  39. </div>
  40. <p class="mt20 mb20" style="color:#CECECE">少儿数字内容</p>
  41. <div>
  42. <el-button type="primary" @click="$router.push(item.path)">立即查询</el-button>
  43. </div>
  44. </div>
  45. </div>
  46. </el-col>
  47. </el-row>
  48. </index-card>
  49. <index-card title="学情报告" class="mt20 index-block">
  50. <el-button type="primary" @click="openNew">查看报告</el-button>
  51. </index-card>
  52. </div>
  53. </div>
  54. </template>
  55. <script>
  56. import IndexCard from '@/views/index/components/index-card.vue'
  57. import MxImageWrap from '@/views/questioncenter/components/main-card/mx-image-wrap.vue'
  58. import loginCheckMixin from '@/views/components/blocks/index-login-check-mixin'
  59. import { checkRole } from '@/utils/permission'
  60. import { mapGetters } from 'vuex'
  61. export default {
  62. components: { IndexCard, MxImageWrap },
  63. mixins: [loginCheckMixin],
  64. computed:{
  65. ...mapGetters(['middlebarRouters']),
  66. idcListOpt() {
  67. const obj = {}
  68. this.idc.map(item => {
  69. obj[`${item.title}${item.path}`] = {desc: item.desc }
  70. })
  71. return obj
  72. },
  73. idcFormatList() {
  74. if(!this.middlebarRouters.length) return []
  75. if(!this.middlebarRouters.find(item => item.meta.title == '学情分析')) return []
  76. if(!checkRole(['frontMaster'])) return this.idc
  77. const listOptKey = Object.keys(this.idcListOpt)
  78. let formatList = []
  79. return this.middlebarRouters.find(item => item.meta.title == '学情分析').children.slice(0,3).map((item,idx) =>{
  80. return {
  81. title: item.meta.title,
  82. img:this.idc[idx].img,
  83. path:item.path,
  84. }
  85. })
  86. }
  87. },
  88. data() {
  89. return {
  90. role:checkRole(['frontStudent']),
  91. onLinePaper: [
  92. {
  93. title: '个人测评',
  94. img: `${this.$imgBase}index/daoxue/personal_eval.png`,
  95. path: '/daoxue/evaluating/personal/index_3'
  96. },
  97. {
  98. title: '真题测评',
  99. img: `${this.$imgBase}index/daoxue/past_eval.png`,
  100. path: '/daoxue/evaluating/past/index_5'
  101. },
  102. {
  103. title: '学校测评',
  104. img: `${this.$imgBase}index/daoxue/school_eval.png`,
  105. path: '/daoxue/evaluating/school/index_1'
  106. }
  107. ],
  108. idc: [
  109. {
  110. title: '个人测评',
  111. img: `${this.$imgBase}index/daoxue/personal_idc.png`,
  112. path: '/daoxue/idc/eval/index_3'
  113. },
  114. {
  115. title: '真题测评',
  116. img: `${this.$imgBase}index/daoxue/past_idc.png`,
  117. path: '/daoxue/idc/eval/index_5'
  118. },
  119. {
  120. title: '学校测评',
  121. img: `${this.$imgBase}index/daoxue/school_idc.png`,
  122. path: '/daoxue/idc/eval/school/index_1'
  123. }
  124. ]
  125. }
  126. },
  127. methods: {
  128. openNew(){
  129. window.open('https://online.fliphtml5.com/jkrou/hjig/#p=1','_blank')
  130. }
  131. }
  132. }
  133. </script>
  134. <style scoped lang="scss">
  135. .wrap-item {
  136. background: #F7F8FD;
  137. border-radius: 4px;
  138. padding: 20px 30px 0 30px;
  139. }
  140. .right {
  141. display: flex;
  142. }
  143. @media screen and (min-width: 1440px) {
  144. .index-block {
  145. width: 1350px;
  146. overflow: hidden;
  147. }
  148. }
  149. @media screen and (max-width: 1439px) {
  150. .index-block {
  151. width: calc(100vw - 80px);
  152. overflow: hidden;
  153. }
  154. }
  155. </style>