TextbookDetail.vue 36 KB

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