Rorschach 4 yıl önce
ebeveyn
işleme
2a7a6cd678

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

+ 16 - 2
component/comment/comment.js

@@ -27,7 +27,8 @@ Component({
     commentNum: 0,
     commentList: [],
     ifGetFocus: false,
-    replyType: 'works' // 回复类型,works是回复作品,comment是回复评论
+    replyType: 'works' ,// 回复类型,works是回复作品,comment是回复评论
+    isScroll: true
   },
 
   /**
@@ -79,7 +80,20 @@ Component({
         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)

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

+ 2 - 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,7 @@
         </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}}" />

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

+ 23 - 13
component/share/share.js

@@ -43,7 +43,8 @@ Component({
       '在朗读中  提升孩子的思辨能力',
       '重温经典课文  享受亲子美好时光',
       '大声朗读  能帮助孩子提高写作能力'
-    ]
+    ],
+    shareStep: 'firend'
   },
 
   /**
@@ -209,7 +210,7 @@ Component({
           type: data.type,
           grade: data.grade,
           shareImg: data.shareImg,
-          // path: data.path,
+          shareStep: 'firend',
           QRData: {
             page: data.path,
             scene: data.scene
@@ -234,8 +235,6 @@ Component({
           groupType: data.groupType
         })
       }
-      this.poster();
-
       if (this.data.shareType === 'class') {
         console.log('课程分享')
         this.setData({
@@ -287,19 +286,19 @@ Component({
             content: '快去分享给小伙伴吧',
             confirmText: '我知道了',
             showCancel: false,
-            success(res) {
+            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();
-                }
+                setTimeout(() => {
+                  if (oRes.data.count > 0) {
+                    this.setData({
+                      flowerNum: oRes.data.count
+                    })
+                    this.flowerAnimationHandler();
+                  }
+                }, 500)
               })
             }
           })
@@ -334,12 +333,23 @@ Component({
       })
     },
     shareFriend: function () {
+      this.setData({
+        shareStep: 'circle'
+      })
+      this.poster();
       httpRequestApi.shareLog({
         readId: this.data.id,
         type: this.data.type,
         grade: this.data.grade
       }).success((res) => {
         console.log('分享记录', res)
+        if (res.data.count > 0) {
+          this.setData({
+            flowerNum: res.data.count,
+          }, () => {
+            this.flowerAnimationHandler();
+          })
+        }
       })
       this.triggerEvent('customevent', {})
     },

+ 16 - 14
component/share/share.wxml

@@ -4,26 +4,28 @@
        <view class="corss-line"></view>
        <view class="invite-text">分享作品</view>
        <view class="share-btn">
-            <!-- <button class="share-friend" open-type="share" catchtap="shareFriend">
-               <image  src="../../static/groupImg/weixin.png"></image>
-               <text>群/好友</text>
-            </button> -->
-            <view class="share-circle" catchtap="PreservationImg">
+            <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" 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="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>
+       <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">分享成功,获得3朵小红花奖励</view>
+       <view class="cover-text">再接再厉~</view>
+       <view class="cover-text">现在将海报分享到朋友圈</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}}" />

+ 43 - 31
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,7 +21,7 @@
     z-index: 1;
 }
 
-.invite-text{
+.invite-text {
     width: 120rpx;
     height: 30rpx;
     color: #262626;
@@ -43,14 +44,16 @@
 }
 
 .btn .bg {
-  display: block;
+    display: block;
     width: 500rpx;
     margin: 5% auto;
     height: 42rpx;
 }
-.btn text{
-  font-size: 28rpx;
+
+.btn text {
+    font-size: 28rpx;
 }
+
 .share-btn {
     display: flex;
     justify-content: center;
@@ -60,7 +63,7 @@
 .share-btn image {
     width: 55rpx;
     height: 55rpx;
-    margin-right:20rpx;
+    margin-right: 20rpx;
 }
 
 .share-btn view {
@@ -91,7 +94,8 @@
     /* width: 375rpx; */
     /* height: 667rpx; */
 }
