natasha hace 1 año
padre
commit
2dfc476cb4

BIN
src/assets/cover-order-11.png


BIN
src/assets/cover-order-21.png


BIN
src/assets/cover-order-22.png


BIN
src/assets/cover-order-23.png


BIN
src/assets/cover-order-31.png


BIN
src/assets/cover-order-32.png


BIN
src/assets/cover-order-33.png


BIN
src/assets/cover-order-jingdu.png


+ 1 - 3
src/utils/request.js

@@ -54,9 +54,7 @@ service.interceptors.response.use(
             // 执行错误  JSON 数据格式错误
             msg = Message({
                 message: res.msg || res.error || 'Error',
-                type: 'error',
-                showClose: true,
-                duration: 0
+                type: 'error'
             })
             return Promise.reject(new Error(res.message || res.error || 'Error'))
         } else if (res.status === -1) {

+ 25 - 2
src/views/bookShelf/articleDetail.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="bookStore" :style="{background:bgColorList[activeIndex].contentBg}">
-    <Header :LoginNavIndex="1"/>
+    <Header :LoginNavIndex="LoginNavIndex"/>
     <div class="navBar" :class="['navBar-'+bgColorList[activeIndex].type]" :style="{background:bgColorList[activeIndex].navBg}">
         <div class="navBar-left">
             <a class="goback" @click="$router.go(-1)"><i class="el-icon-arrow-left"></i> 第 856 期</a>
@@ -116,6 +116,8 @@ export default {
   },
   data(){
     return{
+        config: this.$route.query.headerConfig?decodeURIComponent(this.$route.query.headerConfig):'',
+        LoginNavIndex: 0,
         wordFontsize: 18, // 文章文字大小
         bgColorList:[
             {
@@ -590,6 +592,18 @@ export default {
         .then((res) => {
             if(res.status===1){
                 
+            }
+        })
+        .catch(() => {
+            
+        }); 
+        getLogin('/ShopServer/Client/ReadingRecordManager/GetReadingStatus_Article', {
+            goods_type: 21,
+            article_id: this.articleId,
+        })
+        .then((res) => {
+            if(res.status===1){
+                this.noRead = res.reading_info.is_reading === 'false'
                 if(!this.noRead){
                     clearInterval(this_.timer);
                     this_.timer = null;
@@ -597,7 +611,7 @@ export default {
             }
         })
         .catch(() => {
-            
+            this.loading = false
         }); 
     },
     handleReadArticle(){
@@ -625,6 +639,14 @@ export default {
     }
   },
   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] : '商城'
+    }
     if(this.articleId){
         this.getArticleDetail()
     }
@@ -847,6 +869,7 @@ export default {
     .readed{
         background: rgba(231, 238, 255, 1);
         color: rgba(23, 93, 255, 1);
+        cursor: initial;
     }
 }
 </style>

+ 24 - 1
src/views/bookShelf/articlePeruseDetail.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="bookStore" :style="{background:bgColorList[activeIndex].contentBg}" v-loading="loading" v-if="peruseDetail">
-    <Header :LoginNavIndex="1"/>
+    <Header :LoginNavIndex="LoginNavIndex"/>
     <div class="navBar" :class="['navBar-'+bgColorList[activeIndex].type]" :style="{background:bgColorList[activeIndex].navBg}">
         <div class="navBar-left">
             <a class="goback" @click="$router.go(-1)"><i class="el-icon-arrow-left"></i> 第 {{peruseDetail.batch}} 期</a>
@@ -134,6 +134,8 @@ export default {
   },
   data(){
     return{
+        config: this.$route.query.headerConfig?decodeURIComponent(this.$route.query.headerConfig):'',
+        LoginNavIndex: 0,
         wordFontsize: 16, // 文章文字大小
         bgColorList:[
             {
@@ -360,6 +362,18 @@ export default {
                     this.knowledgeList = res.data.content.knowledgeList
                 }
                 this.loading = false
+            }
+        })
+        .catch(() => {
+            this.loading = false
+        }); 
+        getLogin('/ShopServer/Client/ReadingRecordManager/GetReadingStatus_Article', {
+            goods_type: 3,
+            article_id: this.peruseId
+        })
+        .then((res) => {
+            if(res.status===1){
+                this.noRead = res.reading_info.is_reading === 'false'
                 if(!this.noRead){
                     clearInterval(this_.timer);
                     this_.timer = null;
@@ -484,6 +498,14 @@ export default {
     },
   },
   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] : '商城'
+    }
     if(this.peruseId){
         this.getPeruseDetail()
     }
@@ -717,6 +739,7 @@ export default {
             .readed{
                 background: rgba(231, 238, 255, 1);
                 color: rgba(23, 93, 255, 1);
+                cursor: initial;
             }
         }
         .backgroundImg{

+ 4 - 2
src/views/bookShelf/bookItem.vue

@@ -202,7 +202,7 @@
         width="712px"
         class="bookItem-dialog"
         v-if="paymentShow">
-        <Payment :data="info" :payWay="payWay" @handleClose="handleClose" :orderId="orderId" :qr_code_url="qr_code_url" />
+        <Payment :data="info" :payWay="payWay" @handleClose="handleClose" :orderId="orderId" :qr_code_url="qr_code_url" :order_amount="order_amount" />
     </el-dialog>
   </div>
 </template>
@@ -423,7 +423,8 @@ export default {
         qr_code_url: '',
         pre_play_cs_item_id: '', //上次阅读课节id
         pre_play_index: null, // 上次阅读索引
-        issueChnList:[]
+        issueChnList:[],
+        order_amount: null
     }
   },
   //计算属性 类似于data概念
@@ -589,6 +590,7 @@ export default {
                 this.orderId = res.id
                 this.qr_code_url = res.qr_code_url
                 this.paymentShow = true;
+                this.order_amount = res.order_amount
             }
         })
         // this.paymentShow = true;

+ 3 - 1
src/views/bookShelf/bookPeruseItem.vue

@@ -106,7 +106,7 @@
         width="712px"
         class="bookItem-dialog"
         v-if="paymentShow">
-        <Payment :data="info" :payWay="payWay" @handleClose="handleClose" :orderId="orderId" :qr_code_url="qr_code_url" />
+        <Payment :data="info" :payWay="payWay" @handleClose="handleClose" :orderId="orderId" :qr_code_url="qr_code_url" :order_amount="order_amount" />
     </el-dialog>
   </div>
 </template>
@@ -156,6 +156,7 @@ export default {
         qr_code_url: '',
         pre_play_cs_item_id: '', //上次阅读课节id
         pre_play_index: null, // 上次阅读索引
+        order_amount: null,
     }
   },
   //计算属性 类似于data概念
@@ -274,6 +275,7 @@ export default {
                 this.orderId = res.id
                 this.qr_code_url = res.qr_code_url
                 this.paymentShow = true;
+                this.order_amount = res.order_amount
             }
         })
         // this.paymentShow = true;

+ 5 - 3
src/views/bookShelf/components/Payment.vue

@@ -10,7 +10,7 @@
         <i class="el-icon-close" @click="closeDialogue"></i>
         <h2>{{data.name||data.cn_title}}</h2>
         <h3>{{data.org_name||'二十一世纪英文报'}}</h3>
-        <p class="price">¥{{data.price_discount||data.price|cutMoneyFiter}}</p>
+        <p class="price">¥{{payAmount||data.price_discount||data.price|cutMoneyFiter}}</p>
         <template v-if="payType==='dui'">
             <el-input class="code" placeholder="在此输入兑换码" v-model="codeValue" maxlength="20"></el-input>
             <a class="exchange" @click="handleExchange">兑换</a>
@@ -38,7 +38,7 @@ import QRCode from "qrcode";
 export default {
   //import引入的组件需要注入到对象中才能使用
   components: { },
-  props: ["data", "payWay", "qr_code_url", "orderId"],
+  props: ["data", "payWay", "qr_code_url", "orderId", "order_amount"],
   filters:{
     cutMoneyFiter
   },
@@ -83,7 +83,8 @@ export default {
             },
         },
         timer: null,
-        loading: false
+        loading: false,
+        payAmount: this.order_amount?this.order_amount:null
     }
   },
   //计算属性 类似于data概念
