Browse Source

价格为0时隐藏 加教师姓名

natasha 2 years ago
parent
commit
4c54de7ea0

+ 31 - 20
src/components/learnCenter/Course.vue

@@ -6,10 +6,10 @@
         <span>
           <img src="../../assets/learncenter/listTitleImg1.png" alt="" />
         </span>
-        <b> <!-- 课程 -->{{ $t("Key215") }} </b>
+        <b> <!-- 课程 -->{{ $t('Key215') }} </b>
       </div>
       <div class="more" @click="gotolist">
-        <span> <!-- 查看更多  -->{{ $t("Key47") }} </span>
+        <span> <!-- 查看更多  -->{{ $t('Key47') }} </span>
         <img src="../../assets/learncenter/moreImage.png" alt="" />
       </div>
     </div>
@@ -20,12 +20,13 @@
           <img v-if="item.picture_url" :src="item.picture_url" alt="" />
           <span v-else>
             <!-- 加载失败 -->
-            {{ $t("Key323") }}
+            {{ $t('Key323') }}
           </span>
         </div>
 
         <p class="one_name">{{ item.name }}</p>
-        <p class="price">
+        <p class="teacher_name">{{ item.teacherName }}</p>
+        <p class="price" v-if="item.price>0">
           ¥<span class="price_1" v-html="changePrice(item.price)"></span>
         </p>
       </div>
@@ -35,41 +36,41 @@
 
 <script>
 export default {
-  props: ["classList", "type"],
+  props: ['classList', 'type'],
   data() {
-    return {};
+    return {}
   },
   methods: {
     gotolist() {
       this.$router.push({
-        path: "/learncenter/ListPage",
-        query: { id: "COURSE" },
-      });
+        path: '/learncenter/ListPage',
+        query: { id: 'COURSE' },
+      })
     },
 
     // 处理价格
     changePrice(price) {
-      let str = "";
-      price = price ? price.toString() : "0.00";
-      if (price.indexOf(".") > -1) {
-        let arr = price.split(".");
-        str = `<span style="font-size: 24px;">${arr[0]}</span>.<span style="font-size: 16px;">${arr[1]}</span>`;
+      let str = ''
+      price = price ? price.toString() : '0.00'
+      if (price.indexOf('.') > -1) {
+        let arr = price.split('.')
+        str = `<span style="font-size: 24px;">${arr[0]}</span>.<span style="font-size: 16px;">${arr[1]}</span>`
       } else {
-        str = `<span style="font-size: 24px;">${price}</span>.<span  style="font-size: 16px;">00</span>`;
+        str = `<span style="font-size: 24px;">${price}</span>.<span  style="font-size: 16px;">00</span>`
       }
 
-      return str;
+      return str
     },
     // 需要跳转到教学系统进行查看详情或者购买
     gotoIntroduce(item) {
-      let href = `/GCLS-Learn/#/GoodsDetail?goods_id=${item.id}&goods_type=201&invok_module=GCLS-LC`;
-      window.open(href, "_blank");
+      let href = `/GCLS-Learn/#/GoodsDetail?goods_id=${item.id}&goods_type=201&invok_module=GCLS-LC`
+      window.open(href, '_blank')
     },
   },
-};
+}
 </script>
 
