Tang 2 jaren geleden
bovenliggende
commit
d5ad642302
2 gewijzigde bestanden met toevoegingen van 354 en 166 verwijderingen
  1. 339 163
      src/pages/home/index.vue
  2. 15 3
      src/pages/person-center/my-course/index.vue

+ 339 - 163
src/pages/home/index.vue

@@ -6,16 +6,23 @@
           <div class="text-list" v-if="!userInfo">
             <a @click="go('/login', { state: 1 })">登录</a>
             <a @click="go('/login', { state: 2 })">注册</a>
-
           </div>
 
           <div class="icon-list" v-else>
             <!-- <a @click="go('/person-center/my-message')">
               <i class="el-icon-message-solid icon"></i>
             </a> -->
-            <el-badge :is-dot="msgCount > 0 ? true : false" class="item" style="vertical-align: baseline">
-              <el-button style="font-size: 20px; padding: 0px" icon="el-icon-message-solid" type="text"
-                @click="go('/person-center/my-message')"></el-button>
+            <el-badge
+              :is-dot="msgCount > 0 ? true : false"
+              class="item"
+              style="vertical-align: baseline"
+            >
+              <el-button
+                style="font-size: 20px; padding: 0px"
+                icon="el-icon-message-solid"
+                type="text"
+                @click="go('/person-center/my-message')"
+              ></el-button>
             </el-badge>
             <!-- <el-tooltip placement="bottom-end" v-model="msgShow" :hide-after="0" manual popper-class="tooltipStyle">
               <el-badge :is-dot="msgCount > 0 ? true : false" class="item" style="vertical-align: baseline">
@@ -30,12 +37,16 @@
             </el-tooltip> -->
             <el-dropdown @command="handleCommand">
               <span class="el-dropdown-link">
-                <i class="el-icon-user-solid" style="
+                <i
+                  class="el-icon-user-solid"
+                  style="
                     font-size: 20px;
                     color: #3f8dfd;
                     cursor: pointer;
                     margin-left: 20px;
-                  " @click="go('/person-center/my-course')"></i>
+                  "
+                  @click="go('/person-center/my-course')"
+                ></i>
               </span>
               <el-dropdown-menu slot="dropdown">
                 <el-dropdown-item command="1">我的课程</el-dropdown-item>
@@ -51,7 +62,11 @@
       <div class="header__body">
         <div class="container clearfix">
           <a class="logo">
-            <img v-if="header.companyLogo" :src="$tools.splitImgHost(header.companyLogo)" alt="" />
+            <img
+              v-if="header.companyLogo"
+              :src="$tools.splitImgHost(header.companyLogo)"
+              alt=""
+            />
             <h1 v-else></h1>
           </a>
           <div class="search">
@@ -63,11 +78,21 @@
               </select>
             </div>
             <div class="search__input">
-              <input v-model="searchKey" type="text" autocomplete="new-password" />
+              <input
+                v-model="searchKey"
+                type="text"
+                autocomplete="new-password"
+              />
             </div>
-            <el-button type="primary" @click="search" class="search__btn">搜索</el-button>
+            <el-button type="primary" @click="search" class="search__btn"
+              >搜索</el-button
+            >
           </div>
-          <div class="contact" v-show="false" v-if="header.serviceTel.status == 1">
+          <div
+            class="contact"
+            v-show="false"
+            v-if="header.serviceTel.status == 1"
+          >
             <div class="contact__phone">{{ header.serviceTel.tel }}</div>
             <div class="contact__time">
               {{ header.serviceTel.time }}
@@ -81,11 +106,37 @@
       <div class="container">
         <div class="tabs">
           <template v-for="(item, index) in showNav(header.Nav)">
