TextbookDetail.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249
  1. <template>
  2. <!-- 教材详情 -->
  3. <div class="TextbookDetail" v-if="TextbookData && isData">
  4. <div class="nav">
  5. <!-- 登录导航 -->
  6. <Header />
  7. <div class="shade"></div>
  8. </div>
  9. <!-- 教材详情 744 -->
  10. <HeaderOne text="123" :title="$t('Key744')" name="" />
  11. <template v-if="TextbookData.is_deleted == 'false'">
  12. <template v-if="bookIsBuy == 'true' || TextbookData.publish_status == 1">
  13. <div class="main" v-loading="loading">
  14. <div class="bookDetail" v-if="detailSHow">
  15. <div class="rightUp">
  16. <span>HOT</span>
  17. </div>
  18. <div class="img">
  19. <img :src="TextbookData.picture_url" alt="" />
  20. </div>
  21. <div class="text">
  22. <p class="p1">{{ TextbookData.name }}</p>
  23. <p class="p2">{{ TextbookData.org_name }}</p>
  24. <p class="p2">{{ TextbookData.author }}</p>
  25. <p class="p3">
  26. {{ TextbookData.description }}
  27. </p>
  28. <div class="operation">
  29. <span class="price">
  30. ¥<span
  31. class="price_1"
  32. v-html="changePrice(TextbookData.price, 24, 16)"
  33. ></span>
  34. </span>
  35. <button @click="getPurchase" class="get">
  36. <!-- Key390-去学习 Key72-购买 -->
  37. {{
  38. bookIsBuy == "true" ? this.$t("Key390") : this.$t("Key72")
  39. }}
  40. </button>
  41. <!-- <button class="acquired">
  42. ACQUIRED
  43. </button> -->
  44. <span class="enshrine" @click="enshrineEvent">
  45. <img
  46. v-if="enshrine == 'false'"
  47. src="../assets/textBookDetail/enshrine2.png"
  48. alt=""
  49. />
  50. <img
  51. v-else
  52. src="../assets/textBookDetail/enshrine1.png"
  53. alt=""
  54. />
  55. </span>
  56. </div>
  57. </div>
  58. </div>
  59. <!-- <div class="more" v-if="detailSHow">
  60. <div class="moreTitle">更多推荐</div>
  61. <div class="moreList">
  62. <div class="moreOne">
  63. <div>
  64. <img src="../assets/textBookDetail/Rectangle 905.png" alt="" />
  65. </div>
  66. <div class="text">
  67. <p class="p1">Learn Chinese with Ease-Learn Chinese with Ease</p>
  68. <p>Beijing language and Culture University</p>
  69. <p>Esther Howard</p>
  70. <div class="operation">
  71. <span class="price">
  72. <span
  73. class="price_1"
  74. v-text="changePrice('19.99')"
  75. ></span>
  76. <span
  77. class="price_2"
  78. v-text="changePrice('19.99')"
  79. ></span>
  80. </span>
  81. <button class="get">GET</button>
  82. </div>
  83. </div>
  84. </div>
  85. <div class="moreOne">
  86. <div>
  87. <img src="../assets/textBookDetail/Rectangle 906.png" alt="" />
  88. </div>
  89. <div class="text">
  90. <p class="p1">Learn Chinese with Ease-Learn Chinese with Ease</p>
  91. <p>Beijing language and Culture University</p>
  92. <p>Esther Howard</p>
  93. <div class="operation">
  94. <span class="price">
  95. <span
  96. class="price_1"
  97. v-text="changePrice('19.99')"
  98. ></span>
  99. <span
  100. class="price_2"
  101. v-text="changePrice('19.99')"
  102. ></span>
  103. </span>
  104. <button class="get">GET</button>
  105. </div>
  106. </div>
  107. </div>
  108. <div class="moreOne">
  109. <div>
  110. <img src="../assets/textBookDetail/Rectangle 907.png" alt="" />
  111. </div>
  112. <div class="text">
  113. <p class="p1">Learn Chinese with Ease-Learn Chinese with Ease</p>
  114. <p>Beijing language and Culture University</p>
  115. <p>Esther Howard</p>
  116. <div class="operation">
  117. <span class="price">
  118. <span
  119. class="price_1"
  120. v-text="changePrice('1', '19.99')"
  121. ></span>
  122. <span
  123. class="price_2"
  124. v-text="changePrice('2', '19.99')"
  125. ></span>
  126. </span>
  127. <button class="get">GET</button>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. </div> -->
  133. <div class="cutDownOrimg" v-if="detailSHow">
  134. <div class="sele">
  135. <div
  136. @click="SelectShowEvent('1')"
  137. :class="SelectShow == '1' ? 'select' : ''"
  138. v-if="SelectFirstShow"
  139. >
  140. <!-- 目录 -->{{ $t("Key612") }}
  141. </div>
  142. <!-- 资源 -->
  143. <div
  144. @click="SelectShowEvent('2')"
  145. :class="SelectShow == '1' ? '' : 'select'"
  146. v-if="
  147. fileListVideo.length > 0 ||
  148. fileListAudio.length > 0 ||
  149. fileListOtheraudio.length > 0 ||
  150. fileListDoc.length > 0
  151. "
  152. >
  153. {{ $t("Key613") }}
  154. </div>
  155. </div>
  156. </div>
  157. <div v-if="SelectShow == '1'" class="Catalogue">
  158. <BookView
  159. :bookId="TextBookId"
  160. @bookdetailShow="bookdetailShow"
  161. :bookIsBuy="bookIsBuy"
  162. :bookFontSize="TextbookData.font_size"
  163. ></BookView>
  164. </div>
  165. <div v-else class="Resources">
  166. <!--没有数据-->
  167. <!-- <div>
  168. <img src="../assets/textBookDetail/fileType1.png" alt="" />
  169. <span> 文件名 </span>
  170. <img src="../assets/textBookDetail/upload.png" alt="" />
  171. </div> -->
  172. <div class="resource-content" v-if="fileListVideo.length > 0">
  173. <!-- 视频资源 736 -->
  174. <h2 class="video-title">{{ $t("Key736") }}</h2>
  175. <ul class="video-list">
  176. <li
  177. v-for="(item, index) in fileListVideo"
  178. :key="index"
  179. @click="handleJumpVideo(index)"
  180. >
  181. <div
  182. class="video-img"
  183. :style="{
  184. background:
  185. 'url(' + item.preview_image_file_url + ') no-repeat',
  186. 'background-size': 'cover',
  187. }"
  188. >
  189. <img class="video" />
  190. <img src="../assets/common/play-one.png" class="play-one" />
  191. </div>
  192. <p class="video-name">{{ item.file_name }}</p>
  193. </li>
  194. </ul>
  195. </div>
  196. <div
  197. class="resource-content"
  198. v-if="fileListAudio.length > 0 || fileListOtheraudio.length > 0"
  199. >
  200. <!-- 音频资源737 -->
  201. <h2 class="video-title">{{ $t("Key737") }}</h2>
  202. <div class="audio-content" v-if="fileListAudio.length > 0">
  203. <!-- 课文资源 738 -->
  204. <p class="audio-type">{{ $t("Key738") }}</p>
  205. <div class="audio-line-box">
  206. <AudioLine
  207. :audioId="'fileListAudio'"
  208. :mp3List="fileListAudio"
  209. type="audioLine"
  210. ref="audioLine"
  211. />
  212. </div>
  213. </div>
  214. <div class="audio-content" v-if="fileListOtheraudio.length > 0">
  215. <!-- 自学音频 739 -->
  216. <p class="audio-type">{{ $t("Key739") }}</p>
  217. <div class="audio-line-box">
  218. <AudioLine
  219. :audioId="'fileListOtheraudio'"
  220. :mp3List="fileListOtheraudio"
  221. type="audioLine"
  222. ref="audioLine"
  223. />
  224. </div>
  225. </div>
  226. <div class="audio-content">
  227. <!-- 资源下载 740 -->
  228. <p class="audio-type">{{ $t("Key740") }}</p>
  229. <div class="download">
  230. <div class="book-open" @click="handleDownloadAudio">
  231. <img
  232. src="../assets/common/download.png"
  233. class="book-open-img"
  234. />
  235. <!-- 音频 -->
  236. <span class="book-open-text">{{ $t("Key400") }}</span>
  237. </div>
  238. <!-- <div class="book-open">
  239. <img
  240. src="../assets/common/download.png"
  241. class="book-open-img"
  242. />
  243. <span class="book-open-text">互动课件</span>
  244. </div> -->
  245. </div>
  246. </div>
  247. </div>
  248. <div class="resource-content" v-if="fileListDoc.length > 0">
  249. <!-- 试读PDF 741 -->
  250. <h2 class="video-title">{{ $t("Key741") }}</h2>
  251. <ul class="PDF-list">
  252. <li
  253. v-for="(item, index) in fileListDoc"
  254. :key="index"
  255. @click="handleJumpPdf(index)"
  256. >
  257. <b>{{ index + 1 }}.</b>
  258. <p class="PDF-name">{{ item.file_name }}</p>
  259. <span>{{ item.fileSize }}</span>
  260. <img
  261. src="../assets/common/download.png"
  262. class="book-open-img"
  263. @click="handleDownload(item.file_id)"
  264. />
  265. </li>
  266. </ul>
  267. </div>
  268. </div>
  269. </div>
  270. </template>
  271. </template>
  272. <template v-if="TextbookData.is_deleted == 'true'">
  273. <div class="noview-msg-box">
  274. <!-- 无法查看,教材已被删除 742 -->
  275. <div class="noview-msg">{{ $t("Key742") }}</div>
  276. </div>
  277. </template>
  278. <template
  279. v-if="
  280. TextbookData.is_deleted == 'false' &&
  281. bookIsBuy == 'false' &&
  282. TextbookData.publish_status == 0
  283. "
  284. >
  285. <div class="noview-msg-box">
  286. <!-- 无法查看,教材已下架 743 -->
  287. <div class="noview-msg">{{ $t("Key743") }}</div>
  288. </div>
  289. </template>
  290. <!-- 商品详情 -->
  291. <el-dialog
  292. class="buyWindow"
  293. :title="$t('Key52')"
  294. :visible.sync="NopymentShow"
  295. width="720px"
  296. :before-close="closeNoPyment"
  297. >
  298. <Confirmorder
  299. :data="TextbookData"
  300. :goods_type="101"
  301. :changeOrderNumber="changeOrderNumber"
  302. ref="Confirmorder"
  303. />
  304. </el-dialog>
  305. <!-- 订单号 -->
  306. <el-dialog
  307. :title="$t('Key472') + ':' + orderNumber"
  308. :visible.sync="PymentShow"
  309. width="720px"
  310. :before-close="closePyment"
  311. >
  312. <Payment
  313. :data="TextbookData"
  314. :orderNumber="orderNumber"
  315. :closePyment="closePyment"
  316. />
  317. </el-dialog>
  318. </div>
  319. </template>
  320. <script>
  321. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  322. //例如:import 《组件名称》from ‘《组件路径》';
  323. import Header from "@/components/inputModules/common/Header";
  324. import HeaderOne from "@/components/inputModules/common/HeaderOne";
  325. import {
  326. TextbookAPI,
  327. LearnWebSI,
  328. getContent,
  329. getContentFile,
  330. } from "@/api/ajax";
  331. import Confirmorder from "@/components/pyment/Confirmorder";
  332. import Payment from "@/components/pyment/Payment";
  333. import BookView from "@/views/bookView"; // 教材预览
  334. import { updateWordPack } from "@/utils/i18n";
  335. import AudioLine from "@/components/inputModules/common/AudioLine";
  336. import { getToken } from "@/utils/auth";
  337. import { Base64 } from "js-base64";
  338. export default {
  339. //import引入的组件需要注入到对象中才能使用
  340. components: {
  341. Header,
  342. HeaderOne,
  343. Confirmorder,
  344. Payment,
  345. BookView,
  346. AudioLine,
  347. },
  348. props: {},
  349. data() {
  350. //这里存放数据
  351. return {
  352. enshrine: "false",
  353. IsPurchase: false,
  354. SelectShow: "1", //选择展示课程资源还是下载
  355. SelectFirstShow: true,
  356. TextBookId: null,
  357. TextbookData: null,
  358. loading: false,
  359. NopymentShow: false, //添加订单弹窗
  360. PymentShow: false, //支付订单弹窗
  361. orderNumber: null, //订单号
  362. IsDownload: false, //是否可以下载
  363. detailSHow: true, // 除教材预览外其他内容是否显示
  364. bookIsBuy: "false", // 教材是否已购买
  365. isData: false,
  366. fileListVideo: [], // 教材资源视频数组
  367. fileListAudio: [], // 教材资源视频数组
  368. fileListOtheraudio: [],
  369. fileListDoc: [], // 教材资源视频数组
  370. };
  371. },
  372. //计算属性 类似于data概念
  373. computed: {},
  374. //监控data中数据变化
  375. watch: {},
  376. //方法集合
  377. methods: {
  378. closeNoPyment() {
  379. this.NopymentShow = false;
  380. this.$refs.Confirmorder.clearData();
  381. },
  382. closePyment(str) {
  383. this.PymentShow = false;
  384. this.$refs.Confirmorder.clearData();
  385. if (str == "支付成功") {
  386. this.getdetail();
  387. }
  388. },
  389. // 生成订单 同时切换到支付弹窗
  390. changeOrderNumber(
  391. val,
  392. back_discount_code,
  393. discount_money,
  394. receivables_money
  395. ) {
  396. this.orderNumber = val;
  397. this.NopymentShow = false;
  398. this.TextbookData.back_discount_code = back_discount_code;
  399. this.TextbookData.discount_money = discount_money;
  400. this.TextbookData.receivables_money = receivables_money;
  401. this.PymentShow = true;
  402. this.isConfirmorder = false;
  403. },
  404. // 选择课程资源还是下载
  405. SelectShowEvent(num) {
  406. this.SelectShow = num;
  407. },
  408. changePrice(price, fontSize1, fontSize2) {
  409. price = price ? price : 0;
  410. price = price.toFixed(2);
  411. price = price.toString();
  412. let arr = price.split(".");
  413. let str = `<span style="font-size: ${fontSize1 ? fontSize1 : 16}px;">${
  414. arr[0]
  415. }</span>.<span style="font-size: ${fontSize2 ? fontSize2 : 16}px;">${
  416. arr[1]
  417. }</span>`;
  418. return str;
  419. },
  420. // 收藏
  421. enshrineEvent() {
  422. // this.enshrine = !this.enshrine;
  423. if (this.enshrine == "false") {
  424. let Mname = "order-collection_manager-AddMyCollection";
  425. let data = {
  426. goods_id: this.TextBookId,
  427. goods_type: 101,
  428. goods_name: this.TextbookData.name,
  429. goods_person_name_desc: this.TextbookData.author,
  430. goods_picture_id: this.TextbookData.picture_id,
  431. goods_price: this.TextbookData.price,
  432. };
  433. LearnWebSI(Mname, data).then((res) => {
  434. this.enshrine = "true";
  435. this.$message.success(this.$t("Key575")); //"收藏成功"
  436. });
  437. } else {
  438. let Mname = "order-collection_manager-CancelMyGoodsCollection";
  439. let data = {
  440. goods_type: 101,
  441. goods_id_list: [this.TextBookId],
  442. };
  443. LearnWebSI(Mname, data).then((res) => {
  444. this.enshrine = "false";
  445. this.$message.success(this.$t("Key396")); //"取消收藏成功"
  446. });
  447. }
  448. },
  449. // 购买
  450. getPurchase() {
  451. if (this.bookIsBuy == "true") {
  452. this.$router.push("/courseview?bookId=" + this.TextBookId);
  453. } else {
  454. this.NopymentShow = true;
  455. }
  456. },
  457. bookdetailShow(flag) {
  458. this.detailSHow = flag;
  459. },
  460. //获取当前书籍是否已购买
  461. handleIsBuy() {
  462. let Mname = "order-order_manager-CheckMyGoodsBuyStatus";
  463. let data = {
  464. goods_type: 101,
  465. goods_id: this.TextBookId,
  466. };
  467. LearnWebSI(Mname, data).then((res) => {
  468. this.bookIsBuy = res.is_buy;
  469. });
  470. },
  471. // 获取当前书籍是否已收藏
  472. handleIsEnshrine() {
  473. let Mname = "order-collection_manager-CheckMyGoodsCollectionStatus";
  474. let data = {
  475. goods_type: 101,
  476. goods_id: this.TextBookId,
  477. };
  478. LearnWebSI(Mname, data).then((res) => {
  479. this.enshrine = res.is_collection;
  480. });
  481. },
  482. getdetail() {
  483. this.loading = true;
  484. this.TextBookId = this.$route.query.goods_id;
  485. let Mname = "book-book_manager-GetBook";
  486. // 获取课程详情
  487. TextbookAPI(Mname, {
  488. id: this.TextBookId,
  489. })
  490. .then((res) => {
  491. this.TextbookData = res;
  492. this.loading = false;
  493. sessionStorage.setItem("Bookdetail", JSON.stringify(res));
  494. })
  495. .catch((res) => {
  496. this.loading = false;
  497. });
  498. this.handleIsBuy();
  499. this.handleIsEnshrine();
  500. this.getBookSource();
  501. this.getBookStructList();
  502. },
  503. // 教材资源
  504. getBookSource() {
  505. let MethodNames = "book-resource_manager-GetBookResourceList";
  506. let datas = {
  507. book_id: this.TextBookId,
  508. };
  509. getContent(MethodNames, datas).then((res) => {
  510. if (res.status == 1) {
  511. this.fileListVideo = res.video_list;
  512. this.fileListAudio = res.audio_list;
  513. this.fileListOtheraudio = res.otheraudio_list;
  514. this.fileListDoc = res.doc_list;
  515. this.fileListDoc.forEach((item) => {
  516. if (item.file_size > 1024 * 1024) {
  517. if (item.file_size / 1024 / 1024 / 1024 > 1) {
  518. item.fileSize =
  519. (item.file_size / 1024 / 1024 / 1024).toFixed(2) + "GB";
  520. } else {
  521. item.fileSize =
  522. (item.file_size / 1024 / 1024).toFixed(2) + "MB";
  523. }
  524. } else {
  525. item.fileSize = (item.file_size / 1024).toFixed(2) + "KB";
  526. }
  527. });
  528. }
  529. });
  530. },
  531. // 章节树
  532. getBookStructList() {
  533. let MethodName = "book-book_manager-GetBookChapterStruct";
  534. let data = {
  535. book_id: this.TextBookId,
  536. };
  537. getContent(MethodName, data).then((res) => {
  538. this.SelectFirstShow = res.nodes ? true : false;
  539. this.SelectShow = res.nodes ? "1" : "2";
  540. });
  541. },
  542. // 打包下载全部音频
  543. handleDownloadAudio() {
  544. let _this = this;
  545. _this.loading = true;
  546. // 拿到当前课的所有文件id
  547. let userInfor = JSON.parse(getToken());
  548. let UserCode = "",
  549. UserType = "",
  550. SessionID = "";
  551. if (userInfor) {
  552. UserCode = userInfor.user_code;
  553. UserType = userInfor.user_type;
  554. SessionID = userInfor.session_id;
  555. }
  556. let FileID = null;
  557. let data = {
  558. SessionID,
  559. UserCode,
  560. UserType,
  561. FileID,
  562. };
  563. let arr = [];
  564. this.fileListAudio.forEach((item) => {
  565. arr.push(item.file_id);
  566. });
  567. this.fileListOtheraudio.forEach((item) => {
  568. arr.push(item.file_id);
  569. });
  570. let MethodName = "file_store_manager-StartCreateFileCompressPack";
  571. getContentFile(MethodName, {
  572. file_id_list: arr,
  573. })
  574. .then((res) => {
  575. let MethodName2 = "file_store_manager-GetFileCompressTaskProgress";
  576. let timer = setInterval(() => {
  577. getContentFile(MethodName2, {
  578. file_compress_task_id: res.file_compress_task_id,
  579. })
  580. .then((res) => {
  581. if (res.is_finish == "true") {
  582. data.FileID = res.compress_pack_file_id;
  583. clearInterval(timer);
  584. timer = null;
  585. location.href =
  586. process.env.VUE_APP_BASE_API +
  587. `/GCLSFileServer/WebFileDownload?UserCode=${data.UserCode}&UserType=${data.UserType}&SessionID=${data.SessionID}&FileID=${data.FileID}`;
  588. _this.loading = false;
  589. }
  590. })
  591. .catch((res) => {
  592. this.loading = false;
  593. });
  594. }, 1000);
  595. })
  596. .catch((res) => {
  597. this.loading = false;
  598. });
  599. },
  600. // 下载单个文件
  601. handleDownload(fileId) {
  602. let userInfor = JSON.parse(getToken());
  603. let UserCode = "",
  604. UserType = "",
  605. SessionID = "";
  606. if (userInfor) {
  607. UserCode = userInfor.user_code;
  608. UserType = userInfor.user_type;
  609. SessionID = userInfor.session_id;
  610. }
  611. let FileID = fileId;
  612. let data = {
  613. SessionID,
  614. UserCode,
  615. UserType,
  616. FileID,
  617. };
  618. location.href =
  619. process.env.VUE_APP_BASE_API +
  620. `/GCLSFileServer/WebFileDownload?UserCode=${data.UserCode}&UserType=${data.UserType}&SessionID=${data.SessionID}&FileID=${data.FileID}`;
  621. },
  622. // 跳转预览PDF
  623. handleJumpPdf(index) {
  624. this.$router.push(
  625. "/TextbookDetailPdf?id=" +
  626. this.TextBookId +
  627. "&url=" +
  628. Base64.encodeURL(this.fileListDoc[index].file_url) +
  629. "&invok_module=" +
  630. this.$route.query.invok_module +
  631. "&fileId=" +
  632. Base64.encodeURL(this.fileListDoc[index].file_id) +
  633. "&relativePath=" +
  634. Base64.encodeURL(this.fileListDoc[index].file_relative_path)
  635. );
  636. },
  637. // 跳转预览视频
  638. handleJumpVideo(index) {
  639. this.$router.push(
  640. "/TextbookDetailVideo?id=" +
  641. this.TextBookId +
  642. "&invok_module=" +
  643. this.$route.query.invok_module +
  644. "&activeIndex=" +
  645. Base64.encodeURL(index)
  646. );
  647. },
  648. },
  649. //生命周期 - 创建完成(可以访问当前this实例)
  650. async created() {
  651. await updateWordPack({
  652. word_key_list: [
  653. "Key9",
  654. "Key38",
  655. "Key39",
  656. "Key52",
  657. "Key53",
  658. "Key54",
  659. "Key55",
  660. "Key72",
  661. "Key94",
  662. "Key108",
  663. "Key109",
  664. "Key116",
  665. "Key390",
  666. "Key396",
  667. "Key400",
  668. "Key472",
  669. "Key473",
  670. "Key474",
  671. "Key475",
  672. "Key575",
  673. "Key612",
  674. "Key613",
  675. "Key744",
  676. "Key736",
  677. "Key737",
  678. "Key738",
  679. "Key739",
  680. "Key740",
  681. "Key741",
  682. "Key742",
  683. "Key743",
  684. ],
  685. });
  686. this.isData = true;
  687. this.getdetail();
  688. },
  689. //生命周期 - 挂载完成(可以访问DOM元素)
  690. mounted() {},
  691. //生命周期-创建之前
  692. beforeCreated() {},
  693. //生命周期-挂载之前
  694. beforeMount() {},
  695. //生命周期-更新之前
  696. beforUpdate() {},
  697. //生命周期-更新之后
  698. updated() {},
  699. //生命周期-销毁之前
  700. beforeDestory() {},
  701. //生命周期-销毁完成
  702. destoryed() {},
  703. //如果页面有keep-alive缓存功能,这个函数会触发
  704. activated() {},
  705. };
  706. </script>
  707. <style lang="scss" scoped>
  708. /* @import url(); 引入css类 */
  709. .TextbookDetail {
  710. // height: 100%;
  711. .price_1 {
  712. font-style: normal;
  713. font-weight: 600;
  714. font-size: 24px;
  715. line-height: 150%;
  716. color: #ffffff;
  717. .num1 {
  718. font-size: 24px;
  719. }
  720. .num2 {
  721. font-size: 16px;
  722. }
  723. }
  724. .nav {
  725. background: url("../assets/textBookDetail/Homebg2.png") no-repeat center;
  726. background-size: 100% 100%;
  727. // height: 60px;
  728. border-bottom-left-radius: 20px;
  729. border-bottom-right-radius: 20px;
  730. position: relative;
  731. .shade {
  732. position: absolute;
  733. top: 0;
  734. width: 100%;
  735. height: 100%;
  736. background: rgba(0, 0, 0, 0.5);
  737. display: flex;
  738. color: #fff;
  739. font-weight: bold;
  740. font-size: 18px;
  741. justify-content: space-around;
  742. align-items: center;
  743. .el-menu-demo {
  744. background: rgba(0, 0, 0, 0);
  745. }
  746. // 取消组件默认的样式
  747. .el-menu.el-menu--horizontal {
  748. border-bottom: none;
  749. li:hover {
  750. background: none;
  751. }
  752. li {
  753. background: none;
  754. }
  755. }
  756. .nav_title {
  757. text-align: left;
  758. }
  759. .seek {
  760. input {
  761. width: 450px;
  762. height: 46px;
  763. background: #979797;
  764. border: none;
  765. outline: none;
  766. color: white;
  767. font-size: 18px;
  768. opacity: 0.5;
  769. }
  770. img {
  771. position: relative;
  772. right: 40px;
  773. top: 8px;
  774. cursor: pointer;
  775. }
  776. }
  777. }
  778. }
  779. .headerone {
  780. // margin-top: 10px;
  781. }
  782. .main {
  783. min-height: 100%;
  784. padding-top: 52px;
  785. background: #e5e5e5;
  786. padding-bottom: 20px;
  787. .bookDetail {
  788. width: 1240px;
  789. margin: 0 auto;
  790. background: #6e767c;
  791. border-radius: 8px;
  792. display: flex;
  793. position: relative;
  794. overflow: hidden;
  795. padding: 40px;
  796. box-sizing: border-box;
  797. .img {
  798. margin-right: 32px;
  799. img {
  800. width: 168px;
  801. height: 224px;
  802. }
  803. }
  804. .rightUp {
  805. margin: 0;
  806. width: 72px;
  807. height: 72px;
  808. background: url("../assets/textBookDetail/Rectangle903.png");
  809. position: absolute;
  810. right: 0;
  811. top: 0;
  812. // text-align: right;
  813. span {
  814. display: inline-block;
  815. color: #fff;
  816. transform: rotateZ(45deg);
  817. position: absolute;
  818. left: 30px;
  819. top: 15px;
  820. }
  821. }
  822. .text {
  823. width: 900px;
  824. color: white;
  825. p {
  826. font-size: 16px;
  827. margin: 0;
  828. }
  829. .p1 {
  830. font-size: 40px;
  831. font-weight: normal;
  832. font-size: 40px;
  833. line-height: 150%;
  834. color: #ffffff;
  835. }
  836. > :not(.p1) {
  837. margin-top: 16px;
  838. }
  839. .p2 {
  840. font-weight: 600;
  841. font-size: 16px;
  842. line-height: 150%;
  843. color: #ffffff;
  844. }
  845. .p3 {
  846. font-weight: normal;
  847. font-size: 16px;
  848. line-height: 150%;
  849. color: #ffffff;
  850. }
  851. .price {
  852. font-size: 24px;
  853. .price_2 {
  854. font-size: 16px;
  855. }
  856. }
  857. .operation {
  858. display: flex;
  859. align-items: center;
  860. margin-top: 16px;
  861. }
  862. .get {
  863. min-width: 120px;
  864. height: 40px;
  865. background: #ff9900;
  866. border-radius: 4px;
  867. border: none;
  868. outline: none;
  869. color: white;
  870. font-size: 20px;
  871. margin-left: 30px;
  872. cursor: pointer;
  873. }
  874. .acquired {
  875. width: 120px;
  876. height: 40px;
  877. background: #d5d5d5;
  878. border-radius: 4px;
  879. border: none;
  880. outline: none;
  881. color: white;
  882. font-size: 16px;
  883. margin-left: 30px;
  884. cursor: pointer;
  885. }
  886. .enshrine {
  887. margin-left: 30px;
  888. img {
  889. width: 24px;
  890. cursor: pointer;
  891. }
  892. }
  893. }
  894. }
  895. .more {
  896. width: 1240px;
  897. margin: 0 auto;
  898. margin-top: 30px;
  899. .moreTitle {
  900. font-weight: 600;
  901. font-size: 20px;
  902. color: #000000;
  903. }
  904. .moreTitle::before {
  905. content: "|";
  906. background: #ff9900;
  907. color: #ff9900;
  908. margin-right: 16px;
  909. }
  910. .moreList {
  911. width: 1300px;
  912. margin: 0 auto;
  913. // margin-top: 20px;
  914. display: flex;
  915. flex-wrap: wrap;
  916. // overflow-y: hidden;
  917. // overflow-x: scroll;
  918. .moreOne {
  919. margin-right: 20px;
  920. margin-top: 20px;
  921. width: 598px;
  922. height: 236px;
  923. background: #ffffff;
  924. border-radius: 8px;
  925. display: flex;
  926. > div {
  927. margin-left: 32px;
  928. margin-top: 32px;
  929. img {
  930. width: 120px;
  931. height: 160px;
  932. }
  933. }
  934. .text {
  935. width: 390px;
  936. margin-right: 23px;
  937. > p:not(.p1) {
  938. font-size: 16px;
  939. color: #2c2c2c;
  940. opacity: 0.7;
  941. margin-top: 10px;
  942. }
  943. .p1 {
  944. font-weight: 600;
  945. font-size: 20px;
  946. color: #2c2c2c;
  947. }
  948. .operation {
  949. margin-top: 10px;
  950. text-align: right;
  951. }
  952. .get {
  953. min-width: 120px;
  954. height: 40px;
  955. background: #ff9900;
  956. border-radius: 4px;
  957. border: none;
  958. outline: none;
  959. color: white;
  960. font-size: 20px;
  961. margin-left: 30px;
  962. cursor: pointer;
  963. }
  964. .acquired {
  965. width: 120px;
  966. height: 40px;
  967. background: #d5d5d5;
  968. border-radius: 4px;
  969. border: none;
  970. outline: none;
  971. color: white;
  972. font-size: 16px;
  973. margin-left: 30px;
  974. cursor: pointer;
  975. }
  976. .price {
  977. font-size: 24px;
  978. .price_2 {
  979. font-size: 16px;
  980. }
  981. }
  982. }
  983. }
  984. }
  985. }
  986. .cutDownOrimg {
  987. width: 1240px;
  988. margin: 0 auto;
  989. margin-top: 24px;
  990. .sele {
  991. width: fit-content; //318px;
  992. height: 48px;
  993. background: #ebebeb;
  994. border-radius: 30px;
  995. color: #9f9f9f;
  996. font-size: 20px;
  997. display: flex;
  998. align-items: center;
  999. > div {
  1000. width: 158px;
  1001. height: 48px;
  1002. border-radius: 30px;
  1003. line-height: 48px;
  1004. text-align: center;
  1005. cursor: pointer;
  1006. }
  1007. .select {
  1008. background: #ff9900;
  1009. color: white;
  1010. box-shadow: 0px 2px 8px rgba(255, 153, 0, 0.15);
  1011. }
  1012. }
  1013. }
  1014. .Catalogue {
  1015. margin: 24px auto;
  1016. width: 1240px;
  1017. height: 710px;
  1018. background: #ffffff;
  1019. display: flex;
  1020. .left {
  1021. width: 340px;
  1022. height: 710px;
  1023. border-right: 1px solid #d9d9d9;
  1024. .title {
  1025. width: 80%;
  1026. margin: 29px auto;
  1027. font-weight: 600;
  1028. font-size: 24px;
  1029. color: #000000;
  1030. cursor: pointer;
  1031. }
  1032. .subtitle {
  1033. width: 80%;
  1034. margin: 0 auto;
  1035. height: 44px;
  1036. line-height: 44px;
  1037. font-weight: bold;
  1038. font-size: 14px;
  1039. color: #000000;
  1040. cursor: pointer;
  1041. }
  1042. }
  1043. .right {
  1044. width: 860px;
  1045. height: 710px;
  1046. }
  1047. }
  1048. .Resources {
  1049. margin: 24px auto;
  1050. width: 1240px;
  1051. min-height: 710px;
  1052. // background: #ffffff;
  1053. // display: flex;
  1054. box-sizing: border-box;
  1055. padding: 20px 0;
  1056. div {
  1057. // height: 40px;
  1058. // margin: 12px 8px;
  1059. // border: 1px solid rgba(44, 44, 44, 0.15);
  1060. // border-radius: 4px;
  1061. // padding: 0 10px;
  1062. // display: flex;
  1063. // justify-content: center;
  1064. // align-items: center;
  1065. // cursor: pointer;
  1066. img {
  1067. width: 24px;
  1068. margin-right: 10px;
  1069. }
  1070. }
  1071. }
  1072. }
  1073. .resource-content {
  1074. width: 100%;
  1075. margin: 0 auto;
  1076. box-sizing: border-box;
  1077. padding: 26px 24px 8px;
  1078. background: #ffffff;
  1079. border-radius: 8px;
  1080. margin-bottom: 24px;
  1081. .video-title {
  1082. font-size: 24px;
  1083. line-height: 32px;
  1084. font-weight: 700;
  1085. margin-bottom: 40px;
  1086. margin-top: 0;
  1087. }
  1088. .video-list {
  1089. padding: 0 36px;
  1090. display: flex;
  1091. flex-wrap: wrap;
  1092. justify-content: flex-start;
  1093. list-style: none;
  1094. > li {
  1095. margin: 0 12px 16px 12px;
  1096. cursor: pointer;
  1097. .video-img {
  1098. // background: #ff9900;
  1099. position: relative;
  1100. width: 256px;
  1101. height: 144px;
  1102. border-radius: 8px;
  1103. margin-bottom: 8px;
  1104. overflow: hidden;
  1105. .video-bg {
  1106. width: 256px;
  1107. height: 144px;
  1108. border-radius: 8px;
  1109. }
  1110. .play-one {
  1111. position: absolute;
  1112. left: 108px;
  1113. top: 52px;
  1114. width: 40px;
  1115. height: 40px;
  1116. display: block;
  1117. margin: 0;
  1118. }
  1119. }
  1120. .video-name {
  1121. font-size: 16px;
  1122. line-height: 150%;
  1123. color: #000000;
  1124. word-break: break-all;
  1125. display: -webkit-box;
  1126. -webkit-box-orient: vertical;
  1127. -webkit-line-clamp: 2;
  1128. text-overflow: ellipsis;
  1129. overflow: hidden;
  1130. }
  1131. }
  1132. }
  1133. .PDF-list {
  1134. width: 1096px;
  1135. margin: 0 auto;
  1136. padding-bottom: 90px;
  1137. li {
  1138. border: 1px solid rgba(0, 0, 0, 0.1);
  1139. box-sizing: border-box;
  1140. border-radius: 8px;
  1141. display: flex;
  1142. padding: 8px 12px;
  1143. align-items: center;
  1144. margin-bottom: 8px;
  1145. b {
  1146. width: 24px;
  1147. font-size: 16px;
  1148. line-height: 24px;
  1149. font-weight: normal;
  1150. margin-right: 16px;
  1151. }
  1152. p {
  1153. margin: 0;
  1154. width: 920px;
  1155. cursor: pointer;
  1156. font-size: 16px;
  1157. line-height: 24px;
  1158. }
  1159. span {
  1160. width: 80px;
  1161. text-align: right;
  1162. }
  1163. img {
  1164. width: 16px;
  1165. margin-left: 16px;
  1166. cursor: pointer;
  1167. }
  1168. }
  1169. }
  1170. .audio-content {
  1171. padding: 0 28px;
  1172. margin: 0 auto 24px auto;
  1173. width: 1152px;
  1174. .audio-type {
  1175. margin-bottom: 10px;
  1176. }
  1177. .download {
  1178. display: flex;
  1179. justify-content: flex-start;
  1180. align-items: center;
  1181. .book-open {
  1182. width: fit-content;
  1183. margin-right: 16px;
  1184. border: 1px solid rgba(0, 0, 0, 0.1);
  1185. box-sizing: border-box;
  1186. border-radius: 8px;
  1187. padding: 8px 16px;
  1188. display: flex;
  1189. align-items: center;
  1190. cursor: pointer;
  1191. .book-open-text {
  1192. line-height: 24px;
  1193. }
  1194. }
  1195. }
  1196. }
  1197. .audio-line-box {
  1198. width: 100%;
  1199. height: 56px;
  1200. box-sizing: border-box;
  1201. padding: 7px 12px;
  1202. background: #ffffff;
  1203. border: 1px solid rgba(0, 0, 0, 0.1);
  1204. box-sizing: border-box;
  1205. border-radius: 8px;
  1206. }
  1207. }
  1208. .noview-msg-box {
  1209. width: 100%;
  1210. position: absolute;
  1211. top: 200px;
  1212. left: 0;
  1213. z-index: 9999;
  1214. }
  1215. .noview-msg {
  1216. width: fit-content;
  1217. margin: 0 auto;
  1218. padding: 8px;
  1219. background: #fcf5f5;
  1220. border: 1px solid #e65959;
  1221. box-sizing: border-box;
  1222. border-radius: 4px;
  1223. font-weight: 400;
  1224. font-size: 12px;
  1225. line-height: 14px;
  1226. color: #e55959;
  1227. }
  1228. }
  1229. </style>
  1230. <style lang="scss">
  1231. .buyWindow {
  1232. .el-dialog__body {
  1233. padding: 20px 32px;
  1234. }
  1235. .el-dialog__header {
  1236. padding: 20px 32px 10px;
  1237. }
  1238. }
  1239. </style>