Forráskód Böngészése

精读结算价格

natasha 1 éve
szülő
commit
d0f6659daa

BIN
src/assets/voice-play.png


+ 11 - 7
src/views/bookShelf/articleDetail.vue

@@ -1,11 +1,11 @@
 <template>
-  <div class="bookStore" :style="{background:bgColorList[activeIndex].contentBg}">
+  <div class="bookStore" :style="{background:bgColorList[activeIndex].contentBg}" v-if="articleInfo" :v-loading="loading">
     <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>
+            <a class="goback" @click="$router.go(-1)"><i class="el-icon-arrow-left"></i> 第 {{articleInfo.iss_no}} 期</a>
             <div class="border"></div>
-            <p class="article-title">Making room for the pet boom</p>
+            <p class="article-title">{{articleInfo.art_title}}</p>
         </div>
         <div class="navBar-right">
             <el-input-number class="article-fontsize" v-model="wordFontsize" :step="2" step-strictly :min="12" :max="24" :style="{borderColor:bgColorList[activeIndex].boxBorder}"></el-input-number>
@@ -49,7 +49,7 @@
                 <el-collapse-transition >
                     <div v-if="showGlossary">
                         <h4 :style="{color:bgColorList[activeIndex].glossarySubtitle}">生词</h4>
-                        <new-word-list class="newWord-list" :list="wordList" :style="{background:bgColorList[activeIndex].glossaryBg}" :colorObj="bgColorList[activeIndex]"></new-word-list>
+                        <new-word-list class="newWord-list" :list="articleInfo.art_voc_data" :style="{background:bgColorList[activeIndex].glossaryBg}" :colorObj="bgColorList[activeIndex]"></new-word-list>
                         <h4 :style="{color:bgColorList[activeIndex].glossarySubtitle}">短语</h4>
                         <phrase-list class="newWord-list" :list="phraseList" :style="{background:bgColorList[activeIndex].glossaryBg}" :colorObj="bgColorList[activeIndex]"></phrase-list>
                         <h4 :style="{color:bgColorList[activeIndex].glossarySubtitle}">注释</h4>
@@ -499,6 +499,8 @@ export default {
         oppose: false, // 不支持
         timer: null,
         readLength: 0,
+        articleInfo: null,
+        loading: false,
     }
   },
   methods: {
@@ -583,6 +585,7 @@ export default {
         }
     },
     getArticleDetail(){
+        this.loading = true
         let this_ = this;
         let MethodName = "/PaperServer/Client/Article/GetArticleDetail";
         let data = {
@@ -590,12 +593,14 @@ export default {
         }
         getLogin(MethodName, data)
         .then((res) => {
+            this.loading = false
             if(res.status===1){
-                
+                this.articleInfo = res.data
+                this.inityuan()
             }
         })
         .catch(() => {
-            
+            this.loading = false
         }); 
         getLogin('/ShopServer/Client/ReadingRecordManager/GetReadingStatus_Article', {
             goods_type: 21,
@@ -652,7 +657,6 @@ export default {
     }
   },
   mounted(){
-    this.inityuan()
     let this_ = this;
     this_.timer = null;
     this_.readLength = 0

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

@@ -115,7 +115,7 @@
                 <div class="btn-box">
                     <a class="continue" v-if="isBuy==='true'" @click="handleLink">继续学习</a>
                     <template v-else>
-                        <a class="el-button" @click="handleChangeWay('wei')">立即购买</a>
+                        <a class="el-button" @click="handleChangeWay('wei')" :loading="createOrderLoading">立即购买</a>
                         <a class="upgrade" @click="handleChangeWay('dui')">使用兑换码</a>
                     </template> 
                 </div>
@@ -424,7 +424,8 @@ export default {
         pre_play_cs_item_id: '', //上次阅读课节id
         pre_play_index: null, // 上次阅读索引
         issueChnList:[],
-        order_amount: null
+        order_amount: null,
+        createOrderLoading: false
     }
   },
   //计算属性 类似于data概念
@@ -578,6 +579,7 @@ export default {
     },
     // 生成订单
     handleOrder(){
+        this.createOrderLoading = true
         let MethodName = "/ShopServer/Client/OrderManager/CreateOrder";
         let data = {
             goods_type: this.bookType==='LB'?0:this.bookType==='baozhi'?2:null,
@@ -586,12 +588,15 @@ export default {
         }
         getLogin(MethodName, data)
         .then((res) => {
+            this.createOrderLoading = false
             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
             }
+        }).catch(()=>{
+            this.createOrderLoading = false
         })
         // this.paymentShow = true;
     },
@@ -812,6 +817,7 @@ export default {
                     font-size: 16px;
                     line-height: 40px;
                     text-align: center;
+                    width: 128px;
                 }
             }
         }

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

@@ -75,7 +75,7 @@
                 <div class="btn-box">
                     <a class="continue" v-if="isBuy==='true'" @click="handleLink">继续学习</a>
                     <template v-else>
-                        <a class="el-button" @click="handleChangeWay('wei')">立即购买</a>
+                        <a class="el-button" @click="handleChangeWay('wei')" :loading="createOrderLoading">立即购买</a>
                         <a class="upgrade" @click="handleChangeWay('dui')">使用兑换码</a>
                     </template> 
                 </div>
@@ -157,6 +157,7 @@ export default {
         pre_play_cs_item_id: '', //上次阅读课节id
         pre_play_index: null, // 上次阅读索引
         order_amount: null,
+        createOrderLoading: false,
     }
   },
   //计算属性 类似于data概念
@@ -263,6 +264,7 @@ export default {
     },
     // 生成订单
     handleOrder(){
+        this.createOrderLoading = true
         let MethodName = "/ShopServer/Client/OrderManager/CreateOrder";
         let data = {
             goods_type: 3,
@@ -271,12 +273,15 @@ export default {
         }
         getLogin(MethodName, data)
         .then((res) => {
+            this.createOrderLoading = false
             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
             }
+        }).catch(()=>{
+            this.createOrderLoading = false
         })
         // this.paymentShow = true;
     },
@@ -496,6 +501,7 @@ export default {
                     font-size: 16px;
                     line-height: 40px;
                     text-align: center;
+                    width: 128px;
                 }
             }
         }

+ 1 - 1
src/views/bookShelf/components/NormalModel.vue

@@ -22,7 +22,7 @@
             />
             <svg-icon icon-class="icon-wrapper" class="wrapper"></svg-icon>
         </div>
-        <el-button round class="explain-video" @click="handleVideo"><svg-icon icon-class="video-line"></svg-icon>讲解视频</el-button>
+        <!-- <el-button round class="explain-video" @click="handleVideo"><svg-icon icon-class="video-line"></svg-icon>讲解视频</el-button> -->
     </div>
     <magazine-video v-if="magazineVideoShow" @closeWord="closeWord" style="margin-top:24px"></magazine-video>
     <template v-if="resArr.length > 0">

+ 37 - 19
src/views/bookStore/Subscribe.vue

@@ -4,6 +4,7 @@
       :headerBg="headerBg"
       :headerBorder="headerBorder"
       :userBg="userBg"
+      :LoginNavIndex="0"
     />
     <div class="navBar" v-if="info">
         <div class="navBar-left">
@@ -166,17 +167,17 @@
                             </el-tooltip>
                         </div>
                     </div>
-                    <div class="info-item order-item">
+                    <div class="info-item order-item" v-if="settlement">
                         <label>结算价格</label>
                         <div class="order-content">
-                            <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>
+                            <span class="OPPOSans">¥{{settlement.price_settlement|cutMoneyFiter}}</span>
+                            <span class="old-price" v-if="settlement.price&&settlement.price_settlement!==settlement.price">¥{{settlement.price|cutMoneyFiter}}</span>
                         </div>
                     </div>
                 </div>
                 <div class="btn-box">
-                    <a class="el-button" @click="handleChangeWay('wei')">立即购买</a>
-                    <a class="upgrade" @click="handleChangeWay('dui')">使用兑换码</a>
+                    <el-button class="el-button" @click="handleChangeWay('wei')" :loading="createOrderLoading">立即购买</el-button>
+                    <el-button class="upgrade" @click="handleChangeWay('dui')">使用兑换码</el-button>
                 </div>
             </div>
         </div>
@@ -438,7 +439,9 @@ export default {
                 study_phase: 23,
                 study_phase_name: '初三版'
             },
-        ]
+        ],
+        settlement: null, // 结算价格
+        createOrderLoading: false
     }
   },
   //计算属性 类似于data概念
@@ -473,18 +476,6 @@ 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!==-1?this.orderTotalNumber:this.customOrderNumberList.length,
@@ -529,6 +520,28 @@ export default {
         .catch(() => {
             this.loading = false
         }); 
+        this.handleOrderPrice()
+    },
+    // 计算结算价格
+    handleOrderPrice(){
+        this.loading = true
+        let MethodName = '/ShopServer/Client/ReservationQuery/ComputeReservationSettlementPrice_Issue'
+        let data = {
+            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
+        }
+        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){
@@ -538,7 +551,7 @@ export default {
             this.customOrderNumberList.push(item.issue_no)
             this.orderTable.push(item)
         }
-        // this.getInfo()
+        this.handleOrderPrice()
     },
     changeStudy(item){
         this.studyType = item.study_phase
@@ -580,6 +593,7 @@ export default {
     },
     // 生成订单
     handleOrder(){
+        this.createOrderLoading = true
         let MethodName = "/ShopServer/Client/OrderManager/CreateOrder";
         let data = {
             goods_type: this.bookType==='LB'?0:this.bookType==='baozhi'?2:null,
@@ -588,12 +602,15 @@ export default {
         }
         getLogin(MethodName, data)
         .then((res) => {
+            this.createOrderLoading = false
             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
             }
+        }).catch(()=>{
+            this.createOrderLoading = false
         })
         // this.paymentShow = true;
     },
@@ -867,6 +884,7 @@ export default {
                     font-size: 16px;
                     line-height: 40px;
                     text-align: center;
+                    width: 128px;
                 }
             }
         }