2 İşlemeler 03389fc25e ... 126e900215

Yazar SHA1 Mesaj Tarih
  Limengbo 126e900215 增加活动 3 yıl önce
  Limengbo dd9dfbe3fe 新增活动页面 3 yıl önce
79 değiştirilmiş dosya ile 2705 ekleme ve 564 silme
  1. BIN
      .DS_Store
  2. 5 3
      app.json
  3. 175 0
      component/comment/comment.css
  4. 43 5
      component/comment/comment.js
  5. 3 1
      component/comment/comment.json
  6. 1 0
      component/comment/comment.less
  7. 3 2
      component/comment/comment.wxml
  8. 1 1
      component/flowerBox/flowerBox.js
  9. 2 1
      component/flowerBox/flowerBox.wxss
  10. 1 1
      component/my/my.js
  11. 152 104
      component/share/share.js
  12. 3 1
      component/share/share.json
  13. 22 16
      component/share/share.wxml
  14. 79 41
      component/share/share.wxss
  15. 243 0
      component/video-swiper/index.css
  16. 135 58
      component/video-swiper/index.js
  17. 2 1
      component/video-swiper/index.json
  18. 81 3
      component/video-swiper/index.less
  19. 117 149
      component/video-swiper/index.wxml
  20. 79 10
      component/video-swiper/index.wxss
  21. 432 0
      pages/activity/index/index.js
  22. 6 0
      pages/activity/index/index.json
  23. 111 0
      pages/activity/index/index.wxml
  24. 247 0
      pages/activity/index/index.wxss
  25. 78 0
      pages/activity/rule/rule.js
  26. 3 0
      pages/activity/rule/rule.json
  27. 4 0
      pages/activity/rule/rule.wxml
  28. 11 0
      pages/activity/rule/rule.wxss
  29. 78 0
      pages/activity/strategy/strategy.js
  30. 3 0
      pages/activity/strategy/strategy.json
  31. 9 0
      pages/activity/strategy/strategy.wxml
  32. 23 0
      pages/activity/strategy/strategy.wxss
  33. 128 39
      pages/index/index.js
  34. 3 2
      pages/index/index.json
  35. 30 15
      pages/index/index.wxml
  36. 17 8
      pages/index/index.wxss
  37. 34 13
      pages/mycollection/mycollection.js
  38. 1 1
      pages/mycollection/mycollection.wxml
  39. 35 13
      pages/myworks/myworks.js
  40. 1 1
      pages/myworks/myworks.wxml
  41. 85 21
      pages/reading/reading.js
  42. 3 1
      pages/reading/reading.json
  43. 7 7
      pages/reading/reading.wxml
  44. 2 2
      pages/social/littleFlower/littleFlower.wxml
  45. 2 1
      pages/social/replyDetail/replyDetail.js
  46. 17 8
      project.config.json
  47. BIN
      static/.DS_Store
  48. BIN
      static/activity/.DS_Store
  49. BIN
      static/activity/1.png
  50. BIN
      static/activity/2.png
  51. BIN
      static/activity/3.png
  52. BIN
      static/activity/activity_bg.jpg
  53. BIN
      static/activity/comment.png
  54. BIN
      static/activity/comment1.png
  55. BIN
      static/activity/follow.png
  56. BIN
      static/activity/forward.png
  57. BIN
      static/activity/forward1.png
  58. BIN
      static/activity/left.png
  59. BIN
      static/activity/like.png
  60. BIN
      static/activity/like1.png
  61. BIN
      static/activity/popularity.png
  62. BIN
      static/activity/popularity1.png
  63. BIN
      static/activity/right.png
  64. BIN
      static/activity/rule-img.png
  65. BIN
      static/activity/strategy-img.png
  66. BIN
      static/activity/tab-bg.png
  67. BIN
      static/image/wx_firend.png
  68. BIN
      static/image/wx_icon.png
  69. BIN
      static/index/res_comment.png
  70. BIN
      static/index/res_eye.png
  71. BIN
      static/index/res_like.png
  72. BIN
      static/index/res_share.png
  73. BIN
      static/index/res_star.png
  74. 52 8
      templates/courses/courses.less
  75. 26 10
      templates/courses/courses.wxml
  76. 51 7
      templates/courses/courses.wxss
  77. 54 5
      utils/APIClient.js
  78. 3 3
      utils/const.js
  79. 2 2
      utils/httpUtilNoLogin.js

BIN
.DS_Store


+ 5 - 3
app.json

@@ -23,14 +23,16 @@
     "pages/vipPage/vip/vip",
     "pages/vipPage/vipCode/vipCode",
     "pages/vipPage/wechat/wechat",
-    "pages/grade/grade"
+    "pages/grade/grade",
+    "pages/activity/index/index",
+    "pages/activity/rule/rule",
+    "pages/activity/strategy/strategy"
   ],
   "window": {
     "backgroundTextStyle": "light",
     "navigationBarBackgroundColor": "#12C962",
     "navigationBarTitleText": "小学语文朗读配音",
     "navigationBarTextStyle": "white",
-    "backgroundColor": "#12C962",
     "onReachBottomDistance": 50,
     "enablePullDownRefresh": true
   },
@@ -42,4 +44,4 @@
       "provider": "wx7279a29ef86a3002"
     }
   }
-}
+}

+ 175 - 0
component/comment/comment.css

@@ -0,0 +1,175 @@
+.comment_container {
+  position: fixed;
+  z-index: 9999;
+  bottom: 0;
+  width: 100%;
+  height: 850rpx;
+  background: #ffffff;
+  padding-bottom: 200rpx;
+  box-sizing: border-box;
+}
+.comment_container .comment_number {
+  width: 100%;
+  height: 68rpx;
+  display: flex;
+  align-items: center;
+  padding-left: 20rpx;
+  color: #4a4a4a;
+  font-size: 30rpx;
+}
+.comment_container .comment_item {
+  width: 100%;
+  display: flex;
+  flex-direction: column;
+  padding-left: 20rpx;
+  padding-right: 68rpx;
+  box-sizing: border-box;
+  margin-bottom: 14rpx;
+}
+.comment_container .comment_item .comment_box {
+  width: 100%;
+  display: flex;
+  flex-direction: row;
+  box-sizing: border-box;
+  padding-bottom: 24rpx;
+  padding-left: 48rpx;
+  border-bottom: 1rpx solid rgba(151, 151, 151, 0.34);
+}
+.comment_container .comment_item .comment_box .avatar_box {
+  width: 111rpx;
+  height: 100%;
+  display: block;
+  margin-right: 15rpx;
+}
+.comment_container .comment_item .comment_box .avatar_box image {
+  width: 96rpx;
+  height: 96rpx;
+  background: chocolate;
+  border-radius: 50%;
+}
+.comment_container .comment_item .comment_box .comment_info {
+  display: flex;
+  flex-direction: column;
+  align-items: flex-start;
+  width: 100%;
+}
+.comment_container .comment_item .comment_box .comment_info .nickname {
+  font-size: 30rpx;
+  color: rgba(0, 0, 0, 0.6);
+}
+.comment_container .comment_item .comment_box .comment_info .comment_text {
+  font-size: 30rpx;
+  color: rgba(0, 0, 0, 0.8);
+  margin-bottom: 23rpx;
+}
+.comment_container .comment_item .comment_box .comment_info .comment_reply_wrapper {
+  background: rgba(0, 0, 0, 0.03);
+  width: 100%;
+  padding-left: 12rpx;
+  padding-top: 10rpx;
+  box-sizing: border-box;
+}
+.comment_container .comment_item .comment_box .comment_info .comment_reply_wrapper .comment_reply_item {
+  font-size: 28rpx;
+  color: rgba(0, 0, 0, 0.8);
+}
+.comment_container .comment_item .comment_box .comment_info .comment_reply_wrapper .comment_reply_item .reply_nickname {
+  color: rgba(1, 67, 124, 0.8);
+}
+.comment_container .comment_item .comment_box .comment_info .comment_reply_wrapper .more_btn {
+  display: flex;
+  justify-content: flex-end;
+  width: 100%;
+  height: 37rpx;
+  font-size: 26rpx;
+  color: #698FAF;
+  padding-right: 20rpx;
+  box-sizing: border-box;
+  padding-bottom: 20rpx;
+}
+.comment_container .comment_item .comment_box .comment_info .time_info {
+  width: 100%;
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  align-items: center;
+  margin-top: 30rpx;
+}
+.comment_container .comment_item .comment_box .comment_info .time_info .time {
+  color: rgba(0, 0, 0, 0.8);
+  font-size: 28rpx;
+}
+.comment_container .comment_item .comment_box .comment_info .time_info .info {
+  width: 200rpx;
+  height: 100%;
+  display: flex;
+  position: relative;
+}
+.comment_container .comment_item .comment_box .comment_info .time_info .info .like {
+  width: 80rpx;
+  height: 35rpx;
+  display: flex;
+  align-items: center;
+  position: absolute;
+  top: -14rpx;
+  left: 0;
+}
+.comment_container .comment_item .comment_box .comment_info .time_info .info .like image {
+  width: 30rpx;
+  height: 27rpx;
+  margin-right: 12rpx;
+}
+.comment_container .comment_item .comment_box .comment_info .time_info .info .like text {
+  font-size: 22.4rpx;
+  color: rgba(0, 0, 0, 0.8);
+}
+.comment_container .comment_item .comment_box .comment_info .time_info .info .comment {
+  width: 80rpx;
+  height: 35rpx;
+  display: flex;
+  align-items: center;
+  position: absolute;
+  top: -14rpx;
+  left: 120rpx;
+}
+.comment_container .comment_item .comment_box .comment_info .time_info .info .comment image {
+  width: 28.8rpx;
+  height: 25rpx;
+  margin-right: 16rpx;
+}
+.comment_container .comment_item .comment_box .comment_info .time_info .info .comment text {
+  font-size: 22.4rpx;
+  color: rgba(0, 0, 0, 0.8);
+}
+.comment_container .comment_input {
+  width: 100%;
+  height: 205rpx;
+  background: #eee;
+  position: fixed;
+  bottom: 0;
+  z-index: 9999;
+  padding-left: 24rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+}
+.comment_container .comment_input .send_input {
+  width: 575rpx;
+  height: 94rpx;
+  background: #fff;
+  border-radius: 10rpx;
+  padding-left: 50rpx;
+  margin: 0;
+}
+.comment_container .comment_input .send_input ::placeholder {
+  text-indent: 10rpx;
+  color: #000;
+}
+.comment_container .comment_input .send_btn {
+  width: 120rpx;
+  height: 48rpx;
+  line-height: 48rpx;
+  text-align: center;
+  color: #42a8ff;
+  font-size: 34rpx;
+}

+ 43 - 5
component/comment/comment.js

