Rorschach 4 anni fa
parent
commit
1a2bfe0b1b

+ 26 - 2
component/comment/comment.js

@@ -73,8 +73,8 @@ 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
       })
@@ -117,6 +117,12 @@ Component({
             [strImg]: true
           })
         }
+        if (res.data.count > 0) {
+          this.setData({
+            flowerNum: res.data.count
+          })
+          this.flowerAnimationHandler();
+        }
 
       });
     },
@@ -132,6 +138,13 @@ Component({
           this.setData({
             inputValue: '',
           })
+          if (res.data.count > 0) {
+            this.setData({
+              flowerNum: res.data.count
+            })
+            this.flowerAnimationHandler();
+          }
+
         })
       });
     },
@@ -160,6 +173,12 @@ Component({
             replyType: 'works',
             ifGetFocus: false
           })
+          if (res.data.count > 0) {
+            this.setData({
+              flowerNum: res.data.count
+            })
+            this.flowerAnimationHandler();
+          }
         });
       });
     },
@@ -190,6 +209,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.wxml

@@ -36,4 +36,5 @@
         <input name="send_input" 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>

+ 31 - 35
component/share/share.js

@@ -158,7 +158,7 @@ Component({
             wx.hideLoading()
           },
           fail: (res) => {
-            console.log('史称失败',res)
+            console.log('史称失败', res)
             wx.hideLoading();
           }
         })
@@ -195,7 +195,7 @@ Component({
       });
     },
     share: function (data) {
-      console.log('分享内容',data)
+      console.log('分享内容', data)
       if (this.data.shareType === 'works') {
 
         this.setData({
@@ -205,9 +205,9 @@ 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,
           QRData: {
@@ -289,29 +289,21 @@ Component({
             showCancel: false,
             success(res) {
               console.log('用户点击确定')
+              httpRequestApi.shareImgLog({
+                readId: this.data.id,
+                type: this.data.type,
+                grade: this.data.grade
+              }).success((oRes) => {
+                if (oRes.data.count > 0) {
+                  this.setData({
+                    flowerNum: oRes.data.count
+                  })
+                  this.flowerAnimationHandler();
+                }
+              })
             }
           })
-         /*  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
@@ -343,26 +335,30 @@ Component({
     },
     shareFriend: function () {
       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)
       })
       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"
+  }
 }

+ 6 - 2
component/share/share.wxml

@@ -9,17 +9,21 @@
                <text>群/好友</text>
             </button> -->
             <view class="share-circle" catchtap="PreservationImg">
-               <image  src="../../static/groupImg/circle.png"></image>
+               <image  src="../../static/image/wx_firend.png"></image>
                <text>保存海报</text>
             </view>           
        </view>
    </view>
    <cover-view class="share-img" wx:if="{{imgUrls}}" id="imgArea">
        <cover-image class="img" src="{{imgUrls}}"  catchtap="nothing"></cover-image>
+       <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 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>
+</view>
+<flowerBox id="flower-toast" flowerNum="{{flowerNum}}" />

+ 24 - 5
component/share/share.wxss

@@ -60,12 +60,13 @@
 .share-btn image {
     width: 55rpx;
     height: 55rpx;
+    margin-right:20rpx;
 }
 
 .share-btn view {
     display: flex;
     flex-direction: row;
-    justify-content: space-around;
+    justify-content: center;
     align-items: center;
     font-size: 30rpx;
     height: 85rpx;
@@ -82,13 +83,31 @@
     /* 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: 30rpx;
+    text-align: center;
+    display: flex;
+    flex-direction: row;
+    margin-bottom: 5rpx;
+    align-items: center;
+    justify-content: center;
+}
+.cover-flower{
+    width: 32rpx;
+    height: 34rpx;
+    margin-left:3rpx;
+    margin-right:3rpx;
+}
 .Preservation {
     position: absolute;
     left: 15%;

+ 28 - 15
component/video-swiper/index.js

@@ -65,7 +65,8 @@ Component({
         _invalidDown: 0,
         _videoContexts: [],
         inputValue: '',
-        showControl: 0
+        showControl: 0,
+        flowerNum: 0
     },
     lifetimes: {
         attached: function attached() {
@@ -292,12 +293,18 @@ 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`
                 httpRequestApi.collectClass(data).success((res) => {
@@ -337,11 +344,14 @@ 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,
                     })
                 });
@@ -401,8 +411,6 @@ Component({
         },
         openShare: function (e) {
             const obj = e.currentTarget.dataset
-            console.log('分享的dataset', obj)
-            console.log('分享', e)
             if (1) {
                 this.shareDialog = this.selectComponent("#share-dialog");
                 const data = {
@@ -412,20 +420,25 @@ Component({
                     title: obj.title,
                     path: `pages/index/index`,
                     scene: obj.id,
-                    type:obj.type,
-                    grade:obj.grade,
+                    type: obj.type,
+                    grade: obj.grade,
                     productId: 1,
-                    shareImg:obj.shareImg
-                    // tip: this.data.tip,
+                    shareImg: obj.shareImg
                 }
-                // console.log(data)
                 this.setData({
                     noScroll: 'noScroll'
                 })
                 this.shareDialog.share(data);
+                this.shareDialog.shareFriend();
+
             }
             this.triggerEvent('openShare', e)
         },
+        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) {
                 wx.navigateTo({

+ 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"
     }
 }

+ 93 - 150
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>
+            <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,64 +69,45 @@
       </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="{{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="{{!item.showMyBtn}}" class="time">
-            <text>发布时间:{{item.time}}</text>
-          </view>
-          <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/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 && !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/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>
-      <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>
+    <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"
@@ -165,53 +115,46 @@
         bindwaiting="onWaiting"
         bindprogress="onProgress"
         bindloadedmetadata="onLoadedMetaData" -->
-      </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>收藏</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}}">
+    </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>收藏</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> -->
-           <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_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>
-            
+        <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="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 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>
     </view>
-    <view class="no_work" wx:if="{{!isSwiper && noMoreWork}}" >
-      <text class="no_work_text">已经到底啦!</text>
+    <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" shareId="{{id}}" />

+ 6 - 5
pages/index/index.js

@@ -775,10 +775,6 @@ Page({
     })
   },
   onShareAppMessage: function (res) {
-    console.log('点击分享按钮', res)
-    console.log('点击分享按钮', this.data.shareTitle)
-    console.log('点击分享按钮', this.data.shareId)
-    console.log('点击分享按钮', this.data.shareImg)
     if (res.from === 'button') {
       return {
         title: '请欣赏我的课文朗读作品,点赞+评论。',
@@ -794,7 +790,6 @@ Page({
     }
   },
   openShare: function (e) {
-    console.log('用户点击分享按钮123', e)
     this.setData({
       shareTitle: e.detail.currentTarget.dataset.title,
       shareId: e.detail.currentTarget.dataset.id,
@@ -985,5 +980,11 @@ 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();
   },
 })

+ 2 - 1
pages/index/index.json

@@ -6,7 +6,8 @@
         "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": {

+ 11 - 0
pages/reading/reading.js

@@ -573,6 +573,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,
@@ -753,4 +759,9 @@ 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();
+    },
 })

+ 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
 }

+ 3 - 3
pages/reading/reading.wxml

@@ -79,8 +79,7 @@
 <view class="comment_section" catchtouchmove="touchMove" catchtap="commentTap" data-type="blank" wx:if="{{commentShow}}">
     <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 - 1
pages/social/replyDetail/replyDetail.js

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

BIN
static/image/wx_firend.png


+ 6 - 0
utils/APIClient.js

@@ -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');