Rorschach 4 years ago
parent
commit
84a8a49134

+ 1 - 1
app.wxss

@@ -18,7 +18,7 @@ text {
 .container {
   height: auto;
   box-sizing: border-box;
-  /* padding-top: 80rpx; */
+  padding-top: 80rpx;
   /* color: #444; */
   font-family: PingFang SC, Microsoft Yahei, Source Han Sans CN, SimHei;
 }

+ 140 - 25
component/comment/comment.js

@@ -1,17 +1,21 @@
 // component/comment.js
+import httpRequestApi from '../../utils/APIClient';
+import {
+  formatDate
+} from '../../utils/util';
+
 Component({
   /**
    * 组件的属性列表
    */
   properties: {
-    commentList: {
-      type: Array,
-      value: [],
-      observer: function observer() {
-        console.log(123)
-        this.formatList()
+    commentId: {
+      type: Number,
+      observer: function observer(id) {
+        this.getReply(id)
       }
     }
+
   },
 
   /**
@@ -19,39 +23,150 @@ Component({
    */
   data: {
     inputValue: '',
-    showControl: 0
+    showControl: 0,
+    commentNum: 0,
+    commentList: [],
+    ifGetFocus: false,
+    replyType: 'works' // 回复类型,works是回复作品,comment是回复评论
   },
 
   /**
    * 组件的方法列表
    */
   methods: {
-    formatList: function formatList(changeIndex) {
-      this.data.commentList.map((item, index) => {
-        if (changeIndex && index === changeIndex) {
-          item.showControl = 100;
-
-        } else {
-          item.showControl = 0;
-
-        }
-      })
-      this.setData({
-        commentList: this.data.commentList
-      })
-      console.log(321, this.data.commentList)
+    // 获取评论信息
+    getReply: function (columnId) {
+      httpRequestApi.getReply(this.uid, columnId, 1, 10).success((res) => {
+        console.log('reply', res)
+        const commentList = res.data.data.list;
+        const commentNum = res.data.data.totalSize;
+        console.log('评论数量', commentNum)
+        commentList.forEach((item) => {
+          const temp = {};
+          temp.nickName = item.user.wechatName;
+          temp.avatar = item.user.avatar;
+          temp.uid = item.user.uid;
+          temp.text = item.detailDesc;
+          temp.id = item.id;
+          temp.replyCount = item.replyCount;
+          temp.time = formatDate(item.gmtCreated, 3);
+          temp.likes = item.postsAttributeInfo.favors || 0;
+          temp.isLike = item.isLike;
+          temp.replyList = item.replyVOList;
+          temp.showControl = 0;
+          this.data.commentList.push(temp);
+        });
+        this.setData({
+          commentList: this.data.commentList,
+          commentNum: commentNum
+        })
+      });
     },
     showMore: function showMore(e) {
-      // this.formatList(100)
+      let index = e.currentTarget.dataset.index || index === 0 ? e.currentTarget.dataset.index : e.target.dataset.index;
+      let str = `commentList[${index}].showControl`;
+      this.setData({
+        [str]: 10
+      })
+      console.log('showControl', this.data.commentList[index].showControl)
     },
+
+    // 评论作品
     sendReply: function sendReply(e) {
       console.log('sendReply', e.detail.value)
-      this.triggerEvent('sendReply', {
-        content: e.detail.value
+      if (this.data.replyType === 'works') {
+        let data = {
+          columnId: this.data.commentId,
+          colunmNames: 'what',
+          detailDesc: e.detail.value,
+        }
+        this.replyWorks(data);
+      }
+      if (this.data.replyType === 'comment') {
+        let data = {
+          postsId: this.data.postId,
+          content: e.detail.value
+        }
+
+        this.replyComment(data);
+      }
+
+    },
+    // 点赞评论
+    likeComment: function (e) {
+      console.log(e);
+      let postId = e.currentTarget.dataset.id ? e.currentTarget.dataset.id : e.target.dataset.id;
+      let index = e.currentTarget.dataset.index || index === 0 ? e.currentTarget.dataset.index : e.target.dataset.index;
+      httpRequestApi.likeCommend(postId).success(res => {
+        console.log(res);
+        const str = `commentList[${index}].likes`;
+        const strImg = `commentList[${index}].isLike`;
+        this.setData({
+          [str]: res.data.data.favors,
+          [strImg]: true
+        })
       });
+    },
+    // 回复作品
+    replyWorks: function (data) {
+      httpRequestApi.postReply(data).success(res => {
+        console.log(res)
+        this.setData({
+          pageNo: 1,
+          commentList: []
+        }, () => {
+          this.getReply(this.data.commentId);
+          this.setData({
+            inputValue: '',
+          })
+        })
+      });
+    },
+    catchComment: function catchComment(e) {
+      let postId = e.currentTarget.dataset.id ? e.currentTarget.dataset.id : e.target.dataset.id;
+      let index = e.currentTarget.dataset.index || index === 0 ? e.currentTarget.dataset.index : e.target.dataset.index;
       this.setData({
-        inputValue: '',
+        postId: postId,
+        replyType: 'comment',
+        ifGetFocus: true,
+        postIndex: index
       })
+      console.log(this.data.ifGetFocus)
+
+    },
+    // 回复评论
+    replyComment: function (data) {
+      httpRequestApi.postReplyComment(data).success(res => {
+
+        this.setData({
+          replyInfo: '',
+        }, () => {
+          this.getReply(this.data.commentId);
+          this.setData({
+            inputValue: '',
+            replyType: 'works',
+            ifGetFocus: false
+          })
+        });
+      });
+    },
+    // 发布楼中楼评论后渲染之前列表
+    getReplyInner: function (columnId) {
+      httpRequestApi.getReply(this.uid, columnId, 1, 10).success((res) => {
+        const commentList = res.data.data.list;
+        commentList.forEach((item, index) => {
+          if (index === this.data.postIndex) {
+            let replyList = item.replyVOList;
+            let str = `commentList[${index}].replyVOList`;
+            this.setData({
+              [str]: replyList
+            })
+            return;
+          };
+        })
+
+      });
     },
   }
+
 })

+ 12 - 12
component/comment/comment.less

@@ -1,4 +1,4 @@
-.container {
+.comment_container {
     position: fixed;
     z-index: 99;
     bottom: 0;
@@ -7,6 +7,8 @@
     // min-height: 550rpx;
     max-height: 900rpx;
     background: #ffffff;
+    padding-bottom: 120rpx;
+    box-sizing: border-box;
 
 
     .comment_number {
@@ -26,11 +28,16 @@
         padding-left: 20rpx;
         padding-right: 68rpx;
         box-sizing: border-box;
+        margin-bottom: 14rpx;
 
         .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,.34);
 
             .avatar_box {
                 width: 111rpx;
@@ -154,18 +161,10 @@
                 }
             }
         }
-
-        .place_line {
-            height: 1rpx;
-            width: 103%;
-            background: #979797;
-            margin-top: 35rpx;
-            margin-bottom: 33rpx;
-            opacity: .34;
-            position: relative;
-            left: 10rpx;
-        }
     }
+    
+    
+    
 
 
 
@@ -175,6 +174,7 @@
         background: #eeeded;
         position: fixed;
         bottom: 0;
+
         input {
             width: 100%;
             height: 100%;

+ 9 - 10
component/comment/comment.wxml

@@ -1,5 +1,5 @@
 <!-- component/comment.wxml -->
-<scroll-view class="container" scroll-y="{{true}}">
+<scroll-view class="comment_container" scroll-y="{{true}}">
     <view class="comment_number">评论 {{commentNum}}</view>
     <view class="comment_item" wx:for="{{commentList}}" data-commentid="{{item.id}}" wx:key="*this">
         <view class="comment_box">
@@ -10,20 +10,20 @@
                 <text class="nickname">{{item.nickName}}</text>
                 <text class="comment_text" space="false">{{item.text}}</text>
                 <view class="comment_reply_wrapper" wx:if="{{item.replyCount > 0}}">
-                    <view class="comment_reply_item" wx:for="{{item.replyList}}" wx:if="{{index > showControl}}" wx:key="{{item.id}}">
-                        <text class="reply_nickname">{{item.user.nickName}}:</text>
-                        <text class="reply_text">{{item.content}}</text>
+                    <view class="comment_reply_item" wx:for="{{item.replyList}}" wx:for-item="inner" wx:if="{{index <= item.showControl}}" wx:key="inner">
+                        <text class="reply_nickname">{{index}}:{{item.showControl}}{{inner.user.nickName}}:</text>
+                        <text class="reply_text">{{inner.content}}</text>
                     </view>
-                    <view wx:if="{{item.replyCount > 1}}" class="more_btn">更多></view>
+                    <view wx:if="{{item.replyCount > 1 && item.showControl == 0}}" catchtap="showMore" data-index="{{index}}" class="more_btn">更多></view>
                 </view>
                 <view class="time_info">
                     <view class="time">{{item.time}}</view>
                     <view class="info">
-                        <view class="like">
-                            <image src="../../static/index/flower.png" />
+                        <view class="like" bindtap="{{item.isLike? null:'likeComment'}}" data-index="{{index}}" data-likes="{{item.likes}}" data-id="{{item.id}}">
+                            <image src="{{item.isLike? '../../static/image/point.png' : '../../static/image/like.png'}}" />
                             <text>{{item.likes}}</text>
                         </view>
-                        <view class="comment">
+                        <view class="comment" bindtap="catchComment" data-index="{{index}}" data-id="{{item.id}}">
                             <image src="../../static/index/comment.png" />
                             <text>{{item.replyCount}}</text>
                         </view>
@@ -31,9 +31,8 @@
                 </view>
             </view>
         </view>
-        <view class="place_line"></view>
     </view>
     <view class="comment_input">
-        <input confirm-type="hold" value="{{inputValue}}" bindconfirm="sendReply" placeholder="给好评..." />
+        <input confirm-type="hold" focus="{{ifGetFocus}}" value="{{inputValue}}" bindconfirm="sendReply" placeholder="给好评..." />
     </view>
 </scroll-view>

+ 31 - 34
component/comment/comment.wxss

@@ -1,12 +1,14 @@
-.container {
+.comment_container {
   position: fixed;
   z-index: 99;
   bottom: 0;
   width: 100%;
   max-height: 900rpx;
   background: #ffffff;
+  padding-bottom: 120rpx;
+  box-sizing: border-box;
 }
-.container .comment_number {
+.comment_container .comment_number {
   width: 100%;
   height: 68rpx;
   display: flex;
@@ -15,58 +17,63 @@
   color: #4a4a4a;
   font-size: 30rpx;
 }
-.container .comment_item {
+.comment_container .comment_item {
   width: 100%;
   display: flex;
   flex-direction: column;
   padding-left: 20rpx;
   padding-right: 68rpx;
   box-sizing: border-box;
+  margin-bottom: 14rpx;
 }
-.container .comment_item .comment_box {
+.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);
 }
-.container .comment_item .comment_box .avatar_box {
+.comment_container .comment_item .comment_box .avatar_box {
   width: 111rpx;
   height: 100%;
   display: block;
   margin-right: 15rpx;
 }
-.container .comment_item .comment_box .avatar_box image {
+.comment_container .comment_item .comment_box .avatar_box image {
   width: 96rpx;
   height: 96rpx;
   background: chocolate;
   border-radius: 50%;
 }
-.container .comment_item .comment_box .comment_info {
+.comment_container .comment_item .comment_box .comment_info {
   display: flex;
   flex-direction: column;
   align-items: flex-start;
   width: 100%;
 }
-.container .comment_item .comment_box .comment_info .nickname {
+.comment_container .comment_item .comment_box .comment_info .nickname {
   font-size: 30rpx;
   color: rgba(0, 0, 0, 0.6);
 }
-.container .comment_item .comment_box .comment_info .comment_text {
+.comment_container .comment_item .comment_box .comment_info .comment_text {
   font-size: 28rpx;
   color: rgba(0, 0, 0, 0.6);
   margin-bottom: 23rpx;
 }
-.container .comment_item .comment_box .comment_info .comment_reply_wrapper {
+.comment_container .comment_item .comment_box .comment_info .comment_reply_wrapper {
   background: rgba(0, 0, 0, 0.03);
   width: 100%;
 }
-.container .comment_item .comment_box .comment_info .comment_reply_wrapper .comment_reply_item {
+.comment_container .comment_item .comment_box .comment_info .comment_reply_wrapper .comment_reply_item {
   font-size: 28rpx;
   color: rgba(0, 0, 0, 0.6);
 }
-.container .comment_item .comment_box .comment_info .comment_reply_wrapper .comment_reply_item .reply_nickname {
+.comment_container .comment_item .comment_box .comment_info .comment_reply_wrapper .comment_reply_item .reply_nickname {
   color: rgba(1, 67, 124, 0.6);
 }
-.container .comment_item .comment_box .comment_info .comment_reply_wrapper .more_btn {
+.comment_container .comment_item .comment_box .comment_info .comment_reply_wrapper .more_btn {
   display: flex;
   justify-content: flex-end;
   width: 100%;
@@ -75,7 +82,7 @@
   color: #698FAF;
   padding-right: 20rpx;
 }
-.container .comment_item .comment_box .comment_info .time_info {
+.comment_container .comment_item .comment_box .comment_info .time_info {
   width: 100%;
   display: flex;
   flex-direction: row;
@@ -83,17 +90,17 @@
   align-items: center;
   margin-top: 30rpx;
 }
-.container .comment_item .comment_box .comment_info .time_info .time {
+.comment_container .comment_item .comment_box .comment_info .time_info .time {
   color: rgba(0, 0, 0, 0.6);
   font-size: 28rpx;
 }
-.container .comment_item .comment_box .comment_info .time_info .info {
+.comment_container .comment_item .comment_box .comment_info .time_info .info {
   width: 200rpx;
   height: 100%;
   display: flex;
   position: relative;
 }
-.container .comment_item .comment_box .comment_info .time_info .info .like {
+.comment_container .comment_item .comment_box .comment_info .time_info .info .like {
   width: 80rpx;
   height: 35rpx;
   display: flex;
@@ -102,16 +109,16 @@
   top: -14rpx;
   left: 0;
 }
-.container .comment_item .comment_box .comment_info .time_info .info .like image {
+.comment_container .comment_item .comment_box .comment_info .time_info .info .like image {
   width: 30rpx;
   height: 27rpx;
   margin-right: 12rpx;
 }
-.container .comment_item .comment_box .comment_info .time_info .info .like text {
+.comment_container .comment_item .comment_box .comment_info .time_info .info .like text {
   font-size: 22.4rpx;
   color: rgba(0, 0, 0, 0.6);
 }
-.container .comment_item .comment_box .comment_info .time_info .info .comment {
+.comment_container .comment_item .comment_box .comment_info .time_info .info .comment {
   width: 80rpx;
   height: 35rpx;
   display: flex;
@@ -120,33 +127,23 @@
   top: -14rpx;
   left: 120rpx;
 }
-.container .comment_item .comment_box .comment_info .time_info .info .comment image {
+.comment_container .comment_item .comment_box .comment_info .time_info .info .comment image {
   width: 28.8rpx;
   height: 25rpx;
   margin-right: 16rpx;
 }
-.container .comment_item .comment_box .comment_info .time_info .info .comment text {
+.comment_container .comment_item .comment_box .comment_info .time_info .info .comment text {
   font-size: 22.4rpx;
   color: rgba(0, 0, 0, 0.6);
 }
-.container .comment_item .place_line {
-  height: 1rpx;
-  width: 103%;
-  background: #979797;
-  margin-top: 35rpx;
-  margin-bottom: 33rpx;
-  opacity: 0.34;
-  position: relative;
-  left: 10rpx;
-}
-.container .comment_input {
+.comment_container .comment_input {
   width: 100%;
   height: 120rpx;
   background: #eeeded;
   position: fixed;
   bottom: 0;
 }
-.container .comment_input input {
+.comment_container .comment_input input {
   width: 100%;
   height: 100%;
   background: #eeeded;

+ 5 - 0
component/my/my.js

@@ -62,10 +62,15 @@ export const myInit = (that) => {
           temp.uid = item.user.uid;
           temp.plays = item.userRead.playAmount;
           temp.likes = item.userRead.likeAmount;
+          temp.commentAmount = item.userRead.commentAmount ? item.userRead.commentAmount : 0;
+          temp.classId = item.userRead.exampleId ? item.userRead.exampleId :  1605097720036046;
           temp.img = item.userRead.iconImg;
           temp.id = item.userRead.id;
           temp.title = item.userRead.title;
           temp.summary = item.userRead.summary;
+          temp.type = item.userRead.type;
+          temp.isLike = item.isLike;
+          temp.isFavorite = item.isFavorites;
           temp.time = formatDate(item.userRead.gmtCreated, 3);
           // 还差一些字段
           that.data.followData.push(temp);

+ 10 - 8
component/my/my.wxml

@@ -14,7 +14,7 @@
               微信昵称:{{ myData.user.user.wechatName || myData.user.wechatName  }}
             </view>
             <view class='avatar-nickname'>
-              宝贝昵称:{{ myData.user.user.nickName || myData.user.nickName  }}
+              年级:{{ myData.user.user.grade || myData.user.grade  }}年级
             </view>
             <image class="edit-img" src="../../static/image/edit_new.png" />
             <view class='mine-category'>
@@ -39,17 +39,19 @@
         <view class="flower-tips" wx:if="{{myData.user.unfinishedAmount <= 0}}">今天任务全部完成,真棒</view>
       </view> -->
       <!-- android 显示两个 -->
-      <view class="wallet-section" >
+      <view class="wallet-section">
         <view class="flower-box" bindtap="goToFlower">
           <view class="grey-point"></view>
-          <image class="flower-icon" src='../../static/image/flower_small.png' />
-          <view class="flower-text">
-            <view>小红花:{{myData.user.integralAmount || 0 }}</view>
-            <view class="flower-tips-text">
-              <text class="flower-last">{{myData.user.unfinishedAmount }}</text>
-              个任务福利还没有完成
+          <view class="flower-box-box">
+            <image class="flower-icon" src='../../static/image/flower_small.png' />
+            <view class="flower-text">
+              <view>小红花:{{myData.user.integralAmount || 0 }}</view>
             </view>
           </view>
+          <view class="flower-tips-text">
+            <text class="flower-last">{{myData.user.unfinishedAmount }}</text>
+            个任务福利还没有完成
+          </view>
         </view>
       </view>
       <view class="btn-section">

+ 10 - 3
component/my/my.wxss

@@ -222,7 +222,7 @@ image {
   width: 720rpx;
   height: 120rpx;
   /* background: #fff; */
-  border-radius: 20rpx;
+  border-radius: 10rpx;
   margin: 10rpx auto 0;
   position: relative;
   display: flex;
@@ -233,14 +233,20 @@ image {
 
 .wallet-box,
 .flower-box {
-  width: 355rpx;
+  width: 100%;
   height: 120rpx;
   border-radius: 20rpx;
   background: #fff;
   display: flex;
   align-items: center;
   position: relative;
-  /* justify-content: space-around; */
+  justify-content: space-around;
+}
+
+.flower-box-box{
+  display: flex;
+  align-items: center;
+
 }
 
 .wallet-box {
@@ -301,6 +307,7 @@ margin-top: -7rpx;
 }
 
 .flower-tips-text {
+  float: right;
   color: #848484;
   font-size: 22rpx;
 }

+ 71 - 10
component/video-swiper/index.js

@@ -1,5 +1,6 @@
 "use strict";
 
+import httpRequestApi from '../../utils/APIClient';
 
 Component({
     options: {
@@ -7,6 +8,14 @@ Component({
         pureDataPattern: /^_/
     },
     properties: {
+        ifHeadTap:{
+            type: Boolean,
+            value: true
+        },
+        isSwiper: {
+            type: Boolean,
+            value: true
+        },
         duration: {
             type: Number,
             value: 500
@@ -23,6 +32,8 @@ Component({
             type: Array,
             value: [],
             observer: function observer() {
+                console.log('this.isSwiper', this.data.isSwiper)
+                if (!this.data.isSwiper) return;
                 var newVal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
 
                 this._videoListChanged(newVal);
@@ -44,7 +55,9 @@ Component({
         _change: -1,
         _invalidUp: 0,
         _invalidDown: 0,
-        _videoContexts: []
+        _videoContexts: [],
+        inputValue: '',
+        showControl: 0
     },
     lifetimes: {
         attached: function attached() {
@@ -56,6 +69,7 @@ Component({
             var _this = this;
 
             var data = this.data;
+            console.log('newVal', newVal)
             newVal.forEach(function (item) {
                 data.nextQueue.push(item);
             });
@@ -129,7 +143,7 @@ Component({
             });
         },
         playCurrent: function playCurrent(current) {
-            return;// 注掉自动播放
+            return; // 注掉自动播放
             this.data._videoContexts.forEach(function (ctx, index) {
                 index !== current ? ctx.pause() : ctx.play();
             });
@@ -166,22 +180,69 @@ Component({
             this.trigger(e, 'openComment')
         },
         // 点击头部
-        headTap: function headTap(e){
-            this.trigger(e,'headTap')
+        headTap: function headTap(e) {
+            let uid = e.target.dataset.uid ? e.target.dataset.uid : e.currentTarget.dataset.uid;
+            // this.trigger(e, 'headTap')
+            console.log('点击头像',e)
+            wx.navigateTo({
+                url: `../../pages/user/myworks/myworks?uid=${uid}`
+              });
         },
         // 去朗读
-        goToReading: function goToReading(e){
-            this.trigger(e,'goToReading')
+        goToReading: function goToReading(e) {
+            this.trigger(e, 'goToReading')
+        },
+        // 收藏课程
+        collectTap: function collectClass(e) {
+            console.log('收藏按钮', e);
+            const data = {
+                targetCode: e.target.dataset.id ? e.target.dataset.id : e.currentTarget.dataset.id,
+                favoritesType: e.target.dataset.type ? e.target.dataset.type : e.currentTarget.dataset.type
+            }
+            const index = e.target.dataset.index ? e.target.dataset.index : e.currentTarget.dataset.index;
+            console.log('视频index', index);
+            let str = `curQueue[${index}].isFavorite`
+            httpRequestApi.collectClass(data).success((res) => {
+                this.setData({
+                    [str]: true
+                })
+            });
+
+        },
+        // 点赞
+        likeTap: function likeTap(e) {
+            const isLike = e.target.dataset.islike ? e.target.dataset.islike : e.currentTarget.dataset.islike;
+            console.log('isLike',isLike)
+            if (isLike) {
+                return;
+            }
+            const id = e.target.dataset.id ? e.target.dataset.id : e.currentTarget.dataset.id;
+            const index = e.target.dataset.index ? e.target.dataset.index : e.currentTarget.dataset.index;
+            console.log('视频index', index);
+            let likeStr = `curQueue[${index}].isLike`;
+            let likeNumStr = `curQueue[${index}].likes`;
+            httpRequestApi.likeWorks(id).success((res) => {
+                this.setData({
+                    [likeStr]: true,
+                    [likeNumStr]: this.data.curQueue[index].likes + 1
+                })
+            });
+
         },
+
         trigger: function trigger(e, type) {
             var ext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
 
             // var detail = e.detail;
-            var activeId =  e.target.dataset.id ? e.target.dataset.id : e.currentTarget.dataset.id;
-            this.triggerEvent(type, {activeId: activeId},{bubbles:false});
-          /*   this.triggerEvent(type, Object.assign(Object.assign(Object.assign({}, detail), {
+            var activeId = e.target.dataset.id ? e.target.dataset.id : e.currentTarget.dataset.id;
+            this.triggerEvent(type, {
                 activeId: activeId
-            }), ext)); */
+            }, {
+                bubbles: false
+            });
+            /*   this.triggerEvent(type, Object.assign(Object.assign(Object.assign({}, detail), {
+                  activeId: activeId
+              }), ext)); */
         }
     }
 });

+ 116 - 105
component/video-swiper/index.less

@@ -1,149 +1,160 @@
-
-.container {
+.swiper_container {
     width: 100%;
     height: 100%;
-    padding-top: 20rpx;
+    // padding-top: 20rpx;
 
     .video-swiper {
         width: 100%;
         height: 100%;
         display: block;
         background: #ffffff;
-        margin-top: 64rpx;
-        
-        .swiper_item {
-            width: 100%;
-            height: 100%;
-            
-            .head_box {
-                width: 100%;
-                height: 120rpx;
-                display: flex;
-                justify-content: space-between;
-                padding-left: 20rpx;
+        // margin-top: 64rpx;
 
-                .user_box {
-                    width: 400rpx;
-                    height: 100%;
-                    display: flex;
-                    align-items: center;
+    }
 
-                    .avatar {
-                        width: 80rpx;
-                        height: 80rpx;
-                        border: 2rpx solid green;
-                        border-radius: 50%;
 
-                    }
+    .swiper_item {
+        width: 100%;
+        height: 100%;
 
-                    .user_right {
-                        margin-left: 16rpx;
+        &.no_swiper {
+            height: 879rpx;
+        }
 
-                        .nickname {
-                            font-size: 30rpx;
-                            color: rgba(0, 0, 0, 0.60);
-                        }
-                    }
+        .head_box {
+            width: 100%;
+            height: 120rpx;
+            display: flex;
+            justify-content: space-between;
+            padding-left: 20rpx;
+            box-sizing: border-box;
+            padding-right: 20rpx;
+
+            .user_box {
+                width: 400rpx;
+                height: 100%;
+                display: flex;
+                align-items: center;
+
+                .avatar {
+                    width: 80rpx;
+                    height: 80rpx;
+                    border: 2rpx solid green;
+                    border-radius: 50%;
 
                 }
 
-                .time {
-                    font-size: 26rpx;
-                    color: rgba(0, 0, 0, 0.60);
+                .user_right {
+                    margin-left: 16rpx;
+
+                    .nickname {
+                        font-size: 30rpx;
+                        color: rgba(0, 0, 0, 0.60);
+                    }
                 }
+
             }
 
-            .video_item {
-                width: 100%;
-                height: 422rpx;
+            .time {
+                display: flex;
+                align-items: center;
+                font-size: 26rpx;
+                color: rgba(0, 0, 0, 0.60);
             }
+        }
+
+        .video_item {
+            width: 100%;
+            height: 422rpx;
+        }
 
-            .video_title {
-                width: 100%;
-                height: 62rpx;
-                font-size: 30rpx;
-                color: #373737;
+        .video_title {
+            width: 100%;
+            height: 62rpx;
+            font-size: 30rpx;
+            color: #373737;
+            display: flex;
+            align-items: center;
+        }
+
+        .foot_box {
+            width: 100%;
+            height: 120rpx;
+            display: flex;
+            justify-content: space-between;
+            padding-left: 20rpx;
+
+            .foot_left,
+            .foot_right {
                 display: flex;
                 align-items: center;
             }
 
-            .foot_box {
-                width: 100%;
-                height: 120rpx;
+            .btn {
+                margin-right: 42rpx;
+                font-size: 28rpx;
+                color: rgba(0, 0, 0, 0.60);
                 display: flex;
-                justify-content: space-between;
-                padding-left: 20rpx;
+                flex-direction: row;
+                align-items: center;
 
-                .foot_left,
-                .foot_right {
-                    display: flex;
-                    align-items: center;
+                .collect_btn_icon {
+                    width: 48rpx;
+                    height: 46rpx;
+                    margin-right: 14rpx;
                 }
 
-                .btn {
-                    margin-right: 42rpx;
-                    font-size: 28rpx;
-                    color: rgba(0, 0, 0, 0.60);
-                    display: flex;
-                    flex-direction: row;
-                    align-items: center;
-
-                    .collect_btn_icon {
-                        width: 48rpx;
-                        height: 46rpx;
-                        margin-right: 14rpx;
-                    }
-
-                    .share_btn_icon {
-                        width: 46rpx;
-                        height: 46rpx;
-                        margin-right: 14rpx;
-                    }
+                .share_btn_icon {
+                    width: 46rpx;
+                    height: 46rpx;
+                    margin-right: 14rpx;
+                }
 
-                    .flower_btn_icon {
-                        width: 46rpx;
-                        height: 46rpx;
-                        margin-right: 14rpx;
-                    }
+                .flower_btn_icon {
+                    width: 46rpx;
+                    height: 46rpx;
+                    margin-right: 14rpx;
+                }
 
-                    .comment_btn_icon {
-                        width: 49rpx;
-                        height: 47rpx;
-                        margin-right: 14rpx;
-                    }
+                .comment_btn_icon {
+                    width: 49rpx;
+                    height: 47rpx;
+                    margin-right: 14rpx;
                 }
             }
+        }
 
-            .btn_wrapper{
-                width: 100%;
-                height: 110rpx;
+        .btn_wrapper {
+            width: 100%;
+            height: 110rpx;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+
+            .reading_btn {
+                width: 271rpx;
+                height: 80rpx;
+                background: #14c962;
+                border-radius: 100rpx;
                 display: flex;
                 align-items: center;
                 justify-content: center;
-                .reading_btn{
-                    width: 271rpx;
-                    height: 80rpx;
-                    background: #14c962;
-                    border-radius: 100rpx;
-                    display: flex;
-                    align-items: center;
-                    justify-content: center;
-
-                    image{
-                        width: 39rpx;
-                        height: 50rpx;
-                        margin-right: 20rpx;
-                    }
-                    text{
-                        color: #fff;
-                        font-size: 30rpx;
-                    }
+
+                image {
+                    width: 39rpx;
+                    height: 50rpx;
+                    margin-right: 20rpx;
+                }
+
+                text {
+                    color: #fff;
+                    font-size: 30rpx;
                 }
             }
         }
+    }
 
 
-    }
 
+}
 
-}

+ 81 - 7
component/video-swiper/index.wxml

@@ -1,5 +1,6 @@
-<view class="container">
+<view class="swiper_container">
   <swiper 
+    wx:if="{{isSwiper}}"
     class="video-swiper" 
     circular="{{circular}}"
     next-margin="{{nextMargin}}" 
@@ -12,7 +13,7 @@
         
     <swiper-item class="swiper_item" wx:for="{{curQueue}}"  data-id="{{item.id}}"  wx:key="*this">
       <view class="head_box">
-        <view class="user_box" catchtap="headTap" data-id="{{item.uid}}">
+        <view class="user_box" catchtap="{{ifHeadTap ? 'headTap' : null}}" data-uid="{{item.uid}}">
           <image class="avatar" lazy-load="true" src="{{item.avatar}}" />
           <view class="user_right">
             <view class="nickname">{{item.nickName}}</view>
@@ -53,8 +54,8 @@
         
       <view class="foot_box"> 
         <view class="foot_left">
-          <view class="btn collect_btn">
-              <image class="collect_btn_icon" src="../../static/index/star.png" lazy-load="true" />
+          <view class="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="btn share_btn">
@@ -63,13 +64,13 @@
           </view>
         </view>
         <view class="foot_right">
-          <view class="btn flower_btn">
-              <image class="flower_btn_icon" src="../../static/index/flower.png" lazy-load="true" />
+          <view class="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/flower_colored.png' : '../../static/index/flower.png'}}" />
               <text>{{item.likes}}</text>
           </view>
           <view class="btn comment_btn" catchtap="openComment" data-id="{{item.id}}">
               <image class="comment_btn_icon" src="../../static/index/comment.png" lazy-load="true" />
-              <text>{{item.likes}}123</text>
+              <text>{{item.commentAmount}}</text>
           </view>
         </view>
             
@@ -82,5 +83,78 @@
       </view>
     </swiper-item>
   </swiper>
+
+  <!-- // 非swiper -->
+  <view wx:if="{{!isSwiper}}" class="swiper_item no_swiper" wx:for="{{videoList}}"  data-id="{{item.id}}"  wx:key="*this">
+      <view class="head_box">
+        <view class="user_box" catchtap="headTap" data-id="{{item.uid}}">
+          <image class="avatar" lazy-load="true" src="{{item.avatar}}" />
+          <view class="user_right">
+            <view class="nickname">{{item.nickName}}</view>
+          </view>
+            
+        </view>
+          <view class="time">
+            <text>发布时间:{{item.time}}</text>
+          </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}}"
+      >
+      <!--   bindplay="onPlay"
+        bindpause="onPause"
+        bindended="onEnded"
+        binderror="onError"
+        bindtimeupdate="onTimeUpdate"
+        bindwaiting="onWaiting"
+        bindprogress="onProgress"
+        bindloadedmetadata="onLoadedMetaData" -->
+      </video>
+      <view class="video_title">
+        <text>
+          {{item.title}}
+        </text>
+          
+      </view>
+        
+      <view class="foot_box"> 
+        <view class="foot_left">
+          <view class="btn collect_btn" catchtap="collectTap" data-id="{{item.id}}" data-type="{{item.type}}">
+              <image class="collect_btn_icon" src="../../static/index/star.png" />
+              <text>收藏</text>
+          </view>
+          <view class="btn share_btn" catchtap="likeTap" data-index="{{index}}" data-id="{{item.id}}" data-type="{{item.type}}">
+              <image class="share_btn_icon" src="../../static/index/share.png" />
+              <text>分享</text>
+          </view>
+        </view>
+        <view class="foot_right">
+          <view class="btn flower_btn" catchtap="likeTap" data-index="{{index}}" data-id="{{item.id}}" data-type="{{item.type}}">
+              <image class="flower_btn_icon" src="../../static/index/flower.png"  />
+              <text>{{item.likes}}</text>
+          </view>
+          <view class="btn comment_btn" catchtap="openComment" data-id="{{item.id}}">
+              <image class="comment_btn_icon" src="../../static/index/comment.png" />
+              <text>{{item.likes}}123</text>
+          </view>
+        </view>
+            
+      </view>
+      <view class="btn_wrapper" catchtap="goToReading" data-id="{{item.classId}}">
+        <view class="reading_btn">
+          <image src="../../static/index/star.png" />
+          <text>我要配音</text>
+        </view>
+      </view>
+    </view>
 </view>
 

+ 30 - 25
component/video-swiper/index.wxss

@@ -1,54 +1,59 @@
-.container {
+.swiper_container {
   width: 100%;
   height: 100%;
-  padding-top: 20rpx;
 }
-.container .video-swiper {
+.swiper_container .video-swiper {
   width: 100%;
   height: 100%;
   display: block;
   background: #ffffff;
-  margin-top: 64rpx;
 }
-.container .video-swiper .swiper_item {
+.swiper_container .swiper_item {
   width: 100%;
   height: 100%;
 }
-.container .video-swiper .swiper_item .head_box {
+.swiper_container .swiper_item.no_swiper {
+  height: 879rpx;
+}
+.swiper_container .swiper_item .head_box {
   width: 100%;
   height: 120rpx;
   display: flex;
   justify-content: space-between;
   padding-left: 20rpx;
+  box-sizing: border-box;
+  padding-right: 20rpx;
 }
-.container .video-swiper .swiper_item .head_box .user_box {
+.swiper_container .swiper_item .head_box .user_box {
   width: 400rpx;
   height: 100%;
   display: flex;
   align-items: center;
 }
-.container .video-swiper .swiper_item .head_box .user_box .avatar {
+.swiper_container .swiper_item .head_box .user_box .avatar {
   width: 80rpx;
   height: 80rpx;
   border: 2rpx solid green;
   border-radius: 50%;
 }
-.container .video-swiper .swiper_item .head_box .user_box .user_right {
+.swiper_container .swiper_item .head_box .user_box .user_right {
   margin-left: 16rpx;
 }
-.container .video-swiper .swiper_item .head_box .user_box .user_right .nickname {
+.swiper_container .swiper_item .head_box .user_box .user_right .nickname {
   font-size: 30rpx;
   color: rgba(0, 0, 0, 0.6);
 }
-.container .video-swiper .swiper_item .head_box .time {
+.swiper_container .swiper_item .head_box .time {
+  display: flex;
+  align-items: center;
   font-size: 26rpx;
   color: rgba(0, 0, 0, 0.6);
 }
-.container .video-swiper .swiper_item .video_item {
+.swiper_container .swiper_item .video_item {
   width: 100%;
   height: 422rpx;
 }
-.container .video-swiper .swiper_item .video_title {
+.swiper_container .swiper_item .video_title {
   width: 100%;
   height: 62rpx;
   font-size: 30rpx;
@@ -56,19 +61,19 @@
   display: flex;
   align-items: center;
 }
-.container .video-swiper .swiper_item .foot_box {
+.swiper_container .swiper_item .foot_box {
   width: 100%;
   height: 120rpx;
   display: flex;
   justify-content: space-between;
   padding-left: 20rpx;
 }
-.container .video-swiper .swiper_item .foot_box .foot_left,
-.container .video-swiper .swiper_item .foot_box .foot_right {
+.swiper_container .swiper_item .foot_box .foot_left,
+.swiper_container .swiper_item .foot_box .foot_right {
   display: flex;
   align-items: center;
 }
-.container .video-swiper .swiper_item .foot_box .btn {
+.swiper_container .swiper_item .foot_box .btn {
   margin-right: 42rpx;
   font-size: 28rpx;
   color: rgba(0, 0, 0, 0.6);
@@ -76,34 +81,34 @@
   flex-direction: row;
   align-items: center;
 }
-.container .video-swiper .swiper_item .foot_box .btn .collect_btn_icon {
+.swiper_container .swiper_item .foot_box .btn .collect_btn_icon {
   width: 48rpx;
   height: 46rpx;
   margin-right: 14rpx;
 }
-.container .video-swiper .swiper_item .foot_box .btn .share_btn_icon {
+.swiper_container .swiper_item .foot_box .btn .share_btn_icon {
   width: 46rpx;
   height: 46rpx;
   margin-right: 14rpx;
 }
-.container .video-swiper .swiper_item .foot_box .btn .flower_btn_icon {
+.swiper_container .swiper_item .foot_box .btn .flower_btn_icon {
   width: 46rpx;
   height: 46rpx;
   margin-right: 14rpx;
 }
-.container .video-swiper .swiper_item .foot_box .btn .comment_btn_icon {
+.swiper_container .swiper_item .foot_box .btn .comment_btn_icon {
   width: 49rpx;
   height: 47rpx;
   margin-right: 14rpx;
 }
-.container .video-swiper .swiper_item .btn_wrapper {
+.swiper_container .swiper_item .btn_wrapper {
   width: 100%;
   height: 110rpx;
   display: flex;
   align-items: center;
   justify-content: center;
 }
-.container .video-swiper .swiper_item .btn_wrapper .reading_btn {
+.swiper_container .swiper_item .btn_wrapper .reading_btn {
   width: 271rpx;
   height: 80rpx;
   background: #14c962;
@@ -112,12 +117,12 @@
   align-items: center;
   justify-content: center;
 }
-.container .video-swiper .swiper_item .btn_wrapper .reading_btn image {
+.swiper_container .swiper_item .btn_wrapper .reading_btn image {
   width: 39rpx;
   height: 50rpx;
   margin-right: 20rpx;
 }
-.container .video-swiper .swiper_item .btn_wrapper .reading_btn text {
+.swiper_container .swiper_item .btn_wrapper .reading_btn text {
   color: #fff;
   font-size: 30rpx;
 }

+ 33 - 22
pages/index/index.js

@@ -100,7 +100,8 @@ Page({
     // 获取推荐列表
     if (myIndex == 0) {
       this.setData({
-        videoList: []
+        videoList: [],
+        isSwiper: true
       }, () => {
         this.getHotRecommend(this.uid);
       })
@@ -131,7 +132,8 @@ Page({
     // 刷新关注列表
     if (myIndex == 1) {
       this.setData({
-        videoList: []
+        videoList: [],
+        isSwiper: true
       }, () => {
         this.getFollowData()
       })
@@ -141,7 +143,8 @@ Page({
     if (myIndex == 3) {
       this.setData({
         videoList: [],
-        templates: 'my'
+        templates: 'my',
+        isSwiper: false
       }, () => {
         myInit(this);
       })
@@ -208,7 +211,7 @@ Page({
     getOpenidNoLogin((res) => {
       let winH = this.data.winH * this.data.devicePixelRatio;
       // let minusNumber = 860;
-      let minusNumber = (winH * 880) / 1206;
+      let minusNumber = (winH * 920) / 1206;
 
       // if(winH < 510){
       //   minusNumber = 400;
@@ -260,7 +263,7 @@ Page({
       uid
     ).success((res) => {
       // 点击切换按钮时 只刷新我的课程和未读消息 官方推荐和热门不加载
-      const recommendRes = res.data.data;
+ /*      const recommendRes = res.data.data;
       console.log(res)
       recommendRes.hotReader.forEach(item => {
         const temp = {};
@@ -268,27 +271,30 @@ Page({
         temp.img = item.userRead.iconImg;
         temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
         temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
+        temp.commentAmount = item.userRead.commentAmount ? item.userRead.commentAmount : 0;
         temp.classId = item.userRead.lessonId;
         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.type = item.userRead.type;
         // temp.avatar = item.user.avatar;
         temp.nickName = item.user ? item.user.wechatName : '';
         temp.id = item.userRead.id;
-        // recommendWorks.push(temp);
-        // that.data.hotData.hotWorks.push(temp);
+        temp.isLike = item.isLike;
+        temp.isFavorite = item.isFavorites;
         this.data.videoList.push(temp);
       });
       this.setData({
         videoList: this.data.videoList
-      })
-      this.getHotRecommendSecond(this.uid, 1, 5)
+      }) */
+      this.getHotRecommendSecond(1, 5)
     })
   },
   // 获取热门作品 算法出来的
-  getHotRecommendSecond: function (uid, pageNo, pageSize) {
-    httpRequestApi.getHotRecommendSecond(uid, pageNo, pageSize).success(res => {
+  getHotRecommendSecond: function (pageNo, pageSize) {
+    let grade = 'PRIMARY_FIRST_GRADE'
+    httpRequestApi.getHotRecommendSecond(grade, pageNo, pageSize).success(res => {
       console.log(res)
       const recommendRes = res.data.data.list;
       if (recommendRes.length === 0) return;
@@ -300,15 +306,19 @@ Page({
         temp.img = item.userRead.iconImg;
         temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
         temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
-        temp.classId = item.userRead.lessonId;
+        temp.commentAmount = item.userRead.commentAmount ? item.userRead.commentAmount : 0;
+        temp.classId = item.userRead.exampleId ? item.userRead.exampleId :  1605097720036046;
         temp.time = formatDate(item.userRead.gmtCreated, 3);
         temp.avatar = item.user.avatar;
         temp.profession = item.user.profession;
         temp.uid = item.user.uid;
-        temp.url = item.userRead.originVideo;
+        temp.url = item.userRead.videoPath ? item.userRead.videoPath : item.userRead.originVideo;
         temp.id = item.userRead.id;
+        temp.type = item.userRead.type;
         // temp.avatar = item.user.avatar;
         temp.nickName = item.user.wechatName;
+        temp.isLike = item.isLike;
+        temp.isFavorite = item.isFavorites;
         // recommendWorks.push(temp);
         this.data.videoList.push(temp);
 
@@ -467,9 +477,9 @@ Page({
   // 获取我的朗读
   getMyRead: function () {
     httpRequestApi.myRead().success(res => {
-      console.log(res)
+      console.log(123123,res)
       console.log('mydata', this.data.myData)
-      const myList = res.data.data.list;
+      const myList = res.data.data;
       if (myList.length === 0) return;
       // const recommendWorks = [];
       myList.forEach(item => {
@@ -482,11 +492,11 @@ Page({
         temp.img = item.iconImg;
         temp.plays = item.playAmount;
         temp.likes = item.likeAmount;
-        temp.classId = item.lessonId;
+        temp.classId = item.userRead.exampleId ? item.userRead.exampleId :  1605097720036046;
         temp.time = formatDate(item.gmtCreated, 3);
         temp.avatar = this.data.userInfo.avatar;
         temp.uid = this.uid;
-        temp.url = item.originVideo;
+        temp.url = item.userRead.videoPath ? item.userRead.videoPath : item.userRead.originVideo;
         temp.id = item.id;
         // temp.avatar = item.user.avatar;
         temp.nickName = this.data.userInfo.wechatName;
@@ -514,9 +524,9 @@ Page({
     this.setData({
       commentShow: !this.data.commentShow,
       commentId: e.detail.activeId,
-      commentList: []
+      // commentList: []
     });
-    this.getReply(e.detail.activeId);
+    // this.getReply(e.detail.activeId);
   },
   // 获取评论信息
   getReply: function (columnId) {
@@ -528,7 +538,7 @@ Page({
       console.log('reply', res)
       const commentList = res.data.data.list;
       const commentNum = res.data.data.totalSize;
-
+      console.log('评论数量',commentNum)
       commentList.forEach((item) => {
         const temp = {};
         temp.nickName = item.user.wechatName;
@@ -617,11 +627,11 @@ Page({
         temp.img = item.userRead.iconImg;
         temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
         temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
-        temp.classId = item.userRead.id;
+        temp.classId = item.userRead.exampleId ? item.userRead.exampleId :  1605097720036046;
         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 ? item.userRead.videoPath : item.userRead.originVideo;
         temp.nickName = item.user ? item.user.wechatName : '';
         temp.id = item.userRead.id;
         this.data.videoList.push(temp);
@@ -651,6 +661,7 @@ Page({
     })
   },
   goToReading: function (e) {
+    console.log('去朗读',e)
     wx.navigateTo({
       url: `../../pages/main/reading/reading?id=${e.detail.activeId}`
     });

+ 7 - 3
pages/index/index.wxml

@@ -38,11 +38,17 @@
       </view>
     </block>
   </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}}"
 
   bindopenComment="openComment"
   bindheadTap="headTapHandler"
@@ -58,13 +64,11 @@
   bindloadedmetadata="onLoadedMetaData" -->
   </VideoSwiper>
 
-   <!-- 调用组件 -->
-  <template is="{{templates}}" wx:if="{{myIndex === 3 || myIndex === 2}}" data="{{myData: myData,coursesData:coursesData}}"></template>
 
   <view class="comment_section" catchtap="commentTap" data-type="blank" wx:if="{{commentShow}}">
   <Comment 
   data-type="list"
-  commentList = "{{commentList}}"
+  commentId="{{commentId}}"
   commentNum ="{{commentNum}}"
   inputValue="{{inputValue}}"
   bindsendReply = "sendReply"

+ 1 - 1
pages/index/index.wxss

@@ -1,6 +1,6 @@
 /**index.wxss**/
 /*热门推荐*/
-@import "/component/hot/hot.wxss";
+/* @import "/component/hot/hot.wxss"; */
 /*热团*/
 @import "/component/group/group.wxss";
 /*关注*/

+ 74 - 25
pages/main/reading/reading.js

@@ -1,18 +1,18 @@
 import httpRequestApi from '../../../utils/APIClient';
 import {
     formatDate
-  } from '../../../utils/util';
+} from '../../../utils/util';
 Page({
     data: {
         title: '',
         id: '',
         img: '',
         fullScreenBtn: false,
-        playBtn: false,
+        playBtn: true,
         gesture: true,
         muted: false,
         gesture: false,
-        centerBtn: false,
+        centerBtn: true,
         recordFlag: 0,
         recordSource: '',
         videoCtr: 'recordingVideoEnd',
@@ -24,32 +24,38 @@ Page({
         readingText: '',
         videoList: [],
         pageNo: 1,
-        nextMargin: getApp().globalData.nextMargin
+        nextMargin: getApp().globalData.nextMargin,
+        lowerThresHold: 100,
+        isVideoListShow: true
     },
     onLoad: function (option) {
         console.log(option);
         this.videoCtx = null;
         const uid = wx.getStorageSync('uid')
-        httpRequestApi.getClassDetail(uid, option.id).success(res => {
+        httpRequestApi.getClassDetail(option.id).success(res => {
             console.log(res)
             let reg = /\\n/g
             this.setData({
-                title: res.data.data.lesson.title,
-                videoUrl: res.data.data.lesson.accompany || res.data.data.playUrl,
-                img: res.data.data.lesson.iconImg,
-                id: res.data.data.lesson.id,
-                // readingText: res.data.data.lessonText.replace(reg,'')
-                readingText: res.data.data.lesson.lessonText,
-                grade: res.data.data.lesson.gradeClassify,
-                productId: res.data.data.product.id
+                title: res.data.data.title,
+                videoUrl: res.data.data.originVideo || res.data.data.playUrl,
+                originVideo: res.data.data.originVideo,
+                img: res.data.data.iconImg,
+                id: res.data.data.id,
+                readingText: res.data.data.lessonText,
+                grade: res.data.data.grade,
+                exampleId: res.data.data.exampleId,
+                summary: res.data.data.summary
+                // productId: res.data.data.product.id
+
             })
             console.log(this.data.readingText)
             console.log(this.data.img)
+            this.getReadInfo(option.id)
+
             httpRequestApi.userIntoPage('pages/main/reading/reading', '朗读页面').success((res) => {
 
             })
         })
-        this.getReadInfo()
         this.recorderManager = wx.getRecorderManager();
 
 
@@ -162,6 +168,8 @@ Page({
                 title: "小学语文课文朗读", //标题
             },
         })
+        this.videoCtx = wx.createVideoContext('myVideo', this);
+
     },
     // 视频缓冲
     // videoWaiting: function () {
@@ -199,12 +207,14 @@ Page({
      *      2 录音结束
      ***/
     audioRecord: function () {
-        console.log(this.data.recordFlag)
+        console.log('recordFlag', this.data.recordFlag)
         if (this.data.recordFlag === 0) {
             // this.recordStart();
             // this.saveVideo();
+            console.log('是否有视频', this.videoCtx)
             if (this.videoCtx) {
                 this.videoCtx.stop();
+                this.videoCtx.seek(0);
             }
             if (this.recorderManager) {
                 this.recorderManager.stop();
@@ -267,11 +277,15 @@ Page({
     },
     // 播放录音
     audioPlay: function () {
+        this.setData({
+            videoUrl: this.data.videoUrl
+        })
         console.log('音频播放');
         if (this.innerAudioContext) {
             this.innerAudioContext.stop();
             this.videoCtx.stop();
         }
+        this.videoCtx.seek(0)
         this.innerAudioContext = wx.createInnerAudioContext();
         this.innerAudioContext.src = this.data.recordSource; // 这里可以是录音的临时路径
         console.log(this.innerAudioContext.src);
@@ -282,13 +296,16 @@ Page({
     videoComplete: function () {
         // let videoUrl = 'http://efunimgs.ai160.com/ott/test/002tPr2Xlx07oP7B4ro40104120022hP0k010.mp4';
         this.setData({
-            recordFlag: 1
+            recordFlag: 1,
+            videoUrl: this.data.originVideo,
+            centerBtn: false,
+            playBtn: false,
+            isVideoListShow: false
         }, () => {
-
+            this.videoCtx.play();
+            this.recordStart();
         })
-        this.videoCtx = wx.createVideoContext('myVideo', this);
-        this.videoCtx.play();
-        this.recordStart();
+
     },
     // 上传
     upload: function () {
@@ -331,8 +348,10 @@ Page({
                 "audioPath": audio,
                 "title": this.data.title,
                 "iconImg": this.data.img,
-                "summary": this.data.grade,
-                productId: this.data.productId
+                "summary": this.data.summary,
+                "productId": this.data.productId,
+                "grade":this.data.grade,
+                "exampleId": this.data.exampleId
             };
             httpRequestApi.postWork(uid, data).success(res => {
                 wx.hideLoading({
@@ -356,12 +375,13 @@ Page({
     },
 
     // 获取本课朗读内容
-    getReadInfo: function (pageNo, pageSize) {
+    getReadInfo: function (id,pageNo, pageSize) {
         // const uid =  wx.getStorageSync('uid');
         const data = {
-            lessonId: this.data.id,
+            exampleId: this.data.id || id,
             pageNo: this.data.pageNo,
-            pageSize: 10
+            pageSize: 3,
+            type:'READ'
         };
         httpRequestApi.getClassRead(this.uid, data).success(res => {
             const readInfo = res.data.data.list;
@@ -389,4 +409,33 @@ Page({
             })
         });
     },
+    // 评论区点击
+    commentTap: function (e) {
+        console.log('点击评论区', e)
+        if (e.target.dataset.type === 'blank') {
+            this.setData({
+                commentShow: false
+            })
+        }
+    },
+    scrollToLower: function (e) {
+        console.log('滑动到底部', e)
+        this.setData({
+            pageNo: this.data.pageNo + 1
+        }, () => {
+            this.getReadInfo()
+        })
+    },
+    scrollToUpper: function (e) {
+        console.log('滑动到顶部', e)
+
+    },
+    // 打开评论
+    openComment: function (e) {
+        console.log('id', e.detail.activeId)
+        this.setData({
+            commentShow: !this.data.commentShow,
+            commentId: e.detail.activeId,
+        });
+    },
 })

+ 24 - 29
pages/main/reading/reading.wxml

@@ -1,5 +1,4 @@
-<StatusBar receiveData="{{statusbarobj}}" grade="{{grade}}" bindgradeTap="gradeTap" />
-<view class="readingPage">
+<scroll-view class="readingPage" lower-threshold="{{}}" scroll-y="true" bindscrolltolower="scrollToLower" bindscrolltoupper="scrollToUpper">
     <!-- <view class="videoSection" wx:if="{{!isIOS}}">
         <image wx:if="{{!videoLoad}}" class="videoIcon" src="{{iconImg}}" />
     </view> -->
@@ -7,42 +6,38 @@
     <!-- bindwaiting="videoWaiting"
   bindplay="videoPlay" -->
     <!-- <audio name="123" author="123" src="{{recordSource}}" id="myAudio" controls loop></audio> -->
-    <scroll-view class="textSection" scroll-y="true">
-        <view class="btn_wrapper" bindtap="audioRecord">
-            <view class="reading_btn">
-                <image src="../../../static/index/star.png" />
-                <text>我要配音</text>
-            </view>
-        </view>
-        <text class="textContent">{{readingText}}</text>
-    </scroll-view>
-   <!--  <view class="footSection">
+    <view class="footSection">
         <image class="blackbord" src="../../../static/image/blackbord.png" />
         <view class="collectBtn footerBtn" wx:if="{{btnFlag}}" bindtap="audioPlay">
             <image src="../../../static/image/listen.png" />
             <text>试听</text>
         </view>
-        <view class="readingBtn footerBtn" bindtap="audioRecord">
+        <!-- <view class="readingBtn footerBtn" bindtap="audioRecord">
             <image class="microphone" src="{{btnImgFlag ? recordingGif :microphonePng}}" />
             <text>{{btnImgFlag ? '点击结束' : btnFlag ? '点击重录' : '开始朗读'}}</text>
+        </view> -->
+        <view class="btn_wrapper" bindtap="audioRecord">
+            <view class="reading_btn">
+                <image class="microphone" src="{{btnImgFlag ? recordingGif :microphonePng}}" />
+                <text>{{btnImgFlag ? '点击结束' : btnFlag ? '点击重录' : '开始朗读'}}</text>
+            </view>
         </view>
         <view class="shareBtn footerBtn" wx:if="{{btnFlag}}" bindtap="upload">
             <image src="../../../static/image/upload.png" />
             <text>上传</text>
         </view>
-    </view> -->
-
-</view>
-      <VideoSwiper 
-  wx:if="{{videoList.length > 0}}"
-  class="video-swiper" 
-  video-list="{{videoList}}" 
-  nextMargin="{{nextMargin}}"
-
-  bindopenComment="openComment"
-  bindheadTap="headTapHandler"
-  bindgoToReading="goToReading"
-  bindplay="onPlay"
-  >
-  </VideoSwiper>
-
+    </view>
+    <scroll-view class="textSection" scroll-y="true">
+        <!-- <view class="btn_wrapper" bindtap="audioRecord">
+            <view class="reading_btn">
+                <image src="../../../static/index/star.png" />
+                <text>{{btnImgFlag ? '点击结束' : btnFlag ? '点击重录' : '开始朗读'}}</text>
+            </view>
+        </view> -->
+        <text class="textContent">{{readingText}}</text>
+    </scroll-view>
+    <VideoSwiper wx:if="{{videoList.length > 0 && isVideoListShow}}" class="video-swiper" video-list="{{videoList}}" nextMargin="{{nextMargin}}" isSwiper="{{false}}" bindopenComment="openComment" bindheadTap="headTapHandler" bindgoToReading="goToReading" bindplay="onPlay"></VideoSwiper>
+</scroll-view>
+<view class="comment_section" catchtap="commentTap" data-type="blank" wx:if="{{commentShow}}">
+    <Comment data-type="list" commentId="{{commentId}}" />
+</view>

+ 5 - 5
pages/main/reading/reading.wxss

@@ -1,5 +1,5 @@
 .readingPage {
-    /* height: 100%; */
+    height: 100%;
     /* overflow: hidden; */
 }
 
@@ -23,7 +23,7 @@ audio {
     overflow: visible;
 }
 
-.textSection .btn_wrapper {
+.btn_wrapper {
     width: 100%;
     height: 110rpx;
     display: flex;
@@ -71,8 +71,8 @@ audio {
 .footSection {
     width: 750rpx;
     height: 192rpx;
-    position: fixed;
-    bottom: 0;
+    /* position: fixed; */
+    /* bottom: 0; */
     display: flex;
     flex-direction: row;
     justify-content: space-between;
@@ -130,7 +130,7 @@ audio {
 
 .footSection .microphone {
     display: block;
-    margin: -12rpx auto 8rpx;
+    /* margin: -12rpx auto 8rpx; */
     width: 108rpx;
     height: 106rpx;
 

+ 75 - 35
pages/user/myworks/myworks.js

@@ -1,6 +1,8 @@
 // pages/user/myworks/myworks.js
 import APIClient from '../../../utils/APIClient.js'
-import { formatDate } from '../../../utils/util.js'
+import {
+  formatDate
+} from '../../../utils/util.js'
 Page({
 
   /**
@@ -11,11 +13,21 @@ Page({
     pageNo: 1,
     totalNo: 0,
     uid: '',
-    worksList: [],
+    videoList: [],
     isFans: false,
     isMyself: false,
+    commentId: '',
+
   },
-  toMyWorks: function(e){
+  // 打开评论
+  openComment: function (e) {
+    console.log('id', e.detail.activeId)
+    this.setData({
+      commentShow: !this.data.commentShow,
+      commentId: e.detail.activeId,
+    });
+  },
+  toMyWorks: function (e) {
     let id = e.currentTarget.dataset.readid;
     let title = e.currentTarget.dataset.title;
     wx.navigateTo({
@@ -28,68 +40,96 @@ Page({
     const uid = wx.getStorageSync('uid');
     if (this.data.isFans) {
       APIClient.cancerFollow(uid, followUid).success((res) => {
-            this.setData({
-                isFans: false
-            })
-            wx.showToast({
-                title: '取消关注',
-                icon: 'success',
-                duration: 1000
-            })
-        });
+        this.setData({
+          isFans: false
+        })
+        wx.showToast({
+          title: '取消关注',
+          icon: 'success',
+          duration: 1000
+        })
+      });
     } else {
       APIClient.followUser(uid, followUid).success((res) => {
-            this.setData({
-                isFans: true
-            })
-            wx.showToast({
-                title: '关注啦',
-                icon: 'success',
-                duration: 1000
-            })
-        });
+        this.setData({
+          isFans: true
+        })
+        wx.showToast({
+          title: '关注啦',
+          icon: 'success',
+          duration: 1000
+        })
+      });
     }
-},
-  getResults(){
+  },
+  getResults() {
     let pageNo = this.data.pageNo;
     let pageSize = 3;
     let uid = this.data.uid;
-    console.log('用户身份',uid);
+    console.log('用户身份', uid);
     APIClient.getUserMsg(uid, pageNo, pageSize).success(res => {
       console.log(res)
-      res.data.data.user.birthday = formatDate(res.data.data.user.birthday,4)
+      res.data.data.user.birthday = formatDate(res.data.data.user.birthday, 4)
       this.setData({
         wareCards: res.data.data,
-        isFans: res.data.data.like 
+        isFans: res.data.data.like
       });
       console.log(this.data.wareCards)
       // wx.hideToast();
+      this.getUserWorks(uid, pageNo, pageSize)
     }).fail(err => {
       console.log(err);
     });
+
+  },
+
+  getUserWorks(uid, pageNo, pageSize) {
     APIClient.userWorks(uid, pageNo, pageSize).success(res => {
       console.log(res)
-      this.setData({
-        worksList: this.data.worksList.concat(res.data.data.list),
-        totalNo: res.data.data.totalNo
+      const recommendRes = res.data.data.list;
+      if (recommendRes.length === 0) return;
+      recommendRes.forEach(item => {
+        const temp = {};
+        temp.title = item.userRead.title;
+        temp.summary = item.userRead.summary;
+        temp.img = item.userRead.iconImg;
+        temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
+        temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
+        temp.commentAmount = item.userRead.commentAmount ? item.userRead.commentAmount : 0;
+        temp.classId = item.userRead.exampleId ? item.userRead.exampleId : 1605097720036046;
+        temp.time = formatDate(item.userRead.gmtCreated, 3);
+        temp.avatar = item.user.avatar;
+        temp.profession = item.user.profession;
+        temp.uid = item.user.uid;
+        temp.url = item.userRead.videoPath ? item.userRead.videoPath : item.userRead.originVideo;
+        temp.id = item.userRead.id;
+        temp.type = item.userRead.type;
+        // temp.avatar = item.user.avatar;
+        temp.nickName = item.user.wechatName;
+        temp.isLike = item.isLike;
+        temp.isFavorite = item.isFavorites;
+        // recommendWorks.push(temp);
+        this.data.videoList.push(temp);
+
       });
-      // wx.hideToast();
-    }).fail(err => {
-      console.log(err);
-    });
+      this.setData({
+        videoList: this.data.videoList
+      })
+      console.log('dangqian', this.data.videoList)
+    })
   },
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    if(options.uid === wx.getStorageSync('uid') || options.uid === 'c7f0a8fdd3a549ea9109a7b7486775f2'){
+    if (options.uid === wx.getStorageSync('uid') || options.uid === 'c7f0a8fdd3a549ea9109a7b7486775f2') {
       this.setData({
         isMyself: true
       })
     }
     this.setData({
       uid: options.uid
-    },() => {
+    }, () => {
       console.log(options.uid);
     });
     // wx.showToast({

+ 6 - 1
pages/user/myworks/myworks.json

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

+ 17 - 78
pages/user/myworks/myworks.wxml

@@ -1,30 +1,11 @@
 <!-- pages/user/myworks/myworks.wxml -->
 <!-- <wxs src="../../commonWxs/format.wxs" module="format" /> -->
-<view class='user-works'>
+<scroll-view class='user-works'>
   <view class='follow-details'>
     <view class='follow-info'>
       <view class='set-msg'>
-        <view class='avatar-bg'>
-          <view class='avatar-box'>
-            <image class='avatar-image' src='{{ wareCards.user.avatar }}'></image>
-          </view>
-          <view class='occupation-title' wx:if="{{wareCards.user.profession}}">
-            {{ wareCards.user.profession }}
-          </view>
-        </view>
-        <view class='avatar-msg'>
-          <view class='avatar-nickname'>
-            <text>{{ wareCards.user.wechatName }}</text>
-            <view class='flowers-box' wx:if='{{ wareCards.user.gender === 2 }}'>
-              <image src='../../../static/image/flowers.png'></image>
-            </view>
-            <view class='flowers-box' wx:elif='{{ wareCards.user.gender === 1 }}'>
-              <image src='../../../static/image/boy.png'></image>
-            </view>
-          </view>
-          <view class='avatar-birthday'>{{ wareCards.user.birthday ? wareCards.user.birthday : '' }}</view>
-          <view class='avatar-address'>{{ wareCards.user.schoolName }}</view>
-        </view>
+        <image class='avatar-image' src='{{ wareCards.user.avatar }}'></image>
+        <text class="avatar-nickname">{{ wareCards.user.wechatName }}</text>
       </view>
       <view class="follow" wx:if="{{!isMyself}}" bindtap="follow">
         <image src="{{isFans? '../../../static/image/fully_heart.png' : '../../../static/image/empty_heart.png'}}" />
@@ -33,69 +14,27 @@
     </view>
     <view class='mine-category'>
       <view class='play-count'>
-        <view class='color' style="padding-right:38rpx;">{{ wareCards.playAmount || 0 }}</view>
-        <view class='border-right'>
-          <view class='play-img'>
-            <image src='../../../static/image/play.png'></image>
-          </view>
+          <text>作品</text>
+          {{ wareCards.readAmount || 0 }}
+      </view>
+      <view class='play-count'>
           <text>播放量</text>
-        </view>
+          {{ wareCards.playAmount || 0 }}
       </view>
       <view class='follow-count'>
-        <view class='color' style="padding-right:48rpx;">{{ wareCards.fansAmount || 0 }}</view>
-        <view class='border-right'>
-          <view class='red-heart'>
-            <image src='../../../static/image/purple_heart.png'></image>
-          </view>
           <text>粉丝</text>
-        </view>
+          {{ wareCards.fansAmount || 0 }}
       </view>
-      <!-- <view class='point-count'>
-        <view class='color' style="padding-right:60rpx;">{{ wareCards.likeAmount || 0 }}</view>
-        <view class='border-right'>
-          <view class='point-img'>
-            <image src='../../../static/image/point.png'></image>
-          </view>
-          <text>赞</text>
-        </view>
-      </view> -->
       <view class='flower-count'>
-        <view class='color'>{{ wareCards.integralAmount || 0 }}</view>
-        <view class='border-right'>
-          <view class='point-img'>
-            <image src='../../../static/image/flower_small_pink.png'></image>
-          </view>
-          <text>红花</text>
-        </view>
-      </view>
-    </view>
-  </view>
-  <view class="hotWares">
-    <view wx:for="{{worksList}}" wx:key="{{index}}" class="worksCard" bindtap="toMyWorks" data-readId="{{ item.userRead.id }}" data-title="{{ item.userRead.title }}">
-      <view class="topData">
-        <view class="worksLeft">
-          <image class="authorAvatar" lazy-load="true" src="{{ item.user.avatar }}" />
-          <view class="worksInfo">
-            <view class="authorName">{{ item.user.wechatName }}</view>
-            <view class="time">{{ format.formatDate(item.userRead.gmtCreated) || 0 }}</view>
-          </view>
-        </view>
-        <view class="numberInfo">
-          <view class="wareCardPlays">
-            <image class="wareCardPlaysImg" lazy-load="true" src="../../../static/image/hotPlays.png" />
-            <text>{{ item.userRead.playAmount || 0 }}</text>
-          </view>
-          <view class="wareCardLikes">
-            <image class="wareCardLikesImg" lazy-load="true" src="../../../static/image/flower_small_pink.png" />
-            <text>{{ item.userRead.likeAmount || 0 }}</text>
-          </view>
-        </view>
-      </view>
-      <image class="wareCardImg" src="{{ item.userRead.iconImg }}" />
-      <view class="titleSummary">
-        <text class="wareCardTitle">{{ item.userRead.title }}</text>
-        <text class="wareCardTip">{{ item.userRead.summary }}</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>
+</scroll-view>
+<view class="comment_section" catchtap="commentTap" data-type="blank" wx:if="{{commentShow}}">
+    <Comment data-type="list" commentId="{{commentId}}" />
 </view>

+ 36 - 65
pages/user/myworks/myworks.wxss

@@ -17,7 +17,7 @@ page {
 
 .follow-details {
   width: 100%;
-  height: 382rpx;
+  height: 230rpx;
   /* border-radius: 20rpx; */
   background: #FFFFFF;
   /* margin-top: 30rpx; */
@@ -25,11 +25,15 @@ page {
   display: flex;
   position: relative;
   box-sizing: border-box;
+  display: flex;
+  flex-direction: column;
+
 }
 
 .follow-info {
   width: 100%;
   display: flex;
+  padding: 30rpx 22rpx 10rpx 30rpx;
 }
 
 .follow {
@@ -67,35 +71,31 @@ page {
 }
 
 .avatar-box {
-  width: 138rpx;
-  height: 138rpx;
+  width: 100rpx;
+  height: 100rpx;
   border-radius: 50%;
   z-index: 300;
   /* position: absolute;
   top: 7rpx;
   left: 7rpx; */
-  margin: 8rpx auto;
 }
 
 .avatar-image {
-  width: 100%;
-  height: 100%;
+  width: 100rpx;
+  height: 100rpx;
   border-radius: 50%;
+  margin-right: 28rpx;
 }
-
-.avatar-nickname {
-  width: 500rpx;
-  display: flex;
-
-}
-
-.avatar-nickname text {
+.avatar-nickname{
   max-width: 290rpx;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
+  font-size: 30rpx;
+  color: rgba(0, 0, 0, .6);
 }
 
+
 .avatar-address {
   width: 500rpx;
 }
@@ -112,65 +112,50 @@ page {
 }
 
 .occupation-title {
-  width:60rpx;
-height:30rpx;
-background:rgba(97, 202, 84, 1);
-border-radius:15rpx;
-font-size:22rpx;
-font-weight:800;
-color:rgba(255, 255, 255, 1);
-line-height:30rpx;
-text-align:center;
-position:absolute;
-bottom:-10rpx;
-left:48rpx;
+  width: 60rpx;
+  height: 30rpx;
+  background: rgba(97, 202, 84, 1);
+  border-radius: 15rpx;
+  font-size: 22rpx;
+  font-weight: 800;
+  color: rgba(255, 255, 255, 1);
+  line-height: 30rpx;
+  text-align: center;
+  position: absolute;
+  bottom: -10rpx;
+  left: 48rpx;
 
 
 }
 
 .avatar-msg {
   margin-left: 40rpx;
-  margin-top: 50rpx;
-  width: 500rpx;
-  height: 150rpx;
-  color: #444444;
   font-size: 32rpx;
 }
 
-.gender-size {
-  margin-left: 10rpx;
-  font-size: 28rpx;
-  align-self: center;
-}
-
 .set-msg {
-  width: 100%;
-  height: 248rpx;
   display: flex;
-  align-items: flex-start;
+  align-items: center;
   justify-content: center;
 }
 
-.avatar-nickname,
-.avatar-birthday,
-.avatar-address {
-  line-height: 50rpx;
-  color: #444;
-  font-size: 32rpx;
-}
+
 
 .mine-category {
   box-sizing: border-box;
   width: 674rpx;
-  padding-top: 30rpx;
-  border-top: 4rpx solid #F0F1F5;
+  /* padding-top: 30rpx; */
+  border-top: 1rpx solid rgba(0,0,0,.2);
+  padding-top: 19rpx;
   font-size: 28rpx;
   /* font-weight: 600; */
+  color: rgba(0,0,0,.6);
   z-index: 900;
   display: flex;
-  position: absolute;
-  top: 246rpx;
-  left: 5%;
+  margin: 0 auto;
+  /* position: absolute; */
+  /* top: 246rpx; */
+  /* left: 5%; */
   justify-content: space-around;
 }
 
@@ -229,21 +214,7 @@ image {
 
 }
 
-.play-count {
-  color: #92D626;
-}
-
-.point-count {
-  color: #FFA700;
-}
-
-.follow-count {
-  color: #F466FF;
-}
 
-.flower-count {
-  color: #EE5750;
-}
 
 .hotWares {
   display: flex;

+ 4 - 0
templates/courses/courses.less

@@ -1,11 +1,15 @@
 .courses_container {
     width: 100%;
     height: 100%;
+    background: #444;
 
     .course_item {
         width: 100%;
         height: 400rpx;
         background: #fff;
+        margin-top: 10rpx;
+        padding-top: 20rpx;
+        box-sizing: border-box;
         // display: flex;
         // flex-direction: column;
         // align-items: center;

+ 4 - 0
templates/courses/courses.wxss

@@ -1,11 +1,15 @@
 .courses_container {
   width: 100%;
   height: 100%;
+  background: #444;
 }
 .courses_container .course_item {
   width: 100%;
   height: 400rpx;
   background: #fff;
+  margin-top: 10rpx;
+  padding-top: 20rpx;
+  box-sizing: border-box;
 }
 .courses_container .course_item .course_icon {
   display: block;

+ 42 - 39
utils/APIClient.js

@@ -10,7 +10,7 @@ function getProductUrl(action) {
 
 function getBaseUrl(action) {
   return HOST_BASE + action;
-} 
+}
 module.exports = {
   //获取推荐首页信息(推荐课程)
   getIndex(uid) {
@@ -20,20 +20,21 @@ module.exports = {
     }).url(url).send();
   },
   // 获取首页人气推荐
-  getHotRecommendSecond(uid, pageNo, pageSize) {
+  getHotRecommendSecond(grade, pageNo, pageSize) {
     let url = getBaseUrl('wx/userRead/recommend');
     return request.getInstance().header({
-      uid
+      uid: wx.getStorageSync('uid')
     }).data({
+      grade,
       pageNo,
       pageSize,
     }).url(url).send();
   },
   // 获取首页人气推荐2.0 
-  getHotRecommend(uid) {
+  getHotRecommend() {
     let url = getBaseUrl('wx/discovery');
     return request.getInstance().header({
-      uid
+      uid: wx.getStorageSync('uid')
     }).url(url).send();
   },
   // 获取用户朗读详细信息
@@ -60,14 +61,16 @@ module.exports = {
       uid
     }).url(url).send();
   },
-  // 获取单课详情
-  getClassDetail(uid, id) {
+  // 获取朗读详情
+  // 获取单课详情 
+  getClassDetail(id) {
     // let url = getProductUrl(`wx/lesson/${id}`);
-    let url = getBaseUrl(`wx/lesson/info/${id}`);
+    let url = getBaseUrl(`wx/userRead/readInfo/${id}`);
     return request.getInstance().header({
-      uid
+      uid: wx.getStorageSync('uid')
     }).url(url).send();
   },
+  
   // 检查是否收藏过课程
   classIsLike(uid, data) {
     let url = getBaseUrl(`wx/favorites/isLike`);
@@ -98,10 +101,10 @@ module.exports = {
     }).url(url).data(data).method('POST').send();
   },
   // 点赞作品
-  likeWorks(uid, readId) {
+  likeWorks(readId) {
     let url = getBaseUrl(`wx/userRead/like/${readId}`);
     return request.getInstance().header({
-      uid
+      uid: wx.getStorageSync('uid')
     }).url(url).send();
   },
   // 关注用户
@@ -143,10 +146,10 @@ module.exports = {
     }).send();
   },
   // 搜索
-  getCourses(grade,pageNo, pageSize) {
+  getCourses(grade, pageNo, pageSize) {
     let url = getBaseUrl(`wx/lesson`);
     return request.getInstance().header({
-      uid:wx.getStorageSync('uid')
+      uid: wx.getStorageSync('uid')
     }).url(url).data({
       gradeClassify: grade,
       pageNo: pageNo,
@@ -165,31 +168,31 @@ module.exports = {
     }).send();
   },
   // 获取回复(楼中楼)
-  getReplyComment(uid, postId) {
+  getReplyComment(postId) {
     let url = getBaseUrl(`wx/posts/one/${postId}`);
     return request.getInstance().header({
-      uid
+      uid: wx.getStorageSync('uid')
     }).url(url).send();
   },
   // 发布回复(楼中楼)
-  postReplyComment(uid, data) {
+  postReplyComment(data) {
     let url = getBaseUrl(`wx/reply`);
     return request.getInstance().header({
-      uid
+      uid: wx.getStorageSync('uid')
     }).url(url).data(data).method('POST').send();
   },
   // 点赞评论
-  likeCommend(uid, likeUid) {
-    let url = getBaseUrl(`wx/posts/attribute/${likeUid}`);
+  likeCommend(postId) {
+    let url = getBaseUrl(`wx/posts/like/${postId}`);
     return request.getInstance().header({
-      uid
+      uid: wx.getStorageSync('uid')
     }).url(url).method('GET').send();
   },
   // 发布讨论
-  postReply(uid, data) {
+  postReply(data) {
     let url = getBaseUrl(`wx/posts`);
     return request.getInstance().header({
-      uid
+      uid: wx.getStorageSync('uid')
     }).url(url).data(data).method('POST').send();
   },
   // 获取推荐团购信息
@@ -230,10 +233,10 @@ module.exports = {
     }).method('POST').send();
   },
   // 收藏课程
-  collectClass(uid, data) {
+  collectClass(data) {
     let url = getBaseUrl(`wx/favorites`);
     return request.getInstance().header({
-      uid
+      uid: wx.getStorageSync('uid')
     }).url(url).data(data).method('POST').send();
   },
   //我的团
@@ -405,14 +408,14 @@ module.exports = {
     }).url(url).send();
   },
   // 更新消息状态
-  refreshMessageStatus(){
+  refreshMessageStatus() {
     let url = getBaseUrl('wx/message');
     return request.getInstance().header({
       uid: wx.getStorageSync('uid')
     }).url(url).method('PUT').send();
   },
   // 获取正在进行中的团数量
-  getMyGroupGoing(){
+  getMyGroupGoing() {
     let url = getBaseUrl('wx/groupPurchase/underway');
     return request.getInstance().header({
       uid: wx.getStorageSync('uid')
@@ -440,7 +443,7 @@ module.exports = {
     }).url(url).method('POST').send();
   },
   // 用户进入页面统计
-  userIntoPage(action,actionName) {
+  userIntoPage(action, actionName) {
     let url = getBaseUrl('wx/userEvent');
     return request.getInstance().header({
       uid: wx.getStorageSync('uid')
@@ -457,11 +460,11 @@ module.exports = {
     }).data(data).url(url).method('POST').send();
   },
   // 小红花 获取任务列表
-  getMissionList(){
-      let url = getBaseUrl('wx/task');
-      return request.getInstance().header({
-        uid: wx.getStorageSync('uid')
-      }).url(url).send();
+  getMissionList() {
+    let url = getBaseUrl('wx/task');
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).send();
   },
   // 获取用户连续签到日期
   // getSignInData(){
@@ -471,7 +474,7 @@ module.exports = {
   //   }).url(url).send();
   // },
   // 保存formId
-  postFormId(formId){
+  postFormId(formId) {
     let url = getBaseUrl('wx/form');
     return request.getInstance().header({
       uid: wx.getStorageSync('uid')
@@ -480,21 +483,21 @@ module.exports = {
     }).url(url).method('POST').send();
   },
   // 获取签到信息 
-  getSignInData(){
+  getSignInData() {
     let url = getBaseUrl('wx/loginLog/signIn');
     return request.getInstance().header({
       uid: wx.getStorageSync('uid')
     }).url(url).send();
   },
   // 获取产品信息
-  getProductData(){
+  getProductData() {
     let url = getBaseUrl('wx/product');
     return request.getInstance().header({
       uid: wx.getStorageSync('uid')
     }).url(url).send();
   },
   // 创建订单
-  postOrder(productId){
+  postOrder(productId) {
     let url = getBaseUrl('wx/order');
     return request.getInstance().header({
       uid: wx.getStorageSync('uid'),
@@ -504,8 +507,8 @@ module.exports = {
     }).url(url).method('POST').send();
   },
   //激活码激活
-  postActiveCode(code){
-    console.log(22222,code)
+  postActiveCode(code) {
+    console.log(22222, code)
     let url = getBaseUrl('wx/activationCode');
     return request.getInstance().header({
       uid: wx.getStorageSync('uid'),
@@ -514,7 +517,7 @@ module.exports = {
     }).url(url).method('POST').send();
   },
   // 会员鉴权
-  getUserAuth(){
+  getUserAuth() {
     let url = getBaseUrl('wx/auth');
     return request.getInstance().header({
       uid: wx.getStorageSync('uid')