courseDetail.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. <template>
  2. <div class="course-detail">
  3. <Header
  4. :headerBg="headerBg"
  5. :headerBorder="headerBorder"
  6. :userBg="userBg"
  7. :LoginNavIndex="LoginNavIndex"
  8. />
  9. <div class="navBar">
  10. <div class="navBar-left">
  11. <a class="goback" @click="$router.go(-1)"><i class="el-icon-arrow-left"></i>{{previousPage}}</a>
  12. <div class="border"></div>
  13. <p>{{data.navTitle}}</p>
  14. </div>
  15. <div class="navBar-right">
  16. <a @click="handleShare">
  17. <svg-icon icon-class="share-personal" className="icon-share"></svg-icon>
  18. <span>分享</span>
  19. </a>
  20. <a @click="handlelike">
  21. <svg-icon icon-class="like-line" className="icon-like"></svg-icon>
  22. <span>收藏</span>
  23. </a>
  24. </div>
  25. </div>
  26. <div class="main">
  27. <h2>{{data.title}}</h2>
  28. <div class="main-top">
  29. <svg-icon icon-class="headset" className="icon-headset"></svg-icon>
  30. <span class="playsNumber">{{data.playsNumber}}</span>
  31. <span class="progress">已更新{{data.updateLessons}}课时/共{{data.totalLessons}}课时</span>
  32. </div>
  33. <div class="main-center">
  34. <h1>{{data.number+' '+data.lessonTitle}}</h1>
  35. <p class="teacher">主讲教师 {{data.teacher}}</p>
  36. <div class="audioline-box">
  37. <audio-line audioId='course-detail-audio' :mp3="data.lessonCatalog[0].src"></audio-line>
  38. </div>
  39. </div>
  40. <div class="main-bottom">
  41. <div class="main-bottom-left">
  42. <div class="tabs-box">
  43. <a class="info-btn" :class="[infoIndex===0?'active':'']" @click="handleChangeInfo(0)">课节信息</a>
  44. <a class="info-btn" :class="[infoIndex===1?'active':'']" @click="handleChangeInfo(1)">课节资源</a>
  45. </div>
  46. <div class="info-detail" v-html="data.lessonInfo" v-if="infoIndex===0"></div>
  47. <resources-list :data="data.resourcesList" v-if="infoIndex===1"></resources-list>
  48. </div>
  49. <lesson-catalog :data="data.lessonCatalog" class="main-bottom-right"></lesson-catalog>
  50. </div>
  51. </div>
  52. </div>
  53. </template>
  54. <script>
  55. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  56. //例如:import 《组件名称》from ‘《组件路径》';
  57. import Header from "../../components/Header.vue";
  58. import LessonCatalog from "./components/LessonCatalog.vue"
  59. import AudioLine from "@/components/common/AudioLine.vue"
  60. import ResourcesList from "./components/ResourcesList.vue"
  61. export default {
  62. //import引入的组件需要注入到对象中才能使用
  63. components: { Header, LessonCatalog, AudioLine, ResourcesList},
  64. props: [],
  65. data() {
  66. //这里存放数据
  67. return {
  68. config: this.$route.query.headerConfig?decodeURIComponent(this.$route.query.headerConfig):'',
  69. LoginNavIndex: 0,
  70. userBg: 'rgba(0, 0, 0, 0.24)',
  71. headerBorder: '#5C5C5C',
  72. headerBg: '#1F1F1F',
  73. previousPage: '课程详情',
  74. data:{
  75. navTitle:'2023 新高一阅读暑期训练营',
  76. title:'2023 新高一英语素养暑期训练营(基础级)',
  77. playsNumber: '3.2万',
  78. updateLessons: '56',
  79. totalLessons: '120',
  80. number: '1.',
  81. lessonTitle: '第一讲 英语阅读核心素养',
  82. teacher: '王琦',
  83. lessonInfo: '富文本',
  84. lessonCatalog: [
  85. {
  86. number:'1',
  87. title:'课程介绍',
  88. teacher:'王琦',
  89. length:'8分钟',
  90. src:'https://nnpe.utschool.cn/CSFileServer/URL/001/DC2B5164FB8F2351BB51C31CB8CD273020230627093140OIRIMXKQJRYGI0HYQ4JSOMTH1H4QNI1JSOOPCWWB_00103-20211214-17-EDNENNKW.mp3'
  91. },
  92. {
  93. number:'2',
  94. title:'基本阅读技能',
  95. teacher:'王琦',
  96. length:'10分钟'
  97. },
  98. {
  99. number:'3',
  100. title:'高级阅读技能',
  101. teacher:'王琦',
  102. length:'10分钟'
  103. },
  104. {
  105. number:'4',
  106. title:'主题语境·人与自然',
  107. teacher:'王琦',
  108. length:'10分钟'
  109. },
  110. {
  111. number:'5',
  112. title:'课程主题语境·人与自我介绍',
  113. teacher:'王琦',
  114. length:'14分钟'
  115. },
  116. {
  117. number:'6',
  118. title:'主题语境·人与自我',
  119. teacher:'王琦',
  120. length:'10分钟'
  121. },
  122. {
  123. number:'7',
  124. title:'主题语境·人与自我',
  125. teacher:'王琦',
  126. length:'10分钟'
  127. }
  128. ],
  129. resourcesList: [
  130. {
  131. type: 'txt',
  132. name: 'employeelist.txt'
  133. },
  134. {
  135. type: 'mp3',
  136. name: 'employeelist.mp3'
  137. },
  138. {
  139. type: 'jpg',
  140. name: 'employeelist.jpg'
  141. },
  142. {
  143. type: 'mp4',
  144. name: 'employeelist.mp4'
  145. },
  146. {
  147. type: 'zip',
  148. name: 'employeelist.zip'
  149. },
  150. {
  151. type: 'pdf',
  152. name: 'employeelist.pdf'
  153. },
  154. {
  155. type: 'doc',
  156. name: 'employeelist.doc'
  157. },
  158. {
  159. type: 'xlsx',
  160. name: 'employeelist.xlsx'
  161. },
  162. {
  163. type: 'ppt',
  164. name: 'employeelist.ppt'
  165. }
  166. ]
  167. },
  168. infoIndex: 0 // 课节信息tabs
  169. }
  170. },
  171. //计算属性 类似于data概念
  172. computed: {},
  173. //监控data中数据变化
  174. watch: {},
  175. //方法集合
  176. methods: {
  177. // 分享
  178. handleShare(){
  179. },
  180. // 收藏
  181. handlelike(){
  182. },
  183. // 切换infotabs
  184. handleChangeInfo(value){
  185. this.infoIndex = value
  186. }
  187. },
  188. //生命周期 - 创建完成(可以访问当前this实例)
  189. created() {
  190. if(this.config){
  191. let arr = this.config.split('&&&')
  192. this.LoginNavIndex = arr[0] * 1
  193. this.userBg = arr[1] ? arr[1] : 'rgba(0, 0, 0, 0.24)'
  194. this.headerBorder = arr[2] ? arr[2] : '#5C5C5C'
  195. this.headerBg = arr[3] ? arr[3] : '#1F1F1F'
  196. }
  197. },
  198. //生命周期 - 挂载完成(可以访问DOM元素)
  199. mounted() {
  200. },
  201. //生命周期-创建之前
  202. beforeCreated() { },
  203. //生命周期-挂载之前
  204. beforeMount() { },
  205. //生命周期-更新之前
  206. beforUpdate() { },
  207. //生命周期-更新之后
  208. updated() { },
  209. //生命周期-销毁之前
  210. beforeDestory() { },
  211. //生命周期-销毁完成
  212. destoryed() { },
  213. //如果页面有keep-alive缓存功能,这个函数会触发
  214. activated() { }
  215. }
  216. </script>
  217. <style lang="scss" scoped>
  218. /* @import url(); 引入css类 */
  219. .course-detail {
  220. background: #fff;
  221. min-height: 100%;
  222. .main{
  223. width: 1200px;
  224. margin: 0 auto;
  225. padding: 105px 0;
  226. h2{
  227. font-weight: 400;
  228. font-size: 20px;
  229. line-height: 28px;
  230. color: #2F3742;
  231. margin: 0 0 10px 0;
  232. }
  233. &-top{
  234. margin-bottom: 24px;
  235. color: #929CA8;
  236. font-weight: 400;
  237. font-size: 14px;
  238. line-height: 22px;
  239. .playsNumber{
  240. margin: 0 24px 0 4px;
  241. }
  242. }
  243. &-center{
  244. background: #F7F8FA;
  245. border-radius: 8px;
  246. padding: 24px;
  247. h1{
  248. font-weight: 600;
  249. font-size: 24px;
  250. line-height: 32px;
  251. color: #1F2C5C;
  252. margin: 0;
  253. }
  254. .teacher{
  255. margin: 16px 0;
  256. color: #929CA8;
  257. font-weight: 400;
  258. font-size: 16px;
  259. line-height: 24px;
  260. }
  261. .audioline-box{
  262. border: 1px solid #EBEBEB;
  263. border-radius: 30px;
  264. background: #FFFFFF;
  265. height: 64px;
  266. display: flex;
  267. align-items: center;
  268. padding: 16px 24px;
  269. }
  270. }
  271. &-bottom{
  272. margin-top: 23px;
  273. display: flex;
  274. &-left{
  275. width: 808px;
  276. margin-right: 33px;
  277. padding-bottom: 48px;
  278. .tabs-box{
  279. display: flex;
  280. width: 100%;
  281. }
  282. .info-btn{
  283. background: #fff;
  284. border-radius: 16px;
  285. width: 88px;
  286. height: 32px;
  287. display: flex;
  288. align-items: center;
  289. justify-content: center;
  290. font-weight: 500;
  291. font-size: 14px;
  292. line-height: 22px;
  293. color: #4E5969;
  294. margin-right: 16px;
  295. &:hover{
  296. background: #F2F3F5;
  297. }
  298. &.active{
  299. color: #165DFF;
  300. background: #F2F3F5;
  301. }
  302. }
  303. .info-detail{
  304. background: #F7F8FA;
  305. border: 1px solid #F2F3F5;
  306. border-radius: 4px;
  307. padding: 40px;
  308. margin-top: 16px;
  309. height: 100%;
  310. }
  311. }
  312. &-right{
  313. width: 355px;
  314. }
  315. }
  316. }
  317. }
  318. </style>