Rorschach 5 years ago
parent
commit
66f0ae99e1
57 changed files with 1079 additions and 712 deletions
  1. 0 1
      app.wxss
  2. 3 0
      component/dialog/dialog.js
  3. 6 6
      component/dialog/dialog.wxml
  4. 4 3
      component/dialog/dialog.wxss
  5. 3 3
      component/follow/follow.wxss
  6. 5 1
      component/group/group.js
  7. 1 1
      component/group/group.wxml
  8. 1 1
      component/group/group.wxss
  9. 34 20
      component/hot/hot.js
  10. 7 4
      component/hot/hot.wxml
  11. 4 4
      component/hot/hot.wxss
  12. 4 4
      component/my/my.wxss
  13. 4 1
      component/myModal/myModal.js
  14. 1 1
      component/myModal/myModal.wxml
  15. 2 2
      component/myToast/myToast.wxss
  16. 1 1
      component/popup/popup.wxss
  17. 102 90
      component/share/share.js
  18. 3 3
      component/share/share.wxml
  19. 8 7
      component/share/share.wxss
  20. 1 1
      pages/groupPage/collage-details/collage-details.js
  21. 1 1
      pages/groupPage/collage-details/collage-details.wxss
  22. 26 11
      pages/groupPage/grade-details/grade-details.js
  23. 20 17
      pages/groupPage/grade-details/grade-details.wxml
  24. 47 11
      pages/groupPage/grade-details/grade-details.wxss
  25. 27 7
      pages/groupPage/group-details/group-details.js
  26. 8 7
      pages/groupPage/group-details/group-details.wxml
  27. 18 2
      pages/groupPage/group-details/group-details.wxss
  28. 16 16
      pages/groupPage/make-money/make-money.js
  29. 2 2
      pages/index/index.js
  30. 62 56
      pages/main/class/class.js
  31. 105 35
      pages/main/reading/reading.js
  32. 3 3
      pages/main/reading/reading.wxml
  33. 7 1
      pages/main/reading/reading.wxss
  34. 1 1
      pages/main/searchResult/searchResult.wxml
  35. 44 18
      pages/main/searchResult/searchResult.wxss
  36. 24 19
      pages/main/week/week.wxss
  37. 2 2
      pages/social/replyDetail/replyDetail.js
  38. 6 5
      pages/social/replyDetail/replyDetail.wxml
  39. 15 11
      pages/social/replyDetail/replyDetail.wxss
  40. 184 105
      pages/social/works/works.js
  41. 2 1
      pages/social/works/works.json
  42. 19 15
      pages/social/works/works.wxml
  43. 20 11
      pages/social/works/works.wxss
  44. 3 0
      pages/user/myEdit/myEdit.js
  45. 32 21
      pages/user/mycollection/mycollection.wxss
  46. 1 1
      pages/user/myconcern/myconcern.wxml
  47. 1 1
      pages/user/myconcern/myconcern.wxss
  48. 1 1
      pages/user/mycourse/mycourse.wxss
  49. 32 8
      pages/user/myread/myread.wxml
  50. 118 122
      pages/user/myread/myread.wxss
  51. 1 1
      pages/user/myworks/myworks.wxml
  52. 7 6
      pages/user/myworks/myworks.wxss
  53. 9 26
      project.config.json
  54. BIN
      static/image/goBackHome.png
  55. 11 11
      utils/APIClient.js
  56. 4 2
      utils/httpUtil.js
  57. 6 1
      utils/util.js

+ 0 - 1
app.wxss

@@ -10,7 +10,6 @@ page {
   box-sizing:border-box;
   padding-top: 70rpx;
   color:#444;
- 
 } 
 ::-webkit-scrollbar{
   width: 0;

+ 3 - 0
component/dialog/dialog.js

@@ -22,6 +22,9 @@ Component({
       var myEventDetail = {} // detail对象,提供给事件监听函数
       var myEventOption = {} // 触发事件的选项
       this.triggerEvent('myevent', myEventDetail, myEventOption)
+    },
+    touchMove: function(){
+      return false
     }
   }
 })

+ 6 - 6
component/dialog/dialog.wxml

@@ -1,11 +1,11 @@
 <!--compontents/dialog/dialog.wxml-->
-<view class="dialog">
+<view class="dialog" catchtouchmove="touchMove">
     <view class="dialog-contain">
-        <view class="title">微信授权</view>
-        <image class="head-bg" src="../../static/image/reader_logo.jpg" style="background: red;"></image>
-        <view class="text">小学语文朗读配音 申请获得以下权限</view>
-        <view class="shuoming">获得你的公开信(昵称、头像等)</view>
-        <button class="btn"  open-type="getUserInfo" bindgetuserinfo="impower">允许</button>
+        <!-- <view class="title">微信授权</view> -->
+        <!-- <image class="head-bg" src="../../static/image/reader_logo.jpg" style="background: red;"></image> -->
+        <view class="text">使用您的微信登录</view>
+        <!-- <view class="shuoming">获得你的公开信(昵称、头像等)</view> -->
+        <button class="btn"  open-type="getUserInfo" bindgetuserinfo="impower">登录</button>
     </view>
 </view>
 

+ 4 - 3
component/dialog/dialog.wxss

@@ -6,7 +6,7 @@
     width: 100%;
     height: 100%;
     background: rgba(0, 0, 0, .4);
