Subscribe.vue 44 KB

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