Rorschach 4 years ago
parent
commit
f27d619463

+ 1 - 1
component/my/my.js

@@ -24,7 +24,7 @@ export const myInit = (that) => {
     followData: []
   });
   that.getUserWorksInfo();
-  that.getUserAuth(); //用户鉴权
+  // that.getUserAuth(); //用户鉴权
   // that.getMyRead();
   console.log(that.data.myData)
   that.toMyEdit = (e) => {

+ 2 - 2
component/share/share.wxml

@@ -4,10 +4,10 @@
        <view class="corss-line"></view>
        <view class="invite-text">分享作品</view>
        <view class="share-btn">
-            <button class="share-friend" open-type="share" catchtap="shareFriend">
+            <!-- <button class="share-friend" open-type="share" catchtap="shareFriend">
                <image  src="../../static/groupImg/weixin.png"></image>
                <text>群/好友</text>
-            </button>
+            </button> -->
             <view class="share-circle" catchtap="PreservationImg">
                <image  src="../../static/groupImg/circle.png"></image>
                <text>保存海报</text>

+ 11 - 8
component/share/share.wxss

@@ -53,25 +53,28 @@
 }
 .share-btn {
     display: flex;
-    justify-content: space-around;
+    justify-content: center;
     margin-top: 65rpx;
 }
 
 .share-btn image {
-    width: 76rpx;
-    height: 76rpx;
+    width: 55rpx;
+    height: 55rpx;
 }
 
 .share-btn view {
     display: flex;
-    flex-direction: column;
-    /* justify-content: space-between; */
+    flex-direction: row;
+    justify-content: space-around;
     align-items: center;
-    font-size: 24rpx;
-    height: 120rpx;
-    width: 180rpx;
+    font-size: 30rpx;
+    height: 85rpx;
+    width: 333rpx;
     line-height: 0;
     line-height: 33rpx;
+    color: #fff;
+    background: #44af34;
+    border-radius: 52rpx;
 }
 
 .img {

+ 4 - 0
component/video-swiper/index.js

@@ -20,6 +20,10 @@ Component({
             type: Boolean,
             value: true
         },
+        noMoreWork: {
+            type: Boolean,
+            value: true
+        },
         duration: {
             type: Number,
             value: 500

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

@@ -180,10 +180,14 @@
               <image class="collect_btn_icon" src="{{item.isFavorite ? '../../static/index/star_colored.png' : '../../static/index/star.png'}}" />
               <text>收藏</text>
           </view>
-          <view class="video_btn share_btn" bindtap="openShare" data-author="{{item.nickName}}"  data-index="{{index}}" data-id="{{item.id}}" data-avatar="{{item.avatar}}" data-uid="{{item.uid}}" data-img="{{item.img}}" data-title="{{item.title}}" data-shareimg="{{item.shareImg}}" data-grade="{{item.grade}}" data-type="{{item.type}}">
-              <image class="share_btn_icon" src="../../static/index/share.png" />
-              <text>分享</text>
-          </view>
+          <!--  <view class="video_btn share_btn" bindtap="openShare" data-author="{{item.nickName}}" data-index="{{index}}" data-id="{{item.id}}" data-avatar="{{item.avatar}}" data-uid="{{item.uid}}" data-img="{{item.img}}" data-title="{{item.title}}" data-shareimg="{{item.shareImg}}" data-grade="{{item.grade}}" data-type="{{item.type}}">
+   <image class="share_btn_icon" src="../../static/index/share.png" />
+   <text>分享</text>
+ </view> -->
+           <button class="video_btn share_btn" open-type="share" bindtap="openShare" data-author="{{item.nickName}}"  data-index="{{index}}" data-id="{{item.id}}" data-avatar="{{item.avatar}}" data-uid="{{item.uid}}" data-img="{{item.img}}" data-title="{{item.title}}" data-shareimg="{{item.shareImg}}" data-grade="{{item.grade}}" data-type="{{item.type}}">
+               <image class="share_btn_icon" src="../../static/index/share.png"></image>
+               <text>分享</text>
+            </button>
         </view>
           <view class="foot_right">
           <view class="video_btn flower_btn" catchtap="{{item.isLike ?  null : 'likeTap'}}" data-index="{{index}}" data-id="{{item.id}}" data-islike="{{item.isLike}}">
@@ -204,6 +208,9 @@
         </view>
       </view>
     </view>
+    <view class="no_work" wx:if="{{!isSwiper && noMoreWork}}" >
+      <text class="no_work_text">已经到底啦!</text>
+    </view>
 </view>
 
 <shareDialog id="share-dialog" shareType='works' bindShareDialogClose="shareDialogClose" shareId="{{id}}" />

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

@@ -3,12 +3,14 @@
   height: 100%;
   background: #eee;
 }
+
 .swiper_container .video-swiper {
   width: 100%;
   height: 100%;
   display: block;
   background: #ffffff;
 }
+
 .swiper_container .swiper_item {
   width: 100%;
   background: #ffffff;
@@ -16,10 +18,12 @@
   padding-bottom: 20rpx;
   overflow: hidden;
 }
+
 .swiper_container .swiper_item.no_swiper {
   max-height: 879rpx;
   min-height: 640rpx;
 }
+
 .swiper_container .swiper_item .head_box {
   width: 100%;
   height: 120rpx;
@@ -30,6 +34,7 @@
   padding-right: 20rpx;
   position: relative;
 }
+
 .swiper_container .swiper_item .head_box .tag_icon {
   width: 66rpx;
   height: 34rpx;
@@ -37,6 +42,7 @@
   right: 0;
   top: 0;
 }
+
 .swiper_container .swiper_item .head_box .user_box {
   width: 378rpx;
   height: 100%;
@@ -44,12 +50,14 @@
   align-items: center;
   position: relative;
 }
+
 .swiper_container .swiper_item .head_box .user_box .avatar {
   width: 80rpx;
   height: 80rpx;
   border: 2rpx solid green;
   border-radius: 50%;
 }
+
 .swiper_container .swiper_item .head_box .user_box .avatar_fans {
   width: 34rpx;
   height: 34rpx;
@@ -57,46 +65,55 @@
   bottom: 5rpx;
   left: 26rpx;
 }
+
 .swiper_container .swiper_item .head_box .user_box .user_right {
   margin-left: 16rpx;
   display: flex;
   align-items: center;
 }
+
 .swiper_container .swiper_item .head_box .user_box .user_right .nickname {
   font-size: 30rpx;
   color: rgba(0, 0, 0, 0.8);
   font-weight: bold;
 }
+
 .swiper_container .swiper_item .head_box .user_box .user_right .efun_tag {
   width: 68rpx;
   height: 30rpx;
   margin-left: 4rpx;
 }
+
 .swiper_container .swiper_item .head_box .time {
   display: flex;
   align-items: center;
   font-size: 30rpx;
   color: rgba(0, 0, 0, 0.8);
 }
+
 .swiper_container .swiper_item .head_box .my_btn {
   display: flex;
   align-items: center;
 }
+
 .swiper_container .swiper_item .head_box .my_btn .delete {
   display: flex;
   flex-direction: column;
   align-items: center;
   margin-right: 45rpx;
 }
+
 .swiper_container .swiper_item .head_box .my_btn .delete .delete_image {
   width: 25rpx;
   height: 33rpx;
   margin-bottom: 2rpx;
 }
+
 .swiper_container .swiper_item .head_box .my_btn .delete .delete_text {
   font-size: 26rpx;
   color: rgba(0, 0, 0, 0.8);
 }
+
 .swiper_container .swiper_item .head_box .my_btn .hide {
   display: flex;
   flex-direction: column;
@@ -105,19 +122,23 @@
   padding-top: 3rpx;
   box-sizing: border-box;
 }
+
 .swiper_container .swiper_item .head_box .my_btn .hide .hide_image {
   width: 32rpx;
   height: 33rpx;
   margin-bottom: 2rpx;
 }
+
 .swiper_container .swiper_item .head_box .my_btn .hide .hide_text {
   font-size: 26rpx;
   color: rgba(0, 0, 0, 0.8);
 }
+
 .swiper_container .swiper_item .video_item {
   width: 100%;
   height: 422rpx;
 }
+
 .swiper_container .swiper_item .video_place {
   width: 100%;
   height: 430rpx;
@@ -127,6 +148,7 @@
   justify-content: center;
   position: relative;
 }
+
 .swiper_container .swiper_item .video_place .play_btn {
   width: 100rpx;
   height: 100rpx;
@@ -136,10 +158,12 @@
   right: 0;
   margin: 0 auto;
 }
+
 .swiper_container .swiper_item .video_place .place_img {
   width: 100%;
   height: 100%;
 }
+
 .swiper_container .swiper_item .video_item_dialog {
   width: 100%;
   height: 422rpx;
@@ -150,10 +174,12 @@
   position: absolute;
   z-index: 1;
 }
+
 .swiper_container .swiper_item .video_item_dialog .video_item_dialog_img {
   width: 215rpx;
   height: 215rpx;
 }
+
 .swiper_container .swiper_item .video_title {
   width: 100%;
   height: 58rpx;
@@ -164,6 +190,7 @@
   padding-left: 27rpx;
   font-weight: bold;
 }
+
 .swiper_container .swiper_item .foot_box {
   width: 100%;
   height: 65rpx;
@@ -172,11 +199,13 @@
   justify-content: space-between;
   padding-left: 20rpx;
 }
+
 .swiper_container .swiper_item .foot_box .foot_left,
 .swiper_container .swiper_item .foot_box .foot_right {
   display: flex;
   align-items: center;
 }
+
 .swiper_container .swiper_item .foot_box .video_btn {
   margin-right: 42rpx;
   font-size: 28rpx;
@@ -185,28 +214,38 @@
   flex-direction: row;
   align-items: center;
 }
+
 .swiper_container .swiper_item .foot_box .video_btn .collect_btn_icon {
   width: 48rpx;
   height: 46rpx;
   margin-right: 7rpx;
 }
+
 .swiper_container .swiper_item .foot_box .video_btn .share_btn_icon {
   width: 46rpx;
   height: 46rpx;
   margin-right: 8rpx;
+  outline: none;
+  padding: 0;
+  margin: 0;
+  border-radius: 0;
+  background: #fff;
 }
+
 .swiper_container .swiper_item .foot_box .video_btn .flower_btn_icon {
   width: 46rpx;
   height: 46rpx;
   margin-right: 10rpx;
   border-radius: none;
 }
+
 .swiper_container .swiper_item .foot_box .video_btn .comment_btn_icon {
   width: 49rpx;
   height: 47rpx;
   margin-right: 9rpx;
   border-radius: 0;
 }
+
 .swiper_container .swiper_item .btn_wrapper {
   width: 100%;
   height: 111rpx;
@@ -218,6 +257,7 @@
   padding-bottom: 20rpx;
   box-sizing: border-box;
 }
+
 .swiper_container .swiper_item .btn_wrapper .reading_btn {
   width: 271rpx;
   height: 80rpx;
@@ -227,12 +267,27 @@
   align-items: center;
   justify-content: center;
 }
+
 .swiper_container .swiper_item .btn_wrapper .reading_btn image {
   width: 39rpx;
   height: 50rpx;
   margin-right: 20rpx;
 }
+
 .swiper_container .swiper_item .btn_wrapper .reading_btn text {
   color: #fff;
   font-size: 30rpx;
 }
+
+.no_work {
+  width: 100%;
+  height: 120rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.no_work .no_work_text {
+  color: #373737;
+  font-size: 30rpx;
+}

+ 23 - 11
pages/index/index.js

@@ -32,6 +32,9 @@ import {
 Page({
   data: {
     tab: [{
+        name: '我的',
+        templates: 'my',
+      }, {
         name: '推荐',
         templates: 'recommend',
       },
@@ -42,10 +45,6 @@ Page({
       {
         name: '资源',
         templates: 'courses',
-      },
-      {
-        name: '我的',
-        templates: 'my',
       }
     ],
     winH: 568,
@@ -81,7 +80,8 @@ Page({
       isshowbtn: true, //是否显示按钮
       title: "小学语文朗读配音", //标题
     },
-    grade: wx.getStorageSync('grade')
+    grade: wx.getStorageSync('grade'),
+    noMoreWork: false ,// 没有更多作品 已经到底了
 
   },
   jurisdiction: function () {
@@ -101,9 +101,10 @@ Page({
   },
   // 根据index 更新template
   updateData: function (index) {
-    let myIndex = index;
+    let myIndex = parseInt(index);
     this.setData({
       myIndex,
+      noMoreWork: false
     });
     // 获取推荐列表
     if (myIndex == 0) {
@@ -378,15 +379,25 @@ Page({
     httpRequestApi.getHotRecommendSecond(grade, pageNo, pageSize).success(res => {
       console.log(res)
       const recommendRes = res.data.data.list;
-      if (recommendRes.length === 0) return;
+      if (recommendRes.length === 0){
+        this.setData({
+          noMoreWork: true
+        })
+        return
+      };
       // const recommendWorks = [];
       this.formatWorksList(recommendRes);
-
     })
   },
   // 组装list
   formatWorksList(list, notSet) {
     // const tempList = [];
+    console.log('列表长度列表长度',list.length)
+    if(list.length < 6 || list.length === 0){
+      this.setData({
+        noMoreWork: true
+      })
+    }
     list.forEach((item, index) => {
       /* if (index === list.length - 2 && list.length > 2) {
         console.log('设置当前id', item.id)
@@ -671,7 +682,8 @@ Page({
       console.log('myWorks', myWorks)
       if (this.data.myIndex === 3) {
         this.setData({
-          videoList: myWorks
+          videoList: myWorks,
+          noMoreWork: true
         })
       }
     })
@@ -834,7 +846,6 @@ Page({
       } else {
         this.setData({
           noFollow: false
-
         })
       }
 
@@ -865,7 +876,8 @@ Page({
     httpRequestApi.getClassRead(data).success(res => {
       console.log('资源', this.data.coursesData)
       this.setData({
-        coursesData: this.data.coursesData.concat(res.data.data.list)
+        coursesData: this.data.coursesData.concat(res.data.data.list),
+        noMoreWork: res.data.data.list <= 0 ? true : false
       }, () => {
         console.log(this.data.coursesData)
       })

+ 21 - 10
pages/index/index.wxml

@@ -13,7 +13,7 @@
     </view>
     <view class="change_row change_row_single">
       <view class="change_item" bindtap="changeGrade" data-code="PRESCHOOL">学前班</view>
-      <view class="change_item change_item_blank"  data-code="PRESCHOOL"></view>
+      <view class="change_item change_item_blank" data-code="PRESCHOOL"></view>
     </view>
   </view>
 </view>
@@ -25,16 +25,28 @@
   <import src="/component/my/my.wxml" />
   <import src="/templates/courses/courses.wxml" />
   <!-- 顶部导航 -->
-  <view class="top-tab" wx:if="{{!isGradeShow}}" >
-    <block wx:for="{{tab}}" wx:key="index">
+  <view class="top-tab" wx:if="{{!isGradeShow}}">
+    <!-- <block wx:for="{{tab}}" wx:key="index">
       <view class="tabbar {{index == myIndex ? 'select':' '}}" bindtap="switcher" data-index="{{index}}">
         <text>{{item.name}}</text>
       </view>
-    </block>
+    </block> -->
+    <view class="tabbar {{3 == myIndex ? 'select':' '}}" bindtap="switcher" data-index="3">
+      <text>我的</text>
+    </view>
+    <view class="tabbar {{0 == myIndex ? 'select':' '}}" bindtap="switcher" data-index="0">
+      <text>推荐</text>
+    </view>
+    <view class="tabbar {{1 == myIndex ? 'select':' '}}" bindtap="switcher" data-index="1">
+      <text>关注</text>
+    </view>
+    <view class="tabbar {{2 == myIndex ? 'select':' '}}" bindtap="switcher" data-index="2">
+      <text>资源</text>
+    </view>
   </view>
   <!-- 调用组件 -->
-  <template is="{{templates}}" wx:if="{{myIndex === 3 || myIndex === 2}}" data="{{myData: myData,coursesData:coursesData}}"></template>
-  <VideoSwiper wx:if="{{videoList.length > 0}}" class="video-swiper" video-list="{{videoList}}" nextMargin="{{nextMargin}}" isSwiper="{{isSwiper}}" ifHeadTap="{{true}}" bindopenShare="openShare" bindopenComment="openComment" bindheadTap="headTapHandler" bindgoToReading="goToReading" bindcollectTap="collectTap" bindlikeTap="likeTap" binddelHideMyWork="delHideMyWork" bindchange="videoChange">
+  <template is="{{templates}}" wx:if="{{myIndex === 3 || myIndex === 2}}" data="{{myData: myData,coursesData:coursesData,noMoreWork:noMoreWork}}"></template>
+  <VideoSwiper wx:if="{{videoList.length > 0}}" class="video-swiper" video-list="{{videoList}}" nextMargin="{{nextMargin}}" isSwiper="{{isSwiper}}" noMoreWork="{{noMoreWork}}" ifHeadTap="{{true}}" bindopenShare="openShare" bindopenComment="openComment" bindheadTap="headTapHandler" bindgoToReading="goToReading" bindcollectTap="collectTap" bindlikeTap="likeTap" binddelHideMyWork="delHideMyWork" bindchange="videoChange">
     <!-- bindplay="onPlay"
   bindpause="onPause"
   bindtimeupdate="onTimeUpdate"
@@ -49,8 +61,8 @@
   </view>
   <view class="no_follow" wx:if="{{myIndex === 1 && videoList.length <= 0 && noFollow}}">
     <image class="no_follow_icon" src="../../static/index/no_follow.png" />
-    <text >赶快去关注优秀作者吧,</text>
-    <text >这里将会发生欣喜的变化。</text>
+    <text>赶快去关注优秀作者吧,</text>
+    <text>这里将会发生欣喜的变化。</text>
   </view>
 </view>
 <!-- <MyToast /> -->
@@ -58,8 +70,7 @@
   <Dialog bindmyevent="jurisdiction" />
 </view>
 <shareDialog id="share-dialog" shareType='works' bindShareDialogClose="shareDialogClose" shareId="{{id}}" />
-
- <canvas canvas-id="myCanvas" style="width:300px; height: 525px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
+<canvas canvas-id="myCanvas" style="width:300px; height: 525px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
 <!-- <view class="index-dialog" wx:if="{{indexSignDialog}}">
   <form bindsubmit="signInBtn" report-submit="{{true}}" class="index-dialog-wrapper" >
     <view class="index-dialog-text">签到领取小红花哦</view>

+ 3 - 0
templates/courses/courses.wxml

@@ -17,5 +17,8 @@
                 </view>
             </view>
         </view>
+        <view class="no_work" wx:if="{{noMoreWork}}">
+            <text class="no_work_text">已经到底啦!</text>
+        </view>
     </view>
 </template>

+ 12 - 0
templates/courses/courses.wxss

@@ -49,3 +49,15 @@
   font-size: 28rpx;
   color: rgba(0, 0, 0, 0.6);
 }
+.no_work{
+  width: 100%;
+  height: 120rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+.no_work .no_work_text{
+  color: #373737;
+  font-size: 30rpx;
+}
+