-            <a v-if="item.name === '首页'" :key="index" class="tab active">首页</a>
-            <a v-if="item.name === '走进祥粤'" :key="index" class="tab" @click="go('/about')">走进祥粤</a>
-            <a v-if="item.name === '课程'" :key="index" class="tab" @click="go('/course-list')">课程</a>
-            <a v-if="item.name === '题库'" :key="index" class="tab" @click="go('/bank-list')">题库</a>
-            <a v-if="item.name === '直播'" :key="index" class="tab" @click="go('/live-list')">直播</a>
+            <a v-if="item.name === '首页'" :key="index" class="tab active"
+              >首页</a
+            >
+            <a
+              v-if="item.name === '走进祥粤'"
+              :key="index"
+              class="tab"
+              @click="go('/about')"
+              >走进祥粤</a
+            >
+            <a
+              v-if="item.name === '课程'"
+              :key="index"
+              class="tab"
+              @click="go('/course-list')"
+              >课程</a
+            >
+            <a
+              v-if="item.name === '题库'"
+              :key="index"
+              class="tab"
+              @click="go('/bank-list')"
+              >题库</a
+            >
+            <a
+              v-if="item.name === '直播'"
+              :key="index"
+              class="tab"
+              @click="go('/live-list')"
+              >直播</a
+            >
           </template>
         </div>
       </div>
@@ -96,13 +147,20 @@
             <div class="left-box__body">
               <div class="bg"></div>
               <div class="slide-list">
-                <div class="slide-list__item" v-for="(type, typeItem) in typeList" :key="'type' + typeItem">
+                <div
+                  class="slide-list__item"
+                  v-for="(type, typeItem) in typeList"
+                  :key="'type' + typeItem"
+                >
                   <div class="title" @click="goCourse(type)">
                     {{ type.educationName }}
                   </div>
                   <ul class="nav">
-                    <li v-for="(slideItem, slideIndex) in slideList[typeItem]" :key="'item' + slideIndex"
-                      @click="goCourse(slideItem)">
+                    <li
+                      v-for="(slideItem, slideIndex) in slideList[typeItem]"
+                      :key="'item' + slideIndex"
+                      @click="goCourse(slideItem)"
+                    >
                       <div class="text">
                         <!-- {{ slideItem.projectName }}-{{ slideItem.businessName }} -->
                         {{ slideItem.aliasName }}
@@ -118,8 +176,12 @@
                       {{ item.educationName }}
                     </div>
                     <div class="text__desc">
-                      <a @click="goCourse(aItem)" class="item" v-for="(aItem, aIndex) in item.list"
-                        :key="'aItem' + aIndex">
+                      <a
+                        @click="goCourse(aItem)"
+                        class="item"
+                        v-for="(aItem, aIndex) in item.list"
+                        :key="'aItem' + aIndex"
+                      >
                         <!-- {{ aItem.projectName }}-{{ aItem.businessName }} -->
                         {{ aItem.aliasName }}
                       </a>
@@ -131,10 +193,22 @@
           </div>
 
           <div class="swiper">
-            <swiper v-if="bannerList.length > 0" ref="mySwiper"
-              @slideChangeTransitionStart="slideChangeTransitionStart($event)" class="" v-bind:options="swiperOptions">
-              <swiper-slide v-for="(item, index) in bannerList" v-bind:key="index" @click.native="swiperJump(item)">
-                <img :src="$tools.splitImgHost(item.adverUrl, true, 1272)" alt="" />
+            <swiper
+              v-if="bannerList.length > 0"
+              ref="mySwiper"
+              @slideChangeTransitionStart="slideChangeTransitionStart($event)"
+              class=""
+              v-bind:options="swiperOptions"
+            >
+              <swiper-slide
+                v-for="(item, index) in bannerList"
+                v-bind:key="index"
+                @click.native="swiperJump(item)"
+              >
+                <img
+                  :src="$tools.splitImgHost(item.adverUrl, true, 1272)"
+                  alt=""
+                />
               </swiper-slide>
 
               <div class="swiper-pagination" slot="pagination"></div>
