CourseDetail.vue 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373
  1. <template>
  2. <!-- 课程详情 -->
  3. <div class="CourseDetail" v-if="CourseData">
  4. <div class="nav">
  5. <!-- 登录导航 -->
  6. <Header />
  7. <div class="shade"></div>
  8. </div>
  9. <HeaderOne text="123" :name="CourseData.name" title="教学" />
  10. <div class="main" v-if="CourseData" v-loading="loading">
  11. <div class="bookDetail">
  12. <div class="rightUp">
  13. <span>HOT</span>
  14. </div>
  15. <div class="text">
  16. <p class="p1">{{ CourseData.name }}</p>
  17. <p>Beijing language and Culture University</p>
  18. <p>{{ CourseData.teacher_list[0].teacher_name }}</p>
  19. <p>
  20. <!-- Learn to design data models, build data warehouses and data lakes,
  21. automate data pipelines, and work with massive datasets. At the end
  22. of the program, you’ll combine your new skills by completing a
  23. capstone project. -->
  24. {{ CourseData.intro }}
  25. </p>
  26. <p>
  27. <span> {{ CourseData.begin_date }} </span>
  28. <span>-</span>
  29. <span> {{ CourseData.end_date }} </span>
  30. </p>
  31. <div class="operation">
  32. <!-- <div class="countdown" v-if="backTime">
  33. <p>距离关闭购买渠道还有</p>
  34. <div class="time">
  35. <div>
  36. <p>{{ backTime.days }}</p>
  37. <p>天</p>
  38. </div>
  39. <div>
  40. <p>{{ backTime.hours }}</p>
  41. <p>小时</p>
  42. </div>
  43. <div>
  44. <p>{{ backTime.minutes }}</p>
  45. <p>分钟</p>
  46. </div>
  47. <div>
  48. <p>{{ backTime.seconds }}</p>
  49. <p>秒</p>
  50. </div>
  51. </div>
  52. </div>
  53. <div v-else>The purchase channel has been closed</div>-->
  54. <div>
  55. <span class="price">
  56. $
  57. <span
  58. class="price_1"
  59. v-text="changePrice('1', CourseData.price)"
  60. ></span>
  61. <span
  62. class="price_2"
  63. v-text="changePrice('2', CourseData.price)"
  64. ></span>
  65. </span>
  66. <button @click="getPurchase" v-if="!IsPurchase" class="get">
  67. 获取课程
  68. </button>
  69. <button @click="getPurchase" v-else class="acquired">
  70. ACQUIRED
  71. </button>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <div class="more">
  77. <div class="moreTitle">教学材料</div>
  78. <div class="moreList">
  79. <div
  80. class="moreOne"
  81. v-for="(item, i) in CourseData.book_list"
  82. :key="i"
  83. >
  84. <div>
  85. <img :src="item.book_picture_url" alt="" />
  86. </div>
  87. <div class="text">
  88. <p class="p1">{{ item.book_name }}</p>
  89. <p>{{ item.book_org_name }}</p>
  90. <p>{{ item.book_author }}</p>
  91. <div class="operation">
  92. <span class="price">
  93. $
  94. <span
  95. class="price_1"
  96. v-text="changePrice('1', item.book_price)"
  97. ></span>
  98. <span
  99. class="price_2"
  100. v-text="changePrice('2', item.book_price)"
  101. ></span>
  102. </span>
  103. <button v-if="!IsPurchase" class="get">购买</button>
  104. <button v-else class="acquired">ACQUIRED</button>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. <div class="more">
  111. <div class="moreTitle">老师</div>
  112. <div class="moreList teacherList">
  113. <div
  114. class="moreOne"
  115. v-for="(item, i) in CourseData.teacher_list"
  116. :key="i"
  117. >
  118. <div>
  119. <img :src="item.teacher_image_url" alt="" />
  120. </div>
  121. <div class="text">
  122. <p class="p1">{{ item.teacher_name }}</p>
  123. <p>{{ item.teacher_org_name }}</p>
  124. <p>
  125. 拌铍痹柔宫搏疲执胰逊持侨懈赫蜘秩锥畴陵黑阎停拢狂员棕鸟今纪秘也害棍亩疫潜,荫畜凉劈押望鹏艇从地赏果汛*隔微颊剪法震占
  126. </p>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. <div class="coursearrangement">
  132. <div class="moreTitle">课程安排</div>
  133. <div
  134. class="angement"
  135. v-for="(item, i) in CourseData.cs_item_list"
  136. :key="i"
  137. >
  138. <div class="courseOne">
  139. <div class="title">
  140. <div>
  141. <span>{{ i + 1 }}.</span>
  142. <span>{{ item.name }}</span>
  143. </div>
  144. <div style="color: #737373">
  145. {{ item.begin_time }} ~ {{ item.end_time }}
  146. </div>
  147. </div>
  148. </div>
  149. <div class="content" style="width: 670px">
  150. <el-collapse @change="handleChange">
  151. <el-collapse-item :name="item.id">
  152. <div slot="title" class="Coursetasks">
  153. 课程任务
  154. <img
  155. v-show="openList.indexOf(item.id) != -1"
  156. class="open1"
  157. src="../../assets/learncenter/open1.png"
  158. alt=""
  159. />
  160. <img
  161. v-show="openList.indexOf(item.id) == -1"
  162. class="open2"
  163. src="../../assets/learncenter/open2.png"
  164. alt=""
  165. />
  166. </div>
  167. <div class="courseContent">
  168. <div class="tasks">
  169. <div class="title">
  170. <span></span>
  171. 课前任务
  172. </div>
  173. <div class="content">
  174. <el-collapse-item
  175. :name="it.id"
  176. v-for="(it, it_i) in item.pre_task_list"
  177. :key="it_i"
  178. >
  179. <div
  180. slot="title"
  181. :class="
  182. openList.indexOf(it.id) != -1
  183. ? 'contenttitle2'
  184. : 'contenttitle'
  185. "
  186. >
  187. <span>{{ it.name }}</span>
  188. <span>
  189. <span>
  190. <img
  191. src="../../assets/learncenter/people.png"
  192. alt=""
  193. />
  194. 姓名</span
  195. >
  196. <span
  197. v-text="changeitTime(it.begin_time, it.end_time)"
  198. class="gray"
  199. >{{ it.begin_time }} ~ {{ it.end_time }}</span
  200. >
  201. <span class="gray">···</span>
  202. </span>
  203. </div>
  204. <div class="detail">
  205. <div>
  206. <span>说明</span>
  207. <p>
  208. {{ it.content }}
  209. </p>
  210. </div>
  211. <div v-if="it.courseware_list.length > 0">
  212. <span>课件</span>
  213. <div>
  214. <div
  215. class="btn"
  216. v-for="(
  217. courseware, courseware_i
  218. ) in it.courseware_list"
  219. :key="courseware_i"
  220. >
  221. <img
  222. src="../../assets/learncenter/file.png"
  223. alt=""
  224. />
  225. <span> {{ courseware.courseware_name }} </span>
  226. </div>
  227. </div>
  228. </div>
  229. <div v-if="it.accessory_list.length > 0">
  230. <span>附件</span>
  231. <div>
  232. <div
  233. class="btn"
  234. v-for="(
  235. accessory, accessory_i
  236. ) in it.accessory_list"
  237. :key="accessory_i"
  238. >
  239. <img
  240. src="../../assets/learncenter/fileType1.png"
  241. alt=""
  242. />
  243. <span> {{ accessory.file_name }} </span>
  244. </div>
  245. </div>
  246. </div>
  247. </div>
  248. </el-collapse-item>
  249. <!-- <el-collapse-item style="margin-top: 16px" name="1-2">
  250. <div
  251. slot="title"
  252. :class="
  253. openList.indexOf('1-2') != -1
  254. ? 'contenttitle2'
  255. : 'contenttitle'
  256. "
  257. >
  258. <span>阅读</span>
  259. <span>
  260. <span>
  261. <img
  262. src="../../assets/learncenter/people.png"
  263. alt=""
  264. />
  265. 姓名</span
  266. >
  267. <span class="gray">08-21 06:00 ~ 11:00</span>
  268. <span class="gray">···</span>
  269. </span>
  270. </div>
  271. <div class="detail">
  272. <div>
  273. <span>说明</span>
  274. <p>
  275. You need to complete the online courseware task.
  276. Choose one of the attached articles to read aloud
  277. and record it and upload it.
  278. </p>
  279. </div>
  280. <div>
  281. <span>课件</span>
  282. <div>
  283. <div class="btn">
  284. <img
  285. src="../../assets/learncenter/file.png"
  286. alt=""
  287. />
  288. <span> say the Chinese number </span>
  289. </div>
  290. <div class="btn">
  291. <img
  292. src="../../assets/learncenter/file.png"
  293. alt=""
  294. />
  295. <span> say the Chinese number </span>
  296. </div>
  297. </div>
  298. </div>
  299. <div>
  300. <span>课件</span>
  301. <div>
  302. <div class="btn">
  303. <img
  304. src="../../assets/learncenter/fileType1.png"
  305. alt=""
  306. />
  307. <span> The first class.doc </span>
  308. </div>
  309. </div>
  310. </div>
  311. </div>
  312. </el-collapse-item> -->
  313. </div>
  314. </div>
  315. <div class="tasks">
  316. <div class="title">
  317. <span></span>
  318. 课中任务
  319. </div>
  320. <div class="content">
  321. <el-collapse-item
  322. :name="it.id"
  323. v-for="(it, it_i) in item.mid_task_list"
  324. :key="it_i"
  325. >
  326. <div
  327. slot="title"
  328. :class="
  329. openList.indexOf(it.id) != -1
  330. ? 'contenttitle2'
  331. : 'contenttitle'
  332. "
  333. >
  334. <span>{{ it.name }}</span>
  335. <span>
  336. <span>
  337. <img
  338. src="../../assets/learncenter/people.png"
  339. alt=""
  340. />
  341. 姓名</span
  342. >
  343. <span
  344. v-text="changeitTime(it.begin_time, it.end_time)"
  345. class="gray"
  346. >{{ it.begin_time }} ~ {{ it.end_time }}</span
  347. >
  348. <span class="gray">···</span>
  349. </span>
  350. </div>
  351. <div class="detail">
  352. <div>
  353. <span>说明</span>
  354. <p>
  355. {{ it.content }}
  356. </p>
  357. </div>
  358. <div v-if="it.courseware_list.length > 0">
  359. <span>课件</span>
  360. <div>
  361. <div
  362. class="btn"
  363. v-for="(
  364. courseware, courseware_i
  365. ) in it.courseware_list"
  366. :key="courseware_i"
  367. >
  368. <img
  369. src="../../assets/learncenter/file.png"
  370. alt=""
  371. />
  372. <span> {{ courseware.courseware_name }} </span>
  373. </div>
  374. </div>
  375. </div>
  376. <div v-if="it.accessory_list.length > 0">
  377. <span>附件</span>
  378. <div>
  379. <div
  380. class="btn"
  381. v-for="(
  382. accessory, accessory_i
  383. ) in it.accessory_list"
  384. :key="accessory_i"
  385. >
  386. <img
  387. src="../../assets/learncenter/fileType1.png"
  388. alt=""
  389. />
  390. <span> {{ accessory.file_name }} </span>
  391. </div>
  392. </div>
  393. </div>
  394. </div>
  395. </el-collapse-item>
  396. <!-- <el-collapse-item style="margin-top: 16px" name="1-4">
  397. <div
  398. slot="title"
  399. :class="
  400. openList.indexOf('1-4') != -1
  401. ? 'contenttitle2'
  402. : 'contenttitle'
  403. "
  404. >
  405. <span>阅读</span>
  406. <span>
  407. <span>
  408. <img
  409. src="../../assets/learncenter/people.png"
  410. alt=""
  411. />
  412. 姓名</span
  413. >
  414. <span class="gray">08-21 06:00 ~ 11:00</span>
  415. <span class="gray">···</span>
  416. </span>
  417. </div>
  418. <div class="detail">
  419. <div>
  420. <span>说明</span>
  421. <p>
  422. You need to complete the online courseware task.
  423. Choose one of the attached articles to read aloud
  424. and record it and upload it.
  425. </p>
  426. </div>
  427. <div>
  428. <span>课件</span>
  429. <div>
  430. <div class="btn">
  431. <img
  432. src="../../assets/learncenter/file.png"
  433. alt=""
  434. />
  435. <span> say the Chinese number </span>
  436. </div>
  437. <div class="btn">
  438. <img
  439. src="../../assets/learncenter/file.png"
  440. alt=""
  441. />
  442. <span> say the Chinese number </span>
  443. </div>
  444. </div>
  445. </div>
  446. <div>
  447. <span>课件</span>
  448. <div>
  449. <div class="btn">
  450. <img
  451. src="../../assets/learncenter/fileType1.png"
  452. alt=""
  453. />
  454. <span> The first class.doc </span>
  455. </div>
  456. </div>
  457. </div>
  458. </div>
  459. </el-collapse-item> -->
  460. </div>
  461. </div>
  462. <div class="tasks" v-if="item.after_task_list.length > 0">
  463. <div class="title">
  464. <span></span>
  465. 课后任务
  466. </div>
  467. <div class="content">
  468. <el-collapse-item
  469. :name="it.id"
  470. v-for="(it, it_i) in item.after_task_list"
  471. :key="it_i"
  472. >
  473. <div
  474. slot="title"
  475. :class="
  476. openList.indexOf(it.id) != -1
  477. ? 'contenttitle2'
  478. : 'contenttitle'
  479. "
  480. >
  481. <span>{{ it.name }}</span>
  482. <span>
  483. <span>
  484. <img
  485. src="../../assets/learncenter/people.png"
  486. alt=""
  487. />
  488. 姓名</span
  489. >
  490. <span
  491. v-text="changeitTime(it.begin_time, it.end_time)"
  492. class="gray"
  493. >{{ it.begin_time }} ~ {{ it.end_time }}</span
  494. >
  495. <span class="gray">···</span>
  496. </span>
  497. </div>
  498. <div class="detail">
  499. <div>
  500. <span>说明</span>
  501. <p>
  502. {{ it.content }}
  503. </p>
  504. </div>
  505. <div v-if="it.courseware_list.length > 0">
  506. <span>课件</span>
  507. <div>
  508. <div
  509. class="btn"
  510. v-for="(
  511. courseware, courseware_i
  512. ) in it.courseware_list"
  513. :key="courseware_i"
  514. >
  515. <img
  516. src="../../assets/learncenter/file.png"
  517. alt=""
  518. />
  519. <span> {{ courseware.courseware_name }} </span>
  520. </div>
  521. </div>
  522. </div>
  523. <div v-if="it.accessory_list.length > 0">
  524. <span>附件</span>
  525. <div>
  526. <div
  527. class="btn"
  528. v-for="(
  529. accessory, courseware_i
  530. ) in it.accessory_list"
  531. :key="courseware_i"
  532. >
  533. <img
  534. src="../../assets/learncenter/fileType1.png"
  535. alt=""
  536. />
  537. <span> {{ accessory.file_name }} </span>
  538. </div>
  539. </div>
  540. </div>
  541. </div>
  542. </el-collapse-item>
  543. <!-- <el-collapse-item style="margin-top: 16px" name="1-6">
  544. <div
  545. slot="title"
  546. :class="
  547. openList.indexOf('1-6') != -1
  548. ? 'contenttitle2'
  549. : 'contenttitle'
  550. "
  551. >
  552. <span>阅读</span>
  553. <span>
  554. <span>
  555. <img
  556. src="../../assets/learncenter/people.png"
  557. alt=""
  558. />
  559. 姓名</span
  560. >
  561. <span class="gray">08-21 06:00 ~ 11:00</span>
  562. <span class="gray">···</span>
  563. </span>
  564. </div>
  565. <div class="detail">
  566. <div>
  567. <span>说明</span>
  568. <p>
  569. You need to complete the online courseware task.
  570. Choose one of the attached articles to read aloud
  571. and record it and upload it.
  572. </p>
  573. </div>
  574. <div>
  575. <span>课件</span>
  576. <div>
  577. <div class="btn">
  578. <img
  579. src="../../assets/learncenter/file.png"
  580. alt=""
  581. />
  582. <span> say the Chinese number </span>
  583. </div>
  584. <div class="btn">
  585. <img
  586. src="../../assets/learncenter/file.png"
  587. alt=""
  588. />
  589. <span> say the Chinese number </span>
  590. </div>
  591. </div>
  592. </div>
  593. <div>
  594. <span>课件</span>
  595. <div>
  596. <div class="btn">
  597. <img
  598. src="../../assets/learncenter/fileType1.png"
  599. alt=""
  600. />
  601. <span> The first class.doc </span>
  602. </div>
  603. </div>
  604. </div>
  605. </div>
  606. </el-collapse-item> -->
  607. </div>
  608. </div>
  609. </div>
  610. </el-collapse-item>
  611. </el-collapse>
  612. </div>
  613. </div>
  614. </div>
  615. <el-dialog
  616. class="orderDialog"
  617. title="商品详情"
  618. :visible.sync="auditShow"
  619. width="720px"
  620. :before-close="closeaudit"
  621. >
  622. <Audit :data="data" :goods_type="201" />
  623. </el-dialog>
  624. </div>
  625. </div>
  626. </template>
  627. <script>
  628. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  629. //例如:import 《组件名称》from ‘《组件路径》';
  630. import Header from "@/components/Header";
  631. import HeaderOne from "@/components/learnCenter/HeaderOne";
  632. import Audit from "@/components/payment/Audit";
  633. import { cousrseAPI, LearnWebSI } from "@/api/api";
  634. export default {
  635. //import引入的组件需要注入到对象中才能使用
  636. components: {
  637. Header,
  638. HeaderOne,
  639. Audit,
  640. },
  641. props: {},
  642. data() {
  643. //这里存放数据
  644. return {
  645. enshrine: false,
  646. IsPurchase: false,
  647. SelectShow: "1", //选择展示课程资源还是下载
  648. courseRW: null,
  649. openList: [],
  650. timer: null, // 获取倒计时
  651. backTime: new Date(),
  652. CouserId: null,
  653. auditShow: false,
  654. loading: false,
  655. data: {
  656. articleId: "2",
  657. coverFileId: "00101-20210705-17-RBB2NLXL",
  658. coverUrl:
  659. "http://gcls.helxsoft.cn/GCLSFileStore/00101/D-WFXZJCY3AK1XES1JUR/F-EN7NXT1LSO6XZEZZLK.png",
  660. createTime: "2021-07-05 17:36:55",
  661. id: 2,
  662. isFavorite: false,
  663. isPurchased: false,
  664. name: "录播课程1",
  665. price: "19.9",
  666. status: 4,
  667. tag: [""],
  668. teacher: "王老师",
  669. tenantId: "2021052017-HFTZIRVKWOWPAUU",
  670. updateTime: "2021-07-05 17:39:42",
  671. userId: "20210702-1013-3JVWVHHRGVUX",
  672. videoDuration: 60,
  673. visitCount: 132,
  674. weight: 1,
  675. },
  676. CourseData: null,
  677. };
  678. },
  679. //计算属性 类似于data概念
  680. computed: {},
  681. //监控data中数据变化
  682. watch: {},
  683. //方法集合
  684. methods: {
  685. // 小节时间处理
  686. changeitTime(beginTime, endTime) {
  687. let arr1 = beginTime.split(" ");
  688. let arr2 = endTime.split(" ");
  689. if (arr1[0] == arr2[0]) {
  690. return arr1[0] + " " + arr1[1] + "~" + arr2[1];
  691. } else {
  692. return arr1[0] + " " + arr1[1] + "~" + arr2[0] + " " + arr2[1];
  693. }
  694. },
  695. // 课程任务的打开和关闭
  696. handleChange(val) {
  697. this.openList = val;
  698. },
  699. // 选择课程资源还是下载
  700. SelectShowEvent(num) {
  701. this.SelectShow = num;
  702. },
  703. // 处理价格
  704. changePrice(type, item) {
  705. if (item) {
  706. item = item + "";
  707. if (item.indexOf(".") != -1) {
  708. if (type == 1) {
  709. return item.split(".")[0];
  710. } else if (type == 2) {
  711. return "." + item.split(".")[1];
  712. }
  713. } else {
  714. if (type == 1) {
  715. return item;
  716. }
  717. }
  718. }
  719. },
  720. // 收藏
  721. enshrineEvent() {
  722. this.enshrine = !this.enshrine;
  723. },
  724. // 购买 需要先加入课程 审核 审核通过之后才能购买课程
  725. getPurchase() {
  726. // 购买通道关闭
  727. // if (!this.backTime) {
  728. // this.$message.warning("购买渠道已关闭");
  729. // return;
  730. // }
  731. this.auditShow = true;
  732. },
  733. closeaudit() {
  734. this.auditShow = false;
  735. },
  736. // 获取当前时间到指定时间的倒计时
  737. getBackTime() {
  738. let targetTime = new Date("2021-7-30 13:00").getTime();
  739. // 目标时间戳 - 当前时间戳 = 倒计时
  740. this.timer = setInterval(() => {
  741. let currentTime = new Date().getTime();
  742. let backTime = targetTime - currentTime;
  743. backTime = this.formatduring(backTime);
  744. this.backTime = backTime;
  745. }, 1000);
  746. },
  747. // 倒计时时间戳转换为 天 小时 分钟 秒
  748. formatduring(mss) {
  749. var days = parseInt(mss / (1000 * 60 * 60 * 24));
  750. var hours = parseInt((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  751. var minutes = parseInt((mss % (1000 * 60 * 60)) / (1000 * 60));
  752. var seconds = parseInt((mss % (1000 * 60)) / 1000);
  753. // 如果到时间了返回false 关闭购买通道 无法购买
  754. if (days <= 0 && hours <= 0 && minutes <= 0 && seconds <= 0) {
  755. return false;
  756. } else {
  757. return {
  758. days,
  759. hours,
  760. minutes,
  761. seconds,
  762. };
  763. }
  764. },
  765. },
  766. //生命周期 - 创建完成(可以访问当前this实例)
  767. created() {
  768. let Mname = "cominfo_query-course_query-GetCourseInfoBox";
  769. this.CouserId = this.$route.query.id;
  770. // 获取课程详情
  771. this.loading = true;
  772. cousrseAPI(Mname, {
  773. id: this.CouserId,
  774. })
  775. .then((res) => {
  776. this.CourseData = res;
  777. this.loading = false;
  778. })
  779. .catch(() => {
  780. this.loading = false;
  781. });
  782. this.getBackTime();
  783. },
  784. //生命周期 - 挂载完成(可以访问DOM元素)
  785. mounted() {},
  786. //生命周期-创建之前
  787. beforeCreated() {},
  788. //生命周期-挂载之前
  789. beforeMount() {},
  790. //生命周期-更新之前
  791. beforUpdate() {},
  792. //生命周期-更新之后
  793. updated() {},
  794. //生命周期-销毁之前
  795. beforeDestory() {
  796. // 清空定时器
  797. clearInterval(this.timer);
  798. this.timer = null;
  799. },
  800. //生命周期-销毁完成
  801. destoryed() {},
  802. //如果页面有keep-alive缓存功能,这个函数会触发
  803. activated() {},
  804. };
  805. </script>
  806. <style lang="scss" scoped>
  807. /* @import url(); 引入css类 */
  808. .CourseDetail {
  809. // height: 100%;
  810. .nav {
  811. background: #ffffff;
  812. background-size: 100% 100%;
  813. height: 64px;
  814. border-bottom-left-radius: 20px;
  815. border-bottom-right-radius: 20px;
  816. position: relative;
  817. .shade {
  818. position: absolute;
  819. top: 0;
  820. width: 100%;
  821. height: 100%;
  822. background: rgba(0, 0, 0, 0.5);
  823. display: flex;
  824. color: #fff;
  825. font-weight: bold;
  826. font-size: 18px;
  827. justify-content: space-around;
  828. align-items: center;
  829. .el-menu-demo {
  830. background: rgba(0, 0, 0, 0);
  831. }
  832. // 取消组件默认的样式
  833. .el-menu.el-menu--horizontal {
  834. border-bottom: none;
  835. li:hover {
  836. background: none;
  837. }
  838. li {
  839. background: none;
  840. }
  841. }
  842. .nav_title {
  843. text-align: left;
  844. }
  845. .seek {
  846. input {
  847. width: 450px;
  848. height: 46px;
  849. background: #979797;
  850. border: none;
  851. outline: none;
  852. color: white;
  853. font-size: 18px;
  854. opacity: 0.5;
  855. }
  856. img {
  857. position: relative;
  858. right: 40px;
  859. top: 8px;
  860. cursor: pointer;
  861. }
  862. }
  863. }
  864. }
  865. .main {
  866. min-height: 100%;
  867. padding-top: 52px;
  868. background: #e5e5e5;
  869. padding-bottom: 20px;
  870. .bookDetail {
  871. width: 1200px;
  872. height: 452px;
  873. margin: 0 auto;
  874. background: url("../../assets/learncenter/Rectangle113.png");
  875. border-radius: 8px;
  876. display: flex;
  877. position: relative;
  878. overflow: hidden;
  879. .rightUp {
  880. margin: 0;
  881. width: 72px;
  882. height: 72px;
  883. background: url("../../assets/learncenter/Rectangle903.png");
  884. position: absolute;
  885. right: 0;
  886. top: 0;
  887. // text-align: right;
  888. span {
  889. display: inline-block;
  890. color: #fff;
  891. transform: rotateZ(45deg);
  892. position: absolute;
  893. left: 30px;
  894. top: 10px;
  895. }
  896. }
  897. > div {
  898. margin-top: 40px;
  899. margin-left: 40px;
  900. }
  901. .text {
  902. width: 1100px;
  903. color: white;
  904. p {
  905. font-size: 16px;
  906. }
  907. .p1 {
  908. font-size: 40px;
  909. margin-top: 16px;
  910. }
  911. > :not(.p1) {
  912. margin-top: 20px;
  913. }
  914. .price {
  915. font-size: 24px;
  916. .price_2 {
  917. font-size: 16px;
  918. }
  919. }
  920. .operation {
  921. display: flex;
  922. align-items: flex-end;
  923. justify-content: space-between;
  924. margin-top: 52px;
  925. .countdown {
  926. > p {
  927. color: rgba(255, 255, 255, 0.7);
  928. }
  929. .time {
  930. margin-top: 16px;
  931. display: flex;
  932. div {
  933. width: 48px;
  934. margin-right: 48px;
  935. text-align: center;
  936. p:nth-child(1) {
  937. font-size: 40px;
  938. }
  939. p:nth-child(2) {
  940. margin-top: 5px;
  941. font-size: 24px;
  942. }
  943. }
  944. }
  945. }
  946. }
  947. .get {
  948. width: 200px;
  949. height: 56px;
  950. background: #ff9900;
  951. border-radius: 4px;
  952. border: none;
  953. outline: none;
  954. color: #ffffff;
  955. font-size: 20px;
  956. margin-left: 30px;
  957. cursor: pointer;
  958. }
  959. .acquired {
  960. width: 120px;
  961. height: 40px;
  962. background: #d5d5d5;
  963. border-radius: 4px;
  964. border: none;
  965. outline: none;
  966. color: white;
  967. font-size: 16px;
  968. margin-left: 30px;
  969. cursor: pointer;
  970. }
  971. .enshrine {
  972. margin-left: 30px;
  973. img {
  974. width: 24px;
  975. cursor: pointer;
  976. }
  977. }
  978. }
  979. }
  980. .more {
  981. width: 1200px;
  982. margin: 0 auto;
  983. margin-top: 30px;
  984. .moreTitle {
  985. font-weight: 600;
  986. font-size: 20px;
  987. color: #000000;
  988. }
  989. .moreTitle::before {
  990. content: "|";
  991. background: #ff9900;
  992. color: #ff9900;
  993. margin-right: 16px;
  994. }
  995. .moreList {
  996. width: 1300px;
  997. margin: 0 auto;
  998. // margin-top: 20px;
  999. display: flex;
  1000. flex-wrap: wrap;
  1001. // overflow-y: hidden;
  1002. // overflow-x: scroll;
  1003. .moreOne {
  1004. margin-right: 20px;
  1005. margin-top: 20px;
  1006. width: 598px;
  1007. height: 236px;
  1008. background: #ffffff;
  1009. border-radius: 8px;
  1010. display: flex;
  1011. > div {
  1012. margin-left: 32px;
  1013. margin-top: 32px;
  1014. img {
  1015. width: 120px;
  1016. height: 160px;
  1017. }
  1018. }
  1019. .text {
  1020. width: 390px;
  1021. margin-right: 23px;
  1022. > p:not(.p1) {
  1023. font-size: 16px;
  1024. color: #2c2c2c;
  1025. opacity: 0.7;
  1026. margin-top: 10px;
  1027. }
  1028. .p1 {
  1029. font-weight: 600;
  1030. font-size: 20px;
  1031. color: #2c2c2c;
  1032. }
  1033. .operation {
  1034. margin-top: 10px;
  1035. text-align: right;
  1036. }
  1037. .get {
  1038. width: 120px;
  1039. height: 40px;
  1040. background: #ff9900;
  1041. border-radius: 4px;
  1042. border: none;
  1043. outline: none;
  1044. color: white;
  1045. font-size: 20px;
  1046. margin-left: 30px;
  1047. cursor: pointer;
  1048. }
  1049. .acquired {
  1050. width: 120px;
  1051. height: 40px;
  1052. background: #d5d5d5;
  1053. border-radius: 4px;
  1054. border: none;
  1055. outline: none;
  1056. color: white;
  1057. font-size: 16px;
  1058. margin-left: 30px;
  1059. cursor: pointer;
  1060. }
  1061. .price {
  1062. font-size: 24px;
  1063. .price_2 {
  1064. font-size: 16px;
  1065. }
  1066. }
  1067. }
  1068. }
  1069. }
  1070. .teacherList {
  1071. .moreOne {
  1072. > div {
  1073. img {
  1074. width: 120px;
  1075. height: 120px;
  1076. border-radius: 50%;
  1077. }
  1078. }
  1079. }
  1080. }
  1081. }
  1082. .coursearrangement {
  1083. width: 1200px;
  1084. margin: 0 auto;
  1085. margin-top: 30px;
  1086. .moreTitle {
  1087. font-weight: 600;
  1088. font-size: 20px;
  1089. color: #000000;
  1090. }
  1091. .moreTitle::before {
  1092. content: "|";
  1093. background: #ff9900;
  1094. color: #ff9900;
  1095. margin-right: 16px;
  1096. }
  1097. .angement {
  1098. margin-top: 30px;
  1099. width: 1200px;
  1100. background: #fff;
  1101. padding: 40px 68px 40px 40px;
  1102. font-size: 18px;
  1103. > :not(.courseOne) {
  1104. padding-left: 40px;
  1105. margin-top: 16px;
  1106. }
  1107. .courseOne {
  1108. .title {
  1109. display: flex;
  1110. justify-content: space-between;
  1111. > div:nth-child(1) {
  1112. font-size: 20px;
  1113. font-weight: bold;
  1114. span {
  1115. margin-right: 24px;
  1116. }
  1117. }
  1118. }
  1119. }
  1120. .Coursetasks {
  1121. cursor: pointer;
  1122. display: flex;
  1123. align-items: center;
  1124. font-size: 16px;
  1125. img {
  1126. width: 24px;
  1127. margin-left: 8px;
  1128. }
  1129. }
  1130. .courseContent {
  1131. .tasks {
  1132. padding-left: 10px;
  1133. .title {
  1134. font-size: 16px;
  1135. color: #2c2c2c;
  1136. span {
  1137. display: inline-block;
  1138. width: 8px;
  1139. height: 8px;
  1140. background: #fe6d68;
  1141. border-radius: 50%;
  1142. position: relative;
  1143. right: 3px;
  1144. margin-right: 16px;
  1145. }
  1146. }
  1147. .content {
  1148. border-left: 1px solid #fe6d68;
  1149. padding-left: 20px;
  1150. margin-top: 16px;
  1151. padding-bottom: 10px;
  1152. .contenttitle {
  1153. padding: 0 10px;
  1154. // margin-top: 16px;
  1155. width: 670px;
  1156. // height: 44px;
  1157. background: #ffffff;
  1158. border: 1px solid #e6e6e6;
  1159. box-sizing: border-box;
  1160. border-radius: 8px;
  1161. border-radius: 8px;
  1162. display: flex;
  1163. justify-content: space-between;
  1164. align-items: center;
  1165. font-size: 16px;
  1166. cursor: pointer;
  1167. img {
  1168. width: 16px;
  1169. margin-left: 8px;
  1170. }
  1171. span {
  1172. margin-left: 16px;
  1173. }
  1174. .gray {
  1175. opacity: 0.5;
  1176. }
  1177. }
  1178. .contenttitle2 {
  1179. padding: 0 10px;
  1180. // margin-top: 16px;
  1181. width: 670px;
  1182. // height: 44px;
  1183. background: #f9f9f9;
  1184. border: 1px solid #e6e6e6;
  1185. box-sizing: border-box;
  1186. border-top-left-radius: 8px;
  1187. border-top-right-radius: 8px;
  1188. display: flex;
  1189. justify-content: space-between;
  1190. align-items: center;
  1191. font-size: 16px;
  1192. cursor: pointer;
  1193. img {
  1194. width: 16px;
  1195. margin-left: 8px;
  1196. }
  1197. span {
  1198. margin-left: 16px;
  1199. }
  1200. .gray {
  1201. opacity: 0.5;
  1202. }
  1203. }
  1204. .detail {
  1205. width: 670px;
  1206. background: #ffffff;
  1207. border: 1px solid #e7e7e7;
  1208. box-sizing: border-box;
  1209. border-bottom-left-radius: 8px;
  1210. border-bottom-right-radius: 8px;
  1211. box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.1);
  1212. padding-bottom: 24px;
  1213. > div {
  1214. margin-top: 24px;
  1215. display: flex;
  1216. > :nth-child(1) {
  1217. width: 78px;
  1218. font-size: 16px;
  1219. color: #000000;
  1220. margin-left: 24px;
  1221. }
  1222. > :nth-child(2) {
  1223. margin-left: 16px;
  1224. img {
  1225. width: 24px;
  1226. }
  1227. .btn {
  1228. width: 270px;
  1229. height: 40px;
  1230. background: #ffffff;
  1231. border: 1px solid #dbdbdb;
  1232. box-sizing: border-box;
  1233. border-radius: 4px;
  1234. display: flex;
  1235. align-items: center;
  1236. cursor: pointer;
  1237. img {
  1238. margin-left: 16px;
  1239. margin-right: 8px;
  1240. }
  1241. }
  1242. .btn:not(:nth-child(1)) {
  1243. margin-top: 8px;
  1244. }
  1245. }
  1246. }
  1247. }
  1248. }
  1249. }
  1250. }
  1251. }
  1252. }
  1253. .cutDownOrimg {
  1254. width: 1200px;
  1255. margin: 0 auto;
  1256. margin-top: 24px;
  1257. .sele {
  1258. width: 318px;
  1259. height: 48px;
  1260. background: #ebebeb;
  1261. border-radius: 30px;
  1262. color: #9f9f9f;
  1263. font-size: 20px;
  1264. display: flex;
  1265. align-items: center;
  1266. > div {
  1267. width: 158px;
  1268. height: 48px;
  1269. border-radius: 30px;
  1270. line-height: 48px;
  1271. text-align: center;
  1272. cursor: pointer;
  1273. }
  1274. .select {
  1275. background: #ff9900;
  1276. color: white;
  1277. box-shadow: 0px 2px 8px rgba(255, 153, 0, 0.15);
  1278. }
  1279. }
  1280. }
  1281. .Catalogue {
  1282. margin: 24px auto;
  1283. width: 1200px;
  1284. height: 710px;
  1285. background: #ffffff;
  1286. display: flex;
  1287. .left {
  1288. width: 340px;
  1289. height: 710px;
  1290. border-right: 1px solid #d9d9d9;
  1291. .title {
  1292. width: 80%;
  1293. margin: 29px auto;
  1294. font-weight: 600;
  1295. font-size: 24px;
  1296. color: #000000;
  1297. }
  1298. }
  1299. .right {
  1300. width: 860px;
  1301. height: 710px;
  1302. }
  1303. }
  1304. .Resources {
  1305. margin: 24px auto;
  1306. width: 1200px;
  1307. height: 710px;
  1308. background: #ffffff;
  1309. display: flex;
  1310. div {
  1311. height: 40px;
  1312. margin: 10px;
  1313. border: 1px solid rgba(44, 44, 44, 0.15);
  1314. border-radius: 4px;
  1315. padding: 0 10px;
  1316. margin-left: 10px;
  1317. display: flex;
  1318. justify-content: center;
  1319. align-items: center;
  1320. cursor: pointer;
  1321. img {
  1322. width: 24px;
  1323. margin: 0 10px;
  1324. }
  1325. span {
  1326. width: 182px;
  1327. overflow: hidden;
  1328. text-overflow: ellipsis;
  1329. white-space: nowrap;
  1330. }
  1331. }
  1332. }
  1333. }
  1334. }
  1335. </style>
  1336. <style lang="scss">
  1337. .el-collapse {
  1338. border: none;
  1339. .el-collapse-item__header {
  1340. border: none;
  1341. height: none;
  1342. .l-collapse-item__arrow,
  1343. .el-icon-arrow-right {
  1344. display: none;
  1345. }
  1346. }
  1347. .el-collapse-item__wrap {
  1348. border: none;
  1349. }
  1350. .el-collapse-item__content {
  1351. padding-bottom: 0;
  1352. }
  1353. }
  1354. .orderDialog {
  1355. .el-dialog__header {
  1356. padding: 32px 20px 24px 32px;
  1357. .el-dialog__title {
  1358. line-height: 150%;
  1359. font-size: 20px;
  1360. color: #000;
  1361. }
  1362. }
  1363. .el-dialog__body {
  1364. padding: 0px 32px 32px 32px;
  1365. }
  1366. }
  1367. </style>