Parcourir la source

视频详情页相关事件处理;

huan-jie il y a 4 ans
Parent
commit
b64d87e8d3

+ 20 - 1
assets/css/learn/detail/_id.scss

@@ -19,7 +19,25 @@
         .video-wrapper {
             width: 100%;
             height: 563px;
-            background: rgba(0,0,0,0.4);
+            .cover-wrapper {
+                position: relative;
+                width: 100%;
+                height: 100%;
+                .cover {
+                    width: 100%;
+                    height: 100%;
+                    object-fit: cover;
+                }
+                .play-icon {
+                    position: absolute;
+                    z-index: 21;
+                    top: calc(50% - 39px);
+                    left: calc(50% - 39px);
+                    width: 78px;
+                    height: 78px;
+                    cursor: pointer;
+                }
+            }
         }
         .learn-detail-content {
             width: 100%;
@@ -144,6 +162,7 @@
                 display: flex;
                 align-items: center;
                 justify-content: space-between;
+                cursor: pointer;
                 .course-title {
                     flex: 1;
                     font-size: 20px;

+ 18 - 3
components/learn/dealSeoDetail.js

@@ -5,7 +5,7 @@ export default class DealSeoData {
         this.app = app
         this.redirect = redirect
         this.error = error
-        this.skillDetail = {}
+        this.learnDetail = {}
         this.isExist = true
     }
 
@@ -24,18 +24,33 @@ export default class DealSeoData {
             this.redirect(301, '/l/' + sale_id)
         }
 
-        const skillDetail = {}
+        const learnDetail = await this._getLearnDetail(sale_id)
 
         return {
             isExist: this.isExist,
             sale_id,
-            skillDetail,
+            learnDetail,
             mobile: this.app.$deviceType.isMobile(),
             head: this.dealThisMeta(),
             act
         }
     }
 
+    /** 获取课程详情 */
+    async _getLearnDetail (sale_id) {
+        let res = await this.$axios.$post('https://dev.test.proginn.com/api/sale/videoDetail', { sale_id })
+        let learnDetail = {}
+
+        console.log(res)
+        if (Number(res.status) === 1) {
+            learnDetail = res.data
+        } else if (Number(res.status) === 40001) {
+            this.isExist = false
+        }
+
+        return learnDetail
+    }
+
     dealThisMeta() {
         if (!this.isExist) {
             // 页面不存在时

Fichier diff supprimé car celui-ci est trop grand
+ 119 - 23
pages/frontend/learn/detail/_id.vue