소스 검색

购买量和是否购买

natasha 1 년 전
부모
커밋
2e72ba9000
2개의 변경된 파일12개의 추가작업 그리고 10개의 파일을 삭제
  1. 10 8
      src/views/bookShelf/bookItem.vue
  2. 2 2
      src/views/login.vue

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

@@ -112,8 +112,8 @@
                     </div>
                 </div>
                 <div class="btn-box">
-                    <a class="continue" v-if="data.isBuy">继续学习</a>
-                    <a class="upgrade" v-if="data.isBuy">升级为讲解版</a>
+                    <a class="continue" v-if="isBuy==='true'">继续学习</a>
+                    <a class="upgrade" v-if="isBuy==='true'">升级为讲解版</a>
                     <template v-else>
                         <a class="el-button" @click="handleChangeWay('wei')">立即购买</a>
                         <a class="upgrade" @click="handleChangeWay('dui')">使用兑换码</a>
@@ -135,7 +135,7 @@
             <el-tab-pane label="目录" v-if="bookType==='baozhi'">
                 <tree-list 
                     :data="data.treeList" 
-                    :isBuy="data.isBuy"
+                    :isBuy="isBuy==='true'"
                     :headerBg="headerBg"
                     :headerBorder="headerBorder"
                     :userBg="userBg"
@@ -164,7 +164,7 @@
                 </div> -->
                 <tree-list 
                     :data="data.treeLists" 
-                    :isBuy="data.isBuy"
+                    :isBuy="isBuy==='true'"
                     :headerBg="headerBg"
                     :headerBorder="headerBorder"
                     :userBg="userBg"
@@ -175,7 +175,7 @@
             <el-tab-pane label="课程目录" v-if="bookType==='LB'">
                 <course-list 
                     :data="courseList" 
-                    :isBuy="data.isBuy" 
+                    :isBuy="isBuy==='true'" 
                     :headerBg="headerBg"
                     :headerBorder="headerBorder"
                     :userBg="userBg"
@@ -414,8 +414,9 @@ export default {
         id: this.$route.query.id?this.$route.query.id:'',
         info: null, // 信息
         courseList:[],
-        sales: 900000,
-        salesCn: '1000+',
+        sales: null,
+        salesCn: '',
+        isBuy: 'false'
     }
   },
   //计算属性 类似于data概念
@@ -456,7 +457,8 @@ export default {
             if(res.status===1){
                 this.info = res.lb_course
                 this.courseList = this.handleCourseLength(res.cs_item_list)
-                console.log(this.sales<10000)
+                this.isBuy = res.buy_info.is_buy
+                this.sales = res.buy_info.total_buy_count
                 if(this.sales<1000){
                     this.salesCn = ''
                 }else if(1000<=this.sales&&this.sales<10000){

+ 2 - 2
src/views/login.vue

@@ -27,7 +27,7 @@
                 <a class="forgotPwd">忘记密码?</a>
             </el-form-item>
             <el-form-item class="btn-box">
-                <el-button type="primary" @click="onSubmitPassword('loginPwdForm')" size="small" :loading="loading">保存</el-button>
+                <el-button type="primary" @click="onSubmitPassword('loginPwdForm')" size="small" :loading="loading">登录</el-button>
                 <el-button @click="onCancel('loginPwdForm')" size="small">取消</el-button>
             </el-form-item>
         </el-form>
@@ -53,7 +53,7 @@
                 <a class="forgotPwd">忘记密码?</a>
             </el-form-item>
             <el-form-item class="btn-box">
-                <el-button type="primary" @click="onSubmitPassword('loginCodeForm')" size="small" :loading="loading">保存</el-button>
+                <el-button type="primary" @click="onSubmitPassword('loginCodeForm')" size="small" :loading="loading">登录</el-button>
                 <el-button @click="onCancel('loginCodeForm')" size="small">取消</el-button>
             </el-form-item>
         </el-form>