@@ -150,17 +224,32 @@
                 <el-form :model="loginForm" ref="loginForm" :rules="loginRules">
                   <div class="input">
                     <el-form-item prop="account">
-                      <el-input autocomplete="new-password" v-model="loginForm.account" @keyup.enter.native="login"
-                        placeholder="请输入手机号或身份证号"></el-input>
+                      <el-input
+                        autocomplete="new-password"
+                        v-model="loginForm.account"
+                        @keyup.enter.native="login"
+                        placeholder="请输入手机号或身份证号"
+                      ></el-input>
                     </el-form-item>
                   </div>
                   <div class="input">
                     <el-form-item prop="pwd">
-                      <el-input autocomplete="new-password" type="password" v-model="loginForm.pwd" placeholder="请输入密码"
-                        @keyup.enter.native="login"></el-input>
+                      <el-input
+                        autocomplete="new-password"
+                        type="password"
+                        v-model="loginForm.pwd"
+                        placeholder="请输入密码"
+                        @keyup.enter.native="login"
+                      ></el-input>
                     </el-form-item>
                   </div>
-                  <el-button type="primary" class="submit" @click="login()" :loading="isLogin">登录</el-button>
+                  <el-button
+                    type="primary"
+                    class="submit"
+                    @click="login()"
+                    :loading="isLogin"
+                    >登录</el-button
+                  >
                   <div class="bottom-text">
                     <a class="text" @click="loginType = 2">手机验证码登录</a>
                     <a class="text" @click="go('/login?state=2')">注册</a>
@@ -174,24 +263,42 @@
               </template>
 
               <template v-if="loginType == 2">
-                <el-form :model="loginSmsForm" ref="loginSmsForm" :rules="loginSmsRules">
+                <el-form
+                  :model="loginSmsForm"
+                  ref="loginSmsForm"
+                  :rules="loginSmsRules"
+                >
                   <div class="input">
                     <el-form-item prop="tel">
-                      <el-input autocomplete="new-password" v-model="loginSmsForm.tel" placeholder="请输入手机号"></el-input>
+                      <el-input
+                        autocomplete="new-password"
+                        v-model="loginSmsForm.tel"
+                        placeholder="请输入手机号"
+                      ></el-input>
                     </el-form-item>
                   </div>
                   <div class="input">
                     <el-form-item prop="code">
-                      <el-input autocomplete="new-password" v-model="loginSmsForm.code" placeholder="请输入验证码">
+                      <el-input
+                        autocomplete="new-password"
+                        v-model="loginSmsForm.code"
+                        placeholder="请输入验证码"
+                      >
                         <span slot="suffix" @click="getLoginSms" class="btn">{{
-                            countDown == 0
-                              ? "获取验证码"
-                              : `${countDown}秒重新获取`
+                          countDown == 0
+                            ? "获取验证码"
+                            : `${countDown}秒重新获取`
                         }}</span>
                       </el-input>
                     </el-form-item>
                   </div>
-                  <el-button type="primary" class="submit" :loading="isloginSms" @click="loginSms()">登录</el-button>
+                  <el-button
+                    type="primary"
+                    class="submit"
+                    :loading="isloginSms"
+                    @click="loginSms()"
+                    >登录</el-button
+                  >
                   <div class="bottom-text">
                     <a class="text" @click="loginType = 1">账号密码登录</a>
                     <a class="text" @click="go('/login?state=2')">注册</a>
@@ -212,15 +319,24 @@
               </div>
 
               <div class="type-list">
-                <div class="type-list__item" @click="go('/person-center/my-course')">
+                <div
+                  class="type-list__item"
+                  @click="go('/person-center/my-course')"
+                >
                   <img src="@/assets/kc.png" alt="" />
                   <div class="text">课程</div>
                 </div>
