liyongli 1 tahun lalu
induk
melakukan
70d680b22e

+ 5 - 3
cloudfunctions/server/service/media/index.js

@@ -5,7 +5,7 @@ const {
 async function MediaService(data) {
   const list = [];
   const skip = (data.skip || 0) * (data.limit || 100);
-  console.log('---------------',data)
+  console.log('---------------', data)
   const orilist = await db.collection('AudioAndVideo').where({
     type: _.eq(data.typeMedia),
     activity_name: _.eq(data.activityName)
@@ -59,7 +59,8 @@ async function MediaOnceService(data) {
         url: v.url,
         title: v.title,
         cover: v.cover,
-        id: v._id
+        id: v._id,
+        type: v.type
       })
     } else {
       // push
@@ -72,7 +73,8 @@ async function MediaOnceService(data) {
           url: v.url,
           title: v.title,
           cover: v.cover,
-          id: v._id
+          id: v._id,
+          type: v.type
         }]
       })
     }

+ 3 - 2
miniprogram/components/dayList/index.js

@@ -25,7 +25,8 @@ Component({
           }
         }
       }
-    }
+    },
+    activityName: String
   },
   /**
    * 组件的初始数据
@@ -48,7 +49,7 @@ Component({
         return
       }
       wx.navigateTo({
-        url: "/pages/videoDetail/index?id=" + item.id + '&group=' + row.location + '&type=' + item.type
+        url: "/pages/videoDetail/index?id=" + item.id + '&group=' + row.location + '&type=' + item.type + '&activityName=' + this.data.activityName
       })
     }
   }

+ 1 - 0
miniprogram/pages/live/live.js

@@ -24,6 +24,7 @@ Page({
         id: _this.id
       },
       call(res) {
+        console.log(res)
         const obj = res || {};
         _this.setData({
           liveData: obj

+ 5 - 3
miniprogram/pages/mediaController/index.js

@@ -13,11 +13,11 @@ Page({
    */
   data: {
     mediaList: [],
+    activityName: '',
   },
   nameText: "",
   page: 0,
   limit: 100,
-  activityName: '',
 
   getDate() {
     const _this = this;
@@ -28,7 +28,7 @@ Page({
         typeMedia: this.mediaType,
         page: this.page,
         limit: this.limit,
-        activityName: this.activityName
+        activityName: this.data.activityName
       },
       call(res) {
         if (!res.length) {
@@ -55,7 +55,9 @@ Page({
   onLoad(options) {
     this.nameText = decodeURIComponent(options.title || "详情");
     this.mediaType = options.mediaType || 'image';
-    this.activityName = options.activity;
+    this.setData({
+      activityName: options.activity,
+    })
     wx.setNavigationBarTitle({
       title: this.nameText
     })

+ 1 - 1
miniprogram/pages/mediaController/index.wxml

@@ -1,2 +1,2 @@
 <!--pages/imgController/index.wxml-->
-<day-list mediaList="{{mediaList}}" wx:if="{{mediaList && mediaList.length}}"></day-list>
+<day-list activityName="{{activityName}}" mediaList="{{mediaList}}" wx:if="{{activityName && mediaList && mediaList.length}}"></day-list>

+ 6 - 2
miniprogram/pages/videoDetail/index.js

@@ -14,11 +14,13 @@ Page({
     videoWidth: 0,
     videoHeight: 0,
   },
+  activityName: "",
 
   toNext(e) {
     const item = this.data.media.child[e.currentTarget.dataset.index];
+    console.log(item);
     wx.redirectTo({
-      url: "/pages/videoDetail/index?id=" + item.id + '&group=' + this.data.media.location
+      url: "/pages/videoDetail/index?id=" + item.id + '&group=' + this.data.media.location + '&type=' + item.type + '&activityName=' + this.activityName
     })
   },
 
@@ -38,13 +40,15 @@ Page({
    */
   onLoad(options) {
     const _this = this;
+    this.activityName = options.activityName;
     httpCloud({
       name: "server",
       type: "getMediaOnceController",
       data: {
         typeMedia: options.type,
         id: options.id,
-        group: options.group
+        group: options.group,
+        activityName: options.activityName
       },
       call(res) {
         const ori = res[0] || {