bookItem.vue 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306
  1. <template>
  2. <div class="bookItem">
  3. <Header
  4. :headerBg="headerBg"
  5. :headerBorder="headerBorder"
  6. :userBg="userBg"
  7. :LoginNavIndex="LoginNavIndex"
  8. ref="header"
  9. />
  10. <div class="navBar" v-if="info">
  11. <div class="navBar-left">
  12. <a class="goback" @click="$router.go(-1)"
  13. ><i class="el-icon-arrow-left"></i>{{ info.study_phase_name }}版</a
  14. >
  15. <div class="border"></div>
  16. <p>{{ info.name || info.iss_name }}</p>
  17. </div>
  18. <!-- <div class="navBar-right">
  19. <a @click="handleShare">
  20. <svg-icon icon-class="share-personal" className="icon-share"></svg-icon>
  21. <span>分享</span>
  22. </a>
  23. <a @click="handlelike">
  24. <svg-icon icon-class="like-line" className="icon-like"></svg-icon>
  25. <span>收藏</span>
  26. </a>
  27. </div> -->
  28. </div>
  29. <div class="main-top" v-if="info">
  30. <div class="main-top-inner">
  31. <el-carousel
  32. class="swiper-container"
  33. trigger="click"
  34. arrow="never"
  35. height="414px"
  36. >
  37. <!-- <el-carousel-item v-for="(item1, index) in data.imgList" :key="index"> -->
  38. <el-image
  39. class="image"
  40. :src="
  41. info.cover_image_url || info.iss_cover_url
  42. ? info.cover_image_url || info.iss_cover_url
  43. : bookType === 'baozhi'
  44. ? require('../../assets/baozhi' +
  45. (Math.floor(Math.random() * 2) + 1) +
  46. '.png')
  47. : require('../../assets/kecheng' +
  48. (Math.floor(Math.random() * 3) + 1) +
  49. '.png')
  50. "
  51. :fit="'cover'"
  52. >
  53. </el-image>
  54. <!-- </el-carousel-item> -->
  55. </el-carousel>
  56. <div class="book-info-right">
  57. <h1 class="title">{{ info.name || info.iss_name }}</h1>
  58. <!-- <b class="org">{{data.org}}</b><span class="date">2023.07.01-2023.07.21</span> -->
  59. <div class="sales-box" v-if="isBuy === 'false'">
  60. <div class="sales-left">
  61. <span>优惠价</span>
  62. <span class="OPPOSans"
  63. >¥{{
  64. info.hasOwnProperty("price_discount") ||
  65. info.hasOwnProperty("iss_price_sell")
  66. ? info.price_discount || info.iss_price_sell
  67. : info.price || info.iss_price_org | cutMoneyFiter
  68. }}</span
  69. >
  70. <span
  71. class="old-price"
  72. v-if="
  73. (info.hasOwnProperty('price_discount') &&
  74. info.price_discount !== info.price) ||
  75. (info.hasOwnProperty('iss_price_sell') &&
  76. info.iss_price_sell !== info.iss_price_org)
  77. "
  78. >¥{{ info.price || info.iss_price_org | cutMoneyFiter }}</span
  79. >
  80. </div>
  81. <span class="sales-right" v-if="sales >= 1000"
  82. >累计销售 {{ salesCn }}</span
  83. >
  84. </div>
  85. <div class="label-box">
  86. <label
  87. v-for="(itemL, indexL) in info.label_name_list ||
  88. info.info_tag_data"
  89. :key="indexL"
  90. :style="{
  91. background: tagBg[indexL % 3],
  92. color: tagColor[indexL % 3],
  93. }"
  94. >
  95. {{ "# " + itemL }}
  96. </label>
  97. </div>
  98. <!-- <div class="book-describe">
  99. <h2 class="title">{{data.describe.title}}</h2>
  100. <span class="author">{{'BY '+data.describe.author}}</span>
  101. <p class="describe">{{data.describe.describe}}</p>
  102. </div> -->
  103. <div
  104. class="info-box"
  105. v-if="bookType === 'baozhi' || bookType === 'huakan'"
  106. >
  107. <div class="info-item">
  108. <label>出版社</label>
  109. <span>{{
  110. info.vendor_name ? info.vendor_name : "中国日报社"
  111. }}</span>
  112. </div>
  113. <!-- <div class="info-item">
  114. <label>字数</label>
  115. <span>78291</span>
  116. </div> -->
  117. <div class="info-item">
  118. <label>发行时间</label>
  119. <span>{{ info.release_date }}</span>
  120. </div>
  121. <div class="info-item">
  122. <label>语种</label>
  123. <span>中英双语</span>
  124. </div>
  125. <div class="info-item">
  126. <label>期数</label>
  127. <span>{{ info.iss_no }} 期</span>
  128. </div>
  129. <div class="info-item">
  130. <label>学段</label>
  131. <span>{{ info.study_phase_name }}</span>
  132. </div>
  133. <!-- <div class="info-item">
  134. <label>版本</label>
  135. <span>基础版</span>
  136. </div> -->
  137. </div>
  138. <div class="info-box" v-if="bookType === 'LB'">
  139. <div class="info-item">
  140. <label>出版社</label>
  141. <span>{{ info.org_name }}</span>
  142. </div>
  143. <div class="info-item" v-if="bookType === 'LB'">
  144. <label>教师</label>
  145. <span>{{ info.teacher_name_list.join("、") }}</span>
  146. </div>
  147. <div class="info-item">
  148. <label>类型</label>
  149. <span>录播课</span>
  150. </div>
  151. <div class="info-item">
  152. <label>课时</label>
  153. <span>{{ courseList.length + " 课时" }}</span>
  154. </div>
  155. <div class="info-item">
  156. <label>有效期</label>
  157. <span>{{ info.effective_month_count + " 个月" }}</span>
  158. </div>
  159. <div class="info-item">
  160. <label>学段</label>
  161. <span>{{ info.study_phase_name }}</span>
  162. </div>
  163. </div>
  164. <div class="btn-box">
  165. <a class="continue" v-if="isBuy === 'true'" @click="handleLink"
  166. >继续学习</a
  167. >
  168. <template v-else>
  169. <a
  170. class="el-button"
  171. @click="handleChangeWay('wei')"
  172. :loading="createOrderLoading"
  173. >立即购买</a
  174. >
  175. <!-- <a class="upgrade" @click="handleChangeWay('dui')">使用兑换码</a> -->
  176. <a
  177. class="upgrade"
  178. v-if="bookType === 'baozhi' || bookType === 'huakan'"
  179. @click="linkSubscribe"
  180. >多期订阅</a
  181. >
  182. </template>
  183. </div>
  184. </div>
  185. </div>
  186. </div>
  187. <div class="main-center" v-if="info">
  188. <el-tabs
  189. type="card"
  190. style="margin-bottom: 24px"
  191. v-if="info.intro || info.iss_note"
  192. >
  193. <el-tab-pane label="简介">
  194. <div v-html="info.intro || info.iss_note"></div>
  195. </el-tab-pane>
  196. </el-tabs>
  197. <el-tabs type="card" v-if="bookType !== 'huakan'">
  198. <!-- <el-tab-pane :label="bookType==='course'?'课程简介':'简介'">
  199. </el-tab-pane> -->
  200. <el-tab-pane label="目录" v-if="bookType === 'baozhi'">
  201. <tree-list
  202. :data="issueChnList"
  203. :isBuy="isBuy === 'true'"
  204. :headerBg="headerBg"
  205. :headerBorder="headerBorder"
  206. :userBg="userBg"
  207. :LoginNavIndex="LoginNavIndex"
  208. :cardType="bookType"
  209. >
  210. </tree-list>
  211. </el-tab-pane>
  212. <!-- <el-tab-pane label="目录" v-if="bookType==='huakan'">
  213. <tree-list
  214. :data="data.treeLists"
  215. :isBuy="isBuy==='true'"
  216. :headerBg="headerBg"
  217. :headerBorder="headerBorder"
  218. :userBg="userBg"
  219. :LoginNavIndex="LoginNavIndex"
  220. :cardType="bookType">
  221. </tree-list>
  222. </el-tab-pane> -->
  223. <el-tab-pane label="课程目录" v-if="bookType === 'LB'">
  224. <course-list
  225. :data="courseList"
  226. :isBuy="isBuy === 'true'"
  227. :headerBg="headerBg"
  228. :headerBorder="headerBorder"
  229. :userBg="userBg"
  230. :LoginNavIndex="LoginNavIndex"
  231. :cardType="info.type"
  232. >
  233. </course-list>
  234. </el-tab-pane>
  235. </el-tabs>
  236. <div class="banner-box-close" v-if="bannerFlag">
  237. <a v-if="1 == 2" href="#" target="_blank">
  238. <img class="banner-item" src="../../assets/banner4.png" />
  239. </a>
  240. <img v-else class="banner-item" src="../../assets/banner4.png" />
  241. <div class="close-box">
  242. <a class="close-btn" @click="bannerFlag = false"
  243. ><i class="el-icon-close"></i
  244. ></a>
  245. <span class="close-tips">广告</span>
  246. </div>
  247. </div>
  248. </div>
  249. <el-dialog
  250. :visible.sync="paymentShow"
  251. :show-close="false"
  252. :close-on-click-modal="false"
  253. width="712px"
  254. class="bookItem-dialog"
  255. v-if="paymentShow"
  256. >
  257. <Payment
  258. :data="info"
  259. :payWay="payWay"
  260. @handleClose="handleClose"
  261. :orderId="orderId"
  262. :qr_code_url="qr_code_url"
  263. :order_amount="order_amount"
  264. @handleSuccess="handleSuccess"
  265. />
  266. </el-dialog>
  267. </div>
  268. </template>
  269. <script>
  270. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  271. //例如:import 《组件名称》from ‘《组件路径》';
  272. import Header from "../../components/Header.vue";
  273. import BookCard from "@/components/common/BookCard.vue";
  274. import Payment from "./components/Payment.vue";
  275. import TreeList from "./components/TreeList";
  276. import CourseList from "./components/CourseList.vue";
  277. import { cutMoneyFiter } from "@/utils/defined";
  278. import { getLogin, getNoToken } from "@/api/ajax";
  279. import { getToken } from "@/utils/auth";
  280. export default {
  281. //import引入的组件需要注入到对象中才能使用
  282. components: { Header, BookCard, Payment, TreeList, CourseList },
  283. props: [],
  284. filters: {
  285. cutMoneyFiter,
  286. },
  287. data() {
  288. //这里存放数据
  289. return {
  290. config: this.$route.query.headerConfig
  291. ? decodeURIComponent(this.$route.query.headerConfig)
  292. : "",
  293. LoginNavIndex: 0,
  294. userBg: "rgba(0, 0, 0, 0.24)",
  295. headerBorder: "#5C5C5C",
  296. headerBg: "#00ADEF",
  297. previousPage: "商城",
  298. data: {
  299. navTitle: "第 815 期 Celebrating new King",
  300. title: "第 815 期 Celebrating new King",
  301. org: "二十一世纪英文报",
  302. tagList: ["中英双语", "经典读物", "初中必读"],
  303. imgList: [
  304. require("../../assets/img1.png"),
  305. require("../../assets/bookcard-image.png"),
  306. ],
  307. describe: {
  308. title: "Bring books up to date",
  309. author: "TEENS",
  310. describe:
  311. "Should childrenn read the original or adapted version? 英国童书再版遭大量删改引争议 词数 372 测试见IV版 建议阅读时间 5分钟 Puffin ...",
  312. },
  313. price: "3.9",
  314. oldPrice: "5.99",
  315. isBuy: this.$route.query.isBuy ? this.$route.query.isBuy : false,
  316. treeList: [
  317. {
  318. number: "1",
  319. title: "FRONTPAGE",
  320. children: [
  321. {
  322. number: "1.1",
  323. title: "Meeting Foreigners at an Airport",
  324. },
  325. ],
  326. },
  327. {
  328. number: "2",
  329. title: "OUR WORLD",
  330. children: [
  331. {
  332. number: "2.1",
  333. title: "Out in the fields",
  334. },
  335. {
  336. number: "2.2",
  337. title: "IN BRIEF 新闻速览",
  338. },
  339. {
  340. number: "2.3",
  341. title: "XI’S WORDS 英语学习",
  342. },
  343. {
  344. number: "2.4",
  345. title: "WORLD LENS 图行天下",
  346. },
  347. {
  348. number: "2.5",
  349. title: "4,200",
  350. },
  351. ],
  352. },
  353. {
  354. number: "3",
  355. title: "SCIENCE STUDY",
  356. children: [
  357. {
  358. number: "3.1",
  359. title: "Listened to by aliens",
  360. },
  361. {
  362. number: "3.2",
  363. title: "Wearable mushrooms",
  364. },
  365. {
  366. number: "3.3",
  367. title: "Lend a helping fin",
  368. },
  369. ],
  370. },
  371. {
  372. number: "4",
  373. title: "READING & WRITING",
  374. children: [
  375. {
  376. number: "4.1",
  377. title: "What’s the word 短文填空",
  378. },
  379. {
  380. number: "4.2",
  381. title: "任务型阅读:我的身体我做主",
  382. },
  383. ],
  384. },
  385. ],
  386. treeLists: [
  387. {
  388. chn_name: "Nature",
  389. chn_idx: 0,
  390. arts: [
  391. {
  392. id: "i21a160948",
  393. art_title: "I have a super ‘mouth’",
  394. en_flag: 1,
  395. art_status: 1,
  396. chn_item: "FRONTPAGE",
  397. art_idx: 0,
  398. art_author: "TEENS",
  399. },
  400. ],
  401. },
  402. {
  403. chn_name: "My works",
  404. chn_idx: 1,
  405. arts: [
  406. {
  407. id: "i21a160954",
  408. art_title: "My works",
  409. en_flag: 1,
  410. art_status: 1,
  411. chn_item: "OUR WORLD",
  412. art_idx: 1,
  413. art_author: "TEENS",
  414. },
  415. ],
  416. },
  417. {
  418. chn_name: "Daily words",
  419. chn_idx: 2,
  420. arts: [
  421. {
  422. id: "i21a160962",
  423. art_title: "Happy birthday",
  424. en_flag: 1,
  425. art_status: 9,
  426. chn_item: "SCHOOL TIME",
  427. art_idx: 0,
  428. art_author: "TEENS",
  429. },
  430. ],
  431. },
  432. {
  433. chn_name: "Have a go",
  434. chn_idx: 3,
  435. arts: [
  436. {
  437. id: "i21a160964",
  438. art_title: "P1 Have a go",
  439. en_flag: 1,
  440. art_status: 9,
  441. chn_item: "MAGIC WORLD",
  442. art_idx: 0,
  443. art_author: "TEENS",
  444. },
  445. {
  446. id: "i21a160965",
  447. art_title: "Listen and write",
  448. en_flag: 1,
  449. art_status: 9,
  450. chn_item: "MAGIC WORLD",
  451. art_idx: 1,
  452. art_author: "TEENS",
  453. },
  454. {
  455. id: "i21a160966",
  456. art_title: "P6 Have a go",
  457. en_flag: 1,
  458. art_status: 1,
  459. chn_item: "MAGIC WORLD",
  460. art_idx: 2,
  461. art_author: "TEENS",
  462. },
  463. {
  464. id: "i21a160967",
  465. art_title: "P4 Have a go",
  466. en_flag: 1,
  467. art_status: 9,
  468. chn_item: "MAGIC WORLD",
  469. art_idx: 3,
  470. art_author: "TEENS",
  471. },
  472. ],
  473. },
  474. {
  475. chn_name: "Little Hikers",
  476. chn_idx: 4,
  477. arts: [
  478. {
  479. id: "i21a160968",
  480. art_title: "Beach full of shells",
  481. en_flag: 1,
  482. art_status: 9,
  483. chn_item: "SCIENCE STUDY",
  484. art_idx: 0,
  485. art_author: "TEENS",
  486. },
  487. ],
  488. },
  489. {
  490. chn_name: "Cartoons",
  491. chn_idx: 5,
  492. arts: [
  493. {
  494. id: "i21a160971",
  495. art_title: "Bud likes mud",
  496. en_flag: 1,
  497. art_status: 9,
  498. chn_item: "READING FUN",
  499. art_idx: 0,
  500. art_author: "TEENS",
  501. },
  502. ],
  503. },
  504. {
  505. chn_name: "Game bar",
  506. chn_idx: 6,
  507. arts: [
  508. {
  509. id: "i21a160972",
  510. art_title: "GAME BAR",
  511. en_flag: 1,
  512. art_status: 9,
  513. chn_item: "WORLD CUP FOCUS",
  514. art_idx: 0,
  515. art_author: "TEENS",
  516. },
  517. ],
  518. },
  519. {
  520. chn_name: "Word lab",
  521. chn_idx: 7,
  522. arts: [
  523. {
  524. id: "i21a160973",
  525. art_title: "Word lab",
  526. en_flag: 1,
  527. art_status: 9,
  528. chn_item: "LEARNING",
  529. art_idx: 0,
  530. art_author: "TEENS",
  531. },
  532. ],
  533. },
  534. {
  535. chn_name: "Photos",
  536. chn_idx: 8,
  537. arts: [
  538. {
  539. id: "i21a160975",
  540. art_title: "Happy festival",
  541. en_flag: 1,
  542. art_status: 9,
  543. chn_item: "READING & WRITING",
  544. art_idx: 0,
  545. art_author: "TEENS",
  546. },
  547. ],
  548. },
  549. {
  550. chn_name: "World wows",
  551. chn_idx: 9,
  552. arts: [
  553. {
  554. id: "i21a160978",
  555. art_title: "World wows",
  556. en_flag: 1,
  557. art_status: 9,
  558. chn_item: "EXTRA CREDIT",
  559. art_idx: 0,
  560. art_author: "TEENS",
  561. },
  562. ],
  563. },
  564. ],
  565. },
  566. guessList: [
  567. {
  568. src: require("../../assets/bookcard-image.png"),
  569. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  570. price: "3.00",
  571. oldprice: "3.00",
  572. author: "作者",
  573. score: 3,
  574. progress: "90%",
  575. },
  576. {
  577. src: require("../../assets/bookcard-image.png"),
  578. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  579. price: "3.00",
  580. oldprice: "3.00",
  581. author: "作者",
  582. score: 3,
  583. },
  584. {
  585. src: require("../../assets/bookcard-image.png"),
  586. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  587. price: "3.00",
  588. oldprice: "3.00",
  589. author: "作者",
  590. score: 3,
  591. },
  592. {
  593. src: require("../../assets/bookcard-image.png"),
  594. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  595. price: "3.00",
  596. oldprice: "3.00",
  597. author: "作者",
  598. score: 3,
  599. },
  600. {
  601. src: require("../../assets/bookcard-image.png"),
  602. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  603. price: "3.00",
  604. oldprice: "3.00",
  605. author: "作者",
  606. score: 3,
  607. },
  608. ],
  609. tagBg: ["#C9EBFF", "#FFFAC9", "#D7C9FF"], // 标签背景色
  610. tagColor: ["#006DAA", "#AA8500", "#7849C4"], // 标签字体颜色
  611. paymentShow: false, // 支付弹窗
  612. payWay: this.$route.query.paywei ? this.$route.query.paywei : "dui",
  613. bookType: this.$route.query.cardType
  614. ? this.$route.query.cardType
  615. : "baozhi", // 书籍类型
  616. bannerFlag: true, // 是否展示广告
  617. id: this.$route.query.id ? this.$route.query.id : "",
  618. info: null, // 信息
  619. courseList: [],
  620. sales: null,
  621. salesCn: "",
  622. isBuy: "false",
  623. userMessage: getToken() ? JSON.parse(getToken()) : null,
  624. orderId: "",
  625. qr_code_url: "",
  626. pre_play_cs_item_id: "", //上次阅读课节id
  627. pre_play_index: null, // 上次阅读索引
  628. issueChnList: [],
  629. order_amount: null,
  630. createOrderLoading: false,
  631. };
  632. },
  633. //计算属性 类似于data概念
  634. computed: {},
  635. //监控data中数据变化
  636. watch: {},
  637. //方法集合
  638. methods: {
  639. // 分享
  640. handleShare() {},
  641. // 收藏
  642. handlelike() {},
  643. handleChangeWay(type) {
  644. if (!this.userMessage) {
  645. this.$refs.header.handleLogin(
  646. "/bookItem?headerConfig=" +
  647. this.$route.query.headerConfig +
  648. "&cardType=" +
  649. this.bookType +
  650. "&id=" +
  651. this.id +
  652. "&paywei=" +
  653. type,
  654. "url"
  655. );
  656. return false;
  657. }
  658. this.payWay = type;
  659. this.handleOrder();
  660. },
  661. // 关闭弹窗
  662. handleClose() {
  663. this.paymentShow = false;
  664. this.getInfo();
  665. },
  666. handleSuccess() {
  667. this.paymentShow = false;
  668. this.getInfo();
  669. },
  670. // 详情
  671. getInfo() {
  672. let MethodName = "/CourseServer/Client/LBCourseQuery/GetLBCourseInfo";
  673. let data = null;
  674. if (this.bookType === "LB") {
  675. data = {
  676. id: this.id,
  677. is_contain_cs_item: "true",
  678. cs_item_sort_mode: "ASCE",
  679. };
  680. } else if (this.bookType === "baozhi") {
  681. MethodName = "/PaperServer/Client/Issue/GetIssueBriefInfo";
  682. data = {
  683. id: this.id,
  684. };
  685. } else if (this.bookType === "huakan") {
  686. MethodName = "/PaperServer/Client/PicIssue/GetIssueBriefInfo";
  687. data = {
  688. id: this.id,
  689. };
  690. }
  691. getLogin(MethodName, data)
  692. .then((res) => {
  693. if (res.status === 1) {
  694. if (this.bookType === "LB") {
  695. this.info = res.lb_course;
  696. if (res.my_play_record.pre_play_cs_item_id) {
  697. this.pre_play_cs_item_id =
  698. res.my_play_record.pre_play_cs_item_id;
  699. }
  700. this.courseList = this.handleCourseLength(res.cs_item_list);
  701. } else if (
  702. this.bookType === "baozhi" ||
  703. this.bookType === "huakan"
  704. ) {
  705. this.info = res.data;
  706. this.issueChnList = res.data.chn_art_data;
  707. }
  708. }
  709. })
  710. .catch(() => {});
  711. if (this.userMessage) {
  712. getLogin("/ShopServer/Client/BookshelfQuery/GetGoodsBuyStatus", {
  713. goods_type:
  714. this.bookType === "LB"
  715. ? 0
  716. : this.bookType === "baozhi"
  717. ? 2
  718. : this.bookType === "huakan"
  719. ? 4
  720. : null,
  721. goods_id: this.id,
  722. })
  723. .then((res) => {
  724. if (res.status === 1) {
  725. this.isBuy = res.buy_info.is_buy;
  726. this.sales = res.data.sold_count;
  727. if (this.sales < 1000) {
  728. this.salesCn = "";
  729. } else if (1000 <= this.sales && this.sales < 10000) {
  730. this.salesCn = this.sales.toString().substring(0, 1) + "000+";
  731. } else if (10000 <= this.sales && this.sales < 100000) {
  732. this.salesCn = this.sales.toString().substring(0, 1) + "万+";
  733. } else if (100000 <= this.sales && this.sales < 1000000) {
  734. this.salesCn = this.sales.toString().substring(0, 1) + "0万+";
  735. } else if (1000000 <= this.sales && this.sales < 10000000) {
  736. this.salesCn = this.sales.toString().substring(0, 1) + "00万+";
  737. } else if (10000000 <= this.sales && this.sales < 100000000) {
  738. this.salesCn = this.sales.toString().substring(0, 1) + "000万+";
  739. } else if (100000000 <= this.sales) {
  740. this.salesCn = this.sales.toString().substring(0, 1) + "亿+";
  741. }
  742. }
  743. })
  744. .catch(() => {});
  745. } else {
  746. getNoToken(
  747. "/ShopServer/Client/BookshelfQuery/GetGoodsBuyStatus",
  748. {
  749. goods_type:
  750. this.bookType === "LB"
  751. ? 0
  752. : this.bookType === "baozhi"
  753. ? 2
  754. : this.bookType === "huakan"
  755. ? 4
  756. : null,
  757. goods_id: this.id,
  758. },
  759. "VOID"
  760. )
  761. .then((res) => {
  762. if (res.status === 1) {
  763. this.isBuy = res.buy_info.is_buy;
  764. this.sales = res.data.sold_count;
  765. if (this.sales < 1000) {
  766. this.salesCn = "";
  767. } else if (1000 <= this.sales && this.sales < 10000) {
  768. this.salesCn = this.sales.toString().substring(0, 1) + "000+";
  769. } else if (10000 <= this.sales && this.sales < 100000) {
  770. this.salesCn = this.sales.toString().substring(0, 1) + "万+";
  771. } else if (100000 <= this.sales && this.sales < 1000000) {
  772. this.salesCn = this.sales.toString().substring(0, 1) + "0万+";
  773. } else if (1000000 <= this.sales && this.sales < 10000000) {
  774. this.salesCn = this.sales.toString().substring(0, 1) + "00万+";
  775. } else if (10000000 <= this.sales && this.sales < 100000000) {
  776. this.salesCn = this.sales.toString().substring(0, 1) + "000万+";
  777. } else if (100000000 <= this.sales) {
  778. this.salesCn = this.sales.toString().substring(0, 1) + "亿+";
  779. }
  780. }
  781. })
  782. .catch(() => {});
  783. }
  784. },
  785. // 处理授课时长 小于1分钟的按1分钟 之后个位数四舍五入
  786. handleCourseLength(list) {
  787. let listArr = JSON.parse(JSON.stringify(list));
  788. listArr.forEach((item, index) => {
  789. if (item.file_media_duration) {
  790. if (item.file_media_duration < 60) {
  791. item.timeCn = "1分钟";
  792. } else if (item.file_media_duration < 600) {
  793. item.timeCn = Math.ceil(item.file_media_duration / 60) + "分钟";
  794. } else {
  795. let first =
  796. Math.ceil(item.file_media_duration / 60)
  797. .toString()
  798. .substring(
  799. 0,
  800. Math.ceil(item.file_media_duration / 60).toString().length - 1
  801. ) * 1;
  802. let last =
  803. Math.ceil(item.file_media_duration / 60)
  804. .toString()
  805. .substring(
  806. Math.ceil(item.file_media_duration / 60).toString().length - 1
  807. ) * 1;
  808. if (last < 5) {
  809. item.timeCn = first + "0分钟";
  810. } else {
  811. item.timeCn = first + 1 + "0分钟";
  812. }
  813. }
  814. } else {
  815. item.timeCn = "-";
  816. }
  817. if (item.id === this.pre_play_cs_item_id) {
  818. this.pre_play_index = index;
  819. }
  820. });
  821. return listArr;
  822. },
  823. // 生成订单
  824. handleOrder() {
  825. this.createOrderLoading = true;
  826. let MethodName = "/ShopServer/Client/OrderManager/CreateOrder";
  827. let data = {
  828. goods_type:
  829. this.bookType === "LB"
  830. ? 0
  831. : this.bookType === "baozhi"
  832. ? 2
  833. : this.bookType === "huakan"
  834. ? 4
  835. : null,
  836. goods_id_list: [this.id],
  837. pay_type:
  838. this.payWay === "wei"
  839. ? 3
  840. : this.payWay === "zhi"
  841. ? 4
  842. : this.payWay === "dui"
  843. ? 5
  844. : null,
  845. };
  846. getLogin(MethodName, data)
  847. .then((res) => {
  848. this.createOrderLoading = false;
  849. if (res.status === 1) {
  850. this.order_amount = res.order_amount;
  851. if (this.order_amount <= 0) {
  852. this.getInfo();
  853. } else {
  854. this.orderId = res.id;
  855. this.qr_code_url = res.qr_code_url;
  856. this.paymentShow = true;
  857. }
  858. }
  859. })
  860. .catch(() => {
  861. this.createOrderLoading = false;
  862. });
  863. // this.paymentShow = true;
  864. },
  865. // 跳转
  866. async handleLink() {
  867. let url =
  868. this.LoginNavIndex +
  869. "&&&" +
  870. this.userBg +
  871. "&&&" +
  872. this.headerBorder +
  873. "&&&" +
  874. this.headerBg;
  875. if (this.bookType === "baozhi") {
  876. let articleId = "";
  877. if (this.info.last_read_art_id) {
  878. articleId = this.info.last_read_art_id;
  879. } else {
  880. for (let i = 0; i < this.issueChnList.length; i++) {
  881. if (articleId) {
  882. break;
  883. }
  884. if (
  885. this.issueChnList[i].arts &&
  886. this.issueChnList[i].arts.length > 0
  887. ) {
  888. for (let j = 0; j < this.issueChnList[i].arts.length; j++) {
  889. if (this.issueChnList[i].arts[j].id) {
  890. articleId = this.issueChnList[i].arts[j].id;
  891. break;
  892. }
  893. }
  894. }
  895. }
  896. }
  897. let MethodName = "/PaperServer/Client/Issue/SaveLastReadArtInIss";
  898. let data = {
  899. iss_id: this.$route.query.id,
  900. art_id: articleId,
  901. };
  902. await getLogin(MethodName, data).then((res) => {});
  903. this.$router.push({
  904. path: "/articleDetail",
  905. query: {
  906. headerConfig: encodeURIComponent(url),
  907. id: articleId,
  908. iss_id: this.$route.query.id,
  909. },
  910. });
  911. } else if (this.bookType === "huakan") {
  912. this.$router.push({
  913. path: "/magazineDetail",
  914. query: {
  915. headerConfig: encodeURIComponent(url),
  916. iss_id: this.$route.query.id,
  917. },
  918. });
  919. } else {
  920. this.$router.push({
  921. path: this.info.type === 1 ? "/courseDetail" : "/videoDetail",
  922. query: {
  923. headerConfig: encodeURIComponent(url),
  924. index: this.pre_play_index,
  925. id: this.id,
  926. },
  927. });
  928. }
  929. },
  930. // 多期订阅
  931. linkSubscribe() {
  932. this.$router.push({
  933. path: "/subscribe",
  934. query: {
  935. name: encodeURIComponent("报纸"),
  936. type: this.bookType,
  937. studyType: this.info.study_phase,
  938. studyTypeName: encodeURIComponent(this.info.study_phase_name),
  939. },
  940. });
  941. },
  942. },
  943. //生命周期 - 创建完成(可以访问当前this实例)
  944. created() {
  945. if (this.config) {
  946. let arr = this.config.split("&&&");
  947. this.LoginNavIndex = arr[0] * 1;
  948. this.userBg = arr[1] ? arr[1] : "rgba(0, 0, 0, 0.24)";
  949. this.headerBorder = arr[2] ? arr[2] : "#5C5C5C";
  950. this.headerBg = arr[3] ? arr[3] : "#00ADEF";
  951. this.previousPage = arr[4] ? arr[4] : "商城";
  952. }
  953. this.getInfo();
  954. if (this.$route.query.paywei) {
  955. this.handleOrder();
  956. }
  957. },
  958. //生命周期 - 挂载完成(可以访问DOM元素)
  959. mounted() {},
  960. //生命周期-创建之前
  961. beforeCreated() {},
  962. //生命周期-挂载之前
  963. beforeMount() {},
  964. //生命周期-更新之前
  965. beforUpdate() {},
  966. //生命周期-更新之后
  967. updated() {},
  968. //生命周期-销毁之前
  969. beforeDestory() {},
  970. //生命周期-销毁完成
  971. destoryed() {},
  972. //如果页面有keep-alive缓存功能,这个函数会触发
  973. activated() {},
  974. };
  975. </script>
  976. <style lang="scss" scoped>
  977. /* @import url(); 引入css类 */
  978. .bookItem {
  979. background: #f7f8fa;
  980. min-height: 100%;
  981. .main-top {
  982. background: #ffffff;
  983. padding: 48px 0;
  984. margin-top: 56px;
  985. &-inner {
  986. width: 1200px;
  987. margin: 0 auto;
  988. display: flex;
  989. .swiper-container {
  990. width: 416px;
  991. height: 440px;
  992. text-align: center;
  993. .el-image {
  994. width: 297px;
  995. height: 414px;
  996. border: 1px solid #f3f3f3;
  997. }
  998. }
  999. .book-info-right {
  1000. flex: 1;
  1001. padding-left: 88px;
  1002. .title {
  1003. color: #2f3742;
  1004. font-weight: 500;
  1005. font-size: 32px;
  1006. line-height: 44px;
  1007. margin: 0 0 16px 0;
  1008. }
  1009. .org,
  1010. .date {
  1011. font-weight: 500;
  1012. font-size: 14px;
  1013. line-height: 22px;
  1014. color: rgba(0, 0, 0, 0.4);
  1015. }
  1016. .date {
  1017. margin-left: 32px;
  1018. line-height: 24px;
  1019. }
  1020. .label-box {
  1021. display: flex;
  1022. flex-flow: wrap;
  1023. margin: 16px 0;
  1024. label {
  1025. margin: 0 8px 8px 0;
  1026. border-radius: 20px;
  1027. padding: 4px 12px;
  1028. font-weight: 400;
  1029. font-size: 14px;
  1030. line-height: 22px;
  1031. }
  1032. }
  1033. .book-describe {
  1034. border-top: 1px solid #e5e6eb;
  1035. border-bottom: 1px solid #e5e6eb;
  1036. padding: 16px 0;
  1037. .title {
  1038. font-weight: 500;
  1039. font-size: 16px;
  1040. line-height: 24px;
  1041. color: #000000;
  1042. margin-bottom: 8px;
  1043. }
  1044. .author {
  1045. font-weight: 400;
  1046. font-size: 12px;
  1047. line-height: 20px;
  1048. color: #000000;
  1049. margin-bottom: 8px;
  1050. display: block;
  1051. }
  1052. .describe {
  1053. font-weight: 400;
  1054. font-size: 14px;
  1055. line-height: 22px;
  1056. color: #000000;
  1057. margin: 0;
  1058. }
  1059. }
  1060. .price-box {
  1061. padding: 20px 0 16px 0;
  1062. display: flex;
  1063. align-items: flex-end;
  1064. .price {
  1065. font-weight: 500;
  1066. font-size: 32px;
  1067. line-height: 40px;
  1068. color: #ea5939;
  1069. }
  1070. .oldPrice {
  1071. padding: 0 0 2px 7px;
  1072. font-weight: 500;
  1073. font-size: 14px;
  1074. line-height: 22px;
  1075. color: rgba(0, 0, 0, 0.4);
  1076. text-decoration-line: line-through;
  1077. }
  1078. }
  1079. .info-box {
  1080. display: flex;
  1081. flex-flow: wrap;
  1082. border-bottom: 1px solid #ebebeb;
  1083. margin-bottom: 24px;
  1084. .info-item {
  1085. width: 50%;
  1086. margin-bottom: 15px;
  1087. font-size: 14px;
  1088. line-height: 22px;
  1089. display: flex;
  1090. label {
  1091. color: #c2c2c2;
  1092. font-weight: 400;
  1093. margin-right: 16px;
  1094. width: 58px;
  1095. display: block;
  1096. text-align: justify;
  1097. text-justify: distribute-all-lines;
  1098. text-align-last: justify;
  1099. -moz-text-align-last: justify;
  1100. -webkit-text-align-last: justify;
  1101. }
  1102. }
  1103. }
  1104. .btn-box {
  1105. display: flex;
  1106. .el-button {
  1107. width: 112px;
  1108. height: 40px;
  1109. background: #ea5939;
  1110. box-shadow: 0px 8px 16px rgba(234, 89, 57, 0.24);
  1111. border-radius: 4px;
  1112. font-weight: 500;
  1113. font-size: 16px;
  1114. color: #ffffff;
  1115. border: none;
  1116. }
  1117. .svg-icon {
  1118. margin-left: 7px;
  1119. }
  1120. .continue {
  1121. width: 112px;
  1122. height: 40px;
  1123. background: #175dff;
  1124. border-radius: 4px;
  1125. font-weight: 500;
  1126. font-size: 16px;
  1127. line-height: 40px;
  1128. color: rgba(255, 255, 255, 1);
  1129. display: block;
  1130. text-align: center;
  1131. box-shadow: 0px 8px 16px rgba(23, 93, 255, 0.24);
  1132. }
  1133. .upgrade {
  1134. margin-left: 16px;
  1135. display: block;
  1136. padding: 0px 24px;
  1137. height: 40px;
  1138. background: #e9e9e9;
  1139. box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.06);
  1140. border-radius: 4px;
  1141. color: #595959;
  1142. font-weight: 500;
  1143. font-size: 16px;
  1144. line-height: 40px;
  1145. text-align: center;
  1146. width: 130px;
  1147. }
  1148. }
  1149. }
  1150. }
  1151. }
  1152. .main-center {
  1153. width: 1200px;
  1154. margin: 0 auto;
  1155. padding: 40px 0;
  1156. .el-tabs--card > .el-tabs__header .el-tabs__item.is-active {
  1157. border-color: #e7e7e7;
  1158. }
  1159. }
  1160. .main-bottom {
  1161. width: 1200px;
  1162. margin: 0 auto;
  1163. padding-bottom: 40px;
  1164. &-top {
  1165. display: flex;
  1166. justify-content: space-between;
  1167. p {
  1168. margin: 0;
  1169. font-weight: 500;
  1170. font-size: 24px;
  1171. line-height: 32px;
  1172. color: #1f2c5c;
  1173. font-family: initial;
  1174. }
  1175. .right {
  1176. color: rgba(0, 0, 0, 0.88);
  1177. font-weight: 400;
  1178. font-size: 16px;
  1179. line-height: 24px;
  1180. cursor: pointer;
  1181. a {
  1182. margin-right: 8px;
  1183. }
  1184. }
  1185. }
  1186. }
  1187. .list {
  1188. margin-top: 24px;
  1189. display: flex;
  1190. flex-wrap: wrap;
  1191. > div {
  1192. width: 200px;
  1193. border-radius: 8px;
  1194. overflow: hidden;
  1195. background: #ffffff;
  1196. margin-bottom: 24px;
  1197. }
  1198. }
  1199. }
  1200. .banner-box-close {
  1201. margin-top: 40px;
  1202. }
  1203. .sales-box {
  1204. display: flex;
  1205. // width: 592px;
  1206. padding: 16px;
  1207. border-radius: 4px;
  1208. background: #f5f5f5;
  1209. justify-content: space-between;
  1210. align-items: flex-end;
  1211. color: #adadad;
  1212. font-size: 14px;
  1213. font-weight: 400;
  1214. line-height: 22px;
  1215. .OPPOSans {
  1216. margin: 0 8px 0 16px;
  1217. color: #ea5939;
  1218. font-size: 32px;
  1219. font-weight: 500;
  1220. line-height: 40px;
  1221. }
  1222. .old-price {
  1223. color: rgba(0, 0, 0, 0.4);
  1224. font-size: 14px;
  1225. font-weight: 500;
  1226. line-height: 22px;
  1227. text-decoration: line-through;
  1228. }
  1229. }
  1230. </style>
  1231. <style lang="scss">
  1232. .bookItem {
  1233. .el-carousel__button {
  1234. width: 8px;
  1235. height: 8px;
  1236. background: #d9d9d9;
  1237. opacity: 1;
  1238. border-radius: 4px;
  1239. }
  1240. .el-carousel__indicator.is-active {
  1241. .el-carousel__button {
  1242. background: #5e5e5e;
  1243. }
  1244. }
  1245. .el-tabs__header {
  1246. margin: 0;
  1247. }
  1248. .el-tab-pane {
  1249. background: #f8f8f8;
  1250. border: 1px solid #e7e7e7;
  1251. border-top: none;
  1252. padding: 24px;
  1253. }
  1254. .el-tabs__item {
  1255. width: 160px;
  1256. height: 38px;
  1257. text-align: center;
  1258. font-weight: 500;
  1259. font-size: 14px;
  1260. line-height: 38px;
  1261. color: #1f2c5c;
  1262. &:hover {
  1263. background: #e7e7e7;
  1264. }
  1265. &.is-active {
  1266. // background: #3459D2;
  1267. // color: #EEF3FF;
  1268. border-bottom: none;
  1269. background: #e7e7e7;
  1270. }
  1271. }
  1272. }
  1273. .bookitem-dropdown.el-dropdown-menu {
  1274. padding: 4px;
  1275. .el-dropdown-menu__item {
  1276. font-weight: 500;
  1277. font-size: 16px;
  1278. line-height: 40px;
  1279. color: #000000;
  1280. }
  1281. .el-dropdown-menu__item:focus,
  1282. .el-dropdown-menu__item:not(.is-disabled):hover {
  1283. background: #fdecee;
  1284. border-radius: 4px;
  1285. color: #ea5939;
  1286. }
  1287. }
  1288. .bookItem-dialog {
  1289. .el-dialog__header,
  1290. .el-dialog__body {
  1291. padding: 0;
  1292. }
  1293. .el-dialog {
  1294. border: 1px solid #ebebeb;
  1295. box-shadow: 0px 6px 30px 5px rgba(0, 0, 0, 0.05),
  1296. 0px 16px 24px 2px rgba(0, 0, 0, 0.04),
  1297. 0px 8px 10px -5px rgba(0, 0, 0, 0.08);
  1298. border-radius: 8px;
  1299. overflow: hidden;
  1300. }
  1301. }
  1302. </style>