-                <div class="type-list__item" @click="go('/person-center/my-bank')">
+                <div
+                  class="type-list__item"
+                  @click="go('/person-center/my-bank')"
+                >
                   <img src="@/assets/tk.png" alt="" />
                   <div class="text">题库</div>
                 </div>
-                <div class="type-list__item" @click="go('/person-center/my-order')">
+                <div
+                  class="type-list__item"
+                  @click="go('/person-center/my-order')"
+                >
                   <img src="@/assets/dd.png" alt="" />
                   <div class="text">订单</div>
                 </div>
@@ -232,13 +348,15 @@
                   {{ recordList.goodsName }}
                 </div>
                 <div class="progress">
-                  <span>已学{{
+                  <span
+                    >已学{{
                       toFixed(
                         (recordList.videoCurrentTime /
                           recordList.durationTime) *
-                        100
+                          100
                       )
-                  }}%</span>
+                    }}%</span
+                  >
                   <span>{{ recordList.date }}</span>
                 </div>
               </div>
@@ -254,8 +372,13 @@
           <div class="lefts">
             <div class="title">推荐课程</div>
             <div class="tabs">
-              <div v-for="(item, index) in courseName" :key="index" class="tab"
-                :class="couIndex === index ? 'active' : ''" @click="changeCou(item.recommendId, index)">
+              <div
+                v-for="(item, index) in courseName"
+                :key="index"
+                class="tab"
+                :class="couIndex === index ? 'active' : ''"
+                @click="changeCou(item.recommendId, index)"
+              >
                 {{ item.name }}
               </div>
             </div>
@@ -296,9 +419,7 @@
         </div> -->
 
         <div class="course__body">
-          <p v-if="
-            !goodsList1.length
-          " class="text_align">
+          <p v-if="!goodsList1.length" class="text_align">
             该培训项目无推荐课程
           </p>
           <ul v-else class="list clearfix">
@@ -311,16 +432,20 @@
         </div>
 
         <div class="pagination">
-          <el-pagination @current-change="currentChangeCou" background layout="prev, pager, next"
-            :total="paramList[0].total" :current-page.sync="paramList[0].currentPage"
-            :page-size="paramList[0].pageSize">
+          <el-pagination
+            @current-change="currentChangeCou"
+            background
+            layout="prev, pager, next"
+            :total="paramList[0].total"
+            :current-page.sync="paramList[0].currentPage"
+            :page-size="paramList[0].pageSize"
+          >
           </el-pagination>
         </div>
 
         <!-- <div class="course__footer">
           <div class="btn" @click="go('/course-list')">查看更多</div>
         </div> -->
-
       </div>
     </section>
 
@@ -330,8 +455,13 @@
           <div class="lefts">
             <div class="title">推荐题库</div>
             <div class="tabs">
-              <div v-for="(item, index) in bankName" :key="index" class="tab"
-                :class="bankIndex === index ? 'active' : ''" @click="changebank(item.recommendId, index)">
+              <div
+                v-for="(item, index) in bankName"
+                :key="index"
+                class="tab"
+                :class="bankIndex === index ? 'active' : ''"
+                @click="changebank(item.recommendId, index)"
+              >
                 {{ item.name }}
               </div>
             </div>
@@ -376,11 +506,8 @@
           </ul>
         </div> -->
 
-
         <div class="bank__body">
-          <p v-if="
-            !goodsList2.length
-          " class="text_align">
+          <p v-if="!goodsList2.length" class="text_align">
             该培训项目无推荐题库
           </p>
           <ul v-else class="list clearfix">
@@ -394,27 +521,56 @@
         </div>
 
         <div class="pagination">
-          <el-pagination @current-change="currentChangeBank" background layout="prev, pager, next"
-            :total="paramList[1].total" :current-page.sync="paramList[1].currentPage"
-            :page-size="paramList[1].pageSize">
+          <el-pagination
+            @current-change="currentChangeBank"
+            background
+            layout="prev, pager, next"
+            :total="paramList[1].total"
+            :current-page.sync="paramList[1].currentPage"
+            :page-size="paramList[1].pageSize"
+          >
           </el-pagination>
         </div>
