DESKTOP-SVI9JE1\muzen 1 gadu atpakaļ
vecāks
revīzija
c6c2a58876
1 mainītis faili ar 18 papildinājumiem un 14 dzēšanām
  1. 18 14
      src/pages/content/index.vue

+ 18 - 14
src/pages/content/index.vue

@@ -51,27 +51,31 @@ export default {
     }
   },
   onLoad(e) {
-    if (e.articleId) {
-      this.getDetail(e.articleId)
+    if (e.id) {
+      this.getDetail(e.id)
     }
   },
   methods: {
-    getDetail(articleId) {
+    getDetail(id) {
       detail({
-        articleId: articleId
+        articleId: id
       }).then(res => {
         if (res.data.code === 0) {
-          // 按sort从小到大排序
-          res.data.data.contentShareLayoutList.sort(function (x, y) {
-            return x.sort > y.sort ? 1 : -1
-          })
-          // 给单音频添加播放状态
-          res.data.data.contentShareLayoutList.map(i => {
-            if ([2, 6, 11].includes(i.contentType)) {
-              i.playStatus = 2
-            }
-          })
+          if (res.data.data.templateType == 1) {
+            // 按sort从小到大排序
+            res.data.data.contentShareLayoutList.sort(function (x, y) {
+              return x.sort > y.sort ? 1 : -1
+            })
+            // 给单音频添加播放状态
+            res.data.data.contentShareLayoutList.map(i => {
+              if ([2, 6, 11].includes(i.contentType)) {
+                i.playStatus = 2
+              }
+            })
+          }
+
           this.form = res.data.data
+          
           // 检测当前是否有正在播放的音频
           if (this.inside) {
             this.getStatus()