ProfessionalIntroductionIndex.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <!--
  2. * @Description: 专业详情
  3. * @Author: 空白格
  4. * @Date: 2022-08-29 10:13:44
  5. * @LastEditors: 空白格
  6. * @LastEditTime: 2022-08-29 14:38:54
  7. * @FilePath: \veterans_client_web\src\views\EducationPromote\ProfessionalIntroduction\ProfessionalIntroductionIndex.vue
  8. * @Copyright: Copyright (c) 2016~2022 by 空白格, All Rights Reserved.
  9. -->
  10. <template>
  11. <div>
  12. <div class="topBox">
  13. <div class="_center">
  14. <div class="package">
  15. <div class="tit-img">
  16. <img :src="skillDetail.img" alt />
  17. </div>
  18. <div class="right-top">
  19. <div class="title-right">
  20. <!-- <span class="tags">检验</span> -->
  21. <span class="tag-title">{{ skillDetail.name }}</span>
  22. </div>
  23. <div class="introduce">
  24. <p>
  25. <span style="margin-right: 6px">难度</span>
  26. <el-rate v-model="skillDetail.difficult" disabled></el-rate>
  27. </p>
  28. <p>学习时间:{{ skillDetail.cycle }}个月</p>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. <div class="selected-box">
  35. <div class="_center">
  36. <div class="selected-center">
  37. <div class="selected-title">
  38. <h3>精选课程</h3>
  39. <span @click="more">更多></span>
  40. </div>
  41. <div class="swpier-box" v-if="skillDetail.courseList && skillDetail.courseList.length > 0">
  42. <swiper :options="swiperOption">
  43. <swiper-slide v-for="(img, index) in skillDetail.courseList" :key="index">
  44. <div class="news-box" @click="skillClick(img)">
  45. <img :src="img.img" alt />
  46. <div class="video"></div>
  47. <p class="title">{{ img.name }}</p>
  48. <!-- <p class="state">线上课程</p> -->
  49. </div>
  50. </swiper-slide>
  51. </swiper>
  52. <div class="swiper-button-prev" slot="button-prev"></div>
  53. <div class="swiper-button-next" slot="button-next"></div>
  54. </div>
  55. <div v-else class="swpier-box">
  56. <el-empty description="暂无课程"></el-empty>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="skill-box">
  62. <div class="_center">
  63. <div class="skill-center">
  64. <h2>技能详解</h2>
  65. <div v-html="skillDetail.description"></div>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </template>
  71. <script>
  72. import { getDetailBySchool } from '@/api/EducationPromote/index';
  73. export default {
  74. name: 'SkillPackageIndex',
  75. data() {
  76. return {
  77. newsId: this.$route.query.id,
  78. schoolName: this.$route.query.schoolName,
  79. train: 3,
  80. itemList: [
  81. {
  82. img: require('@/assets/images/selected.png')
  83. },
  84. {
  85. img: require('@/assets/images/selected.png')
  86. },
  87. {
  88. img: require('@/assets/images/selected.png')
  89. },
  90. {
  91. img: require('@/assets/images/selected.png')
  92. }
  93. ],
  94. swiperOption: {
  95. slidesPerView: 4,
  96. // 设置前进后退按钮
  97. navigation: {
  98. nextEl: '.swiper-button-next',
  99. prevEl: '.swiper-button-prev'
  100. },
  101. // 设置自动轮播
  102. autoplay: {
  103. delay: 2000 // 5秒切换一次
  104. }
  105. // 设置轮播可循环
  106. // loop: true
  107. },
  108. skillDetail: {}
  109. };
  110. },
  111. created() {
  112. this.getSkillDetail();
  113. },
  114. methods: {
  115. getSkillDetail() {
  116. getDetailBySchool(this.newsId).then((res) => {
  117. this.skillDetail = res.data;
  118. });
  119. },
  120. more() {
  121. this.$router.push({
  122. path: '/educationpromote/courses',
  123. query: {
  124. id: this.newsId
  125. }
  126. });
  127. },
  128. /**
  129. * 点击课程
  130. * @date 2022-08-29
  131. * @param {any} item
  132. * @returns {any}
  133. */
  134. skillClick(item) {
  135. this.$router.push({
  136. path: '/educationpromote/video',
  137. query: {
  138. id: item.id
  139. }
  140. });
  141. }
  142. }
  143. };
  144. </script>
  145. <style lang="scss" scoped>
  146. .news-box {
  147. width: 280px;
  148. height: 174px;
  149. // overflow: hidden;
  150. position: relative;
  151. display: inline-block;
  152. p {
  153. list-style: 30px;
  154. }
  155. .news-box {
  156. font-size: 20px;
  157. color: #2e2e2e;
  158. }
  159. .state {
  160. font-size: 14px;
  161. color: #818181;
  162. }
  163. }
  164. .news-box img {
  165. cursor: pointer;
  166. width: 100%;
  167. height: 100%;
  168. }
  169. .news-box img::after {
  170. width: 70px;
  171. height: 70px;
  172. background-image: url('@/assets/images/shipin.png');
  173. background-size: 70px 70px;
  174. position: absolute;
  175. top: 25%;
  176. left: 35%;
  177. }
  178. .video {
  179. width: 70px;
  180. height: 70px;
  181. background-image: url('@/assets/images/shipin.png');
  182. background-size: 70px 70px;
  183. position: absolute;
  184. top: 25%;
  185. left: 35%;
  186. }
  187. .title {
  188. color: #2e2e2e;
  189. margin-top: 10px;
  190. font-size: 14px;
  191. }
  192. .topBox {
  193. background-color: #43565f;
  194. width: 100%;
  195. padding-bottom: 40px;
  196. }
  197. ._center {
  198. width: 70%;
  199. min-width: 70%;
  200. margin: 0 auto;
  201. }
  202. .package {
  203. display: flex;
  204. padding-top: 35px;
  205. justify-content: left;
  206. .tit-img {
  207. width: 266px;
  208. height: 266px;
  209. border: 1px #ccc dashed;
  210. img {
  211. width: 100%;
  212. height: 100%;
  213. object-fit: fill;
  214. }
  215. }
  216. .right-top {
  217. margin-left: 30px;
  218. color: #fff;
  219. .title-right {
  220. margin-bottom: 14px;
  221. .tags {
  222. width: 64px;
  223. height: 28px;
  224. font-size: 18px;
  225. background-image: linear-gradient(153deg, #f89e42 0%, #ff7833 97%);
  226. border-radius: 14px;
  227. display: inline-block;
  228. text-align: center;
  229. line-height: 28px;
  230. }
  231. .tag-title {
  232. font-size: 26px;
  233. margin-left: 10px;
  234. }
  235. }
  236. .introduce {
  237. display: flex;
  238. flex-direction: column;
  239. p {
  240. line-height: 30px;
  241. height: 30px;
  242. display: flex;
  243. justify-content: left;
  244. align-items: center;
  245. }
  246. }
  247. .tag-btn {
  248. padding: 10px 0;
  249. .tag-state {
  250. width: 320px;
  251. height: 36px;
  252. border: 2px solid #ffffff;
  253. border-radius: 39px;
  254. text-align: center;
  255. line-height: 36px;
  256. display: inline-block;
  257. }
  258. }
  259. }
  260. }
  261. .selected-box,
  262. .skill-box {
  263. margin-top: 20px;
  264. }
  265. .skill-box {
  266. padding-bottom: 40px;
  267. }
  268. .selected-center,
  269. .skill-center {
  270. background-color: #ffffff;
  271. padding: 20px;
  272. }
  273. .selected-title {
  274. display: flex;
  275. justify-content: space-between;
  276. align-items: flex-end;
  277. height: 40px;
  278. margin-bottom: 20px;
  279. h3 {
  280. color: #222222;
  281. font-size: 26px;
  282. }
  283. span {
  284. color: #a3a3a3;
  285. font-size: 14px;
  286. cursor: pointer;
  287. }
  288. }
  289. ::v-deep .swiper-container {
  290. width: 91%;
  291. }
  292. .swpier-box {
  293. position: relative;
  294. .swiper-button-prev {
  295. width: 30px;
  296. height: 174px;
  297. top: 12%;
  298. background: #f3f3f3;
  299. }
  300. .swiper-button-next {
  301. width: 30px;
  302. height: 174px;
  303. top: 12%;
  304. background: #f3f3f3;
  305. }
  306. .swiper-button-prev:after,
  307. .swiper-button-next:after {
  308. font-size: 30px;
  309. color: #dedede;
  310. }
  311. }
  312. </style>