-
       </div>
     </section>
 
-    <el-dialog :visible.sync="bindShow" width="348px" center :close-on-click-modal="false"
-      :close-on-press-escape="false" class="bind">
+    <el-dialog
+      :visible.sync="bindShow"
+      width="348px"
+      center
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      class="bind"
+    >
       <a class="bind__close" @click="bindNext">X</a>
       <div class="bind__header">关联学员身份</div>
       <div class="bind__body">
-        <el-form class="bind-form" ref="bindForm" :model="bindForm" :rules="bindForm">
-          <el-form-item prop="realname"><el-input placeholder="真实姓名" v-model="bindForm.realname">
-            </el-input></el-form-item>
+        <el-form
+          class="bind-form"
+          ref="bindForm"
+          :model="bindForm"
+          :rules="bindForm"
+        >
+          <el-form-item prop="realname"
+            ><el-input placeholder="真实姓名" v-model="bindForm.realname">
+            </el-input
+          ></el-form-item>
           <el-form-item prop="idCard">
-            <el-input placeholder="身份证号码" v-model="bindForm.idCard" maxlength="18">
-            </el-input></el-form-item>
-          <el-button class="submit" type="primary" :loading="isBind" round @click="bind()">确定</el-button>
+            <el-input
+              placeholder="身份证号码"
+              v-model="bindForm.idCard"
+              maxlength="18"
+            >
+            </el-input
+          ></el-form-item>
+          <el-button
+            class="submit"
+            type="primary"
+            :loading="isBind"
+            round
+            @click="bind()"
+            >确定</el-button
+          >
           <div class="bind-next" @click="bindNext">下次再关联</div>
         </el-form>
       </div>
@@ -424,7 +580,10 @@
     <Footer></Footer>
     <wx-login ref="wxLogin" @wxLoginBack="wxLoginBack"></wx-login>
 
-    <RebuildModal ref="rebuildModal" @rebuildSubmit="rebuildSubmit($event)"></RebuildModal>
+    <RebuildModal
+      ref="rebuildModal"
+      @rebuildSubmit="rebuildSubmit($event)"
+    ></RebuildModal>
   </div>
 </template>
 
@@ -547,7 +706,7 @@ export default {
           pageNum: 1,
           pageSize: 15,
           total: 0,
-        }
+        },
       ],
       total1: 0,
       total2: 0,
