Rorschach пре 4 година
родитељ
комит
8c017a8613
40 измењених фајлова са 423 додато и 222 уклоњено
  1. 1 1
      app.json
  2. 1 1
      component/comment/comment.js
  3. 1 1
      component/my/my.js
  4. 14 14
      component/my/my.wxml
  5. 8 1
      component/my/my.wxss
  6. 2 1
      component/share/share.js
  7. 24 13
      component/video-swiper/index.js
  8. 1 0
      component/video-swiper/index.less
  9. 14 14
      component/video-swiper/index.wxml
  10. 1 0
      component/video-swiper/index.wxss
  11. 159 61
      pages/index/index.js
  12. 1 1
      pages/index/index.wxml
  13. 1 0
      pages/index/index.wxss
  14. 7 1
      pages/mycollection/mycollection.js
  15. 2 1
      pages/mycollection/mycollection.wxml
  16. 1 1
      pages/user/myconcern/myconcern.js
  17. 0 0
      pages/myconcern/myconcern.json
  18. 2 2
      pages/user/myconcern/myconcern.wxml
  19. 0 0
      pages/myconcern/myconcern.wxss
  20. 3 2
      pages/myworks/myworks.wxml
  21. 9 12
      pages/myworks/myworks.wxss
  22. 134 55
      pages/reading/reading.js
  23. 3 4
      pages/reading/reading.wxml
  24. 9 18
      pages/reading/reading.wxss
  25. 6 7
      project.config.json
  26. BIN
      static/index/add_follow.png
  27. BIN
      static/index/contact.png
  28. BIN
      static/index/delete.png
  29. BIN
      static/index/follow.png
  30. BIN
      static/index/followed.png
  31. BIN
      static/index/heart.png
  32. BIN
      static/index/heart_colored.png
  33. BIN
      static/index/hide_icon.png
  34. BIN
      static/index/listen.png
  35. BIN
      static/index/microphone.png
  36. BIN
      static/index/readingNow.gif
  37. BIN
      static/index/show_icon.png
  38. BIN
      static/index/upload.png
  39. 6 6
      templates/courses/courses.wxml
  40. 13 5
      templates/courses/courses.wxss

+ 1 - 1
app.json

@@ -13,7 +13,7 @@
     "pages/main/week/week",
     "pages/main/week/week",
     "pages/main/searchResult/searchResult",
     "pages/main/searchResult/searchResult",
     "pages/user/myEdit/myEdit",
     "pages/user/myEdit/myEdit",
-    "pages/user/myconcern/myconcern",
+    "pages/myconcern/myconcern",
     "pages/user/myWallet/myWallet",
     "pages/user/myWallet/myWallet",
     "pages/user/mycourse/mycourse",
     "pages/user/mycourse/mycourse",
     "pages/user/myread/myread",
     "pages/user/myread/myread",

+ 1 - 1
component/comment/comment.js