@@ -119,6 +120,7 @@ export default {
         .then((res) => {
             if(res.status === 1){
                 this.payCode[this.payType] = res.qr_code_url
+                this.payAmount = res.order_amount
                 this.createQRCode()
             }
         })

+ 44 - 13
src/views/bookShelf/index.vue

@@ -48,18 +48,31 @@
           :style="{
               marginLeft:index==0||index%5==0?'0':'50px',
             }"
+          :class="[item.type===3?'book-item-peruse':'']"
         >
-          <BookCard
-            :item="item"
-            type='bookShelf'
-            :headerBg="'#1F1F1F'"
-            :headerBorder="'#5C5C5C'"
-            :userBg="'rgba(0, 0, 0, 0.24)'"
-            :LoginNavIndex="1"
-            :previousPage="'书架'"
-            :cardType="item.course_type"
-            :isBuy="true"
-          />
+            <template v-if="item.type===3">
+                <BookPeruseCard
+                    :item="item"
+                    type='bookShelf'
+                    :headerBg="'#1F1F1F'"
+                    :headerBorder="'#5C5C5C'"
+                    :userBg="'rgba(0, 0, 0, 0.24)'"
+                    :LoginNavIndex="1"
+                    :previousPage="'书架'"
+                />
+            </template>
+            <template v-else>
+                <BookCard
+                    :item="item"
+                    type='bookShelf'
+                    :headerBg="'#1F1F1F'"
+                    :headerBorder="'#5C5C5C'"
+                    :userBg="'rgba(0, 0, 0, 0.24)'"
+                    :LoginNavIndex="1"
+                    :previousPage="'书架'"
+                    :cardType="item.course_type"
+                />
+            </template>
         </div>
         <p v-if="loading" class="tips">加载中...</p>
         <p v-if="noMore" class="tips">没有更多了</p>