-.cover-text{
+
+.cover-text {
     width: 100%;
     color: #fff;
     font-size: 30rpx;
@@ -102,12 +106,14 @@
     align-items: center;
     justify-content: center;
 }
-.cover-flower{
+
+.cover-flower {
     width: 32rpx;
     height: 34rpx;
-    margin-left:3rpx;
-    margin-right:3rpx;
+    margin-left: 3rpx;
+    margin-right: 3rpx;
 }
+
 .Preservation {
     position: absolute;
     left: 15%;
@@ -123,23 +129,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: 30rpx;
+    height: 85rpx;
+    width: 333rpx;
+    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;
+}

+ 29 - 22
component/video-swiper/index.js

@@ -22,7 +22,7 @@ Component({
         },
         noMoreWork: {
             type: Boolean,
-            value: true
+            value: false
         },
         duration: {
             type: Number,
@@ -323,6 +323,16 @@ Component({
                 });
                 return;
             }
+            this.setData({
+                addComeOut: 'add-one-come-out'
+            })
+            setTimeout(() => {
+                if (this.data.addComeOut) {
+                    this.setData({
+                        addComeOut: ''
+                    })
+                }
+            }, 1100)
             const isLike = e.target.dataset.islike ? e.target.dataset.islike : e.currentTarget.dataset.islike;
             console.log('isLike', isLike)
             if (isLike) {
@@ -410,29 +420,26 @@ Component({
             })
         },
         openShare: function (e) {
+            this.triggerEvent('openShare', e)
             const obj = e.currentTarget.dataset
-            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
-                }
-                this.setData({
-                    noScroll: 'noScroll'
-                })
-                this.shareDialog.share(data);
-                this.shareDialog.shareFriend();
-
+            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
             }
-            this.triggerEvent('openShare', e)
+            this.setData({
+                noScroll: 'noScroll'
+            })
+            this.shareDialog.share(data);
+            // this.shareDialog.shareFriend();
         },
         flowerAnimationHandler: function () {
             this.flowerBox = this.selectComponent("#flower-toast");

+ 48 - 1
component/video-swiper/index.less

@@ -1,4 +1,17 @@
-// out: index.wxss   
+// out: index.wxss 
+@keyframes numberMove {
+    from {
+        bottom: 20rpx;
+        opacity: 1;
+    }
+
+    to {
+        bottom: 200rpx;
+        font-size: 50rpx;
+        opacity: 0;
+    }
+}
+
 .swiper_container {
     width: 100%;
     height: 100%;
@@ -22,6 +35,7 @@
         margin-bottom: 20rpx;
         padding-bottom: 20rpx;
         overflow: hidden;
+        position: relative;
 
         &.no_swiper {
             max-height: 879rpx;
@@ -212,6 +226,7 @@
             .foot_right {
                 display: flex;
                 align-items: center;
+                position: relative;
             }
 
             .video_btn {
@@ -222,6 +237,38 @@
                 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;

+ 14 - 9
component/video-swiper/index.wxml

@@ -125,23 +125,27 @@
           <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>
+        <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>
-        </button>
+        </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}}">
+          <view class="animation-flower {{addComeOut}}">
+            <image class="animation-flower-icon" src="../../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}}</text>
+          <text>{{item.likes === 0 ? '点赞' : 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>
+          <text>{{item.commentAmount ===0 ?'评论' : '0'}}</text>
         </view>
       </view>
     </view>
@@ -150,6 +154,7 @@
         <image src="../../static/index/microphone.png" />
         <text>我要配音</text>
       </view>
+
     </view>
   </view>
   <view class="no_work" wx:if="{{!isSwiper && noMoreWork}}">

+ 42 - 0
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;
@@ -176,6 +188,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;
@@ -185,6 +198,35 @@
   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;

+ 8 - 19
pages/index/index.js

@@ -332,8 +332,6 @@ Page({
     wx.setNavigationBarTitle({
       title: '小学语文朗读配音'
     })
-    console.log('页面返回页面返回', this.data.fromLoginIndex)
-    console.log('页面返回页面返回', this.data.myIndex)
     if (this.data.fromLoginIndex) {
       console.log('页面返回页面返回', this.data.fromLoginIndex)
       let index = this.data.fromLoginIndex;
@@ -353,21 +351,12 @@ Page({
     }
     // 刷新课程资源的收藏数等
     if (this.data.myIndex === 2) {
-      console.log('去刷新')
       this.refreshCourseAmount()
     }
-
-    // const userInfo = wx.getStorageSync('user')
-    // console.log('userInfo',userInfo)
-    // if (userInfo.wechatName) {
-    //   this.setData({
-    //     isLogin: true
-    //   })
-    // } else {
-    //   this.setData({
-    //     isLogin: false
-    //   })
-    // }
+    this.setData({
+      shareImg: '',
+      shareId: ''
+    })
   },
 
   onHide: function () {
@@ -386,7 +375,7 @@ Page({
     httpRequestApi.getHotRecommendSecond(grade, pageNo, pageSize).success(res => {
       console.log(res)
       const recommendRes = res.data.data.list;
-      if (recommendRes.length === 0) {
+      if (recommendRes.length <= 0) {
         this.setData({
           noMoreWork: true
         })
@@ -400,7 +389,7 @@ Page({
   formatWorksList(list, notSet) {
     // const tempList = [];
     console.log('列表长度列表长度', list.length)
-    if (list.length < 6 || list.length === 0) {
+    if (list.length < 3 || list.length === 0) {
       this.setData({
         noMoreWork: true
       })
@@ -775,12 +764,12 @@ Page({
     })
   },
   onShareAppMessage: function (res) {
+    console.log('onShareAppMessage>>>>>>>>>>>>')
     if (res.from === 'button') {
       return {
         title: '请欣赏我的课文朗读作品,点赞+评论。',
         path: `/pages/index/index?readId=${this.data.shareId}`,
         imageUrl: this.data.shareImg
-
       }
     } else {
       return {
@@ -879,7 +868,7 @@ Page({
       console.log('资源', this.data.coursesData)
       this.setData({
         coursesData: this.data.coursesData.concat(res.data.data.list),
-        noMoreWork: res.data.data.list <= 0 ? true : false
+        noMoreWork: res.data.data.list.length <= 0 ? true : false
       }, () => {
         console.log(this.data.coursesData)
       })

+ 32 - 5
pages/reading/reading.js

@@ -44,6 +44,8 @@ Page({
             isshowbtn: false, //是否显示按钮
             title: "小学语文朗读配音", //标题
         },
+        isScroll: true,
+        noMoreWork: false
     },
     onLoad: function (option) {
         console.log(option);
@@ -659,8 +661,11 @@ Page({
             });
             this.setData({
                 videoList: this.data.videoList,
-                totalSize: res.data.data.totalSize
+                totalSize: res.data.data.totalSize,
+                noMoreWork: readInfo.length <= 0 ? true : false
+
             })
+
         });
     },
     // 评论区点击
@@ -680,6 +685,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)
 
@@ -702,9 +715,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: '请欣赏我的课文朗读作品,点赞+评论。',
@@ -724,7 +737,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,
@@ -764,4 +777,18 @@ Page({
         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');
+    },
 })

+ 4 - 4
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,10 +74,10 @@
             <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" 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>
 <view class="score_dialog" wx:if="{{ifScoreDialogShow}}">

+ 3 - 2
project.config.json

@@ -16,13 +16,14 @@
     "checkInvalidKey": true,
     "checkSiteMap": true,
     "uploadWithSourceMap": true,
-    "useMultiFrameRuntime": false,
+    "useMultiFrameRuntime": true,
     "useApiHook": true,
     "babelSetting": {
       "ignore": [],
       "disablePlugins": [],
       "outputPath": ""
     },
+    "bundle": false,
     "useIsolateContext": true,
     "useCompilerModule": true,
     "userConfirmedUseCompilerModuleSwitch": false,
@@ -30,7 +31,7 @@
     "packNpmManually": false,
     "packNpmRelationList": [],
     "minifyWXSS": true,
-    "bundle": false
+    "useApiHostProcess": true
   },
   "compileType": "miniprogram",
   "libVersion": "2.14.0",

BIN
static/image/wx_icon.png


+ 2 - 3
templates/courses/courses.wxml

@@ -7,7 +7,6 @@
                 <text class="course_title">{{item.userRead.title}}</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.userRead.commentAmount}}</text>
@@ -20,11 +19,11 @@
                         <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}}">
+                    <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}}" catchtap="courseCollectTap">
+                    <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.shareAmount}}</text>
                     </view>