@@ -555,14 +714,14 @@ export default {
       bankName: [],
       couIndex: 0,
       bankIndex: 0,
-      courseId: '',
-      bankId: '',
+      courseId: "",
+      bankId: "",
     };
   },
   created() {
-    this.goodsList1 = []
-    this.goodsList2 = []
-    this.courseLists()
+    this.goodsList1 = [];
+    this.goodsList2 = [];
+    this.courseLists();
   },
   mounted() {
     if (this.userInfo) {
@@ -587,91 +746,103 @@ export default {
   methods: {
     //课程
     courseLists() {
-      this.$request.appCommonActivityRecommendList({ platform: 2, status: 1 }).then(async (res) => {
-        if (res.code == 200) {
-          let list = res.rows || []
-          //课程
-          this.courseName = list.filter(x => x.type == 1).sort((a, b) => a.sort - b.sort).map(x => {
-            return {
-              name: x.name,
-              recommendId: x.recommendId
-            }
-          });
-          console.log('couIndex', this.couIndex, this.courseName)
-          //题库
-          this.bankName = list.filter(x => x.type == 2).sort((a, b) => a.sort - b.sort).map(x => {
-            return {
-              name: x.name,
-              recommendId: x.recommendId
+      this.$request
+        .appCommonActivityRecommendList({ platform: 2, status: 1 })
+        .then(async (res) => {
+          if (res.code == 200) {
+            let list = res.rows || [];
+            //课程
+            this.courseName = list
+              .filter((x) => x.type == 1)
+              .sort((a, b) => a.sort - b.sort)
+              .map((x) => {
+                return {
+                  name: x.name,
+                  recommendId: x.recommendId,
+                };
+              });
+            console.log("couIndex", this.couIndex, this.courseName);
+            //题库
+            this.bankName = list
+              .filter((x) => x.type == 2)
+              .sort((a, b) => a.sort - b.sort)
+              .map((x) => {
+                return {
+                  name: x.name,
+                  recommendId: x.recommendId,
+                };
+              });
+            if (this.courseName.length) {
+              this.courseId = this.courseName[0].recommendId;
+              let list1 = await this.getGoodsList(
+                this.courseName[0].recommendId,
+                0
+              );
+              console.log(list1, "list1");
+              this.goodsList1.push(...list1);
             }
-          });
-          if (this.courseName.length) {
-            this.courseId = this.courseName[0].recommendId
-            let list1 = await this.getGoodsList(this.courseName[0].recommendId, 0)
-            console.log(list1, 'list1')
-            this.goodsList1.push(...list1)
-          }
 
-          if (this.bankName.length) {
-            this.bankId = this.bankName[0].recommendId
-            let list2 = await this.getGoodsList(this.bankName[0].recommendId, 1)
-            this.goodsList2.push(...list2)
+            if (this.bankName.length) {
+              this.bankId = this.bankName[0].recommendId;
+              let list2 = await this.getGoodsList(
+                this.bankName[0].recommendId,
+                1
+              );
+              this.goodsList2.push(...list2);
+            }
           }
-
-        }
-      });
+        });
     },
     getGoodsList(recommendId, num) {
       return new Promise((resolve, reject) => {
         this.$axios({
           url: `/app/common/activity/recommend/goodsList`,
-          method: 'get',
+          method: "get",
           params: {
             pageNum: this.paramList[num].pageNum,
             pageSize: this.paramList[num].pageSize,
-            recommendId: recommendId
+            recommendId: recommendId,
           },
-          noToken: true
+          noToken: true,
         }).then((res) => {
           if (res.code == 200) {
-            this.paramList[num].total = res.total
-            resolve(res.rows)
+            this.paramList[num].total = res.total;
+            resolve(res.rows);
           }
-        })
-      })
-
+        });
+      });
     },
     async currentChangeCou(val) {
-      console.log('vallll', val)
-      this.paramList[0].pageNum = val
-      this.goodsList1 = []
-      let list1 = await this.getGoodsList(this.courseId, 0)
-      this.goodsList1.push(...list1)
+      console.log("vallll", val);
+      this.paramList[0].pageNum = val;
+      this.goodsList1 = [];
+      let list1 = await this.getGoodsList(this.courseId, 0);
+      this.goodsList1.push(...list1);
     },
     async changeCou(recommendId, index) {
-      this.couIndex = index
-      this.courseId = recommendId
-      this.paramList[0].pageNum = 1
-      this.paramList[0].currentPage = 1
-      this.goodsList1 = []
-      let list1 = await this.getGoodsList(recommendId, 0)
-      this.goodsList1.push(...list1)
+      this.couIndex = index;
+      this.courseId = recommendId;
+      this.paramList[0].pageNum = 1;
+      this.paramList[0].currentPage = 1;
+      this.goodsList1 = [];
+      let list1 = await this.getGoodsList(recommendId, 0);
+      this.goodsList1.push(...list1);
     },
     async currentChangeBank(val) {
-      console.log('val--', val)
-      this.paramList[1].pageNum = val
-      this.goodsList2 = []
-      let list2 = await this.getGoodsList(this.bankId, 1)
-      this.goodsList2.push(...list2)
+      console.log("val--", val);
+      this.paramList[1].pageNum = val;
+      this.goodsList2 = [];
+      let list2 = await this.getGoodsList(this.bankId, 1);
+      this.goodsList2.push(...list2);
     },
     async changebank(recommendId, index) {
-      this.bankIndex = index
-      this.bankId = recommendId
-      this.paramList[1].pageNum = 1
-      this.paramList[1].currentPage = 1
-      this.goodsList2 = []
-      let list2 = await this.getGoodsList(recommendId, 1)
-      this.goodsList2.push(...list2)
+      this.bankIndex = index;
+      this.bankId = recommendId;
+      this.paramList[1].pageNum = 1;
+      this.paramList[1].currentPage = 1;
+      this.goodsList2 = [];
+      let list2 = await this.getGoodsList(recommendId, 1);
+      this.goodsList2.push(...list2);
     },
     /**
      * 关闭消息
@@ -773,7 +944,7 @@ export default {
                   .then((_) => {
                     window.open("http://admin.zhujianpeixun.com/", "_blank");
                   })
-                  .catch((_) => { });
+                  .catch((_) => {});
 
                 return;
               } else {
@@ -940,7 +1111,6 @@ export default {
       localStorage.setItem("user_account", res.data.user_account);
       localStorage.setItem("token", res.data.token);
       if (res.data.full_info) {
-
         this.getInfo();
       } else {
         this.indexUserAccount = res.data.user_account;
@@ -958,10 +1128,21 @@ export default {
           courseId: this.recordList.courseId,
         });
       } else if (this.recordList.goodsType == 1) {
-        this.go("/my-course-detail/" + this.recordList.goodsId, {
-          gradeId: this.recordList.gradeId,
-          orderGoodsId: this.recordList.orderGoodsId,
-          courseId: this.recordList.courseId,
+        this.$router.push({
+          path: `/my-course-detail/${this.recordList.goodsId}`,
+          query: {
+            gradeId: this.recordList.gradeId,
+            orderGoodsId: this.recordList.orderGoodsId,
+            courseId: this.recordList.courseId,
+            chapterId: this.recordList.chapterId,
+            moduleId: this.recordList.moduleId,
+            sectionId: this.recordList.sectionId,
+            recordingUrl: this.recordList.recordingUrl,
+            liveUrl: this.recordList.liveUrl,
+            sectionType: this.recordList.sectionType,
+            liveStartTime: this.recordList.liveStartTime,
+            liveEndTime: this.recordList.liveEndTime,
+          },
         });
       }
     },
@@ -994,9 +1175,9 @@ export default {
         case "4":
           this.$tools.exit();
           break;
-        case '5':
-          console.log('------command:', command)
-          break
+        case "5":
+          console.log("------command:", command);
+          break;
         default:
           break;
       }
@@ -1094,7 +1275,7 @@ export default {
       this.$request
         .businessList({ educationId })
         .then((res) => {
-          let rows = res.rows.filter((item) => item.aliasName)
+          let rows = res.rows.filter((item) => item.aliasName);
           this.$set(this.slideList, index, rows);
           if (rows.length >= 2) {
             let newRows = rows.slice(0, 2);
@@ -1112,7 +1293,7 @@ export default {
           } else {
             this.$set(this.typeList[index], "list", rows);
           }
-          console.log('this.typeList:', this.slideList, this.typeList)
+          console.log("this.typeList:", this.slideList, this.typeList);
         })
         .catch((err) => {
           console.log(err, "err");
@@ -1165,15 +1346,15 @@ export default {
         });
     },
     goCourse(item) {
-      console.log('sdsf', item)
+      console.log("sdsf", item);
       if (item.topicId) {
         this.$router.push({
           path: "/goodsTopic",
           query: {
             topicId: item.topicId,
           },
-        })
-        return
+        });
+        return;
       }
 
       this.$router.push({
@@ -1316,7 +1497,6 @@ export default {
               localStorage.setItem("token", res.data.token);
               this.$tools.setUuid(new Date().valueOf() + "");
               if (res.data.full_info) {
-
                 this.getInfo();
               } else {
                 this.indexUserAccount = res.data.user_account;
@@ -1962,7 +2142,7 @@ export default {
       align-items: center;
       justify-content: space-between;
       padding-bottom: 15px;
-      border-bottom: 1px solid #DCDCDC;
+      border-bottom: 1px solid #dcdcdc;
 
       .lefts {
         display: flex;
@@ -1977,8 +2157,6 @@ export default {
         color: #333333;
         text-shadow: 0px 6px 6px rgba(249, 113, 13, 0.08);
       }
-
-
     }
 
     .tabs {
@@ -2022,10 +2200,10 @@ export default {
         width: 72px;
         height: 28px;
         line-height: 28px;
-        background: #D5E4FF;
+        background: #d5e4ff;
         border-radius: 4px;
         // margin: 20px auto 40px;
-        color: #3F8DFD;
+        color: #3f8dfd;
         text-align: center;
         transition: all 0.2s;
 
@@ -2047,7 +2225,7 @@ export default {
       align-items: center;
       justify-content: space-between;
       padding-bottom: 15px;
-      border-bottom: 1px solid #DCDCDC;
+      border-bottom: 1px solid #dcdcdc;
 
       .lefts {
         display: flex;
@@ -2062,8 +2240,6 @@ export default {
         color: #333333;
         text-shadow: 0px 6px 6px rgba(249, 113, 13, 0.08);
       }
-
-
     }
 
     .tabs {
@@ -2107,10 +2283,10 @@ export default {
         width: 72px;
         height: 28px;
         line-height: 28px;
-        background: #D5E4FF;
+        background: #d5e4ff;
         border-radius: 4px;
         // margin: 20px auto 40px;
-        color: #3F8DFD;
+        color: #3f8dfd;
         text-align: center;
         transition: all 0.2s;
 

+ 15 - 3
src/pages/person-center/my-course/index.vue

@@ -13,7 +13,7 @@
           style="margin-left: 14px"
           @click="changeCourse"
           >切换科目</el-button
-        >
+        ><el-button v-if="outerChain()" @click="jumpExternalLink" size="mini" type="primary">进入外链</el-button>
 
         <el-button
           v-if="
@@ -38,13 +38,13 @@
           @click="changeTest()"
           >预约考试
         </el-button>
-        <div class="note">
+        <div class="note" v-if="!outerChain()">
           {{ goodsData.courseNum }}课程
           {{ goodsData.secAllNum + goodsData.examNum }}节
           {{ goodsData.classHours }}学时
         </div>
       </h4>
-      <div style="margin: 14px 0px">
+      <div style="margin: 14px 0px"  v-if="!outerChain()">
         <el-button
           size="small"
           v-for="(item, index) in subjectList"
@@ -57,6 +57,7 @@
       <div
         v-for="(courseItem, teacherIndex) in goodsTeacher"
         :key="teacherIndex"
+        v-show="!outerChain()"
       >
         <div
           v-for="(item, index) in courseItem.courseList"
@@ -814,6 +815,13 @@ export default {
     this.sysTime = this.$tools.timest();
   },
   methods: {
+    //判断是否外链
+    outerChain(){
+      if(this.goodsData.externalLink){
+        return true
+      }
+      return false
+    },
     comeStyle(courseItem, item) {
       this.$router.push({
         path: `/my-course-detail/${this.goodsData.goodsId}`,
@@ -959,6 +967,10 @@ export default {
           });
       });
     },
+    //进入外链
+    jumpExternalLink(){
+      window.open(this.goodsData.externalLink, "_blank");
+    },
     //切换老师
     switchTeacher(data, index, teacherIndex) {
       console.log(data, "data", index, teacherIndex);