Browse Source

Merge branch 'main' of http://git.mokasz.com/maomao/mini_read_space_front

qiansailong 1 year ago
parent
commit
d53ae1c24a
2 changed files with 14 additions and 2 deletions
  1. 5 0
      .idea/.gitignore
  2. 9 2
      pages/video/detail.js

+ 5 - 0
.idea/.gitignore

@@ -0,0 +1,5 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/

+ 9 - 2
pages/video/detail.js

@@ -22,13 +22,17 @@ Page({
         currentTime: 0, // 当前播放时间
         relatedVideos: [],
         tagId: 0,
-        share_count: 1
+        share_count: 1,
+        scene: 0, // 场景值
     },
 
     onLoad: function (options) {
         const videoId = parseInt(options.id);
         const videoTitle = options.title ? decodeURIComponent(options.title) : '';
         const tagId = parseInt(options.tag_id);
+        this.setData({
+            scene: wx.getStorageSync('scene') || 1001
+        })
 
         console.log('加载视频详情页,ID:', videoId, '标题:', videoTitle);
 
@@ -58,11 +62,14 @@ Page({
         const pages = getCurrentPages();
         const currentPage = pages[pages.length - 1];
         const options = currentPage.options;
+        console.log('scene', this.data.scene)
         if (+options.share_count === 1 && this.data.share_count === 1) {
             this.setData({
                 share_count: 2
             })
-            this.goToBookDetail()
+            if(this.data.scene === 1007 || this.data.scene === 1008){
+                this.goToBookDetail()
+            }
         } else if (+options.share_count === 1 && this.data.share_count === 2) {
             this.setData({
                 share_count: 3