-    z-index:100;
+    z-index:9999;
 }
 
 .dialog-contain {
@@ -16,7 +16,7 @@
     bottom: 0;
     right: 0;
     width: 70%;
-    height: 470rpx;
+    height: 216rpx;
     background: #fff;
     margin: auto;
     border-radius: 20rpx;
@@ -46,7 +46,8 @@
     font-size: 28rpx;
     width: 95%;
     /* border-bottom: 2rpx solid #ccc; */
-    padding: 14rpx 0;
+    padding: 28rpx 0;
+    margin-top:12rpx;
 }
 
 .shuoming {

+ 3 - 3
component/follow/follow.wxss

@@ -1,7 +1,7 @@
 .followWares {
     display: flex;
     flex-wrap: wrap;
-    margin-top:20rpx;
+    margin-top:26rpx;
     /* background: #e8e8e8; */
 }
 .followWareCard {
@@ -23,7 +23,7 @@
     display: block;
     width: 662rpx;
     height: 272rpx;
-    margin: 12rpx auto 0;
+    margin: 22rpx auto 0;
     border-radius: 20rpx;
 }
 
@@ -48,7 +48,7 @@
 
 .followWareCard .topData {
     height: 92rpx;
-    margin-top: 14rpx;
+    margin-top: 22rpx;
     display: flex;
     flex-direction: row;
     /* justify-content: space-between; */

+ 5 - 1
component/group/group.js

@@ -36,11 +36,13 @@ export const groupInit = (that) => {
         recommendListTemp.push(temp);
       })
       const recommendListStr = "groupData.recommendList";
+      const listLengthStr = "groupData.listLength";
       // const recommendListThreeStr = "groupData.recommendListThree";
       that.setData({
         [recommendListStr]: recommendListTemp,
         // [recommendListThreeStr]: that.data.groupData.recommendList.slice(that.data.groupData.baseIndex, that.data.groupData.baseIndex + 3),
-        listLength: res.data.data.totalNo
+        listLength: res.data.data.totalNo,
+        [listLengthStr]: res.data.data.totalNo
       })
     }).fail((error) => {
       console.log('错误', error)
@@ -69,6 +71,8 @@ export const groupInit = (that) => {
   //点击换一换
   that.change = function () {
     that.data.groupIndex++
+    console.log(that.data.listLength)
+    console.log(that.data.groupIndex)
     if (that.data.groupIndex > that.data.listLength) {
       that.setData({
         groupIndex: 1

+ 1 - 1
component/group/group.wxml

@@ -48,7 +48,7 @@
             </view>
           </view>
         </block>
-        <view class="change" bindtap="change" wx:if="{{groupData.recommendList.length > 2}}">换一换</view>
+        <view class="change" bindtap="change" wx:if="{{groupData.listLength > 1}}">换一换</view>
       </view>
       <view class="title">
         <image class="ren" src="../../static/groupImg/Shape3.png" style="width: 30rpx; height: 38rpx;"></image>

+ 1 - 1
component/group/group.wxss

@@ -18,7 +18,7 @@ scroll-view {
 .group-container {
     width: 100%;
     box-sizing: border-box;
-    padding: 0 18rpx;
+    padding: 8rpx 18rpx 0;
 }
 
 .group-bars {

+ 34 - 20
component/hot/hot.js

@@ -22,7 +22,8 @@ export const hotInit = (that) => {
         banner: [],
         recommend: [],
         hotWorks: [],
-        winH: that.data.winH
+        winH: that.data.winH,
+        searchIcon: true
       }
     }),
     // 搜索方法
@@ -32,14 +33,27 @@ export const hotInit = (that) => {
           url: `../main/searchResult/searchResult?keyWords=${that.data.hotInput}`
         })
       }
-
     },
-    // 输入框输入
-    that.inputHandler = (e) => {
+    // 输入框获取焦点 放大镜消失
+    that.searchIconDisappear = () => {
+      const str = 'hotData.searchIcon'
       that.setData({
-        hotInput: e.detail.value
-      });
+        [str]: false
+      })
+    },
+    that.searchIconCome = () => {
+      const str = 'hotData.searchIcon'
+      that.setData({
+        [str]: true
+      })
     }
+  
+  // 输入框输入
+  that.inputHandler = (e) => {
+    that.setData({
+      hotInput: e.detail.value
+    });
+  }
   // 打开全部课本
   that.openBooks = (e) => {
     wx.navigateTo({
@@ -149,21 +163,21 @@ export const hotInit = (that) => {
     })
   }
   that.bannerTap = (e) => {
-    const type = e.currentTarget.dataset.type;
-    const id = e.currentTarget.dataset.id;
-    switch (type) {
-      case 'LESSON':
-        that.openClass('tap', id);
-        break;
+      const type = e.currentTarget.dataset.type;
+      const id = e.currentTarget.dataset.id;
+      switch (type) {
+        case 'LESSON':
+          that.openClass('tap', id);
+          break;
+      }
+    },
+    that.goToUsers = (e) => {
+      console.log(e)
+      let uid = e.currentTarget.dataset.uid;
+      wx.navigateTo({
+        url: `../../pages/user/myworks/myworks?uid=${uid}`
+      });
     }
-  },
-  that.goToUsers = (e) => {
-    console.log(e)
-    let uid = e.currentTarget.dataset.uid;
-        wx.navigateTo({
-            url: `../../pages/user/myworks/myworks?uid=${uid}`
-        });
-  }
   // 下拉加载
   that.scrollUpdate = (e) => {
     console.log(e)

+ 7 - 4
component/hot/hot.wxml

@@ -1,5 +1,5 @@
 <template name="hot">
-    <swiper indicator-dots="{{hotData.indicatorDots}}" autoplay="{{hotData.autoplay}}" interval="{{hotData.interval}}" duration="{{hotData.duration}}" circular="{{hotData.circular}}">
+    <swiper indicator-dots="{{hotData.indicatorDots}}" indicator-active-color="rgba(255,255,255,.9)" autoplay="{{hotData.autoplay}}" interval="{{hotData.interval}}" duration="{{hotData.duration}}" circular="{{hotData.circular}}">
         <block wx:for="{{hotData.banner}}" wx:key="{{index}}">
             <swiper-item>
                 <image src="{{item.url}}" data-type="{{item.type}}" data-id="{{item.id}}" class="slide-image" width="750" height="318" />
@@ -7,8 +7,9 @@
         </block>
     </swiper>
     <view class="searchSection">
-        <input bindinput="inputHandler" bindconfirm="searchHandler" placeholder="{{hotData.hotSearch}}" placeholder-style="text-indent:20rpx" confirm-type="search"></input>
-        <view bindtap="searchHandler" class="searchBtn">
+        <input bindinput="inputHandler" bindfocus="searchIconDisappear" bindblur="searchIconCome" bindconfirm="searchHandler" placeholder="{{hotData.hotSearch}}" placeholder-style="text-indent:20rpx" confirm-type="search"></input>
+        <view >{{searchIcon}}</view>
+        <view bindtap="searchHandler" class="searchBtn" wx:if="{{hotData.searchIcon}}">
             <!-- <icon type="search" size="14" /> -->
             <image src="../../static/image/search_new.png" alt="" />
         </view>
@@ -50,7 +51,9 @@
                 <view class="topData">
                     <view class="worksLeft" catchtap="goToUsers" data-uid="{{item.uid}}">
                         <image class="authorAvatar" lazy-load="true" src="{{item.avatar}}" />
-                        <view class="profession" wx:if="{{item.profession}}">{{item.profession}}</view>
+                        <view class="profession" wx:if="{{item.profession}}">
+                            {{item.profession}}
+                        </view>
                         <view class="worksInfo">
                             <view class="authorName">{{item.nickName}}</view>
                             <view class="time">{{item.time}}</view>

+ 4 - 4
component/hot/hot.wxss

@@ -39,7 +39,7 @@ swiper {
     /* background: #fff; */
     position: absolute;
     z-index: 2;
-    right: 220rpx;
+    right: 202rpx;
     width: 56rpx;
     height: 56rpx;
     border: 1rpx solid rgba(255, 255, 255, 0);
@@ -402,7 +402,7 @@ swiper {
     display: block;
     width: 662rpx;
     height: 272rpx;
-    margin: 14rpx auto 0;
+    margin: 22rpx auto 0;
     border-radius: 20rpx;
 }
 
@@ -427,7 +427,7 @@ swiper {
 
 .worksCard .topData {
     height: 92rpx;
-    margin-top: 14rpx;
+    margin-top: 22rpx;
     display: flex;
     flex-direction: row;
     /* justify-content: space-between; */
@@ -482,7 +482,7 @@ swiper {
     border: 2rpx solid rgba(255, 255, 255, 1);
     font-size: 16rpx;
     /* font-family: PingFangSC-Medium; */
-    font-weight: 500;
+    /* font-weight: 500; */
     color: rgba(255, 255, 255, 1);
     line-height: 24rpx;
     text-align: center;

+ 4 - 4
component/my/my.wxss

@@ -21,7 +21,7 @@ page {
 }
 
 .follow-info {
-  margin-top: 20rpx;
+  margin-top: 26rpx;
   width: 100%;
   height: 382rpx;
   border-radius: 20rpx;
@@ -128,7 +128,7 @@ page {
   padding-bottom: 32rpx;
   border-top: 4rpx solid #F0F1F5;
   font-size: 28rpx;
-  font-weight: 600;
+  /* font-weight: 600; */
   z-index: 900;
   display: flex;
   position: absolute;
@@ -141,7 +141,7 @@ page {
   justify-content: center;
   align-items: center;
   font-size: 24rpx;
-  font-weight: lighter;
+  /* font-weight: lighter; */
   height: 22rpx;
   border-right: 2rpx solid #D6D6D6;
 }
@@ -199,7 +199,7 @@ image {
 }
 
 .follow-count {
-  color: #FF0000;
+  color: #F466FF;
 }
 
 .flower-count {

+ 4 - 1
component/myModal/myModal.js

@@ -42,6 +42,9 @@ Component({
         },
         close: function(){
             this.triggerEvent('close', {})
-        }
+        },
+        touchMove: function(){
+            return false
+          }
     }
 })

+ 1 - 1
component/myModal/myModal.wxml

@@ -1,4 +1,4 @@
-<cover-view class="myModal">
+<cover-view class="myModal" catchtouchmove="touchMove">
     <cover-view class="box havePadding" wx:if="{{type === 'text'}}">
         <cover-view class="text" wx:for="{{text}}" wx:key="{{index}}">
             <cover-view class="{{item.type === 'bigOrange' ? 'orange' : 'normal'}}">

+ 2 - 2
component/myToast/myToast.wxss

@@ -45,7 +45,7 @@
     height: 40rpx;
     font-size: 28rpx;
     /* font-family: PingFangSC-Regular; */
-    font-weight: 400;
+    /* font-weight: 400; */
     color: rgba(37, 37, 37, 1);
     line-height: 40rpx;
 }
@@ -54,7 +54,7 @@
     height: 40rpx;
     font-size: 28rpx;
     /* font-family: PingFangSC-Regular; */
-    font-weight: 400;
+    /* font-weight: 400; */
     color: rgba(37, 37, 37, 1);
     line-height: 40rpx;
 }

+ 1 - 1
component/popup/popup.wxss

@@ -43,7 +43,7 @@ overflow:hidden;
 
 .head-txt .title {
     font-size: 48rpx;
-    font-weight: bolder;
+    /* font-weight: bolder; */
 }
 
 .head-txt .head-con {

+ 102 - 90
component/share/share.js

@@ -37,7 +37,7 @@ Component({
    * 组件的方法列表
    */
   methods: {
-    touchMove: function(){
+    touchMove: function () {
       return false
     },
     poster: function () {
@@ -72,45 +72,34 @@ Component({
               console.log('下载content成功1')
               console.log(res.path)
               //res.path是网络图片的本地地址
-              ctx.drawImage(res.path,127, 423, 121, 121);
-
-
-
+              ctx.drawImage(res.path, 127, 423, 121, 121);
               console.log('下载content成功2')
               ctx.draw(true, function (res) {
-                wx.canvasToTempFilePath({
-                  x: 0,
-                  y: 0,
-                  width: 375,
-                  height: 667,
-                  // destWidth: 370,
-                  destWidth: 1500,
-                  // destHeight: 507,
-                  destHeight: 2668,
-                  canvasId: 'myCanvas',
-                  success: (res) => {
-                    console.log(res.tempFilePath)
-                    // wx.saveImageToPhotosAlbum({
-                    //   filePath: res.path,
-                    //   success(res) {
-                    //     console.log(res);
-                    //   }
-                    // })
-                    that.setData({
-                      imgUrls: res.tempFilePath
-                    }, () => {
-                      wx.hideLoading();
-                    })
-                  },
-                  fail: (res) => {
-                    console.log(res)
-                  }
-                })
+                setTimeout(() => {
+                  wx.canvasToTempFilePath({
+                    x: 0,
+                    y: 0,
+                    width: 375,
+                    height: 667,
+                    // destWidth: 370,
+                    destWidth: 1500,
+                    // destHeight: 507,
+                    destHeight: 2668,
+                    canvasId: 'myCanvas',
+                    success: (res) => {
+                      console.log(res.tempFilePath)
+                      that.setData({
+                        imgUrls: res.tempFilePath
+                      }, () => {
+                        wx.hideLoading();
+                      })
+                    },
+                    fail: (res) => {
+                      console.log(res)
+                    }
+                  })
+                }, 200)
               })
-              console.log('下载content成功3')
-
-
-
             },
             fail: function (res) {
               //失败回调
@@ -158,21 +147,21 @@ Component({
           groupPurchaseInfo: data.groupPurchaseInfo
         })
       }
-      
+
       if (this.data.shareType === 'class') {
         console.log('课程分享')
         this.setData({
           shareFlag: !this.data.shareFlag
         })
       }
-       // 动画测试
-       this.animation = wx.createAnimation({
+      // 动画测试
+      this.animation = wx.createAnimation({
         duration: 700,
         timingFunction: 'ease',
       })
       this.animation.bottom(0).step();
       this.setData({
-        animationData:this.animation.export()
+        animationData: this.animation.export()
       })
       // 动画测试
     },
@@ -184,17 +173,18 @@ Component({
       })
       this.animation.bottom(-300).step();
       this.setData({
-        animationData:this.animation.export()
-      },()=>{
-        setTimeout(()=>{
+        animationData: this.animation.export()
+      }, () => {
+        setTimeout(() => {
           this.setData({
             shareFlag: !this.data.shareFlag,
             imgUrls: ''
           })
-        },200)
+          this.triggerEvent('ShareDialogClose', {})
+        }, 200)
       })
-      
-      
+
+
     },
     nothing: function (e) {
       return
@@ -271,9 +261,9 @@ Component({
           mask: true
         })
         if (this.data.shareType === 'works') {
-          ctx.drawImage('../../../static/image/works_poster.jpg', 0, 0, 1500, 2668,0,0,750,1334); //插入图片  
+          ctx.drawImage('../../../static/image/works_poster.jpg', 0, 0, 1500, 2668, 0, 0, 750, 1334); //插入图片  
         } else {
-          ctx.drawImage('../../../static/image/group_poster.jpg', 0, 0, 1500, 2668,0,0,750,1334); //插入图片  
+          ctx.drawImage('../../../static/image/group_poster.jpg', 0, 0, 1500, 2668, 0, 0, 750, 1334); //插入图片  
         }
         ctx.save()
         ctx.beginPath()
@@ -286,29 +276,29 @@ Component({
     drawAuthor: function (ctx) {
       let author = new Promise((resolve, reject) => {
         if (this.data.shareType === 'works') {
-            ctx.arc(187.5, 171, 36, 0, 2 * Math.PI, false) 
-            ctx.clip(); //剪切头像区域
-            ctx.fill('red')
-            ctx.drawImage(this.data.avatar, 157, 135, 72, 72); //插入图片  
-            ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
-            ctx.setFontSize(18)
-            ctx.setFillStyle('#444444')
-            ctx.fillText(this.data.author, (375 - ctx.measureText(this.data.author).width) / 2, 232)
-            ctx.setFontSize(16)
-            ctx.setFillStyle('#ff9209')
-            ctx.fillText('播音主持特长生', (375 - ctx.measureText('播音主持特长生').width) / 2, 253)
-          } else {
-            ctx.arc(52, 58, 36, 0, 2 * Math.PI, false) 
-            ctx.clip(); //剪切头像区域
-            ctx.fill('red')
-            ctx.drawImage(this.data.avatar, 16, 22, 72, 72); //插入图片  
-            ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
-            ctx.setFontSize(20)
-            ctx.setFillStyle('#fff')
-            ctx.fillText(this.data.author, 97, 49)
-            ctx.setFontSize(22)
-            ctx.fillText('邀您一起来拼团', 97, 77)  
-          }
+          ctx.arc(187.5, 171, 36, 0, 2 * Math.PI, false)
+          ctx.clip(); //剪切头像区域
+          ctx.fill('red')
+          ctx.drawImage(this.data.avatar, 152, 135, 72, 72); //插入图片  
+          ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
+          ctx.setFontSize(18)
+          ctx.setFillStyle('#444444')
+          ctx.fillText(this.data.author, (375 - ctx.measureText(this.data.author).width) / 2, 232)
+          ctx.setFontSize(16)
+          ctx.setFillStyle('#ff9209')
+          ctx.fillText('播音主持特长生', (375 - ctx.measureText('播音主持特长生').width) / 2, 253)
+        } else {
+          ctx.arc(52, 58, 36, 0, 2 * Math.PI, false)
+          ctx.clip(); //剪切头像区域
+          ctx.fill('red')
+          ctx.drawImage(this.data.avatar, 16, 22, 72, 72); //插入图片  
+          ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
+          ctx.setFontSize(20)
+          ctx.setFillStyle('#fff')
+          ctx.fillText(this.data.author, 97, 49)
+          ctx.setFontSize(22)
+          ctx.fillText('邀您一起来拼团', 97, 77)
+        }
         resolve();
       })
       return author;
@@ -322,22 +312,22 @@ Component({
         ctx.setFontSize(18)
         ctx.fillText('小学语文 最新全国统一教材', (375 - ctx.measureText('小学语文 最新全国统一教材').width) / 2, 55);
         ctx.setFontSize(30)
-        ctx.fillText('课文朗读 从未如此有趣', (375 - ctx.measureText('课文朗读 从未如此有趣').width) / 2 ,103);
+        ctx.fillText('课文朗读 从未如此有趣', (375 - ctx.measureText('课文朗读 从未如此有趣').width) / 2, 103);
         ctx.setFontSize(16)
         ctx.setFillStyle('#444')
-        ctx.fillText('使出洪荒之力,声情并茂地朗诵了', (375 - ctx.measureText('使出洪荒之力,声情并茂地朗诵了').width) / 2 ,297)
+        ctx.fillText('使出洪荒之力,声情并茂地朗诵了', (375 - ctx.measureText('使出洪荒之力,声情并茂地朗诵了').width) / 2, 297)
         // ctx.fillText(`配了一段惊世之作`,  90, 240)
         // ctx.setFontSize(16)
         // ctx.setFillStyle('red')
         ctx.fillText(`《${this.data.title}》`, (375 - ctx.measureText(`《${this.data.title}》`).width) / 2, 322)
-        
+
         ctx.setFontSize(16)
         ctx.setFillStyle('#000')
         // ctx.setFillStyle('#000')
         ctx.setFontSize(16)
         // ctx.setFillStyle('#c90000')
         ctx.setFillStyle('#ff9209')
-        ctx.fillText('为TA疯狂打CALL 快去听听', (375 - ctx.measureText('为TA疯狂打CALL 快去听听').width) / 2 , 401)
+        ctx.fillText('为TA疯狂打CALL 快去听听', (375 - ctx.measureText('为TA疯狂打CALL 快去听听').width) / 2, 401)
         ctx.setFontSize(12)
         ctx.setFillStyle('#666666')
         ctx.fillText('长按识别二维码', (375 - ctx.measureText('长按识别二维码').width) / 2, 574)
@@ -352,22 +342,22 @@ Component({
       let group = new Promise((resolve, reject) => {
         ctx.setFontSize(28)
         ctx.setFillStyle('#ff670d')
-        ctx.fillText('小学语文 朗读配音', (375 - ctx.measureText('小学语文 朗读配音').width) / 2 , 152)
-          ctx.setFontSize(16)
+        ctx.fillText('小学语文 朗读配音', (375 - ctx.measureText('小学语文 朗读配音').width) / 2, 152)
+        ctx.setFontSize(16)
         ctx.setFillStyle('#444')
-        ctx.fillText('郎朗读书声,是世上最美的声音', (375 - ctx.measureText('郎朗读书声,是世上最美的声音').width) / 2 ,351)
-        if(this.data.groupPurchaseInfo.productId === 1){
-          ctx.drawImage('../../../static/share/poster_1.jpg', 12, 176, 351, 145);
-        }
-        if(this.data.groupPurchaseInfo.productId === 2){
-          ctx.drawImage('../../../static/share/poster_2.jpg', 12, 176, 351, 145);
-        }
-        if(this.data.groupPurchaseInfo.productId === 3){
-          ctx.drawImage('../../../static/share/poster_3.jpg', 12, 176, 351, 145);
-        }
+        ctx.fillText('朗朗读书声,是世上最美的声音', (375 - ctx.measureText('朗朗读书声,是世上最美的声音').width) / 2, 351)
+        // if (this.data.groupPurchaseInfo.productId === 1) {
+          ctx.drawImage(this.data.iconImg, 12, 176, 351, 145);
+        // }
+        // if (this.data.groupPurchaseInfo.productId === 2) {
+        //   ctx.drawImage('../../../static/share/poster_2.jpg', 12, 176, 351, 145);
+        // }
+        // if (this.data.groupPurchaseInfo.productId === 3) {
+        //   ctx.drawImage('../../../static/share/poster_3.jpg', 12, 176, 351, 145);
+        // }
         ctx.setFontSize(17)
         ctx.setFillStyle('#A95A00')
-        ctx.fillText(`${this.data.groupPurchaseInfo.headcount}人团`,  96, 412)
+        ctx.fillText(`${this.data.groupPurchaseInfo.headcount}人团`, 96, 412)
         ctx.setFontSize(19)
         ctx.fillText('每人仅需', 151, 412)
         // ctx.fillText('元', 120, 495)
@@ -384,9 +374,9 @@ Component({
       return group;
     },
 
-
     // 保存最终图片
     PreservationImg: function () {
+      // this.getImgAuthorize()
       wx.saveImageToPhotosAlbum({
         filePath: this.data.imgUrls,
         success: (res) => {
@@ -394,6 +384,28 @@ Component({
           this.setData({
             imgUrls: false
           })
+        },
+        fail: res => {
+          wx.getSetting({
+            success(res) {
+              if (!res.authSetting['scope.writePhotosAlbum']) {
+                // wx.showToast({
+                //   title: '无权限操作',
+                //   icon: 'fail',
+                //   duration: 800
+                // })
+                wx.showModal({
+                  title: '无法保存分享图片到相册',
+                  content: '点击右上角浮点按钮->进入关于->点击右上角按钮->设置,进行授权',
+                  confirmText: '我知道了',
+                  showCancel: false,
+                  success(res) {
+                    console.log('用户点击确定')
+                  }
+                })
+              }
+            }
+          })
         }
       })
     },

+ 3 - 3
component/share/share.wxml

@@ -1,5 +1,5 @@
 <view class="share" bindtap="close" wx:if="{{shareFlag}}" catchtouchmove="touchMove">
-   <view class="btn" animation="{{animationData}}" wx:if="{{!imgUrls}}" id="btnArea" bindtap="nothing">
+   <view class="btn" animation="{{animationData}}" wx:if="{{!imgUrls}}" id="btnArea" catchtap="nothing">
        <image class="bg" src="../../static/groupImg/share.png"></image>
        <view class="share-btn">
             <button class="share-friend" open-type="share" catchtap="shareFriend">
@@ -12,8 +12,8 @@
             </view>           
        </view>
    </view>
-   <cover-view class="share-img" wx:if="{{imgUrls}}" id="imgArea" bindtap="nothing">
-       <cover-image class="img" src="{{imgUrls}}"></cover-image>
+   <cover-view class="share-img" wx:if="{{imgUrls}}" id="imgArea">
+       <cover-image class="img" src="{{imgUrls}}"  catchtap="nothing"></cover-image>
        <cover-view class="Preservation" bindtap="PreservationImg" style="{{shareType === 'works' ?'background:#ff9209' :'background:#70CA2D'}}">
            <!-- <image class="PreservationBg" src="../../static/groupImg/Preservation.png"></image> -->
            <!-- <text bindtap="PreservationImg">保存到相册中,快去分享吧</text> -->

+ 8 - 7
component/share/share.wxss

@@ -1,12 +1,13 @@
 /* component/shar-dialog/shar-dialog.wxss */
 .share {
-    position: absolute;
-    left: 0;
-    top: 0;
-    width: 100%;
-    height: 1000%;
-    background: rgba(0, 0, 0, .6);
-    z-index: 99;
+    position:fixed;
+    left:0;
+    top:0;
+    width:100%;
+    height:100%;
+    background:rgba(0, 0, 0, .6);
+    z-index:999999;
+    
 }
 
 .btn {

+ 1 - 1
pages/groupPage/collage-details/collage-details.js

@@ -180,7 +180,7 @@ Page({
     return {
       title: '老师同学都在玩的配音show,你还在等什么?',
       path: `pages/groupPage/group-details/group-details?share=true&shareId=${id}`,
-      imageUrl: '../../../static/share/group_icon.jpg',
+      imageUrl: `https://efunbox.lingjiao.cn/reader/resource/share/group_${this.data.productId}.jpg`,
       success: function (res) {
         // 转发成功
         console.log("转发成功:" + JSON.stringify(res));

+ 1 - 1
pages/groupPage/collage-details/collage-details.wxss

@@ -71,7 +71,7 @@
     border: 2rpx solid rgba(255, 255, 255, 1);
     font-size: 20rpx;
     /* font-family: PingFangSC-Medium; */
-    font-weight: 500;
+    /* font-weight: 500; */
     color: rgba(255, 255, 255, 1);
     left: 8rpx;
     text-align: center;

+ 26 - 11
pages/groupPage/grade-details/grade-details.js

@@ -1,5 +1,6 @@
 // pages/grade-details/grade-details.js
 import httpRequestApi from '../../../utils/APIClient';
+import util from '../../../utils/util';
 const app = getApp();
 Page({
   /**
@@ -50,7 +51,8 @@ Page({
         type: 'bigOrange'
       }
     ],
-    isModalShow: false
+    isModalShow: false,
+    formIsANAsshole: true
   },
   //tab切换
   tabSwitch: function (e) {
@@ -68,17 +70,18 @@ Page({
     }
   },
   //获取团购信息并掉起支付
-  pay: function ({
-    currentTarget
-  }) {
+  pay: function (e) {
+    console.log(e)
     const productId = this.data.productId;
-    const groupId = currentTarget.dataset.id;
+    const groupId = e.currentTarget.dataset.id;
     const osType = this.data.isIOS ? 'IOS' : 'ANDROID';
+    const formId = e.detail.formId
     //开始发起团购
     httpRequestApi.SendGroupPurchas({
       productId,
       groupId,
-      osType
+      osType,
+      formId
     }).success((res) => {
       console.log('发起团购', res);
       
@@ -183,6 +186,12 @@ Page({
     //   isModalShow: true
     // })
     // return
+    if(this.data.haveTapMoney){
+      return false
+    }
+    this.setData({
+      haveTapMoney : true
+    })
     console.log(prePayMap)
     console.log(orderId)
     console.log(num)
@@ -198,7 +207,8 @@ Page({
       'success': function (res) {
         that.setData({
           modalType: 'image',
-          isModalShow: true
+          isModalShow: true,
+          haveTapMoney: false
         })
         console.log('支付成功', res)
         // wx.showModal({
@@ -227,6 +237,9 @@ Page({
       },
       'fail': function (res) {
         console.log('支付失败', res)
+        that.setData({
+          haveTapMoney: false
+        })
       }
     })
   },
@@ -255,13 +268,15 @@ Page({
   },
   // 课本鉴权
   areYouBookSuper: function (productId) {
-    const productArr = [];
-    productArr.push(productId);
-    httpRequestApi.areYouSuper(productArr).success(res => {
+    // const productArr = [];
+    // productArr.push(productId);
+    httpRequestApi.areYouSuper(productId).success(res => {
       console.log(res)
       this.setData({
-        imSuper: res.data.data
+        imSuper: res.data.success,
+        lastThreeYears: res.data.success ? util.addThreeYears(res.data.data.gmtModified) : false
       })
+      console.log(this.data.lastThreeYears)
     })
   },
   getBookInfo: function (productId) {

+ 20 - 17
pages/groupPage/grade-details/grade-details.wxml

@@ -3,7 +3,7 @@
     <scroll-view scroll-y="{{true}}">
         <view class="grade-details">
             <image src="{{titleIcon}}"></image>
-            <!-- <text class="limitTime">{{limitTime}}</text> -->
+            <text class="lastThreeYears" wx:if="{{lastThreeYears}}">使用期限至:{{lastThreeYears}}</text>
         </view>
         <view class="catalog">
             <image class="bg2" src="../../../static/groupImg/Rectangle_9.png"></image>
@@ -26,34 +26,37 @@
             <template is="entry" data="{{...article}}" />
         </view>
     </scroll-view>
-    <view class="group-btn" wx:if="{{!imSuper? !isIOS : null}}">
+    <view class="group-btn {{isIPX ? 'bottomx' :''}}" wx:if="{{!imSuper? !isIOS : null}}">
         <image class="bg1" src="../../../static/groupImg/baise.png"></image>
         <image class="bg2" src="../../../static/groupImg/baise.png"></image>      
         <block wx:for="{{payList}}" wx:key="{{index}}">
-            <view class="Price" bindtap="pay" data-id="{{item.id}}" wx:if="{{share ? (index != 0) : true }}">
-                <text>¥{{item.price / 100}}</text>
-                <text>{{item.headcount == '1' ? '单' : item.headcount}}人{{item.headcount == '1' ? '购' : '团'}}</text>
-            </view>
+            <form class="Price" bindsubmit="pay" report-submit="{{formIsANAsshole}}" data-id="{{item.id}}" wx:if="{{share ? (index != 0) : true }}">
+                <text class="formFit">¥{{item.price / 100}}</text>
+                <text class="formFit">{{item.headcount == '1' ? '单' : item.headcount}}人{{item.headcount == '1' ? '购' : '团'}}</text>
+                <button class="formBtn" form-type="submit"></button>
+            </form>
         </block>
     </view>
-    <view class="group-btn" wx:if="{{!imSuper? isIOS : null}}">
+    <view class="group-btn {{isIPX ? 'bottomx' :''}}" wx:if="{{!imSuper? isIOS : null}}">
         <image class="bg1" src="../../../static/groupImg/baise.png" style="left: 50%"></image>
         <block wx:for="{{payList}}" wx:key="{{index}}">
-            <view class="Price" bindtap="pay" data-id="{{item.id}}" wx:if="{{share ? (index != 0) : item.headcount === 1 ? false : true }}">
-                <text>{{item.price / 100}}元/{{item.headcount - 1}}人帮忙</text>
-                <text style="fontSize: 24rpx">免费开团</text>
-            </view>
+            <form class="Price" bindsubmit="pay" report-submit="{{formIsANAsshole}}" data-id="{{item.id}}" wx:if="{{share ? (index != 0) : item.headcount === 1 ? false : true }}">
+                <text class="formFit">{{item.price / 100}}元/{{item.headcount - 1}}人帮忙</text>
+                <text class="formFit" style="fontSize: 24rpx">免费开团</text>
+                <button class="formBtn" form-type="submit"></button>
+            </form>
         </block>
     </view>
-    <view class="group-btn" wx:if="{{imSuper}}">
+    <view class="group-btn {{isIPX ? 'bottomx' :''}}" wx:if="{{imSuper}}">
         <image class="bg1" style="left: 50%" src="../../../static/groupImg/baise.png" ></image>   
         <block wx:for="{{payList}}" wx:key="{{index}}">
-            <view class="Price" bindtap="pay" data-id="{{item.id}}" wx:if="{{imSuper ? (index != 0) : true }}">
+            <form class="Price" bindsubmit="pay" report-submit="{{formIsANAsshole}}" data-id="{{item.id}}" wx:if="{{imSuper ? (index != 0) : true }}">
                 <view>继续开团 赚奖学金</view>
-                <view>
-                    <text>{{item.headcount}}人团</text>
-                </view>
-            </view>
+                <!-- <view class="formFit"> -->
+                    <text class="formFit">{{item.headcount}}人团</text>
+                <!-- </view> -->
+                <button class="formBtn" form-type="submit"></button>
+            </form>
         </block>
     </view>
 </view>

+ 47 - 11
pages/groupPage/grade-details/grade-details.wxss

@@ -10,10 +10,11 @@
 
 /**主题配色(深色样式)**/
 @import '../../../towxml/style/theme/dark.wxss';
+
 .group-details {
     height: 100%;
     width: 100%;
-    background:rgba(240,241,245,1);    
+    background: rgba(240, 241, 245, 1);
 }
 
 
@@ -26,10 +27,10 @@ scroll-view {
     background: #fff;
     display: flex;
     flex-direction: column;
-    padding: 24rpx;
+    padding: 24rpx 24rpx 0 24rpx;
 }
 
-.grade-details image{
+.grade-details image {
     width: 100%;
     height: 290rpx;
     border-radius: 20rpx;
@@ -42,15 +43,17 @@ scroll-view {
     height: 110rpx;
     background: #fff;
     position: relative;
+    margin-bottom: 18rpx;
+
 }
 
 
 .catalog image {
-    position:absolute;
-    left:374rpx;
-    top:26rpx;
-    width:2rpx;
-    height:60rpx;
+    position: absolute;
+    left: 374rpx;
+    top: 26rpx;
+    width: 2rpx;
+    height: 60rpx;
 }
 
 .catalog text {
@@ -58,7 +61,7 @@ scroll-view {
     text-align: center;
     font-size: 36rpx;
     /* margin: 0 110rpx; */
-    margin:0 104rpx;
+    margin: 0 104rpx;
     box-sizing: border-box;
 }
 
@@ -69,9 +72,9 @@ scroll-view {
 
 .catalog-list {
     width: 100%;
-    padding: 18rpx;
+    padding: 0 18rpx 100rpx;
     box-sizing: border-box;
-    margin-bottom: 100rpx;
+
 }
 
 .know {
@@ -94,6 +97,17 @@ scroll-view {
     border-radius: 10rpx;
 }
 
+.lastThreeYears {
+    width: 100%;
+    height: 22rpx;
+    line-height: 26rpx;
+    padding-right: 6rpx;
+    box-sizing: border-box;
+    font-size: 16rpx;
+    color: #939393;
+    text-align: right;
+}
+
 .catalog-item .left {
     color: #656565;
     font-size: 36rpx;
@@ -130,6 +144,7 @@ scroll-view {
 }
 
 .group-btn .Price {
+    position: relative;
     flex: 1;
     display: flex;
     flex-direction: column;
@@ -161,3 +176,24 @@ scroll-view {
 .group-btn .bg2 {
     left: 68%;
 }
+
+.formFit {
+    display: block;
+    text-align: center;
+}
+
+.formBtn {
+    margin: 0;
+    padding: 0;
+    background: rgba(255, 255, 255, 0);
+    width: 100%;
+    position: absolute;
+    top: 0;
+    height: 100%;
+    left: 0;
+
+}
+
+.formBtn::after {
+    border: none;
+}

+ 27 - 7
pages/groupPage/group-details/group-details.js

@@ -52,6 +52,8 @@ Page({
         type: 'bigOrange'
       }
     ],
+    groupStatus: false,
+    formIsANAsshole: true
   },
   //tab切换
   tabSwitch: function () {
@@ -107,14 +109,17 @@ Page({
 
   },
   //参团
-  jionGroup: function () {
+  jionGroup: function (e) {
     if (app.globalData.isIOS) {
       this.showAlert();
       return;
     }
     const orderId = this.data.orderId;
+    const formId = e.detail.formId
+    console.log(e)
     //开始发起团购
-    httpRequestApi.JoinGroupPurchas(orderId).success((res) => {
+    httpRequestApi.JoinGroupPurchas(orderId,formId).success((res) => {
+      
       console.log('参加团购', res);
       if (res.data.message) {
         if (res.data.code === 801) {
@@ -151,6 +156,12 @@ Page({
   //支付
   prePayMap: function (prePayMap, type) {
     console.log(prePayMap)
+    if(this.data.haveTapMoney){
+      return false
+    }
+    this.setData({
+      haveTapMoney : true
+    })
     // const that = this;
     this.setData({
       joinGroupType: type
@@ -165,7 +176,8 @@ Page({
       'success': res => {
         console.log('支付成功')
         this.setData({
-          isModalShow: true
+          isModalShow: true,
+          haveTapMoney: false
         })
         // const type1 = type;
         // wx.showModal({
@@ -188,8 +200,11 @@ Page({
         // })
 
       },
-      'fail': function (res) {
+      'fail': res => {
         console.log('支付失败', res)
+        this.setData({
+          haveTapMoney: false
+        })
       }
     })
   },
@@ -245,7 +260,8 @@ Page({
         }
       }
       let timeList = [];
-      const stillGoing = groupOrder.closeTime - Date.parse(new Date()) <= 0 ? false : true
+      // || groupOrder.status ==='SUCCESSED'
+      const stillGoing = groupOrder.closeTime - Date.parse(new Date()) <= 0  ? false : true
       if (stillGoing) {
         timeList = util.lastHoursInGroup(groupOrder.closeTime - Date.parse(new Date()));
         console.log(timeList)
@@ -257,12 +273,17 @@ Page({
       //     url: `/pages/groupPage/grade-details/grade-details?productId=${res.data.data.groupPurchaseOrder.productId}`
       //   })
       // }
+      // const groupStatus = false;
+      if (groupOrder.status === 'SUCCESSED'){
+        this.data.groupStatus = true
+      }
       this.setData({
         surplusNum,
         joinUserList: res.data.data.joinUserList,
         surplusList: this.data.surplusList,
         timeList,
-        stillGoing
+        stillGoing,
+        groupStatus: this.data.groupStatus
       })
       if (groupOrder.groupType === 'PROMOTION') {
         //this.data.joinUserList.unshift(res.data.data.organizer);
@@ -283,7 +304,6 @@ Page({
   },
   // 弹成功信息框
   showSuccess: function (organizerUid, price) {
-    debugger;
     if (wx.getStorageSync('uid') == organizerUid) {
       this.setData({
         typeOf: 'success',

+ 8 - 7
pages/groupPage/group-details/group-details.wxml

@@ -16,10 +16,10 @@
         </view>
         <view class="shengyu">
             <view class="shengyu-num" wx:if="{{colonelName}}">团长{{colonelName}}发起团购</view>
-            <view class="shengyu-num" hidden="{{surplusNum == '0' || !stillGoing}}">仅剩<text>{{surplusNum}}</text>个名额就拼团成功了</view>
-            <view class="shengyu-num" hidden="{{stillGoing}}">团购已超过时限</view>
+            <view class="shengyu-num" hidden="{{surplusNum == '0' || !stillGoing || groupStatus}}">仅剩<text>{{surplusNum}}</text>个名额就拼团成功了</view>
+            <view class="shengyu-num" hidden="{{stillGoing || !groupStatus}}">团购已超过时限</view>
             <view class="shengyu-num" hidden="{{surplusNum != '0'}}">拼团成功!快去朗读吧</view>
-            <view class="shengyu-time" hidden="{{!stillGoing}}">
+            <view class="shengyu-time" hidden="{{!stillGoing || groupStatus}}">
                 剩余时间:
                 <block wx:for="{{timeList[0]}}" wx:key="{{index}}">
                     <view class="time">
@@ -66,15 +66,16 @@
         </view>
     </scroll-view>
     <!-- 底部按钮 -->
-    <view class="group-details-btn" hidden="{{surplusNum == '0' || !stillGoing }}">
+    <view class="group-details-btn {{isIPX ? 'bottomx' :''}}" hidden="{{surplusNum == '0' || !stillGoing }}">
         <view class="left-btn" bindtap="sendGroup">
             开团
         </view>
-        <view class="right-btn" bindtap="jionGroup">
+        <form class="right-btn {{isIPX ? 'bottomx' :''}}" report-submit="{{formIsANAsshole}}" bindsubmit="jionGroup">
             参团
-        </view>
+            <button class="formBtn" form-type="submit"></button>
+        </form>
     </view>
-    <view class="group-details-btn" hidden="{{stillGoing }}">
+    <view class="group-details-btn {{isIPX ? 'bottomx' :''}}" hidden="{{stillGoing }}">
         <view class="only-one-btn" bindtap="sendGroup">
             重新开团
         </view>

+ 18 - 2
pages/groupPage/group-details/group-details.wxss

@@ -11,7 +11,7 @@
 /**主题配色(深色样式)**/
 @import '../../../towxml/style/theme/dark.wxss';
 .group-details {
-    height: 100%;
+    
     width: 100%;
     background: rgba(240, 241, 245, 1);
 }
@@ -227,10 +227,11 @@ scroll-view {
 .only-one-btn
 {
     flex: 1;
-    height: 54rpx;
+    height: 100%;
     display: flex;
     justify-content: center;
     align-items: center;
+    position: relative;
 }
 
 .left-btn {
@@ -314,4 +315,19 @@ scroll-view {
 .group-item .item-img {
     width: 214rpx;
     height: 278rpx;
+}
+.formBtn {
+    margin: 0;
+    padding: 0;
+    background: rgba(255, 255, 255, 0);
+    width: 100%;
+    position: absolute;
+    top: 0;
+    height: 100%;
+    left: 0;
+
+}
+
+.formBtn::after {
+    border: none;
 }

+ 16 - 16
pages/groupPage/make-money/make-money.js

@@ -143,22 +143,22 @@ Page({
     return {
       title: '老师同学都在玩的配音show,你还在等什么?',
       path: `pages/groupPage/group-details/group-details?share=true&shareId=${id}`,
-      imageUrl: '../../../static/share/group_icon.jpg',
-      success: function (res) {
-        // 转发成功
-        console.log("转发成功:" + JSON.stringify(res));
-        var shareTickets = res.shareTickets;
-        // if (shareTickets.length == 0) {
-        //   return false;
-        // }
-        // //可以获取群组信息
-        // wx.getShareInfo({
-        //   shareTicket: shareTickets[0],
-        //   success: function (res) {
-        //     console.log(res)
-        //   }
-        // })
-      },
+      imageUrl: `https://efunbox.lingjiao.cn/reader/resource/share/lesson_${this.data.productId}.jpg`,
+      // success: function (res) {
+      //   // 转发成功
+      //   console.log("转发成功:" + JSON.stringify(res));
+      //   var shareTickets = res.shareTickets;
+      //   // if (shareTickets.length == 0) {
+      //   //   return false;
+      //   // }
+      //   // //可以获取群组信息
+      //   // wx.getShareInfo({
+      //   //   shareTicket: shareTickets[0],
+      //   //   success: function (res) {
+      //   //     console.log(res)
+      //   //   }
+      //   // })
+      // },
       fail: function (res) {
         // 转发失败
         console.log("转发失败:" + JSON.stringify(res));

+ 2 - 2
pages/index/index.js

@@ -59,7 +59,7 @@ Page({
     hotInput: '12345',
     mineSettingInfo: '528',
     hide: true,
-    isIOS:app.globalData.isIOS
+    isIOS:app.globalData.isIOS,
   },
   jurisdiction: function () {
     //隐藏弹框
@@ -153,7 +153,7 @@ Page({
     console.log(wx.getStorageSync('user'));
     httpRequestApi.getUserWorksInfo().success(res => {
       this.data.myData.user = res.data.data; //直接赋值 给 myData的user对象。
-      this.data.myData.user.user.birthday =formatDate(res.data.data.user.birthday,4);
+      this.data.myData.user.user.birthday = this.data.myData.user.user.birthday ?  formatDate(res.data.data.user.birthday,4) : '2018年1月1日';
       console.log(formatDate(res.data.data.user.birthday,1))
       console.log(this.data.myData.user.birthday)
       this.setData({

+ 62 - 56
pages/main/class/class.js

@@ -37,7 +37,8 @@ Page({
       }
     ],
     modalBtnText:'去开团',
-    isModalShow: false
+    isModalShow: false,
+    productId: 0,
   },
   onLoad: function (option) {
     console.log(option);
@@ -56,14 +57,22 @@ Page({
 
     httpRequestApi.getClassDetail(this.uid, option.id).success(res => {
       console.log(res);
+      const classId = this.data.id;
+      // let productId = 0
+      // httpRequestApi.checkLesson(classId).success(res => {
+      //    productId = res.data.data[0];
+      
+      // });
       this.setData({
-        title: res.data.data.title,
-        videoUrl: res.data.data.playUrl,
-        iconImg: res.data.data.iconImg
+        title: res.data.data.lesson.title,
+        videoUrl: res.data.data.lesson.playUrl,
+        iconImg: res.data.data.lesson.iconImg,
+        productId: res.data.data.product.id
       })
       wx.setNavigationBarTitle({
-        title: res.data.data.title //页面标题为路由参数
+        title: res.data.data.lesson.title //页面标题为路由参数
       })
+
       this.getReadInfo(1, 10);
       this.checkLike();
     })
@@ -96,56 +105,52 @@ Page({
   goToReading: function () {
 
     let classId = this.data.id;
-    httpRequestApi.checkLesson(classId).success(res => {
-      const productId = res.data.data[0];
-      this.setData({
-        productId
-      })
-      // wx.navigateTo({
-      //   url: `../../main/reading/reading?id=${classId}`
-      // })
-      // return;
-      httpRequestApi.areYouSuper(res.data.data).success(res => {
-        if (res.data.success) {
-          wx.navigateTo({
-            url: `../../main/reading/reading?id=${classId}`
-          })
-        } else {
-          // ios用户 并且没有购买过此书
-          // if (app.globalData.isIOS) {
-          //   wx.showModal({
-          //     title: '暂不支持',
-          //     content: '十分抱歉,由于相关规定,您暂时无法在这里朗读',
-          //     success(res) {
-          //       if (res.confirm) {
-          //         console.log('用户点击确定')
-          //       } else if (res.cancel) {
-          //         console.log('用户点击取消')
-          //       }
-          //     }
-          //   })
-          //   return;
-          // }
-          this.setData({
-            isModalShow: true
-          })
-          // wx.showModal({
-          //   title: '您未购买过本书,不能朗读',
-          //   content: '超值团购进行中,快去看看',
-          //   success(res) {
-          //     if (res.confirm) {
-          //       console.log('用户点击确定')
-          //       wx.navigateTo({
-          //         url: `../../groupPage/grade-details/grade-details?productId=${productId}`
-          //       })
-          //     } else if (res.cancel) {
-          //       console.log('用户点击取消')
-          //     }
-          //   }
-          // })
-        }
-      })
-    });
+    // httpRequestApi.checkLesson(classId).success(res => {
+    //   const productId = res.data.data[0];
+    //   this.setData({
+    //     productId
+    //   })
+    // });
+    httpRequestApi.areYouSuper(this.data.productId).success(res => {
+      if (res.data.success) {
+        wx.navigateTo({
+          url: `../../main/reading/reading?id=${this.data.id}`
+        })
+      } else {
+        // ios用户 并且没有购买过此书
+        // if (app.globalData.isIOS) {
+        //   wx.showModal({
+        //     title: '暂不支持',
+        //     content: '十分抱歉,由于相关规定,您暂时无法在这里朗读',
+        //     success(res) {
+        //       if (res.confirm) {
+        //         console.log('用户点击确定')
+        //       } else if (res.cancel) {
+        //         console.log('用户点击取消')
+        //       }
+        //     }
+        //   })
+        //   return;
+        // }
+        this.setData({
+          isModalShow: true
+        })
+        // wx.showModal({
+        //   title: '您未购买过本书,不能朗读',
+        //   content: '超值团购进行中,快去看看',
+        //   success(res) {
+        //     if (res.confirm) {
+        //       console.log('用户点击确定')
+        //       wx.navigateTo({
+        //         url: `../../groupPage/grade-details/grade-details?productId=${productId}`
+        //       })
+        //     } else if (res.cancel) {
+        //       console.log('用户点击取消')
+        //     }
+        //   }
+        // })
+      }
+    })
 
   },
   modalConfirmHandler: function () {
@@ -177,6 +182,7 @@ Page({
     this.shareDialog.share(data);
   },
   onShareAppMessage: function (res) {
+    console.log(this.data.productId)
     if (res.from === 'button') {
       // 来自页面内转发按钮
       console.log(res.target)
@@ -184,7 +190,7 @@ Page({
     return {
       title: '老师同学都在玩的配音show,你还在等什么?',
       path: `pages/main/class/class?id=${this.data.id}&title=${this.data.title}&shareCard=true`,
-      imageUrl: '../../../static/share/class_icon.jpg'
+      imageUrl: `https://efunbox.lingjiao.cn/reader/resource/share/lesson_${this.data.productId}.jpg`
     }
   },
   goToWorks: function (e) {

+ 105 - 35
pages/main/reading/reading.js

@@ -26,22 +26,21 @@ Page({
 
         const uid = wx.getStorageSync('uid')
         httpRequestApi.getClassDetail(uid, option.id).success(res => {
+            wx.setNavigationBarTitle({
+                title: res.data.data.title //页面标题为路由参数
+            })
             let reg = /\\n/g
             this.setData({
-                title: res.data.data.title,
-                videoUrl: res.data.data.accompany || res.data.data.playUrl,
-                img: res.data.data.iconImg,
-                id: res.data.data.id,
+                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.lessonText,
-                grade: res.data.data.gradeClassify
+                readingText: res.data.data.lesson.lessonText,
+                grade: res.data.data.lesson.gradeClassify
             })
             console.log(this.data.readingText)
             console.log(this.data.img)
-        }, () => {
-            wx.setNavigationBarTitle({
-                title: this.data.title //页面标题为路由参数
-            })
         })
 
         this.recorderManager = wx.getRecorderManager();
@@ -52,12 +51,63 @@ Page({
         this.recorderManager.onStart(() => {
             // this.saveVideo();
             this.setData({
-                btnImgFlag: true
+                btnImgFlag: true,
+                btnFlag: false
             })
             console.log('recorder start')
         })
+        // this.recorderManager.onPause(() => {
+        //     wx.showToast({
+        //         title: '录音被暂停',
+        //         icon: 'fail',
+        //         duration: 500
+        //     })
+        // })
+        // this.recorderManager.onInterruptionBegin(() => {
+        //     wx.showToast({
+        //         title: '录音被应用中断开始',
+        //         icon: 'fail',
+        //         duration: 500
+        //     })
+        // })
+        // this.recorderManager.onInterruptionEnd(() => {
+        //     wx.showToast({
+        //         title: '录音中断结束',
+        //         icon: 'fail',
+        //         duration: 500
+        //     })
+        // })
+        this.recorderManager.onError(() => {
+            wx.getSetting({
+                success(res) {
+                    if (!res.authSetting['scope.record']) {
+                        wx.showModal({
+                            title: '无法开启您的录音权限',
+                            content: '点击右上角浮点按钮->进入关于->点击右上角按钮->设置,进行授权',
+                            confirmText: '我知道了',
+                            showCancel: false,
+                            success(res) {
+                                console.log('用户点击确定')
+                            }
+                        })
+                    }
+                    // else {
+                    //     wx.showToast({
+                    //         title: 'onError',
+                    //         icon: 'fail',
+                    //         duration: 500
+                    //     })
+                    // }
+                }
+            })
+        })
         // 录音结束
         this.recorderManager.onStop((res) => {
+            // wx.showToast({
+            //     title: 'onStop',
+            //     icon: 'fail',
+            //     duration: 500
+            // })
             this.videoCtx.stop();
             console.log('recorder stop', res)
             const recordFile = res.tempFilePath;
@@ -69,29 +119,36 @@ Page({
             })
         })
     },
-    onHide: function(){
+    onHide: function () {
         console.log('onhide')
-        if(this.recorderManager){
+        if (this.data.btnImgFlag) {
             this.recorderManager.stop();
         }
-        
-        if(this.innerAudioContext){
+
+        if (this.innerAudioContext) {
             this.innerAudioContext.stop();
         }
     },
-    onUnload: function(){
+    onUnload: function () {
         console.log('onUnload')
-        if(this.recorderManager){
+        if (this.recorderManager) {
             this.recorderManager.stop();
         }
-        if(this.innerAudioContext){
+        if (this.innerAudioContext) {
             this.innerAudioContext.stop();
         }
     },
     // onShow:function(){
 
     // },
-
+    // 视频缓冲
+    // videoWaiting: function () {
+    //     this.recorderManager.pause();
+    // },
+    // //视频播放
+    // videoPlay: function () {
+    //     this.recorderManager.resume();
+    // },
     // 录音中视频播放结束 (控制录音同时结束)
     recordingVideoEnd: function () {
         console.log(this.data.videoCtr)
@@ -99,7 +156,7 @@ Page({
         // 
         if (this.data.recordFlag === 0) {
             // this.recordStop();
-        
+
             this.playingVideoEnd();
             return;
         }
@@ -124,13 +181,13 @@ Page({
         if (this.data.recordFlag === 0) {
             // this.recordStart();
             // this.saveVideo();
-            if(this.videoCtx){
+            if (this.videoCtx) {
                 this.videoCtx.stop();
             }
-            if(this.recorderManager){
+            if (this.recorderManager) {
                 this.recorderManager.stop();
             }
-            if(this.innerAudioContext){
+            if (this.innerAudioContext) {
                 this.innerAudioContext.stop();
             }
             this.videoComplete();
@@ -141,7 +198,7 @@ Page({
             wx.showLoading({
                 title: '作品转码中',
                 mask: true
-              })
+            })
             this.recordStop();
         }
     },
@@ -175,10 +232,11 @@ Page({
     // 播放录音
     audioPlay: function () {
         console.log('音频播放');
+        if (this.innerAudioContext) {
+            this.innerAudioContext.stop();
+            this.videoCtx.stop();
+        }
         this.innerAudioContext = wx.createInnerAudioContext();
-        this.innerAudioContext.onError((res) => {
-            // 播放音频失败的回调
-        })
         this.innerAudioContext.src = this.data.recordSource; // 这里可以是录音的临时路径
         console.log(this.innerAudioContext.src);
         this.videoCtx.play();
@@ -190,17 +248,27 @@ Page({
         this.setData({
             recordFlag: 1
         }, () => {
-            this.videoCtx = wx.createVideoContext('myVideo', this);
-            this.videoCtx.play();
-            this.recordStart();
+
         })
+        this.videoCtx = wx.createVideoContext('myVideo', this);
+        this.videoCtx.play();
+        this.recordStart();
     },
     // 上传
     upload: function () {
+        if (this.videoCtx) {
+            this.videoCtx.stop();
+        }
+        if (this.recorderManager) {
+            this.recorderManager.stop();
+        }
+        if (this.innerAudioContext) {
+            this.innerAudioContext.stop();
+        }
         wx.showLoading({
             title: '作品分享中',
             mask: true
-          })
+        })
         const recordSource = this.data.recordSource;
         wx.uploadFile({
             url: 'https://reader.lingjiao.cn/readerBase/file/upload',
@@ -218,7 +286,9 @@ Page({
 
         })
         let shareWorks = (uid, audio) => {
-            console.log(this.data.img)
+            if (this.innerAudioContext) {
+                this.innerAudioContext.stop();
+            }
             const data = {
                 "lessonId": this.data.id,
                 "originVideo": this.data.videoUrl,
@@ -229,12 +299,12 @@ Page({
             };
             httpRequestApi.postWork(uid, data).success(res => {
                 wx.hideLoading({
-                    success: ()=>{
+                    success: () => {
                         wx.showToast({
                             title: '上传成功',
                             icon: 'success',
                             duration: 1000,
-                            success: ()=>{
+                            success: () => {
                                 console.log(res);
                                 wx.redirectTo({
                                     url: `../../social/works/works?id=${res.data.data.id}`
@@ -243,7 +313,7 @@ Page({
                         })
                     }
                 });
-                
+
             })
         };
     }

+ 3 - 3
pages/main/reading/reading.wxml

@@ -1,4 +1,4 @@
-<view >
+<view class="readingPage">
     <!-- <view class="videoSection" wx:if="{{!isIOS}}">
         <image wx:if="{{!videoLoad}}" class="videoIcon" src="{{iconImg}}" />
     </view> -->
@@ -11,10 +11,10 @@
   show-center-play-btn="{{centerBtn}}"
   muted="{{muted}}"
   enable-progress-gesture="{{gesture}}"
-  bindwaiting="{{videoWaiting}}"
   bindended="recordingVideoEnd"
   ></video>
-
+  <!-- bindwaiting="videoWaiting"
+  bindplay="videoPlay" -->
   <!-- <audio name="123" author="123" src="{{recordSource}}" id="myAudio" controls loop></audio> -->
 <scroll-view class="textSection" scroll-y="true">
    <text class="textContent">

+ 7 - 1
pages/main/reading/reading.wxss

@@ -1,3 +1,8 @@
+.readingPage{
+    height: 100%;
+    overflow: hidden;
+}
+
 .videoSection {
     width: 750rpx;
     height: 421.9rpx;
@@ -12,7 +17,8 @@ audio {
 }
 .textSection{
     width: 100%;
-    height: 600rpx;
+    height: 50%;
+    padding-bottom: 200rpx;
     overflow: visible;
 }
 .textSection .textContent{

+ 1 - 1
pages/main/searchResult/searchResult.wxml

@@ -1,4 +1,4 @@
-<view class="hotWares" style="flex-direction:row;">
+<view class="hotWares">
     <view wx:for="{{wareCards}}" wx:key="{{index}}" class="hotWareCard" bindtap="openClass" data-classId="{{item.classId}}" data-title="{{item.title}}">
         <image class="wareCardImg" src="{{item.img}}" />
         <view class="resultData">

+ 44 - 18
pages/main/searchResult/searchResult.wxss

@@ -1,36 +1,61 @@
+.hotWares {
+    display: flex;
+    flex-wrap: wrap;
+    padding-top:22rpx;
+
+    background: rgba(240, 241, 245, 1);
+
+}
+
 .hotWares .hotWareCard {
     position: relative;
     overflow: hidden;
-    width: 704rpx;
-    height: 360rpx;
-    margin: 20rpx auto;
+    width: 720rpx;
+    height: 374rpx;
+    background: #fff;
+    /* padding: 26rpx; */
+    border-radius: 12rpx;
+    /* margin: 0 0 18rpx 16rpx; */
+    margin: 0 auto 20rpx;
+    /* box-shadow: 0 8rpx 6rpx 0 rgba(0, 0, 0, .28); */
 }
+
+
+
 .hotWareCard .wareCardImg {
-    width: 100%;
-    height: 290rpx;
+    display: block;
+    width: 662rpx;
+    height: 272rpx;
+    margin: 26rpx auto 0;
     border-radius: 20rpx;
 }
 
+.resultData {
+    display: flex;
+    justify-content: space-between;
+    margin-top: 12rpx;
+
+}
 
-.resultData{
+.hotWareCard .titleSummary {
     display: flex;
-    align-content: space-between;
-    align-items: center
+    justify-content: space-between;
+    margin-top: 12rpx;
 }
+
 .hotWareCard .wareCardTitle {
     /* margin: 0 auto; */
-    width: 100%;
+    width: 80%;
     height: 46rpx;
     display: block;
     /* text-align: left; */
-    color: #444;
+    color: #414141;
     font-size: 32rpx;
-    letter-spacing: 4rpx;
+    /* letter-spacing: 4rpx; */
+    margin-left: 28rpx;
     /* font-family: MicrosoftYaHei; */
-    text-overflow: ellipsis;
-    overflow: hidden;
-    white-space: nowrap;
 }
+
 .hotWareCard .bottomData {
     height: 34rpx;
     margin-top: 10rpx;
@@ -49,11 +74,12 @@
 }
 
 .hotWareCard .wareCardTip {
-
     width: 178rpx;
     height: 40rpx;
     display: block;
-    text-align: center;
-    color: #414141;
+    text-align: left;
+    color: #444;
     font-size: 24rpx;
-}
+    line-height: 41rpx;
+
+}

+ 24 - 19
pages/main/week/week.wxss

@@ -1,9 +1,11 @@
-
 .hotSection {
     width: 100%;
     /* height: 50rpx; */
-    background: #fff;
-    margin-top: 10rpx;
+    /* background: #fff; */
+    background: rgba(240, 241, 245, 1);
+    min-height: 100%;
+    padding-bottom:20rpx;
+
 }
 
 .hotWares {
@@ -14,11 +16,12 @@
 .hotSection .hotWares .hotWareCard {
     position: relative;
     overflow: hidden;
-    width: 704rpx;
-    height: 402rpx;
-    /* margin: 0 0 18rpx 16rpx; */
+    width: 720rpx;
+    height: 374rpx;
+    background: #fff;
+    border-radius: 12rpx;
     margin: 0 auto 20rpx;
-    /* box-shadow: 0 8rpx 6rpx 0 rgba(0, 0, 0, .28); */
+
 }
 
 .hotWareCard .titleSummary {
@@ -28,23 +31,24 @@
 }
 
 .hotWareCard .wareCardImg {
-    width: 100%;
-    height: 290rpx;
+    display: block;
+    width: 662rpx;
+    height: 272rpx;
+    margin: 26rpx auto 0;
     border-radius: 20rpx;
+
 }
 
 
 
 .hotWareCard .wareCardTitle {
-    /* margin: 0 auto; */
-    width: 100%;
-    height: 46rpx;
-    display: block;
-    /* text-align: left; */
-    color: #444;
-    font-size: 32rpx;
-    /* letter-spacing: 4rpx; */
-    /* font-family: MicrosoftYaHei; */
+    width:80%;
+    height:46rpx;
+    display:block;
+    color:#414141;
+    font-size:32rpx;
+    margin-left:28rpx;
+    
 }
 
 .hotWareCard .bottomData {
@@ -55,6 +59,7 @@
     justify-content: space-between;
     align-items: center;
 }
+
 .hotWareCard .wareCardTip {
     width: 178rpx;
     height: 40rpx;
@@ -62,4 +67,4 @@
     text-align: left;
     color: #444;
     font-size: 24rpx;
-}
+}

+ 2 - 2
pages/social/replyDetail/replyDetail.js

@@ -56,7 +56,7 @@ Page({
             const authorDetail = {};
             authorDetail.name = replied.user.wechatName;
             authorDetail.text = decodeURI(replied.detailDesc);
-            authorDetail.time = formatDate(replied.gmtModified,3);
+            authorDetail.time = formatDate(replied.gmtCreated,3);
             authorDetail.likes = replied.postsAttributeInfo.favors;
             authorDetail.avatar = replied.user.avatar;
             replyTemp.push(authorDetail);
@@ -64,7 +64,7 @@ Page({
                 const temp = {};
                 temp.name = item.user.wechatName;
                 temp.text = decodeURI(item.content);
-                temp.time = formatDate(item.gmtModified,3);
+                temp.time = formatDate(item.gmtCreated,3);
                 temp.likes = 0;
                 temp.id = item.postId;
                 temp.avatar = item.user.avatar;

+ 6 - 5
pages/social/replyDetail/replyDetail.wxml

@@ -8,6 +8,11 @@
           <text class="gut">{{comment[0].text}}</text>
       </view>
     </view>
+    <view class='reply-msg'>
+    <input name='reply' class='reply-input' bindconfirm="replyDone" placeholder='回复@{{ comment[0].name }}' value='{{ replyInfo }}' bindinput='saveValue' confirm-type ="send">
+    </input>
+    <text class='reply-btn' bindtap='replyDone'>回复</text>
+  </view>
 <view class='reply-all'>
     全部回复({{ count || 0 }})
   </view>
@@ -21,9 +26,5 @@
     </view>
   </view>
   
-  <view class='reply-msg'>
-    <input name='reply' class='reply-input' bindconfirm="replyDone" placeholder='回复@{{ comment[0].name }}' value='{{ replyInfo }}' bindinput='saveValue' confirm-type ="send">
-    </input>
-    <text class='reply-btn' bindtap='replyDone'>回复</text>
-  </view>
+  
 </view>

+ 15 - 11
pages/social/replyDetail/replyDetail.wxss

@@ -8,13 +8,16 @@
 }
 
 .commentArea .commentItem {
-  width: 100%;
-  padding: 0 0 0 23rpx;
-  height: 100%;
-  border-bottom: solid 2rpx #DEDEE2;
-  display: flex;
-  position: relative;
-  background: #F0F1F5;
+  width:674rpx;
+padding:0 0 0 23rpx;
+height:100%;
+border-bottom:solid 2rpx #f8f8f8;
+display:flex;
+position:relative;
+background:#fff;
+margin:10rpx auto;
+border-radius:10rpx;
+
 }
 
 .commentArea  .commentItemFirst{
@@ -32,8 +35,9 @@
 }
 
 .commentItem .avatar {
+  display: block;
   border-radius: 50%;
-  width: 96rpx;
+  width: 101rpx;
   height: 96rpx;
   margin-top: 18rpx;
 }
@@ -69,7 +73,7 @@
   /* position: absolute; */
   box-sizing: border-box;
   padding: 16rpx 23rpx;
-  width: 674rpx;
+  width: 100%;
   border-top: 2rpx solid #F0F1F5;
   /* left: 40rpx; */
   /* top: 200rpx; */
@@ -78,8 +82,8 @@
 }
 
 .reply-msg{
-  position: fixed;
-  bottom: 0;
+  /* position: fixed; */
+  /* bottom: 0; */
   width: 750rpx;
   height: 92rpx;
   z-index: 100rpx;

+ 184 - 105
pages/social/works/works.js

@@ -2,6 +2,9 @@ import httpRequestApi from '../../../utils/APIClient';
 import {
     formatDate
 } from '../../../utils/util';
+import {
+    getOpenidSessionKey
+  } from '../../../utils/httpUtil';
 const app = getApp()
 Page({
     data: {
@@ -30,6 +33,7 @@ Page({
         isIOS: app.globalData.isIOS,
         alertFlag: false,
         modalType: "text",
+        noScroll: '',
         modalText: [{
                 text: '您还不是本课程的会员',
                 type: 'bigOrange'
@@ -39,9 +43,10 @@ Page({
                 type: 'normal'
             }
         ],
-        modalBtnText:'去开团',
+        modalBtnText: '去开团',
         isModalShow: false,
-        modalCloseShow: true
+        modalCloseShow: true,
+        hide: true
         // shareFlag: false
     },
     showAlert: function () {
@@ -50,27 +55,35 @@ Page({
         })
     },
     onLoad: function (option) {
-        let id = option.id ? option.id : option.scene.replace('QR', '')
-        if (option.scene || option.shareCard) {
+        getOpenidSessionKey((res) => {
+            let id = option.id ? option.id : option.scene.replace('QR', '')
+            if (option.scene || option.shareCard) {
+                this.setData({
+                    goBackHome: true
+                })
+            }
+            // wx.setNavigationBarTitle({
+            //     title: option.title //页面标题为路由参数
+            // })
+            this.uid = wx.getStorageSync('uid');
+            let stackSize = 1;
+            if (option.stackSize) {
+                stackSize = option.stackSize;
+            }
             this.setData({
-                goBackHome: true
+                // title: option.title,
+                id,
+                myUid: this.uid,
+                stackSize
             })
-        }
-        wx.setNavigationBarTitle({
-            title: option.title //页面标题为路由参数
-        })
-        this.uid = wx.getStorageSync('uid');
-        let stackSize = 1;
-        if (option.stackSize) {
-            stackSize = option.stackSize;
-        }
-        this.setData({
-            title: option.title,
-            id,
-            myUid: this.uid,
-            stackSize
-        })
-        this.getWorks(this.uid, id);
+            this.getWorks(this.uid, id);
+        }, (error) => {
+            this.setData({
+                hide: !this.data.hide,
+                onLoadOption: option
+            })
+            return;
+        });
     },
     onHide: function () {
         // this.data.stackSize >= 2
@@ -78,21 +91,24 @@ Page({
         if (this.innerAudioContext) {
             this.innerAudioContext.pause();
         }
-        let videoCtx = wx.createVideoContext('worksVideo', this);
-        videoCtx.stop();
+        this.videoCtx = null
     },
     onUnload: function () {
         if (this.innerAudioContext) {
             this.innerAudioContext.destroy();
         }
-        let videoCtx = wx.createVideoContext('worksVideo', this);
-        videoCtx.stop();
+        this.videoCtx = null
+        // let videoCtx = wx.createVideoContext('worksVideo', this);
+        // videoCtx.stop();
     },
     getWorks: function (uid, id) {
         httpRequestApi.getWorksDetail(uid, id).success((res) => {
             const others = res.data.data.otherRead;
             const author = res.data.data.user;
             const works = res.data.data.userRead;
+            wx.setNavigationBarTitle({
+                title: works.title //页面标题为路由参数
+            })
             const othersTemp = [];
             others.forEach((item) => {
                 const temp = {};
@@ -115,13 +131,24 @@ Page({
                 classId: works.lessonId,
                 isLike: res.data.data.isLike,
                 isFans: res.data.data.isFans,
+                title: works.title
             })
+            httpRequestApi.checkLesson(works.lessonId).success(res => {
+                const productId = res.data.data[0];
+                this.setData({
+                    productId
+                })
+            });
             // 设置音频路径
             this.innerAudioContext = wx.createInnerAudioContext();
-            this.innerAudioContext.onError((res) => {
+            this.innerAudioContext.onPause((res) => {
                 // 播放音频失败的回调
+                console.log('音频暂停')
             })
             this.innerAudioContext.src = this.data.audioSrc; // 这里可以是录音的临时路径
+
+
+
         });
     },
     onShow() {
@@ -166,30 +193,47 @@ Page({
     },
     // 弹出分享框
     openShare: function (e) {
-        this.shareDialog = this.selectComponent("#share-dialog");
-        const data = {
-            avatar: this.data.authorAvatar,
-            author: this.data.author,
-            iconImg: this.data.iconImg,
-            title: this.data.title,
-            path: `pages/social/works/works`,
-            scene: this.data.id
-            // tip: this.data.tip,
+        console.log(this.data.authorAvatar)
+        console.log(this.data.author)
+        console.log(this.data.iconImg)
+        console.log(this.data.title)
+        console.log(this.data.id)
+        if (this.data.authorAvatar && this.data.author && this.data.iconImg && this.data.title && this.data.id) {
+            this.shareDialog = this.selectComponent("#share-dialog");
+            const data = {
+                avatar: this.data.authorAvatar,
+                author: this.data.author,
+                iconImg: this.data.iconImg,
+                title: this.data.title,
+                path: `pages/social/works/works`,
+                scene: this.data.id,
+                // tip: this.data.tip,
+            }
+            // console.log(data)
+            this.setData({
+                noScroll: 'noScroll'
+            })
+            this.shareDialog.share(data);
         }
-        this.shareDialog.share(data);
+    },
+    // 分享框关闭
+    shareDialogClose: function (e) {
+        this.setData({
+            noScroll: ''
+        })
     },
     videoPlay: function () {
         // 视频开始 先结束 再开始
+        // this.innerAudioContext.play();
+        // this.innerAudioContext.pause();
+        // wx.showToast({
+        //     title: '加载中',
+        //     icon: 'loading',
+        //     duration: 600
+        // })
+        // setTimeout(() => {
         this.innerAudioContext.play();
-        this.innerAudioContext.pause();
-        wx.showToast({
-            title: '加载中',
-            icon: 'loading',
-            duration: 600
-        })
-        setTimeout(() => {
-            this.innerAudioContext.play();
-        }, 800)
+        // }, 800)
         httpRequestApi.playWorks(this.uid, this.data.id).success(() => {
             console.log('容个错')
         });
@@ -199,67 +243,83 @@ Page({
         this.innerAudioContext.stop();
     },
     videoPause: function () {
+        console.log('视频暂停')
         this.innerAudioContext.pause();
     },
+    videoWaiting: function () {
+        console.log('视频缓冲')
+        this.innerAudioContext.pause();
+    },
+    videoProgress: function (e) {
+        console.log('视频加载进度变化')
+        console.log(e)
+        if (e.detail.buffered <= 10) {
+            this.innerAudioContext.pause();
+        } else {
+            this.innerAudioContext.play();
+        }
+    },
+    videoTimeupdate: function (e) {
+        console.log('视频播放进度发生变化')
+        console.log('视频当前时长', e.detail.currentTime);
+        console.log('音频当前时长', this.innerAudioContext.currentTime)
+        if (e.detail.currentTime - this.innerAudioContext.currentTime >= 1) {
+            this.innerAudioContext.seek(e.detail.currentTime - 0.1);
+        }
+    },
     goToReading: function () {
         const classId = this.data.classId;
-        httpRequestApi.checkLesson(classId).success(res => {
-            const productId = res.data.data[0];
-            this.setData({
-                productId
-            })
-            httpRequestApi.areYouSuper(res.data.data).success(res => {
-                if (res.data.success) {
-                    wx.navigateTo({
-                        url: `../../main/reading/reading?id=${classId}`
-                    })
-                } else {
-                    // ios用户 并且没有购买过此书
-                    // if (this.data.isIOS) {
-                    //     wx.showModal({
-                    //         title: '暂不支持',
-                    //         content: '十分抱歉,由于相关规定,您暂时无法在这里朗读',
-                    //         success(res) {
-                    //             if (res.confirm) {
-                    //                 console.log('用户点击确定')
-                    //             } else if (res.cancel) {
-                    //                 console.log('用户点击取消')
-                    //             }
-                    //         }
-                    //     })
-                    //     return;
-                    // }
-                    console.log('chulaiba')
-                    this.setData({
-                        isModalShow: true
-                    })
-                    // wx.showModal({
-                    //     title: '您未购买过本书,不能朗读',
-                    //     content: '超值团购进行中,快去看看',
-                    //     success(res) {
-                    //         if (res.confirm) {
-                    //             console.log('用户点击确定')
-                    //             wx.navigateTo({
-                    //                 url: `../../groupPage/grade-details/grade-details?productId=${productId}`
-                    //             })
-                    //         } else if (res.cancel) {
-                    //             console.log('用户点击取消')
-                    //         }
-                    //     }
-                    // })
-                }
-            })
-        });
+
+
+        httpRequestApi.areYouSuper(this.data.productId).success(res => {
+            if (res.data.success) {
+                wx.navigateTo({
+                    url: `../../main/reading/reading?id=${classId}`
+                })
+            } else {
+                // ios用户 并且没有购买过此书
+                // if (this.data.isIOS) {
+                //     wx.showModal({
+                //         title: '暂不支持',
+                //         content: '十分抱歉,由于相关规定,您暂时无法在这里朗读',
+                //         success(res) {
+                //             if (res.confirm) {
+                //                 console.log('用户点击确定')
+                //             } else if (res.cancel) {
+                //                 console.log('用户点击取消')
+                //             }
+                //         }
+                //     })
+                //     return;
+                // }
+                console.log('chulaiba')
+                this.setData({
+                    isModalShow: true
+                })
+                // wx.showModal({
+                //     title: '您未购买过本书,不能朗读',
+                //     content: '超值团购进行中,快去看看',
+                //     success(res) {
+                //         if (res.confirm) {
+                //             console.log('用户点击确定')
+                //             wx.navigateTo({
+                //                 url: `../../groupPage/grade-details/grade-details?productId=${productId}`
+                //             })
+                //         } else if (res.cancel) {
+                //             console.log('用户点击取消')
+                //         }
+                //     }
+                // })
+            }
+        })
     },
-    onShareAppMessage: function (res) {
-        if (res.from === 'button') {
-            // 来自页面内转发按钮
-            console.log(res.target)
-        }
+    onShareAppMessage: function () {
+        console.log(this.data.productId);
+
         return {
             title: '一样的课文,不一样的味道!我的配音表演已开始,求各位大咖围观、点评!',
             path: `pages/social/works/works?id=${this.data.id}&title=${this.data.title}&shareCard=true`,
-            imageUrl: '../../../static/share/works_icon.jpg'
+            imageUrl: `https://efunbox.lingjiao.cn/reader/resource/share/read_${this.data.productId}.jpg`
         }
     },
     follow: function () {
@@ -343,7 +403,8 @@ Page({
                 temp.avatar = item.user.avatar;
                 temp.profession = item.user.profession;
                 temp.uid = item.user.uid;
-                temp.text = decodeURI(item.detailDesc);
+                // temp.text = decodeURI(item.detailDesc);
+                temp.text = item.detailDesc;
                 temp.id = item.id;
                 temp.replyCount = item.replyCount;
                 temp.time = formatDate(item.gmtCreated, 3);
@@ -379,7 +440,8 @@ Page({
             let data = {
                 "columnId": this.data.id,
                 colunmNames: 'what',
-                "detailDesc": encodeURI(this.data.inputValue)
+                // "detailDesc": encodeURI(this.data.inputValue)
+                "detailDesc": this.data.inputValue
             }
             httpRequestApi.postReply(this.uid, data).success(res => {
                 this.setData({
@@ -488,6 +550,12 @@ Page({
     },
     //支付
     payMoney: function (orderInfo) {
+        if (this.data.haveTapMoney) {
+            return false
+        }
+        this.setData({
+            haveTapMoney: true
+        })
         wx.requestPayment({
             'appId': orderInfo.appId,
             'timeStamp': orderInfo.timeStamp,
@@ -500,7 +568,9 @@ Page({
                     modalType: 'image',
                     isModalShow: true,
                     modalCloseShow: false,
-                    modalBtnText: '确定'
+                    modalBtnText: '确定',
+                    haveTapMoney: false,
+                    ifReward: false
                 })
                 // wx.showModal({
                 //     title: '提示',
@@ -519,9 +589,9 @@ Page({
                 // })
 
             },
-            'fail': function (res) {
+            'fail': res => {
                 this.setData({
-                    ifReward: false
+                    haveTapMoney: false,
                 })
                 console.log('支付失败', res)
             }
@@ -534,14 +604,15 @@ Page({
         })
     },
     modalConfirmHandler: function () {
-        
+
         if (this.data.modalType === 'image') {
             this.setData({
                 modalType: 'text',
                 isModalShow: false,
                 ifReward: false,
                 modalCloseShow: true,
-                modalBtnText: "去开团"
+                modalBtnText: "去开团",
+                // ifReward: false
             })
             return false
         }
@@ -557,4 +628,12 @@ Page({
             isModalShow: false
         })
     },
+    jurisdiction: function () {
+        //隐藏弹框
+        this.setData({
+            hide: !this.data.hide
+        })
+        //登录页信息
+        this.onLoad(this.data.onLoadOption);
+    },
 })

+ 2 - 1
pages/social/works/works.json

@@ -6,7 +6,8 @@
         "popup": "/component/popup/popup",
         "goBackHome": "/component/goBackHome/goBackHome",
         "myToast":"/component/myToast/myToast",
-        "myModal": "/component/myModal/myModal"
+        "myModal": "/component/myModal/myModal",
+        "Dialog": "/component/dialog/dialog"
     },
     "window": {
         "onReachBottomDistance": 50

+ 19 - 15
pages/social/works/works.wxml

@@ -1,11 +1,11 @@
-<view>
+<view class="{{noScroll}}">
     <view class="videoSection" wx:if="{{!isIOS}}">
         <cover-image wx:if="{{!videoLoad}}" class="video-playBtn" bindtap="videoPlayHandler" src="../../../static/image/play-btn.png"></cover-image>
         <image wx:if="{{!videoLoad}}" class="videoIcon" src="{{iconImg}}" />
-        <video wx:if="{{videoLoad}}" id="worksVideo" class="videoSection" src="{{videoSrc}}" bindplay="videoPlay" bindended="videoEnd" bindpause="videoPause" controls="false" enable-progress-gesture="{{gesture}}" show-fullscreen-btn="{{fullScreenBtn}}" show-play-btn="{{playBtn}}"></video>
+        <video wx:if="{{videoLoad}}" id="worksVideo" class="videoSection" src="{{videoSrc}}" bindplay="videoPlay" bindtimeupdate="videoTimeupdate" bindprogress="videoProgress" bindwaiting="videoWaiting" bindended="videoEnd" bindpause="videoPause" controls="false" enable-progress-gesture="{{gesture}}" show-fullscreen-btn="{{fullScreenBtn}}" show-play-btn="{{playBtn}}"></video>
     </view>
     <!-- <video wx:if="{{isIOS}}" id="worksVideo" class="videoSection" src="{{videoUrl}}" autoPlay="{{autoPlay}}" controls="{{controls}}" show-center-play-btn="{{centerBtn}}" show-fullscreen-btn="{{fullScreenBtn}}" show-play-btn="{{playBtn}}"></video> -->
-    <video wx:if="{{isIOS}}" id="worksVideo" class="videoSection" src="{{videoSrc}}" bindplay="videoPlay" bindended="videoEnd" bindpause="videoPause" controls="false" enable-progress-gesture="{{gesture}}" show-fullscreen-btn="{{fullScreenBtn}}" show-play-btn="{{playBtn}}"></video>
+    <video wx:if="{{isIOS}}" id="worksVideo" class="videoSection" src="{{videoSrc}}" bindplay="videoPlay" bindwaiting="videoWaiting" bindended="videoEnd" bindpause="videoPause" controls="false" enable-progress-gesture="{{gesture}}" show-fullscreen-btn="{{fullScreenBtn}}" show-play-btn="{{playBtn}}"></video>
     <view class="readAuthorSection">
         <image class="avatar" src="{{authorAvatar}}" bindtap="goToUsers" data-uid="{{authorUid}}" />
         <view class="profession" wx:if="{{authorProfession}}">{{authorProfession}}</view>
@@ -22,7 +22,7 @@
     <view class="userSection">
         <view class="peopleNum">
             <image class="peoplesIcon" src="../../../static/image/peoples.png" />
-            <view class="title">共有{{totalRead}}人完成了录音</view>
+            <view class="title">共有{{totalRead}}个录音作品</view>
         </view>
         <scroll-view scroll-x class="scrollWrapper" scroll-with-animation="true">
             <view class="avatarRow">
@@ -33,7 +33,7 @@
         </scroll-view>
     </view>
     <view class="commentSection">
-        <view class="title">评论({{total}})</view>
+        <view class="title">评论({{total || 0}})</view>
         <input class="commentInput" bindconfirm="sendHandler" value="{{inputValue}}" confirm-type="send" placeholder="听了这么多,说点什么吧" bindinput="inputValue"></input>
     </view>
     <view class="commentArea">
@@ -47,22 +47,23 @@
                 <text class="time">{{item.time}}</text>
                 <view class="gut">
                     <text class="gutInGut">{{item.text}}</text>
-                    <text wx:if="{{item.text.length >=10}}" class="whole" bindtap="goToDetail" data-id="{{item.id}}">全文
-                    </text>
+                    <text wx:if="{{item.text.length >=10}}" class="whole" bindtap="goToDetail" data-id="{{item.id}}">全文</text>
                 </view>
                 <view class="commentAll" bindtap="goToDetail" data-id="{{item.id}}" wx:if="{{item.replyCount}}">
-                    共有{{item.replyCount}}条评论
+                    <text>共有{{item.replyCount}}条评论</text>
                 </view>
             </view>
             <view class="btnWrapper">
                 <!-- <image class="commentBtn" src="../../../static/image/comment.png" bindtap="goToDetail" data-count="{{item.replyCount}}" data-id="{{item.id}}" data-index="{{index}}" />
                 <text class="commentText" bindtap="goToDetail" data-id="{{item.id}}" data-count="{{item.replyCount}}" data-index="{{index}}">评论</text> -->
-                <image class="likeBtn" src="{{item.isLike? '../../../static/image/point.png' : '../../../static/image/like.png'}}" data-index="{{index}}" data-likes="{{item.likes}}" data-id="{{item.id}}" bindtap="{{item.isLike? null:'likeCommend'}}" />
-                <text class="likeText" data-index="{{index}}" data-likes="{{item.likes}}" data-id="{{item.id}}" bindtap="{{item.isLike? null:'likeCommend'}}">{{item.likes}}
-                </text>
-                <image class="commentBtn" src="../../../static/image/comment.png" bindtap="goToDetail" data-id="{{item.id}}" data-index="{{index}}" />
-                <text class="commentText" bindtap="goToDetail" data-id="{{item.id}}" data-index="{{index}}">回复
-                </text>
+                <view class="hotAreaBigBigBig" bindtap="{{item.isLike? null:'likeCommend'}}" data-index="{{index}}" data-likes="{{item.likes}}" data-id="{{item.id}}">
+                    <image class="likeBtn" src="{{item.isLike? '../../../static/image/point.png' : '../../../static/image/like.png'}}" />
+                    <text class="likeText">{{item.likes}}</text>
+                </view>
+                <view class="hotAreaBigBigBig" bindtap="goToDetail" data-id="{{item.id}}" data-index="{{index}}">
+                    <image class="commentBtn" src="../../../static/image/comment.png" />
+                    <text class="commentText">回复</text>
+                </view>
             </view>
         </view>
     </view>
@@ -88,7 +89,7 @@
     <!-- 分享框 -->
     <!-- <canvas canvas-id="myCanvas" style="width:750rpx;z-index=99999; height: 1334rpx;"></canvas> -->
     <canvas canvas-id="myCanvas" style="width:375px;z-index=99999; height: 667px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
-    <shareDialog id="share-dialog" shareType='works' shareId="{{id}}" />
+    <shareDialog id="share-dialog" shareType='works' bindShareDialogClose="shareDialogClose" shareId="{{id}}" />
     <!-- 评论框 -->
     <view class="replySection" wx:if="{{replyModal}}">
         <input bindblur="bindTextAreaBlur" bindconfirm="replySB" confirm-type="send" placeholder="回复" bindinput="inputSBValue" auto-focus auto-height />
@@ -124,4 +125,7 @@
     <goBackHome id="goBackHome" shareType="{{goBackHome}}" wx:if="{{goBackHome}}" />
     <MyToast bindShowAlert="showAlert" wx:if="{{alertFlag}}" />
     <myModal id="myModal" btnText="{{modalBtnText}}" type="{{modalType}}" isCloseShow="{{modalCloseShow}}" text="{{modalText}}" wx:if="{{isModalShow}}" bindconfirm="modalConfirmHandler" bindclose="modalCloseHandler" />
+    <view hidden="{{hide}}">
+        <Dialog bindmyevent="jurisdiction" />
+    </view>
 </view>

+ 20 - 11
pages/social/works/works.wxss

@@ -1,3 +1,9 @@
+.noScroll{
+    width: 100%;
+    height: 100%;
+    overflow: hidden;
+}
+
 .videoSection {
     width: 750rpx;
     height: 421.9rpx;
@@ -11,7 +17,7 @@
     left: 0;
     right: 0;
     margin: 0 auto;
-    z-index: 99999;
+    z-index: 9999;
     top: 136rpx;
 }
 
@@ -31,7 +37,8 @@
     align-items: center;
     border-bottom: solid 2rpx #f0f1f5;
     position: relative;
-
+    margin-bottom: 22rpx;
+    padding-bottom: 22rpx
 }
 
 .readAuthorSection .avatar {
@@ -50,12 +57,12 @@
     border: 2rpx solid rgba(255, 255, 255, 1);
     font-size: 16rpx;
     /* font-family: PingFangSC-Medium; */
-    font-weight: 500;
+    /* font-weight: 500; */
     color: rgba(255, 255, 255, 1);
     line-height: 24rpx;
     text-align: center;
     position: absolute;
-    bottom: 4rpx;
+    bottom: 26rpx;
     left: 44rpx;
 }
 
@@ -171,7 +178,7 @@
 
 .commentSection {
     width: 100%;
-    height: 180rpx;
+    height: 158rpx;
 }
 
 .commentSection .title {
@@ -238,7 +245,7 @@
     border: 2rpx solid rgba(255, 255, 255, 1);
     font-size: 16rpx;
     /* font-family: PingFangSC-Medium; */
-    font-weight: 500;
+    /* font-weight: 500; */
     color: rgba(255, 255, 255, 1);
     line-height: 24rpx;
     text-align: center;
@@ -284,12 +291,10 @@
 }
 .commentItem .commentAll {
     margin-top: 10rpx;
-    width: 263rpx;
-    height: 50rpx;
-    background: #f0f1f5;
+    height: 44rpx;
     font-size: 32rpx;
     color: #61ca54;
-    text-indent: 20rpx;
+    
     border-radius: 12rpx;
 }
 
@@ -301,7 +306,11 @@
     align-items: center;
     /* width: 200rpx; */
 }
-
+.btnWrapper .hotAreaBigBigBig{
+    display: flex;
+    align-items: center;
+    margin-left: 8rpx;
+}
 .btnWrapper .commentBtn {
     width: 32rpx;
     height: 30rpx;

+ 3 - 0
pages/user/myEdit/myEdit.js

@@ -40,6 +40,9 @@ Page({
   },
   formSubmit: function (e) {
     console.log(e.detail.value)
+    if(e.detail.value.nickname === ''){
+      return false
+    }
     // const uid = wx.getStorageSync('uid');
     const data = {
       wechatName: e.detail.value.nickname || '',

+ 32 - 21
pages/user/mycollection/mycollection.wxss

@@ -1,50 +1,61 @@
-.my-collection{
+.my-collection {
   width: 750rpx;
+  min-height: 100%;
+  background: rgba(240, 241, 245, 1);
+  padding-top: 22rpx;
   /* background: #F0F1F5; */
 }
-.collection-article{
-  margin-bottom: 4rpx;
-  box-sizing: border-box;
-  width: 100%;
-  padding: 0 23rpx;
-  background: #FFFFFF;
+
+.collection-article {
+  position: relative;
+  overflow: hidden;
+  width: 720rpx;
+  height: 374rpx;
+  background: #fff;
+  border-radius: 12rpx;
+  margin: 0 auto 20rpx;
+
 }
 
-.video-preview{
-  padding-top: 16rpx;
-  width: 100%;
-  height: 290rpx;
+.video-preview {
+  display: block;
+  width: 662rpx;
+  height: 272rpx;
+  margin: 26rpx auto 0;
   border-radius: 20rpx;
+
 }
 
-.video-preview>image{
+.video-preview>image {
   width: 100%;
   height: 100%;
   border-radius: 20rpx;
 }
 
-.content-title{
+.content-title {
   margin-top: 10rpx;
-  width:80%;
+  width: 77%;
   height: 52rpx;
   font-size: 32rpx;
-  color: #414141;
-  display:inline-block;
+  color: #444;
+  display: inline-block;
+  padding-left: 14rpx;
+
 
 }
 
-.content-detail{
+.content-detail {
   /* width: 100%; */
-  
+
   height: 50rpx;
   display: flex;
   justify-content: space-between;
   align-items: center;
   font-size: 24rpx;
-  display:inline-block;
+  display: inline-block;
 
 }
 
-.left{
+.left {
   /* width: 200rpx; */
-}
+}

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

@@ -24,5 +24,5 @@
       </view>
     </view>
   </view>
-  <myPlacerholder class="placerholder" imageShow="{{imageShow}}" line1="{{line1}}" line2="{{line2}}" wx:if="{{fanList.length <= 1}}" />        
+  <!-- <myPlacerholder class="placerholder" imageShow="{{imageShow}}" line1="{{line1}}" line2="{{line2}}" wx:if="{{fanList.length <= 1}}" />         -->
 </view>

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

@@ -34,7 +34,7 @@ page {
   border: 2rpx solid rgba(255, 255, 255, 1);
   font-size: 16rpx;
   /* font-family: PingFangSC-Medium; */
-  font-weight: 500;
+  /* font-weight: 500; */
   color: rgba(255, 255, 255, 1);
   line-height: 24rpx;
   text-align: center;

+ 1 - 1
pages/user/mycourse/mycourse.wxss

@@ -7,7 +7,7 @@
 }
 
 .book-item{
-  margin-left: 20rpx;
+  margin-left: 28rpx;
   margin-bottom: 20rpx;
   width: 214rpx;
 }

+ 32 - 8
pages/user/myread/myread.wxml

@@ -1,7 +1,7 @@
 <wxs src="../../commonWxs/format.wxs" module="format" />
 <view class='my-read'>
-  <view class='read-article' wx:for="{{ wareCards }}" wx:key="{{ index }}" bindtap='toWork' data-lessonId='{{ item.id }}' data-title='{{ item.title }}'>
-    <view class='user-info'>
+  <view class='worksCard' wx:for="{{ wareCards }}" wx:key="{{ index }}" bindtap='toWork' data-lessonId='{{ item.id }}' data-title='{{ item.title }}'>
+    <!-- <view class='user-info'>
       <view class='avatar-box'>
         <image class='avatar-image' src="{{ user.user.avatar }}" />
       </view>
@@ -13,9 +13,7 @@
     <view class='video-preview'>
       <image src='{{ item.iconImg }}'></image>
     </view>
-    <view class='content-title'>
-      {{ item.title }}
-    </view>
+    <view class='content-title'>{{ item.title }}</view>
     <view class='content-detail'>
       <view class='left'>{{ item.summary }}</view>
       <view class='right'>
@@ -32,7 +30,33 @@
           <view class='count-add'>{{ item.likeAmount || 0 }}</view>
         </view>
       </view>
-    </view> 
+    </view> -->
+    <view class="topData">
+      <view class="worksLeft">
+        <image class="authorAvatar" lazy-load="true" src="{{user.user.avatar}}" />
+        <view class="profession" wx:if="{{item.profession}}">{{user.user.profession}}</view>
+        <view class="worksInfo">
+          <view class="authorName">{{user.user.wechatName}}</view>
+          <view class="time">{{format.formatDate(item.gmtCreated)}}</view>
+        </view>
+      </view>
+      <view class="numberInfo">
+          <view class="wareCardPlays">
+            <text>{{item.playAmount || 0}}</text>
+            <image class="wareCardPlaysImg" lazy-load="true" src="../../../static/image/hotPlays.png" />
+          </view>
+          <view class="wareCardLikes">
+            <text>{{item.likeAmount || 0}}</text>
+            <image class="wareCardLikesImg" lazy-load="true" src="../../../static/image/like.png" />
+          </view>
+        </view>
+    </view>
+    <image class="wareCardImg" src="{{item.iconImg}}" />
+    <view class="titleSummary">
+      <text class="wareCardTitle">{{item.title}}</text>
+      <text class="wareCardTip">{{item.summary}}</text>
+    </view>
+    <!-- </view> -->
   </view>
-   <myPlacerholder line1="{{line1}}" line2="{{line2}}" wx:if="{{wareCards.length <= 0}}" />  
-</view>
+  <myPlacerholder line1="{{line1}}" line2="{{line2}}" wx:if="{{wareCards.length <= 0}}" />
+</view>

+ 118 - 122
pages/user/myread/myread.wxss

@@ -1,175 +1,171 @@
 .my-read{
-  width: 750rpx;
-  /* background: #F0F1F5; */
-}
-
-.user-info{
   width: 100%;
-  height: 132rpx;
-  display: flex;
-  justify-content: flex-start;
-  align-items: center;
-}
+    /* height: 50rpx; */
+    /* background: #fff; */
+    background: rgba(240, 241, 245, 1);
+    min-height: 100%;
+    padding-bottom:20rpx;
+    padding-top:22rpx;
 
-.avatar-image{
-  width: 100%;
-  height: 100%;
-  border-radius: 50%;
 }
 
-.avatar-box{
-  width: 96rpx;
-  height: 96rpx;
-  border-radius: 50%;
+.worksCard {
+  position: relative;
+  overflow: hidden;
+  width: 720rpx;
+  height: 476rpx;
+  background: #fff;
+  /* padding: 26rpx; */
+  border-radius: 12rpx;
+  /* margin: 0 0 18rpx 16rpx; */
+  margin: 0 auto 20rpx;
+  /* box-shadow: 0 8rpx 6rpx 0 rgba(0, 0, 0, .28); */
 }
 
-.avatar-name{
-  width: 420rpx;
-  height: 80rpx;
-  font-size: 32rpx;
-  color: #444444;
-  margin-left: 14rpx;
-  margin-bottom: 16rpx;
-}
 
-.avatar-follow{
-  margin-left:30rpx;
-  display:flex;
-  flex-direction:column;
-  align-items:center;
-  width:100rpx;
-
-}
 
-.avatar-img{
-  width: 46rpx;
-  height: 40rpx;
+.worksCard .wareCardImg {
+  display: block;
+  width: 662rpx;
+  height: 272rpx;
+  margin: 22rpx auto 0;
+  border-radius: 20rpx;
 }
 
-.avatar-images{
-  width: 100%;
-  height: 100%;
+.worksCard .titleSummary {
+  display: flex;
+  justify-content: space-between;
+  margin-top: 12rpx;
 }
 
-
-
-
-.read-article{
-  margin-bottom: 4rpx;
-  box-sizing: border-box;
-  width: 100%;
-  padding: 0 23rpx;
-  background: #FFFFFF;
+.worksCard .wareCardTitle {
+  /* margin: 0 auto; */
+  width: 80%;
+  height: 46rpx;
+  display: block;
+  /* text-align: left; */
+  color: #444;
+  font-size: 32rpx;
+  /* letter-spacing: 4rpx; */
+  margin-left: 28rpx;
+  font-family: MicrosoftYaHei;
 }
 
-.read-top{
-  width: 100%;
-  height: 120rpx;
+.worksCard .topData {
+  height: 92rpx;
+  margin-top: 22rpx;
   display: flex;
+  flex-direction: row;
+  /* justify-content: space-between; */
   align-items: center;
 }
 
-.top-img{
-  margin-right: 14rpx;
-  width: 96rpx;
-  height: 96rpx;
-  border-radius: 50%;
-}
+.worksLeft {
+  display: flex;
+  flex-direction: row;
+  flex: 1;
+  margin-left: 10rpx;
 
-.top-img>image{
-  width: 100%;
-  height: 100%;
-  border-radius: 50%;
 }
 
-.read-info{
-  width: 580rpx;
+.worksLeft .worksInfo .authorName {
+  color: #444444;
   font-size: 32rpx;
-  margin-bottom: 10rpx;
-}
+  margin-top: 8rpx;
 
-.read-info>.title{
-  color: #000000;
-  font-weight: 500;
 }
 
-.read-info>.date{
+.worksLeft .worksInfo .time {
   color: #686868;
-  font-weight: lighter;
-}
+  font-size: 28rpx;
 
-.video-preview{
-  /* margin-top: 16rpx; */
-  width: 100%;
-  height: 290rpx;
-  border-radius: 20rpx;
 }
 
-.video-preview>image{
-  width: 100%;
-  height: 100%;
-  border-radius: 20rpx;
-}
+.worksCard .topData .wareCardPlays {
+  width: 100rpx;
+  /* margin-left: 270rpx; */
+  display: flex;
+  flex-direction: row-reverse;
+  align-items: center;
+  padding-right: 35rpx;
 
-.content-title{
-  margin-top: 10rpx;
-  width: 100%;
-  height: 50rpx;
-  font-size: 32rpx;
-  font-weight: 500;
-  color: #444;
 }
 
-.content-detail{
-  width: 100%;
-  height: 35rpx;
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  font-size: 24rpx;
-  color: #444;
+.worksCard .topData .authorAvatar {
+  width: 92rpx;
+  height: 92rpx;
+  margin: 0 22rpx 0 22rpx;
+  display: block;
+  border: 4rpx solid #61CA54;
+  border-radius: 50%;
 }
 
-.left{
-  width: 200rpx;
-  margin-left:10rpx;
+.worksCard .topData .profession {
+  width: 68rpx;
+  height: 24rpx;
+  background: rgba(97, 202, 84, 1);
+  border-radius: 166rpx;
+  border: 2rpx solid rgba(255, 255, 255, 1);
+  font-size: 16rpx;
+  /* font-family: PingFangSC-Medium; */
+  /* font-weight: 500; */
+  color: rgba(255, 255, 255, 1);
+  line-height: 24rpx;
+  text-align: center;
+  position: absolute;
+  bottom: -7rpx;
+  left: 37rpx;
 
 }
 
-.right{
-  height: 100%;
+.topData .numberInfo {
   display: flex;
-  justify-content: space-between;
-  align-items: center;
+  flex-direction: column;
 }
 
-.right image{
-  width: 100%;
-  height: 100%;
-}
-
-.play-img{
-  width:24rpx;
-height:22rpx;
+.worksCard .wareCardTip {
+  width: 178rpx;
+  height: 40rpx;
+  display: block;
+  text-align: left;
+  color: #444;
+  font-size: 24rpx;
+  line-height: 44rpx;
 
 }
 
-.point-img{
+.worksCard .wareCardPlays .wareCardPlaysImg {
   width: 26rpx;
-  height: 24rpx;
+  height: 26rpx;
+  margin-right: 6rpx;
+  float: right;
 }
 
-.count-add{
-  width: 36rpx;
-  text-align: center;
+.worksCard .wareCardPlays text {
+  margin-left: 4rpx;
+  color: #5e5e5e;
+  font-size: 22rpx;
+  text-align: right;
+  /* width:57%; */
+  float: right;
 }
 
-.right-detail,.right-details{
+.worksCard .wareCardLikes {
+  width: 100rpx;
+  margin-right: 18rpx;
   display: flex;
-  justify-content: flex-end;
-  align-items: flex-start;
+  flex-direction: row-reverse;
+  align-items: center;
+}
+
+.worksCard .wareCardLikes .wareCardLikesImg {
+  width: 26rpx;
+  height: 24rpx;
+  margin-right: 6rpx;
 }
 
-.right-details{
-  margin-left: 20rpx;
+.worksCard .wareCardLikes text {
+  margin-left: 4rpx;
+  color: #FF9800;
+  font-size: 24rpx;
 }

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

@@ -45,7 +45,7 @@
         <view class='color' style="padding-right:48rpx;">{{ wareCards.fansAmount || 0 }}</view>
         <view class='border-right'>
           <view class='red-heart'>
-            <image src='../../../static/image/fully_heart.png'></image>
+            <image src='../../../static/image/purple_heart.png'></image>
           </view>
           <text>关注</text>
         </view>

+ 7 - 6
pages/user/myworks/myworks.wxss

@@ -102,7 +102,7 @@ height:58rpx;
 
 .occupation-title{
   position: absolute;
-  left: 48rpx;
+  left: 44rpx;
   bottom: -10rpx;
   width: 68rpx;
   height: 26rpx;
@@ -150,7 +150,7 @@ height:58rpx;
   padding-top: 30rpx;
   border-top: 4rpx solid #F0F1F5;
   font-size: 28rpx;
-  font-weight: 600;
+  /* font-weight: 600; */
   z-index: 900;
   display: flex;
   position: absolute;
@@ -220,7 +220,7 @@ image {
 }
 
 .follow-count {
-  color: #FF0000;
+  color: #F466FF;
 }
 
 .flower-count {
@@ -242,6 +242,7 @@ image {
   display: flex;
   align-items: center;
   font-size:32rpx;
+  padding-top:22rpx;
 }
 
 .user-img{
@@ -269,12 +270,13 @@ image {
   display: flex;
   justify-content: space-between;
   align-items: flex-end;
-  color: #444;
+  color: #414141;
 }
 
 .left-detail{
   width: 500rpx;
   font-size: 32rpx;
+  color:#414141
 }
 
 .right-detail{
@@ -283,6 +285,7 @@ image {
   font-size: 22rpx;
   flex-direction:row-reverse;
 margin-right: 6rpx;
+color:#444
 }
 
 .user-time{
@@ -291,7 +294,6 @@ margin-right: 6rpx;
 }
 
 .video-preview{
-  margin-top: 10rpx;
   width: 100%;
   height: 290rpx;
   border-radius: 20rpx;
@@ -311,7 +313,6 @@ margin-right: 6rpx;
   justify-content: space-between;
   align-items: center;
   font-size: 32rpx;
-  font-weight: 500;
   color: #414141;
 }
 

+ 9 - 26
project.config.json

@@ -39,41 +39,24 @@
 			"current": 2,
 			"list": [
 				{
-					"id": -1,
-					"name": "课程详情",
-					"pathName": "pages/social/works/works",
-					"query": "id=1541877751982865&title=【课文5】影子"
-				},
-				{
-					"id": -1,
-					"name": "团购分享",
-					"pathName": "pages/groupPage/collage-details/collage-details",
-					"query": "orderId=1542621051065701"
-				},
-				{
-					"id": 2,
-					"name": "团购分享",
+					"id": 0,
+					"name": "团购",
 					"pathName": "pages/groupPage/group-details/group-details",
-					"query": "shareId=1544436540903097&share=true",
+					"query": "productId=1544780663806827",
 					"scene": "1012"
 				},
 				{
-					"id": -1,
+					"id": 1,
 					"name": "1",
 					"pathName": "pages/social/works/works",
-					"query": "id=1542687807564957&title=【课文1】小蝌蚪找妈妈"
-				},
-				{
-					"id": 4,
-					"name": "make money",
-					"pathName": "pages/groupPage/make-money/make-money",
-					"query": "productId=1&id=1544436540903097&groupId=2"
+					"query": "id=1544608002793997&title=【课文2】小小的船&shareCard=true"
 				},
 				{
 					"id": -1,
-					"name": "团购",
-					"pathName": "pages/groupPage/group-details/group-details",
-					"query": "productId=1544097403956625"
+					"name": "作品",
+					"pathName": "pages/social/works/works",
+					"query": "id=1544781565949256&title=【课文2】小小的船&shareCard=true",
+					"scene": "1012"
 				}
 			]
 		}

BIN
static/image/goBackHome.png


+ 11 - 11
utils/APIClient.js

@@ -55,7 +55,8 @@ module.exports = {
   },
   // 获取单课详情
   getClassDetail(uid, id) {
-    let url = getProductUrl(`wx/lesson/${id}`);
+    // let url = getProductUrl(`wx/lesson/${id}`);
+    let url = getProductUrl(`wx/lesson/info/${id}`);
     return request.getInstance().header({
       uid
     }).url(url).send();
@@ -67,12 +68,6 @@ module.exports = {
       uid
     }).url(url).data(data).send();
   },
-  getClassDetail(uid, id) {
-    let url = getProductUrl(`wx/lesson/${id}`);
-    return request.getInstance().header({
-      uid
-    }).url(url).send();
-  },
   // 获取单课朗读信息
   getClassRead(uid, data) {
     let url = getBaseUrl(`wx/userRead`);
@@ -216,12 +211,15 @@ module.exports = {
     }).url(url).data(data).method('POST').send();
   },
   // 参加团购
-  JoinGroupPurchas(orderId) {
+  JoinGroupPurchas(orderId,formId) {
+    console.log(formId)
+    console.log(orderId)
     let url = getBaseUrl(`wx/groupPurchase/join`);
     return request.getInstance().header({
       uid: wx.getStorageSync('uid')
     }).url(url).data({
-      orderId
+      orderId,
+      formId
     }).method('POST').send();
   },
   // 收藏课程
@@ -335,11 +333,13 @@ module.exports = {
     }).url(url).send();
   },
   // 课程鉴权
-  areYouSuper(productArr) {
+  areYouSuper(productId) {
     let url = getBaseUrl(`wx/groupPurchase/auth`);
     return request.getInstance().header({
       uid: wx.getStorageSync('uid')
-    }).url(url).data(productArr).method('POST').send();
+    }).url(url).data({
+      productId
+    }).send();
   },
   // // 课本鉴权
   // areYouBookSuper(productArr){

+ 4 - 2
utils/httpUtil.js

@@ -14,7 +14,8 @@ function wxLogin(successcallback, failcallback) {
     wx.showToast({
         title: '登录中...',
         icon: 'loading',
-        duration: 1500
+        duration: 1500,
+        mask:true
     })
     wx.login({  
         success: function(res) {
@@ -50,7 +51,8 @@ function getLoginSchedule(sessionKey, openId, successcallback, failcallback) {
                       wx.showToast({
                           title: '登录成功',
                           icon: 'success',
-                          duration: 1500
+                          duration: 1500,
+                          mask: true
                       })
                       wx.setStorageSync('uid', res.data.data.data.uid)
                       wx.setStorageSync('user', res.data.data.data)

+ 6 - 1
utils/util.js

@@ -12,6 +12,10 @@ const lastHours = date => {
 	let m = parseInt((date % (1000 * 60 * 60)) / (1000 * 60));
 	return h + '小时' + m + '分'
 }
+const addThreeYears = date => {
+		const t = date + (31536000000 * 3)
+		return formatDate(t,4)
+}
 const lastHoursInGroup = date => {
 	// const temp = [];
 	let h = parseInt((date % (1000 * 60 * 60 * 72 )) / (1000 * 60 * 60));
@@ -54,5 +58,6 @@ module.exports = {
 	formatDate,
 	GetQueryString,
 	lastHours,
-	lastHoursInGroup
+	lastHoursInGroup,
+	addThreeYears
 }