Explorar el Código

Merge branch 'apDev1' into dev

ccf hace 4 años
padre
commit
014588919f
Se han modificado 2 ficheros con 26 adiciones y 9 borrados
  1. 6 3
      assets/css/learn/detail/_id.scss
  2. 20 6
      pages/frontend/learn/detail/_id.vue

+ 6 - 3
assets/css/learn/detail/_id.scss

@@ -521,10 +521,11 @@
 
 }
 .learn-detail-wrapper-mobile {
+  border:1px solid red;
     position: relative;
     width: 100%;
-    padding-bottom: calc(56px + 8px + constant(safe-area-inset-bottom));
-    padding-bottom: calc(56px + 8px + env(safe-area-inset-bottom));
+    padding-bottom: calc(1.4rem + 0.16rem + constant(safe-area-inset-bottom));
+    padding-bottom: calc(1.4rem + 0.16rem + env(safe-area-inset-bottom));
     display: flex;
     flex-direction: column;
     .video-container {
@@ -820,10 +821,12 @@
       bottom: 0;
       left: 0;
       right: 0;
-      height: 1.4rem;
+      // height: 1.4rem;
       box-shadow: 0px -0.5px 0px 0px #e6e6e6 inset;
       background: #fff;
       display: flex;
+      height: calc(1.4rem + constant(safe-area-inset-bottom));
+      height: calc(1.4rem + env(safe-area-inset-bottom));
       .btn-study {
         display: flex;
         align-self: center;

+ 20 - 6
pages/frontend/learn/detail/_id.vue

@@ -227,7 +227,7 @@
                   </div>
                 </div>
               </div>
-              <div class="lecturer">
+              <div class="lecturer" @click="goUserPage">
                 <div class="picture">
                   <img :src="defaultImg" v-real-img="learnDetail.teacher.img" :alt="learnDetail.teacher.name">
                   <span>讲师</span>
@@ -252,9 +252,9 @@
             <!-- 目录 -->
             <div class="directory" v-show="tabActive==1">
               <van-collapse v-model="activeNames" v-if="learnDetail.video && learnDetail.video.length>0">
-                <van-collapse-item :title="`第${index+1}章: ${catalogItem.video_name}`" :name="index+1" v-for="(catalogItem, index) in learnDetail.video" :key="index">
+                <van-collapse-item :title="`第${index+1}章: ${catalogItem.video_name}`" :name="index" v-for="(catalogItem, index) in learnDetail.video" :key="index">
                   <template v-if="catalogItem.list && catalogItem.list.length>0">
-                    <div class="item" v-for="(item, i) in  catalogItem.list" :key="item.id" @click="handleClickLearnItem(item.id)">
+                    <div class="item" v-for="item in  catalogItem.list" :key="item.id" @click="handleClickLearnItem(item.id)">
                       <div class="title">
                         <span class="text">{{ item.video_name }}</span>
                         <span class="timer">{{ item.m<10 ? '0'+item.m : item.m }}:{{ item.s<10 ? '0'+item.s : item.s }}</span>
@@ -332,7 +332,7 @@ export default {
             collapseName: 1,
             tabActive: 0,
             defaultImg: require('@/assets/img/common/empty@2x.png'),
-            activeNames: ['1'],
+            activeNames: [0],
             questionName: [],
             isInitPlayer: false, // 是否已初始化播放器
             player: null // 播放器对象
@@ -404,11 +404,18 @@ export default {
         }
     },
     mounted () {
-      // console.log('打印异步数据看看',this)
+      console.log('打印异步数据看看========>',this)
       this.baseUrl = this.$store.state.domainConfig.siteUrl
       this.isWeixinApp = navigator.userAgent.indexOf("miniProgram") > -1
     },
     methods: {
+      goUserPage(){
+        if(this.userinfo && this.userinfo.uid){
+          window.location.href = `/wo/${this.userinfo.uid}`
+        }else{
+          window.location.href = 'proginn://login'
+        }
+      },
       /**
        * 初始化播放器
        */
@@ -549,7 +556,14 @@ export default {
        */
       handleClickPlayIcon(){
         // 不管购买与否,都播放第一个
-        this._getVideoPlayAuth(this.learnDetail.video[0].list[0].id || '')
+        if (!this.userinfo || !this.userinfo.nickname) {
+          // 未登录时 => 去登录
+          if (this.deviceType.ios || this.deviceType.android) {
+            window.location.href = "proginn://login?backToPage=true";
+          }
+        }else{
+          this._getVideoPlayAuth(this.learnDetail.video[0].list[0].id || '')
+        }
       },
       /**
        * 点击目录的每一集: