bookItem.vue 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016
  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)"><i class="el-icon-arrow-left"></i>{{info.study_phase_name}}版</a>
  13. <div class="border"></div>
  14. <p>{{info.name||info.iss_name}}</p>
  15. </div>
  16. <!-- <div class="navBar-right">
  17. <a @click="handleShare">
  18. <svg-icon icon-class="share-personal" className="icon-share"></svg-icon>
  19. <span>分享</span>
  20. </a>
  21. <a @click="handlelike">
  22. <svg-icon icon-class="like-line" className="icon-like"></svg-icon>
  23. <span>收藏</span>
  24. </a>
  25. </div> -->
  26. </div>
  27. <div class="main-top" v-if="info">
  28. <div class="main-top-inner">
  29. <el-carousel class="swiper-container" trigger="click" arrow="never" height="414px">
  30. <!-- <el-carousel-item v-for="(item1, index) in data.imgList" :key="index"> -->
  31. <el-image
  32. class="image"
  33. :src="info.cover_image_url||info.iss_cover_url?info.cover_image_url||info.iss_cover_url:bookType==='baozhi'?require('../../assets/baozhi'+(Math.floor(Math.random()*2)+1)+'.png'):require('../../assets/kecheng'+(Math.floor(Math.random()*3)+1)+'.png')"
  34. :fit="'cover'">
  35. </el-image>
  36. <!-- </el-carousel-item> -->
  37. </el-carousel>
  38. <div class="book-info-right">
  39. <h1 class="title">{{info.name||info.iss_name}}</h1>
  40. <!-- <b class="org">{{data.org}}</b><span class="date">2023.07.01-2023.07.21</span> -->
  41. <div class="sales-box" v-if="isBuy==='false'">
  42. <div class="sales-left">
  43. <span>优惠价</span>
  44. <span class="OPPOSans">¥{{info.hasOwnProperty('price_discount')||info.hasOwnProperty('iss_price_sell')?info.price_discount||info.iss_price_sell:info.price||info.iss_price_org|cutMoneyFiter}}</span>
  45. <span class="old-price" v-if="(info.hasOwnProperty('price_discount')&&info.price_discount!==info.price)||(info.hasOwnProperty('iss_price_sell')&&info.iss_price_sell!==info.iss_price_org)">¥{{info.price||info.iss_price_org|cutMoneyFiter}}</span>
  46. </div>
  47. <span class="sales-right" v-if="sales>=1000">累计销售 {{salesCn}}</span>
  48. </div>
  49. <div class="label-box">
  50. <label v-for="(itemL,indexL) in info.label_name_list||info.info_tag_data" :key="indexL" :style="{background:tagBg[indexL%3],color:tagColor[indexL%3]}">
  51. {{ '# ' + itemL }}
  52. </label>
  53. </div>
  54. <!-- <div class="book-describe">
  55. <h2 class="title">{{data.describe.title}}</h2>
  56. <span class="author">{{'BY '+data.describe.author}}</span>
  57. <p class="describe">{{data.describe.describe}}</p>
  58. </div> -->
  59. <div class="info-box" v-if="bookType==='baozhi'">
  60. <div class="info-item">
  61. <label>出版社</label>
  62. <span>{{info.vendor_name?info.vendor_name:'21世纪报社'}}</span>
  63. </div>
  64. <!-- <div class="info-item">
  65. <label>字数</label>
  66. <span>78291</span>
  67. </div> -->
  68. <div class="info-item">
  69. <label>发行时间</label>
  70. <span>{{info.release_date}}</span>
  71. </div>
  72. <div class="info-item">
  73. <label>语种</label>
  74. <span>中英双语</span>
  75. </div>
  76. <div class="info-item">
  77. <label>期数</label>
  78. <span>{{info.iss_no}} 期</span>
  79. </div>
  80. <div class="info-item">
  81. <label>学段</label>
  82. <span>{{info.study_phase_name}}</span>
  83. </div>
  84. <!-- <div class="info-item">
  85. <label>版本</label>
  86. <span>基础版</span>
  87. </div> -->
  88. </div>
  89. <div class="info-box" v-if="bookType==='LB'">
  90. <div class="info-item">
  91. <label>出版社</label>
  92. <span>{{info.org_name}}</span>
  93. </div>
  94. <div class="info-item" v-if="bookType==='LB'">
  95. <label>教师</label>
  96. <span>{{info.teacher_name_list.join('、')}}</span>
  97. </div>
  98. <div class="info-item">
  99. <label>类型</label>
  100. <span>录播课</span>
  101. </div>
  102. <div class="info-item">
  103. <label>课时</label>
  104. <span>{{courseList.length+' 课时'}}</span>
  105. </div>
  106. <div class="info-item">
  107. <label>有效期</label>
  108. <span>{{info.effective_month_count + ' 个月'}}</span>
  109. </div>
  110. <div class="info-item">
  111. <label>学段</label>
  112. <span>{{info.study_phase_name}}</span>
  113. </div>
  114. </div>
  115. <div class="btn-box">
  116. <a class="continue" v-if="isBuy==='true'" @click="handleLink">继续学习</a>
  117. <template v-else>
  118. <a class="el-button" @click="handleChangeWay('wei')" :loading="createOrderLoading">立即购买</a>
  119. <a class="upgrade" @click="handleChangeWay('dui')">使用兑换码</a>
  120. </template>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. <div class="main-center" v-if="info">
  126. <el-tabs type="card" style="margin-bottom:24px;">
  127. <el-tab-pane label="简介">
  128. <div v-html="info.intro||info.iss_note"></div>
  129. </el-tab-pane>
  130. </el-tabs>
  131. <el-tabs type="card">
  132. <!-- <el-tab-pane :label="bookType==='course'?'课程简介':'简介'">
  133. </el-tab-pane> -->
  134. <el-tab-pane label="目录" v-if="bookType==='baozhi'">
  135. <tree-list
  136. :data="issueChnList"
  137. :isBuy="isBuy==='true'"
  138. :headerBg="headerBg"
  139. :headerBorder="headerBorder"
  140. :userBg="userBg"
  141. :LoginNavIndex="LoginNavIndex"
  142. :cardType="bookType">
  143. </tree-list>
  144. </el-tab-pane>
  145. <el-tab-pane label="目录" v-if="bookType==='huakan'">
  146. <!-- <div class="list">
  147. <div
  148. v-for="(item,index) in guessList"
  149. :key="index+'todayNew'"
  150. :style="{
  151. marginLeft:index==0||index%5==0?'0':'37px',
  152. }"
  153. >
  154. <BookCard
  155. :item="item"
  156. :headerBg="headerBg"
  157. :headerBorder="headerBorder"
  158. :userBg="userBg"
  159. :LoginNavIndex="LoginNavIndex"
  160. :previousPage="previousPage"
  161. />
  162. </div>
  163. </div> -->
  164. <tree-list
  165. :data="data.treeLists"
  166. :isBuy="isBuy==='true'"
  167. :headerBg="headerBg"
  168. :headerBorder="headerBorder"
  169. :userBg="userBg"
  170. :LoginNavIndex="LoginNavIndex"
  171. :cardType="bookType">
  172. </tree-list>
  173. </el-tab-pane>
  174. <el-tab-pane label="课程目录" v-if="bookType==='LB'">
  175. <course-list
  176. :data="courseList"
  177. :isBuy="isBuy==='true'"
  178. :headerBg="headerBg"
  179. :headerBorder="headerBorder"
  180. :userBg="userBg"
  181. :LoginNavIndex="LoginNavIndex"
  182. :cardType="info.type">
  183. </course-list>
  184. </el-tab-pane>
  185. </el-tabs>
  186. <div class="banner-box-close" v-if="bannerFlag">
  187. <a v-if="1==2" href="#" target="_blank">
  188. <img class="banner-item" src="../../assets/banner4.png" />
  189. </a>
  190. <img v-else class="banner-item" src="../../assets/banner4.png" />
  191. <div class="close-box">
  192. <a class="close-btn" @click="bannerFlag=false"><i class="el-icon-close"></i></a>
  193. <span class="close-tips">广告</span>
  194. </div>
  195. </div>
  196. </div>
  197. <el-dialog
  198. :visible.sync="paymentShow"
  199. :show-close="false"
  200. :close-on-click-modal="false"
  201. width="712px"
  202. class="bookItem-dialog"
  203. v-if="paymentShow">
  204. <Payment :data="info" :payWay="payWay" @handleClose="handleClose" :orderId="orderId" :qr_code_url="qr_code_url" :order_amount="order_amount" />
  205. </el-dialog>
  206. </div>
  207. </template>
  208. <script>
  209. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  210. //例如:import 《组件名称》from ‘《组件路径》';
  211. import Header from "../../components/Header.vue";
  212. import BookCard from "@/components/common/BookCard.vue"
  213. import Payment from "./components/Payment.vue"
  214. import TreeList from "./components/TreeList"
  215. import CourseList from "./components/CourseList.vue"
  216. import { cutMoneyFiter } from '@/utils/defined';
  217. import { getLogin, getNoToken } from "@/api/ajax";
  218. import { getToken } from '@/utils/auth'
  219. export default {
  220. //import引入的组件需要注入到对象中才能使用
  221. components: { Header, BookCard, Payment, TreeList, CourseList },
  222. props: [],
  223. filters:{
  224. cutMoneyFiter
  225. },
  226. data() {
  227. //这里存放数据
  228. return {
  229. config: this.$route.query.headerConfig?decodeURIComponent(this.$route.query.headerConfig):'',
  230. LoginNavIndex: 0,
  231. userBg: 'rgba(0, 0, 0, 0.24)',
  232. headerBorder: '#5C5C5C',
  233. headerBg: '#1F1F1F',
  234. previousPage: '商城',
  235. data:{
  236. navTitle: '第 815 期 Celebrating new King',
  237. title: '第 815 期 Celebrating new King',
  238. org: '二十一世纪英文报',
  239. tagList: ['中英双语','经典读物','初中必读'],
  240. imgList:[
  241. require('../../assets/img1.png'), require('../../assets/bookcard-image.png'),
  242. ],
  243. describe:{
  244. title: 'Bring books up to date',
  245. author: 'TEENS',
  246. describe: 'Should childrenn read the original or adapted version? 英国童书再版遭大量删改引争议 词数 372 测试见IV版 建议阅读时间 5分钟 Puffin ...'
  247. },
  248. price: '3.9',
  249. oldPrice: '5.99',
  250. isBuy: this.$route.query.isBuy?this.$route.query.isBuy:false,
  251. treeList: [
  252. {
  253. number: '1',
  254. title: 'FRONTPAGE',
  255. children:[
  256. {
  257. number:'1.1',
  258. title:'Meeting Foreigners at an Airport'
  259. }
  260. ]
  261. },
  262. {
  263. number: '2',
  264. title: 'OUR WORLD',
  265. children:[
  266. {
  267. number:'2.1',
  268. title:'Out in the fields'
  269. },
  270. {
  271. number:'2.2',
  272. title:'IN BRIEF 新闻速览'
  273. },
  274. {
  275. number: '2.3',
  276. title:'XI’S WORDS 英语学习'
  277. },
  278. {
  279. number:'2.4',
  280. title:'WORLD LENS 图行天下'
  281. },
  282. {
  283. number: '2.5',
  284. title:'4,200'
  285. }
  286. ]
  287. },
  288. {
  289. number: '3',
  290. title: 'SCIENCE STUDY',
  291. children: [
  292. {
  293. number: '3.1',
  294. title:'Listened to by aliens'
  295. },
  296. {
  297. number: '3.2',
  298. title: 'Wearable mushrooms'
  299. },
  300. {
  301. number:'3.3',
  302. title:'Lend a helping fin'
  303. }
  304. ]
  305. },
  306. {
  307. number: '4',
  308. title: 'READING & WRITING',
  309. children: [
  310. {
  311. number: '4.1',
  312. title:'What’s the word 短文填空'
  313. },
  314. {
  315. number: '4.2',
  316. title: '任务型阅读:我的身体我做主'
  317. }
  318. ]
  319. }
  320. ],
  321. treeLists: [
  322. {
  323. number: '1',
  324. title: 'Nature',
  325. children:[
  326. {
  327. number:'1.1',
  328. title:'‘King’ of the desert'
  329. }
  330. ]
  331. },
  332. {
  333. number: '2',
  334. title: 'My works',
  335. children:[
  336. {
  337. number:'2.1',
  338. title:'I love summer'
  339. }
  340. ]
  341. },
  342. {
  343. number: '3',
  344. title: 'Front page',
  345. children: [
  346. {
  347. number: '3.1',
  348. title:'2023年3月画刊完整音频'
  349. }
  350. ]
  351. },
  352. {
  353. number: '4',
  354. title: 'Art zone',
  355. children: [
  356. {
  357. number: '4.1',
  358. title:'Art zone'
  359. }
  360. ]
  361. }
  362. ],
  363. },
  364. guessList: [{
  365. src: require('../../assets/bookcard-image.png'),
  366. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  367. price: "3.00",
  368. oldprice: "3.00",
  369. author: "作者",
  370. score: 3,
  371. progress: "90%"
  372. },
  373. {
  374. src: require('../../assets/bookcard-image.png'),
  375. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  376. price: "3.00",
  377. oldprice: "3.00",
  378. author: "作者",
  379. score: 3,
  380. },
  381. {
  382. src: require('../../assets/bookcard-image.png'),
  383. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  384. price: "3.00",
  385. oldprice: "3.00",
  386. author: "作者",
  387. score: 3,
  388. },
  389. {
  390. src: require('../../assets/bookcard-image.png'),
  391. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  392. price: "3.00",
  393. oldprice: "3.00",
  394. author: "作者",
  395. score: 3,
  396. },
  397. {
  398. src: require('../../assets/bookcard-image.png'),
  399. name: "名称名称名称名称名称名称名称名称名称名称名称名称",
  400. price: "3.00",
  401. oldprice: "3.00",
  402. author: "作者",
  403. score: 3,
  404. }
  405. ],
  406. tagBg:['#C9EBFF','#FFFAC9','#D7C9FF'], // 标签背景色
  407. tagColor:['#006DAA','#AA8500','#7849C4'], // 标签字体颜色
  408. paymentShow: false, // 支付弹窗
  409. payWay:this.$route.query.paywei?this.$route.query.paywei:'dui',
  410. bookType: this.$route.query.cardType?this.$route.query.cardType:'baozhi', // 书籍类型
  411. bannerFlag: true, // 是否展示广告
  412. id: this.$route.query.id?this.$route.query.id:'',
  413. info: null, // 信息
  414. courseList:[],
  415. sales: null,
  416. salesCn: '',
  417. isBuy: 'false',
  418. userMessage: getToken()?JSON.parse(getToken()):null,
  419. orderId: '',
  420. qr_code_url: '',
  421. pre_play_cs_item_id: '', //上次阅读课节id
  422. pre_play_index: null, // 上次阅读索引
  423. issueChnList:[],
  424. order_amount: null,
  425. createOrderLoading: false
  426. }
  427. },
  428. //计算属性 类似于data概念
  429. computed: {},
  430. //监控data中数据变化
  431. watch: {},
  432. //方法集合
  433. methods: {
  434. // 分享
  435. handleShare(){
  436. },
  437. // 收藏
  438. handlelike(){
  439. },
  440. handleChangeWay(type){
  441. if(!this.userMessage){
  442. this.$refs.header.handleLogin('/bookItem?headerConfig='+this.$route.query.headerConfig+'&cardType='+this.bookType+'&id='+this.id+'&paywei='+type,'url')
  443. return false
  444. }
  445. this.payWay = type;
  446. this.handleOrder()
  447. },
  448. // 关闭弹窗
  449. handleClose(){
  450. this.paymentShow = false
  451. this.getInfo()
  452. },
  453. // 详情
  454. getInfo(){
  455. let MethodName = "/CourseServer/Client/LBCourseQuery/GetLBCourseInfo";
  456. let data = null
  457. if(this.bookType==='LB'){
  458. data = {
  459. id: this.id,
  460. is_contain_cs_item: "true",
  461. cs_item_sort_mode: "ASCE"
  462. }
  463. }else if(this.bookType==='baozhi'){
  464. MethodName = '/PaperServer/Client/Issue/GetIssueBriefInfo'
  465. data = {
  466. id: this.id,
  467. }
  468. }
  469. getLogin(MethodName, data)
  470. .then((res) => {
  471. if(res.status===1){
  472. if(this.bookType==='LB'){
  473. this.info = res.lb_course
  474. if(res.my_play_record.pre_play_cs_item_id){
  475. this.pre_play_cs_item_id = res.my_play_record.pre_play_cs_item_id
  476. }
  477. this.courseList = this.handleCourseLength(res.cs_item_list)
  478. }else if(this.bookType==='baozhi'){
  479. this.info = res.data
  480. this.issueChnList = res.data.chn_art_data
  481. }
  482. }
  483. })
  484. .catch(() => {
  485. });
  486. if(this.userMessage){
  487. getLogin('/ShopServer/Client/BookshelfQuery/GetGoodsBuyStatus', {
  488. goods_type: this.bookType==='LB'?0:this.bookType==='baozhi'?2:null,
  489. goods_id: this.id
  490. })
  491. .then((res) => {
  492. if(res.status===1){
  493. this.isBuy = res.buy_info.is_buy
  494. this.sales = res.data.sold_count
  495. if(this.sales<1000){
  496. this.salesCn = ''
  497. }else if(1000<=this.sales&&this.sales<10000){
  498. this.salesCn = this.sales.toString().substring(0,1)+'000+'
  499. }else if(10000<=this.sales&&this.sales<100000){
  500. this.salesCn = this.sales.toString().substring(0,1)+'万+'
  501. }else if(100000<=this.sales&&this.sales<1000000){
  502. this.salesCn = this.sales.toString().substring(0,1)+'0万+'
  503. }else if(1000000<=this.sales&&this.sales<10000000){
  504. this.salesCn = this.sales.toString().substring(0,1)+'00万+'
  505. }else if(10000000<=this.sales&&this.sales<100000000){
  506. this.salesCn = this.sales.toString().substring(0,1)+'000万+'
  507. }else if(100000000<=this.sales){
  508. this.salesCn = this.sales.toString().substring(0,1)+'亿+'
  509. }
  510. }
  511. })
  512. .catch(() => {
  513. });
  514. }else{
  515. getNoToken('/ShopServer/Client/BookshelfQuery/GetGoodsBuyStatus', {
  516. goods_type: this.bookType==='LB'?0:this.bookType==='baozhi'?2:null,
  517. goods_id: this.id
  518. }, 'VOID')
  519. .then((res) => {
  520. if(res.status===1){
  521. this.isBuy = res.buy_info.is_buy
  522. this.sales = res.data.sold_count
  523. if(this.sales<1000){
  524. this.salesCn = ''
  525. }else if(1000<=this.sales&&this.sales<10000){
  526. this.salesCn = this.sales.toString().substring(0,1)+'000+'
  527. }else if(10000<=this.sales&&this.sales<100000){
  528. this.salesCn = this.sales.toString().substring(0,1)+'万+'
  529. }else if(100000<=this.sales&&this.sales<1000000){
  530. this.salesCn = this.sales.toString().substring(0,1)+'0万+'
  531. }else if(1000000<=this.sales&&this.sales<10000000){
  532. this.salesCn = this.sales.toString().substring(0,1)+'00万+'
  533. }else if(10000000<=this.sales&&this.sales<100000000){
  534. this.salesCn = this.sales.toString().substring(0,1)+'000万+'
  535. }else if(100000000<=this.sales){
  536. this.salesCn = this.sales.toString().substring(0,1)+'亿+'
  537. }
  538. }
  539. })
  540. .catch(() => {
  541. });
  542. }
  543. },
  544. // 处理授课时长 小于1分钟的按1分钟 之后个位数四舍五入
  545. handleCourseLength(list){
  546. let listArr = JSON.parse(JSON.stringify(list))
  547. listArr.forEach((item,index) => {
  548. if(item.file_media_duration){
  549. if(item.file_media_duration<60){
  550. item.timeCn = '1分钟'
  551. }else if(item.file_media_duration<600){
  552. item.timeCn = Math.ceil(item.file_media_duration/60)+'分钟'
  553. }else{
  554. let first = Math.ceil(item.file_media_duration/60).toString().substring(0,Math.ceil(item.file_media_duration/60).toString().length-1)*1
  555. let last = Math.ceil(item.file_media_duration/60).toString().substring(Math.ceil(item.file_media_duration/60).toString().length-1)*1
  556. if(last<5){
  557. item.timeCn = first+'0分钟'
  558. }else{
  559. item.timeCn = (first+1)+'0分钟'
  560. }
  561. }
  562. }else{
  563. item.timeCn = '-'
  564. }
  565. if(item.id===this.pre_play_cs_item_id){
  566. this.pre_play_index = index
  567. }
  568. });
  569. return listArr
  570. },
  571. // 生成订单
  572. handleOrder(){
  573. this.createOrderLoading = true
  574. let MethodName = "/ShopServer/Client/OrderManager/CreateOrder";
  575. let data = {
  576. goods_type: this.bookType==='LB'?0:this.bookType==='baozhi'?2:null,
  577. goods_id_list: [this.id],
  578. pay_type: this.payWay==='wei'?3:this.payWay==='zhi'?4:this.payWay==='dui'?5:null
  579. }
  580. getLogin(MethodName, data)
  581. .then((res) => {
  582. this.createOrderLoading = false
  583. if(res.status === 1){
  584. this.order_amount = res.order_amount
  585. if(this.order_amount<=0){
  586. this.getInfo()
  587. }else{
  588. this.orderId = res.id
  589. this.qr_code_url = res.qr_code_url
  590. this.paymentShow = true;
  591. }
  592. }
  593. }).catch(()=>{
  594. this.createOrderLoading = false
  595. })
  596. // this.paymentShow = true;
  597. },
  598. // 跳转
  599. async handleLink(){
  600. let url = this.LoginNavIndex +'&&&'+ this.userBg +'&&&'+ this.headerBorder +'&&&'+ this.headerBg
  601. if(this.bookType==='baozhi'){
  602. let articleId = ''
  603. if(this.info.last_read_art_id){
  604. articleId = this.info.last_read_art_id
  605. }else{
  606. for(let i = 0; i<this.issueChnList.length; i++){
  607. if(articleId){
  608. break
  609. }
  610. if(this.issueChnList[i].arts&&this.issueChnList[i].arts.length>0){
  611. for(let j=0; j<this.issueChnList[i].arts.length;j++){
  612. if(this.issueChnList[i].arts[j].id){
  613. articleId = this.issueChnList[i].arts[j].id
  614. break
  615. }
  616. }
  617. }
  618. }
  619. }
  620. let MethodName = "/PaperServer/Client/Issue/SaveLastReadArtInIss";
  621. let data = {
  622. iss_id: this.$route.query.id,
  623. art_id: articleId
  624. }
  625. await getLogin(MethodName, data)
  626. .then((res) => {
  627. })
  628. this.$router.push({
  629. path: "/articleDetail",
  630. query: {
  631. headerConfig: encodeURIComponent(url),
  632. id: articleId,
  633. iss_id: this.$route.query.id
  634. },
  635. });
  636. }else{
  637. this.$router.push({
  638. path: this.info.type===1?"/courseDetail":"/videoDetail",
  639. query: {
  640. headerConfig: encodeURIComponent(url),
  641. index: this.pre_play_index,
  642. id: this.id
  643. },
  644. });
  645. }
  646. }
  647. },
  648. //生命周期 - 创建完成(可以访问当前this实例)
  649. created() {
  650. if(this.config){
  651. let arr = this.config.split('&&&')
  652. this.LoginNavIndex = arr[0] * 1
  653. this.userBg = arr[1] ? arr[1] : 'rgba(0, 0, 0, 0.24)'
  654. this.headerBorder = arr[2] ? arr[2] : '#5C5C5C'
  655. this.headerBg = arr[3] ? arr[3] : '#1F1F1F'
  656. this.previousPage = arr[4] ? arr[4] : '商城'
  657. }
  658. this.getInfo()
  659. if(this.$route.query.paywei){
  660. this.handleOrder()
  661. }
  662. },
  663. //生命周期 - 挂载完成(可以访问DOM元素)
  664. mounted() {
  665. },
  666. //生命周期-创建之前
  667. beforeCreated() { },
  668. //生命周期-挂载之前
  669. beforeMount() { },
  670. //生命周期-更新之前
  671. beforUpdate() { },
  672. //生命周期-更新之后
  673. updated() { },
  674. //生命周期-销毁之前
  675. beforeDestory() { },
  676. //生命周期-销毁完成
  677. destoryed() { },
  678. //如果页面有keep-alive缓存功能,这个函数会触发
  679. activated() { }
  680. }
  681. </script>
  682. <style lang="scss" scoped>
  683. /* @import url(); 引入css类 */
  684. .bookItem {
  685. background: #F7F8FA;
  686. min-height: 100%;
  687. .main-top {
  688. background: #FFFFFF;
  689. padding: 48px 0;
  690. margin-top: 56px;
  691. &-inner{
  692. width: 1200px;
  693. margin: 0 auto;
  694. display: flex;
  695. .swiper-container{
  696. width: 416px;
  697. height: 440px;
  698. text-align: center;
  699. .el-image{
  700. width: 297px;
  701. height: 414px;
  702. border: 1px solid #F3F3F3;
  703. }
  704. }
  705. .book-info-right{
  706. flex: 1;
  707. padding-left: 88px;
  708. .title{
  709. color: #2F3742;
  710. font-weight: 500;
  711. font-size: 32px;
  712. line-height: 44px;
  713. margin: 0 0 16px 0;
  714. }
  715. .org,.date{
  716. font-weight: 500;
  717. font-size: 14px;
  718. line-height: 22px;
  719. color: rgba(0, 0, 0, 0.4);
  720. }
  721. .date{
  722. margin-left: 32px;
  723. line-height: 24px;
  724. }
  725. .label-box{
  726. display: flex;
  727. flex-flow: wrap;
  728. margin: 16px 0;
  729. label{
  730. margin: 0 8px 8px 0;
  731. border-radius: 20px;
  732. padding: 4px 12px;
  733. font-weight: 400;
  734. font-size: 14px;
  735. line-height: 22px;
  736. }
  737. }
  738. .book-describe{
  739. border-top: 1px solid #E5E6EB;
  740. border-bottom: 1px solid #E5E6EB;
  741. padding: 16px 0;
  742. .title{
  743. font-weight: 500;
  744. font-size: 16px;
  745. line-height: 24px;
  746. color: #000000;
  747. margin-bottom: 8px;
  748. }
  749. .author{
  750. font-weight: 400;
  751. font-size: 12px;
  752. line-height: 20px;
  753. color: #000000;
  754. margin-bottom: 8px;
  755. display: block;
  756. }
  757. .describe{
  758. font-weight: 400;
  759. font-size: 14px;
  760. line-height: 22px;
  761. color: #000000;
  762. margin: 0;
  763. }
  764. }
  765. .price-box{
  766. padding: 20px 0 16px 0;
  767. display: flex;
  768. align-items: flex-end;
  769. .price{
  770. font-weight: 500;
  771. font-size: 32px;
  772. line-height: 40px;
  773. color: #EA5939;
  774. }
  775. .oldPrice{
  776. padding: 0 0 2px 7px;
  777. font-weight: 500;
  778. font-size: 14px;
  779. line-height: 22px;
  780. color: rgba(0, 0, 0, 0.4);
  781. text-decoration-line: line-through;
  782. }
  783. }
  784. .info-box{
  785. display: flex;
  786. flex-flow: wrap;
  787. border-bottom: 1px solid #EBEBEB;
  788. margin-bottom: 24px;
  789. .info-item{
  790. width: 50%;
  791. margin-bottom: 15px;
  792. font-size: 14px;
  793. line-height: 22px;
  794. display: flex;
  795. label{
  796. color: #C2C2C2;
  797. font-weight: 400;
  798. margin-right: 16px;
  799. width: 58px;
  800. display: block;
  801. text-align:justify;
  802. text-justify:distribute-all-lines;
  803. text-align-last:justify;
  804. -moz-text-align-last:justify;
  805. -webkit-text-align-last:justify;
  806. }
  807. }
  808. }
  809. .btn-box{
  810. display: flex;
  811. .el-button{
  812. width: 112px;
  813. height: 40px;
  814. background: #EA5939;
  815. box-shadow: 0px 8px 16px rgba(234, 89, 57, 0.24);
  816. border-radius: 4px;
  817. font-weight: 500;
  818. font-size: 16px;
  819. color: #FFFFFF;
  820. border: none;
  821. }
  822. .svg-icon{
  823. margin-left: 7px;
  824. }
  825. .continue{
  826. width: 112px;
  827. height: 40px;
  828. background: #175DFF;
  829. border-radius: 4px;
  830. font-weight: 500;
  831. font-size: 16px;
  832. line-height: 40px;
  833. color: rgba(255, 255, 255, 1);
  834. display: block;
  835. text-align: center;
  836. box-shadow: 0px 8px 16px rgba(23, 93, 255, 0.24);
  837. }
  838. .upgrade{
  839. margin-left: 16px;
  840. display: block;
  841. padding: 0px 24px;
  842. height: 40px;
  843. background: #E9E9E9;
  844. box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.06);
  845. border-radius: 4px;
  846. color: #595959;
  847. font-weight: 500;
  848. font-size: 16px;
  849. line-height: 40px;
  850. text-align: center;
  851. width: 130px;
  852. }
  853. }
  854. }
  855. }
  856. }
  857. .main-center{
  858. width: 1200px;
  859. margin: 0 auto;
  860. padding: 40px 0;
  861. .el-tabs--card>.el-tabs__header .el-tabs__item.is-active{
  862. border-color: #E7E7E7;
  863. }
  864. }
  865. .main-bottom{
  866. width: 1200px;
  867. margin: 0 auto;
  868. padding-bottom: 40px;
  869. &-top{
  870. display: flex;
  871. justify-content: space-between;
  872. p{
  873. margin: 0;
  874. font-weight: 500;
  875. font-size: 24px;
  876. line-height: 32px;
  877. color: #1F2C5C;
  878. font-family: initial;
  879. }
  880. .right{
  881. color: rgba(0, 0, 0, 0.88);
  882. font-weight: 400;
  883. font-size: 16px;
  884. line-height: 24px;
  885. cursor: pointer;
  886. a{
  887. margin-right: 8px;
  888. }
  889. }
  890. }
  891. }
  892. .list {
  893. margin-top: 24px;
  894. display: flex;
  895. flex-wrap: wrap;
  896. > div {
  897. width: 200px;
  898. border-radius: 8px;
  899. overflow: hidden;
  900. background: #ffffff;
  901. margin-bottom: 24px;
  902. }
  903. }
  904. }
  905. .banner-box-close{
  906. margin-top: 40px;
  907. }
  908. .sales-box{
  909. display: flex;
  910. width: 592px;
  911. padding: 16px;
  912. border-radius: 4px;
  913. background: #F5F5F5;
  914. justify-content: space-between;
  915. align-items: flex-end;
  916. color: #ADADAD;
  917. font-size: 14px;
  918. font-weight: 400;
  919. line-height: 22px;
  920. .OPPOSans{
  921. margin: 0 8px 0 16px;
  922. color: #EA5939;
  923. font-size: 32px;
  924. font-weight: 500;
  925. line-height: 40px;
  926. }
  927. .old-price{
  928. color: rgba(0, 0, 0, 0.40);
  929. font-size: 14px;
  930. font-weight: 500;
  931. line-height: 22px;
  932. text-decoration: line-through;
  933. }
  934. }
  935. </style>
  936. <style lang="scss">
  937. .bookItem{
  938. .el-carousel__button{
  939. width: 8px;
  940. height: 8px;
  941. background: #D9D9D9;
  942. opacity: 1;
  943. border-radius: 4px;
  944. }
  945. .el-carousel__indicator.is-active{
  946. .el-carousel__button{
  947. background: #5E5E5E;
  948. }
  949. }
  950. .el-tabs__header{
  951. margin: 0;
  952. }
  953. .el-tab-pane{
  954. background: #F8F8F8;
  955. border: 1px solid #E7E7E7;
  956. border-top: none;
  957. padding: 24px;
  958. }
  959. .el-tabs__item{
  960. width: 160px;
  961. height: 38px;
  962. text-align: center;
  963. font-weight: 500;
  964. font-size: 14px;
  965. line-height: 38px;
  966. color: #1F2C5C;
  967. &:hover{
  968. background: #E7E7E7;
  969. }
  970. &.is-active{
  971. // background: #3459D2;
  972. // color: #EEF3FF;
  973. border-bottom: none;
  974. background: #E7E7E7;
  975. }
  976. }
  977. }
  978. .bookitem-dropdown.el-dropdown-menu{
  979. padding: 4px;
  980. .el-dropdown-menu__item{
  981. font-weight: 500;
  982. font-size: 16px;
  983. line-height: 40px;
  984. color: #000000;
  985. }
  986. .el-dropdown-menu__item:focus, .el-dropdown-menu__item:not(.is-disabled):hover{
  987. background: #FDECEE;
  988. border-radius: 4px;
  989. color: #EA5939;
  990. }
  991. }
  992. .bookItem-dialog{
  993. .el-dialog__header,.el-dialog__body{
  994. padding: 0;
  995. }
  996. .el-dialog{
  997. border: 1px solid #EBEBEB;
  998. box-shadow: 0px 6px 30px 5px rgba(0, 0, 0, 0.05), 0px 16px 24px 2px rgba(0, 0, 0, 0.04), 0px 8px 10px -5px rgba(0, 0, 0, 0.08);
  999. border-radius: 8px;
  1000. overflow: hidden;
  1001. }
  1002. }
  1003. </style>