@@ -77,11 +90,12 @@
 //例如:import 《组件名称》from ‘《组件路径》';
 import Header from "../../components/Header.vue";
 import BookCard from "@/components/common/BookCard.vue"
+import BookPeruseCard from "@/components/common/BookPeruseCard.vue"
 import { getLogin } from "@/api/ajax";
 
 export default {
   //import引入的组件需要注入到对象中才能使用
-  components: { Header, BookCard },
+  components: { Header, BookCard, BookPeruseCard },
   props: {},
   data() {
     //这里存放数据
@@ -131,7 +145,13 @@ export default {
             img: 'kecheng',
             number: 0,
             value: 10
-        }
+        },
+        {
+            label: '精读',
+            img: 'jingdu',
+            number: 0,
+            value: 10
+        },
         // ,
         // {
         //     label: '合刊',
@@ -341,6 +361,12 @@ export default {
                         img: 'kecheng',
                         number: res.count_course,
                         value: 10
+                    },
+                    {
+                        label: '精读课堂',
+                        img: 'jingdu',
+                        number: res.count_course,
+                        value: 3
                     }
                     // ,
                     // {
@@ -521,6 +547,11 @@ export default {
             overflow: hidden;
             background: #ffffff;
             margin-bottom: 24px;
+            &.book-item-peruse{
+                width: 282px;
+                height: 270px;
+                margin-top: 82px;
+            }
         }
         .tips{
             width: 100%;

+ 175 - 52
src/views/bookStore/Subscribe.vue

@@ -9,7 +9,7 @@
         <div class="navBar-left">
             <a class="goback" @click="$router.go(-1)"><i class="el-icon-arrow-left"></i>主页</a>
             <div class="border"></div>
-            <p>{{info.name}}</p>
+            <p>{{bookType==='jingdu'?'二十一世纪英文报·精读课堂':'二十一世纪英文报'}}</p>
         </div>
     </div>
     <div class="main-top" v-if="info">
@@ -18,28 +18,28 @@
                 <!-- <el-carousel-item v-for="(item1, index) in data.imgList" :key="index"> -->
                     <el-image
                         class="image"
-                        :src="info.cover_image_url?info.cover_image_url:bookType==='baozhi'?require('../../assets/baozhi'+(Math.floor(Math.random()*2)+1)+'.png'):require('../../assets/kecheng'+(Math.floor(Math.random()*3)+1)+'.png')"
-                        :fit="'cover'">
+                        :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">
-                <h1 class="title">{{info.name}}</h1>
+            <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_discount?info.price_discount:info.price|cutMoneyFiter}}</span>
-                        <span class="old-price" v-if="info.price_discount&&info.price_discount!==info.price">¥{{info.price|cutMoneyFiter}}</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">
+                <!-- <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> -->
                 <!-- <div class="book-describe">
                     <h2 class="title">{{data.describe.title}}</h2>
                     <span class="author">{{'BY '+data.describe.author}}</span>
@@ -48,27 +48,32 @@
                 <div class="info-box">
                     <div class="info-item">
                         <label>适合年龄</label>
-                        <span>{{info.org_name}}</span>
+                        <span>{{info.issue_info.age_desc}}</span>
                     </div>
                     <div class="info-item">
                         <label>期刊页数</label>
