Subscribe.vue 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144
  1. <template>
  2. <div class="bookItem">
  3. <Header
  4. :headerBg="headerBg"
  5. :headerBorder="headerBorder"
  6. :userBg="userBg"
  7. />
  8. <div class="navBar" v-if="info">
  9. <div class="navBar-left">
  10. <a class="goback" @click="$router.go(-1)"><i class="el-icon-arrow-left"></i>主页</a>
  11. <div class="border"></div>
  12. <p>{{bookType==='jingdu'?'二十一世纪英文报·精读课堂':'二十一世纪英文报'}}</p>
  13. </div>
  14. </div>
  15. <div class="main-top" v-if="info">
  16. <div class="main-top-inner">
  17. <el-carousel class="swiper-container" trigger="click" arrow="never" height="414px">
  18. <!-- <el-carousel-item v-for="(item1, index) in data.imgList" :key="index"> -->
  19. <el-image
  20. class="image"
  21. :src="bookType==='jingdu'?require('../../assets/cover-order-jingdu.png'):require('../../assets/cover-order-'+studyType+'.png')"
  22. :fit="'contain'">
  23. </el-image>
  24. <!-- </el-carousel-item> -->
  25. </el-carousel>
  26. <div class="book-info-right" v-loading="loading">
  27. <h1 class="title">{{bookType==='jingdu'?'Teens 精读课堂('+studyTypeName+')':'《二十一世纪学生英文报》'}}</h1>
  28. <!-- <b class="org">{{data.org}}</b><span class="date">2023.07.01-2023.07.21</span> -->
  29. <div class="sales-box">
  30. <div class="sales-left">
  31. <span>订阅价格</span>
  32. <span class="OPPOSans">¥{{info.price_reservation|cutMoneyFiter}}</span>
  33. <!-- <span class="old-price" v-if="info.price_discount&&info.price_discount!==info.price">¥{{info.price|cutMoneyFiter}}</span> -->
  34. <b>元 / 期</b>
  35. </div>
  36. <span class="sales-right" v-if="sales>=1000">累计订阅 {{salesCn}}</span>
  37. </div>
  38. <!-- <div class="label-box">
  39. <label v-for="(itemL,indexL) in info.label_name_list" :key="indexL" :style="{background:tagBg[indexL%3],color:tagColor[indexL%3]}">
  40. {{ '# ' + itemL }}
  41. </label>
  42. </div> -->
  43. <!-- <div class="book-describe">
  44. <h2 class="title">{{data.describe.title}}</h2>
  45. <span class="author">{{'BY '+data.describe.author}}</span>
  46. <p class="describe">{{data.describe.describe}}</p>
  47. </div> -->
  48. <div class="info-box">
  49. <div class="info-item">
  50. <label>适合年龄</label>
  51. <span>{{info.issue_info.age_desc}}</span>
  52. </div>
  53. <div class="info-item">
  54. <label>期刊页数</label>
  55. <span>{{info.issue_info.page_count_desc}}</span>
  56. <el-tooltip placement="right" v-if="bookType==='baozhi'">
  57. <div slot="content">双刊、特辑、寒暑假合刊除外</div>
  58. <el-button class="tooltip-btn"><svg-icon icon-class="icon-mark"></svg-icon></el-button>
  59. </el-tooltip>
  60. </div>
  61. <div class="info-item">
  62. <label>出版周期</label>
  63. <span>{{info.issue_info.period_desc}}</span>
  64. </div>
  65. <div class="info-item">
  66. <label>期刊定价</label>
  67. <span v-if="bookType==='baozhi'">{{info.issue_info.price}}元/期</span>
  68. <span v-else-if="bookType==='jingdu'">{{info.issue_info.price}}元/年</span>
  69. <el-tooltip placement="right" v-if="bookType==='baozhi'">
  70. <div slot="content">双刊、特辑、寒暑假合刊除外</div>
  71. <el-button class="tooltip-btn"><svg-icon icon-class="icon-mark"></svg-icon></el-button>
  72. </el-tooltip>
  73. </div>
  74. <div class="info-item" style="width:100%;">
  75. <label>主办单位</label>
  76. <span>{{info.issue_info.organizer}}</span>
  77. </div>
  78. </div>
  79. <div class="info-box order-box">
  80. <div class="info-item order-item" style="margin-bottom:16px">
  81. <label>订阅学段</label>
  82. <div class="order-content">
  83. <ul>
  84. <li v-for="item in bookType==='baozhi'?$studyType:studyTypeList" :key="item.study_phase" :class="[studyType===item.study_phase?'active':'']" @click="changeStudy(item)">
  85. {{item.study_phase_name}}
  86. </li>
  87. </ul>
  88. </div>
  89. </div>
  90. <div class="info-item order-item" style="margin-bottom:16px" v-if="bookType==='baozhi'">
  91. <label>订阅期数</label>
  92. <div class="order-content">
  93. <ul>
  94. <li v-for="item in orderList" :key="item.value" :class="[orderTotalNumber===item.value?'active':'']" @click="changeOrderNumber(item)">
  95. {{item.label}}
  96. </li>
  97. <el-tooltip placement="right" style="height:32px">
  98. <div slot="content" v-html="rules"></div>
  99. <el-button class="tooltip-btn"><svg-icon icon-class="icon-mark"></svg-icon></el-button>
  100. </el-tooltip>
  101. </ul>
  102. <div v-if="orderTotalNumber===-1&&info.issue_no_school_year_list.length>0" class="custom-box">
  103. <div class="custom-box-top">
  104. <h5>{{info.issue_no_school_year_list[customPage].year_begin +'-'+info.issue_no_school_year_list[customPage].year_end +' 学年'}}</h5>
  105. <div class="btn-box">
  106. <a @click="changeCustomPage('-')"><i class="el-icon-arrow-left"></i></a>
  107. <a @click="changeCustomPage('+')"><i class="el-icon-arrow-right"></i></a>
  108. </div>
  109. </div>
  110. <ul class="custom-box-bottom">
  111. <li v-for="(itemc,indexc) in info.issue_no_school_year_list[customPage].issue_no_list" :key="indexc" :style="{width:itemc.width?itemc.width*52+'px':'',borderRight:itemc.farRight?'none !important':'',borderBottom:itemc.farBottom?'none !important':''}" :class="[customOrderNumberList.indexOf(itemc.issue_no)>-1?'active':'']" @click="changeCustomOrder(itemc)">
  112. <el-tooltip placement="bottom">
  113. <div slot="content">
  114. 第 {{itemc.issue_no}} 期<br/>
  115. 出版日期:{{itemc.shelve_date}}</div>
  116. <el-button class="custom-btn">{{itemc.issue_no}}</el-button>
  117. </el-tooltip>
  118. </li>
  119. </ul>
  120. </div>
  121. <b v-if="orderTotalNumber!==-1">{{info.issue_no_begin}} - {{info.issue_no_end}}</b>
  122. <b v-else>已选 {{customOrderNumberList.length}} 期</b>
  123. <el-tooltip placement="bottom" style="height:32px">
  124. <div slot="content">
  125. <el-table
  126. class="order-table"
  127. :data="orderTable"
  128. max-height="200px"
  129. style="width: 317px">
  130. <el-table-column
  131. label="#"
  132. type="index"
  133. width="30">
  134. </el-table-column>
  135. <el-table-column
  136. property="issue_no"
  137. label="期"
  138. width="112">
  139. </el-table-column>
  140. <el-table-column
  141. property="shelve_date"
  142. label="发行日期"
  143. width="100">
  144. </el-table-column>
  145. <el-table-column
  146. property="price"
  147. label="价格"
  148. width="75">
  149. <template slot-scope="scope">
  150. {{scope.row.price|cutMoneyFiter}}
  151. </template>
  152. </el-table-column>
  153. </el-table>
  154. </div>
  155. <el-button class="tooltip-btn"><svg-icon icon-class="icon-mark"></svg-icon></el-button>
  156. </el-tooltip>
  157. </div>
  158. </div>
  159. <div class="info-item order-item" v-if="bookType==='jingdu'">
  160. <label>有效期</label>
  161. <div class="order-content">
  162. <b>365天</b>
  163. <el-tooltip placement="right">
  164. <div slot="content">{{validityStr}}</div>
  165. <el-button class="tooltip-btn"><svg-icon icon-class="icon-mark"></svg-icon></el-button>
  166. </el-tooltip>
  167. </div>
  168. </div>
  169. <div class="info-item order-item">
  170. <label>结算价格</label>
  171. <div class="order-content">
  172. <span class="OPPOSans">¥{{info.price_reservation|cutMoneyFiter}}</span>
  173. <span class="old-price" v-if="info.price&&info.price_reservation!==info.price">¥{{info.price|cutMoneyFiter}}</span>
  174. </div>
  175. </div>
  176. </div>
  177. <div class="btn-box">
  178. <a class="el-button" @click="handleChangeWay('wei')">立即购买</a>
  179. <a class="upgrade" @click="handleChangeWay('dui')">使用兑换码</a>
  180. </div>
  181. </div>
  182. </div>
  183. </div>
  184. <el-dialog
  185. :visible.sync="paymentShow"
  186. :show-close="false"
  187. :close-on-click-modal="false"
  188. width="712px"
  189. class="bookItem-dialog"
  190. v-if="paymentShow">
  191. <Payment :data="info" :payWay="payWay" @handleClose="handleClose" :orderId="orderId" :qr_code_url="qr_code_url" :order_amount="order_amount" />
  192. </el-dialog>
  193. </div>
  194. </template>
  195. <script>
  196. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  197. //例如:import 《组件名称》from ‘《组件路径》';
  198. import Header from "../../components/Header.vue";
  199. import { cutMoneyFiter } from '@/utils/defined';
  200. import { getLogin } from "@/api/ajax";
  201. import { mapState } from 'vuex';
  202. import Payment from "../bookShelf/components/Payment.vue"
  203. import { getToken } from '@/utils/auth'
  204. export default {
  205. //import引入的组件需要注入到对象中才能使用
  206. components: { Header, Payment},
  207. props: [],
  208. filters:{
  209. cutMoneyFiter
  210. },
  211. data() {
  212. //这里存放数据
  213. return {
  214. config: this.$route.query.headerConfig?decodeURIComponent(this.$route.query.headerConfig):'',
  215. LoginNavIndex: 0,
  216. userBg: 'rgba(0, 0, 0, 0.24)',
  217. headerBorder: '#5C5C5C',
  218. headerBg: '#1F1F1F',
  219. previousPage: '商城',
  220. data:{
  221. navTitle: '第 815 期 Celebrating new King',
  222. title: '第 815 期 Celebrating new King',
  223. org: '二十一世纪英文报',
  224. tagList: ['中英双语','经典读物','初中必读'],
  225. imgList:[
  226. require('../../assets/img1.png'), require('../../assets/bookcard-image.png'),
  227. ],
  228. describe:{
  229. title: 'Bring books up to date',
  230. author: 'TEENS',
  231. describe: 'Should childrenn read the original or adapted version? 英国童书再版遭大量删改引争议 词数 372 测试见IV版 建议阅读时间 5分钟 Puffin ...'
  232. },
  233. price: '3.9',
  234. oldPrice: '5.99',
  235. isBuy: this.$route.query.isBuy?this.$route.query.isBuy:false,
  236. },
  237. tagBg:['#C9EBFF','#FFFAC9','#D7C9FF'], // 标签背景色
  238. tagColor:['#006DAA','#AA8500','#7849C4'], // 标签字体颜色
  239. paymentShow: false, // 支付弹窗
  240. payWay:this.$route.query.paywei?this.$route.query.paywei:'dui',
  241. bookType: this.$route.query.type?this.$route.query.type:'baozhi', // 书籍类型
  242. bannerFlag: true, // 是否展示广告
  243. id: this.$route.query.id?this.$route.query.id:'',
  244. info: null, // 信息
  245. courseList:[],
  246. sales: null,
  247. salesCn: '',
  248. isBuy: 'false',
  249. studyType: 11,
  250. studyTypeName: '小学版',
  251. orderTotalNumber: 5,
  252. orderList:[
  253. {
  254. label:'5 期',
  255. value: 5
  256. },
  257. {
  258. label:'10 期',
  259. value: 10
  260. },
  261. {
  262. label:'20 期',
  263. value: 20
  264. },
  265. {
  266. label:'40 期',
  267. value: 40
  268. },
  269. {
  270. label:'自定义',
  271. value: -1
  272. }
  273. ],
  274. orderTable:[
  275. {
  276. name:'915 期(合刊)',
  277. date:'2023-06-26',
  278. price:12
  279. },
  280. {
  281. name:'915 期(合刊)',
  282. date:'2023-06-26',
  283. price:12
  284. },
  285. {
  286. name:'915 期(合刊)',
  287. date:'2023-06-26',
  288. price:12
  289. },
  290. {
  291. name:'915 期(合刊)',
  292. date:'2023-06-26',
  293. price:12
  294. },
  295. {
  296. name:'915 期(合刊)',
  297. date:'2023-06-26',
  298. price:12
  299. },
  300. {
  301. name:'915 期(合刊)',
  302. date:'2023-06-26',
  303. price:12
  304. },
  305. {
  306. name:'915 期(合刊)',
  307. date:'2023-06-26',
  308. price:12
  309. },
  310. {
  311. name:'915 期(合刊)',
  312. date:'2023-06-26',
  313. price:12
  314. },
  315. {
  316. name:'915 期(合刊)',
  317. date:'2023-06-26',
  318. price:12
  319. }
  320. ],
  321. customPage: 0,
  322. custonList:[
  323. {
  324. title: '2019-2020 学年',
  325. total: 14,
  326. list: [
  327. {
  328. label: '759',
  329. value: '759',
  330. width: 1,
  331. number: 1 // 算完下一个去复制上一个是不是末位 如果下一个加起来的number/10有余数那就是下一行了
  332. },
  333. {
  334. label: '758',
  335. value: '758',
  336. width: 1,
  337. number: 2
  338. },
  339. {
  340. label: '757',
  341. value: '757',
  342. width: 1,
  343. number: 3
  344. },
  345. {
  346. label: '756',
  347. value: '756',
  348. width: 1,
  349. number: 4
  350. },
  351. {
  352. label: '755',
  353. value: '755',
  354. width: 1,
  355. number: 5
  356. },
  357. {
  358. label: '754',
  359. value: '754',
  360. width: 1,
  361. number: 1
  362. },
  363. {
  364. label: '753',
  365. value: '753',
  366. width: 1,
  367. number: 1
  368. },
  369. {
  370. label: '752',
  371. value: '752',
  372. width: 1,
  373. number: 1
  374. },
  375. {
  376. label: '751',
  377. value: '751',
  378. width: 1,
  379. number: 1,
  380. },
  381. {
  382. label: '751',
  383. value: '751',
  384. width: 1,
  385. number: 1,
  386. farRight: true
  387. },
  388. {
  389. label: '共同战“疫”',
  390. value: 'gong',
  391. width: 2,
  392. number: 1,
  393. farBottom: true
  394. },
  395. {
  396. label: '750',
  397. value: '750',
  398. width: 1,
  399. number: 1,
  400. farBottom: true
  401. },
  402. {
  403. label: '769',
  404. value: '769',
  405. width: 1,
  406. number: 1,
  407. farBottom: true
  408. },
  409. ]
  410. }
  411. ],
  412. customOrderNumberList: [],
  413. validityStr: '', // 有效期
  414. rules: '', // 折扣规则
  415. loading: false,
  416. orderId: '',
  417. qr_code_url: '',
  418. order_amount: null,
  419. userMessage: getToken()?JSON.parse(getToken()):null,
  420. studyTypeList: [
  421. {
  422. study_phase: 11,
  423. study_phase_name: '小学版'
  424. },
  425. {
  426. study_phase: 21,
  427. study_phase_name: '初一版'
  428. },
  429. {
  430. study_phase: 22,
  431. study_phase_name: '初二版'
  432. },
  433. {
  434. study_phase: 23,
  435. study_phase_name: '初三版'
  436. },
  437. ]
  438. }
  439. },
  440. //计算属性 类似于data概念
  441. computed: {
  442. ...mapState(['$studyType']),
  443. },
  444. //监控data中数据变化
  445. watch: {},
  446. //方法集合
  447. methods: {
  448. // 分享
  449. handleShare(){
  450. },
  451. // 收藏
  452. handlelike(){
  453. },
  454. handleChangeWay(type){
  455. if(!this.userMessage){
  456. this.$refs.header.handleLogin('/bookItem?headerConfig='+this.$route.query.headerConfig+'&cardType='+this.bookType+'&id='+this.id+'&paywei='+type,'url')
  457. return false
  458. }
  459. this.payWay = type;
  460. this.handleOrder()
  461. },
  462. // 关闭弹窗
  463. handleClose(){
  464. this.paymentShow = false
  465. },
  466. // 详情
  467. getInfo(){
  468. this.loading = true
  469. let MethodName = "/ShopServer/Client/ReservationQuery/GetReservationInfo_Issue";
  470. // let customStr = 'false'
  471. // if(this.orderTotalNumber===-1){
  472. // if(this.customOrderNumberList.length>0){
  473. // customStr = ''
  474. // this.customOrderNumberList.forEach(item => {
  475. // customStr += item.issue_no + ','
  476. // });
  477. // customStr = customStr.substring(0,customStr.length-1)
  478. // }else{
  479. // // return
  480. // }
  481. // }
  482. let data = {
  483. study_phase: this.studyType,
  484. period_count: this.orderTotalNumber!==-1?this.orderTotalNumber:this.customOrderNumberList.length,
  485. is_custom_select_issue_no: this.orderTotalNumber!==-1?'false':'true'
  486. }
  487. getLogin(MethodName, data)
  488. .then((res) => {
  489. this.loading = false
  490. if(res.status===1){
  491. this.info = res
  492. this.orderTable = res.issue_no_list
  493. res.issue_no_school_year_list.forEach(item=>{
  494. item.issue_no_list.forEach((items,indexs)=>{
  495. const regex = /[\u4e00-\u9fa5]/g;
  496. if(regex.test(items.issue_no)){
  497. items.width = Math.ceil(items.issue_no.length/3)
  498. items.number = item.issue_no_list[indexs-1]?item.issue_no_list[indexs-1].number + Math.ceil(items.issue_no.length/3) : Math.ceil(items.issue_no.length/3)
  499. }else{
  500. items.width = 1
  501. items.number = item.issue_no_list[indexs-1]?item.issue_no_list[indexs-1].number + 1 : 1
  502. }
  503. })
  504. })
  505. this.sales = res.buy_info.total_buy_count
  506. if(this.sales<1000){
  507. this.salesCn = ''
  508. }else if(1000<=this.sales&&this.sales<10000){
  509. this.salesCn = this.sales.toString().substring(0,1)+'000+'
  510. }else if(10000<=this.sales&&this.sales<100000){
  511. this.salesCn = this.sales.toString().substring(0,1)+'万+'
  512. }else if(100000<=this.sales&&this.sales<1000000){
  513. this.salesCn = this.sales.toString().substring(0,1)+'0万+'
  514. }else if(1000000<=this.sales&&this.sales<10000000){
  515. this.salesCn = this.sales.toString().substring(0,1)+'00万+'
  516. }else if(10000000<=this.sales&&this.sales<100000000){
  517. this.salesCn = this.sales.toString().substring(0,1)+'000万+'
  518. }else if(100000000<=this.sales){
  519. this.salesCn = this.sales.toString().substring(0,1)+'亿+'
  520. }
  521. }
  522. })
  523. .catch(() => {
  524. this.loading = false
  525. });
  526. },
  527. changeCustomOrder(item){
  528. if(this.customOrderNumberList.indexOf(item.issue_no)>-1){
  529. this.customOrderNumberList.splice(this.customOrderNumberList.indexOf(item.issue_no),1)
  530. this.orderTable.splice(this.customOrderNumberList.indexOf(item.issue_no),1)
  531. }else{
  532. this.customOrderNumberList.push(item.issue_no)
  533. this.orderTable.push(item)
  534. }
  535. // this.getInfo()
  536. },
  537. changeStudy(item){
  538. this.studyType = item.study_phase
  539. this.studyTypeName = item.study_phase_name
  540. this.customOrderNumberList = []
  541. this.getInfo()
  542. },
  543. changeOrderNumber(item){
  544. this.orderTotalNumber = item.value
  545. this.getInfo()
  546. },
  547. getDiscountRule(){
  548. let MethodName = "/OrgServer/Manager/SysConfigManager/GetSysConfig_DiscountRule";
  549. getLogin(MethodName, {})
  550. .then((res) => {
  551. if(res.status===1){
  552. let str = '一次性订阅:<br/>'
  553. res.rule_list.forEach(item=>{
  554. str += item.buy_count + ' 期 ' + item.discount.toFixed(1) + ' 折<br/>'
  555. })
  556. this.rules = str
  557. }
  558. })
  559. },
  560. changeCustomPage(type){
  561. if(type==='-'){
  562. if(this.customPage!==0){
  563. this.customPage--
  564. }else{
  565. this.$message.warning('已经是最新学年')
  566. }
  567. }else{
  568. if(this.customPage!==this.info.issue_no_school_year_list.length-1){
  569. this.customPage++
  570. }else{
  571. this.$message.warning('后面没有数据啦')
  572. }
  573. }
  574. },
  575. // 生成订单
  576. handleOrder(){
  577. let MethodName = "/ShopServer/Client/OrderManager/CreateOrder";
  578. let data = {
  579. goods_type: this.bookType==='LB'?0:this.bookType==='baozhi'?2:null,
  580. goods_id_list: [this.id],
  581. pay_type: this.payWay==='wei'?3:this.payWay==='zhi'?4:null
  582. }
  583. getLogin(MethodName, data)
  584. .then((res) => {
  585. if(res.status === 1){
  586. this.orderId = res.id
  587. this.qr_code_url = res.qr_code_url
  588. this.paymentShow = true;
  589. this.order_amount = res.order_amount
  590. }
  591. })
  592. // this.paymentShow = true;
  593. },
  594. },
  595. //生命周期 - 创建完成(可以访问当前this实例)
  596. created() {
  597. if(this.config){
  598. let arr = this.config.split('&&&')
  599. this.LoginNavIndex = arr[0] * 1
  600. this.userBg = arr[1] ? arr[1] : 'rgba(0, 0, 0, 0.24)'
  601. this.headerBorder = arr[2] ? arr[2] : '#5C5C5C'
  602. this.headerBg = arr[3] ? arr[3] : '#1F1F1F'
  603. this.previousPage = arr[4] ? arr[4] : '商城'
  604. }
  605. this.getInfo()
  606. this.getDiscountRule()
  607. let date1 = new Date().getFullYear()+'.'+(new Date().getMonth()+1<10?'0'+(new Date().getMonth()+1):(new Date().getMonth()+1))+'.'+new Date().getDate()
  608. let data2 = new Date(new Date((new Date().getFullYear()+1)+'.'+(new Date().getMonth()+1<10?'0'+(new Date().getMonth()+1):(new Date().getMonth()+1))+'.'+new Date().getDate()).getTime() - 24 * 60 * 60 * 1000)
  609. data2 = data2.getFullYear()+'.'+(data2.getMonth()+1<10?'0'+(data2.getMonth()+1):(data2.getMonth()+1))+'.'+data2.getDate()
  610. this.validityStr = date1 + ' ~ ' + data2
  611. if(this.$route.query.paywei){
  612. this.handleOrder()
  613. }
  614. },
  615. //生命周期 - 挂载完成(可以访问DOM元素)
  616. mounted() {
  617. },
  618. //生命周期-创建之前
  619. beforeCreated() { },
  620. //生命周期-挂载之前
  621. beforeMount() { },
  622. //生命周期-更新之前
  623. beforUpdate() { },
  624. //生命周期-更新之后
  625. updated() { },
  626. //生命周期-销毁之前
  627. beforeDestory() { },
  628. //生命周期-销毁完成
  629. destoryed() { },
  630. //如果页面有keep-alive缓存功能,这个函数会触发
  631. activated() { }
  632. }
  633. </script>
  634. <style lang="scss" scoped>
  635. /* @import url(); 引入css类 */
  636. .bookItem {
  637. background: #F7F8FA;
  638. min-height: calc(100vh - 135px);
  639. .main-top {
  640. background: #FFFFFF;
  641. padding: 48px 0;
  642. margin-top: 56px;
  643. min-height: calc(100vh - 135px);
  644. &-inner{
  645. width: 1200px;
  646. margin: 0 auto;
  647. display: flex;
  648. .swiper-container{
  649. width: 416px;
  650. height: 440px;
  651. text-align: center;
  652. .el-image{
  653. width: 414px;
  654. height: 414px;
  655. border: 1px solid #F3F3F3;
  656. }
  657. }
  658. .book-info-right{
  659. flex: 1;
  660. padding-left: 88px;
  661. .title{
  662. color: #2F3742;
  663. font-weight: 500;
  664. font-size: 32px;
  665. line-height: 44px;
  666. margin: 0 0 16px 0;
  667. }
  668. .org,.date{
  669. font-weight: 500;
  670. font-size: 14px;
  671. line-height: 22px;
  672. color: rgba(0, 0, 0, 0.4);
  673. }
  674. .date{
  675. margin-left: 32px;
  676. line-height: 24px;
  677. }
  678. .label-box{
  679. display: flex;
  680. flex-flow: wrap;
  681. margin: 16px 0;
  682. label{
  683. margin: 0 8px 8px 0;
  684. border-radius: 20px;
  685. padding: 4px 12px;
  686. font-weight: 400;
  687. font-size: 14px;
  688. line-height: 22px;
  689. }
  690. }
  691. .book-describe{
  692. border-top: 1px solid #E5E6EB;
  693. border-bottom: 1px solid #E5E6EB;
  694. padding: 16px 0;
  695. .title{
  696. font-weight: 500;
  697. font-size: 16px;
  698. line-height: 24px;
  699. color: #000000;
  700. margin-bottom: 8px;
  701. }
  702. .author{
  703. font-weight: 400;
  704. font-size: 12px;
  705. line-height: 20px;
  706. color: #000000;
  707. margin-bottom: 8px;
  708. display: block;
  709. }
  710. .describe{
  711. font-weight: 400;
  712. font-size: 14px;
  713. line-height: 22px;
  714. color: #000000;
  715. margin: 0;
  716. }
  717. }
  718. .price-box{
  719. padding: 20px 0 16px 0;
  720. display: flex;
  721. align-items: flex-end;
  722. .price{
  723. font-weight: 500;
  724. font-size: 32px;
  725. line-height: 40px;
  726. color: #EA5939;
  727. }
  728. .oldPrice{
  729. padding: 0 0 2px 7px;
  730. font-weight: 500;
  731. font-size: 14px;
  732. line-height: 22px;
  733. color: rgba(0, 0, 0, 0.4);
  734. text-decoration-line: line-through;
  735. }
  736. }
  737. .info-box{
  738. display: flex;
  739. flex-flow: wrap;
  740. border-bottom: 1px solid #EBEBEB;
  741. width: 592px;
  742. margin-top: 48px;
  743. .info-item{
  744. width: 50%;
  745. margin-bottom: 15px;
  746. font-size: 14px;
  747. line-height: 22px;
  748. display: flex;
  749. }
  750. label{
  751. color: #C2C2C2;
  752. font-weight: 400;
  753. margin-right: 16px;
  754. width: 58px;
  755. flex-shrink: 0;
  756. display: block;
  757. text-align:justify;
  758. text-justify:distribute-all-lines;
  759. text-align-last:justify;
  760. -moz-text-align-last:justify;
  761. -webkit-text-align-last:justify;
  762. }
  763. }
  764. .order-box{
  765. margin-bottom: 24px;
  766. padding: 24px 0 0;
  767. margin-top: 0;
  768. .order-item{
  769. margin-bottom: 24px;
  770. width: 100%;
  771. label{
  772. line-height: 32px;
  773. }
  774. .order-content{
  775. line-height: 32px;
  776. ul{
  777. margin: 0;
  778. padding: 0;
  779. list-style: none;
  780. display: flex;
  781. flex-flow: wrap;
  782. li{
  783. cursor: pointer;
  784. border-radius: 2px;
  785. background: #F2F3F5;
  786. margin-right: 8px;
  787. margin-bottom: 8px;
  788. padding: 4px 15px;
  789. color: #000;
  790. font-size: 14px;
  791. font-weight: 500;
  792. line-height: 22px;
  793. border: 1px solid #F2F3F5;
  794. &.active{
  795. color: #EA5939;
  796. background: #ffffff;
  797. border-color: #EA5939;
  798. }
  799. }
  800. }
  801. .el-table{
  802. background: #303133;
  803. }
  804. }
  805. .OPPOSans{
  806. margin: 0 8px 0 0;
  807. color: #EA5939;
  808. font-size: 20px;
  809. font-weight: 500;
  810. line-height: 28px;
  811. }
  812. .old-price{
  813. color: rgba(0, 0, 0, 1);
  814. font-size: 12px;
  815. font-weight: 500;
  816. line-height: 22px;
  817. text-decoration: line-through;
  818. }
  819. }
  820. }
  821. .btn-box{
  822. display: flex;
  823. .el-button{
  824. width: 112px;
  825. height: 40px;
  826. background: #EA5939;
  827. box-shadow: 0px 8px 16px rgba(234, 89, 57, 0.24);
  828. border-radius: 4px;
  829. font-weight: 500;
  830. font-size: 16px;
  831. color: #FFFFFF;
  832. border: none;
  833. }
  834. .svg-icon{
  835. margin-left: 7px;
  836. }
  837. .continue{
  838. width: 112px;
  839. height: 40px;
  840. background: #175DFF;
  841. border-radius: 4px;
  842. font-weight: 500;
  843. font-size: 16px;
  844. line-height: 40px;
  845. color: rgba(255, 255, 255, 1);
  846. display: block;
  847. text-align: center;
  848. box-shadow: 0px 8px 16px rgba(23, 93, 255, 0.24);
  849. }
  850. .upgrade{
  851. margin-left: 16px;
  852. display: block;
  853. padding: 0px 24px;
  854. height: 40px;
  855. background: #E9E9E9;
  856. box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.06);
  857. border-radius: 4px;
  858. color: #595959;
  859. font-weight: 500;
  860. font-size: 16px;
  861. line-height: 40px;
  862. text-align: center;
  863. }
  864. }
  865. }
  866. }
  867. }
  868. .main-center{
  869. width: 1200px;
  870. margin: 0 auto;
  871. padding: 40px 0;
  872. .el-tabs--card>.el-tabs__header .el-tabs__item.is-active{
  873. border-color: #E7E7E7;
  874. }
  875. }
  876. .main-bottom{
  877. width: 1200px;
  878. margin: 0 auto;
  879. padding-bottom: 40px;
  880. &-top{
  881. display: flex;
  882. justify-content: space-between;
  883. p{
  884. margin: 0;
  885. font-weight: 500;
  886. font-size: 24px;
  887. line-height: 32px;
  888. color: #1F2C5C;
  889. font-family: initial;
  890. }
  891. .right{
  892. color: rgba(0, 0, 0, 0.88);
  893. font-weight: 400;
  894. font-size: 16px;
  895. line-height: 24px;
  896. cursor: pointer;
  897. a{
  898. margin-right: 8px;
  899. }
  900. }
  901. }
  902. }
  903. .list {
  904. margin-top: 24px;
  905. display: flex;
  906. flex-wrap: wrap;
  907. > div {
  908. width: 200px;
  909. border-radius: 8px;
  910. overflow: hidden;
  911. background: #ffffff;
  912. margin-bottom: 24px;
  913. }
  914. }
  915. }
  916. .banner-box-close{
  917. margin-top: 40px;
  918. }
  919. .sales-box{
  920. display: flex;
  921. width: 592px;
  922. padding: 16px;
  923. border-radius: 4px;
  924. background: #F5F5F5;
  925. justify-content: space-between;
  926. align-items: flex-end;
  927. color: #ADADAD;
  928. font-size: 14px;
  929. font-weight: 400;
  930. line-height: 22px;
  931. .OPPOSans{
  932. margin: 0 8px 0 16px;
  933. color: #EA5939;
  934. font-size: 32px;
  935. font-weight: 500;
  936. line-height: 40px;
  937. }
  938. .old-price{
  939. color: rgba(0, 0, 0, 0.40);
  940. font-size: 14px;
  941. font-weight: 500;
  942. line-height: 22px;
  943. text-decoration: line-through;
  944. }
  945. b{
  946. color: rgba(0, 0, 0, 0.40);
  947. font-size: 14px;
  948. font-weight: 700;
  949. line-height: 22px;
  950. }
  951. }
  952. .custom-box{
  953. width: 522px;
  954. border: 1px solid #E5E6EB;
  955. background: #FFF;
  956. margin: 4px 0 8px 0;
  957. &-top{
  958. padding: 8px 16px;
  959. display: flex;
  960. justify-content: space-between;
  961. align-items: center;
  962. h5{
  963. margin: 0;
  964. color: #000;
  965. font-size: 12px;
  966. font-weight: 600;
  967. line-height: 20px;
  968. }
  969. .btn-box{
  970. a{
  971. margin-left: 6px;
  972. border-radius: 2px;
  973. background: #F2F2F2;
  974. width: 24px;
  975. height: 24px;
  976. display: block;
  977. text-align: center;
  978. line-height: 24px;
  979. }
  980. }
  981. }
  982. &-bottom{
  983. border-top: 1px solid #E5E6EB;
  984. li{
  985. padding: 8px !important;
  986. margin: 0 !important;
  987. background: #ffffff !important;
  988. border: none !important;
  989. min-width: 52px;
  990. height: 36px;
  991. text-align: center;
  992. border-right: 1px solid #E5E6EB !important;
  993. border-bottom: 1px solid #E5E6EB !important;
  994. border-radius: 0 !important;
  995. display: flex;
  996. .custom-btn{
  997. border: none;
  998. width: 100%;
  999. background: initial;
  1000. padding: 0;
  1001. line-height: 20px;
  1002. height: 20px;
  1003. color: #000;
  1004. }
  1005. &.active{
  1006. border-right: 1px solid #F5F5F5 !important;
  1007. border-bottom: 1px solid #F5F5F5 !important;
  1008. background: #EA5939 !important;
  1009. &:hover{
  1010. .custom-btn{
  1011. color: #FFF !important;
  1012. }
  1013. }
  1014. .custom-btn{
  1015. color: #FFF !important;
  1016. }
  1017. }
  1018. &:hover{
  1019. .custom-btn{
  1020. color: #000 !important;
  1021. }
  1022. }
  1023. }
  1024. }
  1025. }
  1026. </style>
  1027. <style lang="scss">
  1028. .bookItem{
  1029. .el-carousel__button{
  1030. width: 8px;
  1031. height: 8px;
  1032. background: #D9D9D9;
  1033. opacity: 1;
  1034. border-radius: 4px;
  1035. }
  1036. .el-carousel__indicator.is-active{
  1037. .el-carousel__button{
  1038. background: #5E5E5E;
  1039. }
  1040. }
  1041. .el-tabs__header{
  1042. margin: 0;
  1043. }
  1044. .el-tab-pane{
  1045. background: #F8F8F8;
  1046. border: 1px solid #E7E7E7;
  1047. border-top: none;
  1048. padding: 24px;
  1049. }
  1050. .el-tabs__item{
  1051. width: 160px;
  1052. height: 38px;
  1053. text-align: center;
  1054. font-weight: 500;
  1055. font-size: 14px;
  1056. line-height: 38px;
  1057. color: #1F2C5C;
  1058. &:hover{
  1059. background: #E7E7E7;
  1060. }
  1061. &.is-active{
  1062. // background: #3459D2;
  1063. // color: #EEF3FF;
  1064. border-bottom: none;
  1065. background: #E7E7E7;
  1066. }
  1067. }
  1068. }
  1069. .bookitem-dropdown.el-dropdown-menu{
  1070. padding: 4px;
  1071. .el-dropdown-menu__item{
  1072. font-weight: 500;
  1073. font-size: 16px;
  1074. line-height: 40px;
  1075. color: #000000;
  1076. }
  1077. .el-dropdown-menu__item:focus, .el-dropdown-menu__item:not(.is-disabled):hover{
  1078. background: #FDECEE;
  1079. border-radius: 4px;
  1080. color: #EA5939;
  1081. }
  1082. }
  1083. .bookItem-dialog{
  1084. .el-dialog__header,.el-dialog__body{
  1085. padding: 0;
  1086. }
  1087. .el-dialog{
  1088. border: 1px solid #EBEBEB;
  1089. 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);
  1090. border-radius: 8px;
  1091. overflow: hidden;
  1092. }
  1093. }
  1094. .tooltip-btn{
  1095. border: none;
  1096. padding: 0;
  1097. margin-left: 6px;
  1098. color: #BEBEBE;
  1099. &:focus,&:hover{
  1100. color: #BEBEBE;
  1101. background: none;
  1102. }
  1103. }
  1104. .order-table.el-table{
  1105. font-size: 12px;
  1106. color: #FFF;
  1107. line-height: 20px;
  1108. }
  1109. .order-table.el-table th.el-table__cell{
  1110. background: #3E424B !important;
  1111. padding: 2px 5px;
  1112. }
  1113. .order-table.el-table .el-table__cell{
  1114. padding: 2px 5px;
  1115. }
  1116. .order-table.el-table thead{
  1117. font-size: 12px;
  1118. color: #FFF;
  1119. line-height: 20px;
  1120. }
  1121. .order-table.el-table td.el-table__cell, .order-table.el-table th.el-table__cell.is-leaf{
  1122. border-bottom-color: #3E424B;
  1123. }
  1124. .order-table.el-table tr,.order-table.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{
  1125. background: #1D2129;
  1126. }
  1127. .order-table.el-table .cell{
  1128. padding: 0 5px !important;
  1129. }
  1130. .order-table.el-table::before{
  1131. height: 0;
  1132. }
  1133. .order-table.el-table--scrollable-y .el-table__body-wrapper::-webkit-scrollbar {
  1134. display: none;
  1135. }
  1136. </style>