-<style lang="scss"  scoped>
+<style lang="scss" scoped>
 .Course {
   .top {
     width: 1200px;
@@ -151,6 +152,16 @@ export default {
         font-size: 14px;
         color: #2c2c2c;
       }
+      .teacher_name {
+        font-size: 14px;
+        line-height: 150%;
+        height: 21px;
+        text-overflow: ellipsis;
+        overflow: hidden;
+        white-space: nowrap;
+        color: #2c2c2c;
+        opacity: 0.5;
+      }
       .price {
         margin-top: 8px;
         font-weight: bold;

+ 24 - 24
src/components/learnCenter/Textbook.vue

@@ -6,10 +6,10 @@
         <span>
           <img src="../../assets/learncenter/listTitleImg2.png" alt="" />
         </span>
-        <b>{{ $t("Key44") }}</b>
+        <b>{{ $t('Key44') }}</b>
       </div>
       <div class="more" @click="gotolist">
-        <span><!-- 查看更多  -->{{ $t("Key47") }}</span>
+        <span><!-- 查看更多  -->{{ $t('Key47') }}</span>
         <img src="../../assets/learncenter/moreImage.png" alt="" />
       </div>
     </div>
@@ -18,10 +18,10 @@
         <div class="listImage">
           <!-- <el-image lazy :src="item.picture_url" alt=""></el-image> -->
           <img v-if="item.picture_url" :src="item.picture_url" alt="" />
-          <span v-else> {{ $t("Key323") }}</span>
+          <span v-else> {{ $t('Key323') }}</span>
         </div>
         <p class="one_name">{{ item.name }}</p>
-        <p class="price">
+        <p class="price" v-if="item.price > 0 &&item.is_free_license=='false'">
           ¥<span class="price_1" v-html="changePrice(item.price)"></span>
         </p>
       </div>
@@ -30,49 +30,49 @@
 </template>
 
 <script>
-import { updateWordPack } from "@/utils/i18n";
+import { updateWordPack } from '@/utils/i18n'
 export default {
-  props: ["classList", "type"],
+  props: ['classList', 'type'],
   data() {
-    return {};
+    return {}
   },
   methods: {
     gotolist() {
       this.$router.push({
-        path: "/learncenter/ListPage",
-        query: { id: "TEXTBOOK" },
-      });
+        path: '/learncenter/ListPage',
+        query: { id: 'TEXTBOOK' },
+      })
     },
     // 处理价格
     // 处理价格
     changePrice(price) {
-      let str = "";
-      price = price ? price.toString() : "0.00";
-      if (price.indexOf(".") > -1) {
-        let arr = price.split(".");
-        str = `<span style="font-size: 24px;">${arr[0]}</span>.<span style="font-size: 16px;">${arr[1]}</span>`;
+      let str = ''
+      price = price ? price.toString() : '0.00'
+      if (price.indexOf('.') > -1) {
+        let arr = price.split('.')
+        str = `<span style="font-size: 24px;">${arr[0]}</span>.<span style="font-size: 16px;">${arr[1]}</span>`
       } else {
-        str = `<span style="font-size: 24px;">${price}</span>.<span  style="font-size: 16px;">00</span>`;
+        str = `<span style="font-size: 24px;">${price}</span>.<span  style="font-size: 16px;">00</span>`
       }
 
-      return str;
+      return str
     },
     // 需要跳到教材系统的教材详情
     gotoIntroduce(item) {
-      sessionStorage.setItem("Bookdetail", JSON.stringify(item));
-      let href = `/GCLS-Book/#/GoodsDetail?goods_id=${item.id}&goods_type=101&invok_module=GCLS-LC`;
-      window.open(href, "_blank");
+      sessionStorage.setItem('Bookdetail', JSON.stringify(item))
+      let href = `/GCLS-Book/#/GoodsDetail?goods_id=${item.id}&goods_type=101&invok_module=GCLS-LC`
+      window.open(href, '_blank')
     },
   },
   created() {
     updateWordPack({
-      word_key_list: ["Key44", "Key46"],
-    });
+      word_key_list: ['Key44', 'Key46'],
+    })
   },
-};
+}
 </script>
 