-                        <span>78291</span>
-                        <el-tooltip placement="right">
+                        <span>{{info.issue_info.page_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>2023-05-15</span>
+                        <span>{{info.issue_info.period_desc}}</span>
                     </div>
                     <div class="info-item">
                         <label>期刊定价</label>
-                        <span>中英双语</span>
+                        <span v-if="bookType==='baozhi'">{{info.issue_info.price}}元/期</span>
+                        <span v-else-if="bookType==='jingdu'">{{info.issue_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">
+                    <div class="info-item" style="width:100%;">
                         <label>主办单位</label>
-                        <span>815 期</span>
+                        <span>{{info.issue_info.organizer}}</span>
                     </div>
                 </div>
                 <div class="info-box order-box">
@@ -76,7 +81,7 @@
                         <label>订阅学段</label>
                         <div class="order-content">
                             <ul>
-                                <li v-for="item in $studyType" :key="item.study_phase" :class="[studyType===item.study_phase?'active':'']" @click="studyType=item.study_phase">
+                                <li v-for="item in $studyType" :key="item.study_phase" :class="[studyType===item.study_phase?'active':'']" @click="changeStudy(item)">
                                     {{item.study_phase_name}}
                                 </li>
                             </ul>
@@ -86,38 +91,34 @@
                         <label>订阅期数</label>
                         <div class="order-content">
                             <ul>
-                                <li v-for="item in orderList" :key="item.value" :class="[orderTotalNumber===item.value?'active':'']" @click="orderTotalNumber=item.value">
+                                <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">一次性订阅:<br/>
-                                        5 期 9 折 <br/>
-                                        10 期 8 折<br/>
-                                        20 期 6 折<br/>
-                                        40 期 5 折</div>
+                                    <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" class="custom-box">
+                            <div v-if="orderTotalNumber===-1&&info.issue_no_school_year_list.length>0" class="custom-box">
                                 <div class="custom-box-top">
-                                    <h5>{{custonList[customPage].title}}</h5>
+                                    <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><i class="el-icon-arrow-left"></i></a>
-                                        <a><i class="el-icon-arrow-right"></i></a>
+                                        <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 custonList[customPage].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.value)>-1?'active':'']" @click="changeCustomOrder(itemc)">
+                                    <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">
-                                                第 791 期<br/>
-                                                出版日期:2020-10-23</div>
-                                            <el-button class="custom-btn">{{itemc.label}}</el-button>
+                                                第 {{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">915 期 - 919 期</b>
+                            <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">
@@ -132,12 +133,12 @@
                                             width="30">
                                         </el-table-column>
                                         <el-table-column
-                                            property="name"
+                                            property="issue_no"
                                             label="期"
                                             width="112">
                                         </el-table-column>
                                         <el-table-column
-                                            property="date"
+                                            property="shelve_date"
                                             label="发行日期"
                                             width="100">
                                         </el-table-column>
@@ -155,12 +156,12 @@
                             </el-tooltip>
                         </div>
                     </div>
-                    <div class="info-item order-item">
+                    <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">2023.08.14~2024.08.13</div>
+                                <div slot="content">{{validityStr}}</div>
                                 <el-button class="tooltip-btn"><svg-icon icon-class="icon-mark"></svg-icon></el-button>
                             </el-tooltip>
                         </div>
@@ -168,8 +169,8 @@
                     <div class="info-item order-item">
                         <label>结算价格</label>
                         <div class="order-content">
-                            <span class="OPPOSans">¥{{info.price_discount|cutMoneyFiter}}</span>
-                            <span class="old-price">¥{{info.price|cutMoneyFiter}}</span>
+                            <span class="OPPOSans">¥{{info.price_reservation|cutMoneyFiter}}</span>
+                            <span class="old-price" v-if="info.price&&info.price_reservation!==info.price">¥{{info.price|cutMoneyFiter}}</span>
                         </div>
                     </div>
                 </div>
@@ -180,6 +181,15 @@
             </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>
 
@@ -190,10 +200,13 @@ 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},
+  components: { Header, Payment},
   props: [],
   filters:{
     cutMoneyFiter
@@ -227,8 +240,8 @@ export default {
         tagBg:['#C9EBFF','#FFFAC9','#D7C9FF'], // 标签背景色
         tagColor:['#006DAA','#AA8500','#7849C4'], // 标签字体颜色
         paymentShow: false, // 支付弹窗
-        payWay:'dui',
-        bookType: this.$route.query.cardType?this.$route.query.cardType:'baozhi', // 书籍类型
+        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, // 信息
@@ -237,6 +250,7 @@ export default {
         salesCn: '',
         isBuy: 'false',
         studyType: 11,
+        studyTypeName: '小学版',
         orderTotalNumber: 5,
         orderList:[
             {
@@ -399,7 +413,14 @@ export default {
                 ]
             }
         ],
-        customOrderNumberList: []
+        customOrderNumberList: [],
+        validityStr: '', // 有效期
+        rules: '', // 折扣规则
+        loading: false,
+        orderId: '',
+        qr_code_url: '',
+        order_amount: null,
+        userMessage: getToken()?JSON.parse(getToken()):null,
     }
   },
   //计算属性 类似于data概念
@@ -419,8 +440,12 @@ export default {
 
     },
     handleChangeWay(type){
+         if(!this.userMessage){
+            this.$refs.header.handleLogin('/bookItem?headerConfig='+this.$route.query.headerConfig+'&cardType='+this.bookType+'&id='+this.id+'&paywei='+type,'url')
+            return false
+        }
         this.payWay = type;
-        this.paymentShow = true;
+        this.handleOrder()
     },
     // 关闭弹窗
     handleClose(){
@@ -428,16 +453,43 @@ export default {
     },
     // 详情
     getInfo(){
+        this.loading = true
         let MethodName = "/ShopServer/Client/ReservationQuery/GetReservationInfo_Issue";
+        // let customStr = 'false'
+        // if(this.orderTotalNumber===-1){
+        //     if(this.customOrderNumberList.length>0){
+        //         customStr = ''
+        //         this.customOrderNumberList.forEach(item => {
+        //             customStr += item.issue_no + ','
+        //         });
+        //         customStr = customStr.substring(0,customStr.length-1)
+        //     }else{
+        //         // return
+        //     }
+        // }
         let data = {
             study_phase: this.studyType,
-            period_count: this.orderTotalNumber,
-            is_custom_select_issue_no: "false"
+            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
+                        }
+                    })
+                })
                 this.sales = res.buy_info.total_buy_count
                 if(this.sales<1000){
                     this.salesCn = ''
@@ -457,16 +509,76 @@ export default {
             }
         })
         .catch(() => {
-            
+            this.loading = false
         }); 
     },
     changeCustomOrder(item){
-        if(this.customOrderNumberList.indexOf(item.value)>-1){
-            this.customOrderNumberList.splice(this.customOrderNumberList.indexOf(item.value),1)
+        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.value)
+            this.customOrderNumberList.push(item.issue_no)
+            this.orderTable.push(item)
         }
