Rorschach 4 years ago
parent
commit
64d47fbd68

+ 1 - 0
app.wxss

@@ -5,6 +5,7 @@ page {
   overflow-x: hidden;
   color: #444;
   font-family: PingFang SC, Microsoft Yahei, Source Han Sans CN, SimHei;
+  background: #eee;
 }
 
 view {

+ 21 - 14
component/comment/comment.js

@@ -59,8 +59,8 @@ Component({
         this.setData({
           commentList: this.data.commentList,
           commentNum: commentNum
-        },()=>{
-          console.log('评论列表',this.data.commentList)
+        }, () => {
+          console.log('评论列表', this.data.commentList)
         })
       });
     },
@@ -73,6 +73,13 @@ Component({
       console.log('showControl', this.data.commentList[index].showControl)
     },
 
+    textInput: function(e){
+      console.log('键入',e.detail.value)
+      this.setData({
+        inputValue: e.detail.value
+      })
+    },
+
     // 评论作品
     sendReply: function sendReply(e) {
       console.log('sendReply', e.detail.value)
@@ -80,16 +87,16 @@ Component({
         let data = {
           columnId: this.data.commentId,
           colunmNames: 'what',
-          detailDesc: e.detail.value,
+          detailDesc: e.detail.value ? e.detail.value : this.data.inputValue,
         }
         this.replyWorks(data);
       }
       if (this.data.replyType === 'comment') {
         let data = {
           postsId: this.data.postId,
-          content: e.detail.value
+          content: e.detail.value ? e.detail.value : this.data.inputValue
         }
-        console.log(321232123123,data)
+        console.log(321232123123, data)
 
         this.replyComment(data);
       }
@@ -101,16 +108,16 @@ Component({
       let postId = e.currentTarget.dataset.id ? e.currentTarget.dataset.id : e.target.dataset.id;
       let index = e.currentTarget.dataset.index || e.currentTarget.dataset.index === 0 ? e.currentTarget.dataset.index : e.target.dataset.index;
       httpRequestApi.likeCommend(postId).success(res => {
-        console.log('点赞点赞点赞',res.data);
+        console.log('点赞点赞点赞', res.data);
         const str = `commentList[${index}].likes`;
         const strImg = `commentList[${index}].isLike`;
-        if(res.data.data){
+        if (res.data.data) {
           this.setData({
             [str]: res.data.data,
             [strImg]: true
           })
         }
-        
+
       });
     },
     // 回复作品
@@ -161,12 +168,12 @@ Component({
       httpRequestApi.getReply(this.uid, columnId, 1, 10).success((res) => {
         const commentList = res.data.data.list;
         commentList.forEach((item, index) => {
-          console.log('回复列表',index)
-          console.log('回复列表',this.data.postIndex)
-          
+          console.log('回复列表', index)
+          console.log('回复列表', this.data.postIndex)
+
           if (index === this.data.postIndex) {
             let replyList = item.replyVOList;
-            console.log('回复列表',replyList)
+            console.log('回复列表', replyList)
             let str = `commentList[${index}].replyList`;
             let strShow = `commentList[${index}].showControl`;
             let strReply = `commentList[${index}].replyCount`;
@@ -174,8 +181,8 @@ Component({
               [str]: replyList,
               [strShow]: 10,
               [strReply]: replyList.length
-            },()=>{
-              console.log('刷新后列表',this.data.commentList)
+            }, () => {
+              console.log('刷新后列表', this.data.commentList)
             })
             return;
           };

+ 22 - 7
component/comment/comment.less

@@ -175,21 +175,36 @@
 
     .comment_input {
         width: 100%;
-        height: 180rpx;
-        background: #eeeded;
+        height: 205rpx;
+        background: #eee;
         position: fixed;
         bottom: 0;
         z-index: 9999;
+        padding-left: 24rpx;
+        box-sizing: border-box;
+        display: flex;
+        align-items: center;
 
-        input {
-            width: 100%;
-            height: 100%;
-            background: #eeeded;
-
+        .send_input {
+            width: 575rpx;
+            height: 94rpx;
+            background: #fff;
+            border-radius: 10rpx;
+            padding-left: 50rpx;
             ::placeholder{
                 text-indent: 10rpx;
                 color: #000;
             }
         }
+
+        .send_btn{
+            width: 120rpx;
+            height: 48rpx;
+            line-height: 48rpx;
+            text-align: center;
+            color: #42a8ff;
+            font-size: 34rpx;
+
+        }
     }
 }

+ 2 - 1
component/comment/comment.wxml

@@ -33,6 +33,7 @@
         </view>
     </view>
     <view class="comment_input">
-        <input confirm-type="hold" focus="{{ifGetFocus}}" value="{{inputValue}}" bindconfirm="sendReply" placeholder="       给好评..." />
+        <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>
 </scroll-view>

+ 21 - 7
component/comment/comment.wxss

@@ -143,18 +143,32 @@
 }
 .comment_container .comment_input {
   width: 100%;
-  height: 180rpx;
-  background: #eeeded;
+  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 input {
-  width: 100%;
-  height: 100%;
-  background: #eeeded;
+.comment_container .comment_input .send_input {
+  width: 575rpx;
+  height: 94rpx;
+  background: #fff;
+  border-radius: 10rpx;
+  padding-left: 50rpx;
 }
-.comment_container .comment_input input ::placeholder {
+.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;
+}

+ 3 - 3
component/my/my.wxml

@@ -14,10 +14,10 @@
             <view class='avatar-nickname'>年级:{{myData.userInfo.gradeText  }}</view>
             <image class="edit-img" src="../../static/index/edit.png" />
             <view class='mine-category'>
-              <view class='amount-text'>播放{{ myData.playAmount || 0 }} </view>
+              <view class='amount-text'>播放 {{ myData.playAmount || 0 }} </view>
               <!-- <view class='amount-text'>{{ myData.user.likeAmount || 0 }} 赞</view> -->
-              <view class='amount-text'>粉丝{{ myData.fansAmount || 0 }}</view>
-              <view class='amount-text'>作品{{ myData.readAmount || 0 }} </view>
+              <view class='amount-text'>粉丝 {{ myData.fansAmount || 0 }}</view>
+              <view class='amount-text'>作品 {{ myData.readAmount || 0 }} </view>
             </view>
           </view>
         </view>

+ 0 - 4
component/my/my.wxss

@@ -11,10 +11,6 @@
   margin-bottom: 15rpx;
 }
 
-page {
-  background: #faf7fa;
-}
-
 .follow-details {
   width: 100%;
   box-sizing: border-box;

+ 20 - 5
component/share/share.js

@@ -205,6 +205,9 @@ Component({
           iconImg: data.iconImg,
           title: data.title,
           productId: data.productId,
+          id:data.scene,
+          type:data.type,
+          grade:data.grade,
           // path: data.path,
           QRData: {
             page: data.path,
@@ -287,7 +290,7 @@ Component({
               console.log('用户点击确定')
             }
           })
-          const data = {};
+         /*  const data = {};
           // 团购分享记录
           if (this.data.shareType === 'group') {
             data.shareTypeEnum = 'POSTER';
@@ -299,9 +302,14 @@ Component({
             data.shareTypeEnum = 'POSTER';
             data.shareContentEnum = 'READ';
             data.productId = this.data.productId;
-          }
-          httpRequestApi.shareRecord(data).success((res) => {
-            console.log(res)
+          } */
+          
+          httpRequestApi.shareLog({
+            readId:this.data.id,
+            type:this.data.type,
+            grade:this.data.grade
+          }).success((res) => {
+            console.log('分享记录',res)
           })
 
           this.setData({
@@ -333,6 +341,13 @@ Component({
       })
     },
     shareFriend: function () {
+      httpRequestApi.shareLog({
+        readId:this.data.id,
+        type:this.data.type,
+        grade:this.data.grade
+      }).success((res) => {
+        console.log('分享记录',res)
+      })
       this.triggerEvent('customevent', {})
     }
   },
@@ -343,7 +358,7 @@ Component({
       console.log(res.target)
     }else{
       return {
-        title: '课文朗读,从未如此有趣',
+        title: '课文朗读,从未如此有趣',
         path: '/pages/index/index'
       }
     }

+ 1 - 1
component/share/share.wxss

@@ -81,7 +81,7 @@
     /* top: 30rpx; */
     width: 510rpx;
     height: 893rpx;
-    margin: 196rpx auto;
+    margin: 63rpx auto;
     /* width: 375rpx; */
     /* height: 667rpx; */
 }

+ 24 - 6
component/video-swiper/index.js

@@ -169,6 +169,13 @@ Component({
         },
         onPlayList: function onPlayList(e) {
             console.log('lastVideoId', this.data.lastVideoId);
+            console.log('lastVideoId', e);
+            httpRequestApi.playLogReport({
+                userReadId: e.target.dataset.id,
+                playStopTime: 1000
+            }).success(res => {
+                console.log('播放记录', res)
+            })
             if (this.data.lastVideoId && e.target.id !== this.data.lastVideoId) {
                 const lastVideo = wx.createVideoContext(this.data.lastVideoId, this)
                 lastVideo.stop();
@@ -277,10 +284,16 @@ Component({
             if (this.data.curQueue.length <= 0) {
                 let str = `videoList[${index}].isFavorite`
                 httpRequestApi.collectClass(data).success((res) => {
-                    this.setData({
-                        [str]: !this.data.videoList[index].isFavorite
+                    let isCollect = res.data.data.status === 'NORMAL' ? true : false;
+                    // this.setData({
+                    //     [str]: isCollect
+                    // })
+                    this.triggerEvent('collectTap',{
+                        index,
+                        isCollect
                     })
                 });
+                
             } else {
                 let str = `curQueue[${index}].isFavorite`
                 httpRequestApi.collectClass(data).success((res) => {
@@ -320,9 +333,12 @@ 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.setData({
+                    //     [likeStr]: true,
+                    //     [likeNumStr]: this.data.videoList[index].likes + 1
+                    // })
+                    this.triggerEvent('likeTap',{
+                        index,
                     })
                 });
             }
@@ -334,7 +350,7 @@ Component({
                 content: '作品将被永久删除,无法找回。',
                 confirmText: '确认',
                 cancelText: '取消',
-                success:(res) => {
+                success: (res) => {
                     if (res.confirm) {
                         /* let data = {
                             id: e.currentTarget.dataset.id,
@@ -392,6 +408,8 @@ Component({
                     title: obj.title,
                     path: `pages/index/index`,
                     scene: obj.id,
+                    type:obj.type,
+                    grade:obj.grade,
                     productId: 1
                     // tip: this.data.tip,
                 }

+ 31 - 20
component/video-swiper/index.less

@@ -3,6 +3,7 @@
     height: 100%;
     // padding-top: 20rpx;
     background: #eee;
+
     .video-swiper {
         width: 100%;
         height: 100%;
@@ -17,8 +18,10 @@
         width: 100%;
         // height: 100%;
         background: #ffffff;
-        margin-bottom: 10rpx;
+        margin-bottom: 20rpx;
+        padding-bottom: 20rpx;
         overflow: hidden;
+
         &.no_swiper {
             max-height: 879rpx;
             min-height: 640rpx;
@@ -34,7 +37,7 @@
             padding-right: 20rpx;
             position: relative;
 
-            .tag_icon{
+            .tag_icon {
                 width: 66rpx;
                 height: 34rpx;
                 position: absolute;
@@ -43,7 +46,7 @@
             }
 
             .user_box {
-                width: 400rpx;
+                width: 378rpx;
                 height: 100%;
                 display: flex;
                 align-items: center;
@@ -56,25 +59,27 @@
                     border-radius: 50%;
 
                 }
-                .avatar_fans{
+
+                .avatar_fans {
                     width: 34rpx;
                     height: 34rpx;
                     position: absolute;
                     bottom: 5rpx;
-    left: 26rpx;
+                    left: 26rpx;
                 }
 
                 .user_right {
                     margin-left: 16rpx;
                     display: flex;
                     align-items: center;
+
                     .nickname {
                         font-size: 30rpx;
                         color: rgba(0, 0, 0, 0.80);
-                        font-weight: 600;
+                        font-weight: bold;
                     }
 
-                    .efun_tag{
+                    .efun_tag {
                         width: 68rpx;
                         height: 30rpx;
                         margin-left: 4rpx;
@@ -94,7 +99,7 @@
                 display: flex;
                 align-items: center;
 
-                
+
                 .delete {
                     display: flex;
                     flex-direction: column;
@@ -112,6 +117,7 @@
                         color: rgba(0, 0, 0, 0.80);
                     }
                 }
+
                 .hide {
                     display: flex;
                     flex-direction: column;
@@ -119,6 +125,7 @@
                     margin-right: 23rpx;
                     padding-top: 3rpx;
                     box-sizing: border-box;
+
                     .hide_image {
                         width: 32rpx;
                         height: 33rpx;
@@ -137,16 +144,17 @@
             width: 100%;
             height: 422rpx;
         }
-        .video_place{
+
+        .video_place {
             width: 100%;
             height: 430rpx;
-            background: rgba(0,0,0,.3);
+            background: rgba(0, 0, 0, .3);
             display: flex;
             align-items: center;
             justify-content: center;
             position: relative;
 
-            .play_btn{
+            .play_btn {
                 width: 100rpx;
                 height: 100rpx;
                 position: absolute;
@@ -156,24 +164,24 @@
                 margin: 0 auto;
             }
 
-            .place_img{
+            .place_img {
                 width: 100%;
                 height: 100%;
 
             }
         }
 
-        .video_item_dialog{
+        .video_item_dialog {
             width: 100%;
             height: 422rpx;
-            background: rgba(0,0,0,.3);
+            background: rgba(0, 0, 0, .3);
             display: flex;
             align-items: center;
             justify-content: center;
             position: absolute;
             z-index: 1;
 
-            .video_item_dialog_img{
+            .video_item_dialog_img {
                 width: 215rpx;
                 height: 215rpx;
 
@@ -182,18 +190,19 @@
 
         .video_title {
             width: 100%;
-            height: 45rpx;
+            height: 58rpx;
             font-size: 34rpx;
             color: #373737;
             display: flex;
             align-items: center;
-            padding-left: 0rpx;
+            padding-left: 27rpx;
+            font-weight: bold;
         }
 
         .foot_box {
             width: 100%;
             height: 65rpx;
-            margin-top: 31rpx;
+            margin-top: 43rpx;
             display: flex;
             justify-content: space-between;
             padding-left: 20rpx;
@@ -242,12 +251,14 @@
 
         .btn_wrapper {
             width: 100%;
-            height: 110rpx;
+            height: 111rpx;
             display: flex;
             align-items: center;
             justify-content: center;
-            margin-top: 10rpx;
+            margin-top: 45rpx;
             margin-bottom: 10rpx;
+            padding-bottom: 20rpx;
+            box-sizing: border-box;
 
             .reading_btn {
                 width: 271rpx;

+ 5 - 4
component/video-swiper/index.wxml

@@ -24,7 +24,7 @@
             
         </view>
           <view wx:if="{{!item.showMyBtn}}" class="time">
-            <text>发布时间:{{item.time}}</text>
+            <text>发布时间{{item.time}}</text>
           </view>
           <view wx:if="{{item.showMyBtn}}" class="my_btn">
             <view catchtap="delete" data-id="{{item.id}}">
@@ -116,7 +116,7 @@
             
         </view>
           <view wx:if="{{!item.showMyBtn}}" class="time">
-            <text>发布时间:{{item.time}}</text>
+            <text>发布时间{{item.time}}</text>
           </view>
           <view wx:if="{{item.showMyBtn && !item.ifCheck}}" class="my_btn">
             <view class="delete" catchtap="delete" data-id="{{item.id}}">
@@ -149,6 +149,7 @@
         autoplay="{{true}}"
         object-fit="contain"
         data-index="{{index}}"
+        data-id="{{item.id}}"
         bindplay="onPlayList"
         bindended="onEndedList"
         binderror="onError"
@@ -168,7 +169,7 @@
         
       <view class="video_title">
         <text>
-          {{item.title}}
+          {{item.title}}
         </text>
           
       </view>
@@ -179,7 +180,7 @@
               <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-type="{{item.type}}">
+          <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-grade="{{item.grade}}" data-type="{{item.type}}">
               <image class="share_btn_icon" src="../../static/index/share.png" />
               <text>分享</text>
           </view>

+ 12 - 8
component/video-swiper/index.wxss

@@ -12,7 +12,8 @@
 .swiper_container .swiper_item {
   width: 100%;
   background: #ffffff;
-  margin-bottom: 10rpx;
+  margin-bottom: 20rpx;
+  padding-bottom: 20rpx;
   overflow: hidden;
 }
 .swiper_container .swiper_item.no_swiper {
@@ -37,7 +38,7 @@
   top: 0;
 }
 .swiper_container .swiper_item .head_box .user_box {
-  width: 400rpx;
+  width: 378rpx;
   height: 100%;
   display: flex;
   align-items: center;
@@ -64,7 +65,7 @@
 .swiper_container .swiper_item .head_box .user_box .user_right .nickname {
   font-size: 30rpx;
   color: rgba(0, 0, 0, 0.8);
-  font-weight: 600;
+  font-weight: bold;
 }
 .swiper_container .swiper_item .head_box .user_box .user_right .efun_tag {
   width: 68rpx;
@@ -155,17 +156,18 @@
 }
 .swiper_container .swiper_item .video_title {
   width: 100%;
-  height: 45rpx;
+  height: 58rpx;
   font-size: 34rpx;
   color: #373737;
   display: flex;
   align-items: center;
-  padding-left: 0rpx;
+  padding-left: 27rpx;
+  font-weight: bold;
 }
 .swiper_container .swiper_item .foot_box {
   width: 100%;
   height: 65rpx;
-  margin-top: 31rpx;
+  margin-top: 43rpx;
   display: flex;
   justify-content: space-between;
   padding-left: 20rpx;
@@ -207,12 +209,14 @@
 }
 .swiper_container .swiper_item .btn_wrapper {
   width: 100%;
-  height: 110rpx;
+  height: 111rpx;
   display: flex;
   align-items: center;
   justify-content: center;
-  margin-top: 10rpx;
+  margin-top: 45rpx;
   margin-bottom: 10rpx;
+  padding-bottom: 20rpx;
+  box-sizing: border-box;
 }
 .swiper_container .swiper_item .btn_wrapper .reading_btn {
   width: 271rpx;

+ 33 - 6
pages/index/index.js

@@ -187,7 +187,8 @@ Page({
           recommendTotalNo: 1
         }, () => {
           this.formatWorksList(tempList, true);
-          this.getHotRecommend();
+          console.log('插入数据')
+          // this.getHotRecommend();
           // return;
         })
         // this.showPage()
@@ -196,6 +197,7 @@ Page({
     if (options && options.index) {
       this.updateData(options.index)
     } else {
+      console.log('又加载一边')
       this.updateData(0)
     }
     setTimeout(() => {
@@ -416,6 +418,7 @@ Page({
       temp.tagUrl = item.userRead.tag ? item.userRead.tag === 'HOT' ? '../../static/index/hot_tag.png' : '../../static/index/new_tag.png' : ''
       temp.status = item.userRead.status;
       temp.coverImg = item.userRead.coverImg;
+      temp.grade=item.userRead.grade
       temp.videoShow = false;
       this.data.videoList.push(temp);
       // tempList.push(temp);
@@ -433,11 +436,11 @@ Page({
     if (flag) {
       httpRequestApi.getUserWorksInfo().success(res => {
         const userInfo = this.formatGrade(res.data.data.user);
-        const str = 'myData.userInfo.nickName';
+        const str = 'myData.userInfo.wechatName';
         const avatarStr = 'myData.userInfo.avatar';
         const gradeTextStr = 'myData.userInfo.gradeText';
         this.setData({
-          [str]: userInfo.nickName,
+          [str]: userInfo.wechatName,
           [avatarStr]: userInfo.avatar,
           [gradeTextStr]: userInfo.gradeText
         })
@@ -625,7 +628,12 @@ Page({
       console.log(123123, res)
       console.log('mydata', this.data.myData)
       const myList = res.data.data;
-      if (myList.length === 0) return;
+      if (myList.length === 0) {
+        this.setData({
+          videoList:[]
+        })
+        return
+      }
       // this.formatWorksList(myList)
       // const recommendWorks = [];
       const myWorks = [];
@@ -653,6 +661,7 @@ Page({
         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;
         myWorks.push(temp);
@@ -758,7 +767,7 @@ Page({
       }
     } else {
       return {
-        title: '课文朗读,从未如此有趣',
+        title: '课文朗读,从未如此有趣',
         path: '/pages/index/index',
       }
     }
@@ -904,5 +913,23 @@ Page({
       })
       this.shareDialog.share(data);
     }
-  }
+  },
+  collectTap: function(e){
+    console.log('点击收藏首页',e)
+    const index = e.detail.index;
+    let str = `videoList[${index}].isFavorite`
+    this.setData({
+     [str]: e.detail.isCollect
+    })
+  },
+  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
+   })
+  },
 })

+ 4 - 4
pages/index/index.wxml

@@ -11,8 +11,9 @@
       <view class="change_item" bindtap="changeGrade" data-code="PRIMARY_THREE_GRADE">三年级</view>
       <view class="change_item" bindtap="changeGrade" data-code="PRIMARY_SENIOR_GRADE">四年级</view>
     </view>
-    <view class="change_row">
+    <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>
   </view>
 </view>
@@ -33,7 +34,7 @@
   </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" binddelHideMyWork="delHideMyWork" bindchange="videoChange">
+  <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">
     <!-- bindplay="onPlay"
   bindpause="onPause"
   bindtimeupdate="onTimeUpdate"
@@ -48,9 +49,8 @@
   </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 /> -->

+ 6 - 2
pages/index/index.wxss

@@ -11,7 +11,7 @@
 
 .container {
   /* background: rgba(242, 242, 242, 1); */
-  background: #eee;
+  /* background: #eee; */
   height: 100%;
   /* overflow: hidden; */
 }
@@ -362,7 +362,7 @@
 
 .change_grade .change_brage_wrapper {
   width: 548rpx;
-  height: 453rpx;
+  /* height: 453rpx; */
   background: #fff;
   border-radius: 20rpx;
 }
@@ -395,4 +395,8 @@
   justify-content: center;
   font-size: 36rpx;
   color: #fff;
+}
+
+.change_grade .change_brage_wrapper .change_item_blank{
+  background: #ffffff !important;
 }

+ 30 - 2
pages/mycollection/mycollection.js

@@ -66,6 +66,7 @@ Page({
       temp.isFans = true;
       temp.isFavorite = true;
       temp.coverImg = item.userRead.coverImg;
+      temp.grade=item.userRead.grade;
       temp.videoShow = false;
       this.data.videoList.push(temp);
     });
@@ -168,11 +169,38 @@ Page({
   onReachBottom: function () {
 
   },
+  collectTap: function(e){
+    console.log('点击收藏',e)
+    const index = e.detail.index;
+    let str = `videoList[${index}].isFavorite`
+    this.setData({
+     [str]: e.detail.isCollect
+    })
+  },
+  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
+   })
+  },
+  openShare: function (e) {
+    console.log('用户点击分享按钮', e)
+    this.setData({
+      shareTitle: e.detail.currentTarget.dataset.title,
+      shareId: e.detail.currentTarget.dataset.id,
+      shareImg: e.detail.currentTarget.dataset.img
+    })
+  },
 
   /**
    * 用户点击右上角分享
    */
-  onShareAppMessage: function () {
+  onShareAppMessage: function (res) {
+    console.log('用户点分享',res)
     if (res.from === 'button') {
       return {
         title: '请欣赏我的课文朗读作品,点赞+评论。',
@@ -182,7 +210,7 @@ Page({
       }
     } else {
       return {
-        title: '课文朗读,从未如此有趣',
+        title: '课文朗读,从未如此有趣',
         path: '/pages/index/index',
       }
     }

+ 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" 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" binddelHideMyWork="delHideMyWork" 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" />

+ 1 - 1
pages/myconcern/myconcern.js

@@ -100,7 +100,7 @@ Page({
       }
     } else {
       return {
-        title: '课文朗读,从未如此有趣',
+        title: '课文朗读,从未如此有趣',
         path: '/pages/index/index',
       }
     }

+ 19 - 1
pages/myworks/myworks.js

@@ -217,6 +217,24 @@ Page({
       }
     })
   },
+  collectTap: function(e){
+    console.log('点击收藏',e)
+    const index = e.detail.index;
+    let str = `videoList[${index}].isFavorite`
+    this.setData({
+     [str]: e.detail.isCollect
+    })
+  },
+  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
+   })
+  },
 
   /**
    * 用户点击右上角分享
@@ -235,7 +253,7 @@ Page({
       }
     } else {
       return {
-        title: '课文朗读,从未如此有趣',
+        title: '课文朗读,从未如此有趣',
         path: '/pages/index/index',
       }
     }

+ 2 - 2
pages/myworks/myworks.wxml

@@ -29,14 +29,14 @@
           {{ wareCards.fansAmount || 0 }}
       </view>
       <view class='flower-count'>
-        <text>红花</text>
+        <text>红花</text>
         {{ wareCards.integralAmount || 0 }}
       </view>
     </view>
   </view>
 
 
-  <VideoSwiper wx:if="{{videoList.length > 0}}" class="video-swiper" video-list="{{videoList}}" nextMargin="{{nextMargin}}" isSwiper="{{false}}" bindopenComment="openComment" bindheadTap="headTapHandler" 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" bindgoToReading="goToReading" 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}}" />

+ 1 - 0
pages/myworks/myworks.wxss

@@ -101,6 +101,7 @@ page {
   white-space: nowrap;
   font-size: 30rpx;
   color: rgba(0, 0, 0, .8);
+  font-weight: 600;
 }
 
 

+ 33 - 12
pages/reading/reading.js

@@ -462,7 +462,7 @@ Page({
                     })
                 }
             });
-        }).fail(res=>{
+        }).fail(res => {
             wx.hideLoading({
                 success: () => {
                     wx.showToast({
@@ -498,7 +498,7 @@ Page({
                 temp.time = formatDate(item.userRead.gmtCreated, 3);
                 temp.avatar = item.user ? item.user.avatar : '';
                 temp.uid = item.user ? item.user.uid : '';
-                temp.url = item.userRead.originVideo;
+                temp.url = item.userRead.videoPath;
                 // temp.avatar = item.user.avatar;
                 temp.nickName = item.user ? item.user.wechatName : '';
                 temp.id = item.userRead.id;
@@ -506,6 +506,9 @@ Page({
                 temp.isFans = item.isFans ? true : item.user.uid === this.uid ? true : false;
                 temp.coverImg = item.userRead.coverImg;
                 temp.videoShow = false;
+                temp.grade = item.userRead.grade;
+                temp.type = item.userRead.type;
+
                 // recommendWorks.push(temp);
                 // that.data.hotData.hotWorks.push(temp);
                 this.data.videoList.push(temp);
@@ -560,20 +563,20 @@ Page({
         console.log('点击分享按钮', this.data.shareImg)
         if (res.from === 'button') {
             return {
-              title: '请欣赏我的课文朗读作品,点赞+评论。',
-              path: `/pages/index/index?readId=${this.data.shareId}`,
-              imageUrl: '../../static/index/share_icon.png'
-      
+                title: '请欣赏我的课文朗读作品,点赞+评论。',
+                path: `/pages/index/index?readId=${this.data.shareId}`,
+                imageUrl: '../../static/index/share_icon.png'
+
             }
-          } else {
+        } else {
             return {
-              title: '课文朗读,从未如此有趣',
-              path: '/pages/index/index',
+                title: '课文朗读,从未如此有趣',
+                path: '/pages/index/index',
             }
-          }
+        }
 
     },
-    touchMove: function(){
+    touchMove: function () {
         return
     },
     openShare: function (e) {
@@ -593,5 +596,23 @@ Page({
             this.videoCtx = wx.createVideoContext('myVideo', this);
             this.videoCtx.stop();
         }
-    }
+    },
+    collectTap: function (e) {
+        console.log('点击收藏', e)
+        const index = e.detail.index;
+        let str = `videoList[${index}].isFavorite`
+        this.setData({
+            [str]: e.detail.isCollect
+        })
+    },
+    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
+        })
+    },
 })

+ 3 - 1
pages/reading/reading.wxml

@@ -74,11 +74,13 @@
             <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" bindgoToReading="goToReading" bindonPlay="onPlay"></VideoSwiper>
+    <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>
 <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>
+
 <view class="score_dialog" wx:if="{{ifScoreDialogShow}}">
     <view class="score_section">
         <view class="title">测评报告</view>

+ 3 - 2
pages/reading/reading.wxss

@@ -1,5 +1,6 @@
 .readingPage {
     height: 100%;
+    background: #fff;
     /* overflow: hidden; */
     /* background: #eee; */
 }
@@ -86,7 +87,7 @@ audio {
 
 .textSection .textContent {
     font-size: 32rpx;
-    line-height: 56rpx;
+    line-height: 68rpx;
     text-align: center;
     display: block;
     margin: 0 50rpx;
@@ -203,7 +204,7 @@ audio {
     box-sizing: border-box;
     height: 524rpx;
     background: #fffbf7;
-    border-top: 10rpx solid #eee;
+    border-top: 20rpx solid #eee;
 }
 
 .score_section .title {

+ 1 - 1
pages/user/myEdit/myEdit.js

@@ -105,7 +105,7 @@ Page({
     }
     // const uid = wx.getStorageSync('uid');
     const data = {
-      nickName: e.detail.value.nickname || '',
+      wechatName: e.detail.value.nickname || '',
       gender: e.detail.value.radioGroup1,
       schoolName: e.detail.value.address || '',
       birthday: e.detail.value.picker || '',

+ 1 - 1
pages/user/myEdit/myEdit.wxml

@@ -13,7 +13,7 @@
       <view class='nickname-box'>
         <text class='setting-title'>昵称</text>
         <view class='user-action'>
-          <input name='nickname' class='nickname' type='text' maxlength="9" placeholder='{{user.nickName}}' placeholder-class='placeholderStyle' focus='{{ true }}' value='{{user.nickName}}' bindblur='saveNickName'></input>
+          <input name='nickname' class='nickname' type='text' maxlength="9" placeholder='{{user.wechatName}}' placeholder-class='placeholderStyle' focus='{{ true }}' value='{{user.wechatName}}' bindblur='saveNickName'></input>
         </view>
         <view class='edit-img'>
           <image src='../../../static/image/edit_new.png' class='icon'></image>

+ 2 - 0
pages/user/myEdit/myEdit.wxss

@@ -13,6 +13,8 @@
   font-size: 32rpx;
   color: #5E5E5E;
   background: #F7F7F7;
+  overflow-x: hidden;
+  margin-top: 20rpx;
 }
 
 .nickname-box{

+ 1 - 1
templates/courses/courses.less

@@ -7,7 +7,7 @@
         width: 100%;
         height: 400rpx;
         background: #fff;
-        margin-bottom: 10rpx;
+        margin-bottom: 20rpx;
         padding-top: 20rpx;
         box-sizing: border-box;
         // display: flex;

+ 1 - 1
templates/courses/courses.wxss

@@ -7,7 +7,7 @@
   width: 100%;
   height: 400rpx;
   background: #fff;
-  margin-bottom: 10rpx;
+  margin-bottom: 20rpx;
   padding-top: 20rpx;
   box-sizing: border-box;
 }

+ 6 - 0
utils/APIClient.js

@@ -443,6 +443,12 @@ module.exports = {
       uid: wx.getStorageSync('uid')
     }).data(data).url(url).method('POST').send();
   },
+  shareLog(data){
+    let url = getBaseUrl('wx/shareLog');
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).data(data).url(url).method('POST').send();
+  },
   // 由分享进入的记录
   shareTagRecord(data) {
     let url = getBaseUrl('wx/ShareStatistics/click');