Rorschach 3 роки тому
батько
коміт
56dfa15deb
3 змінених файлів з 13 додано та 7 видалено
  1. 5 2
      pages/index/index.js
  2. 3 2
      pages/myworks/myworks.js
  3. 5 3
      pages/reading/reading.js

+ 5 - 2
pages/index/index.js

@@ -808,10 +808,11 @@ Page({
   },
   onShareAppMessage: function (res) {
     console.log('onShareAppMessage>>>>>>>>>>>>')
+    console.log('this.data', this.data)
     if (res.from === 'button') {
       return {
         title: '请欣赏我的课文朗读作品,点赞+评论。',
-        path: `/pages/index/index?readId=${this.data.shareId}`,
+        path: `/pages/index/index?readId=${this.data.shareId}&activity=${this.data.ifTapActivity}`,
         imageUrl: this.data.shareImg
       }
     } else {
@@ -822,11 +823,13 @@ Page({
     }
   },
   openShare: function (e) {
+    console.log('点击分享', e)
     this.setData({
       shareTitle: e.detail.currentTarget.dataset.title,
       shareId: e.detail.currentTarget.dataset.id,
       shareImg: e.detail.currentTarget.dataset.shareimg,
-      goToShare: true
+      goToShare: true,
+      ifTapActivity: e.detail.currentTarget.dataset.activity
     })
   },
   // 修改年级

+ 3 - 2
pages/myworks/myworks.js

@@ -256,7 +256,8 @@ Page({
     this.setData({
       shareTitle: e.detail.currentTarget.dataset.title,
       shareId: e.detail.currentTarget.dataset.id,
-      shareImg: e.detail.currentTarget.dataset.shareimg
+      shareImg: e.detail.currentTarget.dataset.shareimg,
+      ifTapActivity: e.detail.currentTarget.dataset.activity
     })
   },
   /**
@@ -270,7 +271,7 @@ Page({
     if (res.from === 'button') {
       return {
         title: '请欣赏我的课文朗读作品,点赞+评论。',
-        path: `/pages/index/index?readId=${this.data.shareId}`,
+        path: `/pages/index/index?readId=${this.data.shareId}&activity=${this.data.ifTapActivity}`,
         imageUrl: this.data.shareImg
 
       }

+ 5 - 3
pages/reading/reading.js

@@ -674,6 +674,7 @@ Page({
                 temp.grade = item.userRead.grade;
                 temp.type = item.userRead.type;
                 temp.shareImg = item.userRead.shareImg;
+                item.isActivity && (temp.activity = true);
                 // recommendWorks.push(temp);
                 // that.data.hotData.hotWorks.push(temp);
                 this.data.videoList.push(temp);
@@ -750,7 +751,7 @@ Page({
         if (res.from === 'button') {
             return {
                 title: '请欣赏我的课文朗读作品,点赞+评论。',
-                path: `/pages/index/index?readId=${this.data.shareId}`,
+                path: `/pages/index/index?readId=${this.data.shareId}&activity=${this.data.ifTapActivity}`,
                 imageUrl: this.data.shareImg
 
             }
@@ -770,7 +771,8 @@ Page({
         this.setData({
             shareTitle: e.detail.currentTarget.dataset.title,
             shareId: e.detail.currentTarget.dataset.id,
-            shareImg: e.detail.currentTarget.dataset.shareimg
+            shareImg: e.detail.currentTarget.dataset.shareimg,
+            ifTapActivity: e.detail.currentTarget.dataset.activity
         })
     },
     onPlay: function (e) {
@@ -829,4 +831,4 @@ Page({
             [str]: this.data.videoList[e.detail.index].shareAmount + 1
         })
     }
-})
+})