-    }
+        // this.getInfo()
+    },
+    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/Manager/SysConfigManager/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(){
+        let MethodName = "/ShopServer/Client/OrderManager/CreateOrder";
+        let data = {
+            goods_type: this.bookType==='LB'?0:this.bookType==='baozhi'?2:null,
+            goods_id_list: [this.id],
+            pay_type: this.payWay==='wei'?3:this.payWay==='zhi'?4:null
+        }
+        getLogin(MethodName, data)
+        .then((res) => {
+            if(res.status === 1){
+                this.orderId = res.id
+                this.qr_code_url = res.qr_code_url
+                this.paymentShow = true;
+                this.order_amount = res.order_amount
+            }
+        })
+        // this.paymentShow = true;
+    },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
@@ -479,6 +591,14 @@ export default {
         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()
+    }
   },
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
@@ -519,7 +639,7 @@ export default {
             height: 440px;
             text-align: center;
             .el-image{
-                width: 297px;
+                width: 414px;
                 height: 414px;
                 border: 1px solid #F3F3F3;
             }
@@ -608,6 +728,7 @@ export default {
                 flex-flow: wrap;
                 border-bottom: 1px solid #EBEBEB;
                 width: 592px;
+                margin-top: 48px;
                 .info-item{
                     width: 50%;
                     margin-bottom: 15px;
@@ -620,6 +741,7 @@ export default {
                     font-weight: 400;
                     margin-right: 16px;
                     width: 58px;
+                    flex-shrink: 0;
                     display: block;
                     text-align:justify;
                     text-justify:distribute-all-lines;
@@ -631,6 +753,7 @@ export default {
             .order-box{
                 margin-bottom: 24px;
                 padding: 24px 0 0;
+                margin-top: 0;
                 .order-item{
                     margin-bottom: 24px;
                     width: 100%;