UniversityStyle.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <div class="univerty" v-loading="loading">
  3. <!-- VR -->
  4. <!-- <div class="image-item">-->
  5. <!-- <div class="cover-image vr" >-->
  6. <!-- <div class="colleges-imgs-mask">-->
  7. <!-- <i class="iconfont icon-vr" style="font-size: 28px"></i>-->
  8. <!-- </div>-->
  9. <!-- </div>-->
  10. <!-- <p class="mt15 text-overflow-ellipsis f14 lh20">VR校园</p>-->
  11. <!-- </div>-->
  12. <!-- &lt;!&ndash; 视频 &ndash;&gt;-->
  13. <!-- <div class="image-item">-->
  14. <!-- <div class="cover-image video" >-->
  15. <!-- <div class="colleges-imgs-mask">-->
  16. <!-- <i class="iconfont icon-bofang" style="font-size: 28px"></i>-->
  17. <!-- </div>-->
  18. <!-- </div>-->
  19. <!-- <p class="mt15 text-overflow-ellipsis f14 lh20">清华大学</p>-->
  20. <!-- </div>-->
  21. <!-- 图片列表-->
  22. <div class="image-wrap" v-if="senceList.length">
  23. <div class="image-item" v-for="item in senceList">
  24. <div v-if="item.type == 1" class="cover-image vr" @click="toVR(item.url)">
  25. <el-image class="cover-image" fit="fill" :src="item.coverUrl" ></el-image>
  26. <p class="mt10 text-overflow-ellipsis f14 lh20">VR校园</p>
  27. <div class="colleges-imgs-mask">
  28. <i class="iconfont icon-vr" style="font-size: 28px"></i>
  29. </div>
  30. </div>
  31. <div v-if="item.type == 3">
  32. <el-image class="cover-image" fit="fill" :src="item.url" :preview-src-list="srcList"></el-image>
  33. <p class="mt10 text-overflow-ellipsis f14 lh20">{{ item.description }}</p>
  34. </div>
  35. </div>
  36. </div>
  37. <evaluation-empty class="mt20" v-else shadow title="暂无数据"></evaluation-empty>
  38. </div>
  39. </template>
  40. <script>
  41. import { universitiesStyle } from '@/api/webApi/career-course'
  42. export default {
  43. props: {
  44. code: {
  45. type: String || Number,
  46. default: ''
  47. }
  48. },
  49. created() {
  50. this.getUniversitiesStyle()
  51. },
  52. data() {
  53. return {
  54. senceList: [],
  55. loading: false
  56. }
  57. },
  58. computed: {
  59. srcList() {
  60. if (!this.senceList.length) return []
  61. return this.senceList.filter(item => {
  62. return item.type == 3
  63. }).map(item => {
  64. return item.url
  65. })
  66. }
  67. },
  68. methods: {
  69. getUniversitiesStyle() {
  70. this.loading = true
  71. universitiesStyle({ code: this.code }).then(res => {
  72. this.senceList = res.data
  73. console.log(res)
  74. })
  75. .finally(_ => {
  76. this.loading = false
  77. })
  78. },
  79. toVR(url) {
  80. window.open(url,"_blank");
  81. }
  82. }
  83. }
  84. </script>
  85. <style scoped lang="scss">
  86. .univerty {
  87. overflow: auto;
  88. }
  89. .image-item {
  90. width: 217px;
  91. cursor: pointer;
  92. margin-right: 28px;
  93. margin-top: 20px;
  94. float: left;
  95. color: #333;
  96. .cover-image {
  97. width: 217px;
  98. height: 120px;
  99. background-repeat: no-repeat;
  100. background-size: 100% 100%;
  101. background-position: 50%;
  102. border-radius: 4px;
  103. position: relative;
  104. cursor: pointer;
  105. }
  106. .image-item:nth-of-type(5n) {
  107. margin-right: 0;
  108. }
  109. .vr {
  110. background-image: url("http://toc.cn-bj.ufileos.com/media/files/20210414/9d02bb82.png");
  111. }
  112. .video {
  113. background-image: url("http://img1.youzy.cn/content/media/thumbs/p00176063.jpeg");
  114. }
  115. .colleges-imgs-mask {
  116. position: absolute;
  117. top: 0;
  118. left: 0;
  119. width: 217px;
  120. height: 120px;
  121. background: rgba(0, 0, 0, .5);
  122. color: #fff;
  123. text-align: center;
  124. line-height: 120px;
  125. border-radius: 4px;
  126. overflow: hidden;
  127. }
  128. &:hover {
  129. color: #42b983;
  130. }
  131. }
  132. </style>