UniversityDetail.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <div ref="universityDetail" id="universityDetail" style="padding:24px 8%;background-color:#f7f7f7;">
  3. <el-card style="color: #5E5E5E;" ref="navBar">
  4. <el-breadcrumb separator-class="el-icon-arrow-right">
  5. <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
  6. <el-breadcrumb-item :to="{ name: 'LibraryCollege'}">校园库</el-breadcrumb-item>
  7. <el-breadcrumb-item>校院详情</el-breadcrumb-item>
  8. </el-breadcrumb>
  9. </el-card>
  10. <el-row ref="header" style="margin-top: 10px;background-color: #F0F3FC;height:260px;" v-if="universityDetails.baseInfo">
  11. <el-col :span="5" class="headerImg">
  12. <el-image class="img" :src="universityDetails.baseInfo.logo" style="text-align: center">
  13. <h1 slot="error">{{universityDetails.baseInfo.name}}</h1>
  14. </el-image>
  15. </el-col>
  16. <el-col :span="19">
  17. <el-row style="padding:20px 0 30px 30px;">
  18. <el-col :span="20">
  19. <div class="baseInfo">
  20. <span>院校属性:</span>
  21. <p></p>
  22. </div>
  23. <div class="baseInfo">
  24. <span>网址:</span>
  25. <el-link :underline="false" style="color:#1154FF">{{universityDetails.baseInfo.url}}</el-link>
  26. </div>
  27. <div class="baseInfo">
  28. <span>电话:</span>
  29. <span :underline="false">
  30. {{universityDetails.baseInfo.tel}}
  31. </span>
  32. </div>
  33. <div class="baseInfo">
  34. <span>院校隶属:</span>
  35. <span :underline="false">
  36. {{universityDetails.baseInfo.managerType}}
  37. </span>
  38. </div>
  39. <div class="baseInfo">
  40. <span>所在地:</span>
  41. <span :underline="false">
  42. {{universityDetails.baseInfo.location}}
  43. </span>
  44. </div>
  45. <div class="baseInfo">
  46. <span>院校类型:</span>
  47. <span :underline="false">
  48. {{universityDetails.baseInfo.type}}
  49. </span>
  50. </div>
  51. </el-col>
  52. <el-col :span="4" style="text-align: right;">
  53. <div class="headerText">NO:{{universityDetails.baseInfo.code}}</div>
  54. </el-col>
  55. </el-row>
  56. </el-col>
  57. </el-row>
  58. <el-row style="padding:20px 0px;" v-if="universityDetails.overview">
  59. <el-col :span="5" class="detailNaver">
  60. <div >院校概况</div>
  61. <div >院系设置</div>
  62. <div >招生简章</div>
  63. <div >录取分数线</div>
  64. <div >招生计划</div>
  65. <div >VR校园</div>
  66. <div @click="activeSelectNaver('1')" :class="{'activeNaver':selectNaver==='1','noActiveNaver':selectNaver==='2' || selectNaver==='3' }">学校状况</div>
  67. <div @click="activeSelectNaver('2')" :class="{'activeNaver':selectNaver==='2','noActiveNaver':selectNaver==='1' || selectNaver==='3' }">招生简章</div>
  68. <div @click="activeSelectNaver('3')" :class="{'activeNaver':selectNaver==='3','noActiveNaver':selectNaver==='2' || selectNaver==='1' }">开设专业</div>
  69. </el-col>
  70. <el-col :span="19" style="padding:0px 20px;">
  71. <div ref="a1" style="background-color: #ffffff;padding:20px 20px 0px 0px;">
  72. <div style="display: flex;justify-content: space-between">
  73. <span :style="{'color':theme}" style="background-color:#F0F3FC;font-size:16px;font-weight:bold;padding:10px 100px 10px 50px;display:inline-block;clip-path: polygon(0 0, 80% 0, 100% 100%, 0 100%);">学校概况</span>
  74. <span :style="{'color':theme}" style="font-size:36px;color:#FCE1B0;">SCHOOL SURVEY</span>
  75. </div>
  76. <!--第一个内容区域-->
  77. <div style="padding:30px;">
  78. <div v-html="universityDetails.overview"></div>
  79. </div>
  80. </div>
  81. <!--第二个内容区域-->
  82. <div ref="a2" style="background-color: #ffffff;padding:20px 20px 0px 0px;margin-top: 30px;">
  83. <div style="display: flex;justify-content: space-between">
  84. <span :style="{'color':theme}" style="background-color:#F0F3FC;font-size:16px;font-weight:bold;padding:10px 100px 10px 50px;display:inline-block;clip-path: polygon(0 0, 80% 0, 100% 100%, 0 100%);">招生简章</span>
  85. <span :style="{'color':theme}" style="font-size:36px;color:#FCE1B0;">GENERAL RULES</span>
  86. </div>
  87. <div style="padding:30px;">
  88. <div class="generalTitle" v-for="(item,index) in universityDetails.zsjzs" :key="item.title">
  89. <p :style="{'color':activeGeneralTitle===index?theme:'#000'}" @click="activeGeneralTitle=index" >·{{item.title}}</p>
  90. </div>
  91. <div style="margin-top:50px;" v-html="universityDetails.zsjzs[activeGeneralTitle].remark"></div>
  92. </div>
  93. </div>
  94. <!--第三个内容区域-->
  95. <div ref="a3" style="background-color: #ffffff;padding:20px 20px 0px 0px;margin-top: 30px;">
  96. <div style="display: flex;justify-content: space-between">
  97. <span :style="{'color':theme}" style="background-color:#F0F3FC;font-size:16px;font-weight:bold;padding:10px 100px 10px 50px;display:inline-block;clip-path: polygon(0 0, 80% 0, 100% 100%, 0 100%);">开设专业</span>
  98. <span :style="{'color':theme}" style="font-size:36px;color:#FCE1B0;">MARJOR</span>
  99. </div>
  100. <div style="padding:30px;">
  101. <el-row :gutter="30" style="font-family: PingFangSC-Regular, PingFang SC;
  102. font-weight: 400;">
  103. <el-col :span="12" v-for="(item,index) in universityDetails.marjors" :key="item.name+index">
  104. <div style="padding: 8px;">
  105. <h5 style="margin:0 0 8px">{{item.name}}({{item.children.length}}个)</h5>
  106. <span style="padding:4px;display: inline-block" v-for="val in item.children" :key="val">{{val}}</span>
  107. </div>
  108. </el-col>
  109. </el-row>
  110. </div>
  111. </div>
  112. </el-col>
  113. </el-row>
  114. </div>
  115. </template>
  116. <script>
  117. import {mapState} from 'vuex';
  118. import {selectUniversityDetail} from '@/api/webApi/career-course'
  119. export default {
  120. name: "UniversityDetail",
  121. data(){
  122. return {
  123. universityId:'',
  124. universityDetails:{},
  125. selectNaver:'1',
  126. activeGeneralTitle:0
  127. }
  128. },
  129. computed:{
  130. ...mapState({theme: state => state.settings.theme}),
  131. },
  132. watch:{
  133. theme:{
  134. immediate:true,
  135. handler(val){
  136. this.$nextTick(()=>{
  137. this.$refs.universityDetail.style.setProperty('--themeColor', val)
  138. })
  139. }
  140. },
  141. '$route':{
  142. immediate:true,
  143. handler(val){
  144. this.universityId= val.query.id
  145. this.getUniversityDetail()
  146. }
  147. }
  148. },
  149. methods:{
  150. activeSelectNaver(type){
  151. this.selectNaver=type
  152. const navBarHeight=this.$refs.navBar.$el.offsetHeight
  153. const headerHeight=this.$refs.header.$el.offsetHeight
  154. const a1Height=this.$refs.a1.offsetHeight
  155. const a2Height=this.$refs.a2.offsetHeight
  156. const a3Height=this.$refs.a3.offsetHeight
  157. if(type==='1'){
  158. document.documentElement.scrollTop=navBarHeight+headerHeight+50
  159. }else if(type==='2'){
  160. document.documentElement.scrollTop=navBarHeight+headerHeight+a1Height+50+20
  161. }else if(type==='3'){
  162. document.documentElement.scrollTop=navBarHeight+headerHeight+a1Height+a2Height+50+20+20
  163. }
  164. },
  165. getUniversityDetail(){
  166. if(this.universityId){
  167. const params={
  168. universityId:this.universityId
  169. }
  170. selectUniversityDetail(params).then(res=>{
  171. this.universityDetails=res.data
  172. })
  173. }
  174. }
  175. }
  176. }
  177. </script>
  178. <style lang="scss" scoped>
  179. #universityDetail{
  180. .title{
  181. &:hover{
  182. color:var(--themeColor);
  183. }
  184. }
  185. .baseInfo{
  186. margin-top: 15px;
  187. font-size: 14px;
  188. font-family: PingFangSC-Regular, PingFang SC;
  189. font-weight: 400;
  190. color: #414141;
  191. line-height: 20px;
  192. }
  193. .headerImg{
  194. background-color: var(--themeColor);
  195. height:100%;
  196. display: flex;
  197. align-items: center;
  198. justify-content: center;
  199. .img{
  200. width:60%;
  201. border-radius: 50%;
  202. }
  203. }
  204. .headerText{
  205. font-size: 24px;
  206. font-family: PingFangSC-Semibold, PingFang SC;
  207. font-weight: 600;
  208. color: #FFFFFF;
  209. padding: 10px;
  210. background-color: var(--themeColor);
  211. border-top-left-radius: 50px;
  212. border-bottom-left-radius: 50px;
  213. }
  214. .detailNaver{
  215. div{
  216. padding:20px;
  217. &:hover{
  218. background-color: #F0F3FC;
  219. border-top: 4px solid var(--themeColor);
  220. }
  221. }
  222. }
  223. .generalTitle{
  224. padding: 8px 0;
  225. cursor: pointer;
  226. font-family: PingFangSC-Regular, PingFang SC,Helvetica,serif;
  227. font-weight: 400;
  228. /*color:var(--themeColor);*/
  229. }
  230. }
  231. .noActiveNaver{
  232. background-color: #f7f7f7;
  233. border-top: 4px solid transparent;
  234. }
  235. .activeNaver{
  236. background-color: #F0F3FC;
  237. border-top: 4px solid var(--themeColor);
  238. }
  239. </style>