123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212 |
- <template>
- <div class="bookItem">
- <Header
- :headerBg="headerBg"
- :headerBorder="headerBorder"
- :userBg="userBg"
- :LoginNavIndex="0"
- ref="header"
- />
- <div class="navBar" v-if="info">
- <div class="navBar-left">
- <a class="goback" @click="$router.go(-1)"><i class="el-icon-arrow-left"></i>主页</a>
- <div class="border"></div>
- <p>{{bookType==='jingdu'?'二十一世纪英文报·精读课堂':'二十一世纪英文报'}}</p>
- </div>
- </div>
- <div class="main-top" v-if="info">
- <div class="main-top-inner">
- <el-carousel class="swiper-container" trigger="click" arrow="never" height="414px">
- <!-- <el-carousel-item v-for="(item1, index) in data.imgList" :key="index"> -->
- <el-image
- class="image"
- :src="bookType==='jingdu'?require('../../assets/cover-order-jingdu.png'):require('../../assets/cover-order-'+studyType+'.png')"
- :fit="'contain'">
- </el-image>
- <!-- </el-carousel-item> -->
- </el-carousel>
- <div class="book-info-right" v-loading="loading">
- <h1 class="title">{{bookType==='jingdu'?'Teens 精读课堂('+studyTypeName+')':'《二十一世纪学生英文报》'}}</h1>
- <!-- <b class="org">{{data.org}}</b><span class="date">2023.07.01-2023.07.21</span> -->
- <div class="sales-box">
- <div class="sales-left">
- <span>订阅价格</span>
- <span class="OPPOSans">¥{{info.price_reservation|cutMoneyFiter}}</span>
- <!-- <span class="old-price" v-if="info.price_discount&&info.price_discount!==info.price">¥{{info.price|cutMoneyFiter}}</span> -->
- <b>元 / 期</b>
- </div>
- <span class="sales-right" v-if="sales>=1000">累计订阅 {{salesCn}}</span>
- </div>
- <!-- <div class="label-box">
- <label v-for="(itemL,indexL) in info.label_name_list" :key="indexL" :style="{background:tagBg[indexL%3],color:tagColor[indexL%3]}">
- {{ '# ' + itemL }}
- </label>
- </div> -->
- <!-- <div class="book-describe">
- <h2 class="title">{{data.describe.title}}</h2>
- <span class="author">{{'BY '+data.describe.author}}</span>
- <p class="describe">{{data.describe.describe}}</p>
- </div> -->
- <div class="info-box">
- <div class="info-item">
- <label>适合年龄</label>
- <span>{{info.issue_info?info.issue_info.age_desc:info.iread_info.age_desc}}</span>
- </div>
- <div class="info-item">
- <label>期刊页数</label>
- <span>{{info.issue_info?info.issue_info.page_count_desc:info.iread_info.article_count_desc}}</span>
- <el-tooltip placement="right" v-if="bookType==='baozhi'">
- <div slot="content">双刊、特辑、寒暑假合刊除外</div>
- <el-button class="tooltip-btn"><svg-icon icon-class="icon-mark"></svg-icon></el-button>
- </el-tooltip>
- </div>
- <div class="info-item">
- <label>出版周期</label>
- <span>{{info.issue_info?info.issue_info.period_desc:info.iread_info.period_desc}}</span>
- </div>
- <div class="info-item">
- <label>期刊定价</label>
- <span v-if="bookType==='baozhi'">{{info.issue_info.price}}元/期</span>
- <span v-else-if="bookType==='jingdu'">{{info.iread_info.price}}元/年</span>
- <el-tooltip placement="right" v-if="bookType==='baozhi'">
- <div slot="content">双刊、特辑、寒暑假合刊除外</div>
- <el-button class="tooltip-btn"><svg-icon icon-class="icon-mark"></svg-icon></el-button>
- </el-tooltip>
- </div>
- <div class="info-item" style="width:100%;">
- <label>主办单位</label>
- <span>{{info.issue_info?info.issue_info.organizer:info.iread_info.organizer}}</span>
- </div>
- </div>
- <div class="info-box order-box">
- <div class="info-item order-item" style="margin-bottom:16px">
- <label>订阅学段</label>
- <div class="order-content">
- <ul>
- <li v-for="item in bookType==='baozhi'?$studyType:studyTypeList" :key="item.study_phase" :class="[studyType===item.study_phase?'active':'']" @click="changeStudy(item)">
- {{item.study_phase_name}}
- </li>
- </ul>
- </div>
- </div>
- <div class="info-item order-item" style="margin-bottom:16px" v-if="bookType==='baozhi'">
- <label>订阅期数</label>
- <div class="order-content">
- <ul>
- <li v-for="item in orderList" :key="item.value" :class="[orderTotalNumber===item.value?'active':'']" @click="changeOrderNumber(item)">
- {{item.label}}
- </li>
- <el-tooltip placement="right" style="height:32px">
- <div slot="content" v-html="rules"></div>
- <el-button class="tooltip-btn"><svg-icon icon-class="icon-mark"></svg-icon></el-button>
- </el-tooltip>
- </ul>
- <div v-if="orderTotalNumber===-1&&info.issue_no_school_year_list.length>0" class="custom-box">
- <div class="custom-box-top">
- <h5>{{info.issue_no_school_year_list[customPage].year_begin +'-'+info.issue_no_school_year_list[customPage].year_end +' 学年'}}</h5>
- <div class="btn-box">
- <a @click="changeCustomPage('-')"><i class="el-icon-arrow-left"></i></a>
- <a @click="changeCustomPage('+')"><i class="el-icon-arrow-right"></i></a>
- </div>
- </div>
- <ul class="custom-box-bottom">
- <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)">
- <el-tooltip placement="bottom">
- <div slot="content">
- 第 {{itemc.issue_no}} 期<br/>
- 出版日期:{{itemc.shelve_date}}</div>
- <el-button class="custom-btn">{{itemc.issue_no}}</el-button>
- </el-tooltip>
- </li>
- </ul>
- </div>
- <b v-if="orderTotalNumber!==-1">{{info.issue_no_begin}} - {{info.issue_no_end}}</b>
- <b v-else>已选 {{customOrderNumberList.length}} 期</b>
- <el-tooltip placement="bottom" style="height:32px">
- <div slot="content">
- <el-table
- class="order-table"
- :data="orderTable"
- max-height="200px"
- style="width: 317px">
- <el-table-column
- label="#"
- type="index"
- width="30">
- </el-table-column>
- <el-table-column
- property="issue_no"
- label="期"
- width="112">
- </el-table-column>
- <el-table-column
- property="shelve_date"
- label="发行日期"
- width="100">
- </el-table-column>
- <el-table-column
- property="price"
- label="价格"
- width="75">
- <template slot-scope="scope">
- {{scope.row.price|cutMoneyFiter}}
- </template>
- </el-table-column>
- </el-table>
- </div>
- <el-button class="tooltip-btn"><svg-icon icon-class="icon-mark"></svg-icon></el-button>
- </el-tooltip>
- </div>
- </div>
- <div class="info-item order-item" v-if="bookType==='jingdu'">
- <label>有效期</label>
- <div class="order-content">
- <b>365天</b>
- <el-tooltip placement="right">
- <div slot="content">{{validityStr}}</div>
- <el-button class="tooltip-btn"><svg-icon icon-class="icon-mark"></svg-icon></el-button>
- </el-tooltip>
- </div>
- </div>
- <div class="info-item order-item" v-if="settlement||info.settlement_price">
- <label>结算价格</label>
- <div class="order-content">
- <span class="OPPOSans">¥{{settlement?settlement.price_settlement:info.settlement_price.price_settlement|cutMoneyFiter}}</span>
- <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>
- </div>
- </div>
- </div>
- <div class="btn-box">
- <el-button class="el-button" @click="handleChangeWay('wei')" :loading="createOrderLoading">立即购买</el-button>
- <!-- <el-button class="upgrade" @click="handleChangeWay('dui')">使用兑换码</el-button> -->
- </div>
- </div>
- </div>
- </div>
- <el-dialog
- :visible.sync="paymentShow"
- :show-close="false"
- :close-on-click-modal="false"
- width="712px"
- class="bookItem-dialog"
- v-if="paymentShow">
- <Payment :data="info" :payWay="payWay" @handleClose="handleClose" :orderId="orderId" :qr_code_url="qr_code_url" :order_amount="order_amount" />
- </el-dialog>
- </div>
- </template>
- <script>
- //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
- //例如:import 《组件名称》from ‘《组件路径》';
- import Header from "../../components/Header.vue";
- import { cutMoneyFiter } from '@/utils/defined';
- import { getLogin } from "@/api/ajax";
- import { mapState } from 'vuex';
- import Payment from "../bookShelf/components/Payment.vue"
- import { getToken } from '@/utils/auth'
- export default {
- //import引入的组件需要注入到对象中才能使用
- components: { Header, Payment},
- props: [],
- filters:{
- cutMoneyFiter
- },
- data() {
- //这里存放数据
- return {
- config: this.$route.query.headerConfig?decodeURIComponent(this.$route.query.headerConfig):'',
- LoginNavIndex: 0,
- userBg: 'rgba(0, 0, 0, 0.24)',
- headerBorder: '#5C5C5C',
- headerBg: '#1F1F1F',
- previousPage: '商城',
- data:{
- navTitle: '第 815 期 Celebrating new King',
- title: '第 815 期 Celebrating new King',
- org: '二十一世纪英文报',
- tagList: ['中英双语','经典读物','初中必读'],
- imgList:[
- require('../../assets/img1.png'), require('../../assets/bookcard-image.png'),
- ],
- describe:{
- title: 'Bring books up to date',
- author: 'TEENS',
- describe: 'Should childrenn read the original or adapted version? 英国童书再版遭大量删改引争议 词数 372 测试见IV版 建议阅读时间 5分钟 Puffin ...'
- },
- price: '3.9',
- oldPrice: '5.99',
- isBuy: this.$route.query.isBuy?this.$route.query.isBuy:false,
- },
- tagBg:['#C9EBFF','#FFFAC9','#D7C9FF'], // 标签背景色
- tagColor:['#006DAA','#AA8500','#7849C4'], // 标签字体颜色
- paymentShow: false, // 支付弹窗
- payWay:this.$route.query.paywei?this.$route.query.paywei:'dui',
- bookType: this.$route.query.type?this.$route.query.type:'baozhi', // 书籍类型
- bannerFlag: true, // 是否展示广告
- id: this.$route.query.id?this.$route.query.id:'',
- info: null, // 信息
- courseList:[],
- sales: null,
- salesCn: '',
- isBuy: 'false',
- studyType: this.$route.query.studyType?this.$route.query.studyType:11,
- studyTypeName: this.$route.query.studyTypeName?decodeURIComponent(this.$route.query.studyTypeName):'小学版',
- orderTotalNumber: 5,
- orderList:[
- {
- label:'5 期',
- value: 5
- },
- {
- label:'10 期',
- value: 10
- },
- {
- label:'20 期',
- value: 20
- },
- {
- label:'40 期',
- value: 40
- },
- {
- label:'自定义',
- value: -1
- }
- ],
- orderTable:[
- {
- name:'915 期(合刊)',
- date:'2023-06-26',
- price:12
- },
- {
- name:'915 期(合刊)',
- date:'2023-06-26',
- price:12
- },
- {
- name:'915 期(合刊)',
- date:'2023-06-26',
- price:12
- },
- {
- name:'915 期(合刊)',
- date:'2023-06-26',
- price:12
- },
- {
- name:'915 期(合刊)',
- date:'2023-06-26',
- price:12
- },
- {
- name:'915 期(合刊)',
- date:'2023-06-26',
- price:12
- },
- {
- name:'915 期(合刊)',
- date:'2023-06-26',
- price:12
- },
- {
- name:'915 期(合刊)',
- date:'2023-06-26',
- price:12
- },
- {
- name:'915 期(合刊)',
- date:'2023-06-26',
- price:12
- }
-
- ],
- customPage: 0,
- custonList:[
- {
- title: '2019-2020 学年',
- total: 14,
- list: [
- {
- label: '759',
- value: '759',
- width: 1,
- number: 1 // 算完下一个去复制上一个是不是末位 如果下一个加起来的number/10有余数那就是下一行了
- },
- {
- label: '758',
- value: '758',
- width: 1,
- number: 2
- },
- {
- label: '757',
- value: '757',
- width: 1,
- number: 3
- },
- {
- label: '756',
- value: '756',
- width: 1,
- number: 4
- },
- {
- label: '755',
- value: '755',
- width: 1,
- number: 5
- },
- {
- label: '754',
- value: '754',
- width: 1,
- number: 1
- },
- {
- label: '753',
- value: '753',
- width: 1,
- number: 1
- },
- {
- label: '752',
- value: '752',
- width: 1,
- number: 1
- },
- {
- label: '751',
- value: '751',
- width: 1,
- number: 1,
- },
- {
- label: '751',
- value: '751',
- width: 1,
- number: 1,
- farRight: true
- },
- {
- label: '共同战“疫”',
- value: 'gong',
- width: 2,
- number: 1,
- farBottom: true
- },
- {
- label: '750',
- value: '750',
- width: 1,
- number: 1,
- farBottom: true
- },
- {
- label: '769',
- value: '769',
- width: 1,
- number: 1,
- farBottom: true
- },
- ]
- }
- ],
- customOrderNumberList: [],
- validityStr: '', // 有效期
- rules: '', // 折扣规则
- loading: false,
- orderId: '',
- qr_code_url: '',
- order_amount: null,
- userMessage: getToken()?JSON.parse(getToken()):null,
- studyTypeList: [
- {
- study_phase: 11,
- study_phase_name: '小学版'
- },
- {
- study_phase: 21,
- study_phase_name: '初一版'
- },
- {
- study_phase: 22,
- study_phase_name: '初二版'
- },
- {
- study_phase: 23,
- study_phase_name: '初三版'
- },
- ],
- settlement: null, // 结算价格
- createOrderLoading: false,
- valid_period_id: null
- }
- },
- //计算属性 类似于data概念
- computed: {
- ...mapState(['$studyType']),
- },
- //监控data中数据变化
- watch: {},
- //方法集合
- methods: {
- // 分享
- handleShare(){
- },
- // 收藏
- handlelike(){
- },
- handleChangeWay(type){
- if(!this.userMessage){
- this.$refs.header.handleLogin('/subscribe?name='+this.$route.query.name+'&type='+this.$route.query.type+'&paywei='+type,'url')
- return false
- }
- this.payWay = type;
- this.handleOrder()
- },
- // 关闭弹窗
- handleClose(){
- this.paymentShow = false
- },
- // 详情
- getInfo(){
- this.loading = true
- if(this.bookType==='baozhi'){
- let MethodName = "/ShopServer/Client/ReservationQuery/GetReservationInfo_Issue";
- let data = {
- study_phase: this.studyType,
- period_count: this.orderTotalNumber!==-1?this.orderTotalNumber:this.customOrderNumberList.length,
- is_custom_select_issue_no: this.orderTotalNumber!==-1?'false':'true'
- }
- getLogin(MethodName, data)
- .then((res) => {
- this.loading = false
- if(res.status===1){
- this.info = res
- this.orderTable = res.issue_no_list
- res.issue_no_school_year_list.forEach(item=>{
- item.issue_no_list.forEach((items,indexs)=>{
- const regex = /[\u4e00-\u9fa5]/g;
- if(regex.test(items.issue_no)){
- items.width = Math.ceil(items.issue_no.length/3)
- 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)
- }else{
- items.width = 1
- items.number = item.issue_no_list[indexs-1]?item.issue_no_list[indexs-1].number + 1 : 1
- }
- })
- })
- }
- })
- .catch(() => {
- this.loading = false
- });
- this.handleOrderPrice()
- }else{
- let MethodName = "/ShopServer/Client/ReservationQuery/GetReservationValidPeriodList_Iread";
- getLogin(MethodName, {})
- .then((res) => {
- this.loading = false
- if(res.status===1){
- this.valid_period_id = res.valid_period_list[0]?res.valid_period_list[0].id:''
- getLogin('/ShopServer/Client/ReservationQuery/GetReservationInfo_Iread', {
- study_phase: this.studyType,
- valid_period_id: res.valid_period_list[0]?res.valid_period_list[0].id:''
- }).then((ress) => {
- if(ress.status===1){
- this.info = ress
- }
- })
- .catch(() => {
- });
- }
- })
- .catch(() => {
- this.loading = false
- });
- }
- },
- // 计算结算价格
- handleOrderPrice(){
- this.loading = true
- let MethodName = '/ShopServer/Client/ReservationQuery/ComputeReservationSettlementPrice_Issue'
- let data = {
- study_phase: this.studyType,
- period_count: this.orderTotalNumber!==-1?this.orderTotalNumber:this.customOrderNumberList.length,
- is_custom_select_issue_no: this.orderTotalNumber!==-1?'false':'true',
- issue_no_list:this.customOrderNumberList
- }
- getLogin(MethodName, data)
- .then((res) => {
- this.loading = false
- if(res.status===1){
- this.settlement = res
- }
- })
- .catch(() => {
- this.loading = false
- });
- },
- changeCustomOrder(item){
- if(this.customOrderNumberList.indexOf(item.issue_no)>-1){
- this.customOrderNumberList.splice(this.customOrderNumberList.indexOf(item.issue_no),1)
- this.orderTable.splice(this.customOrderNumberList.indexOf(item.issue_no),1)
- }else{
- this.customOrderNumberList.push(item.issue_no)
- this.orderTable.push(item)
- }
- this.handleOrderPrice()
- },
- changeStudy(item){
- this.studyType = item.study_phase
- this.studyTypeName = item.study_phase_name
- this.customOrderNumberList = []
- this.getInfo()
- },
- changeOrderNumber(item){
- this.orderTotalNumber = item.value
- this.getInfo()
- },
- getDiscountRule(){
- let MethodName = "/OrgServer/Client/SysConfigQuery/GetSysConfig_DiscountRule";
- getLogin(MethodName, {})
- .then((res) => {
- if(res.status===1){
- let str = '一次性订阅:<br/>'
- res.rule_list.forEach(item=>{
- str += item.buy_count + ' 期 ' + item.discount.toFixed(1) + ' 折<br/>'
- })
- this.rules = str
- }
- })
- },
- changeCustomPage(type){
- if(type==='-'){
- if(this.customPage!==0){
- this.customPage--
- }else{
- this.$message.warning('已经是最新学年')
- }
- }else{
- if(this.customPage!==this.info.issue_no_school_year_list.length-1){
- this.customPage++
- }else{
- this.$message.warning('后面没有数据啦')
- }
- }
- },
- // 生成订单
- handleOrder(){
- this.createOrderLoading = true
- let MethodName = "/ShopServer/Client/OrderManager/CreateOrder";
- let data = {
- is_reservation: 'true',
- sale_model: this.bookType==='jingdu'?1:0,
- goods_type: this.bookType==='jingdu'?3:2,
- goods_study_phase: this.studyType,
- period_count: this.orderTotalNumber!==-1?this.orderTotalNumber:this.customOrderNumberList.length,
- is_custom_select_issue_no: this.orderTotalNumber!==-1?'false':'true',
- issue_no_list:this.customOrderNumberList,
- pay_type: this.payWay==='wei'?3:this.payWay==='zhi'?4:this.payWay==='dui'?5:null,
- valid_period_id: this.valid_period_id
- }
- getLogin(MethodName, data)
- .then((res) => {
- this.createOrderLoading = false
- if(res.status === 1){
- this.order_amount = res.order_amount
- if(this.order_amount<=0){
-
- }else{
- this.orderId = res.id
- this.qr_code_url = res.qr_code_url
- this.paymentShow = true;
- }
- }
- }).catch(()=>{
- this.createOrderLoading = false
- })
- // this.paymentShow = true;
- },
- getTotalSales(){
- let MethodName = "/ShopServer/Client/ShopHomeQuery/GetGoodsTotalSales";
- let data = {
- goods_type: 2
- }
- getLogin(MethodName, data)
- .then((res) => {
- if(res.status === 1){
- this.sales = res.sale_count
- if(this.sales<1000){
- this.salesCn = ''
- }else if(1000<=this.sales&&this.sales<10000){
- this.salesCn = this.sales.toString().substring(0,1)+'000+'
- }else if(10000<=this.sales&&this.sales<100000){
- this.salesCn = this.sales.toString().substring(0,1)+'万+'
- }else if(100000<=this.sales&&this.sales<1000000){
- this.salesCn = this.sales.toString().substring(0,1)+'0万+'
- }else if(1000000<=this.sales&&this.sales<10000000){
- this.salesCn = this.sales.toString().substring(0,1)+'00万+'
- }else if(10000000<=this.sales&&this.sales<100000000){
- this.salesCn = this.sales.toString().substring(0,1)+'000万+'
- }else if(100000000<=this.sales){
- this.salesCn = this.sales.toString().substring(0,1)+'亿+'
- }
- }
- }).catch(()=>{
- })
- }
- },
- //生命周期 - 创建完成(可以访问当前this实例)
- created() {
- if(this.config){
- let arr = this.config.split('&&&')
- this.LoginNavIndex = arr[0] * 1
- this.userBg = arr[1] ? arr[1] : 'rgba(0, 0, 0, 0.24)'
- this.headerBorder = arr[2] ? arr[2] : '#5C5C5C'
- this.headerBg = arr[3] ? arr[3] : '#1F1F1F'
- this.previousPage = arr[4] ? arr[4] : '商城'
- }
- this.getInfo()
- this.getDiscountRule()
- let date1 = new Date().getFullYear()+'.'+(new Date().getMonth()+1<10?'0'+(new Date().getMonth()+1):(new Date().getMonth()+1))+'.'+new Date().getDate()
- 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)
- data2 = data2.getFullYear()+'.'+(data2.getMonth()+1<10?'0'+(data2.getMonth()+1):(data2.getMonth()+1))+'.'+data2.getDate()
- this.validityStr = date1 + ' ~ ' + data2
- if(this.$route.query.paywei){
- this.handleOrder()
- }
- this.getTotalSales()
- },
- //生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {
- },
- //生命周期-创建之前
- beforeCreated() { },
- //生命周期-挂载之前
- beforeMount() { },
- //生命周期-更新之前
- beforUpdate() { },
- //生命周期-更新之后
- updated() { },
- //生命周期-销毁之前
- beforeDestory() { },
- //生命周期-销毁完成
- destoryed() { },
- //如果页面有keep-alive缓存功能,这个函数会触发
- activated() { }
- }
- </script>
- <style lang="scss" scoped>
- /* @import url(); 引入css类 */
- .bookItem {
- background: #F7F8FA;
- min-height: calc(100vh - 135px);
- .main-top {
- background: #FFFFFF;
- padding: 48px 0;
- margin-top: 56px;
- min-height: calc(100vh - 135px);
- &-inner{
- width: 1200px;
- margin: 0 auto;
- display: flex;
- .swiper-container{
- width: 416px;
- height: 440px;
- text-align: center;
- .el-image{
- width: 414px;
- height: 414px;
- border: 1px solid #F3F3F3;
- }
- }
- .book-info-right{
- flex: 1;
- padding-left: 88px;
- .title{
- color: #2F3742;
- font-weight: 500;
- font-size: 32px;
- line-height: 44px;
- margin: 0 0 16px 0;
- }
- .org,.date{
- font-weight: 500;
- font-size: 14px;
- line-height: 22px;
- color: rgba(0, 0, 0, 0.4);
- }
- .date{
- margin-left: 32px;
- line-height: 24px;
- }
- .label-box{
- display: flex;
- flex-flow: wrap;
- margin: 16px 0;
- label{
- margin: 0 8px 8px 0;
- border-radius: 20px;
- padding: 4px 12px;
- font-weight: 400;
- font-size: 14px;
- line-height: 22px;
- }
- }
- .book-describe{
- border-top: 1px solid #E5E6EB;
- border-bottom: 1px solid #E5E6EB;
- padding: 16px 0;
- .title{
- font-weight: 500;
- font-size: 16px;
- line-height: 24px;
- color: #000000;
- margin-bottom: 8px;
- }
- .author{
- font-weight: 400;
- font-size: 12px;
- line-height: 20px;
- color: #000000;
- margin-bottom: 8px;
- display: block;
- }
- .describe{
- font-weight: 400;
- font-size: 14px;
- line-height: 22px;
- color: #000000;
- margin: 0;
- }
- }
- .price-box{
- padding: 20px 0 16px 0;
- display: flex;
- align-items: flex-end;
- .price{
- font-weight: 500;
- font-size: 32px;
- line-height: 40px;
- color: #EA5939;
- }
- .oldPrice{
- padding: 0 0 2px 7px;
- font-weight: 500;
- font-size: 14px;
- line-height: 22px;
- color: rgba(0, 0, 0, 0.4);
- text-decoration-line: line-through;
- }
- }
- .info-box{
- display: flex;
- flex-flow: wrap;
- border-bottom: 1px solid #EBEBEB;
- width: 592px;
- margin-top: 48px;
- .info-item{
- width: 50%;
- margin-bottom: 15px;
- font-size: 14px;
- line-height: 22px;
- display: flex;
- }
- label{
- color: #C2C2C2;
- font-weight: 400;
- margin-right: 16px;
- width: 58px;
- flex-shrink: 0;
- display: block;
- text-align:justify;
- text-justify:distribute-all-lines;
- text-align-last:justify;
- -moz-text-align-last:justify;
- -webkit-text-align-last:justify;
- }
- }
- .order-box{
- margin-bottom: 24px;
- padding: 24px 0 0;
- margin-top: 0;
- .order-item{
- margin-bottom: 24px;
- width: 100%;
- label{
- line-height: 32px;
- }
- .order-content{
- line-height: 32px;
- ul{
- margin: 0;
- padding: 0;
- list-style: none;
- display: flex;
- flex-flow: wrap;
- li{
- cursor: pointer;
- border-radius: 2px;
- background: #F2F3F5;
- margin-right: 8px;
- margin-bottom: 8px;
- padding: 4px 15px;
- color: #000;
- font-size: 14px;
- font-weight: 500;
- line-height: 22px;
- border: 1px solid #F2F3F5;
- &.active{
- color: #EA5939;
- background: #ffffff;
- border-color: #EA5939;
- }
- }
- }
- .el-table{
- background: #303133;
- }
- }
- .OPPOSans{
- margin: 0 8px 0 0;
- color: #EA5939;
- font-size: 20px;
- font-weight: 500;
- line-height: 28px;
- }
- .old-price{
- color: rgba(0, 0, 0, 1);
- font-size: 12px;
- font-weight: 500;
- line-height: 22px;
- text-decoration: line-through;
- }
- }
- }
- .btn-box{
- display: flex;
- .el-button{
- width: 112px;
- height: 40px;
- background: #EA5939;
- box-shadow: 0px 8px 16px rgba(234, 89, 57, 0.24);
- border-radius: 4px;
- font-weight: 500;
- font-size: 16px;
- color: #FFFFFF;
- border: none;
- }
- .svg-icon{
- margin-left: 7px;
- }
- .continue{
- width: 112px;
- height: 40px;
- background: #175DFF;
- border-radius: 4px;
- font-weight: 500;
- font-size: 16px;
- line-height: 40px;
- color: rgba(255, 255, 255, 1);
- display: block;
- text-align: center;
- box-shadow: 0px 8px 16px rgba(23, 93, 255, 0.24);
- }
- .upgrade{
- margin-left: 16px;
- display: block;
- padding: 0px 24px;
- height: 40px;
- background: #E9E9E9;
- box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.06);
- border-radius: 4px;
- color: #595959;
- font-weight: 500;
- font-size: 16px;
- line-height: 40px;
- text-align: center;
- width: 130px;
- }
- }
- }
- }
- }
- .main-center{
- width: 1200px;
- margin: 0 auto;
- padding: 40px 0;
- .el-tabs--card>.el-tabs__header .el-tabs__item.is-active{
- border-color: #E7E7E7;
- }
- }
- .main-bottom{
- width: 1200px;
- margin: 0 auto;
- padding-bottom: 40px;
- &-top{
- display: flex;
- justify-content: space-between;
- p{
- margin: 0;
- font-weight: 500;
- font-size: 24px;
- line-height: 32px;
- color: #1F2C5C;
- font-family: initial;
- }
- .right{
- color: rgba(0, 0, 0, 0.88);
- font-weight: 400;
- font-size: 16px;
- line-height: 24px;
- cursor: pointer;
- a{
- margin-right: 8px;
- }
- }
- }
- }
- .list {
- margin-top: 24px;
- display: flex;
- flex-wrap: wrap;
- > div {
- width: 200px;
- border-radius: 8px;
- overflow: hidden;
- background: #ffffff;
- margin-bottom: 24px;
- }
- }
- }
- .banner-box-close{
- margin-top: 40px;
- }
- .sales-box{
- display: flex;
- width: 592px;
- padding: 16px;
- border-radius: 4px;
- background: #F5F5F5;
- justify-content: space-between;
- align-items: flex-end;
- color: #ADADAD;
- font-size: 14px;
- font-weight: 400;
- line-height: 22px;
- .OPPOSans{
- margin: 0 8px 0 16px;
- color: #EA5939;
- font-size: 32px;
- font-weight: 500;
- line-height: 40px;
- }
- .old-price{
- color: rgba(0, 0, 0, 0.40);
- font-size: 14px;
- font-weight: 500;
- line-height: 22px;
- text-decoration: line-through;
- }
- b{
- color: rgba(0, 0, 0, 0.40);
- font-size: 14px;
- font-weight: 700;
- line-height: 22px;
- }
- }
- .custom-box{
- width: 522px;
- border: 1px solid #E5E6EB;
- background: #FFF;
- margin: 4px 0 8px 0;
- &-top{
- padding: 8px 16px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- h5{
- margin: 0;
- color: #000;
- font-size: 12px;
- font-weight: 600;
- line-height: 20px;
- }
- .btn-box{
- a{
- margin-left: 6px;
- border-radius: 2px;
- background: #F2F2F2;
- width: 24px;
- height: 24px;
- display: block;
- text-align: center;
- line-height: 24px;
- }
- }
- }
- &-bottom{
- border-top: 1px solid #E5E6EB;
- li{
- padding: 8px !important;
- margin: 0 !important;
- background: #ffffff !important;
- border: none !important;
- min-width: 52px;
- height: 36px;
- text-align: center;
- border-right: 1px solid #E5E6EB !important;
- border-bottom: 1px solid #E5E6EB !important;
- border-radius: 0 !important;
- display: flex;
- .custom-btn{
- border: none;
- width: 100%;
- background: initial;
- padding: 0;
- line-height: 20px;
- height: 20px;
- color: #000;
- }
- &.active{
- border-right: 1px solid #F5F5F5 !important;
- border-bottom: 1px solid #F5F5F5 !important;
- background: #EA5939 !important;
- &:hover{
- .custom-btn{
- color: #FFF !important;
- }
- }
- .custom-btn{
- color: #FFF !important;
- }
- }
- &:hover{
- .custom-btn{
- color: #000 !important;
- }
- }
- }
- }
- }
- </style>
- <style lang="scss">
- .bookItem{
- .el-carousel__button{
- width: 8px;
- height: 8px;
- background: #D9D9D9;
- opacity: 1;
- border-radius: 4px;
- }
- .el-carousel__indicator.is-active{
- .el-carousel__button{
- background: #5E5E5E;
- }
- }
- .el-tabs__header{
- margin: 0;
- }
- .el-tab-pane{
- background: #F8F8F8;
- border: 1px solid #E7E7E7;
- border-top: none;
- padding: 24px;
- }
- .el-tabs__item{
- width: 160px;
- height: 38px;
- text-align: center;
- font-weight: 500;
- font-size: 14px;
- line-height: 38px;
- color: #1F2C5C;
- &:hover{
- background: #E7E7E7;
- }
- &.is-active{
- // background: #3459D2;
- // color: #EEF3FF;
- border-bottom: none;
- background: #E7E7E7;
- }
- }
- }
- .bookitem-dropdown.el-dropdown-menu{
- padding: 4px;
- .el-dropdown-menu__item{
- font-weight: 500;
- font-size: 16px;
- line-height: 40px;
- color: #000000;
- }
- .el-dropdown-menu__item:focus, .el-dropdown-menu__item:not(.is-disabled):hover{
- background: #FDECEE;
- border-radius: 4px;
- color: #EA5939;
- }
- }
- .bookItem-dialog{
- .el-dialog__header,.el-dialog__body{
- padding: 0;
- }
- .el-dialog{
- border: 1px solid #EBEBEB;
- 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);
- border-radius: 8px;
- overflow: hidden;
- }
- }
- .tooltip-btn{
- border: none;
- padding: 0;
- margin-left: 6px;
- color: #BEBEBE;
- &:focus,&:hover{
- color: #BEBEBE;
- background: none;
- }
- }
- .order-table.el-table{
- font-size: 12px;
- color: #FFF;
- line-height: 20px;
- }
- .order-table.el-table th.el-table__cell{
- background: #3E424B !important;
- padding: 2px 5px;
- }
- .order-table.el-table .el-table__cell{
- padding: 2px 5px;
- }
- .order-table.el-table thead{
- font-size: 12px;
- color: #FFF;
- line-height: 20px;
- }
- .order-table.el-table td.el-table__cell, .order-table.el-table th.el-table__cell.is-leaf{
- border-bottom-color: #3E424B;
- }
- .order-table.el-table tr,.order-table.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{
- background: #1D2129;
- }
- .order-table.el-table .cell{
- padding: 0 5px !important;
- }
- .order-table.el-table::before{
- height: 0;
- }
- .order-table.el-table--scrollable-y .el-table__body-wrapper::-webkit-scrollbar {
- display: none;
- }
- </style>
|