-<style lang="scss"  scoped>
+<style lang="scss" scoped>
 .Textbook {
   .top {
     width: 1200px;

+ 92 - 71
src/views/learn-center/ListPage.vue

@@ -35,16 +35,16 @@
 </template>
 
 <script>
-import Header from "@/components/Header";
-import Course from "@/components/learnCenter/Course";
-import Textbook from "@/components/learnCenter/Textbook";
+import Header from '@/components/Header'
+import Course from '@/components/learnCenter/Course'
+import Textbook from '@/components/learnCenter/Textbook'
 
-import { cousrseAPI, TextbookAPI } from "@/api/api";
-import HeaderOne from "@/components/learnCenter/HeaderOne";
-import { updateWordPack } from "@/utils/i18n";
+import { cousrseAPI, TextbookAPI } from '@/api/api'
+import HeaderOne from '@/components/learnCenter/HeaderOne'
+import { updateWordPack } from '@/utils/i18n'
 
 export default {
-  name: "teacher_edu",
+  name: 'teacher_edu',
   components: {
     Header,
     Course,
@@ -53,7 +53,7 @@ export default {
   },
   data() {
     return {
-      seekContent: "", //搜索内容
+      seekContent: '', //搜索内容
       navName: null,
       CourseList: null,
       targetPage: 1,
@@ -61,24 +61,24 @@ export default {
       pageNum: 1,
       pageSize: 8,
       loading: false,
-      headerOneTitle: "",
+      headerOneTitle: '',
       pageSizes: [],
       pageSizes1: [8, 16, 32, 64],
       pageSizes2: [10, 20, 30, 40],
       isData: false,
-    };
+    }
   },
   computed: {
     getCurrentQuestionView() {
       switch (this.navName) {
-        case "COURSE":
-          return Course;
-        case "TEXTBOOK":
-          return Textbook;
-        case "LEARNRESOURCE":
-          return Textbook;
+        case 'COURSE':
+          return Course
+        case 'TEXTBOOK':
+          return Textbook
+        case 'LEARNRESOURCE':
+          return Textbook
         default:
-          return null;
+          return null
       }
     },
   },
@@ -96,104 +96,125 @@ export default {
   methods: {
     // 切换导航
     handleSelect(key, keyPath) {
-      console.log(key, keyPath);
-      this.navName = key;
+      console.log(key, keyPath)
+      this.navName = key
     },
     // 搜索
     seekList() {},
     handleSizeChange(val) {
-      this.pageNum = 1;
-      this.pageSize = val;
-      this.getData();
+      this.pageNum = 1
+      this.pageSize = val
+      this.getData()
     },
     handleCurrentChange(val) {
-      this.pageNum = val;
-      this.getData();
+      this.pageNum = val
+      this.getData()
     },
     toPageChange() {
-      this.gotoPage = this.gotoPage.replace(/[^\d]/g, ""); //使用空字符串去替换非数字的字符
+      this.gotoPage = this.gotoPage.replace(/[^\d]/g, '') //使用空字符串去替换非数字的字符
       if (this.gotoPage > Math.ceil(this.CourseList.total_count / 8)) {
-        return;
+        return
       } else if (this.gotoPage != this.targetPage) {
-        this.targetPage = this.gotoPage * 1;
-        this.pageNum = this.gotoPage * 1;
-        this.getData();
+        this.targetPage = this.gotoPage * 1
+        this.pageNum = this.gotoPage * 1
+        this.getData()
       }
     },
     // 获取数据
     getData(val) {
-      this.loading = true;
+      this.loading = true
 
-      if (this.navName == "COURSE") {
-        this.pageSizes = this.pageSizes1;
+      if (this.navName == 'COURSE') {
+        this.pageSizes = this.pageSizes1
         // 获取课程列表
-        cousrseAPI("page_query-PageQueryCourseList", {
+        cousrseAPI('page_query-PageQueryCourseList', {
           page_capacity: this.pageSize,
           cur_page: this.pageNum,
           finish_status: 53,
           release_status: 1,
         }).then((res) => {
-          this.CourseList = res;
-          this.loading = false;
-        });
+          this.CourseList = res
+          this.CourseList.course_list.forEach((item, index) => {
+            let teacher_list = [
+              {
+                teacher_name: '张仪',
+              },
+              {
+                teacher_name: '吴先文',
+              },
+              {
+                teacher_name: '韦所所',
+              },
+              {
+                teacher_name: '罗蒙',
+              },
+            ]
+            item.teacherName = teacher_list
+              .map(function(obj, index) {
+                return obj.teacher_name
+              })
+              .join(' ')
+          })
+          this.loading = false
+        })
       }
-      if (this.navName == "TEXTBOOK") {
-        this.pageSizes = this.pageSizes2;
-        TextbookAPI("book-book_manager-PageQueryBookList", {
+      if (this.navName == 'TEXTBOOK') {
+        this.pageSizes = this.pageSizes2
+        TextbookAPI('book-book_manager-PageQueryBookList', {
           page_capacity: this.pageSize == 8 ? this.pageSize + 2 : this.pageSize,
           cur_page: this.pageNum,
           publish_status: 1,
-          is_control_publish_scope: "true",
+          is_control_publish_scope: 'true',
         }).then((res) => {
-          this.CourseList = res;
-          this.loading = false;
-        });
+          this.CourseList = res
+          this.loading = false
+        })
       }
 
-      if (this.navName == "LEARNRESOURCE") {
-        this.pageSizes = this.pageSizes2;
-        TextbookAPI("book-book_manager-PageQueryBookList", {
+      if (this.navName == 'LEARNRESOURCE') {
+        this.pageSizes = this.pageSizes2
+        TextbookAPI('book-book_manager-PageQueryBookList', {
           page_capacity: this.pageSize == 8 ? this.pageSize + 2 : this.pageSize,
           cur_page: this.pageNum,
           publish_status: 1,
-          is_control_publish_scope: "true",
+          is_control_publish_scope: 'true',
         }).then((res) => {
-          this.CourseList = res;
-          this.loading = false;
-        });
+          this.CourseList = res
+          this.loading = false
+        })
       }
     },
   },
   async created() {
-    this.navName = this.$route.query.id;
+    this.navName = this.$route.query.id
     await updateWordPack({
       word_key_list: [
-        "Key8",
-        "Key38",
-        "Key39",
-        "Key573",
-        "Key44",
-        "Key46",
-        "Key323",
-        "Key215",
+        'Key8',
+        'Key38',
+        'Key39',
+        'Key573',
+        'Key44',
+        'Key46',
+        'Key323',
+        'Key215',
       ],
-    });
-    this.isData = true;
-    if (this.navName == "COURSE") {
-      this.headerOneTitle = this.$t("Key215");
+    })
+    this.isData = true
+    if (this.navName == 'COURSE') {
+      this.headerOneTitle = this.$t('Key215')
     }
-    if (this.navName == "TEXTBOOK") {
-      this.headerOneTitle = this.$t("Key44");
+    if (this.navName == 'TEXTBOOK') {
+      this.headerOneTitle = this.$t('Key44')
     }
-    if (this.navName == "LEARNRESOURCE") {
-      this.headerOneTitle = "学习资源"; //this.$t("Key44");
+    if (this.navName == 'LEARNRESOURCE') {
+      this.headerOneTitle = '学习资源' //this.$t("Key44");
     }
 
-    this.getData();
+    this.getData()
   },
-};
+}
 </script>
-<style lang="scss"  scoped>
+<style lang="scss" scoped>
 .teacher_edu {
   min-height: 100vh;
   background: #f6f6f6;
@@ -239,7 +260,7 @@ export default {
   color: #2c2c2c;
 }
 .el-pagination button,
-.el-pagination span:not([class*="suffix"]) {
+.el-pagination span:not([class*='suffix']) {
   height: 32px;
   line-height: 32px;
 }

+ 92 - 71
src/views/learn-center/Seekresult.vue

@@ -60,7 +60,7 @@
           <img src="../../assets/learncenter/noSeekResult.png" alt="" />
           <p class="p1">
             <!-- 抱歉,我找不到相关的内容。 -->
-            {{ $t("Key547") }}
+            {{ $t('Key547') }}
           </p>
           <!-- <p class="p2">Try the following keywords</p> -->
           <!-- <div class="keywords">
@@ -75,14 +75,14 @@
 </template>
 
 <script>
-import { cousrseAPI, TextbookAPI } from "@/api/api";
+import { cousrseAPI, TextbookAPI } from '@/api/api'
 
-import Header from "@/components/Header";
-import HeaderOne from "@/components/learnCenter/HeaderOne";
-import ClassicalCourse from "@/components/learnCenter/ClassicalCourse";
-import Course from "@/components/learnCenter/Course";
-import Textbook from "@/components/learnCenter/Textbook";
-import { updateWordPack } from "@/utils/i18n";
+import Header from '@/components/Header'
+import HeaderOne from '@/components/learnCenter/HeaderOne'
+import ClassicalCourse from '@/components/learnCenter/ClassicalCourse'
+import Course from '@/components/learnCenter/Course'
+import Textbook from '@/components/learnCenter/Textbook'
+import { updateWordPack } from '@/utils/i18n'
 export default {
   props: [],
   components: {
@@ -97,9 +97,9 @@ export default {
       CourseList: null, //课程列表
       TextList: null, //教材列表
       dataList: null, //展示列表
-      seekContent: "", //搜索内容
-      gotoPage: "",
-      keycode: "",
+      seekContent: '', //搜索内容
+      gotoPage: '',
+      keycode: '',
       pageNum: 1,
       pageSize: 8,
       targetPage: 1,
@@ -111,17 +111,17 @@ export default {
       pageSizes: [8, 16, 32, 64],
       pageSizes1: [8, 16, 32, 64],
       pageSizes2: [10, 20, 30, 40],
-    };
+    }
   },
   computed: {
     getCurrentQuestionView() {
       switch (this.classilfyIndex) {
         case 0:
-          return Course;
+          return Course
         case 1:
-          return Textbook;
+          return Textbook
         default:
-          return null;
+          return null
       }
     },
   },
@@ -129,126 +129,147 @@ export default {
     classilfyIndex(newval, oldval) {
       if (newval != oldval) {
         if (newval == 0) {
-          this.pageNum = 1;
-          this.pageSizes = this.pageSizes1;
-          this.getData("课程");
+          this.pageNum = 1
+          this.pageSizes = this.pageSizes1
+          this.getData('课程')
         } else if (newval == 1) {
-          this.pageNum = 1;
-          this.pageSizes = this.pageSizes2;
-          this.getData("教材");
+          this.pageNum = 1
+          this.pageSizes = this.pageSizes2
+          this.getData('教材')
         }
       }
     },
   },
   methods: {
     handleSizeChange(val) {
-      this.pageNum = 1;
-      this.pageSize = val;
+      this.pageNum = 1
+      this.pageSize = val
       if (this.classilfyIndex == 0) {
-        this.getData("课程");
+        this.getData('课程')
       } else if (this.classilfyIndex == 1) {
-        this.getData("教材");
+        this.getData('教材')
       }
     },
     // 跳页
     handleCurrentChange(val) {
-      this.pageNum = val;
+      this.pageNum = val
       if (this.classilfyIndex == 0) {
-        this.getData("课程");
+        this.getData('课程')
       } else if (this.classilfyIndex == 1) {
-        this.getData("教材");
+        this.getData('教材')
       }
     },
     // 切换分类
     cutClassilfy(item, i) {
-      this.classilfyIndex = i;
+      this.classilfyIndex = i
     },
     // 获取子组件传过来的keycode进行查询
     changeKeycode(val) {
-      this.keycode = val;
+      this.keycode = val
       if (this.classilfyIndex == 0) {
-        this.getData("课程");
+        this.getData('课程')
       } else if (this.classilfyIndex == 1) {
-        this.getData("教材");
+        this.getData('教材')
       }
     },
     // 输入目标页 并跳到目标页
     toPageChange() {
-      this.gotoPage = this.gotoPage.replace(/[^\d]/g, ""); //使用空字符串去替换非数字的字符
+      this.gotoPage = this.gotoPage.replace(/[^\d]/g, '') //使用空字符串去替换非数字的字符
       if (this.gotoPage > Math.ceil(this.CourseList.total / 8)) {
-        return;
+        return
       } else if (this.gotoPage != this.targetPage) {
-        this.targetPage = this.gotoPage * 1;
-        this.pageNum = this.gotoPage * 1;
+        this.targetPage = this.gotoPage * 1
+        this.pageNum = this.gotoPage * 1
         if (this.classilfyIndex == 0) {
-          this.getData("课程");
+          this.getData('课程')
         } else if (this.classilfyIndex == 1) {
-          this.getData("教材");
+          this.getData('教材')
         }
       }
     },
     // 获取数据
     getData(val) {
-      this.loading = true;
-      if (val == "课程") {
+      this.loading = true
+      if (val == '课程') {
         // 获取课程列表
-        cousrseAPI("page_query-PageQueryCourseList", {
+        cousrseAPI('page_query-PageQueryCourseList', {
           page_capacity: this.pageSize,
           cur_page: this.pageNum,
           finish_status: 53,
           release_status: 1,
           name: this.keycode,
         }).then((res) => {
-          this.dataList = res;
-          this.CourseList = res;
-          this.loading = false;
-        });
+          this.dataList = res
+          this.dataList.course_list.forEach((item, index) => {
+            let teacher_list = [
+              {
+                teacher_name: '张仪',
+              },
+              {
+                teacher_name: '吴先文',
+              },
+              {
+                teacher_name: '韦所所',
+              },
+              {
+                teacher_name: '罗蒙',
+              },
+            ]
+            item.teacherName = teacher_list
+              .map(function(obj, index) {
+                return obj.teacher_name
+              })
+              .join(' ')
+          })
+          this.CourseList = res
+          this.loading = false
+        })
       } else {
-        TextbookAPI("book-book_manager-PageQueryBookList", {
+        TextbookAPI('book-book_manager-PageQueryBookList', {
           cur_page: this.pageNum,
           page_capacity: this.pageSize == 8 ? this.pageSize + 2 : this.pageSize,
           name: this.keycode,
           publish_status: 1,
-          is_control_publish_scope: "true",
+          is_control_publish_scope: 'true',
         }).then((res) => {
-          this.TextList = res;
-          if (val == "教材") {
-            this.dataList = null;
-            this.dataList = this.TextList;
-            this.loading = false;
+          this.TextList = res
+          if (val == '教材') {
+            this.dataList = null
+            this.dataList = this.TextList
+            this.loading = false
           }
-        });
+        })
       }
     },
   },
   async created() {
-    this.keycode = this.$route.query.keycode;
-    this.classilfyID = this.$route.query.id;
+    this.keycode = this.$route.query.keycode
+    this.classilfyID = this.$route.query.id
     // classilfyIndex
     // if (this.$route.query.id == "COURSE") {
-    this.classilfyIndex = 0;
-    this.getData("课程");
+    this.classilfyIndex = 0
+    this.getData('课程')
     // } else {
     //   this.getData("教材");
     //   this.classilfyIndex = 1;
     // }
     await updateWordPack({
       word_key_list: [
-        "Key8",
-        "Key38",
-        "Key39",
-        "Key573",
-        "Key44",
-        "Key215",
-        "Key248",
-        "Key323",
-        "Key547",
+        'Key8',
+        'Key38',
+        'Key39',
+        'Key573',
+        'Key44',
+        'Key215',
+        'Key248',
+        'Key323',
+        'Key547',
       ],
-    });
-    this.isData = true;
-    this.classilfyList = [this.$t("Key215"), this.$t("Key44")];
+    })
+    this.isData = true
+    this.classilfyList = [this.$t('Key215'), this.$t('Key44')]
   },
-};
+}
 </script>
 
 <style lang="scss" scoped>
@@ -358,4 +379,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 87 - 67
src/views/learn-center/index.vue

@@ -13,9 +13,9 @@
           active-text-color="#FF9900"
         >
           <el-menu-item index="COURSE"
-            ><!-- 课程 -->{{ $t("Key215") }}</el-menu-item
+            ><!-- 课程 -->{{ $t('Key215') }}</el-menu-item
           >
-          <el-menu-item index="TEXTBOOK">{{ $t("Key44") }}</el-menu-item>
+          <el-menu-item index="TEXTBOOK">{{ $t('Key44') }}</el-menu-item>
           <!-- <el-menu-item index="LEARNRESOURCE">学习资源</el-menu-item> -->
           <!-- <el-menu-item index="LIVE LESSON">LIVE LESSON</el-menu-item>
         <el-menu-item index="VIDEO COURSE">VIDEO COURSE</el-menu-item> -->
@@ -69,18 +69,18 @@
 </template>
 
 <script>
-import { mapGetters } from "vuex";
-import Header from "@/components/Header";
-import Course from "@/components/learnCenter/Course";
-import Textbook from "@/components/learnCenter/Textbook";
-import Learnresource from "@/components/learnCenter/Learnresource";
-import Live from "@/components/learnCenter/Live";
-import VideoCourse from "@/components/learnCenter/VideoCourse";
-import Cookies from "js-cookie";
-import { cousrseAPI, TextbookAPI } from "@/api/api";
-import { updateWordPack } from "@/utils/i18n";
+import { mapGetters } from 'vuex'
+import Header from '@/components/Header'
+import Course from '@/components/learnCenter/Course'
+import Textbook from '@/components/learnCenter/Textbook'
+import Learnresource from '@/components/learnCenter/Learnresource'
+import Live from '@/components/learnCenter/Live'
+import VideoCourse from '@/components/learnCenter/VideoCourse'
+import Cookies from 'js-cookie'
+import { cousrseAPI, TextbookAPI } from '@/api/api'
+import { updateWordPack } from '@/utils/i18n'
 export default {
-  name: "lear_center",
+  name: 'lear_center',
   components: {
     Header,
     Course,
@@ -93,130 +93,150 @@ export default {
   data() {
     return {
       isData: false,
-      seekContent: "", //搜索内容
-      activeIndex: "COURSE", //默认展示精品课程
-      navName: "COURSE",
+      seekContent: '', //搜索内容
+      activeIndex: 'COURSE', //默认展示精品课程
+      navName: 'COURSE',
       buy: false,
       classList: [],
       disSeekShow: false,
       loading: false,
       ImageList: [
         {
-          url: "../../assets/learncenter/Rectangle 1048.png",
-          name: "Rectangle 1048",
+          url: '../../assets/learncenter/Rectangle 1048.png',
+          name: 'Rectangle 1048',
         },
         {
-          url: "../../assets/learncenter/Rectangle 1049.png",
-          name: "Rectangle 1049",
+          url: '../../assets/learncenter/Rectangle 1049.png',
+          name: 'Rectangle 1049',
         },
         {
-          url: "../../assets/learncenter/Rectangle 1051.png",
-          name: "Rectangle 1051",
+          url: '../../assets/learncenter/Rectangle 1051.png',
+          name: 'Rectangle 1051',
         },
         {
-          url: "../../assets/learncenter/Rectangle 1052.png",
-          name: "Rectangle 1052",
+          url: '../../assets/learncenter/Rectangle 1052.png',
+          name: 'Rectangle 1052',
         },
       ], //轮播图列表 测试
       courseList: null, //课程列表
       TextbookList: null, //教材列表
       LearnResourceList: null, //学习资源
-      SeekName: "",
-    };
+      SeekName: '',
+    }
   },
   computed: {
-    ...mapGetters(["language_type"]),
+    ...mapGetters(['language_type']),
   },
   methods: {
     // 切换导航
     handleSelect(key, keyPath) {
-      console.log(key, keyPath);
-      this.navName = key;
-      this.changeNav(key);
+      this.navName = key
+      this.changeNav(key)
     },
     // 锚点定位
     changeNav(index) {
-      let id = index;
-      let dom = document.getElementById(id);
+      let id = index
+      let dom = document.getElementById(id)
       if (dom) {
-        document.getElementById(id).scrollIntoView();
+        document.getElementById(id).scrollIntoView()
       }
     },
     // 搜索
     seekList() {
-      this.disSeekShow = true;
+      this.disSeekShow = true
     },
     // 前往搜索结果
     gotoSeekResult(item) {
       // this.$router.push({ path: "/SeekResult", query: { item } });
-      if (this.SeekName == "") {
-        this.$message.warning("Please enter the contents");
-        return;
+      if (this.SeekName == '') {
+        this.$message.warning('Please enter the contents')
+        return
       } else {
         this.$router.push({
-          path: "/learncenter/Seekresult",
+          path: '/learncenter/Seekresult',
           query: {
             keycode: this.SeekName,
           },
-        });
+        })
       }
     },
     keyDownSeekData(e) {
       if (e.keyCode == 13) {
-        this.gotoSeekResult();
+        this.gotoSeekResult()
       }
     },
   },
   async created() {
-    this.loading = true;
+    this.loading = true
     // 获取课程列表  需要从中截取出4个作为轮播图
-    cousrseAPI("page_query-PageQueryCourseList", {
+    cousrseAPI('page_query-PageQueryCourseList', {
       page_capacity: 8,
       cur_page: 1,
       finish_status: 53,
       release_status: 1,
     })
       .then((res) => {
-        this.courseList = res.course_list;
-        this.ImageList = res.course_list.slice(0, 4);
+        this.courseList = res.course_list
+        this.courseList.forEach((item, index) => {
+          let teacher_list = [
+            {
+              teacher_name: '张仪',
+            },
+            {
+              teacher_name: '吴先文',
+            },
+            {
+              teacher_name: '韦所所',
+            },
+            {
+              teacher_name: '罗蒙',
+            },
+          ]
+          item.teacherName = teacher_list
+            .map(function(obj, index) {
+              return obj.teacher_name
+            })
+            .join(' ')
+        })
+        this.ImageList = res.course_list.slice(0, 4)
       })
       .catch(() => {
-        this.loading = false;
-      });
+        this.loading = false
+      })
     // 获取教材列表
-    TextbookAPI("book-book_manager-PageQueryBookList", {
+    TextbookAPI('book-book_manager-PageQueryBookList', {
       page_capacity: 10,
       cur_page: 1,
       publish_status: 1,
-      is_control_publish_scope: "true",
+      is_control_publish_scope: 'true',
     })
       .then((res) => {
-        this.TextbookList = res.book_list;
-        this.loading = false;
+        this.TextbookList = res.book_list
+        this.loading = false
       })
       .catch(() => {
-        this.loading = false;
-      });
+        this.loading = false
+      })
     await updateWordPack({
       word_key_list: [
-        "Key8",
-        "Key38",
-        "Key39",
-        "Key44",
-        "Key46",
-        "Key47",
-        "Key147",
-        "Key215",
-        "Key323",
-        "Key573",
+        'Key8',
+        'Key38',
+        'Key39',
+        'Key44',
+        'Key46',
+        'Key47',
+        'Key147',
+        'Key215',
+        'Key323',
+        'Key573',
       ],
-    });
-    this.isData = true;
+    })
+    this.isData = true
   },
-};
+}
 </script>
 
-<style lang="scss"  scoped>
+<style lang="scss" scoped>
 .lear_center {
   min-height: 100vh;
   background: #f6f6f6;
@@ -297,4 +317,4 @@ export default {
     font-weight: 600;
   }
 }
-</style>
+</style>