Browse Source

首页课程和报纸列表

natasha 1 năm trước cách đây
mục cha
commit
991c01e8c1

+ 4 - 4
src/components/common/BookCard.vue

@@ -6,7 +6,7 @@
     ></div> -->
     <el-image
         class="image"
-        :src="item.src"
+        :src="item.cover_image_url?item.cover_image_url:item.type1==='baozhi'?require('../../assets/baozhi'+(Math.floor(Math.random()*2)+1)+'.png'):require('../../assets/kecheng'+(Math.floor(Math.random()*3)+1)+'.png')"
         :fit="'contain'">
     </el-image>
     <div class="bottom">
@@ -21,11 +21,11 @@
         >
         </el-rate>
       </template> -->
-      <p class="author">{{item.date||item.typeName||item.classperiod||item.author}}</p>
+      <p class="author">{{item.shelve_date||item.typeName||item.classperiod||item.author}}</p>
       <template v-if="!type||type!='bookShelf'">
         <p class="price">
-          <span class="OPPOSans">¥{{item.price|cutMoneyFiter}}</span>
-          <s>¥{{item.oldprice|cutMoneyFiter}}</s>
+          <span class="OPPOSans">¥{{item.price_discount|cutMoneyFiter}}</span>
+          <s>¥{{item.price|cutMoneyFiter}}</s>
         </p>
       </template>
     </div>

+ 45 - 3
src/views/bookStore/index.vue

@@ -38,7 +38,7 @@
       />
       <BookListModule
         name="baozhi"
-        :list="BookList2"
+        :list="IssueList"
         :headerBg="'#1F1F1F'"
         :headerBorder="'#5C5C5C'"
         :userBg="'rgba(0, 0, 0, 0.24)'"
@@ -56,7 +56,7 @@
       /> -->
       <BookListModule
         name="kecheng"
-        :list="BookList3"
+        :list="LBCourseList"
         :headerBg="'#1F1F1F'"
         :headerBorder="'#5C5C5C'"
         :userBg="'rgba(0, 0, 0, 0.24)'"
@@ -82,6 +82,7 @@
 //例如:import 《组件名称》from ‘《组件路径》';
 import Header from "../../components/Header.vue";
 import BookListModule from "@/components/common/BookListModule.vue"
+import { getLogin } from "@/api/ajax";
 
 export default {
   //import引入的组件需要注入到对象中才能使用
@@ -218,6 +219,8 @@ export default {
         score: 3,
       }
       ],
+      LBCourseList:[], // 录播课列表
+      IssueList: [], // 报纸列表
       bannerFlag: true // 是否展示广告
     }
   },
@@ -227,10 +230,49 @@ export default {
   watch: {},
   //方法集合
   methods: {
+    // 获取录播课列表
+    getLBCourseList(){
+        let MethodName = "/ShopServer/Client/ShopHomeQuery/QueryLBCourseList";
+        let data = {
+            top_n: 5
+        }
+        getLogin(MethodName, data)
+        .then((res) => {
+            if(res.status===1){
+                res.lb_course_list.forEach(item => {
+                    item.type1="kecheng"
+                });
+                this.LBCourseList = res.lb_course_list
+            }
+        })
+        .catch(() => {
+            
+        }); 
+    },
+    // 获取报纸列表
+    getIssueList(){
+        let MethodName = "/ShopServer/Client/ShopHomeQuery/QueryIssueList";
+        let data = {
+            top_n: 5
+        }
+        getLogin(MethodName, data)
+        .then((res) => {
+            if(res.status===1){
+                res.issue_list.forEach(item => {
+                    item.type1="baozhi"
+                });
+                this.IssueList = res.issue_list
+            }
+        })
+        .catch(() => {
+            
+        }); 
+    }
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
-
+    this.getLBCourseList()
+    this.getIssueList()
   },
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {

+ 1 - 1
src/views/personalCenter/components/Setting.vue

@@ -245,7 +245,7 @@ export default {
             if (result) {
                 callback();
             } else {
-                callback(new Error('密码只能包含数字和字母'));
+                callback(new Error('密码必须同时包含数字和大小写字母'));
             }
             
         }