@@ -144,7 +144,7 @@ Component({
         this.setData({
         this.setData({
           replyInfo: '',
           replyInfo: '',
         }, () => {
         }, () => {
-          this.getReply(this.data.commentId);
+          this.getReplyInner(this.data.commentId);
           this.setData({
           this.setData({
             inputValue: '',
             inputValue: '',
             replyType: 'works',
             replyType: 'works',

+ 1 - 1
component/my/my.js

@@ -35,7 +35,7 @@ export const myInit = (that) => {
     },
     },
     that.toMyConcern = e => {
     that.toMyConcern = e => {
       wx.navigateTo({
       wx.navigateTo({
-        url: `../user/myconcern/myconcern?title=我的关注`
+        url: `../myconcern/myconcern?title=我的关注`
       });
       });
     }
     }
   that.toMyRead = e => {
   that.toMyRead = e => {

+ 14 - 14
component/my/my.wxml

@@ -10,17 +10,13 @@
             <!-- <view class='occupation-title' wx:if="{{myData.user.user.profession}}">{{ myData.user.user.profession }}</view> -->
             <!-- <view class='occupation-title' wx:if="{{myData.user.user.profession}}">{{ myData.user.user.profession }}</view> -->
           </view>
           </view>
           <view class='avatar-msg' bindtap="toMyEdit">
           <view class='avatar-msg' bindtap="toMyEdit">
-            <view class='avatar-nickname'>
-              微信昵称:{{ myData.userInfo.wechatName  }}
-            </view>
-            <view class='avatar-nickname'>
-              年级:{{myData.userInfo.gradeText  }}
-            </view>
+            <view class='avatar-nickname'>微信昵称:{{ myData.userInfo.wechatName  }}</view>
+            <view class='avatar-nickname'>年级:{{myData.userInfo.gradeText  }}</view>
             <image class="edit-img" src="../../static/image/edit_new.png" />
             <image class="edit-img" src="../../static/image/edit_new.png" />
             <view class='mine-category'>
             <view class='mine-category'>
-              <view class='amount-text'>{{ myData.user.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.user.likeAmount || 0 }} 赞</view> -->
-              <view class='amount-text'>{{ myData.user.fansAmount || 0 }} 粉丝</view>
+              <view class='amount-text'>{{ myData.fansAmount || 0 }} 粉丝</view>
             </view>
             </view>
           </view>
           </view>
         </view>
         </view>
@@ -45,28 +41,32 @@
           <view class="flower-box-box">
           <view class="flower-box-box">
             <image class="flower-icon" src='../../static/image/flower_small.png' />
             <image class="flower-icon" src='../../static/image/flower_small.png' />
             <view class="flower-text">
             <view class="flower-text">
-              <view>小红花:{{myData.user.integralAmount || 0 }}</view>
+              <view>小红花:{{myData.integralAmount || 0 }}</view>
             </view>
             </view>
           </view>
           </view>
           <view class="flower-tips-text">
           <view class="flower-tips-text">
-            <text class="flower-last">{{myData.user.unfinishedAmount }}</text>
+            <text class="flower-last">{{myData.unfinishedAmount }}</text>
             个任务福利还没有完成
             个任务福利还没有完成
           </view>
           </view>
         </view>
         </view>
       </view>
       </view>
       <view class="btn-section">
       <view class="btn-section">
         <view class="btn" bindtap='toMyConcern'>
         <view class="btn" bindtap='toMyConcern'>
-          <image src="../../static/image/concern.png" />
+          <image class="btn-icon" src="../../static/image/concern.png" />
           <view class="btn-title">我的关注</view>
           <view class="btn-title">我的关注</view>
         </view>
         </view>
         <view class="btn" bindtap='toMyKeep' data-title='{{ myData.keep }}'>
         <view class="btn" bindtap='toMyKeep' data-title='{{ myData.keep }}'>
-          <image src="../../static/image/collect.png" />
+          <image class="btn-icon" src="../../static/image/collect.png" />
           <view class="btn-title">我的收藏</view>
           <view class="btn-title">我的收藏</view>
         </view>
         </view>
         <view class="btn">
         <view class="btn">
-          <image src="../../static/image/message.png" bindtap="goToMessage" />
-          <view class="btn-title">消息/客服</view>
+          <image class="btn-icon" src="../../static/image/message.png" bindtap="goToMessage" />
+          <view class="btn-title">消息通知</view>
         </view>
         </view>
+        <button class="btn" open-type="contact" plain="true" hover-class="none" style="border: none;">
+            <image class="btn-icon" src="../../static/index/contact.png"></image>
+            <view class="btn-title">联系客服</view>
+        </button>
       </view>
       </view>
     </view>
     </view>
   </view>
   </view>

+ 8 - 1
component/my/my.wxss

@@ -325,17 +325,24 @@ margin-top: -7rpx;
 }
 }
 
 
 .btn {
 .btn {
+  padding: 0;
+  margin: 0;
+  overflow: visible;
+  -webkit-appearance: none;
+  -webkit-tap-highlight-color: #fff;
   width: 121rpx;
   width: 121rpx;
   height: 170rpx;
   height: 170rpx;
   display: flex;
   display: flex;
   flex-direction: column;
   flex-direction: column;
   margin-top: 6rpx;
   margin-top: 6rpx;
+  line-height: normal;
 }
 }
 
 
-.btn image {
+.btn .btn-icon {
   width: 121rpx;
   width: 121rpx;
   height: 121rpx;
   height: 121rpx;
   border-radius: 50%;
   border-radius: 50%;
+  flex-shrink: 0;
 }
 }
 
 
 .btn-title {
 .btn-title {

+ 2 - 1
component/share/share.js

@@ -336,7 +336,8 @@ Component({
       this.triggerEvent('customevent', {})
       this.triggerEvent('customevent', {})
     }
     }
   },
   },
-  onShareAppMessage: (res) => {
+  onShareAppMessage: (e) => {
+    console.log('点击分享按钮',e)
     if (res.from === 'button') {
     if (res.from === 'button') {
       // 来自页面内转发按钮
       // 来自页面内转发按钮
       console.log(res.target)
       console.log(res.target)

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

@@ -100,13 +100,15 @@ Component({
             if (diff === 0) return;
             if (diff === 0) return;
             this.data._last = current;
             this.data._last = current;
             this.playCurrent(current);
             this.playCurrent(current);
+           
+            var direction = diff === 1 || diff === -2 ? 'up' : 'down';
             this.triggerEvent('change', {
             this.triggerEvent('change', {
                 activeId: curQueue[current].id,
                 activeId: curQueue[current].id,
                 index: current,
                 index: current,
                 _last,
                 _last,
                 nextQueue,
                 nextQueue,
+                direction
             });
             });
-            var direction = diff === 1 || diff === -2 ? 'up' : 'down';
             if (direction === 'up') {
             if (direction === 'up') {
                 if (this.data._invalidDown === 0) {
                 if (this.data._invalidDown === 0) {
                     var change = (_change + 1) % 3;
                     var change = (_change + 1) % 3;
@@ -182,6 +184,7 @@ Component({
                     lastVideoId: e.target.id
                     lastVideoId: e.target.id
                 })
                 })
             }
             }
+            this.triggerEvent('onPlay')
         },
         },
         onPause: function onPause(e) {
         onPause: function onPause(e) {
             this.trigger(e, 'pause');
             this.trigger(e, 'pause');
@@ -270,9 +273,6 @@ Component({
             }
             }
 
 
         },
         },
-        collectTapList: function collectTapList(e) {
-
-        },
         // 点赞
         // 点赞
         likeTap: function likeTap(e) {
         likeTap: function likeTap(e) {
             if (!wx.getStorageSync('user').wechatName) {
             if (!wx.getStorageSync('user').wechatName) {
@@ -289,15 +289,25 @@ Component({
             const id = e.target.dataset.id ? e.target.dataset.id : e.currentTarget.dataset.id;
             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;
             const index = e.target.dataset.index ? e.target.dataset.index : e.currentTarget.dataset.index;
             console.log('视频index', 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
-                })
-            });
-
+            if (this.isSwiper) {
+                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
+                    })
+                });
+            } else {
+                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
+                    })
+                });
+            }
         },
         },
         delete: function (e) {
         delete: function (e) {
             console.log('删除', e)
             console.log('删除', e)
@@ -346,6 +356,7 @@ Component({
                 })
                 })
                 this.shareDialog.share(data);
                 this.shareDialog.share(data);
             }
             }
+            this.triggerEvent('openShare',e)
         },
         },
         trigger: function trigger(e, type) {
         trigger: function trigger(e, type) {
             if (!wx.getStorageSync('user').wechatName) {
             if (!wx.getStorageSync('user').wechatName) {

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

@@ -157,6 +157,7 @@
                     width: 46rpx;
                     width: 46rpx;
                     height: 46rpx;
                     height: 46rpx;
                     margin-right: 14rpx;
                     margin-right: 14rpx;
+                    border-radius: none;
                 }
                 }
 
 
                 .comment_btn_icon {
                 .comment_btn_icon {

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

@@ -2,7 +2,7 @@
   <swiper 
   <swiper 
     wx:if="{{isSwiper}}"
     wx:if="{{isSwiper}}"
     class="video-swiper" 
     class="video-swiper" 
-    circular="{{false}}"
+    circular="{{circular}}"
     next-margin="{{nextMargin}}" 
     next-margin="{{nextMargin}}" 
     easing-function="{{easingFunction}}" 
     easing-function="{{easingFunction}}" 
     vertical 
     vertical 
@@ -25,12 +25,12 @@
           </view>
           </view>
           <view wx:if="{{item.showMyBtn}}" class="my_btn">
           <view wx:if="{{item.showMyBtn}}" class="my_btn">
             <view catchtap="delete" data-id="{{item.id}}">
             <view catchtap="delete" data-id="{{item.id}}">
-              <image src="../../static/index/star.png" />
+              <image src="../../static/index/delete.png" />
               <text >删除</text>
               <text >删除</text>
             </view>
             </view>
             <view catchtap="hide" data-status="{{item.status}}"  data-id="{{item.id}}">
             <view catchtap="hide" data-status="{{item.status}}"  data-id="{{item.id}}">
-              <image src="../../static/index/star.png" />
-              <text >隐藏</text>
+              <image src="{{item.status==='NORMAL'? '../../static/index/hide_icon.png': '../../static/index/show_icon.png'}}" />
+              <text >{{item.status==='NORMAL'? '隐藏': '展示'}}</text>
             </view>
             </view>
           </view>
           </view>
       </view>
       </view>
@@ -71,14 +71,14 @@
               <image class="collect_btn_icon" src="{{item.isFavorite ? '../../static/index/star_colored.png' : '../../static/index/star.png'}}" />
               <image class="collect_btn_icon" src="{{item.isFavorite ? '../../static/index/star_colored.png' : '../../static/index/star.png'}}" />
               <text>收藏</text>
               <text>收藏</text>
           </view>
           </view>
-          <view class="btn share_btn" bindtap="openShare" data-index="{{index}}" data-id="{{item.id}}" data-avatar="{{item.avatar}}" data-author="{{item.nickName}}" data-uid="{{item.uid}}" data-icon="{{item.iconImg}}" data-title="{{item.title}}" data-type="{{item.type}}">
+          <view class="btn share_btn" bindtap="openShare" data-index="{{index}}" data-id="{{item.id}}" data-avatar="{{item.avatar}}" data-author="{{item.nickName}}" data-uid="{{item.uid}}" data-img="{{item.img}}" data-title="{{item.title}}" data-type="{{item.type}}">
               <image class="share_btn_icon" src="../../static/index/share.png" lazy-load="true" />
               <image class="share_btn_icon" src="../../static/index/share.png" lazy-load="true" />
               <text>分享</text>
               <text>分享</text>
           </view>
           </view>
         </view>
         </view>
         <view class="foot_right">
         <view class="foot_right">
           <view class="btn flower_btn" catchtap="{{item.isLike ?  null : 'likeTap'}}" data-index="{{index}}" data-id="{{item.id}}" data-islike="{{item.isLike}}">
           <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'}}" />
+              <image class="flower_btn_icon" src="{{item.isLike ? '../../static/index/heart.png' : '../../static/index/heart.png'}}" />
               <text>{{item.likes}}</text>
               <text>{{item.likes}}</text>
           </view>
           </view>
           <view class="btn comment_btn" catchtap="openComment" data-id="{{item.id}}">
           <view class="btn comment_btn" catchtap="openComment" data-id="{{item.id}}">
@@ -90,7 +90,7 @@
       </view>
       </view>
       <view class="btn_wrapper" catchtap="goToReading" data-id="{{item.classId}}">
       <view class="btn_wrapper" catchtap="goToReading" data-id="{{item.classId}}">
         <view class="reading_btn">
         <view class="reading_btn">
-          <image src="../../static/index/star.png" />
+          <image src="../../static/index/microphone.png" />
           <text>我要配音</text>
           <text>我要配音</text>
         </view>
         </view>
       </view>
       </view>
@@ -112,12 +112,12 @@
           </view>
           </view>
           <view wx:if="{{item.showMyBtn}}" class="my_btn">
           <view wx:if="{{item.showMyBtn}}" class="my_btn">
             <view class="delete" catchtap="delete" data-id="{{item.id}}">
             <view class="delete" catchtap="delete" data-id="{{item.id}}">
-              <image class="delete_image" src="../../static/index/star.png" />
+              <image class="delete_image" src="../../static/index/delete.png" />
               <text class="delete_text" >删除</text>
               <text class="delete_text" >删除</text>
             </view>
             </view>
             <view class="hide" catchtap="hide" data-status="{{item.status}}" data-id="{{item.id}}">
             <view class="hide" catchtap="hide" data-status="{{item.status}}" data-id="{{item.id}}">
-              <image class="hide_image" src="../../static/index/star.png" />
-              <text class="hide_text" >{{item.status === 'DISABLE' ? '打开' : '隐藏'}}</text>
+              <image class="hide_image" src="{{item.status==='NORMAL'? '../../static/index/hide_icon.png': '../../static/index/show_icon.png'}}" />
+              <text class="hide_text" >{{item.status==='NORMAL'? '隐藏': '展示'}}</text>
             </view>
             </view>
           </view>
           </view>
       </view>
       </view>
@@ -157,14 +157,14 @@
               <image class="collect_btn_icon" src="{{item.isFavorite ? '../../static/index/star_colored.png' : '../../static/index/star.png'}}" />
               <image class="collect_btn_icon" src="{{item.isFavorite ? '../../static/index/star_colored.png' : '../../static/index/star.png'}}" />
               <text>收藏</text>
               <text>收藏</text>
           </view>
           </view>
-          <view class="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-icon="{{item.iconImg}}" data-title="{{item.title}}" data-type="{{item.type}}">
+          <view class="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}}">
               <image class="share_btn_icon" src="../../static/index/share.png" />
               <image class="share_btn_icon" src="../../static/index/share.png" />
               <text>分享</text>
               <text>分享</text>
           </view>
           </view>
         </view>
         </view>
           <view class="foot_right">
           <view class="foot_right">
           <view class="btn flower_btn" catchtap="{{item.isLike ?  null : 'likeTap'}}" data-index="{{index}}" data-id="{{item.id}}" data-islike="{{item.isLike}}">
           <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'}}" />
+              <image class="flower_btn_icon" src="{{item.isLike ? '../../static/index/heart.png' : '../../static/index/heart.png'}}" />
               <text>{{item.likes}}</text>
               <text>{{item.likes}}</text>
           </view>
           </view>
           <view class="btn comment_btn" catchtap="openComment" data-id="{{item.id}}">
           <view class="btn comment_btn" catchtap="openComment" data-id="{{item.id}}">
@@ -174,9 +174,9 @@
         </view>
         </view>
             
             
       </view>
       </view>
-      <view class="btn_wrapper" wx:if="{{item.noReading}}" catchtap="goToReading" data-id="{{item.classId}}">
+      <view class="btn_wrapper" wx:if="{{!item.noReading}}" catchtap="goToReading" data-id="{{item.classId}}">
         <view class="reading_btn">
         <view class="reading_btn">
-          <image src="../../static/index/star.png" />
+          <image src="../../static/index/microphone.png" />
           <text>我要配音</text>
           <text>我要配音</text>
         </view>
         </view>
       </view>
       </view>

+ 1 - 0
component/video-swiper/index.wxss

@@ -132,6 +132,7 @@
   width: 46rpx;
   width: 46rpx;
   height: 46rpx;
   height: 46rpx;
   margin-right: 14rpx;
   margin-right: 14rpx;
+  border-radius: none;
 }
 }
 .swiper_container .swiper_item .foot_box .btn .comment_btn_icon {
 .swiper_container .swiper_item .foot_box .btn .comment_btn_icon {
   width: 49rpx;
   width: 49rpx;

+ 159 - 61
pages/index/index.js

@@ -52,7 +52,7 @@ Page({
     myIndex: 0,
     myIndex: 0,
     followData: [],
     followData: [],
     recommendPageNo: 1,
     recommendPageNo: 1,
-    recommendPageSize: 6,
+    recommendPageSize: 12,
     recommendTotalNo: 1,
     recommendTotalNo: 1,
     myData: {},
     myData: {},
     templates: '',
     templates: '',
@@ -75,6 +75,7 @@ Page({
     followPageSize: 6,
     followPageSize: 6,
     coursePageNo: 1,
     coursePageNo: 1,
     coursesData: [],
     coursesData: [],
+    updateId: 0 // 刷新id
 
 
   },
   },
   jurisdiction: function () {
   jurisdiction: function () {
@@ -200,13 +201,35 @@ Page({
     }, 2800)
     }, 2800)
   },
   },
   onLoad: function (options) {
   onLoad: function (options) {
+    console.log('onload', options);
     getOpenidNoLogin((res) => {
     getOpenidNoLogin((res) => {
       console.log('getOpenidNoLogin', res)
       console.log('getOpenidNoLogin', res)
       if (!res.data.data.grade) {
       if (!res.data.data.grade) {
+        // 没有年级的老用户
+        if (res.data.data.wechatName) {
+          this.setData({
+            isGradeShow: true,
+            options,
+            isLogin: true,
+            oldUser: true
+          })
+          return;
+        }
         this.setData({
         this.setData({
           isGradeShow: true,
           isGradeShow: true,
-          options
+          options,
+          isLogin: false,
+          workId: options.scene ? options.scene : options.readId ? options.readId : undefined
         })
         })
+        return
+      } else {
+        if (res.data.data.wechatName) {
+          this.setData({
+            isLogin: true
+          }, () => {
+            this.showPage();
+          })
+        }
       }
       }
       // 登录或注册完成 展示页面
       // 登录或注册完成 展示页面
     }, (error) => {
     }, (error) => {
@@ -219,6 +242,11 @@ Page({
         workId: options.scene
         workId: options.scene
       })
       })
     }
     }
+    if (options.readId) {
+      this.setData({
+        workId: options.readId
+      })
+    }
     this.uid = wx.getStorageSync('uid');
     this.uid = wx.getStorageSync('uid');
     let grade = wx.getStorageSync('grade');
     let grade = wx.getStorageSync('grade');
 
 
@@ -230,7 +258,6 @@ Page({
     //   console.log('没有uid 也不是游客,需要去授权')
     //   console.log('没有uid 也不是游客,需要去授权')
     //   return;
     //   return;
     // }
     // }
-    this.showPage();
     wx.getSystemInfo({
     wx.getSystemInfo({
       success: (res) => {
       success: (res) => {
         console.log('系统', res)
         console.log('系统', res)
@@ -289,24 +316,28 @@ Page({
     console.log('页面返回页面返回', this.data.fromLoginIndex)
     console.log('页面返回页面返回', this.data.fromLoginIndex)
     if (this.data.fromLoginIndex) {
     if (this.data.fromLoginIndex) {
       console.log('页面返回页面返回', this.data.fromLoginIndex)
       console.log('页面返回页面返回', this.data.fromLoginIndex)
+
       let index = this.data.fromLoginIndex;
       let index = this.data.fromLoginIndex;
+      let userInfo = wx.getStorageSync('user');
       this.setData({
       this.setData({
-        fromLoginIndex: null
+        fromLoginIndex: null,
+        isLogin: userInfo.wechatName ? true : false
       }, () => {
       }, () => {
         this.updateData(0)
         this.updateData(0)
 
 
       })
       })
     }
     }
-    const userInfo = wx.getStorageSync('user')
-    if (userInfo.wechatName) {
-      this.setData({
-        isLogin: true
-      })
-    } else {
-      this.setData({
-        isLogin: false
-      })
-    }
+    // const userInfo = wx.getStorageSync('user')
+    // console.log('userInfo',userInfo)
+    // if (userInfo.wechatName) {
+    //   this.setData({
+    //     isLogin: true
+    //   })
+    // } else {
+    //   this.setData({
+    //     isLogin: false
+    //   })
+    // }
   },
   },
 
 
   onHide: function () {
   onHide: function () {
@@ -333,7 +364,14 @@ Page({
   },
   },
   // 组装list
   // 组装list
   formatWorksList(list, notSet) {
   formatWorksList(list, notSet) {
-    list.forEach(item => {
+    const tempList = [];
+    list.forEach((item,index) => {
+      if(index === 1){
+        console.log('设置当前id',item.id)
+        this.setData({
+          updateId: item.userRead.id
+        })
+      }
       const temp = {};
       const temp = {};
       temp.title = item.userRead.title;
       temp.title = item.userRead.title;
       temp.summary = item.userRead.summary;
       temp.summary = item.userRead.summary;
@@ -352,11 +390,12 @@ Page({
       temp.nickName = item.user.wechatName;
       temp.nickName = item.user.wechatName;
       temp.isLike = item.isLike;
       temp.isLike = item.isLike;
       temp.isFavorite = item.isFavorites;
       temp.isFavorite = item.isFavorites;
-      this.data.videoList.push(temp);
+      // this.data.videoList.push(temp);
+      tempList.push(temp);
     });
     });
     if (!notSet) {
     if (!notSet) {
       this.setData({
       this.setData({
-        videoList: this.data.videoList
+        videoList: tempList
       })
       })
     }
     }
 
 
@@ -412,10 +451,15 @@ Page({
     return userInfo;
     return userInfo;
   },
   },
   videoChange: function (e) {
   videoChange: function (e) {
+    console.log('到了底部到了底部', e)
     console.log('到了底部到了底部', e.detail.index)
     console.log('到了底部到了底部', e.detail.index)
     console.log('到了底部到了底部', e.detail._last)
     console.log('到了底部到了底部', e.detail._last)
-    console.log('到了底部到了底部', e.detail.nextQueue)
-    if (e.detail.nextQueue.length === 1) {
+    console.log('到了底部到了底部', e.detail.direction)
+    // if (e.detail.nextQueue.length === 1) {
+    console.log('当前ID',e.detail.activeId);
+    console.log('目标ID',this.data.updateId);
+    if (e.detail.activeId === this.data.updateId) {
+      console.log('应该刷新')
       if (this.data.myIndex === 1) {
       if (this.data.myIndex === 1) {
         this.setData({
         this.setData({
           followPageNo: this.data.followPageNo + 1
           followPageNo: this.data.followPageNo + 1
@@ -423,12 +467,20 @@ Page({
           this.getFollowData()
           this.getFollowData()
         })
         })
       }
       }
+      if (this.data.myIndex === 0) {
+        console.log('首页加载第二页')
+        this.setData({
+          recommendPageNo: this.data.recommendPageNo + 1
+        }, () => {
+          this.getHotRecommend()
+        })
+      }
     }
     }
 
 
+
   },
   },
   // 触底加载
   // 触底加载
   onReachBottom: function () {
   onReachBottom: function () {
-    console.log('到了底部到了底部', this.data.myIndex)
     if (this.data.myIndex === 2) {
     if (this.data.myIndex === 2) {
       this.setData({
       this.setData({
         coursePageNo: this.data.coursePageNo + 1
         coursePageNo: this.data.coursePageNo + 1
@@ -436,13 +488,7 @@ Page({
         this.getCoursesList()
         this.getCoursesList()
       })
       })
     }
     }
-    if (this.data.myIndex === 0) {
-      this.setData({
-        recommendPageNo: this.data.recommendPageNo + 1
-      }, () => {
-        this.getHotRecommend()
-      })
-    }
+
     // // 当前在推荐页面 加载推荐
     // // 当前在推荐页面 加载推荐
     // if (this.data.myIndex === 1) {
     // if (this.data.myIndex === 1) {
     //   console.log(this.data.recommendPageNo)
     //   console.log(this.data.recommendPageNo)
@@ -544,25 +590,31 @@ Page({
       console.log('mydata', this.data.myData)
       console.log('mydata', this.data.myData)
       const myList = res.data.data;
       const myList = res.data.data;
       if (myList.length === 0) return;
       if (myList.length === 0) return;
+      // this.formatWorksList(myList)
       // const recommendWorks = [];
       // const recommendWorks = [];
       const myWorks = [];
       const myWorks = [];
       myList.forEach(item => {
       myList.forEach(item => {
         const temp = {};
         const temp = {};
-        temp.title = item.title;
-        temp.summary = item.summary;
-        temp.img = item.iconImg;
-        temp.plays = item.playAmount;
-        temp.likes = item.likeAmount;
-        temp.commentAmount = item.commentAmount;
-        temp.classId = item.exampleId ? item.exampleId : 1605097720036046;
-        temp.time = formatDate(item.gmtCreated, 3);
-        temp.avatar = this.data.myData.userInfo.avatar;
-        temp.uid = this.uid;
-        temp.url = item.videoPath;
-        temp.id = item.id;
+        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.nickName = item.user.wechatName;
+        temp.isLike = item.isLike;
+        temp.isFavorite = item.isFavorites;
         temp.showMyBtn = true;
         temp.showMyBtn = true;
         temp.nickName = this.data.myData.userInfo.wechatName;
         temp.nickName = this.data.myData.userInfo.wechatName;
-        temp.status = item.status
+        temp.status = item.userRead.status
         myWorks.push(temp);
         myWorks.push(temp);
       });
       });
       console.log('myWorks', myWorks)
       console.log('myWorks', myWorks)
@@ -650,16 +702,62 @@ Page({
       isGradeShow: true
       isGradeShow: true
     })
     })
   },
   },
+  onShareAppMessage: function (res) {
+    console.log('点击分享按钮', res)
+    console.log('点击分享按钮', this.data.shareTitle)
+    console.log('点击分享按钮', this.data.shareId)
+    console.log('点击分享按钮', this.data.shareImg)
+    if (res.from === 'button') {
+      return {
+        title: this.data.shareTitle,
+        path: `/pages/index/index?readId=${this.data.shareId}`,
+        imageUrl: this.data.shareImg
+
+      }
+    } else {
+      return {
+        title: '快来听我的朗读作品吧',
+        path: '/pages/index/index'
+      }
+    }
+
+  },
+  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
+    })
+  },
   // 修改年级
   // 修改年级
   changeGrade: function (e) {
   changeGrade: function (e) {
     const grade = e.target.dataset.code;
     const grade = e.target.dataset.code;
+
     wx.setStorageSync('grade', grade)
     wx.setStorageSync('grade', grade)
     this.setData({
     this.setData({
       isGradeShow: false,
       isGradeShow: false,
     })
     })
+    if (this.data.oldUser) {
+      let data = {
+        grade: e.target.dataset.code
+      };
+      httpRequestApi.settingUserInfo(data).success(res => {
+
+      })
+    };
     getOpenidNoLogin((res) => {
     getOpenidNoLogin((res) => {
       console.log('getOpenidNoLogin', res)
       console.log('getOpenidNoLogin', res)
       // 登录或注册完成 展示页面
       // 登录或注册完成 展示页面
+      if (res.data.data.wechatName) {
+        this.setData({
+          isLogin: true
+        })
+      } else {
+        this.setData({
+          isLogin: false
+        })
+      }
       this.showPage()
       this.showPage()
     }, (error) => {
     }, (error) => {
       console.log('获取失败')
       console.log('获取失败')
@@ -734,27 +832,27 @@ Page({
       })
       })
     });
     });
   },
   },
-  coursesOpenShare: function coursesOpenShare(e){
+  coursesOpenShare: function coursesOpenShare(e) {
     const obj = e.currentTarget.dataset
     const obj = e.currentTarget.dataset
-            console.log('分享', obj)
-            console.log('分享', e)
-            if (1) {
-                this.shareDialog = this.selectComponent("#share-dialog");
-                const data = {
-                    avatar: obj.avatar,
-                    author: obj.author,
-                    iconImg: obj.iconImg,
-                    title: obj.title,
-                    path: `pages/index/index`,
-                    scene: obj.id,
-                    productId: 1
-                    // tip: this.data.tip,
-                }
-                // console.log(data)
-                this.setData({
-                    noScroll: 'noScroll'
-                })
-                this.shareDialog.share(data);
-            }
+    console.log('分享', obj)
+    console.log('分享', e)
+    if (1) {
+      this.shareDialog = this.selectComponent("#share-dialog");
+      const data = {
+        avatar: obj.avatar,
+        author: obj.author,
+        iconImg: obj.iconImg,
+        title: obj.title,
+        path: `pages/index/index`,
+        scene: obj.id,
+        productId: 1
+        // tip: this.data.tip,
+      }
+      // console.log(data)
+      this.setData({
+        noScroll: 'noScroll'
+      })
+      this.shareDialog.share(data);
+    }
   }
   }
 })
 })

+ 1 - 1
pages/index/index.wxml

@@ -30,7 +30,7 @@
   </view>
   </view>
   <!-- 调用组件 -->
   <!-- 调用组件 -->
   <template is="{{templates}}" wx:if="{{myIndex === 3 || myIndex === 2}}" data="{{myData: myData,coursesData:coursesData}}"></template>
   <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" 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" binddelHideMyWork="delHideMyWork" bindchange="videoChange">
     <!-- bindplay="onPlay"
     <!-- bindplay="onPlay"
   bindpause="onPause"
   bindpause="onPause"
   bindtimeupdate="onTimeUpdate"
   bindtimeupdate="onTimeUpdate"

+ 1 - 0
pages/index/index.wxss

@@ -12,6 +12,7 @@
 .container {
 .container {
   background: rgba(242, 242, 242, 1);
   background: rgba(242, 242, 242, 1);
   height: 100%;
   height: 100%;
+  /* overflow: hidden; */
 }
 }
 
 
 .template {
 .template {

+ 7 - 1
pages/mycollection/mycollection.js

@@ -69,7 +69,13 @@ Page({
     })
     })
 
 
   },
   },
-
+  goToReading: function (e) {
+    console.log('去朗读', e)
+    const id = e.detail.activeId ? e.detail.activeId : e.currentTarget.dataset.id;
+    wx.navigateTo({
+      url: `../../pages/reading/reading?id=${id}`
+    });
+  },
   // 评论区点击
   // 评论区点击
   commentTap: function (e) {
   commentTap: function (e) {
     console.log('点击评论区', e)
     console.log('点击评论区', e)

+ 2 - 1
pages/mycollection/mycollection.wxml

@@ -15,4 +15,5 @@
   <view class="comment_section" catchtap="commentTap" data-type="blank" wx:if="{{commentShow}}">
   <view class="comment_section" catchtap="commentTap" data-type="blank" wx:if="{{commentShow}}">
     <Comment data-type="list" commentId="{{commentId}}" commentNum="{{commentNum}}" inputValue="{{inputValue}}" bindsendReply="sendReply" />
     <Comment data-type="list" commentId="{{commentId}}" commentNum="{{commentNum}}" inputValue="{{inputValue}}" bindsendReply="sendReply" />
   </view>
   </view>
-</view>
+</view>
+ <canvas canvas-id="myCanvas" style="width:300px; height: 525px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>

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

@@ -1,4 +1,4 @@
-import httpRequestApi from '../../../utils/APIClient';
+import httpRequestApi from '../../utils/APIClient';
 Page({
 Page({
   /**
   /**
    * 页面的初始数据
    * 页面的初始数据

pages/user/myconcern/myconcern.json → pages/myconcern/myconcern.json


+ 2 - 2
pages/user/myconcern/myconcern.wxml

@@ -12,13 +12,13 @@
       </view>
       </view>
       <view class="avatar-follow" wx:if='{{ item.isEachOther }}'>
       <view class="avatar-follow" wx:if='{{ item.isEachOther }}'>
         <view class='avatar-img'>
         <view class='avatar-img'>
-          <image class='avatar-images' src="../../../static/image/concernback.png" />
+          <image class='avatar-images' src="../../static/image/concernback.png" />
         </view>
         </view>
         <view class="follow-status">相互关注</view>
         <view class="follow-status">相互关注</view>
       </view>
       </view>
       <view class="avatar-follow" wx:elif='{{ item.followBack === item.followBack || item.isEachOther }}'>
       <view class="avatar-follow" wx:elif='{{ item.followBack === item.followBack || item.isEachOther }}'>
         <view class='avatar-img'>
         <view class='avatar-img'>
-          <image class='avatar-images' src="../../../static/image/concerned.png" />
+          <image class='avatar-images' src="../../static/image/concerned.png" />
         </view>
         </view>
         <view class="follow-status">已关注</view>
         <view class="follow-status">已关注</view>
       </view>
       </view>

pages/user/myconcern/myconcern.wxss → pages/myconcern/myconcern.wxss


+ 3 - 2
pages/myworks/myworks.wxml

@@ -8,7 +8,7 @@
         <text class="avatar-nickname">{{ wareCards.user.wechatName }}</text>
         <text class="avatar-nickname">{{ wareCards.user.wechatName }}</text>
       </view>
       </view>
       <view class="follow" wx:if="{{!isMyself}}" bindtap="follow">
       <view class="follow" wx:if="{{!isMyself}}" bindtap="follow">
-        <image src="{{isFans? '../../static/image/fully_heart.png' : '../../static/image/empty_heart.png'}}" />
+        <image src="{{isFans? '../../static/index/followed.png' : '../../static/index/follow.png'}}" />
         <text class="followBtn">{{isFans ? '已' : ''}}关注</text>
         <text class="followBtn">{{isFans ? '已' : ''}}关注</text>
       </view>
       </view>
     </view>
     </view>
@@ -37,4 +37,5 @@
 </scroll-view>
 </scroll-view>
 <view class="comment_section" catchtouchmove="touchMove"  catchtap="commentTap" data-type="blank" wx:if="{{commentShow}}">
 <view class="comment_section" catchtouchmove="touchMove"  catchtap="commentTap" data-type="blank" wx:if="{{commentShow}}">
     <Comment data-type="list" commentId="{{commentId}}" />
     <Comment data-type="list" commentId="{{commentId}}" />
-</view>
+</view>
+ <canvas canvas-id="myCanvas" style="width:300px; height: 525px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>

+ 9 - 12
pages/myworks/myworks.wxss

@@ -48,26 +48,23 @@ page {
 
 
 .follow {
 .follow {
   display: flex;
   display: flex;
+  flex-direction: column;
   align-items: center;
   align-items: center;
   justify-content: center;
   justify-content: center;
-  width: 154rpx;
-  height: 58rpx;
-  border: 2rpx solid #ff0000;
-  font-size: 28rpx;
-  border-radius: 30rpx;
-  /* text-align: center; */
-  /* line-height: 60rpx; */
-  color: #ff0000;
+  /* width: 154rpx; */
+  /* height: 58rpx; */
+  font-size: 26rpx;
+  color: #8a8a8a;
   position: absolute;
   position: absolute;
   top: 36rpx;
   top: 36rpx;
   right: 32rpx;
   right: 32rpx;
 }
 }
 
 
 .follow image {
 .follow image {
-  width: 36rpx;
-  height: 32rpx;
-  margin-right: 15rpx;
-
+  width: 48rpx;
+  height: 45rpx;
+  /* margin-right: 15rpx; */
+  margin-bottom: 8rpx;
 }
 }
 
 
 .avatar-bg {
 .avatar-bg {

+ 134 - 55
pages/reading/reading.js

@@ -18,8 +18,8 @@ Page({
         videoCtr: 'recordingVideoEnd',
         videoCtr: 'recordingVideoEnd',
         btnFlag: false,
         btnFlag: false,
         btnImgFlag: false,
         btnImgFlag: false,
-        microphonePng: '../../static/image/microphone.png',
-        recordingGif: '../../static/image/readingNow.gif',
+        microphonePng: '../../static/index/microphone.png',
+        recordingGif: '../../static/index/readingNow.gif',
         videoUrl: '',
         videoUrl: '',
         readingText: '',
         readingText: '',
         videoList: [],
         videoList: [],
@@ -41,7 +41,8 @@ Page({
         console.log(option);
         console.log(option);
         this.videoCtx = null;
         this.videoCtx = null;
         const uid = wx.getStorageSync('uid')
         const uid = wx.getStorageSync('uid')
-        this.getClassInfo(option.id)
+        this.getClassInfo(option.id);
+        // this.getMicAuth()
     },
     },
     getClassInfo: function (id) {
     getClassInfo: function (id) {
         httpRequestApi.getClassDetail(id).success(res => {
         httpRequestApi.getClassDetail(id).success(res => {
@@ -66,6 +67,10 @@ Page({
     },
     },
     onHide: function () {
     onHide: function () {
         console.log('onhide')
         console.log('onhide')
+        if (this.data.audioPlaying) {
+            console.log('返回时状态', this.data.audioPlaying)
+            this.ss.stopPlay();
+        }
         if (this.data.btnImgFlag) {
         if (this.data.btnImgFlag) {
             this.ss.stopRecord();
             this.ss.stopRecord();
         }
         }
@@ -77,6 +82,10 @@ Page({
     },
     },
     onUnload: function () {
     onUnload: function () {
         console.log('onUnload')
         console.log('onUnload')
+        if (this.data.audioPlaying) {
+            console.log('销毁时状态', this.data.audioPlaying)
+            this.ss.stopPlay();
+        }
         if (this.data.btnImgFlag) {
         if (this.data.btnImgFlag) {
             this.ss.stopRecord();
             this.ss.stopRecord();
         }
         }
@@ -158,20 +167,6 @@ Page({
      *      2 录音结束
      *      2 录音结束
      ***/
      ***/
     audioRecord: function () {
     audioRecord: function () {
-        /* wx.getSetting({
-            success(res) {
-                if (res.authSetting['scope.record']) {
-                    that.videoComplete();
-                }else {
-                    wx.showToast({
-                        title: 'onError',
-                        icon: 'fail',
-                        duration: 500
-                    })
-                }
-            }
-        }) */
-
         console.log('recordFlag', this.data.recordFlag)
         console.log('recordFlag', this.data.recordFlag)
         if (this.data.recordFlag === 0) {
         if (this.data.recordFlag === 0) {
             // this.recordStart();
             // this.recordStart();
@@ -179,7 +174,7 @@ Page({
             console.log('是否有视频', this.videoCtx)
             console.log('是否有视频', this.videoCtx)
             if (this.videoCtx) {
             if (this.videoCtx) {
                 this.videoCtx.stop();
                 this.videoCtx.stop();
-                this.videoCtx.seek(0);
+                // this.videoCtx.seek(0);
             }
             }
             // if (this.recorderManager) {
             // if (this.recorderManager) {
             //     this.recorderManager.stop();
             //     this.recorderManager.stop();
@@ -187,16 +182,8 @@ Page({
             // if (this.innerAudioContext) {
             // if (this.innerAudioContext) {
             //     this.innerAudioContext.stop();
             //     this.innerAudioContext.stop();
             // }
             // }
-            const that = this;
-            that.videoComplete();
-
-            // wx.getSetting({
-            //     success(res) {
-            //         if (res.authSetting['scope.record']) {
-            //             that.videoComplete();
-            //         }
-            //     }
-            // })
+            this.getMicAuth()
+            // this.videoComplete();
             return;
             return;
         }
         }
         // 录音结束后
         // 录音结束后
@@ -234,6 +221,51 @@ Page({
             warrantId: 'c11163aa6c834a028da4a4b30955be96', //鉴权id
             warrantId: 'c11163aa6c834a028da4a4b30955be96', //鉴权id
         })
         })
     },
     },
+    getMicAuth() {
+        let _this = this;
+        wx.getSetting({
+            success(res) {
+                if (res.authSetting['scope.record']) {
+                    // that.videoComplete();
+                    _this.videoComplete();
+
+                } else {
+                    _this.getMicSetAuth();
+                    return;
+                }
+            }
+        })
+    },
+    getMicSetAuth() {
+        let _this = this;
+        wx.authorize({
+            scope: 'scope.record',
+            success() {
+                // 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问
+                _this.audioRecord();
+            },
+            fail() {
+                wx.showModal({
+                    title: '录音前请打开麦克风权限',
+                    content: '',
+                    confirmText: '我知道了',
+                    showCancel: false,
+                    success(res) {
+                        // console.log('用户点击确定')
+                        wx.openSetting({
+                            success(res) {
+                                console.log('跳转到设置页', res.authSetting)
+                                // res.authSetting = {
+                                //   "scope.userInfo": true,
+                                //   "scope.userLocation": true
+                                // }
+                            }
+                        })
+                    }
+                })
+            }
+        })
+    },
     // 录音结束
     // 录音结束
     recordStop: function () {
     recordStop: function () {
         this.setData({
         this.setData({
@@ -289,29 +321,37 @@ Page({
         this.setData({
         this.setData({
             videoUrl: this.data.videoUrl
             videoUrl: this.data.videoUrl
         })
         })
+        if (this.data.audioPath) {
+            this.ss.startPlay(this.data.audioPath);
+            this.videoCtx.stop();
+            this.videoCtx.play();
 
 
-        this.videoCtx.seek(0)
-        const recordSource = this.data.recordSource
-        wx.uploadFile({
-            url: 'https://reader-test.efunbox.cn/readerBase/file/upload',
-            filePath: recordSource,
-            name: '朗读录音',
-            header: {
-                uid: wx.getStorageSync('uid')
-            },
-            success: (res) => {
-                const formateRes = JSON.parse(res.data);
-
-                let audioPath = formateRes.data;
-                this.setData({
-                    audioPath,
-                    audioPlaying: true
-                })
-                this.ss.startPlay(audioPath);
-                this.videoCtx.play();
-            }
+        } else {
+            const recordSource = this.data.recordSource
+            wx.uploadFile({
+                url: 'https://reader-test.efunbox.cn/readerBase/file/upload',
+                filePath: recordSource,
+                name: '朗读录音',
+                header: {
+                    uid: wx.getStorageSync('uid')
+                },
+                success: (res) => {
+                    const formateRes = JSON.parse(res.data);
 
 
-        })
+                    let audioPath = formateRes.data;
+                    this.setData({
+                        audioPath,
+                        audioPlaying: true
+                    })
+                    this.ss.startPlay(audioPath);
+                    // this.videoCtx.seek(0);
+                    this.videoCtx.stop();
+                    console.log('播放器归0')
+                    this.videoCtx.play();
+                    console.log('播放器播放')
+                }
+            })
+        }
     },
     },
 
 
     videoComplete: function () {
     videoComplete: function () {
@@ -322,12 +362,14 @@ Page({
             centerBtn: false,
             centerBtn: false,
             playBtn: false,
             playBtn: false,
             isVideoListShow: false,
             isVideoListShow: false,
-            muted: true
+            muted: true,
+            ifTextShow: true,
+            ifScoreShow: false
+
         }, () => {
         }, () => {
             this.videoCtx.play();
             this.videoCtx.play();
             this.recordStart();
             this.recordStart();
         })
         })
-
     },
     },
     // 上传
     // 上传
     upload: function () {
     upload: function () {
@@ -448,7 +490,7 @@ Page({
                 // temp.avatar = item.user.avatar;
                 // temp.avatar = item.user.avatar;
                 temp.nickName = item.user ? item.user.wechatName : '';
                 temp.nickName = item.user ? item.user.wechatName : '';
                 temp.id = item.userRead.id;
                 temp.id = item.userRead.id;
-                item.noReading = true;
+                temp.noReading = true;
                 // recommendWorks.push(temp);
                 // recommendWorks.push(temp);
                 // that.data.hotData.hotWorks.push(temp);
                 // that.data.hotData.hotWorks.push(temp);
                 this.data.videoList.push(temp);
                 this.data.videoList.push(temp);
@@ -487,12 +529,49 @@ Page({
             commentId: e.detail.activeId,
             commentId: e.detail.activeId,
         });
         });
     },
     },
-    goToReading: function(e){
+    goToReading: function (e) {
         this.setData({
         this.setData({
             pageNo: 1,
             pageNo: 1,
-            videoList:[]
+            videoList: []
         })
         })
         const id = e.detail.activeId ? e.detail.activeId : e.currentTarget.dataset.id;
         const id = e.detail.activeId ? e.detail.activeId : e.currentTarget.dataset.id;
-        this.getClassInfo(id)   
+        this.getClassInfo(id)
+    },
+    onShareAppMessage: function (res) {
+        console.log('点击分享按钮', res)
+        console.log('点击分享按钮', this.data.shareTitle)
+        console.log('点击分享按钮', this.data.shareId)
+        console.log('点击分享按钮', this.data.shareImg)
+        if (res.from === 'button') {
+            return {
+                title: this.data.shareTitle,
+                path: `/pages/index/index${this.data.shareId}`,
+                imageUrl: this.data.shareImg
+
+            }
+        } else {
+            return {
+                title: '快来听我的朗读作品吧',
+                path: '/pages/index/index'
+            }
+        }
+
+    },
+    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
+        })
+    },
+    onPlay: function (e) {
+        // 下边视频列表onplay
+        if (this.videoCtx) {
+            this.videoCtx.stop();
+        } else {
+            this.videoCtx = wx.createVideoContext('myVideo', this);
+            this.videoCtx.stop();
+        }
     }
     }
 })
 })

+ 3 - 4
pages/reading/reading.wxml

@@ -7,9 +7,8 @@
   bindplay="videoPlay" -->
   bindplay="videoPlay" -->
     <!-- <audio name="123" author="123" src="{{recordSource}}" id="myAudio" controls loop></audio> -->
     <!-- <audio name="123" author="123" src="{{recordSource}}" id="myAudio" controls loop></audio> -->
     <view class="footSection">
     <view class="footSection">
-        <image class="blackbord" src="../../static/image/blackbord.png" />
         <view class="collectBtn footerBtn" wx:if="{{btnFlag}}" bindtap="audioPlay">
         <view class="collectBtn footerBtn" wx:if="{{btnFlag}}" bindtap="audioPlay">
-            <image src="../../static/image/listen.png" />
+            <image src="../../static/index/listen.png" />
             <text>试听</text>
             <text>试听</text>
         </view>
         </view>
         <!-- <view class="readingBtn footerBtn" bindtap="audioRecord">
         <!-- <view class="readingBtn footerBtn" bindtap="audioRecord">
@@ -23,7 +22,7 @@
             </view>
             </view>
         </view>
         </view>
         <view class="shareBtn footerBtn" wx:if="{{btnFlag}}" bindtap="upload">
         <view class="shareBtn footerBtn" wx:if="{{btnFlag}}" bindtap="upload">
-            <image src="../../static/image/upload.png" />
+            <image src="../../static/index/upload.png" />
             <text>上传</text>
             <text>上传</text>
         </view>
         </view>
     </view>
     </view>
@@ -58,7 +57,7 @@
             <text >语音语调:{{tone}}/100</text>
             <text >语音语调:{{tone}}/100</text>
         </view>
         </view>
     </view>
     </view>
-    <VideoSwiper wx:if="{{videoList && videoList.length > 0 && isVideoListShow}}" class="video-swiper" video-list="{{videoList}}" nextMargin="{{nextMargin}}" isSwiper="{{false}}" bindopenComment="openComment" bindheadTap="headTapHandler" bindgoToReading="goToReading" bindplay="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" bindgoToReading="goToReading" bindplay="onPlay"></VideoSwiper>
 </scroll-view>
 </scroll-view>
 <view class="comment_section" catchtap="commentTap" data-type="blank" wx:if="{{commentShow}}">
 <view class="comment_section" catchtap="commentTap" data-type="blank" wx:if="{{commentShow}}">
     <Comment data-type="list" commentId="{{commentId}}" />
     <Comment data-type="list" commentId="{{commentId}}" />

+ 9 - 18
pages/reading/reading.wxss

@@ -70,7 +70,7 @@ audio {
 /**底部按钮区域**/
 /**底部按钮区域**/
 .footSection {
 .footSection {
     width: 750rpx;
     width: 750rpx;
-    height: 192rpx;
+    height: 152rpx;
     /* position: fixed; */
     /* position: fixed; */
     /* bottom: 0; */
     /* bottom: 0; */
     display: flex;
     display: flex;
@@ -79,15 +79,6 @@ audio {
     align-items: center;
     align-items: center;
 }
 }
 
 
-.blackbord {
-    width: 100%;
-    height: 192rpx;
-    display: block;
-    position: absolute;
-    top: 0;
-    left: 0;
-    z-index: -1;
-}
 
 
 .readingBtn {
 .readingBtn {
     width: 148rpx;
     width: 148rpx;
@@ -102,29 +93,29 @@ audio {
 .footerBtn {
 .footerBtn {
     display: flex;
     display: flex;
     flex-direction: column;
     flex-direction: column;
-    margin-top: 60rpx;
+    margin-top: 30rpx;
 }
 }
 
 
 .collectBtn {
 .collectBtn {
-    margin-left: 80rpx
+    margin-left: 40rpx
 }
 }
 
 
 .shareBtn {
 .shareBtn {
-    margin-right: 80rpx
+    margin-right: 40rpx
 }
 }
 
 
 .footerBtn image {
 .footerBtn image {
-    width: 50rpx;
-    height: 48rpx;
+    width: 80rpx;
+    height: 80rpx;
     display: block;
     display: block;
-    margin: 0 auto 18rpx;
+    margin: 0 auto 3rpx;
 }
 }
 
 
 .footerBtn text {
 .footerBtn text {
     width: 112rpx;
     width: 112rpx;
     height: 40rpx;
     height: 40rpx;
-    font-size: 28rpx;
-    color: #414141;
+    font-size: 30rpx;
+    color: rgba(0, 0, 0, .6);
     text-align: center;
     text-align: center;
 }
 }
 
 

+ 6 - 7
project.config.json

@@ -41,17 +41,10 @@
   "simulatorType": "wechat",
   "simulatorType": "wechat",
   "simulatorPluginLibVersion": {},
   "simulatorPluginLibVersion": {},
   "condition": {
   "condition": {
-    "search": {
-      "list": []
-    },
-    "conversation": {
-      "list": []
-    },
     "plugin": {
     "plugin": {
       "list": []
       "list": []
     },
     },
     "game": {
     "game": {
-      "currentL": -1,
       "list": []
       "list": []
     },
     },
     "gamePlugin": {
     "gamePlugin": {
@@ -108,6 +101,12 @@
           "pathName": "pages/social/works/works",
           "pathName": "pages/social/works/works",
           "query": "id=1553402613620097&title=【课文7】怎么都快乐",
           "query": "id=1553402613620097&title=【课文7】怎么都快乐",
           "scene": null
           "scene": null
+        },
+        {
+          "name": "pages/index/index",
+          "pathName": "pages/index/index",
+          "query": "readId=1606387447807610",
+          "scene": 1007
         }
         }
       ]
       ]
     }
     }

BIN
static/index/add_follow.png


BIN
static/index/contact.png


BIN
static/index/delete.png


BIN
static/index/follow.png


BIN
static/index/followed.png


BIN
static/index/heart.png


BIN
static/index/heart_colored.png


BIN
static/index/hide_icon.png


BIN
static/index/listen.png


BIN
static/index/microphone.png


BIN
static/index/readingNow.gif


BIN
static/index/show_icon.png


BIN
static/index/upload.png


+ 6 - 6
templates/courses/courses.wxml

@@ -5,13 +5,13 @@
             <image class="course_icon" src="{{item.userRead.iconImg}}" lazy-load="true" />
             <image class="course_icon" src="{{item.userRead.iconImg}}" lazy-load="true" />
             <view class="course_info">
             <view class="course_info">
                 <text class="course_title">{{item.userRead.title}}</text>
                 <text class="course_title">{{item.userRead.title}}</text>
-                <view class="course_btn">
-                    <view class="collect course_btn" data-index="{{index}}" data-id="{{item.userRead.id}}" data-type="{{item.userRead.type}}"  catchtap="courseCollectTap">
-                        <image class="collect_icon btn_icon" src="../../static/image/collect.png" />
-                        <text class="collect_text btn_text">收藏{{item.isFavorites}}</text>
+                <view class="course_btn_wrapper">
+                    <view class="collect course_btn" data-index="{{index}}" data-id="{{item.userRead.id}}" data-type="{{item.userRead.type}}" catchtap="courseCollectTap">
+                        <image class="collect_icon btn_icon" src="{{item.isFavorites ?'../../static/index/star_colored.png' :'../../static/index/star.png' }}" />
+                        <text class="collect_text btn_text">{{item.isFavorites? '已收藏' : '收藏'}}</text>
                     </view>
                     </view>
-                    <view class="share course_btn"  catchtap="coursesOpenShare" data-author="{{item.user.nickName}}" data-index="{{index}}" data-id="{{item.userRead.id}}" data-avatar="{{item.user.avatar}}" data-uid="{{item.user.uid}}" data-icon="{{item.userRead.iconImg}}" data-title="{{item.userRead.title}}" data-type="{{item.userRead.type}}">
-                        <image class="share_icon btn_icon" src="../../static/image/share.png" />
+                    <view class="share course_btn" catchtap="coursesOpenShare" data-author="{{item.user.nickName}}" data-index="{{index}}" data-id="{{item.userRead.id}}" data-avatar="{{item.user.avatar}}" data-uid="{{item.user.uid}}" data-icon="{{item.userRead.iconImg}}" data-title="{{item.userRead.title}}" data-type="{{item.userRead.type}}">
+                        <image class="share_icon btn_icon" src="../../static/index/share.png" />
                         <text class="share_text btn_text">分享</text>
                         <text class="share_text btn_text">分享</text>
                     </view>
                     </view>
                 </view>
                 </view>

+ 13 - 5
templates/courses/courses.wxss

@@ -1,7 +1,7 @@
 .courses_container {
 .courses_container {
   width: 100%;
   width: 100%;
   height: 100%;
   height: 100%;
-  background: #444;
+  background: #eee;
 }
 }
 .courses_container .course_item {
 .courses_container .course_item {
   width: 100%;
   width: 100%;
@@ -30,15 +30,23 @@
   color: #373737;
   color: #373737;
   font-size: 30rpx;
   font-size: 30rpx;
 }
 }
-.courses_container .course_item .course_info .course_btn {
-  width: 270rpx;
+.course_btn_wrapper{
+  width: 290rpx;
   display: flex;
   display: flex;
   align-items: center;
   align-items: center;
   justify-content: space-between;
   justify-content: space-between;
 }
 }
+.courses_container .course_item .course_info .course_btn {
+  /* width: 290rpx; */
+  display: flex;
+  align-items: center;
+
+  /* justify-content: space-between; */
+}
 .courses_container .course_item .course_info .course_btn .btn_icon {
 .courses_container .course_item .course_info .course_btn .btn_icon {
-  width: 56rpx;
-  height: 56rpx;
+  width: 50rpx;
+  height: 50rpx;
+  margin-right: 11rpx;
 }
 }
 .courses_container .course_item .course_info .course_btn .btn_text {
 .courses_container .course_item .course_info .course_btn .btn_text {
   font-size: 28rpx;
   font-size: 28rpx;