@@ -27,7 +27,8 @@ Component({
     commentNum: 0,
     commentList: [],
     ifGetFocus: false,
-    replyType: 'works' // 回复类型,works是回复作品,comment是回复评论
+    replyType: 'works' ,// 回复类型,works是回复作品,comment是回复评论
+    isScroll: true
   },
 
   /**
@@ -73,13 +74,26 @@ Component({
       console.log('showControl', this.data.commentList[index].showControl)
     },
 
-    textInput: function(e){
-      console.log('键入',e.detail.value)
+    textInput: function (e) {
+      console.log('键入', e.detail.value)
       this.setData({
         inputValue: e.detail.value
       })
     },
-
+    // 获取焦点事件
+    bindfocus(e) {
+      this.setData({
+        isScroll: false
+      })
+      // this.triggerEvent('inputFocus');
+    },
+    // 失去焦点事件
+    closeblur(e) {
+      this.setData({
+        isScroll: true
+      })
+      // this.triggerEvent('inputBlur');
+    },
     // 评论作品
     sendReply: function sendReply(e) {
       console.log('sendReply', e.detail.value)
@@ -117,6 +131,12 @@ Component({
             [strImg]: true
           })
         }
+        if (res.data.count > 0) {
+          this.setData({
+            flowerNum: res.data.count
+          })
+          this.flowerAnimationHandler();
+        }
 
       });
     },
@@ -132,6 +152,13 @@ Component({
           this.setData({
             inputValue: '',
           })
+          if (res.data.count > 0) {
+            this.setData({
+              flowerNum: res.data.count
+            })
+            this.flowerAnimationHandler();
+          }
+
         })
       });
     },
@@ -160,6 +187,12 @@ Component({
             replyType: 'works',
             ifGetFocus: false
           })
+          if (res.data.count > 0) {
+            this.setData({
+              flowerNum: res.data.count
+            })
+            this.flowerAnimationHandler();
+          }
         });
       });
     },
@@ -190,6 +223,11 @@ Component({
 
       });
     },
+    flowerAnimationHandler: function () {
+      this.flowerBox = this.selectComponent("#flower-toast");
+      console.log('this.flower', this.flowerBox)
+      this.flowerBox.comeOut();
+    },
   }
 
-})
+})

+ 3 - 1
component/comment/comment.json

@@ -1,4 +1,6 @@
 {
   "component": true,
-  "usingComponents": {}
+  "usingComponents": {
+    "flowerBox": "/component/flowerBox/flowerBox"
+  }
 }

+ 1 - 0
component/comment/comment.less

@@ -191,6 +191,7 @@
             background: #fff;
             border-radius: 10rpx;
             padding-left: 50rpx;
+            margin: 0;
             ::placeholder{
                 text-indent: 10rpx;
                 color: #000;

+ 3 - 2
component/comment/comment.wxml

@@ -1,5 +1,5 @@
 <!-- component/comment.wxml -->
-<scroll-view class="comment_container" scroll-y="{{true}}">
+<scroll-view class="comment_container" scroll-y="{{isScroll}}">
     <view class="comment_number">评论 {{commentNum}}</view>
     <view class="comment_item" wx:for="{{commentList}}" data-commentid="{{item.id}}" wx:key="id">
         <view class="comment_box">
@@ -33,7 +33,8 @@
         </view>
     </view>
     <view class="comment_input">
-        <input name="send_input" class="send_input" confirm-type="hold" focus="{{ifGetFocus}}" value="{{inputValue}}" bindinput="textInput" bindconfirm="sendReply" placeholder="留下你的赞美,鼓励一下。" />
+        <input name="send_input" bindfocus="bindfocus" bindblur="closeblur" class="send_input" confirm-type="hold" focus="{{ifGetFocus}}" value="{{inputValue}}" bindinput="textInput" bindconfirm="sendReply" placeholder="留下你的赞美,鼓励一下。" />
         <view class="send_btn" bindtap="sendReply">发送</view>
     </view>
+<flowerBox id="flower-toast" flowerNum="{{flowerNum}}" />
 </scroll-view>

+ 1 - 1
component/flowerBox/flowerBox.js

@@ -53,7 +53,7 @@ Component({
               timingFunction: 'linear',
             })
             this.animation.opacity(1).step();
-            this.animation.bottom('-100rpx').step();
+            this.animation.bottom('-120rpx').step();
             this.setData({
               animationData: this.animation.export()
             })

+ 2 - 1
component/flowerBox/flowerBox.wxss

@@ -6,7 +6,8 @@
     box-shadow: 0 0 20rpx 0rpx rgba(0, 0, 0, 0.3);
     border-radius: 40rpx;
     position: fixed;
-    bottom: -100rpx;
+    z-index: 9999;
+    bottom: -120rpx;
     left: 0;
     right: 0;
     margin: 0 auto;

+ 1 - 1
component/my/my.js

@@ -24,7 +24,7 @@ export const myInit = (that) => {
     followData: []
   });
   that.getUserWorksInfo();
-  that.getUserAuth(); //用户鉴权
+  // that.getUserAuth(); //用户鉴权
   // that.getMyRead();
   console.log(that.data.myData)
   that.toMyEdit = (e) => {

+ 152 - 104
component/share/share.js

@@ -28,6 +28,7 @@ Component({
     path: '',
     QRCodeImagePath: '',
     QRCodeImageLocalPath: '',
+    activityImg: '',
     groupPurchaseInfo: {},
     groupType: '',
     animationData: {},
@@ -43,7 +44,9 @@ Component({
       '在朗读中  提升孩子的思辨能力',
       '重温经典课文  享受亲子美好时光',
       '大声朗读  能帮助孩子提高写作能力'
-    ]
+    ],
+    shareStep: 'firend',
+    activity: ''
   },
 
   /**
@@ -60,10 +63,12 @@ Component({
         // mask: true
       })
       httpRequestApi.createQRCode(this.data.QRData).success(res => {
+        console.log('----------------->分享二维码222',res.data.data)
         // 下载二维码
         wx.downloadFile({
           url: res.data.data,
           success: res => {
+            console.log('----------------->分享二维码',res.tempFilePath)
             this.setData({
               QRCodeImagePath: res.tempFilePath
             }, () => {
@@ -76,72 +81,92 @@ Component({
     makeImage: function () {
       const ctx = wx.createCanvasContext('myCanvas');
       // 画出背景和相同内容
-      if (this.data.shareType === 'works') {
-        ctx.drawImage('../../static/image/works_poster.jpg', 0, 0, 1200, 2100, 0, 0, 600, 1050); //插入图片  
+      if(this.data.activity) {
+        ctx.drawImage(this.data.activityImg, 0, 0, 1200, 2100, 0, 0, 600, 1050); //插入图片
       } else {
-        ctx.drawImage('../../static/image/group_poster.jpg', 0, 0, 1200, 2100, 0, 0, 600, 1050); //插入图片  
+        if (this.data.shareType === 'works') {
+          ctx.drawImage('../../static/image/works_poster.jpg', 0, 0, 1200, 2100, 0, 0, 600, 1050); //插入图片
+        } else {
+          ctx.drawImage('../../static/image/group_poster.jpg', 0, 0, 1200, 2100, 0, 0, 600, 1050); //插入图片
+        }
       }
-      ctx.save()
-      ctx.beginPath()
-      ctx.fill()
-      ctx.setFontSize(25)
-      ctx.setFillStyle('#fff')
-      ctx.fillText('课文朗读 每天5分钟', (300 - ctx.measureText('课文朗读 每天5分钟').width) / 2, 54.5)
-      ctx.setFontSize(16)
-      let randomSologan = this.data.randomSologan[Math.floor(Math.random() * 10)];
-      ctx.fillText(randomSologan, (300 - ctx.measureText(randomSologan).width) / 2, 75.5)
-      ctx.setFontSize(15)
-      ctx.setFillStyle('#838383')
-      ctx.fillText('长按识别二维码', 130.5, 391)
-      ctx.setFontSize(12)
-      ctx.setFillStyle('#838383')
-      ctx.fillText('接收邀请,获得你的课程吧', 130.5, 409.5) /*  */
-      // 头像
-      console.log('画头像')
-      if (this.data.shareType === 'works') {
-        ctx.arc(150, 160, 36, 0, 2 * Math.PI, true)
+      if (this.data.activity) {
+        ctx.save()
+        ctx.arc(49, 50, 29, 0, 2 * Math.PI, true)
         ctx.clip(); //剪切头像区域
-        ctx.drawImage(this.data.avatar, 116, 126, 68, 68);
-        ctx.arc(150, 160, 34, 0, 2 * Math.PI, false)
-        ctx.setFillStyle('#ff6f42')
-        ctx.fill();
+        ctx.drawImage(this.data.avatar, 20, 20, 61, 61);
         ctx.clip(); //剪切头像区域
-        ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
-        ctx.setFontSize(15)
-        ctx.setFillStyle('#ff6f42')
-        ctx.fillText(this.data.author, (300 - ctx.measureText(this.data.author).width) / 2, 220)
-        ctx.setFillStyle('#434343')
-        ctx.fillText('播音主持特长生', (300 - ctx.measureText('播音主持特长生').width) / 2, 243)
-        ctx.setFontSize(15)
+        ctx.restore();
+        ctx.setFontSize(16)
         ctx.setFillStyle('#434343')
-        ctx.fillText('使出洪荒之力,声情并茂地朗诵了', (300 - ctx.measureText('使出洪荒之力,声情并茂地朗诵了').width) / 2, 262)
-        ctx.fillText(`《${this.data.title}》`, (300 - ctx.measureText(`《${this.data.title}》`).width) / 2, 284)
+        ctx.fillText(`《${this.data.title}》`, (300 - ctx.measureText(`《${this.data.title}》`).width) / 2, 285)
+        // 二维码
+        ctx.drawImage(this.data.QRCodeImagePath, 104, 299, 92, 92);
+        ctx.draw();
       } else {
-        ctx.arc(64, 146, 29, 0, 2 * Math.PI, true)
-        ctx.clip(); //剪切头像区域
-        ctx.drawImage(this.data.avatar, 37, 119, 54, 54);
-        ctx.arc(64, 146, 27, 0, 2 * Math.PI, false)
-        ctx.setFillStyle('#ff6f42')
-        ctx.fill();
-        ctx.clip(); //剪切头像区域
-        //插入图片  
-        ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
-        ctx.setFontSize(18)
-        ctx.setFillStyle('#ff6f42')
-        ctx.fillText(this.data.author, 100, 143.5)
+        ctx.save()
+        ctx.beginPath()
+        ctx.fill()
+        ctx.setFontSize(25)
+        ctx.setFillStyle('#fff')
+        ctx.fillText('课文朗读 每天5分钟', (300 - ctx.measureText('课文朗读 每天5分钟').width) / 2, 54.5)
         ctx.setFontSize(16)
-        ctx.setFillStyle('#434343')
-        ctx.fillText('邀您和我一起大声朗读', 100, 167.5)
-        ctx.drawImage(this.data.iconImg, 27, 194, 247, 103.5);
+        let randomSologan = this.data.randomSologan[Math.floor(Math.random() * 10)];
+        ctx.fillText(randomSologan, (300 - ctx.measureText(randomSologan).width) / 2, 75.5)
         ctx.setFontSize(15)
-        ctx.setFillStyle('#434343')
-        ctx.fillText('朗朗读书声,是世界上最美妙的声音', (300 - ctx.measureText('朗朗读书声,是世界上最美妙的声音').width) / 2, 327.5)
+        ctx.setFillStyle('#838383')
+        ctx.fillText('长按识别二维码', 130.5, 391)
+        ctx.setFontSize(12)
+        ctx.setFillStyle('#838383')
+        ctx.fillText('接收邀请,获得你的课程吧', 130.5, 409.5) /*  */
+        // 头像
+        console.log('画头像')
+        if (this.data.shareType === 'works') {
+          ctx.arc(150, 160, 36, 0, 2 * Math.PI, true)
+          ctx.clip(); //剪切头像区域
+          ctx.drawImage(this.data.avatar, 116, 126, 68, 68);
+          ctx.arc(150, 160, 34, 0, 2 * Math.PI, false)
+          ctx.setFillStyle('#ff6f42')
+          ctx.fill();
+          ctx.clip(); //剪切头像区域
+          ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
+          ctx.setFontSize(15)
+          ctx.setFillStyle('#ff6f42')
+          ctx.fillText(this.data.author, (300 - ctx.measureText(this.data.author).width) / 2, 220)
+          ctx.setFillStyle('#434343')
+          ctx.fillText('播音主持特长生', (300 - ctx.measureText('播音主持特长生').width) / 2, 243)
+          ctx.setFontSize(15)
+          ctx.setFillStyle('#434343')
+          ctx.fillText('使出洪荒之力,声情并茂地朗诵了', (300 - ctx.measureText('使出洪荒之力,声情并茂地朗诵了').width) / 2, 262)
+          ctx.fillText(`《${this.data.title}》`, (300 - ctx.measureText(`《${this.data.title}》`).width) / 2, 284)
+        } else {
+          ctx.arc(64, 146, 29, 0, 2 * Math.PI, true)
+          ctx.clip(); //剪切头像区域
+          ctx.drawImage(this.data.avatar, 37, 119, 54, 54);
+          ctx.arc(64, 146, 27, 0, 2 * Math.PI, false)
+          ctx.setFillStyle('#ff6f42')
+          ctx.fill();
+          ctx.clip(); //剪切头像区域
+          //插入图片
+          ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
+          ctx.setFontSize(18)
+          ctx.setFillStyle('#ff6f42')
+          ctx.fillText(this.data.author, 100, 143.5)
+          ctx.setFontSize(16)
+          ctx.setFillStyle('#434343')
+          ctx.fillText('邀您和我一起大声朗读', 100, 167.5)
+          ctx.drawImage(this.data.iconImg, 27, 194, 247, 103.5);
+          ctx.setFontSize(15)
+          ctx.setFillStyle('#434343')
+          ctx.fillText('朗朗读书声,是世界上最美妙的声音', (300 - ctx.measureText('朗朗读书声,是世界上最美妙的声音').width) / 2, 327.5)
+        }
+        console.log('花二维码')
+        console.log(this.data)
+        console.log(this.data.avatar)
+        ctx.drawImage(this.data.QRCodeImagePath, 35, 351, 90, 90);
+        ctx.draw();
       }
-      console.log('花二维码')
-      console.log(this.data)
-      console.log(this.data.avatar)
-      ctx.drawImage(this.data.QRCodeImagePath, 35, 351, 90, 90);
-      ctx.draw();
+
       setTimeout(() => {
         wx.canvasToTempFilePath({
           x: 0,
@@ -158,7 +183,7 @@ Component({
             wx.hideLoading()
           },
           fail: (res) => {
-            console.log('史称失败',res)
+            console.log('史称失败', res)
             wx.hideLoading();
           }
         })
@@ -178,6 +203,7 @@ Component({
         }
       });
     },
+    /** 需要优化 */
     saveAvatar: function () {
       wx.downloadFile({
         url: this.data.avatar,
@@ -185,17 +211,26 @@ Component({
           this.setData({
             avatar: res.tempFilePath
           }, () => {
-            if (this.data.shareType === 'group') {
-              this.saveIcon();
-            } else {
-              this.makeImage();
-            }
+            wx.downloadFile({
+              url: 'https://reader-wx.ai160.com/images/reader/activity/activity_bg.jpg',
+              success: res => {
+                this.setData({
+                  activityImg: res.tempFilePath
+                }, () => {
+                  if (this.data.shareType === 'group') {
+                    this.saveIcon();
+                  } else {
+                    this.makeImage();
+                  }
+                })
+              }
+            })
           })
         }
       });
     },
     share: function (data) {
-      console.log('分享内容',data)
+      console.log('分享内容', data)
       if (this.data.shareType === 'works') {
 
         this.setData({
@@ -205,11 +240,13 @@ Component({
           iconImg: data.iconImg,
           title: data.title,
           productId: data.productId,
-          id:data.scene,
-          type:data.type,
-          grade:data.grade,
+          id: data.scene,
+          type: data.type,
+          grade: data.grade,
           shareImg: data.shareImg,
-          // path: data.path,
+          shareStep: 'firend',
+          shareIndex: data.index,
+          activity: data.activity,
           QRData: {
             page: data.path,
             scene: data.scene
@@ -234,8 +271,6 @@ Component({
           groupType: data.groupType
         })
       }
-      this.poster();
-
       if (this.data.shareType === 'class') {
         console.log('课程分享')
         this.setData({
@@ -252,6 +287,7 @@ Component({
         animationData: this.animation.export()
       })
       // 动画测试
+      // this.poster();
     },
     //关闭弹框
     close: function (e) {
@@ -287,31 +323,26 @@ Component({
             content: '快去分享给小伙伴吧',
             confirmText: '我知道了',
             showCancel: false,
-            success(res) {
+            success: (res) => {
               console.log('用户点击确定')
+              this.close();
+              httpRequestApi.shareImgLog({
+                readId: this.data.id,
+              }).success((oRes) => {
+                this.triggerEvent('addShareAmount', {
+                  index:this.data.shareIndex
+                })
+                setTimeout(() => {
+                  if (oRes.data.count > 0) {
+                    this.setData({
+                      flowerNum: oRes.data.count
+                    })
+                    this.flowerAnimationHandler();
+                  }
+                }, 500)
+              })
             }
           })
-         /*  const data = {};
-          // 团购分享记录
-          if (this.data.shareType === 'group') {
-            data.shareTypeEnum = 'POSTER';
-            data.shareContentEnum = 'GROUP';
-            data.productId = this.data.groupPurchaseInfo.productId;
-          }
-          // 朗读分享记录
-          if (this.data.shareType === 'works') {
-            data.shareTypeEnum = 'POSTER';
-            data.shareContentEnum = 'READ';
-            data.productId = this.data.productId;
-          } */
-          
-          httpRequestApi.shareLog({
-            readId:this.data.id,
-            type:this.data.type,
-            grade:this.data.grade
-          }).success((res) => {
-            console.log('分享记录',res)
-          })
 
           this.setData({
             imgUrls: false
@@ -342,27 +373,44 @@ Component({
       })
     },
     shareFriend: function () {
+      this.setData({
+        shareStep: 'circle'
+      })
+      this.poster();
       httpRequestApi.shareLog({
-        readId:this.data.id,
-        type:this.data.type,
-        grade:this.data.grade
+        readId: this.data.id,
+        type: this.data.type,
+        grade: this.data.grade
       }).success((res) => {
-        console.log('分享记录',res)
+        console.log('分享记录', res)
+        if (res.data.count > 0) {
+          this.setData({
+            flowerNum: res.data.count,
+          }, () => {
+            // this.flowerAnimationHandler();
+          })
+        }
+        this.triggerEvent('addShareAmount', {
+          index:this.data.shareIndex
+        })
       })
-      this.triggerEvent('customevent', {})
-    }
+    },
+    flowerAnimationHandler: function () {
+      this.flowerBox = this.selectComponent("#flower-toast");
+      console.log('this.flower', this.flowerBox)
+      this.flowerBox.comeOut();
+    },
   },
   onShareAppMessage: (e) => {
-    console.log('点击分享按钮',e)
+    console.log('点击分享按钮', e)
     if (res.from === 'button') {
       // 来自页面内转发按钮
       console.log(res.target)
-    }else{
+    } else {
       return {
         title: '课文朗读,从未如此有趣。',
         path: '/pages/index/index'
       }
     }
-    
-  },
-})
+  }
+})

+ 3 - 1
component/share/share.json

@@ -1,4 +1,6 @@
 {
   "component": true,
-  "usingComponents": {}
+  "usingComponents": {
+    "flowerBox": "/component/flowerBox/flowerBox"
+  }
 }

+ 22 - 16
component/share/share.wxml

@@ -1,25 +1,31 @@
 <view class="share" bindtap="close" wx:if="{{shareFlag}}" catchtouchmove="touchMove">
    <view class="btn" animation="{{animationData}}"  id="btnArea" catchtap="nothing">
        <!-- <image class="bg" src="../../static/groupImg/share.png"></image> -->
-       <view class="corss-line"></view>
-       <view class="invite-text">分享作品</view>
+       <!-- <view class="corss-line"></view> -->
+       <view class="invite-text" wx-if="{{shareStep==='firend' && !activity}}">分享该作品,获得3朵<image class="cover-flower"  src="../../static/image/flower_small.png"></image></view>
+       <view class="invite-text" wx-if="{{activity}}">分享该作品,获得活力值<image class="cover-flower"  src="../../static/activity/popularity1.png"></image></view>
        <view class="share-btn">
-            <button class="share-friend" open-type="share" catchtap="shareFriend">
-               <image  src="../../static/groupImg/weixin.png"></image>
-               <text>群/好友</text>
+            <button class="share-friend" wx-if="{{shareStep==='firend'}}" open-type="share" catchtap="shareFriend">
+               <image  src="../../static/image/wx_icon.png"></image>
+               <text>分享给好友/群聊 </text>
             </button>
-            <view class="share-circle" catchtap="PreservationImg">
-               <image  src="../../static/groupImg/circle.png"></image>
+             <view class="share-circle" wx-if="{{shareStep==='circle'}}" catchtap="PreservationImg">
+               <image  src="../../static/image/wx_firend.png"></image>
                <text>保存海报</text>
-            </view>           
+            </view>
        </view>
    </view>
-   <cover-view class="share-img" wx:if="{{imgUrls}}" id="imgArea">
+   <!-- <cover-view class="share-img" wx:if="{{imgUrls}}" id="imgArea">
        <cover-image class="img" src="{{imgUrls}}"  catchtap="nothing"></cover-image>
-       <!-- <cover-view class="Preservation" bindtap="PreservationImg" style="{{shareType === 'works' ?'background:#ff9209' :'background:#70CA2D'}}">
-           <!-- <image class="PreservationBg" src="../../static/groupImg/Preservation.png"></image> -->
-           <!-- <text bindtap="PreservationImg">保存到相册中,快去分享吧</text> -->
-           <!-- 保存到相册中,快去分享吧! -->
-       <!-- </cover-view> -->
-   </cover-view>
-</view>
+       <cover-view class="cover-text">再接再厉~</cover-view>
+       <cover-view class="cover-text">现在将海报分享到朋友圈</cover-view>
+       <cover-view class="cover-text">还可以额外获得10朵 <cover-image class="cover-flower"  src="../../static/image/flower_small.png"></cover-image></cover-view>
+   </cover-view> -->
+   <view class="share-img" wx:if="{{imgUrls}}" id="imgArea">
+       <image class="img" src="{{imgUrls}}"  catchtap="nothing"></image>
+       <view class="cover-text">将海报分享到朋友圈</view>
+       <view class="cover-text">{{activity ? '获取更多人气值' : '额外获得10朵'}}<image class="cover-flower" hidden="{{activity}}"  src="../../static/image/flower_small.png"></image></view>
+       <!-- <view class="cover-text">还可以额外获得10朵 <image class="cover-flower"  src="../../static/image/flower_small.png"></image>!</view> -->
+   </view>
+</view>
+<flowerBox id="flower-toast" flowerNum="{{flowerNum}}" />

+ 79 - 41
component/share/share.wxss

@@ -1,15 +1,16 @@
 /* component/shar-dialog/shar-dialog.wxss */
 .share {
-    position:fixed;
-    left:0;
-    top:0;
-    width:100%;
-    height:100%;
-    background:rgba(0, 0, 0, .8);
-    z-index:999999;
-    
+    position: fixed;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+    background: rgba(0, 0, 0, .8);
+    z-index: 999;
+
 }
-.corss-line{
+
+.corss-line {
     width: 90%;
     position: absolute;
     height: 39rpx;
@@ -20,11 +21,11 @@
     z-index: 1;
 }
 
-.invite-text{
-    width: 120rpx;
+.invite-text {
+    width: 100%;
     height: 30rpx;
     color: #262626;
-    font-size: 30rpx;
+    font-size: 34rpx;
     position: absolute;
     top: 19rpx;
     margin: 0 auto;
@@ -32,46 +33,56 @@
     right: 0;
     background: #fff;
     z-index: 2;
+    text-align: center;
+    display: flex;
+    align-items: center;
+    justify-content: center;
 }
 
 .btn {
     position: fixed;
     bottom: -200rpx;
     width: 100%;
-    height: 200rpx;
+    height: 230rpx;
     background: #fff;
 }
 
 .btn .bg {
-  display: block;
+    display: block;
     width: 500rpx;
     margin: 5% auto;
     height: 42rpx;
 }
-.btn text{
-  font-size: 28rpx;
+
+.btn text {
+    font-size: 34rpx;
 }
+
 .share-btn {
     display: flex;
-    justify-content: space-around;
-    margin-top: 65rpx;
+    justify-content: center;
+    margin-top: 75rpx;
 }
 
 .share-btn image {
-    width: 76rpx;
-    height: 76rpx;
+    width: 55rpx;
+    height: 55rpx;
+    margin-right: 20rpx;
 }
 
 .share-btn view {
     display: flex;
-    flex-direction: column;
-    /* justify-content: space-between; */
+    flex-direction: row;
+    justify-content: center;
     align-items: center;
-    font-size: 24rpx;
-    height: 120rpx;
-    width: 180rpx;
+    font-size: 34rpx;
+    height: 85rpx;
+    width: 333rpx;
     line-height: 0;
     line-height: 33rpx;
+    color: #fff;
+    background: #44af34;
+    border-radius: 52rpx;
 }
 
 .img {
@@ -79,13 +90,34 @@
     /* position: absolute; */
     /* left: 5rpx; */
     /* top: 30rpx; */
-    width: 510rpx;
-    height: 893rpx;
-    margin: 63rpx auto;
+    /* width: 510rpx; */
+    /* height: 893rpx; */
+    width: 459rpx;
+    height: 810rpx;
+    margin: 23rpx auto;
     /* width: 375rpx; */
     /* height: 667rpx; */
 }
 
+.cover-text {
+    width: 100%;
+    color: #fff;
+    font-size: 34rpx;
+    text-align: center;
+    display: flex;
+    flex-direction: row;
+    margin-bottom: 5rpx;
+    align-items: center;
+    justify-content: center;
+}
+
+.cover-flower {
+    width: 28rpx;
+    height: 34rpx;
+    margin-left: 3rpx;
+    margin-right: 3rpx;
+}
+
 .Preservation {
     position: absolute;
     left: 15%;
@@ -101,23 +133,29 @@
 }
 
 .share-friend {
-    background: #fff;
-    display:flex;
-    flex-direction:column;
+    display: flex;
+    flex-direction: row;
+    justify-content: center;
     align-items: center;
-    outline:none;
-    padding:0;
-    margin:0;
-    border-radius:0;    
-    height: 145rpx;
-    font-size:32rpx;
-    width: 180rpx;
+    font-size: 34rpx;
+    height: 85rpx;
+    width: 400rpx;
+    line-height: 0;
     line-height: 33rpx;
+    color: #fff;
+    background: #44af34;
+    border-radius: 52rpx;
+    outline: none;
+    padding: 0;
+    margin: 0;
+    border-radius: 66rpx;
 }
 
 .share-friend image {
-    width: 76rpx;
-    height: 76rpx;
+    width: 66rpx;
+    height: 53rpx;
 }
 
-button::after{ border: none; } 
+button::after {
+    border: none;
+}

+ 243 - 0
component/video-swiper/index.css

@@ -0,0 +1,243 @@
+.swiper_container {
+  width: 100%;
+  height: 100%;
+  background: #eee;
+}
+.swiper_container .video-swiper {
+  width: 100%;
+  height: 100%;
+  display: block;
+  background: #ffffff;
+}
+.swiper_container .swiper_item {
+  width: 100%;
+  background: #ffffff;
+  margin-bottom: 20rpx;
+  padding-bottom: 20rpx;
+  overflow: hidden;
+}
+.swiper_container .swiper_item.no_swiper {
+  max-height: 879rpx;
+  min-height: 640rpx;
+}
+.swiper_container .swiper_item .head_box {
+  width: 100%;
+  height: 120rpx;
+  display: flex;
+  justify-content: space-between;
+  padding-left: 20rpx;
+  box-sizing: border-box;
+  padding-right: 20rpx;
+  position: relative;
+}
+.swiper_container .swiper_item .head_box .tag_icon {
+  width: 66rpx;
+  height: 34rpx;
+  position: absolute;
+  right: 0;
+  top: 0;
+}
+.swiper_container .swiper_item .head_box .user_box {
+  width: 378rpx;
+  height: 100%;
+  display: flex;
+  align-items: center;
+  position: relative;
+}
+.swiper_container .swiper_item .head_box .user_box .avatar {
+  width: 80rpx;
+  height: 80rpx;
+  border: 2rpx solid green;
+  border-radius: 50%;
+}
+.swiper_container .swiper_item .head_box .user_box .avatar_fans {
+  width: 34rpx;
+  height: 34rpx;
+  position: absolute;
+  bottom: 5rpx;
+  left: 26rpx;
+}
+.swiper_container .swiper_item .head_box .user_box .user_right {
+  margin-left: 16rpx;
+  display: flex;
+  align-items: center;
+}
+.swiper_container .swiper_item .head_box .user_box .user_right .nickname {
+  font-size: 30rpx;
+  color: rgba(0, 0, 0, 0.8);
+  font-weight: bold;
+}
+.swiper_container .swiper_item .head_box .user_box .user_right .efun_tag {
+  width: 68rpx;
+  height: 30rpx;
+  margin-left: 4rpx;
+}
+.swiper_container .swiper_item .head_box .time {
+  display: flex;
+  align-items: center;
+  font-size: 30rpx;
+  color: rgba(0, 0, 0, 0.8);
+}
+.swiper_container .swiper_item .head_box .my_btn {
+  display: flex;
+  align-items: center;
+}
+.swiper_container .swiper_item .head_box .my_btn .delete {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  margin-right: 45rpx;
+}
+.swiper_container .swiper_item .head_box .my_btn .delete .delete_image {
+  width: 25rpx;
+  height: 33rpx;
+  margin-bottom: 2rpx;
+}
+.swiper_container .swiper_item .head_box .my_btn .delete .delete_text {
+  font-size: 26rpx;
+  color: rgba(0, 0, 0, 0.8);
+}
+.swiper_container .swiper_item .head_box .my_btn .hide {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  margin-right: 23rpx;
+  padding-top: 3rpx;
+  box-sizing: border-box;
+}
+.swiper_container .swiper_item .head_box .my_btn .hide .hide_image {
+  width: 32rpx;
+  height: 33rpx;
+  margin-bottom: 2rpx;
+}
+.swiper_container .swiper_item .head_box .my_btn .hide .hide_text {
+  font-size: 26rpx;
+  color: rgba(0, 0, 0, 0.8);
+}
+.swiper_container .swiper_item .video_item {
+  width: 100%;
+  height: 422rpx;
+}
+.swiper_container .swiper_item .video_place {
+  width: 100%;
+  height: 430rpx;
+  background: rgba(0, 0, 0, 0.3);
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  position: relative;
+}
+.swiper_container .swiper_item .video_place .play_btn {
+  width: 100rpx;
+  height: 100rpx;
+  position: absolute;
+  top: 170rpx;
+  left: 0;
+  right: 0;
+  margin: 0 auto;
+}
+.swiper_container .swiper_item .video_place .place_img {
+  width: 100%;
+  height: 100%;
+}
+.swiper_container .swiper_item .video_item_dialog {
+  width: 100%;
+  height: 422rpx;
+  background: rgba(0, 0, 0, 0.3);
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  position: absolute;
+  z-index: 1;
+}
+.swiper_container .swiper_item .video_item_dialog .video_item_dialog_img {
+  width: 215rpx;
+  height: 215rpx;
+}
+.swiper_container .swiper_item .video_title {
+  width: 100%;
+  height: 58rpx;
+  font-size: 34rpx;
+  color: #373737;
+  display: flex;
+  align-items: center;
+  padding-left: 27rpx;
+  font-weight: bold;
+}
+.swiper_container .swiper_item .foot_box {
+  width: 100%;
+  height: 65rpx;
+  margin-top: 43rpx;
+  display: flex;
+  justify-content: space-between;
+  padding-left: 20rpx;
+}
+.swiper_container .swiper_item .foot_box .foot_left,
+.swiper_container .swiper_item .foot_box .foot_right {
+  display: flex;
+  align-items: center;
+}
+.swiper_container .swiper_item .foot_box .video_btn {
+  margin-right: 42rpx;
+  font-size: 28rpx;
+  color: rgba(0, 0, 0, 0.8);
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+}
+.swiper_container .swiper_item .foot_box .video_btn .collect_btn_icon {
+  width: 48rpx;
+  height: 46rpx;
+  margin-right: 7rpx;
+}
+.swiper_container .swiper_item .foot_box .video_btn .share_btn_icon {
+  width: 46rpx;
+  height: 46rpx;
+  margin-right: 8rpx;
+  outline: none;
+  padding: 0;
+  margin: 0;
+  border-radius: 0;
+  background: #fff;
+}
+.swiper_container .swiper_item .foot_box .video_btn .flower_btn_icon {
+  width: 46rpx;
+  height: 46rpx;
+  margin-right: 10rpx;
+  border-radius: none;
+}
+.swiper_container .swiper_item .foot_box .video_btn .comment_btn_icon {
+  width: 49rpx;
+  height: 47rpx;
+  margin-right: 9rpx;
+  border-radius: 0;
+}
+.swiper_container .swiper_item .btn_wrapper {
+  width: 100%;
+  height: 111rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  margin-top: 45rpx;
+  margin-bottom: 10rpx;
+  padding-bottom: 20rpx;
+  box-sizing: border-box;
+}
+.swiper_container .swiper_item .btn_wrapper .reading_btn {
+  width: 271rpx;
+  height: 80rpx;
+  background: #3FACFF;
+  border-radius: 100rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+.swiper_container .swiper_item .btn_wrapper .reading_btn image {
+  width: 39rpx;
+  height: 50rpx;
+  margin-right: 20rpx;
+}
+.swiper_container .swiper_item .btn_wrapper .reading_btn text {
+  color: #fff;
+  font-size: 30rpx;
+}

+ 135 - 58
component/video-swiper/index.js

@@ -20,6 +20,10 @@ Component({
             type: Boolean,
             value: true
         },
+        noMoreWork: {
+            type: Boolean,
+            value: false
+        },
         duration: {
             type: Number,
             value: 500
@@ -36,10 +40,21 @@ Component({
             type: Array,
             value: [],
             observer: function observer() {
-                if (!this.data.isSwiper) return;
-                var newVal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
-
-                this._videoListChanged(newVal);
+                console.log('数据更新111111', arguments)
+                let newValue = arguments[0];
+                let oldValue = arguments[1];
+                if (newValue && oldValue && (this.data.activeIndex || this.data.activeIndex === 0)) {
+                    let newVideoShow = newValue[this.data.activeIndex].videoShow;
+                    let oldVideoShow = oldValue[this.data.activeIndex].videoShow;
+                    if (newVideoShow !== oldVideoShow && oldVideoShow) {
+                        console.log('把值设置为true')
+                        newValue[this.data.activeIndex].videoShow = true;
+                        this.setData({
+                        })
+                    }
+                }
+                let newVal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+                this.updateSonList(newVal);
             }
         },
         nextMargin: {
@@ -49,6 +64,8 @@ Component({
         }
     },
     data: {
+        sonVideoList: [], // 子组件里的视频组件
+        activeType: '',
         nextQueue: [],
         prevQueue: [],
         curQueue: [],
@@ -61,13 +78,21 @@ Component({
         _invalidDown: 0,
         _videoContexts: [],
         inputValue: '',
-        showControl: 0
+        showControl: 0,
+        flowerNum: 0
     },
     lifetimes: {
         attached: function attached() {
             this.data._videoContexts = [wx.createVideoContext('video_0', this), wx.createVideoContext('video_1', this), wx.createVideoContext('video_2', this)];
         }
     },
+    /*     observers: {
+            '**': function() {
+              // 每次 setData 都触发
+              console.log('数据更新333333',this.data)
+
+            },
+          }, */
     methods: {
         _videoListChanged: function _videoListChanged(newVal) {
             var _this = this;
@@ -86,6 +111,12 @@ Component({
                 });
             }
         },
+        updateSonList: function updateSonList(newVal) {
+            this.setData({
+                sonVideoList: newVal,
+                activeIndex: ''
+            })
+        },
         animationfinish: function animationfinish(e) {
             var _data = this.data,
                 _last = _data._last,
@@ -218,15 +249,19 @@ Component({
         },
         openComment: function openComment(e) {
             console.log(e)
+            let index = e.currentTarget.dataset.index;
+            this.setData({
+                activeIndex:index
+            })
             this.trigger(e, 'openComment')
         },
         // 展示视频
         showVideo: function showVideo(e) {
             let index = e.target.dataset.index ? e.target.dataset.index : e.currentTarget.dataset.index;
             console.log('showVideo')
-            const str = `videoList[${index}].videoShow`;
+            const str = `sonVideoList[${index}].videoShow`;
             if (this.data.lastIndex || this.data.lastIndex === 0) {
-                const lastStr = `videoList[${this.data.lastIndex}].videoShow`;
+                const lastStr = `sonVideoList[${this.data.lastIndex}].videoShow`;
                 this.setData({
                     lastIndex: index,
                     [lastStr]: false,
@@ -280,6 +315,9 @@ Component({
                 favoritesType: e.target.dataset.type ? e.target.dataset.type : e.currentTarget.dataset.type
             }
             const index = e.target.dataset.index ? e.target.dataset.index : e.currentTarget.dataset.index;
+            this.setData({
+                activeIndex:index
+            })
             console.log('视频index', index);
             if (this.data.curQueue.length <= 0) {
                 let str = `videoList[${index}].isFavorite`
@@ -288,17 +326,26 @@ Component({
                     // this.setData({
                     //     [str]: isCollect
                     // })
-                    this.triggerEvent('collectTap',{
+                    if (res.data.count > 0) {
+                        this.setData({
+                            flowerNum: res.data.count
+                        })
+                        this.flowerAnimationHandler();
+                    }
+                    this.triggerEvent('collectTap', {
                         index,
                         isCollect
                     })
                 });
-                
+
             } else {
-                let str = `curQueue[${index}].isFavorite`
+                let str = `curQueue[${index}].isFavorite`;
+                let str2 = `curQueue[${index}].favoritesAmount`
                 httpRequestApi.collectClass(data).success((res) => {
+                    console.log('收藏数', this.data.curQueue[index].favoritesAmount)
                     this.setData({
-                        [str]: !this.data.curQueue[index].isFavorite
+                        [str]: !this.data.curQueue[index].isFavorite,
+                        [str2]: res.data.data.status === 'NORMAL' ? this.data.curQueue[index].favoritesAmount + 1 : this.data.curQueue[index].favoritesAmount - 1
                     })
                 });
             }
@@ -306,6 +353,7 @@ Component({
         },
         // 点赞
         likeTap: function likeTap(e) {
+
             if (!wx.getStorageSync('user').wechatName) {
                 wx.navigateTo({
                     url: `../../pages/login/login`
@@ -319,6 +367,18 @@ Component({
             }
             const id = e.target.dataset.id ? e.target.dataset.id : e.currentTarget.dataset.id;
             const index = e.target.dataset.index ? e.target.dataset.index : e.currentTarget.dataset.index;
+            this.setData({
+                addComeOut: index,
+                activeIndex: index,
+                activeType: 'like'
+            })
+            setTimeout(() => {
+                if (this.data.addComeOut) {
+                    this.setData({
+                        addComeOut: ''
+                    })
+                }
+            }, 1100)
             console.log('视频index', index);
             if (this.data.isSwiper) {
                 let likeStr = `curQueue[${index}].isLike`;
@@ -333,16 +393,26 @@ Component({
                 let likeStr = `videoList[${index}].isLike`;
                 let likeNumStr = `videoList[${index}].likes`;
                 httpRequestApi.likeWorks(id).success((res) => {
-                    // this.setData({
-                    //     [likeStr]: true,
-                    //     [likeNumStr]: this.data.videoList[index].likes + 1
-                    // })
-                    this.triggerEvent('likeTap',{
+                    console.log('小红花个数', res.data.count)
+                    if (res.data.count > 0) {
+                        this.setData({
+                            flowerNum: res.data.count
+                        })
+                        this.flowerAnimationHandler();
+                    }
+                    this.triggerEvent('likeTap', {
                         index,
                     })
                 });
             }
         },
+        addShareAmount: function (e) {
+            console.log('+++++1', e.detail.index);
+
+            this.triggerEvent('addShareAmount', {
+                index: e.detail.index
+            })
+        },
         // 下载视频
         download: function (e) {
             // console.log(e.currentTarget.dataset)
@@ -350,38 +420,40 @@ Component({
                 title: '保存到本地',
                 mask: true
             })
-            const { url } = e.currentTarget.dataset;
+            const {
+                url
+            } = e.currentTarget.dataset;
             wx.downloadFile({
                 url,
-                success (res) {
+                success(res) {
                     // 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容
                     if (res.statusCode === 200) {
                         console.log(res.tempFilePath)
                         wx.saveVideoToPhotosAlbum({
                             filePath: res.tempFilePath,
-                            success (res) {
-                              wx.hideLoading()
-                              wx.showToast({
-                                title: '保存成功',
-                                icon: 'success',
-                                duration: 2000,
-                                mask: true
-                              })                              
+                            success(res) {
+                                wx.hideLoading()
+                                wx.showToast({
+                                    title: '保存成功',
+                                    icon: 'success',
+                                    duration: 2000,
+                                    mask: true
+                                })
                             },
-                            fail (error) {
+                            fail(error) {
                                 console.log(error)
                             }
                         })
                     }
                 },
-                fail () {
+                fail() {
                     wx.hideLoading()
                     wx.showToast({
-                      title: '网络不给力',
-                      icon: 'error',
-                      duration: 2000,
-                      mask: true
-                    })                              
+                        title: '网络不给力',
+                        icon: 'error',
+                        duration: 2000,
+                        mask: true
+                    })
                 }
             })
         },
@@ -438,31 +510,34 @@ Component({
             })
         },
         openShare: function (e) {
+            this.triggerEvent('openShare', e)
             const obj = e.currentTarget.dataset
-            console.log('分享的dataset', obj)
-            console.log('分享', e)
-            if (1) {
-                this.shareDialog = this.selectComponent("#share-dialog");
-                const data = {
-                    avatar: obj.avatar,
-                    author: obj.author,
-                    iconImg: obj.iconImg,
-                    title: obj.title,
-                    path: `pages/index/index`,
-                    scene: obj.id,
-                    type:obj.type,
-                    grade:obj.grade,
-                    productId: 1,
-                    shareImg:obj.shareImg
-                    // tip: this.data.tip,
-                }
-                // console.log(data)
-                this.setData({
-                    noScroll: 'noScroll'
-                })
-                this.shareDialog.share(data);
+            const scene = obj.activity ? `${obj.id}&activity=true` : obj.id
+            this.shareDialog = this.selectComponent("#share-dialog");
+            const data = {
+                avatar: obj.avatar,
+                author: obj.author,
+                iconImg: obj.iconImg,
+                title: obj.title,
+                path: `pages/index/index`,
+                scene,
+                type: obj.type,
+                grade: obj.grade,
+                productId: 1,
+                shareImg: obj.shareImg,
+                index: obj.index,
+                activity: obj.activity || ''
             }
-            this.triggerEvent('openShare', e)
+            this.setData({
+                noScroll: 'noScroll'
+            })
+            this.shareDialog.share(data);
+            // this.shareDialog.shareFriend();
+        },
+        flowerAnimationHandler: function () {
+            this.flowerBox = this.selectComponent("#flower-toast");
+            console.log('this.flower', this.flowerBox)
+            this.flowerBox.comeOut();
         },
         trigger: function trigger(e, type) {
             if (!wx.getStorageSync('user').wechatName) {
@@ -475,8 +550,10 @@ Component({
 
             // var detail = e.detail;
             var activeId = e.target.dataset.id ? e.target.dataset.id : e.currentTarget.dataset.id;
+            var activeIndex = e.target.dataset.index ? e.target.dataset.index : e.currentTarget.dataset.index;
             this.triggerEvent(type, {
-                activeId: activeId
+                activeId: activeId,
+                activeIndex: activeIndex
             }, {
                 bubbles: false
             });
@@ -485,4 +562,4 @@ Component({
               }), ext)); */
         }
     }
-});
+});

+ 2 - 1
component/video-swiper/index.json

@@ -1,6 +1,7 @@
 {
     "component": true,
     "usingComponents": {
-        "shareDialog": "/component/share/share"
+        "shareDialog": "/component/share/share",
+        "flowerBox": "/component/flowerBox/flowerBox"
     }
 }

+ 81 - 3
component/video-swiper/index.less

@@ -1,3 +1,17 @@
+// out: index.wxss 
+@keyframes numberMove {
+    from {
+        bottom: 20rpx;
+        opacity: 1;
+    }
+
+    to {
+        bottom: 200rpx;
+        font-size: 50rpx;
+        opacity: 0;
+    }
+}
+
 .swiper_container {
     width: 100%;
     height: 100%;
@@ -21,6 +35,7 @@
         margin-bottom: 20rpx;
         padding-bottom: 20rpx;
         overflow: hidden;
+        position: relative;
 
         &.no_swiper {
             max-height: 879rpx;
@@ -106,9 +121,14 @@
                     align-items: center;
                     margin-right: 45rpx;
 
+                    .download_image {
+                        width: 29rpx;
+                        height: 32rpx;
+                        margin-bottom: 2rpx;
+                      }
                     .delete_image {
                         width: 25rpx;
-                        height: 33rpx;
+                        height: 32rpx;
                         margin-bottom: 2rpx;
                     }
 
@@ -123,13 +143,13 @@
                     flex-direction: column;
                     align-items: center;
                     margin-right: 23rpx;
-                    padding-top: 3rpx;
+                    // padding-top: 3rpx;
                     box-sizing: border-box;
 
                     .hide_image {
                         width: 32rpx;
                         height: 33rpx;
-                        margin-bottom: 2rpx;
+                        margin-bottom: 1rpx;
                     }
 
                     .hide_text {
@@ -211,6 +231,7 @@
             .foot_right {
                 display: flex;
                 align-items: center;
+                position: relative;
             }
 
             .video_btn {
@@ -221,6 +242,45 @@
                 flex-direction: row;
                 align-items: center;
 
+                .animation-flower {
+                    width: 90rpx;
+                    height: 40rpx;
+                    position: absolute;
+                    left: 17rpx;
+                    bottom: 24rpx;
+                    opacity: 0;
+                    display: flex;
+                    align-items: center;
+                    flex-direction: row;
+                    justify-content: center;
+                    .animation-flower-icon {
+                        width: 32rpx;
+                        height: 38rpx;
+                        display: block;
+                        margin-right: 8rpx;
+                    }
+
+                    text {
+                        margin-top: -15rpx;
+                        display: block;
+                        font-size: 26rpx;
+                        font-weight: 800;
+                        color: #fc3b3b;
+                    }
+                }
+
+                .add-one-come-out {
+                    animation: numberMove 1.2s ease;
+                    -webkit-animation: numberMove 1.2s ease;
+                }
+
+                &.share_btn {
+                    outline: none;
+                    padding: 0;
+                    margin: 0;
+                    background: #fff;
+                }
+
                 .collect_btn_icon {
                     width: 48rpx;
                     height: 46rpx;
@@ -231,6 +291,11 @@
                     width: 46rpx;
                     height: 46rpx;
                     margin-right: 8rpx;
+                    outline: none;
+                    padding: 0;
+                    margin: 0;
+                    border-radius: 0;
+                    background: #fff;
                 }
 
                 .flower_btn_icon {
@@ -284,6 +349,19 @@
         }
     }
 
+    .no_work {
+        width: 100%;
+        height: 120rpx;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+
+        .no_work_text {
+            color: #373737;
+            font-size: 30rpx;
+        }
+    }
+
 
 
 }

+ 117 - 149
component/video-swiper/index.wxml

@@ -1,17 +1,7 @@
 <view class="swiper_container">
-  <swiper 
-    wx:if="{{isSwiper}}"
-    class="video-swiper" 
-    circular="{{circular}}"
-    easing-function="{{easingFunction}}" 
-    vertical 
-    current="0"
-    duration="{{duration}}" 
-    next-margin="{{nextMargin}}" 
-    bindanimationfinish="animationfinish">
+  <swiper wx:if="{{isSwiper}}" class="video-swiper" circular="{{circular}}" easing-function="{{easingFunction}}" vertical current="0" duration="{{duration}}" next-margin="{{nextMargin}}" bindanimationfinish="animationfinish">
     <!-- curQueue 循环会导致video重新插入,objectFit 不可变更 -->
-        
-    <swiper-item class="swiper_item" wx:for="{{curQueue}}"  data-id="{{item.id}}"  wx:key="id">
+    <swiper-item class="swiper_item" wx:for="{{curQueue}}" data-id="{{item.id}}" wx:key="id">
       <view class="head_box">
         <image class="tag_icon" wx:if="{{item.hasTag}}" src="{{item.tagUrl}}" />
         <view class="user_box" catchtap="{{ifHeadTap ? 'headTap' : null}}" data-uid="{{item.uid}}">
@@ -21,39 +11,23 @@
             <view class="nickname">{{item.nickName}}</view>
             <image class="efun_tag" src="../../static/index/efun_tag.png" wx:if="{{item.isEfun}}"></image>
           </view>
-            
         </view>
-          <view wx:if="{{!item.showMyBtn}}" class="time">
-            <text>发布时间:{{item.time}}</text>
+        <view wx:if="{{!item.showMyBtn}}" class="time">
+          <text>发布时间:{{item.time}}</text>
+        </view>
+        <view wx:if="{{item.showMyBtn}}" class="my_btn">
+          <view catchtap="delete" data-id="{{item.id}}">
+            <image src="../../static/index/delete.png" />
+            <text>删除</text>
           </view>
-          <view wx:if="{{item.showMyBtn}}" class="my_btn">
-            <view catchtap="delete" data-id="{{item.id}}">
-              <image src="../../static/index/delete.png" />
-              <text >删除</text>
-            </view>
-            <view catchtap="hide" data-status="{{item.status}}"  data-id="{{item.id}}">
-              <image src="{{item.status==='NORMAL'? '../../static/index/show_icon.png': '../../static/index/hide_icon.png'}}" />
-              
-              <text >{{item.status==='NORMAL'? '隐藏': '展示'}}</text>
-            </view>
+          <view catchtap="hide" data-status="{{item.status}}" data-id="{{item.id}}">
+            <image src="{{item.status==='NORMAL'? '../../static/index/show_icon.png': '../../static/index/hide_icon.png'}}" />
+            <text>{{item.status==='NORMAL'? '隐藏': '展示'}}</text>
           </view>
+        </view>
       </view>
-      <video 
-        id="video_{{index}}" 
-        class="video_item" 
-        loop="{{loop}}" 
-        enable-play-gesture 
-        enable-progress-gesture 
-        show-center-play-btn="{{false}}"
-        controls="{{true}}"
-        src="{{item.url}}" 
-        object-fit="contain"
-        data-index="{{index}}"
-        data-id="{{item.id}}"
-        bindplay="onPlay"
-        bindended="onEnded"
-      >
-      <!--   bindplay="onPlay"
+      <video id="video_{{index}}" class="video_item" loop="{{loop}}" enable-play-gesture enable-progress-gesture show-center-play-btn="{{false}}" controls="{{true}}" src="{{item.url}}" object-fit="contain" data-index="{{index}}" data-id="{{item.id}}" bindplay="onPlay" bindended="onEnded">
+        <!-- bindplay="onPlay"
         bindpause="onPause"
         bindended="onEnded"
         binderror="onError"
@@ -63,34 +37,29 @@
         bindloadedmetadata="onLoadedMetaData" -->
       </video>
       <view class="video_title">
-        <text>
-          {{item.title}}
-        </text>
-          
+        <text>{{item.title}}</text>
       </view>
-        
-      <view class="foot_box"> 
+      <view class="foot_box">
         <view class="foot_left">
           <view class="video_btn collect_btn" catchtap="collectTap" data-index="{{index}}" data-id="{{item.id}}" data-type="{{item.type}}">
-              <image class="collect_btn_icon" src="{{item.isFavorite ? '../../static/index/star_colored.png' : '../../static/index/star.png'}}" />
-              <text>收藏</text>
+            <image class="collect_btn_icon" src="{{item.isFavorite ? '../../static/index/star_colored.png' : '../../static/index/star.png'}}" />
+            <text>收藏</text>
           </view>
-          <view class="video_btn share_btn" bindtap="openShare" data-index="{{index}}" data-id="{{item.id}}" data-avatar="{{item.avatar}}" data-author="{{item.nickName}}" data-uid="{{item.uid}}" data-img="{{item.img}}" data-title="{{item.title}}" data-type="{{item.type}}">
-              <image class="share_btn_icon" src="../../static/index/share.png" lazy-load="true" />
-              <text>分享</text>
+          <view class="video_btn share_btn" bindtap="openShare" data-index="{{index}}" data-id="{{item.id}}" data-avatar="{{item.avatar}}" data-author="{{item.nickName}}" data-uid="{{item.uid}}" data-img="{{item.img}}" data-title="{{item.title}}" data-type="{{item.type}}" ata-activity="{{item.activity}}">
+            <image class="share_btn_icon" src="../../static/index/share.png" lazy-load="true" />
+            <text>分享</text>
           </view>
         </view>
         <view class="foot_right">
           <view class="video_btn flower_btn" catchtap="{{item.isLike ?  null : 'likeTap'}}" data-index="{{index}}" data-id="{{item.id}}" data-islike="{{item.isLike}}">
-              <image class="flower_btn_icon" src="{{item.isLike ? '../../static/index/heart_colored.png' : '../../static/index/heart.png'}}" />
-              <text>{{item.likes}}</text>
+            <image class="flower_btn_icon" src="{{item.isLike ? '../../static/index/heart_colored.png' : '../../static/index/heart.png'}}" />
+            <text>{{item.likes}}</text>
           </view>
           <view class="video_btn comment_btn" catchtap="openComment" data-id="{{item.id}}">
-              <image class="comment_btn_icon" src="../../static/index/comment.png" lazy-load="true" />
-              <text>{{item.commentAmount}}</text>
+            <image class="comment_btn_icon" src="../../static/index/comment.png" lazy-load="true" />
+            <text>{{item.commentAmount}}</text>
           </view>
         </view>
-            
       </view>
       <view class="btn_wrapper" catchtap="goToReading" data-id="{{item.classId}}">
         <view class="reading_btn">
@@ -100,68 +69,63 @@
       </view>
     </swiper-item>
   </swiper>
-
   <!-- // 非swiper -->
-  <view wx:if="{{!isSwiper}}" class="swiper_item no_swiper" wx:for="{{videoList}}"  data-id="{{item.id}}"  wx:key="id">
-      <view class="head_box">
-        <image class="tag_icon" wx:if="{{item.hasTag}}" src="{{item.tagUrl}}" />
-        <view class="user_box" catchtap="{{ifHeadTap ? 'headTap' : null}}" data-uid="{{item.uid}}">
-          <image class="avatar" lazy-load="true" src="{{item.avatar}}" />
-          <image class="avatar_fans" wx:if="{{!item.isFans}}" src="../../static/index/add_follow.png" />
-          
-          <view class="user_right">
-            <view class="nickname">{{item.nickName}}</view>
-            <image class="efun_tag" src="../../static/index/efun_tag.png" wx:if="{{item.isEfun}}"></image>
-          </view>
-            
+  <view wx:if="{{!isSwiper}}" class="swiper_item no_swiper" wx:for="{{sonVideoList}}" data-id="{{item.id}}" wx:key="id">
+    <view class="head_box">
+      <image class="tag_icon" wx:if="{{item.hasTag}}" src="{{item.tagUrl}}" />
+      <view class="user_box" catchtap="{{ifHeadTap ? 'headTap' : null}}" data-uid="{{item.uid}}">
+        <image class="avatar" lazy-load="true" src="{{item.avatar}}" />
+        <image class="avatar_fans" wx:if="{{!item.isFans}}" src="../../static/index/add_follow.png" />
+        <view class="user_right">
+          <view class="nickname">{{item.nickName}}</view>
+          <image class="efun_tag" src="../../static/index/efun_tag.png" wx:if="{{item.isEfun}}"></image>
         </view>
-          <view wx:if="{{!item.showMyBtn}}" class="time">
-            <text>发布时间:{{item.time}}</text>
-          </view>
-          <view wx:if="{{item.showMyBtn && !item.ifCheck}}" class="my_btn">
-            <view class="delete" catchtap="download" data-url="{{item.markPath ? item.markPath : '' }}" data-id="{{item.id}}">
-              <image class="download_image" src="../../static/index/down.png" />
-              <text class="delete_text" >下载</text>
-            </view>
-            <view class="delete" catchtap="delete" data-id="{{item.id}}">
-              <image class="delete_image" src="../../static/index/delete.png" />
-              <text class="delete_text" >删除</text>
-            </view>
-            <view class="hide" catchtap="hide" data-status="{{item.status}}" data-id="{{item.id}}">
-              <!-- <image class="hide_image" src="{{item.status==='NORMAL'? '../../static/index/hide_icon.png': '../../static/index/show_icon.png'}}" /> -->
-              <image class="hide_image" src="{{item.status==='NORMAL'? '../../static/index/unlock.png': '../../static/index/lock.png'}}" />
-
-              <text class="hide_text" >{{item.status==='NORMAL'? '公开': '仅自己可见'}}</text>
-            </view>
-          </view>
       </view>
-      <view class="video_place" wx:if="{{!item.videoShow}}" catchtap="{{item.ifCheck ? null : 'showVideo'}}" data-index="{{index}}" >
-        <image class="place_img" src="{{item.coverImg}}" />
-        <image class="play_btn" src="../../static/image/play-btn.png" />
-        <view class="video_item_dialog" wx:if="{{item.ifCheck}}">
-        <image class="video_item_dialog_img" src="../../static/index/checking.png" mode="aspectFit|aspectFill|widthFix" />
+      <!-- <view wx:if="{{!item.showMyBtn}}" class="time">
+        <text>发布时间:{{item.time}}</text>
+      </view> -->
+      <view wx:if="{{!item.showMyBtn}}" class="time">
+        <text>发布时间:{{item.time}}</text>
       </view>
+      <view wx:if="{{item.showMyBtn && !item.ifCheck}}" class="my_btn">
+        <view class="delete" catchtap="download" data-url="{{item.markPath ? item.markPath : '' }}" data-id="{{item.id}}">
+          <image class="download_image" src="../../static/index/down.png" />
+          <text class="delete_text">下载</text>
+        </view>
+        <view class="delete" catchtap="delete" data-id="{{item.id}}">
+          <image class="delete_image" src="../../static/index/delete.png" />
+          <text class="delete_text">删除</text>
+        </view>
+        <view class="hide" catchtap="hide" wx:if="{{!item.activity}}" data-status="{{item.status}}" data-id="{{item.id}}">
+          <!-- <image class="hide_image" src="{{item.status==='NORMAL'? '../../static/index/hide_icon.png': '../../static/index/show_icon.png'}}" /> -->
+          <image class="hide_image" src="{{item.status==='NORMAL'? '../../static/index/unlock.png': '../../static/index/lock.png'}}" />
+          <text class="hide_text">{{item.status==='NORMAL'? '公开': '私密'}}</text>
+        </view>
       </view>
-      <video 
-        wx:if="{{item.videoShow}}"
-        id="video_{{index}}" 
-        class="video_item" 
-        loop="{{loop}}" 
-        show-center-play-btn="{{!item.ifCheck ? true : false}}"
-        controls="{{!item.ifCheck ? true : false}}"
-        src="{{item.url ? item.url : '' }}" 
-        autoplay="{{true}}"
-        object-fit="contain"
-        data-index="{{index}}"
-        data-id="{{item.id}}"
-        bindplay="onPlayList"
-        bindended="onEndedList"
-        binderror="onError"
-      >
-        <!-- show-center-play-btn="{{!item.ifCheck ? true : false}}" -->
-        <!-- show-center-play-btn="{{!item.ifCheck ? true : false}}" -->
-        <!-- show-center-play-btn="{{!item.ifCheck ? true : false}}" -->
-      <!--   bindplay="onPlay"
+      <!-- <view wx:if="{{item.showMyBtn && !item.ifCheck}}" class="my_btn">
+        <view class="delete" catchtap="delete" data-id="{{item.id}}">
+          <image class="delete_image" src="../../static/index/delete.png" />
+          <text class="delete_text">删除</text>
+        </view>
+        <view class="hide" catchtap="hide" data-status="{{item.status}}" data-id="{{item.id}}">
+          <image class="hide_image" src="{{item.status==='NORMAL'? '../../static/index/unlock.png': '../../static/index/lock.png'}}" />
+          <text class="hide_text">{{item.status==='NORMAL'? '公开': '仅自己可见'}}</text>
+        </view>
+      </view> -->
+    </view>
+    <view class="video_place" wx:if="{{!item.videoShow}}" catchtap="{{item.ifCheck ? null : 'showVideo'}}" data-index="{{index}}">
+      <image class="place_img" src="{{item.coverImg}}" />
+      <image class="play_btn" src="../../static/image/play-btn.png" />
+      <image class="activity_tigs" wx:if="{{item.activity}}" src="http://reader-wx.ai160.com/images/reader/activity/activity1.png" />
+      <view class="video_item_dialog" wx:if="{{item.ifCheck}}">
+        <image class="video_item_dialog_img" src="../../static/index/checking.png" mode="aspectFit|aspectFill|widthFix" />
+      </view>
+    </view>
+    <video wx:if="{{item.videoShow}}" id="video_{{index}}" class="video_item" loop="{{loop}}" show-center-play-btn="{{!item.ifCheck ? true : false}}" controls="{{!item.ifCheck ? true : false}}" src="{{item.url ? item.url : '' }}" autoplay="{{true}}" object-fit="contain" data-index="{{index}}" data-id="{{item.id}}" bindplay="onPlayList" bindended="onEndedList" binderror="onError">
+      <!-- show-center-play-btn="{{!item.ifCheck ? true : false}}" -->
+      <!-- show-center-play-btn="{{!item.ifCheck ? true : false}}" -->
+      <!-- show-center-play-btn="{{!item.ifCheck ? true : false}}" -->
+      <!-- bindplay="onPlay"
         bindpause="onPause"
         bindended="onEnded"
         binderror="onError"
@@ -169,46 +133,50 @@
         bindwaiting="onWaiting"
         bindprogress="onProgress"
         bindloadedmetadata="onLoadedMetaData" -->
-      </video>
-        
-      <view class="video_title">
-        <text>
-          {{item.title}}
-        </text>
-          
+    </video>
+    <view class="video_title">
+      <text>{{item.title}}</text>
+    </view>
+    <view class="foot_box" wx:if="{{!item.ifCheck}}">
+      <view class="foot_left">
+        <view class="video_btn collect_btn" catchtap="collectTap" data-index="{{index}}" data-id="{{item.id}}" data-type="{{item.type}}">
+          <image class="collect_btn_icon" src="{{item.isFavorite ? '../../static/index/star_colored.png' : '../../static/index/star.png'}}" />
+          <text>{{item.favoritesAmount === 0 ? '收藏' : item.favoritesAmount}}</text>
+        </view>
+        <view class="video_btn share_btn" bindtap="openShare" data-author="{{item.nickName}}" data-index="{{index}}" data-id="{{item.id}}" data-avatar="{{item.avatar}}" data-uid="{{item.uid}}" data-img="{{item.img}}" data-title="{{item.title}}" data-shareimg="{{item.shareImg}}" data-grade="{{item.grade}}" data-type="{{item.type}}" data-activity="{{item.activity}}">
+          <image class="share_btn_icon" src="../../static/index/share.png" />
+          <text>{{item.shareAmount === 0 ? '分享' : item.shareAmount}}</text>
+        </view>
+        <!-- <button class="video_btn share_btn" open-type="share" bindtap="openShare" data-author="{{item.nickName}}" data-index="{{index}}" data-id="{{item.id}}" data-avatar="{{item.avatar}}" data-uid="{{item.uid}}" data-img="{{item.img}}" data-title="{{item.title}}" data-shareimg="{{item.shareImg}}" data-grade="{{item.grade}}" data-type="{{item.type}}">
+   <image class="share_btn_icon" src="../../static/index/share.png"></image>
+   <text>分享</text>
+ </button> -->
       </view>
-        
-      <view class="foot_box" wx:if="{{!item.ifCheck}}"> 
-        <view class="foot_left">
-          <view class="video_btn collect_btn" catchtap="collectTap" data-index="{{index}}" data-id="{{item.id}}" data-type="{{item.type}}">
-              <image class="collect_btn_icon" src="{{item.isFavorite ? '../../static/index/star_colored.png' : '../../static/index/star.png'}}" />
-              <text>收藏</text>
-          </view>
-          <view class="video_btn share_btn" bindtap="openShare" data-author="{{item.nickName}}"  data-index="{{index}}" data-id="{{item.id}}" data-avatar="{{item.avatar}}" data-uid="{{item.uid}}" data-img="{{item.img}}" data-title="{{item.title}}" data-shareimg="{{item.shareImg}}" data-grade="{{item.grade}}" data-type="{{item.type}}">
-              <image class="share_btn_icon" src="../../static/index/share.png" />
-              <text>分享</text>
+      <view class="foot_right">
+        <view class="video_btn flower_btn" catchtap="{{item.isLike ?  null : 'likeTap'}}" data-index="{{index}}" data-id="{{item.id}}" data-islike="{{item.isLike}}">
+          <view class="animation-flower {{addComeOut === index ? 'add-one-come-out' : ''}}">
+            <image class="animation-flower-icon" src="{{item.activity ? '../../static/activity/popularity1.png' : '../../static/image/flower_small.png'}}" />
+            <text>+1</text>
           </view>
+          <image class="flower_btn_icon" src="{{item.isLike ? '../../static/index/heart_colored.png' : '../../static/index/heart.png'}}" />
+          <text>{{item.likes === 0 ? '点赞' : item.likes}}</text>
         </view>
-          <view class="foot_right">
-          <view class="video_btn flower_btn" catchtap="{{item.isLike ?  null : 'likeTap'}}" data-index="{{index}}" data-id="{{item.id}}" data-islike="{{item.isLike}}">
-              <image class="flower_btn_icon" src="{{item.isLike ? '../../static/index/heart_colored.png' : '../../static/index/heart.png'}}" />
-              <text>{{item.likes}}</text>
-          </view>
-          <view class="video_btn comment_btn" catchtap="openComment" data-id="{{item.id}}">
-              <image class="comment_btn_icon" src="../../static/index/comment.png" lazy-load="true" />
-              <text>{{item.commentAmount || 0}}</text>
-          </view>
+        <view class="video_btn comment_btn" catchtap="openComment" data-id="{{item.id}}" data-index="{{index}}">
+          <image class="comment_btn_icon" src="../../static/index/comment.png" lazy-load="true" />
+          <text>{{item.commentAmount === 0 ?'评论' : item.commentAmount}}</text>
         </view>
-            
       </view>
-      <view class="btn_wrapper" wx:if="{{!item.noReading && !item.ifCheck}}" catchtap="goToReading" data-id="{{item.classId}}">
-        <view class="reading_btn">
-          <image src="../../static/index/microphone.png" />
-          <text>我要配音</text>
-        </view>
+    </view>
+    <view class="btn_wrapper" wx:if="{{!item.noReading && !item.ifCheck}}" catchtap="goToReading" data-id="{{item.classId}}">
+      <view class="reading_btn">
+        <image src="../../static/index/microphone.png" />
+        <text>我要配音</text>
       </view>
     </view>
+  </view>
+  <view class="no_work" wx:if="{{!isSwiper && noMoreWork}}">
+    <text class="no_work_text">已经到底啦!</text>
+  </view>
 </view>
-
-<shareDialog id="share-dialog" shareType='works' bindShareDialogClose="shareDialogClose" shareId="{{id}}" />
-
+<flowerBox id="flower-toast" flowerNum="{{flowerNum}}" />
+<shareDialog id="share-dialog" shareType='works' bindShareDialogClose="shareDialogClose" bindaddShareAmount="addShareAmount" shareId="{{id}}" />

+ 79 - 10
component/video-swiper/index.wxss

@@ -1,3 +1,14 @@
+@keyframes numberMove {
+  from {
+    bottom: 20rpx;
+    opacity: 1;
+  }
+  to {
+    bottom: 200rpx;
+    font-size: 50rpx;
+    opacity: 0;
+  }
+}
 .swiper_container {
   width: 100%;
   height: 100%;
@@ -15,6 +26,7 @@
   margin-bottom: 20rpx;
   padding-bottom: 20rpx;
   overflow: hidden;
+  position: relative;
 }
 .swiper_container .swiper_item.no_swiper {
   max-height: 879rpx;
@@ -38,12 +50,11 @@
   top: 0;
 }
 .swiper_container .swiper_item .head_box .user_box {
-  width: 360rpx;
+  width: 378rpx;
   height: 100%;
   display: flex;
   align-items: center;
   position: relative;
-  overflow: hidden;
 }
 .swiper_container .swiper_item .head_box .user_box .avatar {
   width: 80rpx;
@@ -83,20 +94,20 @@
   display: flex;
   align-items: center;
 }
-.swiper_container .swiper_item .head_box .my_btn .delete .download_image {
-  width: 29rpx;
-  height: 33rpx;
-  margin-bottom: 2rpx;
-}
 .swiper_container .swiper_item .head_box .my_btn .delete {
   display: flex;
   flex-direction: column;
   align-items: center;
   margin-right: 45rpx;
 }
+.swiper_container .swiper_item .head_box .my_btn .delete .download_image {
+  width: 29rpx;
+  height: 32rpx;
+  margin-bottom: 2rpx;
+}
 .swiper_container .swiper_item .head_box .my_btn .delete .delete_image {
   width: 25rpx;
-  height: 33rpx;
+  height: 32rpx;
   margin-bottom: 2rpx;
 }
 .swiper_container .swiper_item .head_box .my_btn .delete .delete_text {
@@ -108,13 +119,12 @@
   flex-direction: column;
   align-items: center;
   margin-right: 23rpx;
-  padding-top: 3rpx;
   box-sizing: border-box;
 }
 .swiper_container .swiper_item .head_box .my_btn .hide .hide_image {
   width: 32rpx;
   height: 33rpx;
-  margin-bottom: 2rpx;
+  margin-bottom: 1rpx;
 }
 .swiper_container .swiper_item .head_box .my_btn .hide .hide_text {
   font-size: 26rpx;
@@ -142,6 +152,13 @@
   right: 0;
   margin: 0 auto;
 }
+.swiper_container .swiper_item .video_place .activity_tigs {
+  position: absolute;
+  bottom: 0;
+  left: 0;
+  width: 100%;
+  height: 49rpx;
+}
 .swiper_container .swiper_item .video_place .place_img {
   width: 100%;
   height: 100%;
@@ -182,6 +199,7 @@
 .swiper_container .swiper_item .foot_box .foot_right {
   display: flex;
   align-items: center;
+  position: relative;
 }
 .swiper_container .swiper_item .foot_box .video_btn {
   margin-right: 42rpx;
@@ -191,6 +209,41 @@
   flex-direction: row;
   align-items: center;
 }
+.swiper_container .swiper_item .foot_box .video_btn .animation-flower {
+  width: 90rpx;
+  height: 40rpx;
+  position: absolute;
+  left: 17rpx;
+  bottom: 24rpx;
+  opacity: 0;
+  display: flex;
+  align-items: center;
+  flex-direction: row;
+  justify-content: center;
+}
+.swiper_container .swiper_item .foot_box .video_btn .animation-flower .animation-flower-icon {
+  width: 32rpx;
+  height: 38rpx;
+  display: block;
+  margin-right: 8rpx;
+}
+.swiper_container .swiper_item .foot_box .video_btn .animation-flower text {
+  margin-top: -15rpx;
+  display: block;
+  font-size: 26rpx;
+  font-weight: 800;
+  color: #fc3b3b;
+}
+.swiper_container .swiper_item .foot_box .video_btn .add-one-come-out {
+  animation: numberMove 1.2s ease;
+  -webkit-animation: numberMove 1.2s ease;
+}
+.swiper_container .swiper_item .foot_box .video_btn.share_btn {
+  outline: none;
+  padding: 0;
+  margin: 0;
+  background: #fff;
+}
 .swiper_container .swiper_item .foot_box .video_btn .collect_btn_icon {
   width: 48rpx;
   height: 46rpx;
@@ -200,6 +253,11 @@
   width: 46rpx;
   height: 46rpx;
   margin-right: 8rpx;
+  outline: none;
+  padding: 0;
+  margin: 0;
+  border-radius: 0;
+  background: #fff;
 }
 .swiper_container .swiper_item .foot_box .video_btn .flower_btn_icon {
   width: 46rpx;
@@ -242,3 +300,14 @@
   color: #fff;
   font-size: 30rpx;
 }
+.swiper_container .no_work {
+  width: 100%;
+  height: 120rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+.swiper_container .no_work .no_work_text {
+  color: #373737;
+  font-size: 30rpx;
+}

+ 432 - 0
pages/activity/index/index.js

@@ -0,0 +1,432 @@
+// pages/activity/index/index.js
+import httpRequestApi from '../../../utils/APIClient';
+import {
+  formatDate
+} from '../../../utils/util';
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    activityReadData: [],
+    selectInd: 0,
+    selectBg: ['../../../static/activity/right.png', '../../../static/activity/left.png'],
+    activityMyReadData: [],
+    nextMargin: '400rpx', // 视频下边距
+    isSwiper: false,
+    noMoreWork: false,
+    hotAmountTopData: [],
+    sortImg: ['../../../static/activity/1.png', '../../../static/activity/2.png' , '../../../static/activity/3.png'],
+    grades: '',
+    gradeObj: {
+      "PRIMARY_FIRST_GRADE": "一年级",
+      "PRIMARY_SECOND_GRADE": "二年级",
+      "PRIMARY_THREE_GRADE": "三年级",
+      "PRIMARY_SENIOR_GRADE": "四年级"
+    },
+    myHotAmountData: {},
+    commentShow: false,
+    commentList: [],
+    commentNum: 0,
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    // 接口调用
+    const grade = wx.getStorageSync('grade')
+    this.setData({
+      grades: this.data.gradeObj[grade]
+    })
+    httpRequestApi.getActivityRead(grade).success(res => {
+      if (res.data.code === 200) {
+        const activityReadData = [...res.data.data]
+        this.setData({
+          activityReadData
+        })
+      }
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    /**
+     * 获取排名信息
+     */
+    httpRequestApi.getHotAmountTop().success(res => {
+      if (res.data.code === 200) {
+        const hotAmountTopData = [...res.data.data]
+        this.setData({
+          hotAmountTopData
+        })
+      }
+    })
+      /**
+     * 获取我的排名信息
+     */
+    httpRequestApi.getMyHotAmount().success(res => {
+      if (res.data.code === 200) {
+        // console.log(res)
+        const myHotAmountData = res.data.data
+        this.setData({
+          myHotAmountData
+        })
+      }
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+  /**
+   * 下拉
+   */
+  onPullDownRefresh: function () {
+     wx.showNavigationBarLoading() //在标题栏中显示加载
+     /**
+     * 获取排名信息
+     */
+    httpRequestApi.getHotAmountTop().success(res => {
+      if (res.data.code === 200) {
+        const hotAmountTopData = [...res.data.data]
+        this.setData({
+          hotAmountTopData
+        })
+        wx.hideNavigationBarLoading() //完成停止加载
+        wx.stopPullDownRefresh() //停止下拉刷新
+      }
+    })
+      /**
+     * 获取我的排名信息
+     */
+    httpRequestApi.getMyHotAmount().success(res => {
+      if (res.data.code === 200) {
+        // console.log(res)
+        const myHotAmountData = res.data.data
+        this.setData({
+          myHotAmountData
+        })
+      }
+    })
+  },
+  /**
+   *
+   * @param {*} res
+   * 分享
+   */
+  onShareAppMessage: function (res) {
+    console.log('onShareAppMessage>>>>>>>>>>>>')
+    if (res.from === 'button') {
+      return {
+        title: '请欣赏我的课文朗读作品,点赞+评论。',
+        path: `/pages/index/index?readId=${this.data.shareId}&activity=true`,
+        imageUrl: this.data.shareImg
+      }
+    } else {
+      return {
+        title: '课文朗读,从未如此有趣。',
+        path: '/pages/index/index',
+      }
+    }
+  },
+  /**
+   * 活动页点击切换
+   */
+  tabSelect({
+    currentTarget
+  }) {
+    const selectInd = currentTarget.dataset.index * 1
+    if (selectInd === this.data.selectInd) return;
+    this.setData({
+      selectInd
+    });
+    if (selectInd === 1) {
+        this.getMyRead();
+    }
+  },
+  /**
+   * 去比赛
+   */
+  goToReading({
+    currentTarget
+  }) {
+    const id = currentTarget.dataset.id
+    wx.navigateTo({
+      url: `../../reading/reading?id=${id}`
+    });
+  },
+  /**
+   * 修改list列表
+   * @param {*} 列表
+   */
+  formatWorksList(list) {
+    this.data.activityMyReadData = [];
+    list.forEach((item) => {
+      const temp = {};
+      temp.title = item.userRead.title;
+      temp.summary = item.userRead.summary;
+      temp.img = item.userRead.iconImg;
+      temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
+      temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
+      temp.commentAmount = item.userRead.commentAmount ? item.userRead.commentAmount : 0;
+      temp.shareAmount = item.userRead.shareAmount;
+      temp.favoritesAmount = item.userRead.favoritesAmount;
+      temp.classId = item.userRead.exampleId ? item.userRead.exampleId : 1605097720036046;
+      temp.time = formatDate(item.userRead.gmtCreated, 3);
+      temp.avatar = item.user.avatar;
+      temp.profession = item.user.profession;
+      temp.uid = item.user.uid;
+      temp.markPath = item.userRead.markPath ? item.userRead.markPath : item.userRead.videoPath;
+      temp.url = item.userRead.videoPath ? item.userRead.videoPath : item.userRead.originVideo;
+      temp.id = item.userRead.id;
+      temp.type = item.userRead.type;
+      temp.nickName = item.user.wechatName;
+      temp.isLike = item.isLike;
+      temp.isFavorite = item.isFavorites;
+      temp.showMyBtn = true;
+      temp.nickName = item.user.wechatName;
+      temp.status = item.userRead.status;
+      temp.ifCheck = item.userRead.status === 'CHECK' ? true : false;
+      temp.coverImg = item.userRead.coverImg;
+      temp.grade = item.userRead.grade
+      temp.isFans = true;
+      temp.videoShow = false;
+      temp.shareImg = item.userRead.shareImg;
+      temp.activity = true;
+      temp.noReading = true;
+      this.data.activityMyReadData.push(temp);
+      // tempList.push(temp);
+    });
+    // if (!notSet) {
+    this.setData({
+      activityMyReadData: this.data.activityMyReadData
+    })
+    // }
+
+  },
+  /**
+   * 获取我的朗读
+   */
+  getMyRead() {
+    httpRequestApi.getActivityMyRead().success(res => {
+      if (res.data.code === 200) {
+        const recommendRes = res.data.data;
+        this.formatWorksList(recommendRes);
+      }
+    })
+  },
+  /**
+   * 点击删除按钮
+  */
+ delHideMyWork() {
+    this.getMyRead()
+  },
+  /**
+   * 点击收藏按钮
+   */
+  collectTap(e) {
+    const index = e.detail.index;
+    let str = `activityMyReadData[${index}].isFavorite`;
+    let str2 = `activityMyReadData[${index}].favoritesAmount`;
+    let favoritesAmount = e.detail.isCollect ? this.data.activityMyReadData[index].favoritesAmount + 1 : this.data.activityMyReadData[index].favoritesAmount - 1
+    this.setData({
+      [str]: e.detail.isCollect,
+      [str2]: favoritesAmount
+    })
+  },
+  /**
+   * 点赞执行事件
+   */
+  likeTap(e) {
+    const index = e.detail.index;
+    let likeStr = `activityMyReadData[${index}].isLike`;
+    let likeNumStr = `activityMyReadData[${index}].likes`;
+    this.setData({
+      [likeStr]: true,
+      [likeNumStr]: this.data.activityMyReadData[index].likes + 1
+    })
+    // this.flowerAnimationHandler()
+  },
+  /**
+   * 打开评论
+   */
+  openComment: function (e) {
+    //
+    this.setData({
+      commentShow: !this.data.commentShow,
+      commentId: e.detail.activeId,
+      commentIndex: e.detail.activeIndex
+    });
+  },
+  /**
+   * 评论区点击
+   */
+  commentTap: function (e) {
+    console.log('点击评论区', e)
+    if (e.target.dataset.type === 'blank') {
+      if (this.data.commentShow && this.data.commentId) {
+        httpRequestApi.getClassDetail(this.data.commentId).success(res => {
+          console.log('评论回显', res.data.data.userRead.commentAmount)
+          let str = `activityMyReadData[${this.data.commentIndex}].commentAmount`;
+          this.setData({
+            [str]: res.data.data.userRead.commentAmount
+          })
+        })
+      }
+      this.setData({
+        commentShow: false
+      })
+    }
+  },
+  /**
+   * 获取评论信息
+   */
+  getReply: function (columnId) {
+    // let columnId = this.data.id;
+    console.log(123123123, columnId)
+    // let pageNo = this.data.pageNo;
+    // let pageSize = this.data.pageSize;
+    httpRequestApi.getReply(this.uid, columnId, 1, 10).success((res) => {
+      console.log('reply', res)
+      const commentList = res.data.data.list;
+      const commentNum = res.data.data.totalSize;
+      console.log('评论数量', commentNum)
+      commentList.forEach((item) => {
+        const temp = {};
+        temp.nickName = item.user.wechatName;
+        temp.avatar = item.user.avatar;
+        temp.uid = item.user.uid;
+        temp.text = item.detailDesc;
+        temp.id = item.id;
+        temp.replyCount = item.replyCount;
+        temp.time = formatDate(item.gmtCreated, 3);
+        temp.likes = item.postsAttributeInfo.favors || 0;
+        temp.isLike = item.isLike;
+        temp.replyList = item.replyVOList;
+        this.data.commentList.push(temp);
+      });
+      this.setData({
+        commentList: this.data.commentList,
+        commentNum: commentNum
+      })
+    });
+  },
+  /**
+   * 发布回复
+   */
+  sendReply: function (e) {
+    console.log('triger', e.detail.content);
+    let data = {
+      columnId: this.data.commentId,
+      colunmNames: 'what',
+      detailDesc: e.detail.content,
+      // productId: this.data.productId
+    }
+    httpRequestApi.postReply(this.uid, data).success(res => {
+      console.log(res)
+      this.setData({
+        pageNo: 1,
+        commentList: []
+      }, () => {
+        this.getReply(this.data.commentId);
+      })
+    });
+  },
+  /**
+   * 点击分享
+   */
+  openShare(e) {
+    this.setData({
+      shareTitle: e.detail.currentTarget.dataset.title,
+      shareId: e.detail.currentTarget.dataset.id,
+      shareImg: e.detail.currentTarget.dataset.shareimg,
+      goToShare: true
+    })
+  },
+  /**
+   * 点击活动
+   */
+  rule() {
+    wx.navigateTo({
+      url: `../rule/rule`
+    });
+  },
+  /**
+   * 点击攻略
+   */
+  strategy() {
+    wx.navigateTo({
+      url: `../strategy/strategy`
+    });
+  },
+  /**
+   * 点击头像
+   */
+  headTap (e) {
+      if (!wx.getStorageSync('user').wechatName) {
+          wx.navigateTo({
+              url: `../../pages/login/login`
+          });
+          return;
+      }
+      let uid = e.target.dataset.uid ? e.target.dataset.uid : e.currentTarget.dataset.uid;
+      // this.trigger(e, 'headTap')
+      console.log('点击头像', e)
+      wx.navigateTo({
+          url: `../../pages/myworks/myworks?uid=${uid}`,
+          fail: (err) => {
+              console.log('跳转错误', err)
+              wx.navigateTo({
+                  url: `../../../pages/myworks/myworks?uid=${uid}`
+              });
+          }
+      });
+
+  },
+  /**
+   * 点击关注
+   */
+  follow(e) {
+    const followUid = e.target.dataset.uid ? e.target.dataset.uid : e.currentTarget.dataset.uid;
+    const uid = wx.getStorageSync('uid');
+    httpRequestApi.followUser(uid, followUid).success((res) => {
+        // this.setData({
+        //   isFans: true
+        // })
+        wx.showToast({
+          title: '关注啦',
+          icon: 'success',
+          duration: 1000
+        })
+    });
+    httpRequestApi.getHotAmountTop().success(res => {
+        if (res.data.code === 200) {
+          const hotAmountTopData = [...res.data.data]
+          this.setData({
+            hotAmountTopData
+          })
+        }
+      })
+    }
+})

+ 6 - 0
pages/activity/index/index.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {
+    "VideoSwiper": "../../component/video-swiper/index",
+    "Comment": "../../component/comment/comment"
+  }
+}

+ 111 - 0
pages/activity/index/index.wxml

@@ -0,0 +1,111 @@
+<!--pages/activity/index/index.wxml-->
+<view class="activity-index">
+  <image class="activity-bg" src="http://reader-wx.ai160.com/images/reader/activity/bg.jpg" mode="scaleToFill"></image>
+  <view class="rule" bindtap="rule">
+    <image src="../../../static/activity/rule-img.png"></image>
+  </view>
+  <view class="strategy" bindtap="strategy">
+    <image src="../../../static/activity/strategy-img.png"></image>
+  </view>
+  <view class="activity-works">
+    <image class="swiper-bg" src="http://reader-wx.ai160.com/images/reader/activity/swiper-bg.png" mode="scaleToFill"></image>
+    <text class="gradeText">{{grades}}朗读范文素材</text>
+    <view class="activity-works-swiper">
+      <swiper indicator-dots="true" autoplay="false" circular="true" previous-margin="66rpx" next-margin="56rpx" indicator-color="#BABABA" indicator-active-color="#fff">
+        <block wx:for="{{activityReadData}}" wx:key="*this">
+          <swiper-item>
+            <view class="swiper-item-view" bindtap="goToReading" data-id="{{item.id}}">
+              <image src="{{item.iconImg}}" mode="scaleToFill"></image>
+            </view>
+          </swiper-item>
+        </block>
+      </swiper>
+    </view>
+  </view>
+  <view class="activity-ranking">
+    <view class="activity-ranking-tab">
+      <image class="tab-bg" src="../../../static/activity/tab-bg.png" mode="scaleToFill"></image>
+      <image  class="select-bg {{selectInd === 0 ? 'left' : 'right'}}" src="{{selectBg[selectInd]}}" mode="scaleToFill"></image>
+      <text class="left {{selectInd === 0 && 'select'}}" data-index="0" bindtap="tabSelect">TOP100人气榜单</text>
+      <text class="right {{selectInd === 1 && 'select'}}" data-index="1" bindtap="tabSelect">我的参赛作品</text>
+    </view>
+    <view class="activity-ranking-container" style="background: #fff;" hidden="{{selectInd === 1}}">
+      <view class="activity-ranking-title">
+        <text>排名</text>
+        <text>名称</text>
+        <text>人气值</text>
+      </view>
+      <view class="scroll-view" style="{{myHotAmountData.activityJoinUser ? 'margin-bottom: 150rpx;' : ''}}">
+        <view class="scroll-view-item" wx:for="{{hotAmountTopData}}" wx:for-index="index" wx:key="*this">
+          <image wx:if="{{sortImg[index]}}" class="ranking-number-img" src="{{sortImg[index]}}"></image>
+          <text wx:else class="ranking-number">{{index + 1}}</text>
+          <view class="ranking-message">
+            <view class="reanking-message-head">
+              <image class="haed-url" bindtap="headTap" src="{{item.user.avatar}}" data-uid="{{item.user.uid}}"></image>
+              <image class="follow-url" src="{{item.isFans ? '' : '../../../static/activity/follow.png'}}" bindtap="{{!item.isFans && 'follow'}}" data-uid="{{item.user.uid}}" data-fans="{{item.isFans}}"></image>
+            </view>
+            <view class="reanking-message-name">
+              <text>{{item.user.wechatName}}</text>
+              <view class="operation">
+                <view class="forward">
+                  <image src="../../../static/activity/forward1.png"></image>
+                  {{item.activityJoinUser.shareAmount}}
+                </view>
+                <view class="like">
+                  <image src="../../../static/activity/like1.png"></image>
+                  {{item.activityJoinUser.likeAmount}}
+                </view>
+                <view class="comment">
+                  <image src="../../../static/activity/comment1.png"></image>
+                  {{item.activityJoinUser.commentAmount}}
+                </view>
+              </view>
+            </view>
+          </view>
+          <view class="popularity">
+            <image src="../../../static/activity/popularity1.png"></image>
+            {{item.activityJoinUser.hotAmount}}
+          </view>
+        </view>
+      </view>
+    </view>
+    <view class="activity-my-ranking" hidden="{{selectInd === 1 || !myHotAmountData.activityJoinUser}}">
+        <text class="ranking-number" style="color: #fff;">{{myHotAmountData.activityJoinUser.order}}</text>
+        <view class="ranking-message">
+          <view class="reanking-message-head">
+            <image class="haed-url" src="{{myHotAmountData.user.avatar}}"></image>
+          </view>
+          <view class="reanking-message-name" style="color: #fff;">
+            <text style="color: #fff;">{{myHotAmountData.user.wechatName}}</text>
+            <view class="operation" style="color: #fff;">
+                <view class="forward">
+                  <image src="../../../static/activity/forward.png"></image>
+                  {{myHotAmountData.activityJoinUser.shareAmount}}
+                </view>
+                <view class="like">
+                  <image src="../../../static/activity/like.png"></image>
+                  {{myHotAmountData.activityJoinUser.likeAmount}}
+                </view>
+                <view class="comment">
+                  <image src="../../../static/activity/comment.png"></image>
+                  {{myHotAmountData.activityJoinUser.commentAmount}}
+                </view>
+            </view>
+          </view>
+        </view>
+        <view class="popularity" style="color: #fff;">
+          <image src="../../../static/activity/popularity.png"></image>
+          {{myHotAmountData.activityJoinUser.hotAmount}}
+        </view>
+    </view>
+    <view class="my-activity-read" hidden="{{selectInd === 0}}">
+      <VideoSwiper wx:if="{{activityMyReadData.length > 0}}" class="video-swiper" video-list="{{activityMyReadData}}" nextMargin="{{nextMargin}}" isSwiper="{{isSwiper}}" noMoreWork="{{noMoreWork}}" ifHeadTap="{{true}}" binddelHideMyWork="delHideMyWork" bindcollectTap="collectTap" bindlikeTap="likeTap" bindopenComment="openComment" bindopenShare="openShare"/>
+      <image class="no_works" wx:if="{{activityMyReadData.length === 0}}" src="http://reader-wx.ai160.com/images/reader/activity/no_works.png"/>
+    </view>
+    <view class="comment_section" catchtap="commentTap" data-type="blank" wx:if="{{commentShow}}">
+      <Comment data-type="list" commentId="{{commentId}}" commentNum="{{commentNum}}" inputValue="{{inputValue}}" bindsendReply="sendReply" />
+    </view>
+  </view>
+
+</view>
+<canvas canvas-id="myCanvas" style="width:300px; height: 525px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>

+ 247 - 0
pages/activity/index/index.wxss

@@ -0,0 +1,247 @@
+/* pages/activity/index/index.wxss */
+.activity-index {
+  position: relative;
+  width: 100%;
+  height: 100%;
+  box-sizing: border-box;
+  overflow: scroll;
+  background: #FD423B;
+}
+.activity-bg {
+  width: 100%;
+  height: 440rpx;
+}
+.rule {
+  position: absolute;
+  top: 32rpx;
+  right: 0;
+  width: 191rpx;
+  height: 60rpx;
+}
+.rule image {
+  width: 100%;
+  height: 100%;
+}
+.strategy {
+  position: fixed;
+  top: 241rpx;
+  right: 0;
+  width: 205rpx;
+  height: 155rpx;
+  z-index: 99;
+}
+.strategy image {
+  width: 100%;
+  height: 100%;
+}
+.activity-works {
+  position: relative;
+  width: 100%;
+  height: 484rpx;
+  overflow: hidden;
+  margin-top: -44rpx;
+}
+.gradeText {
+  position: absolute;
+  left: 50%;
+  top: 30rpx;
+  transform: translateX(-50%);
+  font-size: 34rpx;
+  color: #9B4716;
+  font-weight: 600;
+}
+.swiper-bg {
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+}
+.activity-works-swiper {
+  width: 720rpx;
+  margin: 200rpx auto 0 auto;
+}
+.activity-works-swiper  swiper {
+  width: 100%;
+  height: 237rpx;
+}
+.swiper-item-view {
+  width: 583rpx;
+  height: 237rpx;
+  border-radius: 12rpx;
+  overflow: hidden;
+}
+.swiper-item-view image {
+  width: 100%;
+  height: 100%;
+}
+.activity-ranking {
+  position: relative;
+  width: 100%;
+  margin-top: 60rpx;
+}
+.activity-ranking-tab {
+  position: relative;
+  display: flex;
+  justify-content: space-between;
+  height: 88rpx;
+}
+.tab-bg {
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+}
+.activity-ranking-tab text {
+  position: absolute;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  width: 50%;
+  height: 100%;
+  color: #fff;
+  font-size: 38rpx;
+  z-index: 2;
+}
+.activity-ranking-tab .left {
+  left: 0;
+}
+.activity-ranking-tab .right {
+  right: 0;
+}
+.select-bg {
+  position: absolute;
+  top: -23%;
+  width: 50%;
+  height: 110rpx;
+  z-index: 1;
+}
+.activity-ranking-tab .select {
+  color: #FD423B;
+}
+.activity-ranking-title {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 21rpx 32rpx;
+  color: #D52822;
+  font-size: 38rpx;
+  background: #fff;
+  box-sizing: border-box;
+  font-weight: 600;
+}
+.scroll-view-item,
+.activity-my-ranking {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  width: 100%;
+  height: 150rpx;
+  background: #fff;
+  border-bottom: 2rpx solid #fff;
+  padding: 0 50rpx;
+  box-sizing: border-box;
+}
+.scroll-view-item .ranking-number-img {
+  width: 44rpx;
+  height: 52rpx;
+}
+.scroll-view-item .ranking-number,
+.activity-my-ranking .ranking-number {
+  width: 44rpx;
+  height: 52rpx;
+  text-align: center;
+  line-height: 52rpx;
+  font-size: 38rpx;
+  color: #666;
+}
+.scroll-view-item  .ranking-message,
+.activity-my-ranking  .ranking-message{
+  display: flex;
+  width: 420rpx;
+}
+.scroll-view-item  .ranking-message .reanking-message-head,
+.activity-my-ranking  .ranking-message .reanking-message-head {
+  position: relative;
+  width: 80rpx;
+  height: 80rpx;
+  margin-right: 30rpx;
+}
+.reanking-message-head .haed-url{
+  width: 80rpx;
+  height: 80rpx;
+  border-radius: 50%;
+}
+.reanking-message-head .follow-url {
+  position: absolute;
+  bottom: -10rpx;
+  left: 50%;
+  width: 34rpx;
+  height: 34rpx;
+  transform: translateX(-50%);
+}
+.reanking-message-name {
+  display: flex;
+  flex-direction: column;
+}
+.reanking-message-name text{
+  width: 306rpx;
+  height: 50rpx;
+  font-size: 34rpx;
+  color: #333;
+  overflow: hidden;
+}
+.operation {
+  display: flex;
+  color: #999;
+  font-size: 22rpx;
+}
+.operation .like {
+  margin: 0 23rpx 0 23rpx;
+}
+.operation image{
+  width: 28rpx;
+  height: 24rpx;
+  vertical-align: middle;
+}
+.scroll-view-item .popularity,
+.activity-my-ranking  .popularity {
+  color: #666;
+  font-size: 38rpx;
+  vertical-align: middle;
+  width: 100rpx;
+}
+.popularity image {
+  width: 27rpx;
+  height: 29rpx;
+  vertical-align: middle;
+}
+.activity-my-ranking {
+  position: fixed;
+  left: 0;
+  bottom: 0;
+  background: #FE9E19;
+  z-index: 9;
+}
+.my-activity-read {
+  background: #fff;
+  overflow: hidden;
+}
+.no_works {
+  width: 401rpx;
+  height: 259rpx;
+  margin: 50rpx auto;
+  display: block;
+
+}
+.comment_section {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 98%;
+  z-index: 9999;
+  background: rgba(0, 0, 0, .3);
+  overflow: hidden;
+}

+ 78 - 0
pages/activity/rule/rule.js

@@ -0,0 +1,78 @@
+// pages/activity/rule/rule.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  },
+  /**
+   * 下拉
+   */
+  onPullDownRefresh: function () {
+    wx.stopPullDownRefresh() //停止下拉刷新
+    // wx.showNavigationBarLoading() //在标题栏中显示加载
+    // //模拟加载
+    // setTimeout(function () {
+    //   wx.hideNavigationBarLoading() //完成停止加载
+    //   wx.stopPullDownRefresh() //停止下拉刷新
+    // }, 1000);
+  },
+})

+ 3 - 0
pages/activity/rule/rule.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 4 - 0
pages/activity/rule/rule.wxml

@@ -0,0 +1,4 @@
+<!--pages/activity/rule/rule.wxml-->
+<view class="rule-main">
+  <image class="rule-bg" src="http://reader-wx.ai160.com/images/reader/activity/activit_prize.jpg" />
+</view>

+ 11 - 0
pages/activity/rule/rule.wxss

@@ -0,0 +1,11 @@
+/* pages/activity/rule/rule.wxss */
+.rule-main {
+  width: 100%;
+  height: 100%;
+  overflow-y: scroll;
+}
+.rule-bg {
+  width: 100%;
+  height: 5407rpx;
+  display: block;
+}

+ 78 - 0
pages/activity/strategy/strategy.js

@@ -0,0 +1,78 @@
+// pages/activity/strategy/strategy.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  },
+    /**
+   * 下拉
+   */
+  onPullDownRefresh: function () {
+    wx.stopPullDownRefresh() //停止下拉刷新
+    // wx.showNavigationBarLoading() //在标题栏中显示加载
+    // //模拟加载
+    // setTimeout(function () {
+    //   wx.hideNavigationBarLoading() //完成停止加载
+    //   wx.stopPullDownRefresh() //停止下拉刷新
+    // }, 1000);
+  },
+})

+ 3 - 0
pages/activity/strategy/strategy.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 9 - 0
pages/activity/strategy/strategy.wxml

@@ -0,0 +1,9 @@
+<!--pages/activity/strategy/strategy.wxml-->
+<view class="strategy-main">
+  <image class="strategy-bg" src="http://reader-wx.ai160.com/images/reader/activity/activity_strategy.jpg" />
+      <video
+      class="myVideo"
+      src="http://yfklxt-video.ai160.com/fastStudy/video/20210302001.mp4"
+      autoplay
+    ></video>
+</view>

+ 23 - 0
pages/activity/strategy/strategy.wxss

@@ -0,0 +1,23 @@
+/* pages/activity/strategy/strategy.wxss */
+.strategy-main {
+  width: 100%;
+  height: 100%;
+  background: #FD423B;
+  overflow-y: scroll;
+}
+.strategy-bg {
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 1334rpx;
+}
+.myVideo {
+  position: absolute;
+  left: 50%;
+  top: 273rpx;
+  width: 680rpx;
+  height: 382rpx;
+  transform: translateX(-50%);
+  z-index: 2;
+}

+ 128 - 39
pages/index/index.js

@@ -32,6 +32,9 @@ import {
 Page({
   data: {
     tab: [{
+        name: '我的',
+        templates: 'my',
+      }, {
         name: '推荐',
         templates: 'recommend',
       },
@@ -42,10 +45,6 @@ Page({
       {
         name: '资源',
         templates: 'courses',
-      },
-      {
-        name: '我的',
-        templates: 'my',
       }
     ],
     winH: 568,
@@ -73,7 +72,7 @@ Page({
     commentList: [],
     commentNum: 0,
     followPageNo: 1,
-    followPageSize: 6,
+    followPageSize: 3,
     coursePageNo: 1,
     coursesData: [],
     updateId: 0, // 刷新id
@@ -82,7 +81,9 @@ Page({
       title: "小学语文朗读配音", //标题
     },
     grade: wx.getStorageSync('grade'),
-    upgradeHide: false
+    noMoreWork: false, // 没有更多作品 已经到底了
+    upgradeHide: false,
+    gradeActivity: ''
   },
   jurisdiction: function () {
     //隐藏弹框
@@ -107,9 +108,10 @@ Page({
   },
   // 根据index 更新template
   updateData: function (index) {
-    let myIndex = index;
+    let myIndex = parseInt(index);
     this.setData({
       myIndex,
+      noMoreWork: false
     });
     // 获取推荐列表
     if (myIndex == 0) {
@@ -118,7 +120,10 @@ Page({
         videoList: [],
         isSwiper: false
       }, () => {
-        this.getHotRecommend(this.uid);
+        // 转为异步
+        setTimeout(() => {
+          this.getHotRecommend(this.uid);
+        }, 0)
       })
       return;
     }
@@ -254,6 +259,15 @@ Page({
         workId: options.readId
       })
     }
+    /**
+     * 活动统计
+     */
+    if (options.activity) {
+      console.log('统计')
+      httpRequestApi.shareAddHotAmount(options.readId).success(res => {
+        console.log(res)
+      })
+    }
 
     getOpenidNoLogin((res) => {
       console.log('getOpenidNoLogin', res)
@@ -292,8 +306,6 @@ Page({
 
 
     this.uid = wx.getStorageSync('uid');
-    let grade = wx.getStorageSync('grade');
-
     // if (!this.uid || !grade) {
     //   this.setData({
     //     isGradeShow: true,
@@ -331,13 +343,16 @@ Page({
 
   },
   onShow: function () {
+    let grade = wx.getStorageSync('grade');
+    this.setData({
+      gradeActivity: grade
+    })
     if (this.data.myIndex === 3) {
       this.getUserWorksInfo(1)
     }
     wx.setNavigationBarTitle({
       title: '小学语文朗读配音'
     })
-    console.log('页面返回页面返回', this.data.fromLoginIndex)
     if (this.data.fromLoginIndex) {
       console.log('页面返回页面返回', this.data.fromLoginIndex)
       let index = this.data.fromLoginIndex;
@@ -355,17 +370,14 @@ Page({
       })
       this.updateData(3)
     }
-    // const userInfo = wx.getStorageSync('user')
-    // console.log('userInfo',userInfo)
-    // if (userInfo.wechatName) {
-    //   this.setData({
-    //     isLogin: true
-    //   })
-    // } else {
-    //   this.setData({
-    //     isLogin: false
-    //   })
-    // }
+    // 刷新课程资源的收藏数等
+    if (this.data.myIndex === 2) {
+      this.refreshCourseAmount()
+    }
+    this.setData({
+      shareImg: '',
+      shareId: ''
+    })
   },
 
   onHide: function () {
@@ -384,15 +396,25 @@ Page({
     httpRequestApi.getHotRecommendSecond(grade, pageNo, pageSize).success(res => {
       console.log(res)
       const recommendRes = res.data.data.list;
-      if (recommendRes.length === 0) return;
+      if (recommendRes.length <= 0) {
+        this.setData({
+          noMoreWork: true
+        })
+        return
+      };
       // const recommendWorks = [];
       this.formatWorksList(recommendRes);
-
     })
   },
   // 组装list
   formatWorksList(list, notSet) {
     // const tempList = [];
+    console.log('列表长度列表长度', list.length)
+    if (list.length < 3 || list.length === 0) {
+      this.setData({
+        noMoreWork: true
+      })
+    }
     list.forEach((item, index) => {
       /* if (index === list.length - 2 && list.length > 2) {
         console.log('设置当前id', item.id)
@@ -407,6 +429,8 @@ Page({
       temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
       temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
       temp.commentAmount = item.userRead.commentAmount ? item.userRead.commentAmount : 0;
+      temp.shareAmount = item.userRead.shareAmount;
+      temp.favoritesAmount = item.userRead.favoritesAmount;
       temp.classId = item.userRead.exampleId ? item.userRead.exampleId : 1605097720036046;
       temp.time = formatDate(item.userRead.gmtCreated, 3);
       temp.avatar = item.user.avatar;
@@ -428,6 +452,7 @@ Page({
       temp.shareImg = item.userRead.shareImg;
       temp.grade = item.userRead.grade;
       temp.videoShow = false;
+      item.isActivity && (temp.activity = true);
       this.data.videoList.push(temp);
       // tempList.push(temp);
     });
@@ -653,6 +678,8 @@ Page({
         temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
         temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
         temp.commentAmount = item.userRead.commentAmount ? item.userRead.commentAmount : 0;
+        temp.shareAmount = item.userRead.shareAmount;
+        temp.favoritesAmount = item.userRead.favoritesAmount;
         temp.classId = item.userRead.exampleId ? item.userRead.exampleId : 1605097720036046;
         temp.time = formatDate(item.userRead.gmtCreated, 3);
         temp.avatar = item.user.avatar;
@@ -679,7 +706,8 @@ Page({
       console.log('myWorks', myWorks)
       if (this.data.myIndex === 3) {
         this.setData({
-          videoList: myWorks
+          videoList: myWorks,
+          noMoreWork: true
         })
       }
     })
@@ -688,6 +716,15 @@ Page({
   commentTap: function (e) {
     console.log('点击评论区', e)
     if (e.target.dataset.type === 'blank') {
+      if (this.data.commentShow && this.data.commentId) {
+        httpRequestApi.getClassDetail(this.data.commentId).success(res => {
+          console.log('评论回显', res.data.data.userRead.commentAmount)
+          let str = `videoList[${this.data.commentIndex}].commentAmount`;
+          this.setData({
+            [str]: res.data.data.userRead.commentAmount
+          })
+        })
+      }
       this.setData({
         commentShow: false
       })
@@ -698,17 +735,20 @@ Page({
   },
   // 打开评论
   openComment: function (e) {
-    // 
+    //
     console.log('id', e.detail.activeId)
+    console.log('id', e)
     this.setData({
       commentShow: !this.data.commentShow,
       commentId: e.detail.activeId,
+      commentIndex: e.detail.activeIndex
       // commentList: []
     });
     // this.getReply(e.detail.activeId);
   },
   // 获取评论信息
   getReply: function (columnId) {
+    debugger
     // let columnId = this.data.id;
     console.log(123123123, columnId)
     // let pageNo = this.data.pageNo;
@@ -764,16 +804,12 @@ Page({
     })
   },
   onShareAppMessage: function (res) {
-    console.log('点击分享按钮', res)
-    console.log('点击分享按钮', this.data.shareTitle)
-    console.log('点击分享按钮', this.data.shareId)
-    console.log('点击分享按钮', this.data.shareImg)
+    console.log('onShareAppMessage>>>>>>>>>>>>')
     if (res.from === 'button') {
       return {
         title: '请欣赏我的课文朗读作品,点赞+评论。',
         path: `/pages/index/index?readId=${this.data.shareId}`,
         imageUrl: this.data.shareImg
-
       }
     } else {
       return {
@@ -783,11 +819,11 @@ Page({
     }
   },
   openShare: function (e) {
-    console.log('用户点击分享按钮123', e)
     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,
+      goToShare: true
     })
   },
   // 修改年级
@@ -842,7 +878,6 @@ Page({
       } else {
         this.setData({
           noFollow: false
-
         })
       }
 
@@ -873,7 +908,8 @@ Page({
     httpRequestApi.getClassRead(data).success(res => {
       console.log('资源', this.data.coursesData)
       this.setData({
-        coursesData: this.data.coursesData.concat(res.data.data.list)
+        coursesData: this.data.coursesData.concat(res.data.data.list),
+        noMoreWork: res.data.data.list.length <= 0 ? true : false
       }, () => {
         console.log(this.data.coursesData)
       })
@@ -882,10 +918,40 @@ Page({
   goToReading: function (e) {
     console.log('去朗读', e)
     const id = e.detail.activeId ? e.detail.activeId : e.currentTarget.dataset.id;
+    const index = e.currentTarget.dataset.index;
+    this.setData({
+      goToCoursesId: id,
+      goToCoursesIndex: index
+    })
     wx.navigateTo({
       url: `../../pages/reading/reading?id=${id}`
     });
   },
+  refreshCourseAmount() {
+    console.log(this.data.goToCoursesId)
+    console.log(this.data.goToCoursesIndex)
+    if (this.data.goToCoursesId && (this.data.goToCoursesIndex || this.data.goToCoursesIndex === 0)) {
+      httpRequestApi.getClassDetail(this.data.goToCoursesId).success(res => {
+        console.log('刷新', res.data.data.userRead)
+        let likeStr = `coursesData[${this.data.goToCoursesIndex}].userRead.likeAmount`;
+        let commentStr = `coursesData[${this.data.goToCoursesIndex}].userRead.commentAmount`;
+        let playStr = `coursesData[${this.data.goToCoursesIndex}].userRead.playAmount`;
+        let shareStr = `coursesData[${this.data.goToCoursesIndex}].userRead.shareAmount`;
+        let collectStr = `coursesData[${this.data.goToCoursesIndex}].userRead.collectAmount`;
+        console.log(1, this.data.coursesData[this.data.goToCoursesIndex].userRead.likeAmount)
+        console.log(2, res.data.data.userRead.likeAmount)
+        this.setData({
+          [likeStr]: res.data.data.userRead.likeAmount,
+          [commentStr]: res.data.data.userRead.commentAmount,
+          [playStr]: res.data.data.userRead.playAmount,
+          [shareStr]: res.data.data.userRead.shareAmount,
+          [collectStr]: res.data.data.userRead.collectAmount,
+        }, () => {
+          console.log(111222333, this.data.coursesData[this.data.goToCoursesIndex])
+        })
+      })
+    }
+  },
   courseCollectTap: function collectClass(e) {
     console.log('收藏按钮', e);
     const data = {
@@ -928,11 +994,13 @@ Page({
     }
   },
   collectTap: function (e) {
-    console.log('点击收藏首页', e)
     const index = e.detail.index;
-    let str = `videoList[${index}].isFavorite`
+    let str = `videoList[${index}].isFavorite`;
+    let str2 = `videoList[${index}].favoritesAmount`;
+    let favoritesAmount = e.detail.isCollect ? this.data.videoList[index].favoritesAmount + 1 : this.data.videoList[index].favoritesAmount - 1
     this.setData({
-      [str]: e.detail.isCollect
+      [str]: e.detail.isCollect,
+      [str2]: favoritesAmount
     })
   },
   likeTap: function (e) {
@@ -944,5 +1012,26 @@ Page({
       [likeStr]: true,
       [likeNumStr]: this.data.videoList[index].likes + 1
     })
+    // this.flowerAnimationHandler()
   },
-})
+  flowerAnimationHandler: function () {
+    this.flowerBox = this.selectComponent("#flower-box");
+    console.log('this.flower', this.flowerBox)
+    this.flowerBox.comeOut();
+  },
+  addShareAmount: function (e) {
+    console.log('+++++1', e)
+    let str = `videoList[${e.detail.index}].shareAmount`;
+    this.setData({
+      [str]: this.data.videoList[e.detail.index].shareAmount + 1
+    })
+  },
+  /**
+   * 跳转到活动页
+   */
+  goToActivity() {
+    wx.navigateTo({
+      url: `../activity/index/index`
+    });
+  }
+})

+ 3 - 2
pages/index/index.json

@@ -6,10 +6,11 @@
         "VideoSwiper": "../../component/video-swiper/index",
         "Comment": "../../component/comment/comment",
         "StatusBar": "../../component/statusBar/statusBar",
-        "shareDialog": "/component/share/share"
+        "shareDialog": "/component/share/share",
+        "flowerBox": "/component/flowerBox/flowerBox"
     },
     "enablePullDownRefresh": true,
     "window": {
         "onReachBottomDistance": 50
       }
-  }
+  }

+ 30 - 15
pages/index/index.wxml

@@ -1,5 +1,6 @@
 <!-- index.wxml -->
 <!-- <StatusBar receiveData="{{statusbarobj}}" grade="{{grade}}" bindgradeTap="gradeTap" /> -->
+<mp-navigation-bar  title="UI组件库"></mp-navigation-bar>
 <view class="change_grade" wx:if="{{isGradeShow}}">
   <view class="change_brage_wrapper">
     <text class="title">分龄选择</text>
@@ -13,7 +14,7 @@
     </view>
     <view class="change_row change_row_single">
       <view class="change_item" bindtap="changeGrade" data-code="PRESCHOOL">学前班</view>
-      <view class="change_item change_item_blank"  data-code="PRESCHOOL"></view>
+      <view class="change_item change_item_blank" data-code="PRESCHOOL"></view>
     </view>
   </view>
 </view>
@@ -25,16 +26,31 @@
   <import src="/component/my/my.wxml" />
   <import src="/templates/courses/courses.wxml" />
   <!-- 顶部导航 -->
-  <view class="top-tab" wx:if="{{!isGradeShow}}" >
-    <block wx:for="{{tab}}" wx:key="index">
+  <view class="top-tab" wx:if="{{!isGradeShow}}">
+    <!-- <block wx:for="{{tab}}" wx:key="index">
       <view class="tabbar {{index == myIndex ? 'select':' '}}" bindtap="switcher" data-index="{{index}}">
         <text>{{item.name}}</text>
       </view>
-    </block>
+    </block> -->
+    <view class="tabbar {{3 == myIndex ? 'select':' '}}" bindtap="switcher" data-index="3">
+      <text>我的</text>
+    </view>
+    <view class="tabbar {{0 == myIndex ? 'select':' '}}" bindtap="switcher" data-index="0">
+      <text>推荐</text>
+    </view>
+    <view class="tabbar {{1 == myIndex ? 'select':' '}}" bindtap="switcher" data-index="1">
+      <text>关注</text>
+    </view>
+    <view class="tabbar {{2 == myIndex ? 'select':' '}}" bindtap="switcher" data-index="2">
+      <text>资源</text>
+    </view>
+  </view>
+  <view hidden="{{gradeActivity === 'PRIMARY_SENIOR_GRADE' || gradeActivity === 'PRESCHOOL' || 0 != myIndex}}" class="activity-img" bindtap="goToActivity">
+    <image src="http://reader-wx.ai160.com/images/reader/activity/banner.jpg"></image>
   </view>
   <!-- 调用组件 -->
-  <template is="{{templates}}" wx:if="{{myIndex === 3 || myIndex === 2}}" data="{{myData: myData,coursesData:coursesData}}"></template>
-  <VideoSwiper wx:if="{{videoList.length > 0}}" class="video-swiper" video-list="{{videoList}}" nextMargin="{{nextMargin}}" isSwiper="{{isSwiper}}" ifHeadTap="{{true}}" bindopenShare="openShare" bindopenComment="openComment" bindheadTap="headTapHandler" bindgoToReading="goToReading" bindcollectTap="collectTap" bindlikeTap="likeTap" binddelHideMyWork="delHideMyWork" bindchange="videoChange">
+  <template is="{{templates}}" wx:if="{{myIndex === 3 || myIndex === 2}}" data="{{myData: myData,coursesData:coursesData,noMoreWork:noMoreWork}}"></template>
+  <VideoSwiper wx:if="{{videoList.length > 0}}" class="video-swiper" video-list="{{videoList}}" nextMargin="{{nextMargin}}" isSwiper="{{isSwiper}}" noMoreWork="{{noMoreWork}}" ifHeadTap="{{true}}" bindopenShare="openShare" bindopenComment="openComment" bindheadTap="headTapHandler" bindgoToReading="goToReading" bindcollectTap="collectTap" bindlikeTap="likeTap" binddelHideMyWork="delHideMyWork" bindaddShareAmount="addShareAmount" bindchange="videoChange">
     <!-- bindplay="onPlay"
   bindpause="onPause"
   bindtimeupdate="onTimeUpdate"
@@ -49,23 +65,22 @@
   </view>
   <view class="no_follow" wx:if="{{myIndex === 1 && videoList.length <= 0 && noFollow}}">
     <image class="no_follow_icon" src="../../static/index/no_follow.png" />
-    <text >赶快去关注优秀作者吧,</text>
-    <text >这里将会发生欣喜的变化。</text>
+    <text>赶快去关注优秀作者吧,</text>
+    <text>这里将会发生欣喜的变化。</text>
   </view>
 </view>
 <!-- <MyToast /> -->
 <view hidden="{{hide}}">
   <Dialog bindmyevent="jurisdiction" />
 </view>
-<view class="upgrade" hidden="{{upgradeHide}}">
+<view class="upgrade" hidden="{{gradeActivity === 'PRIMARY_SENIOR_GRADE' || gradeActivity === 'PRESCHOOL' || upgradeHide}}">
   <view class="upgrade-main">
-    <image class="upgrade-icon" src="https://reader-wx.ai160.com/images/reader/upgrade_success.png"></image>
+    <image class="upgrade-icon" src="http://reader-wx.ai160.com/images/reader/activity/activity_dialog.png" bindtap="goToActivity"></image>
     <image class="close" bindtap="hideUpgrade" src="../../static/image/close.png"></image>
-  </view> 
+  </view>
 </view>
-<shareDialog id="share-dialog" shareType='works' bindShareDialogClose="shareDialogClose" shareId="{{id}}" />
-
- <canvas canvas-id="myCanvas" style="width:300px; height: 525px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
+<shareDialog id="share-dialog" shareType='works' bindaddShareAmount="addShareAmount" bindShareDialogClose="shareDialogClose" shareId="{{id}}" />
+<canvas canvas-id="myCanvas" style="width:300px; height: 525px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
 <!-- <view class="index-dialog" wx:if="{{indexSignDialog}}">
   <form bindsubmit="signInBtn" report-submit="{{true}}" class="index-dialog-wrapper" >
     <view class="index-dialog-text">签到领取小红花哦</view>
@@ -78,4 +93,4 @@
     <view class="index-dialog-text">还有<text class="red-text">{{unfinishedCount}}</text>个小红花任务哦</view>
     <view class="index-dialog-btn" >查看任务</view>
   </view>
-</view> -->
+</view> -->

+ 17 - 8
pages/index/index.wxss

@@ -41,6 +41,14 @@
   padding: 0 48rpx 0 48rpx;
 
 }
+.activity-img {
+  width: 100%;
+  height: 321rpx;
+}
+.activity-img image {
+  width: 100%;
+  height: 100%;
+}
 
 .no_follow {
   display: flex;
@@ -406,23 +414,24 @@
   top: 0;
   width: 100%;
   height: 100%;
-  background: rgba(0, 0, 0, .6);
+  background: rgba(0, 0, 0, .75);
   z-index:9999;
 }
 .upgrade-main {
   position: absolute;
-  right: 20rpx;
-  top: -10rpx;  
+  left: 50%;
+  top: 14%;
+  transform: translate(-50%, 0);
 }
 .upgrade-icon {
-  width: 443rpx;
-  height: 236rpx;
+  width: 562rpx;
+  height: 789rpx;
 }
 .close {
   position: absolute;
   left: 50%;
   transform: translateX(-50%);
-  top: 260rpx;
+  bottom: -100rpx;
   width: 65rpx;
-  height: 65rpx;  
-}
+  height: 65rpx;
+}

+ 34 - 13
pages/mycollection/mycollection.js

@@ -16,7 +16,7 @@ Page({
     statusbarobj: {
       isshowbtn: false, //是否显示按钮
       title: "小学语文朗读配音", //标题
-  },
+    },
   },
 
   toClass: function (e) {
@@ -53,6 +53,8 @@ Page({
       temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
       temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
       temp.commentAmount = item.userRead.commentAmount ? item.userRead.commentAmount : 0;
+      temp.shareAmount = item.userRead.shareAmount;
+      temp.favoritesAmount = item.userRead.favoritesAmount;
       temp.classId = item.userRead.exampleId ? item.userRead.exampleId : 1605097720036046;
       temp.time = formatDate(item.userRead.gmtCreated, 3);
       temp.avatar = item.user.avatar;
@@ -67,7 +69,7 @@ Page({
       temp.isFavorite = true;
       temp.coverImg = item.userRead.coverImg;
       temp.shareImg = item.userRead.shareImg;
-      temp.grade=item.userRead.grade;
+      temp.grade = item.userRead.grade;
       temp.videoShow = false;
       this.data.videoList.push(temp);
     });
@@ -89,6 +91,15 @@ Page({
   commentTap: function (e) {
     console.log('点击评论区', e)
     if (e.target.dataset.type === 'blank') {
+      if (this.data.commentShow && this.data.commentId) {
+        httpRequestApi.getClassDetail(this.data.commentId).success(res => {
+          console.log('评论回显', res.data.data.userRead.commentAmount)
+          let str = `videoList[${this.data.commentIndex}].commentAmount`;
+          this.setData({
+            [str]: res.data.data.userRead.commentAmount
+          })
+        })
+      }
       this.setData({
         commentShow: false
       })
@@ -101,6 +112,7 @@ Page({
     this.setData({
       commentShow: !this.data.commentShow,
       commentId: e.detail.activeId,
+      commentIndex: e.detail.activeIndex
       // commentList: []
     });
     // this.getReply(e.detail.activeId);
@@ -170,23 +182,25 @@ Page({
   onReachBottom: function () {
 
   },
-  collectTap: function(e){
-    console.log('点击收藏',e)
+  collectTap: function (e) {
     const index = e.detail.index;
-    let str = `videoList[${index}].isFavorite`
+    let str = `videoList[${index}].isFavorite`;
+    let str2 = `videoList[${index}].favoritesAmount`;
+    let favoritesAmount = e.detail.isCollect ? this.data.videoList[index].favoritesAmount + 1 : this.data.videoList[index].favoritesAmount - 1
     this.setData({
-     [str]: e.detail.isCollect
+      [str]: e.detail.isCollect,
+      [str2]: favoritesAmount
     })
   },
-  likeTap:function(e){
-    console.log('点赞',e)
+  likeTap: function (e) {
+    console.log('点赞', e)
     const index = e.detail.index;
     let likeStr = `videoList[${index}].isLike`;
     let likeNumStr = `videoList[${index}].likes`;
-   this.setData({
-     [likeStr]: true,
-     [likeNumStr]: this.data.videoList[index].likes + 1
-   })
+    this.setData({
+      [likeStr]: true,
+      [likeNumStr]: this.data.videoList[index].likes + 1
+    })
   },
   openShare: function (e) {
     console.log('用户点击分享按钮', e)
@@ -201,7 +215,7 @@ Page({
    * 用户点击右上角分享
    */
   onShareAppMessage: function (res) {
-    console.log('用户点分享',res)
+    console.log('用户点分享', res)
     if (res.from === 'button') {
       return {
         title: '请欣赏我的课文朗读作品,点赞+评论。',
@@ -215,5 +229,12 @@ Page({
         path: '/pages/index/index',
       }
     }
+  },
+  addShareAmount: function (e) {
+    console.log('+++++1', e)
+    let str = `videoList[${e.detail.index}].shareAmount`;
+    this.setData({
+      [str]: this.data.videoList[e.detail.index].shareAmount + 1
+    })
   }
 })

+ 1 - 1
pages/mycollection/mycollection.wxml

@@ -11,7 +11,7 @@
       <view class='left'>{{ item.userRead.summary }}</view>
     </view> 
   </view> -->
-  <VideoSwiper wx:if="{{videoList.length > 0}}" class="video-swiper" video-list="{{videoList}}" nextMargin="{{nextMargin}}" isSwiper="{{isSwiper}}" ifHeadTap="{{true}}" bindopenComment="openComment" bindheadTap="headTapHandler" bindgoToReading="goToReading" bindcollectTap="collectTap" bindlikeTap="likeTap" bindopenShare="openShare" binddelHideMyWork="delHideMyWork" bindchange="videoChange" />
+  <VideoSwiper wx:if="{{videoList.length > 0}}" class="video-swiper" video-list="{{videoList}}" nextMargin="{{nextMargin}}" isSwiper="{{isSwiper}}" ifHeadTap="{{true}}" bindopenComment="openComment" bindheadTap="headTapHandler" bindgoToReading="goToReading" bindcollectTap="collectTap" bindlikeTap="likeTap" bindopenShare="openShare" binddelHideMyWork="delHideMyWork" bindaddShareAmount="addShareAmount" bindchange="videoChange" />
   <!-- <myPlacerholder line1="{{line1}}" line2="{{line2}}" wx:if="{{collection_data.length <= 0}}" /> -->
   <view class="comment_section" catchtouchmove="commentTouchMove" catchtap="commentTap" data-type="blank" wx:if="{{commentShow}}">
     <Comment data-type="list" commentId="{{commentId}}" commentNum="{{commentNum}}" inputValue="{{inputValue}}" bindsendReply="sendReply" />

+ 35 - 13
pages/myworks/myworks.js

@@ -30,6 +30,7 @@ Page({
     this.setData({
       commentShow: !this.data.commentShow,
       commentId: e.detail.activeId,
+      commentIndex: e.detail.activeIndex
     });
   },
   toMyWorks: function (e) {
@@ -39,15 +40,25 @@ Page({
       url: `../../social/works/works?id=${id}&title=${title}`
     });
   },
+  // 评论区点击
   commentTap: function (e) {
     console.log('点击评论区', e)
     if (e.target.dataset.type === 'blank') {
+      if (this.data.commentShow && this.data.commentId) {
+        APIClient.getClassDetail(this.data.commentId).success(res => {
+          console.log('评论回显', res.data.data.userRead.commentAmount)
+          let str = `videoList[${this.data.commentIndex}].commentAmount`;
+          this.setData({
+            [str]: res.data.data.userRead.commentAmount
+          })
+        })
+      }
       this.setData({
         commentShow: false
       })
     }
   },
-  touchMove: function(e){
+  touchMove: function (e) {
     return
   },
   goToReading: function (e) {
@@ -121,6 +132,8 @@ Page({
         temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
         temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
         temp.commentAmount = item.userRead.commentAmount ? item.userRead.commentAmount : 0;
+        temp.shareAmount = item.userRead.shareAmount;
+        temp.favoritesAmount = item.userRead.favoritesAmount;
         temp.classId = item.userRead.exampleId ? item.userRead.exampleId : 1605097720036046;
         temp.time = formatDate(item.userRead.gmtCreated, 3);
         temp.avatar = item.user.avatar;
@@ -175,7 +188,7 @@ Page({
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady: function () {
-    
+
   },
 
   /**
@@ -212,29 +225,31 @@ Page({
   onReachBottom: function () {
     this.setData({
       pageNo: this.data.pageNo + 1
-    },()=>{
+    }, () => {
       if (this.data.pageNo <= this.data.totalNo) {
         this.getUserWorks();
       }
     })
   },
-  collectTap: function(e){
-    console.log('点击收藏',e)
+  collectTap: function (e) {
     const index = e.detail.index;
-    let str = `videoList[${index}].isFavorite`
+    let str = `videoList[${index}].isFavorite`;
+    let str2 = `videoList[${index}].favoritesAmount`;
+    let favoritesAmount = e.detail.isCollect ? this.data.videoList[index].favoritesAmount + 1 : this.data.videoList[index].favoritesAmount - 1
     this.setData({
-     [str]: e.detail.isCollect
+      [str]: e.detail.isCollect,
+      [str2]: favoritesAmount
     })
   },
-  likeTap:function(e){
-    console.log('点赞',e)
+  likeTap: function (e) {
+    console.log('点赞', e)
     const index = e.detail.index;
     let likeStr = `videoList[${index}].isLike`;
     let likeNumStr = `videoList[${index}].likes`;
-   this.setData({
-     [likeStr]: true,
-     [likeNumStr]: this.data.videoList[index].likes + 1
-   })
+    this.setData({
+      [likeStr]: true,
+      [likeNumStr]: this.data.videoList[index].likes + 1
+    })
   },
   openShare: function (e) {
     console.log('用户点击分享按钮', e)
@@ -266,4 +281,11 @@ Page({
       }
     }
   },
+  addShareAmount: function (e) {
+    console.log('+++++1', e)
+    let str = `videoList[${e.detail.index}].shareAmount`;
+    this.setData({
+      [str]: this.data.videoList[e.detail.index].shareAmount + 1
+    })
+  }
 })

+ 1 - 1
pages/myworks/myworks.wxml

@@ -36,7 +36,7 @@
   </view>
 
 
-  <VideoSwiper wx:if="{{videoList.length > 0}}" class="video-swiper" video-list="{{videoList}}" nextMargin="{{nextMargin}}" isSwiper="{{false}}" bindopenComment="openComment" bindheadTap="headTapHandler" bindcollectTap="collectTap" bindlikeTap="likeTap" bindopenShare="openShare" bindgoToReading="goToReading" bindplay="onPlay"></VideoSwiper>
+  <VideoSwiper wx:if="{{videoList.length > 0}}" class="video-swiper" video-list="{{videoList}}" nextMargin="{{nextMargin}}" isSwiper="{{false}}" bindopenComment="openComment" bindheadTap="headTapHandler" bindcollectTap="collectTap" bindlikeTap="likeTap" bindopenShare="openShare" bindgoToReading="goToReading" bindaddShareAmount="addShareAmount" bindplay="onPlay"></VideoSwiper>
 </scroll-view>
 <view class="comment_section" catchtouchmove="touchMove"  catchtap="commentTap" data-type="blank" wx:if="{{commentShow}}">
     <Comment data-type="list" commentId="{{commentId}}" />

+ 85 - 21
pages/reading/reading.js

@@ -44,6 +44,8 @@ Page({
             isshowbtn: false, //是否显示按钮
             title: "小学语文朗读配音", //标题
         },
+        isScroll: true,
+        noMoreWork: false
     },
     onLoad: function (option) {
         console.log(option);
@@ -211,7 +213,7 @@ Page({
     recordingVideoEnd: function () {
         console.log(this.data.videoCtr)
         console.log('recordingVideoEnd');
-        // 
+        //
         if (this.data.recordFlag === 0) {
             // this.recordStop();
 
@@ -230,7 +232,7 @@ Page({
         // this.ss.stopPlay();
     },
     /***
-     *  recordFlag: 
+     *  recordFlag:
      *      0 初始状态
      *      1 录音中
      *      2 录音结束
@@ -288,9 +290,9 @@ Page({
         }
         this.recorderManager.start(options);
         // this.ss.startRecord({
-        //     coreType: 'cn.sent.score', //测评题型    
-        //     evalTime: 300000, //测评的录音时间,时间到自动停止测评    
-        //     refText: this.data.readingText, //测评文本  
+        //     coreType: 'cn.sent.score', //测评题型
+        //     evalTime: 300000, //测评的录音时间,时间到自动停止测评
+        //     refText: this.data.readingText, //测评文本
         //     warrantId: 'c11163aa6c834a028da4a4b30955be96', //鉴权id
         // })
         // 驰声测评
@@ -400,7 +402,7 @@ Page({
         const tone = result.tone; // 语调声调
         // const accuracy = result.accuracy; // 准确度 发音分
         const accuracy = result.overall; // 准确度 发音分
-        const fluency = result.fluency.overall; //流利度 
+        const fluency = result.fluency.overall; //流利度
         let starArray = [];
         let myOverall = integrity * 0.3 + accuracy * 0.5 + fluency * 0.1 + tone * 0.1;
         // let myOverall = 80;
@@ -457,6 +459,7 @@ Page({
         }
         this.innerAudioContext = wx.createInnerAudioContext();
         this.innerAudioContext.src = this.data.recordSource; // 这里可以是录音的临时路径
+        console.log('音频路径', this.data.recordSource)
         this.setData({
             videoUrl: this.data.videoUrl,
             muted: true
@@ -514,6 +517,8 @@ Page({
 
         }, () => {
             console.log('播放视频播放视频播放视频')
+            // this.videoCtx.seek(1);
+            this.videoCtx.stop();
             this.videoCtx.play();
             this.recordStart();
         })
@@ -535,8 +540,8 @@ Page({
         })
         const recordSource = this.data.recordSource;
         wx.uploadFile({
-            url: 'https://reader-api.ai160.com/file/upload',
-            // url: 'https://reader-test.efunbox.cn/file/upload',
+            // url: 'https://reader-api.ai160.com/file/upload',
+            url: 'https://reader-api.efunbox.cn//file/upload',
             filePath: recordSource,
             name: '朗读录音',
             header: {
@@ -573,6 +578,12 @@ Page({
                         duration: 1000,
                         success: () => {
                             console.log('上传成功', res);
+                            if (res.data.count > 0) {
+                                this.setData({
+                                    flowerNum: res.data.count
+                                })
+                                this.flowerAnimationHandler();
+                            }
                             const _data = this.data;
                             const scoreData = {
                                 "userReadId": res.data.data.id,
@@ -632,6 +643,10 @@ Page({
                 temp.img = item.userRead.iconImg;
                 temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
                 temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
+                temp.shareAmount = item.userRead.shareAmount;
+                temp.favoritesAmount = item.userRead.favoritesAmount;
+                temp.commentAmount = item.userRead.commentAmount ? item.userRead.commentAmount : 0;
+
                 temp.classId = item.userRead.exampleId;
                 temp.time = formatDate(item.userRead.gmtCreated, 3);
                 temp.avatar = item.user ? item.user.avatar : '';
@@ -653,19 +668,31 @@ Page({
             });
             this.setData({
                 videoList: this.data.videoList,
-                totalSize: res.data.data.totalSize
+                totalSize: res.data.data.totalSize,
+                noMoreWork: readInfo.length <= 0 ? true : false
+
             })
+
         });
     },
     // 评论区点击
     commentTap: function (e) {
         console.log('点击评论区', e)
         if (e.target.dataset.type === 'blank') {
-            this.setData({
-                commentShow: false
+          if (this.data.commentShow && this.data.commentId) {
+            httpRequestApi.getClassDetail(this.data.commentId).success(res => {
+              console.log('评论回显', res.data.data.userRead.commentAmount)
+              let str = `videoList[${this.data.commentIndex}].commentAmount`;
+              this.setData({
+                [str]:res.data.data.userRead.commentAmount
+              })
             })
+          }
+          this.setData({
+            commentShow: false
+          })
         }
-    },
+      },
     scrollToLower: function (e) {
         console.log('滑动到底部', e)
         this.setData({
@@ -674,6 +701,14 @@ Page({
             this.getReadInfo()
         })
     },
+    onReachBottom: function (e) {
+        console.log('滑动到底部', e)
+        this.setData({
+            pageNo: this.data.pageNo + 1
+        }, () => {
+            this.getReadInfo()
+        })
+    },
     scrollToUpper: function (e) {
         console.log('滑动到顶部', e)
 
@@ -684,6 +719,7 @@ Page({
         this.setData({
             commentShow: !this.data.commentShow,
             commentId: e.detail.activeId,
+            commentIndex: e.detail.activeIndex
         });
     },
     goToReading: function (e) {
@@ -696,9 +732,9 @@ Page({
     },
     onShareAppMessage: function (res) {
         console.log('点击分享按钮', res)
-        console.log('点击分享按钮', this.data.shareTitle)
-        console.log('点击分享按钮', this.data.shareId)
-        console.log('点击分享按钮', this.data.shareImg)
+        console.log('onShareAppMessage', this.data.shareTitle)
+        console.log('onShareAppMessage', this.data.shareId)
+        console.log('onShareAppMessage', this.data.shareImg)
         if (res.from === 'button') {
             return {
                 title: '请欣赏我的课文朗读作品,点赞+评论。',
@@ -718,7 +754,7 @@ Page({
         return
     },
     openShare: function (e) {
-        console.log('用户点击分享按钮', e)
+        console.log('用户点击分享按钮回调', e)
         this.setData({
             shareTitle: e.detail.currentTarget.dataset.title,
             shareId: e.detail.currentTarget.dataset.id,
@@ -736,13 +772,15 @@ Page({
         }
     },
     collectTap: function (e) {
-        console.log('点击收藏', e)
         const index = e.detail.index;
-        let str = `videoList[${index}].isFavorite`
+        let str = `videoList[${index}].isFavorite`;
+        let str2 = `videoList[${index}].favoritesAmount`;
+        let favoritesAmount = e.detail.isCollect ? this.data.videoList[index].favoritesAmount + 1 : this.data.videoList[index].favoritesAmount - 1
         this.setData({
-            [str]: e.detail.isCollect
+          [str]: e.detail.isCollect,
+          [str2]: favoritesAmount
         })
-    },
+      },
     likeTap: function (e) {
         console.log('点赞', e)
         const index = e.detail.index;
@@ -753,4 +791,30 @@ Page({
             [likeNumStr]: this.data.videoList[index].likes + 1
         })
     },
-})
+    flowerAnimationHandler: function () {
+        this.flowerBox = this.selectComponent("#flower-toast");
+        console.log('this.flower', this.flowerBox)
+        this.flowerBox.comeOut();
+    },
+    // 获取焦点事件
+    inputFocus(e) {
+        this.setData({
+            isScroll: false
+        })
+        this.triggerEvent('inputFocus');
+    },
+    // 失去焦点事件
+    inputBlur(e) {
+        this.setData({
+            isScroll: true
+        })
+        this.triggerEvent('inputBlur');
+    },
+    addShareAmount: function (e) {
+        console.log('+++++1', e)
+        let str = `videoList[${e.detail.index}].shareAmount`;
+        this.setData({
+          [str]: this.data.videoList[e.detail.index].shareAmount + 1
+        })
+      }
+})

+ 3 - 1
pages/reading/reading.json

@@ -2,7 +2,9 @@
     "usingComponents": {
         "VideoSwiper": "../../../component/video-swiper/index",
         "Comment": "../../../component/comment/comment",
-        "StatusBar": "../../../component/statusBar/statusBar"
+        "StatusBar": "../../../component/statusBar/statusBar",
+        "flowerBox": "../../../component/flowerBox/flowerBox"
+
     },
     "enablePullDownRefresh": false
 }

+ 7 - 7
pages/reading/reading.wxml

@@ -1,5 +1,5 @@
 <!-- <StatusBar receiveData="{{statusbarobj}}" grade="{{grade}}" bindgradeTap="gradeTap" /> -->
-<scroll-view class="readingPage" lower-threshold="{{}}" scroll-y="true" bindscrolltolower="scrollToLower" bindscrolltoupper="scrollToUpper">
+<view class="readingPage" lower-threshold="{{}}" scroll-y="{{isScroll}}" bindscrolltolower="scrollToLower" bindscrolltoupper="scrollToUpper">
     <!-- <view class="videoSection" wx:if="{{!isIOS}}">
         <image wx:if="{{!videoLoad}}" class="videoIcon" src="{{iconImg}}" />
     </view> -->
@@ -74,13 +74,12 @@
             <text>{{tone}}/100</text>
         </view>
     </view>
-    <VideoSwiper bindopenShare="openShare" wx:if="{{videoList && videoList.length > 0 && isVideoListShow}}" class="video-swiper" video-list="{{videoList}}" nextMargin="{{nextMargin}}" isSwiper="{{false}}" bindopenComment="openComment" bindheadTap="headTapHandler" bindcollectTap="collectTap" bindlikeTap="likeTap" bindgoToReading="goToReading" bindonPlay="onPlay"></VideoSwiper>
-</scroll-view>
+    <VideoSwiper bindopenShare="openShare" wx:if="{{videoList && videoList.length > 0 && isVideoListShow}}" class="video-swiper" video-list="{{videoList}}" nextMargin="{{nextMargin}}" isSwiper="{{false}}" noMoreWork="{{noMoreWork}}" bindopenComment="openComment" bindheadTap="headTapHandler" bindcollectTap="collectTap" bindlikeTap="likeTap" bindgoToReading="goToReading" bindaddShareAmount="addShareAmount" bindonPlay="onPlay"></VideoSwiper>
+</view>
 <view class="comment_section" catchtouchmove="touchMove" catchtap="commentTap" data-type="blank" wx:if="{{commentShow}}">
-    <Comment data-type="list" commentId="{{commentId}}" />
+    <Comment data-type="list"  commentId="{{commentId}}" />
 </view>
- <canvas canvas-id="myCanvas" style="width:300px; height: 525px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
-
+<canvas canvas-id="myCanvas" style="width:300px; height: 525px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
 <view class="score_dialog" wx:if="{{ifScoreDialogShow}}">
     <view class="score_section">
         <view class="title">测评报告</view>
@@ -119,4 +118,5 @@
     <view class="close" bindtap="closeScoreDialog">
         <image class="close_icon" src="../../static/index/close.png" />
     </view>
-</view>
+</view>
+<flowerBox id="flower-toast" flowerNum="{{flowerNum}}" />

+ 2 - 2
pages/social/littleFlower/littleFlower.wxml

@@ -53,10 +53,10 @@
     <!-- <view class="lego-section" bindtap="goToPrize">
         <image class="lego" src="../../../static/image/lego_icon.png" />
     </view> -->
-    <view class="explain">
+    <!-- <view class="explain">
         <view class="explain-gut">小红花有什么用?</view>
         <view class="explain-gut">我们会启动很多好玩的活动,</view>
         <view class="explain-gut">到时候你将会有大大的惊喜哦!</view>
         <view class="explain-gut">请继续积攒小红花吧!</view>
-    </view>
+    </view> -->
 </view>

+ 2 - 1
pages/social/replyDetail/replyDetail.js

@@ -9,7 +9,8 @@ Page({
         postId: '',
         comment: [],
         replyInfo: '',
-        count: ''
+        count: '',
+        flowerNum: 0,
     },
     onLoad: function (option) {
         console.log(option)

+ 17 - 8
project.config.json

@@ -11,7 +11,7 @@
 		"minified": true,
 		"newFeature": true,
 		"coverView": true,
-		"autoAudits": false,
+		"autoAudits": true,
 		"showShadowRootInWxmlPanel": true,
 		"scopeDataCheck": false,
 		"checkInvalidKey": true,
@@ -25,18 +25,19 @@
 		"bundle": false,
 		"useCompilerModule": false,
 		"userConfirmedUseCompilerModuleSwitch": false,
-		"useMultiFrameRuntime": false,
+		"useMultiFrameRuntime": true,
 		"useApiHook": true,
 		"useIsolateContext": true,
 		"userConfirmedBundleSwitch": false,
 		"packNpmManually": false,
 		"packNpmRelationList": [],
-		"minifyWXSS": true
+		"minifyWXSS": true,
+		"useApiHostProcess": true
 	},
 	"compileType": "miniprogram",
 	"libVersion": "2.14.0",
 	"appid": "wx8961a3e5512f307c",
-	"projectname": "%E5%B0%8F%E5%AD%A6%E8%AF%AD%E6%96%87%E6%9C%97%E8%AF%BB",
+	"projectname": "%E5%B0%8F%E5%AD%A6%E8%AF%BE%E6%96%87%E6%9C%97%E8%AF%BB%E9%85%8D%E9%9F%B3",
 	"debugOptions": {
 		"hidedInDevtools": []
 	},
@@ -44,6 +45,14 @@
 	"simulatorType": "wechat",
 	"simulatorPluginLibVersion": {},
 	"condition": {
+		"search": {
+			"current": -1,
+			"list": []
+		},
+		"conversation": {
+			"current": -1,
+			"list": []
+		},
 		"plugin": {
 			"list": []
 		},
@@ -106,10 +115,10 @@
 					"scene": null
 				},
 				{
-					"name": "pages/index/index",
-					"pathName": "pages/index/index",
-					"query": "readId=1606387447807610",
-					"scene": 1007
+					"id": -1,
+					"name": "活动页面",
+					"pathName": "pages/activity/index/index",
+					"scene": null
 				}
 			]
 		}

BIN
static/.DS_Store


BIN
static/activity/.DS_Store


BIN
static/activity/1.png


BIN
static/activity/2.png


BIN
static/activity/3.png


BIN
static/activity/activity_bg.jpg


BIN
static/activity/comment.png


BIN
static/activity/comment1.png


BIN
static/activity/follow.png


BIN
static/activity/forward.png


BIN
static/activity/forward1.png


BIN
static/activity/left.png


BIN
static/activity/like.png


BIN
static/activity/like1.png


BIN
static/activity/popularity.png


BIN
static/activity/popularity1.png


BIN
static/activity/right.png


BIN
static/activity/rule-img.png


BIN
static/activity/strategy-img.png


BIN
static/activity/tab-bg.png


BIN
static/image/wx_firend.png


BIN
static/image/wx_icon.png


BIN
static/index/res_comment.png


BIN
static/index/res_eye.png


BIN
static/index/res_like.png


BIN
static/index/res_share.png


BIN
static/index/res_star.png


+ 52 - 8
templates/courses/courses.less

@@ -1,3 +1,4 @@
+// out: courses.wxss   
 .courses_container {
     width: 100%;
     height: 100%;
@@ -5,7 +6,7 @@
 
     .course_item {
         width: 100%;
-        height: 400rpx;
+        height: 460rpx;
         background: #fff;
         margin-bottom: 20rpx;
         padding-top: 20rpx;
@@ -36,22 +37,52 @@
                 font-size: 30rpx;
 
             }
+        }
+
+        .course_btn_wrapper {
+            width: 100%;
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            padding-left: 24rpx;
+            padding-right: 24rpx;
+            box-sizing: border-box;
 
-            .course_btn_wrapper{
-                width: 290rpx;
-                display: flex;
-                align-items: center;
-                justify-content: space-between;
-              }
             .course_btn {
                 // width: 270rpx;
                 display: flex;
                 align-items: center;
+
                 // justify-content: space-between;
                 .btn_icon {
                     width: 48rpx;
                     height: 46rpx;
-                    margin-right: 7rpx;
+                    margin-right: 10rpx;
+
+                    &.comment_icon {
+                        width: 22rpx;
+                        height: 25rpx;
+                    }
+
+                    &.play_icon {
+                        width: 30rpx;
+                        height: 25rpx;
+                    }
+
+                    &.like_icon {
+                        width: 29rpx;
+                        height: 26rpx;
+                    }
+
+                    &.share_icon {
+                        width: 33rpx;
+                        height: 30rpx;
+                    }
+
+                    &.collect_icon {
+                        width: 32rpx;
+                        height: 30rpx;
+                    }
                 }
 
                 .btn_text {
@@ -62,4 +93,17 @@
         }
 
     }
+
+    .no_work {
+        width: 100%;
+        height: 120rpx;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+
+        .no_work_text {
+            color: #373737;
+            font-size: 30rpx;
+        }
+    }
 }

+ 26 - 10
templates/courses/courses.wxml

@@ -1,21 +1,37 @@
 <!-- <wxs src="../../pages/commonWxs/format.wxs" module="format" /> -->
 <template name="courses">
     <view class="courses_container">
-        <view class="course_item" bindtap="goToReading" wx:for="{{coursesData}}" data-id="{{item.userRead.exampleId}}" wx:key="index">
+        <view class="course_item" bindtap="goToReading" wx:for="{{coursesData}}" data-id="{{item.userRead.exampleId}}" data-index="{{index}}" wx:key="index">
             <image class="course_icon" src="{{item.userRead.iconImg}}" lazy-load="true" />
+            <image class="activity_tigs" wx:if="{{item.isActivity}}" src="http://reader-wx.ai160.com/images/reader/activity/activity2.png" />
             <view class="course_info">
                 <text class="course_title">{{item.userRead.title}}</text>
-                <view class="course_btn_wrapper">
-                    <view class="collect course_btn" data-index="{{index}}" data-id="{{item.userRead.id}}" data-type="{{item.userRead.type}}" catchtap="courseCollectTap">
-                        <image class="collect_icon btn_icon" src="{{item.isFavorites ?'../../static/index/star_colored.png' :'../../static/index/star.png' }}" />
-                        <text class="collect_text btn_text">{{item.isFavorites? '收藏' : '收藏'}}</text>
+            </view>
+            <view class="course_btn_wrapper">
+                    <view class="collect course_btn" data-index="{{index}}" data-id="{{item.userRead.id}}" data-type="{{item.userRead.type}}">
+                        <image class="comment_icon btn_icon" src="../../static/index/res_comment.png" />
+                        <text class="collect_text btn_text">{{item.readAmount}}</text>
+                    </view>
+                    <view class="collect course_btn" data-index="{{index}}" data-id="{{item.userRead.id}}" data-type="{{item.userRead.type}}">
+                        <image class="play_icon btn_icon" src="../../static/index/res_eye.png" />
+                        <text class="collect_text btn_text">{{item.userRead.playAmount}}</text>
+                    </view>
+                    <view class="collect course_btn" data-index="{{index}}" data-id="{{item.userRead.id}}" data-type="{{item.userRead.type}}">
+                        <image class="like_icon btn_icon" src="../../static/index/res_like.png" />
+                        <text class="collect_text btn_text">{{item.userRead.likeAmount}}</text>
                     </view>
-                    <view class="share course_btn" catchtap="coursesOpenShare" data-author="{{item.user.nickName}}" data-index="{{index}}" data-id="{{item.userRead.id}}" data-avatar="{{item.user.avatar}}" data-uid="{{item.user.uid}}" data-shareImg="{{item.userRead.shareImg}}" data-icon="{{item.userRead.iconImg}}" data-title="{{item.userRead.title}}" data-type="{{item.userRead.type}}">
-                        <image class="share_icon btn_icon" src="../../static/index/share.png" />
-                        <text class="share_text btn_text">分享</text>
+                    <view class="share course_btn"  data-author="{{item.user.nickName}}" data-index="{{index}}" data-id="{{item.userRead.id}}" data-avatar="{{item.user.avatar}}" data-uid="{{item.user.uid}}" data-shareImg="{{item.userRead.shareImg}}" data-icon="{{item.userRead.iconImg}}" data-title="{{item.userRead.title}}" data-type="{{item.userRead.type}}">
+                        <image class="share_icon btn_icon" src="../../static/index/res_share.png" />
+                        <text class="share_text btn_text">{{item.userRead.shareAmount}}</text>
+                    </view>
+                    <view class="collect course_btn" data-index="{{index}}" data-id="{{item.userRead.id}}" data-type="{{item.userRead.type}}" >
+                        <image class="collect_icon btn_icon" src="../../static/index/res_star.png" />
+                        <text class="collect_text btn_text">{{item.userRead.favoritesAmount}}</text>
                     </view>
                 </view>
-            </view>
+        </view>
+        <view class="no_work" wx:if="{{noMoreWork}}">
+            <text class="no_work_text">已经到底啦!</text>
         </view>
     </view>
-</template>
+</template>

+ 51 - 7
templates/courses/courses.wxss

@@ -4,8 +4,9 @@
   background: #eee;
 }
 .courses_container .course_item {
+  position: relative;
   width: 100%;
-  height: 400rpx;
+  height: 460rpx;
   background: #fff;
   margin-bottom: 20rpx;
   padding-top: 20rpx;
@@ -18,6 +19,15 @@
   border-radius: 20rpx;
   margin: 0 auto;
 }
+.courses_container .course_item .activity_tigs {
+  position: absolute;
+  top: 270rpx;
+  left: 50%;
+  transform: translateX(-50%);
+  width: 704rpx;
+  height: 40rpx;
+  border-radius: 20rpx;
+}
 .courses_container .course_item .course_info {
   width: 704rpx;
   display: flex;
@@ -30,22 +40,56 @@
   color: #373737;
   font-size: 30rpx;
 }
-.courses_container .course_item .course_info .course_btn_wrapper {
-  width: 290rpx;
+.courses_container .course_item .course_btn_wrapper {
+  width: 100%;
   display: flex;
   align-items: center;
   justify-content: space-between;
+  padding-left: 24rpx;
+  padding-right: 24rpx;
+  box-sizing: border-box;
 }
-.courses_container .course_item .course_info .course_btn {
+.courses_container .course_item .course_btn_wrapper .course_btn {
   display: flex;
   align-items: center;
 }
-.courses_container .course_item .course_info .course_btn .btn_icon {
+.courses_container .course_item .course_btn_wrapper .course_btn .btn_icon {
   width: 48rpx;
   height: 46rpx;
-  margin-right: 7rpx;
+  margin-right: 10rpx;
+}
+.courses_container .course_item .course_btn_wrapper .course_btn .btn_icon.comment_icon {
+  width: 22rpx;
+  height: 25rpx;
+}
+.courses_container .course_item .course_btn_wrapper .course_btn .btn_icon.play_icon {
+  width: 30rpx;
+  height: 25rpx;
+}
+.courses_container .course_item .course_btn_wrapper .course_btn .btn_icon.like_icon {
+  width: 29rpx;
+  height: 26rpx;
+}
+.courses_container .course_item .course_btn_wrapper .course_btn .btn_icon.share_icon {
+  width: 33rpx;
+  height: 30rpx;
 }
-.courses_container .course_item .course_info .course_btn .btn_text {
+.courses_container .course_item .course_btn_wrapper .course_btn .btn_icon.collect_icon {
+  width: 32rpx;
+  height: 30rpx;
+}
+.courses_container .course_item .course_btn_wrapper .course_btn .btn_text {
   font-size: 28rpx;
   color: rgba(0, 0, 0, 0.6);
 }
+.courses_container .no_work {
+  width: 100%;
+  height: 120rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+.courses_container .no_work .no_work_text {
+  color: #373737;
+  font-size: 30rpx;
+}

+ 54 - 5
utils/APIClient.js

@@ -30,7 +30,7 @@ module.exports = {
       pageSize,
     }).url(url).send();
   },
-  // 获取首页人气推荐2.0 
+  // 获取首页人气推荐2.0
   getHotRecommend() {
     let url = getBaseUrl('wx/discovery');
     return request.getInstance().header({
@@ -62,7 +62,7 @@ module.exports = {
     }).url(url).send();
   },
   // 获取朗读详情
-  // 获取单课详情 
+  // 获取单课详情
   getClassDetail(id) {
     // let url = getProductUrl(`wx/lesson/${id}`);
     let url = getBaseUrl(`wx/userRead/readInfo/${id}`);
@@ -70,7 +70,7 @@ module.exports = {
       uid: wx.getStorageSync('uid')
     }).url(url).send();
   },
-  
+
   // 检查是否收藏过课程
   classIsLike(uid, data) {
     let url = getBaseUrl(`wx/favorites/isLike`);
@@ -450,6 +450,12 @@ module.exports = {
       uid: wx.getStorageSync('uid')
     }).data(data).url(url).method('POST').send();
   },
+  shareImgLog(data){
+    let url = getBaseUrl('wx/shareLog/saveShareImg');
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).data(data).url(url).method('POST').send();
+  },
   // 由分享进入的记录
   shareTagRecord(data) {
     let url = getBaseUrl('wx/ShareStatistics/click');
@@ -504,7 +510,7 @@ module.exports = {
       formId
     }).url(url).method('POST').send();
   },
-  // 获取签到信息 
+  // 获取签到信息
   getSignInData() {
     let url = getBaseUrl('wx/loginLog/signIn');
     return request.getInstance().header({
@@ -544,5 +550,48 @@ module.exports = {
     return request.getInstance().header({
       uid: wx.getStorageSync('uid')
     }).url(url).send();
+  },
+  /**
+   * 人气值活动接口
+   */
+  // 获取朗读作品
+  getActivityRead(grade) {
+    let url = getBaseUrl('wx/activityRead');
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).data({
+      grade
+    }).url(url).send();
+  },
+  // 获取我的朗读作品
+  getActivityMyRead() {
+    let url = getBaseUrl('wx/userRead/activityRead')
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).send();
+  },
+  // 获取排名前一百
+  getHotAmountTop() {
+    let url = getBaseUrl('wx/activityJoinUser/hotAmountTop')
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).send();
+  },
+  // 获取我的排名
+  getMyHotAmount() {
+    let url = getBaseUrl('wx/activityJoinUser/myHotAmount')
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).send();
+  },
+  // 点击分享连接进去
+  shareAddHotAmount(readId) {
+    let url = getBaseUrl('wx/userRead/shareAddHotAmount')
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid'),
+      contentType: 'application/x-www-form-urlencoded'
+    }).data({
+      readId
+    }).url(url).method('POST').send();
   }
-}
+}

+ 3 - 3
utils/const.js

@@ -5,6 +5,6 @@ module.exports = {
   productApi:  'https://reader-test.efunbox.cn/readerProduct/',
   // baseApi: 'https://reader.lingjiao.cn/readerBase/'
   // baseApi: 'https://readertest.lingjiao.cn:442/readerBase/'
-  baseApi: 'https://reader-api.ai160.com/'
-  // baseApi: 'https://reader-test.efunbox.cn/'
-}
+  // baseApi: 'https://reader-api.ai160.com/'
+  baseApi: 'https://reader-api.efunbox.cn/'
+}

+ 2 - 2
utils/httpUtilNoLogin.js

@@ -35,7 +35,7 @@ function wxLogin(successcallback, failcallback) {
     })
 }
 
-// 获取原来的 openid 和 session_key 
+// 获取原来的 openid 和 session_key
 /* 新增参数grade 需要给游客添加grade参数 */
 function getOpenidNoLogin(successcallback, failcallback, grade) {
     // if (wx.getStorageSync('user')) {
@@ -80,4 +80,4 @@ function getOpenidNoLogin(successcallback, failcallback, grade) {
 
 module.exports = {
     getOpenidNoLogin
-}
+}