Browse Source

我的关注 用户作品详情页 修改

dongyuan0658 6 years ago
parent
commit
8adc1034eb
87 changed files with 1397 additions and 659 deletions
  1. 15 32
      app.js
  2. 2 1
      app.json
  3. 1 1
      app.wxss
  4. 5 2
      component/dialog/dialog.wxml
  5. 41 2
      component/dialog/dialog.wxss
  6. 31 0
      component/goBackHome/goBackHome.js
  7. 4 0
      component/goBackHome/goBackHome.json
  8. 3 0
      component/goBackHome/goBackHome.wxml
  9. 12 0
      component/goBackHome/goBackHome.wxss
  10. 19 5
      component/group/group.js
  11. 2 2
      component/group/group.wxml
  12. 17 3
      component/group/group.wxss
  13. 26 19
      component/hot/hot.js
  14. 36 29
      component/hot/hot.wxml
  15. 226 21
      component/hot/hot.wxss
  16. 3 7
      component/my/my.js
  17. 4 4
      component/my/my.wxml
  18. 3 2
      component/popup/popup.js
  19. 5 5
      component/popup/popup.wxml
  20. 111 79
      component/share/share.js
  21. 7 6
      component/share/share.wxml
  22. 29 33
      component/share/share.wxss
  23. 44 17
      pages/groupPage/collage-details/collage-details.js
  24. 7 4
      pages/groupPage/collage-details/collage-details.wxml
  25. 15 1
      pages/groupPage/collage-details/collage-details.wxss
  26. 18 2
      pages/groupPage/discount-group/discount-group.js
  27. 1 1
      pages/groupPage/discount-group/discount-group.wxml
  28. 18 7
      pages/groupPage/grade-details/grade-details.js
  29. 16 4
      pages/groupPage/grade-details/grade-details.wxml
  30. 5 1
      pages/groupPage/grade-details/grade-details.wxss
  31. 58 25
      pages/groupPage/group-details/group-details.js
  32. 3 1
      pages/groupPage/group-details/group-details.json
  33. 11 6
      pages/groupPage/group-details/group-details.wxml
  34. 22 3
      pages/groupPage/group-details/group-details.wxss
  35. 25 5
      pages/groupPage/make-money/make-money.js
  36. 6 2
      pages/groupPage/make-money/make-money.wxml
  37. 24 0
      pages/groupPage/make-money/make-money.wxss
  38. 133 84
      pages/groupPage/my-group/my-group.js
  39. 5 3
      pages/groupPage/my-group/my-group.wxml
  40. 8 0
      pages/groupPage/my-group/my-group.wxss
  41. 39 22
      pages/index/index.js
  42. 4 3
      pages/index/index.wxss
  43. 44 13
      pages/main/class/class.js
  44. 2 1
      pages/main/class/class.json
  45. 11 5
      pages/main/class/class.wxml
  46. 51 14
      pages/main/class/class.wxss
  47. 1 1
      pages/main/week/week.wxml
  48. 8 0
      pages/main/week/week.wxss
  49. 5 2
      pages/social/replyDetail/replyDetail.js
  50. 104 28
      pages/social/works/works.js
  51. 6 2
      pages/social/works/works.json
  52. 18 12
      pages/social/works/works.wxml
  53. 31 7
      pages/social/works/works.wxss
  54. 1 1
      pages/user/myEdit/myEdit.js
  55. 1 1
      pages/user/myWallet/myWallet.js
  56. 0 1
      pages/user/mycourse/mycourse.js
  57. 0 1
      pages/user/myread/myread.js
  58. 1 74
      pages/user/myworks/myworks.js
  59. 9 6
      pages/user/myworks/myworks.wxml
  60. 9 45
      project.config.json
  61. BIN
      static/groupImg/Preservation.png
  62. BIN
      static/groupImg/circle.png
  63. BIN
      static/groupImg/faqiren.png
  64. BIN
      static/groupImg/jiang.png
  65. BIN
      static/groupImg/share.png
  66. BIN
      static/groupImg/weixin.png
  67. BIN
      static/image/bonus.png
  68. BIN
      static/image/boy.png
  69. BIN
      static/image/collected.png
  70. BIN
      static/image/course.png
  71. BIN
      static/image/empty_heart.png
  72. BIN
      static/image/fully_heart.png
  73. BIN
      static/image/goBackHome.png
  74. BIN
      static/image/group_poster.jpg
  75. BIN
      static/image/hot_recommend.png
  76. BIN
      static/image/like.png
  77. BIN
      static/image/listen.png
  78. BIN
      static/image/microphone.png
  79. BIN
      static/image/reading_poster.jpg
  80. BIN
      static/image/red_like.png
  81. BIN
      static/image/red_like_empty.png
  82. BIN
      static/image/search_new.png
  83. BIN
      static/image/share.png
  84. BIN
      static/image/timg.jpg
  85. BIN
      static/image/works_poster.png
  86. 23 0
      utils/APIClient.js
  87. 8 1
      utils/util.js

+ 15 - 32
app.js

@@ -1,39 +1,22 @@
 //app.js
 //app.js
+import {GetQueryString} from 'utils/util'
 App({
 App({
-  onLaunch: function () {
-    // 展示本地存储能力
-    var logs = wx.getStorageSync('logs') || []
-    logs.unshift(Date.now())
-    wx.setStorageSync('logs', logs)
-
-    // 登录
-    wx.login({
-      success: res => {
-        // 发送 res.code 到后台换取 openId, sessionKey, unionId
-      }
-    })
-    // 获取用户信息
-    wx.getSetting({
-      success: res => {
-        if (res.authSetting['scope.userInfo']) {
-          // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
-          wx.getUserInfo({
-            success: res => {
-              // 可以将 res 发送给后台解码出 unionId
-              this.globalData.userInfo = res.userInfo
-
-              // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
-              // 所以此处加入 callback 以防止这种情况
-              if (this.userInfoReadyCallback) {
-                this.userInfoReadyCallback(res)
-              }
-            }
-          })
+  onLaunch: function (options) {
+   // 判断设备是否为 iPhone X
+   this.checkIsIPhoneX()
+  },
+  globalData: {
+    isIPX: false, // 当前设备是否为 iPhone X
+  },
+  checkIsIPhoneX: function() {
+    const self = this
+    wx.getSystemInfo({
+      success: function (res) {
+        // 根据 model 进行判断
+        if (res.model.search('iPhone X') != -1) {
+          self.globalData.isIPX = true
         }
         }
       }
       }
     })
     })
-  },
-  globalData: {
-    userInfo: null
   }
   }
 })
 })

+ 2 - 1
app.json

@@ -29,7 +29,8 @@
     "navigationBarTitleText": "小学语文朗读配音",
     "navigationBarTitleText": "小学语文朗读配音",
     "navigationBarTextStyle": "white",
     "navigationBarTextStyle": "white",
     "backgroundColor": "#61CA54",
     "backgroundColor": "#61CA54",
-    "onReachBottomDistance": 50
+    "onReachBottomDistance": 50,
+    "enablePullDownRefresh": true
   },
   },
   "debug": false
   "debug": false
 }
 }

+ 1 - 1
app.wxss

@@ -7,7 +7,7 @@ page {
 .container {
 .container {
   height: 100%;
   height: 100%;
   box-sizing:border-box;
   box-sizing:border-box;
-  padding-top: 80rpx;
+  padding-top: 70rpx;
  
  
 } 
 } 
 ::-webkit-scrollbar{
 ::-webkit-scrollbar{

+ 5 - 2
component/dialog/dialog.wxml

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

+ 41 - 2
component/dialog/dialog.wxss

@@ -16,15 +16,54 @@
     bottom: 0;
     bottom: 0;
     right: 0;
     right: 0;
     width: 80%;
     width: 80%;
-    height: 200rpx;
+    height: 470rpx;
     background: #fff;
     background: #fff;
     margin: auto;
     margin: auto;
     border-radius: 20rpx;
     border-radius: 20rpx;
     text-align: center;
     text-align: center;
-    padding: 0 40rpx;
     box-sizing: border-box;
     box-sizing: border-box;
     display: flex;
     display: flex;
     flex-direction: column;
     flex-direction: column;
     justify-content: space-around;
     justify-content: space-around;
+    align-items: center;
     font-size: 32rpx;
     font-size: 32rpx;
 }
 }
+
+.title {
+    font-size: 36rpx;
+    width: 100%;
+    border-bottom: 2rpx solid #ccc;
+    padding: 28rpx 0;
+}
+
+.head-bg {
+    width: 72rpx;
+    height: 72rpx;
+    border-radius: 50%;
+}
+
+.text {
+    font-size: 28rpx;
+    width: 80%;
+    border-bottom: 2rpx solid #ccc;
+    padding: 14rpx 0;
+}
+
+.shuoming {
+    font-size: 28rpx;
+    width: 100%;
+    border-bottom: 2rpx solid #ccc;
+    padding: 14rpx 0 46rpx 0;
+}
+
+.btn {
+    margin: 0;
+    padding: 0;
+    font-size: 36rpx;
+    color: #16B016;
+    background: #fff;
+}
+
+.btn::after {
+    border: none;
+}

+ 31 - 0
component/goBackHome/goBackHome.js

@@ -0,0 +1,31 @@
+// compontents/dialog/dialog.js
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+        show: {
+            type: 'Boolean',
+            value: false
+          },
+    },
+  
+    /**
+     * 组件的初始数据
+     */
+    data: {
+    //   show: false
+    },
+  
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        goBackHome: function(){
+            wx.redirectTo({
+                url: '../../index/index'
+            })
+      }
+    }
+  })
+  

+ 4 - 0
component/goBackHome/goBackHome.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+  }

+ 3 - 0
component/goBackHome/goBackHome.wxml

@@ -0,0 +1,3 @@
+<view class="goBackHome" bindtap="goBackHome" >
+    <image src="../../static/image/goBackHome.png" />
+</view>

+ 12 - 0
component/goBackHome/goBackHome.wxss

@@ -0,0 +1,12 @@
+.goBackHome {
+    width: 100rpx;
+    height: 100rpx;
+    position: fixed;
+    bottom: 168rpx;
+    right: 45rpx;
+
+}
+.goBackHome image{
+    width: 100%;
+    height: 100%;
+}

+ 19 - 5
component/group/group.js

@@ -1,18 +1,20 @@
 import httpRequestApi from '../../utils/APIClient';
 import httpRequestApi from '../../utils/APIClient';
+const app = getApp();
 export const groupInit = (that) => {
 export const groupInit = (that) => {
   that.setData({
   that.setData({
     groupData: {
     groupData: {
       recommendList: [],
       recommendList: [],
       bookList: [],
       bookList: [],
       sendGroupFlag: true,
       sendGroupFlag: true,
-      selectFlag: []
+      selectFlag: [],
+      isIPX: app.globalData.isIPX
     }
     }
   })
   })
   //请求数据封装
   //请求数据封装
   that.getGroupList = function () {
   that.getGroupList = function () {
     httpRequestApi.getGroupList().success( (res) => {
     httpRequestApi.getGroupList().success( (res) => {
       console.log('推荐团购',res.data.data)
       console.log('推荐团购',res.data.data)
-      that.data.groupData.recommendList = res.data.data;
+      that.data.groupData.recommendList = res.data.data.splice(0,6);
       that.setData({
       that.setData({
         groupData: that.data.groupData
         groupData: that.data.groupData
       })
       })
@@ -96,9 +98,21 @@ export const groupInit = (that) => {
     const productId = currentTarget.dataset.productid;
     const productId = currentTarget.dataset.productid;
     const id = currentTarget.dataset.id;
     const id = currentTarget.dataset.id;
     const groupId = currentTarget.dataset.groupid;
     const groupId = currentTarget.dataset.groupid;
-    wx.navigateTo({
-      url: `/pages/groupPage/group-details/group-details?productId=${productId}&id=${id}&groupId=${groupId}`
-    })
+    const ind = currentTarget.dataset.ind;
+    const groupType = that.data.groupData.recommendList[ind].groupType;
+      wx.navigateTo({
+        url: `/pages/groupPage/group-details/group-details?productId=${productId}&id=${id}&groupId=${groupId}`
+      })
+    // if(groupType === "PROMOTION") {
+    //   wx.navigateTo({
+    //     url: `/pages/groupPage/make-money/make-money?productId=${productId}&id=${id}&groupId=${groupId}`
+    //   })
+    // }else  {
+    //   wx.navigateTo({
+    //     url: `/pages/groupPage/group-details/group-details?productId=${productId}&id=${id}&groupId=${groupId}`
+    //   })
+    // }
+
   }
   }
   //跳转到课程详情
   //跳转到课程详情
   that.goToBook = function(e){
   that.goToBook = function(e){

+ 2 - 2
component/group/group.wxml

@@ -10,7 +10,7 @@
           </view>
           </view>
           <view class="group-box">
           <view class="group-box">
             <block wx:for="{{groupData.recommendList}}" wx:key="{{index}}">
             <block wx:for="{{groupData.recommendList}}" wx:key="{{index}}">
-              <view class="group-item" bindtap="groupDetail" data-id="{{item.id}}" data-productId="{{item.productId}}" data-groupId="{{item.groupId}}">
+              <view class="group-item" bindtap="groupDetail" data-ind="{{index}}" data-id="{{item.id}}" data-productId="{{item.productId}}" data-groupId="{{item.groupId}}">
                 <image class="item-img" src="{{item.iconImg}}"></image>
                 <image class="item-img" src="{{item.iconImg}}"></image>
                 <view>拼团价 <text>¥{{item.price / 100}}</text></view>
                 <view>拼团价 <text>¥{{item.price / 100}}</text></view>
                 <view>原价 <text style="text-decoration: line-through;">¥{{item.originPrice / 100}}</text></view>
                 <view>原价 <text style="text-decoration: line-through;">¥{{item.originPrice / 100}}</text></view>
@@ -39,7 +39,7 @@
           </view>
           </view>
         </view>
         </view>
     </scroll-view>
     </scroll-view>
-    <view class="Collage-bottom">
+    <view class="Collage-bottom {{groupData.isIPX ? 'Collage-bottomx' :''}}">
       <image class="bg" src="../../static/groupImg/Rectangle_9.png"></image>
       <image class="bg" src="../../static/groupImg/Rectangle_9.png"></image>
       <view bindtap="sendGroup">
       <view bindtap="sendGroup">
         <image src="../../static/groupImg/Shape1@2x.png"></image>
         <image src="../../static/groupImg/Shape1@2x.png"></image>

+ 17 - 3
component/group/group.wxss

@@ -23,6 +23,7 @@ scroll-view {
 .less-group,
 .less-group,
 .whole-group {
 .whole-group {
     width: 100%;
     width: 100%;
+    min-height: 60%;
     background: #fff;
     background: #fff;
 }
 }
 
 
@@ -65,14 +66,17 @@ scroll-view {
 
 
 .group-box {
 .group-box {
     display: flex;
     display: flex;
-    width: 100%;
+    width: 105%;
     flex-wrap: wrap;
     flex-wrap: wrap;
-    justify-content: space-between;
+    flex-direction: row;
+    /* justify-content: space-between; */
 }
 }
 
 
 .group-item {
 .group-item {
     position: relative;
     position: relative;
     display: flex;
     display: flex;
+    margin-right:35rpx;
+
     flex-direction: column;
     flex-direction: column;
 }
 }
 
 
@@ -134,6 +138,10 @@ scroll-view {
  position: relative;
  position: relative;
 }
 }
 
 
+.Collage-bottomx {
+    height: 82rpx;
+}
+
 .Collage-bottom view image {
 .Collage-bottom view image {
     width: 42rpx;
     width: 42rpx;
     height: 50rpx;
     height: 50rpx;
@@ -185,7 +193,13 @@ scroll-view {
     flex-wrap: wrap;
     flex-wrap: wrap;
     padding: 0 62rpx;
     padding: 0 62rpx;
 }
 }
-
+.group-list .group-item{
+    position: relative;
+    display: flex;
+    margin-right:0;
+    justify-content: space-between;
+    /* flex-direction: column; */
+}
 .group-content-img {
 .group-content-img {
     width: 214rpx;
     width: 214rpx;
     height: 290rpx;
     height: 290rpx;

+ 26 - 19
component/hot/hot.js

@@ -1,4 +1,7 @@
 import httpRequestApi from '../../utils/APIClient';
 import httpRequestApi from '../../utils/APIClient';
+import {
+  formatDate
+} from '../../utils/util';
 export const hotInit = (that) => {
 export const hotInit = (that) => {
   that.setData({
   that.setData({
       hotData: {
       hotData: {
@@ -15,7 +18,7 @@ export const hotInit = (that) => {
         circular: true,
         circular: true,
         hotWareCardFirst: 'hotWareCardFirst',
         hotWareCardFirst: 'hotWareCardFirst',
         hotWareCard: 'hotWareCard',
         hotWareCard: 'hotWareCard',
-        hotSearch: '鹅鹅鹅',
+        hotSearch: '',
         banner: [],
         banner: [],
         recommend: [],
         recommend: [],
         hotWorks: [],
         hotWorks: [],
@@ -112,24 +115,28 @@ export const hotInit = (that) => {
       pageSize
       pageSize
     ).success((res) => {
     ).success((res) => {
       console.log(res)
       console.log(res)
-        const recommendRes = res.data.data.list;
-        // const recommendWorks = [];
-        recommendRes.forEach(item => {
-          const temp = {};
-          temp.title = item.userRead.title;
-          temp.summary = item.userRead.summary;
-          temp.img = item.userRead.iconImg;
-          temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
-          temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
-          temp.classId = item.userRead.id;
-          // recommendWorks.push(temp);
-          that.data.hotData.hotWorks.push(temp);
-        });
-        const hotStr = 'hotData.hotWorks'
-        that.setData({
-          [hotStr]: that.data.hotData.hotWorks,
-          recommendTotalNo: res.data.data.totalNo
-        })
+      const recommendRes = res.data.data.list;
+      // const recommendWorks = [];
+      recommendRes.forEach(item => {
+        const temp = {};
+        temp.title = item.userRead.title;
+        temp.summary = item.userRead.summary;
+        temp.img = item.userRead.iconImg;
+        temp.plays = item.userRead.playAmount ? item.userRead.playAmount : 0;
+        temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
+        temp.classId = item.userRead.id;
+        temp.time = formatDate(item.userRead.gmtCreated, 3);
+        temp.avatar = item.user.avatar;
+        temp.avatar = item.user.avatar;
+        temp.nickName = item.user.wechatName;
+        // recommendWorks.push(temp);
+        that.data.hotData.hotWorks.push(temp);
+      });
+      const hotStr = 'hotData.hotWorks'
+      that.setData({
+        [hotStr]: that.data.hotData.hotWorks,
+        recommendTotalNo: res.data.data.totalNo
+      })
     })
     })
   }
   }
 
 

+ 36 - 29
component/hot/hot.wxml

@@ -2,65 +2,72 @@
     <swiper indicator-dots="{{hotData.indicatorDots}}" autoplay="{{hotData.autoplay}}" interval="{{hotData.interval}}" duration="{{hotData.duration}}" circular="{{hotData.circular}}">
     <swiper indicator-dots="{{hotData.indicatorDots}}" autoplay="{{hotData.autoplay}}" interval="{{hotData.interval}}" duration="{{hotData.duration}}" circular="{{hotData.circular}}">
         <block wx:for="{{hotData.banner}}" wx:key="{{index}}">
         <block wx:for="{{hotData.banner}}" wx:key="{{index}}">
             <swiper-item>
             <swiper-item>
-                <image src="{{item.url}}" data-type="{{item.type}}" data-id="{{item.id}}" bindtap="bannerTap" class="slide-image" width="750" height="318" />
+                <image src="{{item.url}}" data-type="{{item.type}}" data-id="{{item.id}}" class="slide-image" width="750" height="318" />
             </swiper-item>
             </swiper-item>
         </block>
         </block>
     </swiper>
     </swiper>
     <view class="searchSection">
     <view class="searchSection">
         <input bindinput="inputHandler" bindconfirm="searchHandler" placeholder="{{hotData.hotSearch}}" placeholder-style="text-indent:20rpx" confirm-type="search"></input>
         <input bindinput="inputHandler" bindconfirm="searchHandler" placeholder="{{hotData.hotSearch}}" placeholder-style="text-indent:20rpx" confirm-type="search"></input>
-        <button bindtap="searchHandler" class="searchBtn" plain="{{true}}">
-            <icon type="search" size="17" />
-        </button>
+        <view bindtap="searchHandler" class="searchBtn">
+            <!-- <icon type="search" size="14" /> -->
+            <image src="../../static/image/search_new.png" alt="" />
+        </view>
         <view class="allBooks" bindtap="goToBooks">全部课本</view>
         <view class="allBooks" bindtap="goToBooks">全部课本</view>
+        <!-- <form bindsubmit="submitTest" report-submit="{{true}}" class="allBooks">
+            <button formType="submit">Reset</button>
+        </form> -->
     </view>
     </view>
     <view class="hotSection">
     <view class="hotSection">
         <view class="title">
         <view class="title">
             <view class="leftWrapper">
             <view class="leftWrapper">
                 <image class="recommendTag" src="../../static/image/course.png" alt="" />
                 <image class="recommendTag" src="../../static/image/course.png" alt="" />
-                <text>本周课程推荐</text>
+                <text>本周推荐</text>
             </view>
             </view>
             <view class="moreBtn" bindtap="openMore">更多></view>
             <view class="moreBtn" bindtap="openMore">更多></view>
         </view>
         </view>
         <view class="hotWares" style="flex-direction:row;">
         <view class="hotWares" style="flex-direction:row;">
             <view wx:for="{{hotData.recommend}}" wx:key="{{index}}" class="hotWareCard" bindtap="openClass" data-classId="{{item.classId}}" data-title="{{item.title}}">
             <view wx:for="{{hotData.recommend}}" wx:key="{{index}}" class="hotWareCard" bindtap="openClass" data-classId="{{item.classId}}" data-title="{{item.title}}">
                 <image class="wareCardImg" src="{{item.img}}" />
                 <image class="wareCardImg" src="{{item.img}}" />
-                <text class="wareCardTitle">{{item.title}}</text>
-                <view class="bottomData">
+                <view class="titleSummary">
+                    <text class="wareCardTitle">{{item.title}}</text>
                     <text class="wareCardTip">{{item.summary}}</text>
                     <text class="wareCardTip">{{item.summary}}</text>
-                    <!-- <view class="wareCardPlays">
-                        <image class="wareCardPlaysImg" src="../../static/image/hotPlays.png" />
-                        <text>{{item.plays}}</text>
-                    </view>
-                    <view class="wareCardLikes">
-                        <image class="wareCardLikesImg" src="../../static/image/like.png" />
-                        <text>{{item.likes}}</text>
-                    </view> -->
                 </view>
                 </view>
             </view>
             </view>
         </view>
         </view>
     </view>
     </view>
-    <view class="hotSection">
+    <view class="recommdSection">
         <view class="title">
         <view class="title">
             <view class="leftWrapper">
             <view class="leftWrapper">
                 <image src="../../static/image/hot_recommend.png" alt="" />
                 <image src="../../static/image/hot_recommend.png" alt="" />
-                <text>人气推荐</text>
+                <text>热门作品</text>
             </view>
             </view>
         </view>
         </view>
-        <view class="hotWares"  >
-            <view wx:for="{{hotData.hotWorks}}" wx:key="{{index}}" class="hotWareCard" bindtap="openWorks" data-readId="{{item.classId}}" data-title="{{item.title}}">
-                <image class="wareCardImg" src="{{item.img}}" />
-                <text class="wareCardTitle">{{item.title}}</text>
-                <view class="bottomData">
-                    <text class="wareCardTip">{{item.summary}}</text>
-                    <view class="wareCardPlays">
-                        <image class="wareCardPlaysImg" src="../../static/image/hotPlays.png" />
-                        <text>{{item.plays}}</text>
+        <view class="hotWares">
+            <view wx:for="{{hotData.hotWorks}}" wx:key="{{index}}" class="worksCard" bindtap="openWorks" data-readId="{{item.classId}}" data-title="{{item.title}}">
+                <view class="topData">
+                    <view class="worksLeft">
+                        <image class="authorAvatar" src="{{item.avatar}}" />
+                        <view class="worksInfo">
+                            <view class="authorName">{{item.nickName}}</view>
+                            <view class="time">{{item.time}}</view>
+                        </view>
                     </view>
                     </view>
-                    <view class="wareCardLikes">
-                        <image class="wareCardLikesImg" src="../../static/image/like.png" />
-                        <text>{{item.likes}}</text>
+                    <view class="numberInfo">
+                        <view class="wareCardPlays">
+                            <image class="wareCardPlaysImg" src="../../static/image/hotPlays.png" />
+                            <text>{{item.plays}}</text>
+                        </view>
+                        <view class="wareCardLikes">
+                            <image class="wareCardLikesImg" src="../../static/image/like.png" />
+                            <text>{{item.likes}}</text>
+                        </view>
                     </view>
                     </view>
                 </view>
                 </view>
+                <image class="wareCardImg" src="{{item.img}}" />
+                <view class="titleSummary">
+                    <text class="wareCardTitle">{{item.title}}</text>
+                    <text class="wareCardTip">{{item.summary}}</text>
+                </view>
             </view>
             </view>
         </view>
         </view>
     </view>
     </view>

+ 226 - 21
component/hot/hot.wxss

@@ -1,5 +1,6 @@
 swiper {
 swiper {
-    margin-top: 10rpx;
+    /* margin-top: 10rpx; */
+    padding-top: 20rpx;
     background: #fff;
     background: #fff;
     display: block;
     display: block;
     width: 100%;
     width: 100%;
@@ -24,7 +25,7 @@ swiper {
 
 
 .searchSection input {
 .searchSection input {
     display: flex;
     display: flex;
-    width: 536rpx;
+    width: 518rpx;
     height: 56rpx;
     height: 56rpx;
     border-radius: 10rpx;
     border-radius: 10rpx;
     background: #F0F1F5;
     background: #F0F1F5;
@@ -38,21 +39,23 @@ swiper {
     /* background: #fff; */
     /* background: #fff; */
     position: absolute;
     position: absolute;
     z-index: 2;
     z-index: 2;
-    right: 200rpx;
+    right: 220rpx;
     width: 56rpx;
     width: 56rpx;
     height: 56rpx;
     height: 56rpx;
     border: 1rpx solid rgba(255, 255, 255, 0);
     border: 1rpx solid rgba(255, 255, 255, 0);
 }
 }
 
 
-.searchSection .searchBtn icon {
-    position: absolute;
-    top: 10rpx;
-    right: 15rpx;
+.searchSection .searchBtn image {
+    display: block;
+    width: 34rpx;
+    height: 34rpx;
+    margin: 10rpx auto;
+
 }
 }
 
 
 .searchSection .allBooks {
 .searchSection .allBooks {
     font-size: 32rpx;
     font-size: 32rpx;
-    color: #61ca54;
+    color: #41bb32;
     font-family: PingFangSC-regular;
     font-family: PingFangSC-regular;
     width: 128rpx;
     width: 128rpx;
     margin-left: 56rpx;
     margin-left: 56rpx;
@@ -61,7 +64,8 @@ swiper {
 .hotSection {
 .hotSection {
     width: 100%;
     width: 100%;
     /* height: 50rpx; */
     /* height: 50rpx; */
-    background: #fff;
+    /* background: #fff; */
+    background: rgba(240, 241, 245, 1);
     margin-top: 10rpx;
     margin-top: 10rpx;
 }
 }
 
 
@@ -69,7 +73,7 @@ swiper {
     display: flex;
     display: flex;
     align-items: center;
     align-items: center;
     justify-content: space-between;
     justify-content: space-between;
-    padding: 30rpx 22rpx 20rpx;
+    padding: 10rpx 22rpx 20rpx;
 
 
 }
 }
 
 
@@ -94,11 +98,11 @@ swiper {
     width: 224rpx;
     width: 224rpx;
     letter-spacing: 4rpx;
     letter-spacing: 4rpx;
     height: 40rpx;
     height: 40rpx;
-    margin-left: 12rpx;
+    margin-left: 16rpx;
     font-size: 32rpx;
     font-size: 32rpx;
     line-height: 40rpx;
     line-height: 40rpx;
     font-family: PingFangSC-regular;
     font-family: PingFangSC-regular;
-    color: #414141;
+    color: #444;
 }
 }
 
 
 .hotSection .title .moreBtn {
 .hotSection .title .moreBtn {
@@ -107,19 +111,23 @@ swiper {
     width: 80rpx;
     width: 80rpx;
     height: 38rpx;
     height: 38rpx;
     font-size: 28rpx;
     font-size: 28rpx;
-    color: #6e6e6e;
+    color: #444;
 }
 }
 
 
 .hotWares {
 .hotWares {
     display: flex;
     display: flex;
     flex-wrap: wrap;
     flex-wrap: wrap;
+    /* background: #e8e8e8; */
 }
 }
 
 
 .hotSection .hotWares .hotWareCard {
 .hotSection .hotWares .hotWareCard {
     position: relative;
     position: relative;
     overflow: hidden;
     overflow: hidden;
-    width: 704rpx;
-    height: 402rpx;
+    width: 720rpx;
+    height: 374rpx;
+    background: #fff;
+    /* padding: 26rpx; */
+    border-radius: 12rpx;
     /* margin: 0 0 18rpx 16rpx; */
     /* margin: 0 0 18rpx 16rpx; */
     margin: 0 auto 20rpx;
     margin: 0 auto 20rpx;
     /* box-shadow: 0 8rpx 6rpx 0 rgba(0, 0, 0, .28); */
     /* box-shadow: 0 8rpx 6rpx 0 rgba(0, 0, 0, .28); */
@@ -128,12 +136,18 @@ swiper {
 
 
 
 
 .hotWareCard .wareCardImg {
 .hotWareCard .wareCardImg {
-    width: 100%;
-    height: 290rpx;
+    display: block;
+    width: 662rpx;
+    height: 272rpx;
+    margin: 26rpx auto 0;
     border-radius: 20rpx;
     border-radius: 20rpx;
 }
 }
 
 
-
+.hotWareCard .titleSummary {
+    display: flex;
+    justify-content: space-between;
+    margin-top: 12rpx;
+}
 
 
 .hotWareCard .wareCardTitle {
 .hotWareCard .wareCardTitle {
     /* margin: 0 auto; */
     /* margin: 0 auto; */
@@ -144,6 +158,7 @@ swiper {
     color: #414141;
     color: #414141;
     font-size: 32rpx;
     font-size: 32rpx;
     letter-spacing: 4rpx;
     letter-spacing: 4rpx;
+    margin-left: 28rpx;
     font-family: MicrosoftYaHei;
     font-family: MicrosoftYaHei;
 }
 }
 
 
@@ -165,12 +180,11 @@ swiper {
 }
 }
 
 
 .hotWareCard .wareCardTip {
 .hotWareCard .wareCardTip {
-
     width: 178rpx;
     width: 178rpx;
     height: 40rpx;
     height: 40rpx;
     display: block;
     display: block;
-    text-align: center;
-    color: #414141;
+    text-align: left;
+    color: #444;
     font-size: 24rpx;
     font-size: 24rpx;
 }
 }
 
 
@@ -291,4 +305,195 @@ swiper {
     margin-left: 4rpx;
     margin-left: 4rpx;
     color: #FF9800;
     color: #FF9800;
     font-size: 24rpx;
     font-size: 24rpx;
+}
+
+/* // 热门推荐 */
+.recommdSection {
+    width: 100%;
+    /* height: 50rpx; */
+    /* background: #fff; */
+    background: rgba(240, 241, 245, 1);
+    /* margin-top: 10rpx; */
+}
+
+.recommdSection .title {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding: 0 22rpx 20rpx;
+
+}
+
+.recommdSection .leftWrapper {
+    display: flex;
+    align-items: center;
+
+}
+
+.recommdSection .title image {
+    width: 54rpx;
+    height: 60rpx;
+    margin-left: 14rpx;
+}
+
+.recommdSection .title .recommendTag {
+    width: 38rpx;
+    height: 34rpx;
+}
+
+.recommdSection .title text {
+    width: 224rpx;
+    letter-spacing: 4rpx;
+    height: 40rpx;
+    margin-left: 16rpx;
+    font-size: 32rpx;
+    line-height: 40rpx;
+    font-family: PingFangSC-regular;
+    color: #444;
+}
+
+.recommdSection .title .moreBtn {
+    display: block;
+    float: right;
+    width: 80rpx;
+    height: 38rpx;
+    font-size: 28rpx;
+    color: #6e6e6e;
+}
+
+.hotWares {
+    display: flex;
+    flex-wrap: wrap;
+    /* background: #e8e8e8; */
+}
+
+.recommdSection .hotWares .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); */
+}
+
+
+
+.worksCard .wareCardImg {
+    display: block;
+    width: 662rpx;
+    height: 272rpx;
+    margin: 12rpx auto 0;
+    border-radius: 20rpx;
+}
+
+.worksCard .titleSummary {
+    display: flex;
+    justify-content: space-between;
+    margin-top: 12rpx;
+}
+
+.worksCard .wareCardTitle {
+    /* margin: 0 auto; */
+    width: 100%;
+    height: 46rpx;
+    display: block;
+    /* text-align: left; */
+    color: #414141;
+    font-size: 32rpx;
+    letter-spacing: 4rpx;
+    margin-left: 28rpx;
+    font-family: MicrosoftYaHei;
+}
+
+.worksCard .topData {
+    height: 92rpx;
+    margin-top: 14rpx;
+    display: flex;
+    flex-direction: row;
+    /* justify-content: space-between; */
+    align-items: center;
+}
+
+.worksLeft {
+    display: flex;
+    flex-direction: row;
+    flex:1;
+}
+
+.worksLeft .worksInfo .authorName {
+    color: #444444;
+    font-size: 32rpx;
+    margin-top: 8rpx;
+
+}
+
+.worksLeft .worksInfo .time {
+    color: #686868;
+    font-size: 28rpx;
+
+}
+
+.worksCard .topData .wareCardPlays {
+    width: 100rpx;
+    /* margin-left: 270rpx; */
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+}
+
+.worksCard .topData .authorAvatar {
+    width: 92rpx;
+    height: 92rpx;
+    margin: 0 22rpx 0 22rpx;
+    display: block;
+
+    border-radius: 50%;
+}
+.topData .numberInfo{
+    display: flex;
+    flex-direction: column;
+}
+.worksCard .wareCardTip {
+    width: 178rpx;
+    height: 40rpx;
+    display: block;
+    text-align: left;
+    color: #444;
+    font-size: 24rpx;
+}
+
+.worksCard .wareCardPlays .wareCardPlaysImg {
+    width:20rpx;
+height:22rpx;
+margin-right: 6rpx;
+}
+
+.worksCard .wareCardPlays text {
+    margin-left: 4rpx;
+    color: #5e5e5e;
+    font-size: 22rpx;
+}
+
+.worksCard .wareCardLikes {
+    width: 100rpx;
+    margin-right: 18rpx;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+}
+
+.worksCard .wareCardLikes .wareCardLikesImg {
+    width:26rpx;
+height:24rpx;
+margin-right: 6rpx;
+}
+
+.worksCard .wareCardLikes text {
+    margin-left: 4rpx;
+    color: #FF9800;
+    font-size: 24rpx;
 }
 }

+ 3 - 7
component/my/my.js

@@ -1,4 +1,4 @@
-import APIClient from '../../utils/APIClient.js'
+import APIClient from '../../utils/APIClient';
 export const myInit = (that) => {
 export const myInit = (that) => {
   that.setData({
   that.setData({
     myData: {
     myData: {
@@ -61,10 +61,6 @@ export const myInit = (that) => {
       wx.navigateTo({
       wx.navigateTo({
         url: `../../pages/groupPage/my-group/my-group?title=${title}`
         url: `../../pages/groupPage/my-group/my-group?title=${title}`
       });
       });
-      debugger
-      APIClient.myWallet().success(res => {
-        debugger
-        console.log(res.data.data.data);
-      });
-    } 
+    }
+    
 }
 }

+ 4 - 4
component/my/my.wxml

@@ -21,7 +21,7 @@
       </view>
       </view>
       <view class='mine-category'>
       <view class='mine-category'>
         <view class='play-count'>
         <view class='play-count'>
-          <view>{{ myData.user.playAmount }}</view>
+          <view>{{ myData.user.playAmount || 0 }}</view>
           <view class='border-right'>
           <view class='border-right'>
             <view class='play-img'>
             <view class='play-img'>
               <image src='../../static/image/play.png'></image>
               <image src='../../static/image/play.png'></image>
@@ -30,7 +30,7 @@
           </view>
           </view>
         </view>
         </view>
         <view class='follow-count'>
         <view class='follow-count'>
-          <view class='color'>{{ myData.user.fansAmount }}</view>
+          <view class='color'>{{ myData.user.fansAmount || 0 }}</view>
           <view class='border-right'>
           <view class='border-right'>
             <view class='play-img'>
             <view class='play-img'>
               <image src='../../static/image/follow.png'></image>
               <image src='../../static/image/follow.png'></image>
@@ -39,7 +39,7 @@
           </view>
           </view>
         </view>
         </view>
         <view class='point-count'>
         <view class='point-count'>
-          <view class='color'>{{ myData.user.likeAmount }}</view>
+          <view class='color'>{{ myData.user.likeAmount || 0 }}</view>
           <view class='border-right'>
           <view class='border-right'>
             <view class='play-img'>
             <view class='play-img'>
               <image src='../../static/image/point.png'></image>
               <image src='../../static/image/point.png'></image>
@@ -48,7 +48,7 @@
           </view>
           </view>
         </view>
         </view>
         <view class='flower-count'>
         <view class='flower-count'>
-          <view class='color'>{{ myData.user.pointAmount }}</view>
+          <view class='color'>{{ myData.user.pointAmount || 0 }}</view>
           <view class='border-right'>
           <view class='border-right'>
             <view class='play-img'>
             <view class='play-img'>
               <image src='../../static/image/flower.png'></image>
               <image src='../../static/image/flower.png'></image>

+ 3 - 2
component/popup/popup.js

@@ -30,7 +30,7 @@ Component({
    * 组件的初始数据
    * 组件的初始数据
    */
    */
   data: {
   data: {
-    closeFlag: true
+    flag: true
   },
   },
 
 
   /**
   /**
@@ -39,8 +39,9 @@ Component({
   methods: {
   methods: {
     close: function () {
     close: function () {
       this.setData({
       this.setData({
-        closeFlag: !this.data.closeFlag
+        flag: !this.data.flag
       })
       })
+      this.triggerEvent('Close', {})
     },
     },
     launchGroup: function () {
     launchGroup: function () {
       this.triggerEvent('Group', {})
       this.triggerEvent('Group', {})

+ 5 - 5
component/popup/popup.wxml

@@ -1,5 +1,5 @@
 <!--component/popup/popup.wxml-->
 <!--component/popup/popup.wxml-->
-<view class="popup" hidden="{{closeFlag}}">
+<view class="popup" hidden="{{flag}}">
     <!--成功-->
     <!--成功-->
     <view class="popup-container" wx:if="{{typeOf == 'success' ? true : false}}">
     <view class="popup-container" wx:if="{{typeOf == 'success' ? true : false}}">
         <view class="head-img" style="height: 240rpx">
         <view class="head-img" style="height: 240rpx">
@@ -14,15 +14,15 @@
                 {{headTextTwo}}
                 {{headTextTwo}}
             </view>
             </view>
         </view>
         </view>
-        <view class="content">    
+        <view class="content" style="font-size:32rpx;">    
             <block wx:for="{{content}}" wx:key="{{index}}">
             <block wx:for="{{content}}" wx:key="{{index}}">
                 <text style="color: {{item.color}};">{{item.text}}</text>
                 <text style="color: {{item.color}};">{{item.text}}</text>
             </block>
             </block>
         </view>
         </view>
-        <!-- <view class="send-btn" bindtap="launchGroup">
+         <view class="send-btn" bindtap="launchGroup">
             <image src="../../static/groupImg/Invitation.png"></image>
             <image src="../../static/groupImg/Invitation.png"></image>
-            <text>发起团购</text>
-        </view> -->
+            <text>邀请好友赚奖学金</text>
+        </view>
     </view>
     </view>
     <!--失败 -->
     <!--失败 -->
     <view class="popup-container"  wx:if="{{typeOf == 'error' ? true : false}}">
     <view class="popup-container"  wx:if="{{typeOf == 'error' ? true : false}}">

+ 111 - 79
component/share/share.js

@@ -26,9 +26,9 @@ Component({
     iconImg: '',
     iconImg: '',
     title: '',
     title: '',
     path: '',
     path: '',
-    QRCodeImagePath:'',
-    QRCodeImageLocalPath:'',
-    groupPurchaseInfo:{}
+    QRCodeImagePath: '',
+    QRCodeImageLocalPath: '',
+    groupPurchaseInfo: {}
   },
   },
 
 
   /**
   /**
@@ -61,33 +61,36 @@ Component({
           }
           }
         })
         })
         .then(() => {
         .then(() => {
-          debugger;
           wx.getImageInfo({
           wx.getImageInfo({
-            src: this.data.QRCodeImagePath,//服务器返回的图片地址
+            src: this.data.QRCodeImagePath, //服务器返回的图片地址
             success: function (res) {
             success: function (res) {
+              console.log('下载content成功1')
+              console.log(res.path)
               //res.path是网络图片的本地地址
               //res.path是网络图片的本地地址
-              ctx.drawImage(res.path, 227, 364, 135, 135);
-
+              ctx.drawImage(res.path,127, 423, 121, 121);
 
 
 
 
 
 
+              console.log('下载content成功2')
               ctx.draw(true, function (res) {
               ctx.draw(true, function (res) {
                 wx.canvasToTempFilePath({
                 wx.canvasToTempFilePath({
                   x: 0,
                   x: 0,
                   y: 0,
                   y: 0,
-                  width: 370,
-                  height: 507,
-                  destWidth: 370,
-                  destHeight: 507,
+                  width: 375,
+                  height: 667,
+                  // destWidth: 370,
+                  destWidth: 1500,
+                  // destHeight: 507,
+                  destHeight: 2668,
                   canvasId: 'myCanvas',
                   canvasId: 'myCanvas',
                   success: (res) => {
                   success: (res) => {
                     console.log(res.tempFilePath)
                     console.log(res.tempFilePath)
-                    wx.saveImageToPhotosAlbum({
-                      filePath: res.path,
-                      success(res) {
-                        console.log(res);
-                      }
-                    })
+                    // wx.saveImageToPhotosAlbum({
+                    //   filePath: res.path,
+                    //   success(res) {
+                    //     console.log(res);
+                    //   }
+                    // })
                     that.setData({
                     that.setData({
                       imgUrls: res.tempFilePath
                       imgUrls: res.tempFilePath
                     }, () => {
                     }, () => {
@@ -99,6 +102,7 @@ Component({
                   }
                   }
                 })
                 })
               })
               })
+              console.log('下载content成功3')
 
 
 
 
 
 
@@ -114,7 +118,6 @@ Component({
 
 
     },
     },
     share: function (data) {
     share: function (data) {
-      debugger;
       if (this.data.shareType === 'works') {
       if (this.data.shareType === 'works') {
 
 
         this.setData({
         this.setData({
@@ -124,7 +127,7 @@ Component({
           iconImg: data.iconImg,
           iconImg: data.iconImg,
           title: data.title,
           title: data.title,
           // path: data.path,
           // path: data.path,
-          QRData:{
+          QRData: {
             page: data.path,
             page: data.path,
             scene: data.scene,
             scene: data.scene,
             qrCodeId: this.data.shareId
             qrCodeId: this.data.shareId
@@ -141,7 +144,7 @@ Component({
           iconImg: data.iconImg,
           iconImg: data.iconImg,
           title: data.title,
           title: data.title,
           // path: data.path,
           // path: data.path,
-          QRData:{
+          QRData: {
             page: data.path,
             page: data.path,
             scene: data.scene,
             scene: data.scene,
             qrCodeId: this.data.shareId
             qrCodeId: this.data.shareId
@@ -156,13 +159,23 @@ Component({
         })
         })
       }
       }
     },
     },
+    //关闭弹框
+    close: function (e) {
+      console.log(e)
+      this.setData({
+        shareFlag: !this.data.shareFlag,
+        imgUrls: ''
+      })
+    },
+    nothing: function (e) {
+      return
+    },
     // 保存图片到本地
     // 保存图片到本地
     saveImg: function () {
     saveImg: function () {
       console.log('yibuububu')
       console.log('yibuububu')
       let download = new Promise((resolve, reject) => {
       let download = new Promise((resolve, reject) => {
         let QRCode = () => {
         let QRCode = () => {
           // 生成二维码并下载
           // 生成二维码并下载
-          debugger;
           httpRequestApi.createQRCode(this.data.QRData).success(res => {
           httpRequestApi.createQRCode(this.data.QRData).success(res => {
             // let base64 = wx.arrayBufferToBase64(res.data);
             // let base64 = wx.arrayBufferToBase64(res.data);
             // console.log(a)
             // console.log(a)
@@ -179,7 +192,7 @@ Component({
             //     // }, () => {
             //     // }, () => {
 
 
             //     // })
             //     // })
-  
+
             //   }
             //   }
             // });
             // });
             console.log(this.data.QRCodeImagePath)
             console.log(this.data.QRCodeImagePath)
@@ -229,33 +242,45 @@ Component({
           title: '海报生成中',
           title: '海报生成中',
           mask: true
           mask: true
         })
         })
-        console.log('开始画背景')
-        ctx.rect(0, 0, 370, 507)
-        ctx.setFillStyle('#fff')
-        ctx.fill()
+        if (this.data.shareType === 'works') {
+          ctx.drawImage('../../../static/image/works_poster.png', 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.save()
         ctx.save()
         ctx.beginPath()
         ctx.beginPath()
-        ctx.setFillStyle('#fff')
         ctx.fill()
         ctx.fill()
-        ctx.arc(185, 48, 37, 0, 2 * Math.PI, false)
-        ctx.clip(); //画
         resolve();
         resolve();
       });
       });
       return background;
       return background;
     },
     },
     // 画头像和作者||发起者
     // 画头像和作者||发起者
     drawAuthor: function (ctx) {
     drawAuthor: function (ctx) {
-
       let author = new Promise((resolve, reject) => {
       let author = new Promise((resolve, reject) => {
-        // resolve(() => {
-        console.log('开始画头像')
-        ctx.drawImage(this.data.avatar, 148, 8, 100, 100); //插入图片  
-        ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
-        ctx.setFontSize(20)
-        ctx.setFillStyle('#535353')
-        ctx.fillText(this.data.author, (370 - ctx.measureText(this.data.author).width) / 2, 115)
-        ctx.setFillStyle('#FF4400')
-        // })
+        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, 15, 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();
         resolve();
       })
       })
       return author;
       return author;
@@ -265,19 +290,30 @@ Component({
       let works = new Promise((resolve, reject) => {
       let works = new Promise((resolve, reject) => {
         // resolve(() => {
         // resolve(() => {
         console.log('开始画内容')
         console.log('开始画内容')
-        ctx.fillText('已使出洪荒之力,声情并茂的为', (370 - ctx.measureText('已使出洪荒之力,声情并茂的为').width) / 2, 138)
-        ctx.fillText(`《${this.data.title}》`, (370 - ctx.measureText(`《${this.data.title}》`).width) / 2, 160)
-        ctx.fillText(`配了一段惊世之作`, (370 - ctx.measureText(`配了一段惊世之作`).width) / 2, 182)
-        ctx.drawImage(this.data.iconImg, 9, 205, 352, 145);
-        ctx.setFontSize(18)
-        ctx.setFillStyle('#000')
-        ctx.drawImage('../../../static/groupImg/share_bottom.png', 3, 419, 370, 192);
-        ctx.setFontSize(20)
-        ctx.setFillStyle('red')
-        ctx.fillText('为TA疯狂打CALL', 9, 467)
+        ctx.setFillStyle('#fff')
         ctx.setFontSize(18)
         ctx.setFontSize(18)
+        ctx.fillText('小学语文 最新全国统一教材', (375 - ctx.measureText('小学语文 最新全国统一教材').width) / 2, 55);
+        ctx.setFontSize(30)
+        ctx.fillText('课文朗读 从未如此有趣', (375 - ctx.measureText('课文朗读 从未如此有趣').width) / 2 ,103);
+        ctx.setFontSize(16)
+        ctx.setFillStyle('#444')
+        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.drawImage('../../../static/image/reading_poster.jpg', 11, 276, 351, 145);
+        ctx.setFontSize(16)
         ctx.setFillStyle('#000')
         ctx.setFillStyle('#000')
-        ctx.fillText('长按识别二维码,快去听听', 9, 493)
+        // 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.setFontSize(12)
+        ctx.setFillStyle('#666666')
+        ctx.fillText('长按识别二维码', (375 - ctx.measureText('长按识别二维码').width) / 2, 574)
         // })
         // })
         resolve();
         resolve();
       })
       })
@@ -287,34 +323,27 @@ Component({
     // 分享团购的主体内容
     // 分享团购的主体内容
     drawGroupGut: function (ctx) {
     drawGroupGut: function (ctx) {
       let group = new Promise((resolve, reject) => {
       let group = new Promise((resolve, reject) => {
-        //resolve(() => {
-          ctx.fillText('郎朗读书声是世上最美的声音', 50, 138)
-        ctx.drawImage(this.data.groupPurchaseInfo.bgImg, 9, 205, 352, 145);
-          ctx.drawImage('../../../static/groupImg/Rectangle 41.png', 134, 358, 59, 20);
-          ctx.setFontSize(14)
-          ctx.setFillStyle('#fff')
-          ctx.fillText(`${this.data.groupPurchaseInfo.headcount}人团`, 149, 373)
+        ctx.setFontSize(28)
+        ctx.setFillStyle('#ff670d')
+        ctx.fillText('小学语文 朗读配音', (375 - ctx.measureText('小学语文 朗读配音').width) / 2 , 152)
           ctx.setFontSize(16)
           ctx.setFontSize(16)
-          ctx.setFillStyle('#A95A00')
-          ctx.fillText('原价', 20, 373)
-          ctx.setStrokeStyle('red')
-          ctx.moveTo(64, 368)
-          ctx.lineTo(114, 368)
-          ctx.stroke()
-          ctx.fillText(`¥${parseFloat(this.data.groupPurchaseInfo.originPrice / 100).toFixed(2)}元`, 64, 373)
-          ctx.setFontSize(18)
-          ctx.fillText('团购价仅需', 20, 403)
-          ctx.fillText('元', 174, 403)
-          ctx.setFontSize(20)
-          ctx.setFillStyle('red')
-          ctx.fillText(`¥${parseFloat(this.data.groupPurchaseInfo.price / 100).toFixed(2)}`, 109, 403)
-          ctx.drawImage('../../../static/groupImg/share_bottom.png', 3, 419, 370, 192);
-          ctx.setFontSize(20)
-          ctx.setFillStyle('red')
-          ctx.fillText('名额有限,售完截止', 9, 467)
-          ctx.setFontSize(18)
-          ctx.setFillStyle('#000')
-          ctx.fillText('长按识别二维码参加团购', 9, 493)
+        ctx.setFillStyle('#444')
+        ctx.fillText('郎朗读书声,是世上最美的声音', (375 - ctx.measureText('郎朗读书声,是世上最美的声音').width) / 2 ,351)
+        ctx.drawImage(this.data.iconImg, 12, 176, 351, 145);
+        // ctx.drawImage('../../../static/groupImg/Rectangle 41.png', 134, 358, 59, 20);
+        ctx.setFontSize(17)
+        ctx.setFillStyle('#A95A00')
+        ctx.fillText(`${this.data.groupPurchaseInfo.headcount}人团`,  96, 412)
+        ctx.setFontSize(19)
+        ctx.fillText('每人仅需', 151, 412)
+        // ctx.fillText('元', 120, 495)
+        ctx.setFontSize(28)
+        ctx.setStrokeStyle('red')
+        ctx.setFillStyle('red')
+        ctx.fillText(`${parseFloat(this.data.groupPurchaseInfo.price / 100).toFixed(2)}元`, 235, 415)
+        ctx.setFontSize(12)
+        ctx.setFillStyle('#666666')
+        ctx.fillText('长按识别二维码', (375 - ctx.measureText('长按识别二维码').width) / 2, 574)
         //})
         //})
         resolve();
         resolve();
       })
       })
@@ -326,8 +355,11 @@ Component({
     PreservationImg: function () {
     PreservationImg: function () {
       wx.saveImageToPhotosAlbum({
       wx.saveImageToPhotosAlbum({
         filePath: this.data.imgUrls,
         filePath: this.data.imgUrls,
-        success(res) {
-          console.log('保存成功')
+        success: (res) => {
+          console.log(res)
+          this.setData({
+            imgUrls: false
+          })
         }
         }
       })
       })
     },
     },

+ 7 - 6
component/share/share.wxml

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

+ 29 - 33
component/share/share.wxss

@@ -5,7 +5,7 @@
     top: 0;
     top: 0;
     width: 100%;
     width: 100%;
     height: 100%;
     height: 100%;
-    background: rgba(0, 0, 0, .3);
+    background: rgba(0, 0, 0, .6);
     z-index: 99;
     z-index: 99;
 }
 }
 
 
@@ -18,19 +18,22 @@
 }
 }
 
 
 .btn .bg {
 .btn .bg {
-    width: 90%;
-    margin: 46rpx 5%;
+  display: block;
+    width: 500rpx;
+    margin: 5% auto;
     height: 42rpx;
     height: 42rpx;
 }
 }
-
+.btn text{
+  font-size: 28rpx;
+}
 .share-btn {
 .share-btn {
     display: flex;
     display: flex;
     justify-content: space-around;
     justify-content: space-around;
 }
 }
 
 
 .share-btn image {
 .share-btn image {
-    width: 66rpx;
-    height: 66rpx;
+    width: 68rpx;
+    height: 68rpx;
 }
 }
 
 
 .share-btn view {
 .share-btn view {
@@ -40,40 +43,32 @@
     align-items: center;
     align-items: center;
     font-size: 32rpx;
     font-size: 32rpx;
     height: 120rpx;
     height: 120rpx;
+    width: 180rpx
 }
 }
 
 
 .img {
 .img {
-    position: absolute;
-    left: 5rpx;
-    top: 30rpx;
-    width: 740rpx;
-    height: 1014rpx;
+    display: block;
+    /* position: absolute; */
+    /* left: 5rpx; */
+    /* top: 30rpx; */
+    width: 80%;
+    height: 80%;
+    margin: 50rpx auto;
+    /* width: 375rpx; */
+    /* height: 667rpx; */
 }
 }
 
 
 .Preservation {
 .Preservation {
     position: absolute;
     position: absolute;
     left: 15%;
     left: 15%;
-    bottom: 5%;
-    width: 70%;
-    height: 88rpx;
-
-}
-
-.Preservation .PreservationBg {
-    position: absolute;
-    left: 0;
-    top: 0;
-    width: 100%;
-    height: 100%;
-}
-
-.Preservation text {
+    bottom: 50rpx;
+    width: 536rpx;
+    height: 80rpx;
     color: #fff;
     color: #fff;
     font-size: 36rpx;
     font-size: 36rpx;
-    position: absolute;
-    left: 30rpx;
-    top: 20rpx;
-    z-index: 9;
+    text-align: center;
+    line-height: 80rpx;
+    border-radius: 44rpx;
 }
 }
 
 
 .share-friend {
 .share-friend {
@@ -86,12 +81,13 @@
     margin:0;
     margin:0;
     border-radius:0;    
     border-radius:0;    
     height: 140rpx;
     height: 140rpx;
-    font-size:32rpx;  
+    font-size:32rpx;
+    width: 180rpx;  
 }
 }
 
 
 .share-friend image {
 .share-friend image {
-    width: 66rpx;
-    height: 66rpx;
+    width: 68rpx;
+    height: 68rpx;
 }
 }
 
 
 button::after{ border: none; } 
 button::after{ border: none; } 

+ 44 - 17
pages/groupPage/collage-details/collage-details.js

@@ -30,7 +30,9 @@ Page({
           text: "在限定时间内内成功拼团,您将得到xx元的奖励金哦。",
           text: "在限定时间内内成功拼团,您将得到xx元的奖励金哦。",
           color: "#FF4600"
           color: "#FF4600"
       }
       }
-    ]
+    ],
+    read: false,
+    organizerUid: ''
   },
   },
 
 
   //规则页显示和隐藏
   //规则页显示和隐藏
@@ -41,24 +43,37 @@ Page({
   },
   },
   //显示分享页 
   //显示分享页 
   openShare: function () {
   openShare: function () {
-    this.shareDialog = this.selectComponent("#share-dialog");
-    const data = {
-      avatar: this.data.organizer.avatar,
-      author: this.data.organizer.wechatName,
-      iconImg: this.data.groupPurchaseInfo.bgImg,
-      title: this.data.groupPurchaseInfo.productTitle,
-      path: `pages/groupPage/collage-details/collage-details`,
-      scene: `QR${this.data.orderId}`,
-      groupPurchaseInfo: this.data.groupPurchaseInfo
+    if(this.data.read){
+      const productId = this.data.productId;
+      const id = this.data.orderId;
+      const groupId = this.data.groupId;
+      wx.navigateTo({
+        url: `/pages/groupPage/grade-details/grade-details?productId=${productId}&id=${id}&groupId=${groupId}&share=true`
+      })
+    }else {
+      this.shareDialog = this.selectComponent("#share-dialog");
+      const data = {
+        avatar: this.data.organizer.avatar,
+        author: this.data.organizer.wechatName,
+        iconImg: this.data.groupPurchaseInfo.bgImg,
+        title: this.data.groupPurchaseInfo.productTitle,
+        path: `pages/groupPage/collage-details/collage-details`,
+        scene: `QR${this.data.orderId}`,
+        groupPurchaseInfo: this.data.groupPurchaseInfo
+      }
+      this.shareDialog.share(data);
     }
     }
-    this.shareDialog.share(data);
   },
   },
   /**
   /**
    * 生命周期函数--监听页面加载
    * 生命周期函数--监听页面加载
    */
    */
   onLoad: function (options) {
   onLoad: function (options) {
+    if(options.read) {
+      this.setData({
+        read: options.read
+      })
+    }
     options.scene = 'QR1541862338777268';
     options.scene = 'QR1541862338777268';
-    debugger;
     wx.setNavigationBarTitle({
     wx.setNavigationBarTitle({
       title: '拼团详情'
       title: '拼团详情'
     })
     })
@@ -71,14 +86,20 @@ Page({
       orderId
       orderId
     })
     })
     httpRequestApi.getMygroupInfo(orderId).success( res => {
     httpRequestApi.getMygroupInfo(orderId).success( res => {
-      console.log('支付详情', res.data.data);
-      const surplusNum = res.data.data.groupPurchaseOrder.headcount - res.data.data.groupPurchaseOrder.joinCount;
+      console.log(res);
+      const groupOrder = res.data.data.groupPurchaseOrder;
+      const surplusNum = groupOrder.headcount - groupOrder.joinCount;
+      this.setData({
+        organizerUid: groupOrder.organizer,
+      })
       for(var i = 0; i < surplusNum; i++) {
       for(var i = 0; i < surplusNum; i++) {
         this.data.surplusList.push(1);
         this.data.surplusList.push(1);
       }
       }
       //console.log(res.data.data.groupPurchaseOrder.closeTime - res.data.data.groupPurchaseOrder.gmtModified)
       //console.log(res.data.data.groupPurchaseOrder.closeTime - res.data.data.groupPurchaseOrder.gmtModified)
       //时间转换
       //时间转换
-      const timeList = util.formatTime(res.data.data.groupPurchaseOrder.closeTime - res.data.data.groupPurchaseOrder.gmtModified);
+      const timeList = util.formatTime(groupOrder.closeTime - Date.parse(new Date()));
+      console.log(timeList)
+      //res.data.data.joinUserList.unshift(res.data.data.organizer);
       this.setData({
       this.setData({
         groupPurchaseInfo: res.data.data.groupPurchaseInfo,
         groupPurchaseInfo: res.data.data.groupPurchaseInfo,
         organizer: res.data.data.organizer,
         organizer: res.data.data.organizer,
@@ -86,9 +107,15 @@ Page({
         joinUserList: res.data.data.joinUserList,
         joinUserList: res.data.data.joinUserList,
         surplusList: this.data.surplusList,
         surplusList: this.data.surplusList,
         timeList,
         timeList,
-        productId: res.data.data.groupPurchaseOrder.productId,
-        groupId: res.data.data.groupPurchaseOrder.groupId
+        productId: groupOrder.productId,
+        groupId: groupOrder.groupId
       })
       })
+      if(groupOrder.groupType === 'PROMOTION'){
+        this.data.joinUserList.unshift(res.data.data.organizer);
+        this.setData({
+          joinUserList: this.data.joinUserList,
+        })
+      }
     }).fail( error => {
     }).fail( error => {
       console.log('错误', error)
       console.log('错误', error)
     })
     })

+ 7 - 4
pages/groupPage/collage-details/collage-details.wxml

@@ -11,7 +11,8 @@
     <view class="details-head">
     <view class="details-head">
         <view class="headImg">
         <view class="headImg">
             <block wx:for="{{joinUserList}}" wx:key="{{index}}">
             <block wx:for="{{joinUserList}}" wx:key="{{index}}">
-                <view class="headImg-item">
+                <view class="headImg-item {{organizerUid == item.uid ? 'bg-boder' : ''}}">
+                    <image wx:if="{{organizerUid == item.uid}}" class="tuanzhangIcon" src="../../../static/groupImg/tuanzhangIcon.png"></image>
                     <image src="{{item.avatar}}"></image>
                     <image src="{{item.avatar}}"></image>
                 </view>
                 </view>
             </block>
             </block>
@@ -22,7 +23,9 @@
             </block>                   
             </block>                   
         </view>
         </view>
         <view class="shengyu">
         <view class="shengyu">
-            <view class="shengyu-num" >仅剩<text>{{surplusNum}}</text>个名额就拼团成功了</view>
+            <view class="shengyu-num" hidden="{{surplusNum == '0'}}">还需邀请<text>{{surplusNum}}</text>名好友</view>
+            <view class="shengyu-num" hidden="{{surplusNum == '0'}}">即可获得一年级语文同步辅导(上学期)</view>
+            <view class="shengyu-num" hidden="{{surplusNum != '0'}}">拼团成功!快去朗读吧</view>
             <view class="shengyu-time" >
             <view class="shengyu-time" >
                 剩余时间:
                 剩余时间:
                 <view class="time">
                 <view class="time">
@@ -48,7 +51,7 @@
         </view>
         </view>
         <view class="invitation-btn" bindtap="openShare">
         <view class="invitation-btn" bindtap="openShare">
             <image src="../../../static/groupImg/Invitation.png"></image>
             <image src="../../../static/groupImg/Invitation.png"></image>
-            <text>邀请朋友参加</text>
+            <text>{{read ? '去朗读' : '邀请朋友参加'}}</text>
         </view>
         </view>
     </view>  
     </view>  
     <view class="rule" style="{{hideFlag ? 'right' : 'left'}}: 0" bindtap="hide">
     <view class="rule" style="{{hideFlag ? 'right' : 'left'}}: 0" bindtap="hide">
@@ -60,7 +63,7 @@
         * 转发给自己的朋友们,分享好课, 追随您一起学习进步。您的魅力不是吹的! * 如果拼团失败,您预付的课程费将在48小时内退回您的账户。
         * 转发给自己的朋友们,分享好课, 追随您一起学习进步。您的魅力不是吹的! * 如果拼团失败,您预付的课程费将在48小时内退回您的账户。
     </view>
     </view>
 </view> 
 </view> 
-<canvas canvas-id="myCanvas" style="width:370px; height: 507px; position: absolute; left: -99rpx; top: -999rpx;"></canvas>
+<canvas canvas-id="myCanvas" style="width:375px; height: 668px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
 <shareDialog id="share-dialog" shareType='group' shareId="{{orderId}}"/>
 <shareDialog id="share-dialog" shareType='group' shareId="{{orderId}}"/>
 
 
 <popup
 <popup

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

@@ -3,6 +3,7 @@
     height: 100%;
     height: 100%;
     width: 100%;
     width: 100%;
     background:rgba(240,241,245,1);    
     background:rgba(240,241,245,1);    
+    overflow: hidden;
 }
 }
 
 
 .step {
 .step {
@@ -31,7 +32,7 @@
 
 
 .details-head {
 .details-head {
     width: 100%;
     width: 100%;
-    height: 78%;
+    height: 82%;
     margin-top: 12rpx;
     margin-top: 12rpx;
     background: #fff;
     background: #fff;
 }
 }
@@ -44,6 +45,7 @@
 }
 }
 
 
 .headImg-item {
 .headImg-item {
+    position: relative;
     width: 106rpx;
     width: 106rpx;
     height: 106rpx;
     height: 106rpx;
     border-radius: 50%;
     border-radius: 50%;
@@ -56,6 +58,18 @@
     border-radius: 50%;
     border-radius: 50%;
 }
 }
 
 
+.headImg-item .tuanzhangIcon {
+    position: absolute;
+    right: -20rpx;
+    top: -10rpx;
+    width: 80rpx;
+    height: 30rpx;
+}
+
+.bg-boder {
+    border: 2px solid #61CA54;
+}
+
 .shengyu {
 .shengyu {
  display: flex;
  display: flex;
  flex-direction: column;   
  flex-direction: column;   

+ 18 - 2
pages/groupPage/discount-group/discount-group.js

@@ -10,8 +10,24 @@ Page({
   },
   },
 
 
   //点击跳转到团购详情
   //点击跳转到团购详情
-  groupDetails:function () {
-
+  groupDetail:function ({currentTarget}) {
+    const productId = currentTarget.dataset.productid;
+    const id = currentTarget.dataset.id;
+    const groupId = currentTarget.dataset.groupid;
+    const ind = currentTarget.dataset.ind;
+    //const groupType = this.data.groupData.recommendList[ind].groupType;
+      wx.navigateTo({
+        url: `/pages/groupPage/group-details/group-details?productId=${productId}&id=${id}&groupId=${groupId}`
+      })
+    // if(groupType === "PROMOTION") {
+    //   wx.navigateTo({
+    //     url: `/pages/groupPage/make-money/make-money?productId=${productId}&id=${id}&groupId=${groupId}`
+    //   })
+    // }else  {
+    //   wx.navigateTo({
+    //     url: `/pages/groupPage/group-details/group-details?productId=${productId}&id=${id}&groupId=${groupId}`
+    //   })
+    // }
   },
   },
 
 
   /**
   /**

+ 1 - 1
pages/groupPage/discount-group/discount-group.wxml

@@ -5,7 +5,7 @@
         <view class="less-group">
         <view class="less-group">
           <view class="group-box">
           <view class="group-box">
             <block wx:for="{{recommendList}}" wx:key="{{index}}">
             <block wx:for="{{recommendList}}" wx:key="{{index}}">
-              <view class="group-item" bindtap="groupDetail" data-id="{{item.id}}" data-productId="{{item.productId}}" data-groupId="{{item.groupId}}">
+              <view class="group-item" bindtap="groupDetail" data-ind="{{index}}" data-id="{{item.id}}" data-productId="{{item.productId}}" data-groupId="{{item.groupId}}">
                 <image class="item-img" src="{{item.iconImg}}"></image>
                 <image class="item-img" src="{{item.iconImg}}"></image>
                 <view>拼团价 <text>¥{{item.price / 100}}</text></view>
                 <view>拼团价 <text>¥{{item.price / 100}}</text></view>
                 <view>原价 <text style="text-decoration: line-through;">¥{{item.originPrice / 100}}</text></view>
                 <view>原价 <text style="text-decoration: line-through;">¥{{item.originPrice / 100}}</text></view>

+ 18 - 7
pages/groupPage/grade-details/grade-details.js

@@ -1,5 +1,6 @@
 // pages/grade-details/grade-details.js
 // pages/grade-details/grade-details.js
 import httpRequestApi from '../../../utils/APIClient';
 import httpRequestApi from '../../../utils/APIClient';
+const app = getApp();
 Page({
 Page({
   /**
   /**
    * 页面的初始数据
    * 页面的初始数据
@@ -24,14 +25,15 @@ Page({
         color: "#FF4600"
         color: "#FF4600"
       }
       }
     ],
     ],
-
+    share: false,
+    isIPX: app.globalData.isIPX
   },
   },
   //获取团购信息并掉起支付
   //获取团购信息并掉起支付
   pay: function ({
   pay: function ({
     currentTarget
     currentTarget
   }) {
   }) {
     const productId = this.data.productId;
     const productId = this.data.productId;
-    const groupId = currentTarget.dataset.id;
+    const groupId =  currentTarget.dataset.id;
     //开始发起团购
     //开始发起团购
     httpRequestApi.SendGroupPurchas({
     httpRequestApi.SendGroupPurchas({
       productId,
       productId,
@@ -70,7 +72,7 @@ Page({
             if (res.data.data.groupPurchaseOrder.headCount !== 1) {
             if (res.data.data.groupPurchaseOrder.headCount !== 1) {
               setTimeout(() => {
               setTimeout(() => {
                 wx.navigateTo({
                 wx.navigateTo({
-                  url: `/pages/groupPage/collage-details/collage-details?orderId=${res.data.data.groupPurchaseOrder.id}`
+                  url: `/pages/groupPage/make-money/make-money?productId=${productId}&id=${res.data.data.groupPurchaseOrder.id}&groupId=${groupId}`
                 })
                 })
                 wx.setNavigationBarTitle({
                 wx.setNavigationBarTitle({
                   title: '拼团详情'
                   title: '拼团详情'
@@ -102,7 +104,7 @@ Page({
       'signType': 'MD5',
       'signType': 'MD5',
       'paySign': prePayMap.sign,
       'paySign': prePayMap.sign,
       'success': function (res) {
       'success': function (res) {
-        console.log('支付成功')
+        console.log('支付成功',res)
         wx.showModal({
         wx.showModal({
           title: '提示',
           title: '提示',
           content: '支付成功',
           content: '支付成功',
@@ -135,9 +137,15 @@ Page({
    * 生命周期函数--监听页面加载
    * 生命周期函数--监听页面加载
    */
    */
   onLoad: function (options) {
   onLoad: function (options) {
-    wx.setNavigationBarTitle({
-      title: options.title
-    })
+    console.log(options)
+    if(options.share){
+      this.setData({
+        share: options.share
+      })
+    }
+    // wx.setNavigationBarTitle({
+    //   title: options.title
+    // })
     const productId = options.productId;
     const productId = options.productId;
     if (productId) {
     if (productId) {
       this.setData({
       this.setData({
@@ -149,6 +157,9 @@ Page({
       console.log('课本详情', res.data.data);
       console.log('课本详情', res.data.data);
       const bookInfo = res.data.data.product;
       const bookInfo = res.data.data.product;
       const lessonList = res.data.data.lessonList;
       const lessonList = res.data.data.lessonList;
+      wx.setNavigationBarTitle({
+        title: bookInfo.title
+      })
       this.setData({
       this.setData({
         titleIcon: bookInfo.bgImg,
         titleIcon: bookInfo.bgImg,
         title: bookInfo.title,
         title: bookInfo.title,

+ 16 - 4
pages/groupPage/grade-details/grade-details.wxml

@@ -7,7 +7,7 @@
             <text>{{bookInfo}}</text>
             <text>{{bookInfo}}</text>
         </view>
         </view>
         <view class="catalog">
         <view class="catalog">
-            <image src="../../../static/groupImg/Rectangle 34@2x.png"></image>
+            <image src="../../../static/groupImg/Rectangle34@2x.png"></image>
             <text>课文目录</text>
             <text>课文目录</text>
         </view>
         </view>
         <view class="catalog-list">
         <view class="catalog-list">
@@ -17,15 +17,27 @@
             </view>
             </view>
         </view>
         </view>
     </scroll-view>
     </scroll-view>
-    <view class="group-btn">
+    <view class="group-btn {{isIPX ? 'bottomx' :''}}" wx:if="{{!share}}">
         <image class="bg1" src="../../../static/groupImg/Rectangle_9.png"></image>
         <image class="bg1" src="../../../static/groupImg/Rectangle_9.png"></image>
-        <image class="bg2" src="../../../static/groupImg/Rectangle_9.png"></image>
+        <image class="bg2" src="../../../static/groupImg/Rectangle_9.png"></image>      
         <block wx:for="{{payList}}" wx:key="{{index}}">
         <block wx:for="{{payList}}" wx:key="{{index}}">
-            <view class="Price" bindtap="pay" data-id="{{item.id}}">
+            <view class="Price" bindtap="pay" data-id="{{item.id}}" wx:if="{{share ? (index != 0) : true }}">
                 <text>¥{{item.price / 100}}</text>
                 <text>¥{{item.price / 100}}</text>
                 <text>{{item.headcount}}人团</text>
                 <text>{{item.headcount}}人团</text>
             </view>
             </view>
         </block>
         </block>
     </view>
     </view>
+    <view class="group-btn {{isIPX ? 'bottomx' :''}}" wx:if="{{share}}">
+        <image class="bg1" src="../../../static/groupImg/Rectangle_9.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) : true }}">
+                <view>继续开团</view>
+                <view>
+                    <text>¥{{item.price / 100}}</text>
+                    <text>{{item.headcount}}人团</text>
+                </view>
+            </view> 
+        </block>
+    </view>
 </view>
 </view>
 <popup id="popup" typeOf="sendSuccess" title="报告团长" headTextOne="您发起的团购已经成立" content="{{content}}"></popup>
 <popup id="popup" typeOf="sendSuccess" title="报告团长" headTextOne="您发起的团购已经成立" content="{{content}}"></popup>

+ 5 - 1
pages/groupPage/grade-details/grade-details.wxss

@@ -7,7 +7,7 @@
 
 
 
 
 scroll-view {
 scroll-view {
-    height: 100%;
+    height: 98%;
     width: 100%;
     width: 100%;
 }
 }
 
 
@@ -96,6 +96,10 @@ scroll-view {
     bottom: 0;
     bottom: 0;
 }
 }
 
 
+.bottomx {
+    bottom: 20rpx;
+}
+
 .group-btn .Price {
 .group-btn .Price {
     flex: 1;
     flex: 1;
     display: flex;
     display: flex;

+ 58 - 25
pages/groupPage/group-details/group-details.js

@@ -1,6 +1,10 @@
 // pages/group-details/group-details.js
 // pages/group-details/group-details.js
+import {
+  getOpenidSessionKey
+} from '../../../utils/httpUtil';
 import httpRequestApi from '../../../utils/APIClient';
 import httpRequestApi from '../../../utils/APIClient';
 import util from '../../../utils/util';
 import util from '../../../utils/util';
+const app = getApp();
 Page({
 Page({
 
 
   /**
   /**
@@ -23,6 +27,17 @@ Page({
     headTextOne: '',
     headTextOne: '',
     headTextTwo: '',
     headTextTwo: '',
     content: [],
     content: [],
+    organizer: '',
+    hide: true,
+    isIPX: app.globalData.isIPX
+  },
+  jurisdiction: function () {
+    //隐藏弹框
+    this.setData({
+      hide: !this.data.hide
+    })
+    //登录页信息
+    this.onLoad();
   },
   },
   //跳转到年级
   //跳转到年级
   gradeDetails: function () {
   gradeDetails: function () {
@@ -59,9 +74,14 @@ Page({
         })
         })
         return false;
         return false;
       }
       }
+      debugger;
       if (res.data.data.groupPurchaseOrder.groupType === 'BASE') {
       if (res.data.data.groupPurchaseOrder.groupType === 'BASE') {
         //掉起支付
         //掉起支付
         this.prePayMap(res.data.data.prePayMap, 'create');
         this.prePayMap(res.data.data.prePayMap, 'create');
+      }else {
+        wx.navigateTo({
+          url: `/pages/groupPage/make-money/make-money?productId=${productId}&id=${res.data.data.groupPurchaseOrder.id}&groupId=${groupId}`
+        })
       }
       }
 
 
     }).fail((error) => {
     }).fail((error) => {
@@ -119,7 +139,7 @@ Page({
             //获取拼团信息
             //获取拼团信息
             console.log(that.data.orderId)
             console.log(that.data.orderId)
             wx.showLoading({
             wx.showLoading({
-              title: '作品转码中',
+              title: '支付查询中...',
               mask: true
               mask: true
             })
             })
             setTimeout(() => {
             setTimeout(() => {
@@ -137,23 +157,21 @@ Page({
       }
       }
     })
     })
   },
   },
-  //跳转到拼团详情
-  collage: function () {
-
-  },
   //拼团详情
   //拼团详情
   jionSuccess: function (orderId, type) {
   jionSuccess: function (orderId, type) {
-    debugger;
     httpRequestApi.getMygroupInfo(orderId).success(res => {
     httpRequestApi.getMygroupInfo(orderId).success(res => {
       console.log('拼团详情', res.data.data);
       console.log('拼团详情', res.data.data);
-      const surplusNum = res.data.data.groupPurchaseOrder.headcount - res.data.data.groupPurchaseOrder.joinCount;
+      const groupOrder = res.data.data.groupPurchaseOrder;
+      const surplusNum = groupOrder.headcount - groupOrder.joinCount;
+      this.setData({
+        organizer: groupOrder.organizer,
+      })
       if (type === 'join') {
       if (type === 'join') {
         this.data.surplusList.pop();
         this.data.surplusList.pop();
-
-        if (res.data.data.groupPurchaseOrder.status === 'SUCCESSED') {
-          this.showSuccess(res.data.data.groupPurchaseOrder.organizer, res.data.data.groupPurchaseOrder.organizerPrice)
+        if (groupOrder.status === 'SUCCESSED') {
+          this.showSuccess(groupOrder.organizer, groupOrder.organizerPrice)
         } else {
         } else {
-          this.goToDetail(res.data.data.groupPurchaseOrder.id)
+          this.goToDetail(groupOrder.id)
         }
         }
 
 
       } else {
       } else {
@@ -162,16 +180,27 @@ Page({
         }
         }
       }
       }
 
 
-      console.log(res.data.data.groupPurchaseOrder.closeTime - res.data.data.groupPurchaseOrder.gmtModified)
+      console.log(groupOrder.closeTime - groupOrder.gmtModified)
       //时间转换
       //时间转换
-      const timeList = util.formatTime(res.data.data.groupPurchaseOrder.closeTime - res.data.data.groupPurchaseOrder.gmtModified);
-      console.log(timeList)
+      let timeNow = new Date()
+      // const timeList = util.formatTime(groupOrder.closeTime - groupOrder.gmtModified);
+      const timeList = util.formatTime(groupOrder.closeTime - Date.parse(new Date()));
       this.setData({
       this.setData({
         surplusNum,
         surplusNum,
         joinUserList: res.data.data.joinUserList,
         joinUserList: res.data.data.joinUserList,
         surplusList: this.data.surplusList,
         surplusList: this.data.surplusList,
         timeList,
         timeList,
       })
       })
+      if(groupOrder.groupType === 'PROMOTION'){
+        this.data.joinUserList.unshift(res.data.data.organizer);
+        //this.data.surplusList.pop();
+        this.setData({
+          joinUserList: this.data.joinUserList,
+          //surplusList: this.data.surplusList,
+          surplusNum: this.data.surplusNum
+        })
+      }
+      console.log(this.data.joinUserList)
       // this.groupSuccess(res.data.data.groupPurchaseOrder.productId, detailId);
       // this.groupSuccess(res.data.data.groupPurchaseOrder.productId, detailId);
     }).fail(error => {
     }).fail(error => {
       console.log('错误', error)
       console.log('错误', error)
@@ -243,6 +272,14 @@ Page({
       })
       })
     }, 3000)
     }, 3000)
   },
   },
+  //跳到课程
+  goToClass: function (e) {
+    let id = e.currentTarget.dataset.id;
+    let title = e.currentTarget.dataset.title;
+    wx.navigateTo({
+      url: `../../main/class/class?id=${id}&title=${title}`
+    })
+  },
   //拼团是否成功并弹窗
   //拼团是否成功并弹窗
   // groupSuccess: function (orderId, detailId) {
   // groupSuccess: function (orderId, detailId) {
   //   httpRequestApi.groupSuccess(orderId).success(res => {
   //   httpRequestApi.groupSuccess(orderId).success(res => {
@@ -314,23 +351,19 @@ Page({
   // },
   // },
   //再次发起团
   //再次发起团
   group: function () {
   group: function () {
-    wx.showModal({
-      title: '提示',
-      content: '再次发起团',
-      success(res) {
-        if (res.confirm) {
-          console.log('用户点击确定')
-        } else if (res.cancel) {
-          console.log('用户点击取消')
-        }
-      }
-    })
+    this.openGroup();
   },
   },
 
 
   /**
   /**
    * 生命周期函数--监听页面加载
    * 生命周期函数--监听页面加载
    */
    */
   onLoad: function (options) {
   onLoad: function (options) {
+    getOpenidSessionKey((res) => {}, (error) => {
+      this.setData({
+        hide: !this.data.hide
+      })
+      return;
+    });
     wx.setNavigationBarTitle({
     wx.setNavigationBarTitle({
       title: '拼团详情'
       title: '拼团详情'
     })
     })

+ 3 - 1
pages/groupPage/group-details/group-details.json

@@ -1,6 +1,8 @@
 {
 {
     "component": true,
     "component": true,
     "usingComponents": {
     "usingComponents": {
-        "popup": "/component/popup/popup"
+        "popup": "/component/popup/popup",
+        "Dialog": "/component/dialog/dialog"
+
     }  
     }  
 }
 }

+ 11 - 6
pages/groupPage/group-details/group-details.wxml

@@ -3,7 +3,8 @@
     <view class="details-head" bindtap="collage">
     <view class="details-head" bindtap="collage">
         <view class="headImg">
         <view class="headImg">
             <block wx:for="{{joinUserList}}" wx:key="{{index}}">
             <block wx:for="{{joinUserList}}" wx:key="{{index}}">
-                <view class="headImg-item">
+                <view class="headImg-item {{organizer == item.uid ? 'bg-boder' : ''}}">
+                    <image wx:if="{{organizer == item.uid}}" class="tuanzhangIcon" src="../../../static/groupImg/tuanzhangIcon.png"></image>
                     <image src="{{item.avatar}}"></image>
                     <image src="{{item.avatar}}"></image>
                 </view>
                 </view>
             </block>
             </block>
@@ -15,7 +16,7 @@
         </view>
         </view>
         <view class="shengyu">
         <view class="shengyu">
             <view class="shengyu-num" hidden="{{surplusNum == '0'}}">仅剩<text>{{surplusNum}}</text>个名额就拼团成功了</view>
             <view class="shengyu-num" hidden="{{surplusNum == '0'}}">仅剩<text>{{surplusNum}}</text>个名额就拼团成功了</view>
-            <view class="shengyu-num" hidden="{{surplusNum != '0'}}">拼团成功</view>
+            <view class="shengyu-num" hidden="{{surplusNum != '0'}}">拼团成功!快去朗读吧</view>
             <view class="shengyu-time" hidden="{{surplusNum == '0'}}">
             <view class="shengyu-time" hidden="{{surplusNum == '0'}}">
                 剩余时间:
                 剩余时间:
                 <view class="time">
                 <view class="time">
@@ -47,17 +48,17 @@
             <text>{{bookInfo}}</text>
             <text>{{bookInfo}}</text>
         </view>
         </view>
         <view class="catalog">
         <view class="catalog">
-            <image src="../../../static/groupImg/Rectangle 34@2x.png"></image>
+            <image src="../../../static/groupImg/Rectangle34@2x.png"></image>
             <text>课文目录</text>
             <text>课文目录</text>
         </view>
         </view>
         <view class="catalog-list">
         <view class="catalog-list">
-            <view class="catalog-item" wx:for="{{lessonList}}" wx:key="{{index}}" data-id="{{item.id}}" data-title="{{item.title}}">
+            <view class="catalog-item" wx:for="{{lessonList}}" wx:key="{{index}}" data-id="{{item.id}}" data-title="{{item.title}}" bindtap="goToClass">
                 <text class="left">{{item.title}}</text>
                 <text class="left">{{item.title}}</text>
                 <text class="right">{{item.readingNum}}朗读 ></text>
                 <text class="right">{{item.readingNum}}朗读 ></text>
             </view>           
             </view>           
         </view>
         </view>
     </scroll-view>
     </scroll-view>
-    <view class="group-details-btn">
+    <view class="group-details-btn {{isIPX ? 'bottomx' :''}}" hidden="{{surplusNum == '0'}}">
         <view class="left-btn" bindtap="openGroup">
         <view class="left-btn" bindtap="openGroup">
             开团
             开团
         </view>
         </view>
@@ -76,4 +77,8 @@
     headTextTwo="{{headTextTwo}}"
     headTextTwo="{{headTextTwo}}"
     content="{{content}}"
     content="{{content}}"
     bindGroup="group"
     bindGroup="group"
-></popup>
+></popup>
+
+<view hidden="{{hide}}">
+  <Dialog bindmyevent="jurisdiction" />
+</view>

+ 22 - 3
pages/groupPage/group-details/group-details.wxss

@@ -18,6 +18,7 @@
 }
 }
 
 
 .headImg-item {
 .headImg-item {
+    position: relative;
     width: 106rpx;
     width: 106rpx;
     height: 106rpx;
     height: 106rpx;
     border-radius: 50%;
     border-radius: 50%;
@@ -30,10 +31,23 @@
     border-radius: 50%;
     border-radius: 50%;
 }
 }
 
 
+.headImg-item .tuanzhangIcon {
+    position: absolute;
+    right: -20rpx;
+    top: -10rpx;
+    width: 80rpx;
+    height: 30rpx;
+}
+
+.bg-boder {
+    border: 2px solid #61CA54;
+}
+
 .shengyu {
 .shengyu {
  display: flex;
  display: flex;
  flex-direction: column;   
  flex-direction: column;   
  color: #696969;
  color: #696969;
+ padding-bottom:20px;
 }
 }
 
 
 .shengyu-num {
 .shengyu-num {
@@ -68,7 +82,7 @@
 
 
 .shengyu-time .time  text{
 .shengyu-time .time  text{
     position: absolute;
     position: absolute;
-    left: 2rpx;
+    left: 4rpx;
     top: 0;
     top: 0;
     z-index: 2;
     z-index: 2;
     color: #fff;
     color: #fff;
@@ -76,7 +90,7 @@
 }
 }
 
 
 scroll-view {
 scroll-view {
-    height: 64%;
+    height: 68%;
     width: 100%;
     width: 100%;
 }
 }
 
 
@@ -157,11 +171,16 @@ scroll-view {
 }
 }
 
 
 .group-details-btn {
 .group-details-btn {
-    position: absolute;
+    position: fixed;
     bottom: 0;
     bottom: 0;
     display: flex;
     display: flex;
     width: 100%;
     width: 100%;
     height: 102rpx;
     height: 102rpx;
+    z-index: 99;
+}
+
+.bottomx {
+    bottom: 20rpx;
 }
 }
 
 
 .left-btn {
 .left-btn {

+ 25 - 5
pages/groupPage/make-money/make-money.js

@@ -7,16 +7,30 @@ Page({
    * 页面的初始数据
    * 页面的初始数据
    */
    */
   data: {
   data: {
+    organizer: {},
+    groupPurchaseInfo: {},
     joinUserList: [],
     joinUserList: [],
     surplusList: [],
     surplusList: [],
     timeList: [],
     timeList: [],
     productId: '',
     productId: '',
     orderId: '',
     orderId: '',
-    groupId: ''
+    groupId: '',
+    organizerUid: '',
+    orderList: {}
   },
   },
   //显示分享页 
   //显示分享页 
   share: function () {
   share: function () {
-    this.shareDialog.share();
+    this.shareDialog = this.selectComponent("#share-dialog");
+    const data = {
+      avatar: this.data.organizer.avatar,
+      author: this.data.organizer.wechatName,
+      iconImg: this.data.groupPurchaseInfo.bgImg,
+      title: this.data.groupPurchaseInfo.productTitle,
+      path: `pages/groupPage/collage-details/collage-details`,
+      scene: `QR${this.data.orderId}`,
+      groupPurchaseInfo: this.data.groupPurchaseInfo
+    }
+    this.shareDialog.share(data);
   },
   },
 
 
   /**
   /**
@@ -40,14 +54,20 @@ Page({
     })
     })
     httpRequestApi.getMygroupInfo(orderId).success( res => {
     httpRequestApi.getMygroupInfo(orderId).success( res => {
       console.log('支付详情', res.data.data);
       console.log('支付详情', res.data.data);
-      const surplusNum = res.data.data.groupPurchaseOrder.headcount - res.data.data.groupPurchaseOrder.joinCount;
+      const groupOrder = res.data.data.groupPurchaseOrder;
+      const surplusNum = groupOrder.headcount - groupOrder.joinCount;
+      this.setData({
+        organizerUid: groupOrder.organizer,
+        orderList: res.data.data
+      })
       for(var i = 0; i < surplusNum; i++) {
       for(var i = 0; i < surplusNum; i++) {
         this.data.surplusList.push(1);
         this.data.surplusList.push(1);
       }
       }
-      //console.log(res.data.data.groupPurchaseOrder.closeTime - res.data.data.groupPurchaseOrder.gmtModified)
       //时间转换
       //时间转换
       const timeList = util.formatTime(res.data.data.groupPurchaseOrder.closeTime - res.data.data.groupPurchaseOrder.gmtModified);
       const timeList = util.formatTime(res.data.data.groupPurchaseOrder.closeTime - res.data.data.groupPurchaseOrder.gmtModified);
       this.setData({
       this.setData({
+        groupPurchaseInfo: res.data.data.groupPurchaseInfo,
+        organizer: res.data.data.organizer,
         surplusNum,
         surplusNum,
         joinUserList: res.data.data.joinUserList,
         joinUserList: res.data.data.joinUserList,
         surplusList: this.data.surplusList,
         surplusList: this.data.surplusList,
@@ -64,7 +84,7 @@ Page({
    * 生命周期函数--监听页面初次渲染完成
    * 生命周期函数--监听页面初次渲染完成
    */
    */
   onReady: function () {
   onReady: function () {
-    this.shareDialog = this.selectComponent("#share-dialog");
+    
   },
   },
 
 
   /**
   /**

+ 6 - 2
pages/groupPage/make-money/make-money.wxml

@@ -1,5 +1,9 @@
 <!--pages/groupPage/make-money/make-money.wxml-->
 <!--pages/groupPage/make-money/make-money.wxml-->
 <view class="details-head">
 <view class="details-head">
+    <view class="headImg-item-faqiren" wx:if="{{orderList.groupPurchaseOrder.groupType === 'PROMOTION'}}">
+            <image class="faqiren" src="../../../static/groupImg/faqiren.png"></image>
+            <image src="{{orderList.organizer.avatar}}"></image>
+    </view>
     <view class="headImg">
     <view class="headImg">
         <block wx:for="{{joinUserList}}" wx:key="{{index}}">
         <block wx:for="{{joinUserList}}" wx:key="{{index}}">
             <view class="headImg-item">
             <view class="headImg-item">
@@ -43,5 +47,5 @@
     </view>
     </view>
 </view>  
 </view>  
 
 
-<canvas canvas-id="myCanvas" style="width:370px; height: 507px; position: absolute; left: -99rpx; top: -999rpx;"></canvas>
-<shareDialog id="share-dialog" bindcustomevent="eventListener"/>
+<canvas canvas-id="myCanvas" style="width:370px; height: 507px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
+<shareDialog id="share-dialog" shareType='group' bindcustomevent="eventListener"/>

+ 24 - 0
pages/groupPage/make-money/make-money.wxss

@@ -9,23 +9,47 @@
 .headImg {
 .headImg {
     display: flex;
     display: flex;
     flex-wrap: wrap;
     flex-wrap: wrap;
+    justify-content: center;
     padding: 40rpx 0;
     padding: 40rpx 0;
     box-sizing: border-box;
     box-sizing: border-box;
+    margin-top:180rpx;    
+}
+
+.headImg-item-faqiren {
+    position: absolute;
+    left: 300rpx;
+    top: 30rpx;
+    width: 106rpx;
+    height: 106rpx;
+    border-radius: 50%;
+    margin: 20rpx 22rpx;
+    border: 2px solid #61CA54;
 }
 }
 
 
 .headImg-item {
 .headImg-item {
+    position: relative;
     width: 106rpx;
     width: 106rpx;
     height: 106rpx;
     height: 106rpx;
     border-radius: 50%;
     border-radius: 50%;
     margin: 20rpx 22rpx;
     margin: 20rpx 22rpx;
 }
 }
 
 
+.headImg-item-faqiren image,
 .headImg-item image {
 .headImg-item image {
     width: 100%;
     width: 100%;
     height: 100%;
     height: 100%;
     border-radius: 50%;
     border-radius: 50%;
 }
 }
 
 
+.headImg-item-faqiren .faqiren {
+    position: absolute;
+    right: -15rpx;
+    bottom: -40rpx;
+    width: 144rpx;
+    height: 48rpx;
+    border-radius: 0;
+}
+
 .shengyu {
 .shengyu {
  display: flex;
  display: flex;
  flex-direction: column;   
  flex-direction: column;   

+ 133 - 84
pages/groupPage/my-group/my-group.js

@@ -14,21 +14,40 @@ Page({
     content: [],    
     content: [],    
     productId: '',
     productId: '',
     orderId: '',
     orderId: '',
-    groupId: ''
+    groupId: '',
+    closeFlags: [],
+    ind: 0
   },
   },
     //跳转到团购详情页
     //跳转到团购详情页
   collageDetails: function ({currentTarget}) {
   collageDetails: function ({currentTarget}) {
-    console.log({currentTarget},666);
-    const orderId = currentTarget.dataset.orderid;//团购订单id
-    const num = currentTarget.dataset.num;//状态
-    console.log(num,orderId);
-    if(!num) {//如果 不是 这个状态,会根据 团购订单的id 跳转到 团购详情页。
+    const orderId = currentTarget.dataset.orderid;
+    const productId = currentTarget.dataset.productid;
+    const groupId = currentTarget.dataset.groupid;
+    const uid = currentTarget.dataset.uid;
+    const num = currentTarget.dataset.num;
+    const ind = currentTarget.dataset.ind;
+    this.setData({
+      ind
+    })
+    console.log(num)
+    if(!num) {
       wx.navigateTo({
       wx.navigateTo({
         url: `/pages/groupPage/collage-details/collage-details?orderId=${orderId}`
         url: `/pages/groupPage/collage-details/collage-details?orderId=${orderId}`
       })
       })
     } else {
     } else {
-      
-  
+      if(this.data.closeFlags[ind]) {
+        this.popup.close();
+        this.setData({
+          productId,
+          orderId,
+          groupId
+        })
+        this.dialog(uid);
+      }else {
+        wx.navigateTo({
+          url: `/pages/groupPage/collage-details/collage-details?orderId=${orderId}&read=true`
+        })
+      }
     }
     }
   },
   },
 
 
@@ -36,8 +55,7 @@ Page({
    * 生命周期函数--监听页面加载
    * 生命周期函数--监听页面加载
    */
    */
   onLoad: function (option) {
   onLoad: function (option) {
-    console.log(option.title);
-    if (option.title) {
+    if (option && option.title) {
       wx.setNavigationBarTitle({
       wx.setNavigationBarTitle({
         title: option.title//页面标题为路由参数
         title: option.title//页面标题为路由参数
       });
       });
@@ -50,92 +68,111 @@ Page({
         return
         return
       }
       }
       console.log('我的团', res.data.data.list)
       console.log('我的团', res.data.data.list)
-      this.setData({
-        myGroupList: res.data.data.list
-      })
       res.data.data.list.forEach(element => {
       res.data.data.list.forEach(element => {
-        console.log(element.status)
-        if(element.status == 'successed') {
-          this.setData({
-            productId: element.productId,
-            orderId: element.id,
-            groupId: element.groupId
-          })
-          if(wx.getStorageSync(uid) == element.organizer) {
-            this.setData({
-              typeOf: 'success',
-              title: '恭喜 !',
-              headTextOne: '您发起的团购拼团成功',
-              content: [
-                {
-                    text: "领袖体质魅力无穷!",
-                    color: "#000"
-                },
-                {
-                    text: " 您可以继续发起新的团购,",
-                    color: "#000"
-                },
-                {
-                  text: " 不再需要支付本课程费用,拼团成功,",
-                  color: "#FF9B00"
-                },                          
-                {
-                    text: " 您将得到xxx元奖励。",
-                    color: "#FF0000"
-                }
-              ],
-            })
-          }else {
-            this.setData({
-              typeOf: 'success',
-              title: '拼团成功 ! ',
-              headTextOne: '您参与的团购拼团成功',
-              headTextTwo: '订单号:12344',
-              content: [
-                {
-                    text: "感谢团长的分享",
-                    color: "#000"
-                },
-                {
-                    text: " 您也可以发起新的团购分享给需要的朋友们,",
-                    color: "#000"
-                },
-                {
-                    text: "作为新的发起人,您无需在支付本课程费用;",
-                    color: "#FF0000"
-                },
-                {
-                  text: "团购成功,您将得到xxx元奖励。",
-                  color: "#FF0000"
-                }                          
-              ],
-            })
-          }
+        if(element.status == 'SUCCESSED') {
+          this.data.closeFlags.push(true);
+        }else {
+          this.data.closeFlags.push(false);
         }
         }
       });
       });
+      this.setData({
+        closeFlags: this.data.closeFlags,
+        myGroupList: res.data.data.list
+      })
     }).fail( error => {
     }).fail( error => {
       console.log('错误', error)
       console.log('错误', error)
     })
     })
   },
   },
+  dialog: function (uid) {
+      if(wx.getStorageSync('uid') == uid) {
+        this.setData({
+          typeOf: 'success',
+          title: '恭喜 !',
+          headTextOne: '您发起的团购拼团成功',
+          content: [
+            {
+                text: "领袖体质魅力无穷!",
+                color: "#000"
+            },
+            {
+                text: " 您可以继续发起新的团购,",
+                color: "#000"
+            },
+            {
+              text: " 不再需要支付本课程费用,拼团成功,",
+              color: "#FF9B00"
+            },                          
+            {
+                text: " 您将得到xxx元奖励。",
+                color: "#FF0000"
+            }
+          ],
+        })
+      }else {
+        this.setData({
+          typeOf: 'success',
+          title: '拼团成功 ! ',
+          headTextOne: '您参与的团购拼团成功',
+          headTextTwo: '订单号:12344',
+          content: [
+            {
+                text: "感谢团长的分享",
+                color: "#000"
+            },
+            {
+                text: " 您也可以发起新的团购分享给需要的朋友们,",
+                color: "#000"
+            },
+            {
+                text: "作为新的发起人,您无需在支付本课程费用;",
+                color: "#FF0000"
+            },
+            {
+              text: "团购成功,您将得到xxx元奖励。",
+              color: "#FF0000"
+            }                          
+          ],
+        })
+      }
+  },
+  close: function () {
+    const ind = this.data.ind;
+    this.data.closeFlags[ind] = false;
+    this.setData({
+      closeFlags: this.data.closeFlags
+    })
+    console.log(this.data.closeFlags)
+  },
 
 
   //再次发起团
   //再次发起团
   group: function () {
   group: function () {
-    // wx.showModal({
-    //   title: '提示',
-    //   content: '再次发起团',
-    //   success (res) {
-    //     if (res.confirm) {
-    //       console.log('用户点击确定')
-    //     } else if (res.cancel) {
-    //       console.log('用户点击取消')
-    //     }
-    //   }
-    // })
+    debugger;
     const productId = this.data.productId;
     const productId = this.data.productId;
     const groupId = this.data.groupId;
     const groupId = this.data.groupId;
     const id = this.data.orderId;
     const id = this.data.orderId;
-    wx.navigateTo({
-      url: `/pages/groupPage/make-money/make-money?productId=${productId}&id=${id}&groupId=${groupId}`
+    debugger;
+    //开始发起团购
+    httpRequestApi.SendGroupPurchas({
+      productId,
+      groupId
+    }).success((res) => {
+      console.log('发起团购', res);
+      debugger;
+      if (res.data.message) {
+        wx.showModal({
+          title: '提示',
+          content: res.data.message,
+          success:(res) => {
+          }
+        })
+        return false;
+      }
+      wx.navigateTo({
+        url: `/pages/groupPage/make-money/make-money?productId=${productId}&id=${res.data.data.groupPurchaseOrder.id}&groupId=${groupId}`
+      })
+      this.close();
+    }).fail((error) => {
+
     })  
     })  
   },
   },
 
 
@@ -143,7 +180,7 @@ Page({
    * 生命周期函数--监听页面初次渲染完成
    * 生命周期函数--监听页面初次渲染完成
    */
    */
   onReady: function () {
   onReady: function () {
-
+    this.popup = this.selectComponent("#popup");
   },
   },
 
 
   /**
   /**
@@ -186,5 +223,17 @@ Page({
    */
    */
   onShareAppMessage: function () {
   onShareAppMessage: function () {
 
 
+  },
+  onPullDownRefresh: function () {
+    this.onLoad();
+    
+    wx.showNavigationBarLoading() //在标题栏中显示加载
+    //模拟加载
+    setTimeout(function()
+    {
+      // complete
+      wx.hideNavigationBarLoading() //完成停止加载
+      wx.stopPullDownRefresh() //停止下拉刷新
+    },1500);
   }
   }
 })
 })

+ 5 - 3
pages/groupPage/my-group/my-group.wxml

@@ -3,21 +3,23 @@
     <scroll-view scroll-y="{{true}}">
     <scroll-view scroll-y="{{true}}">
         <view class="my-group-content">
         <view class="my-group-content">
             <block wx:for="{{myGroupList}}" wx:key="{{index}}">
             <block wx:for="{{myGroupList}}" wx:key="{{index}}">
-                <view class="group-item" bindtap="collageDetails" data-num="{{item.status==='SUCCESSED'}}" data-orderId="{{item.id}}">
-                    <image class="item-img" src="{{item.iconImg}}" style="background: red;"></image>
+                <view class="group-item" bindtap="collageDetails" data-ind="{{index}}" data-num="{{item.status==='SUCCESSED'}}" data-orderId="{{item.id}}" data-groupId="{{item.groupId}}" data-productId="{{item.productId}}" data-uid="{{item.organizer}}">
+                    <image class="item-img" src="{{item.iconImg}}" ></image>
                     <view id="grade">{{item.groupTitle}}</view>
                     <view id="grade">{{item.groupTitle}}</view>
+                    <image class="jiang" src="../../../static/groupImg/jiang.png" wx:if="{{(item.groupType== 'PROMOTION') && (item.status==='SUCCESSED') }}"></image>
                     <image class="type-img" src="../../../static/groupImg/{{item.status==='SUCCESSED' ? 'yisuccess' : 'weisuccess' }}.png"></image>
                     <image class="type-img" src="../../../static/groupImg/{{item.status==='SUCCESSED' ? 'yisuccess' : 'weisuccess' }}.png"></image>
                 </view> 
                 </view> 
             </block>
             </block>
         </view>
         </view>
     </scroll-view>
     </scroll-view>
 </view>
 </view>
-
 <popup
 <popup
+    id="popup"
     typeOf="{{typeOf}}"
     typeOf="{{typeOf}}"
     title="{{title}}"
     title="{{title}}"
     headTextOne="{{headTextOne}}"
     headTextOne="{{headTextOne}}"
     headTextTwo="{{headTextTwo}}"
     headTextTwo="{{headTextTwo}}"
     content="{{content}}"
     content="{{content}}"
     bindGroup="group"
     bindGroup="group"
+    bindClose="close"
 ></popup>
 ></popup>

+ 8 - 0
pages/groupPage/my-group/my-group.wxss

@@ -38,3 +38,11 @@
     width: 100rpx;
     width: 100rpx;
     height: 40rpx;
     height: 40rpx;
 }
 }
+
+.jiang {
+    position: absolute;
+    right: 5rpx;
+    bottom: 55rpx;
+    width: 82rpx;
+    height: 68rpx;   
+}

+ 39 - 22
pages/index/index.js

@@ -20,6 +20,9 @@ import {
 // import '../../utils/hls';
 // import '../../utils/hls';
 import httpRequestApi from '../../utils/APIClient';
 import httpRequestApi from '../../utils/APIClient';
 import httputil from '../../utils/httpUtil';
 import httputil from '../../utils/httpUtil';
+import {
+  GetQueryString
+} from '../../utils/util';
 
 
 Page({
 Page({
   data: {
   data: {
@@ -78,12 +81,19 @@ Page({
       templates
       templates
     });
     });
     if (myIndex == 0) {
     if (myIndex == 0) {
+
       groupInit(this);
       groupInit(this);
     }
     }
     if (myIndex == 1) {
     if (myIndex == 1) {
+      this.setData({
+        recommendPageNo: 1
+      })
       hotInit(this);
       hotInit(this);
     }
     }
     if (myIndex == 2) {
     if (myIndex == 2) {
+      this.setData({
+        followPageNo: 1
+      })
       followInit(this);
       followInit(this);
     }
     }
     if (myIndex == 3) {
     if (myIndex == 3) {
@@ -97,28 +107,19 @@ Page({
       // });
       // });
     }
     }
   },
   },
-  aa: function () {
-    let a = new Promise((resolve, reject) => {
-      resolve(console.log('aa'))
-    });
-    return a;
-  },
-  bb: function () {
-    let b = new Promise((resolve, reject) => {
-      resolve(console.log('bb'))
-    });
-    return b
-  },
-  cc: function () {
-    let c = new Promise((resolve, reject) => {
-      console.log('cc')
-    });
-    return c
-  },
   onLoad: function (options) {
   onLoad: function (options) {
-    console.log(options)
-    this.uid = wx.getStorageSync('uid');
 
 
+    this.uid = wx.getStorageSync('uid');
+    // const type = GetQueryString(decodeURIComponent(options.scene),"type");
+    // const sceneId = GetQueryString( decodeURIComponent(options.scene),"id");
+    // console.log(type,sceneId)
+    // switch(type){
+    //   case "works":
+    //   wx.navigateTo({
+    //     url: `../social/works/works?id=${sceneId}&title="测试"`
+    //   })
+    //   break
+    // };
     wx.getSystemInfo({
     wx.getSystemInfo({
       success: (res) => {
       success: (res) => {
         this.setData({
         this.setData({
@@ -172,10 +173,10 @@ Page({
   },
   },
   // 触底加载
   // 触底加载
   onReachBottom: function () {
   onReachBottom: function () {
-    console.log(this.data.recommendPageNo)
-    console.log('bottom')
+
     // 当前在推荐页面 加载推荐
     // 当前在推荐页面 加载推荐
     if (this.data.myIndex === 1) {
     if (this.data.myIndex === 1) {
+      console.log(this.data.recommendPageNo)
       this.setData({
       this.setData({
         recommendPageNo: this.data.recommendPageNo + 1
         recommendPageNo: this.data.recommendPageNo + 1
       })
       })
@@ -198,5 +199,21 @@ Page({
         console.log('没有更多')
         console.log('没有更多')
       }
       }
     }
     }
+  },
+  onPullDownRefresh: function () {
+    //当前在团购页下拉加载
+    if (this.data.myIndex === 0) {
+      groupInit(this);
+    }
+    
+    wx.showNavigationBarLoading() //在标题栏中显示加载
+    //模拟加载
+    setTimeout(function()
+    {
+      // complete
+      wx.hideNavigationBarLoading() //完成停止加载
+      wx.stopPullDownRefresh() //停止下拉刷新
+    },1500);
   }
   }
+  
 })
 })

+ 4 - 3
pages/index/index.wxss

@@ -23,7 +23,7 @@
   width: 100%;
   width: 100%;
   height: 80rpx;
   height: 80rpx;
   background:#fff;
   background:#fff;
-  color: #6a6a6a;
+  color: #383838;
   box-sizing: border-box;
   box-sizing: border-box;
   display: flex;
   display: flex;
   justify-content: space-between;
   justify-content: space-between;
@@ -39,8 +39,9 @@
   justify-content: center;
   justify-content: center;
   align-items: center;
   align-items: center;
   width: 164rpx;
   width: 164rpx;
-  height: 64rpx;
-  font-size: 36rpx;
+  height: 60rpx;
+  line-height: 60rpx;
+  font-size: 32rpx;
   border-radius: 30rpx;
   border-radius: 30rpx;
   background: #fff;
   background: #fff;
 }
 }

+ 44 - 13
pages/main/class/class.js

@@ -17,10 +17,15 @@ Page({
     pageNo: 1,
     pageNo: 1,
     totalNo: 0,
     totalNo: 0,
     collectFlag: false,
     collectFlag: false,
+    goBackHome: false
   },
   },
   onLoad: function (option) {
   onLoad: function (option) {
     console.log(option);
     console.log(option);
-    
+    if(option.scene){
+      this.setData({
+          goBackHome: true
+      })
+  }
     this.setData({
     this.setData({
       // title: option.title,
       // title: option.title,
       id: option.id
       id: option.id
@@ -54,11 +59,34 @@ Page({
     })
     })
   },
   },
   goToReading: function () {
   goToReading: function () {
-    let id = this.data.id;
-    let title = this.data.title;
-    wx.navigateTo({
-      url: `../../main/reading/reading?id=${id}`
-    })
+    
+    let classId = this.data.id;
+    httpRequestApi.checkLesson(classId).success(res=>{
+      const productId = res.data.data[0];
+      httpRequestApi.areYouSuper(res.data.data).success(res => {
+        if(res.data.success){
+          wx.navigateTo({
+            url: `../../main/reading/reading?id=${classId}`
+          })
+        } else {
+          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('用户点击取消')
+              }
+            }
+          })
+        }
+      })
+    });
+    
   },
   },
   openShare: function (e) {
   openShare: function (e) {
     // this.setData({
     // this.setData({
@@ -87,21 +115,24 @@ Page({
     }
     }
 },
 },
   goToWorks: function (e) {
   goToWorks: function (e) {
-    this.videoCtx = wx.createVideoContext('myVideo', this);
-    this.videoCtx.stop();
+    console.log(this.data.works)
+    // this.videoCtx = wx.createVideoContext('myVideo', this);
+    if(this.videoCtx){
+      this.videoCtx.stop(); 
+    }
     console.log(e);
     console.log(e);
-    let readId = e.target.dataset.uid;
+    let readId = e.target.dataset.id;
     let title = this.data.title;
     let title = this.data.title;
     wx.navigateTo({
     wx.navigateTo({
-      url: `../../social/works/works?id=${readId}&tilte=${title}`
+      url: `../../social/works/works?id=${readId}&title=${title}`
     })
     })
   },
   },
   collect: function (e) {
   collect: function (e) {
     // let uid =  wx.getStorageSync('uid');
     // let uid =  wx.getStorageSync('uid');
     let data = {
     let data = {
       targetCode: this.data.id,
       targetCode: this.data.id,
-      title: this.data.title,
-      iconImg: this.data.iconImg
+      // title: this.data.title,
+      // iconImg: this.data.iconImg
     }
     }
     httpRequestApi.collectClass(this.uid, data).success(res => {
     httpRequestApi.collectClass(this.uid, data).success(res => {
       this.setData({
       this.setData({
@@ -114,7 +145,7 @@ Page({
     const data = {
     const data = {
       lessonId: this.data.id,
       lessonId: this.data.id,
       pageNo: this.data.pageNo,
       pageNo: this.data.pageNo,
-      pageSize: 1
+      pageSize: 10
     };
     };
     httpRequestApi.getClassRead(this.uid, data).success(res => {
     httpRequestApi.getClassRead(this.uid, data).success(res => {
       const readInfo = res.data.data.list;
       const readInfo = res.data.data.list;

+ 2 - 1
pages/main/class/class.json

@@ -5,6 +5,7 @@
     "component": true,
     "component": true,
     "usingComponents": {
     "usingComponents": {
         "shareDialog": "/component/share/share",
         "shareDialog": "/component/share/share",
-        "popup": "/component/popup/popup"
+        "popup": "/component/popup/popup",
+        "goBackHome": "/component/goBackHome/goBackHome"
     }
     }
 }
 }

+ 11 - 5
pages/main/class/class.wxml

@@ -5,7 +5,7 @@
             <image class="peoplesIcon" src="../../../static/image/peoples.png" />
             <image class="peoplesIcon" src="../../../static/image/peoples.png" />
             <view class="title">共有{{total}}人完成了录音</view>
             <view class="title">共有{{total}}人完成了录音</view>
         </view>
         </view>
-        <view class="workCard" wx:for="{{works}}" wx:key="{{index}}" bindtap="goToWorks" data-uid="{{item.uid}}">
+        <view class="workCard" wx:for="{{works}}" wx:key="{{index}}" bindtap="goToWorks" data-id="{{item.id}}">
             <image class="avatar" src="{{item.avatar}}" />
             <image class="avatar" src="{{item.avatar}}" />
             <view class="name">
             <view class="name">
                 <text class="nickName">{{item.nickName}}</text>
                 <text class="nickName">{{item.nickName}}</text>
@@ -27,11 +27,17 @@
             <image class="microphone" src="../../../static/image/microphone.png" />
             <image class="microphone" src="../../../static/image/microphone.png" />
             <text>我要朗读</text>
             <text>我要朗读</text>
         </view>
         </view>
-        <view class="shareBtn footerBtn" bindtap="openShare">
-            <image src="../../../static/image/share.png" />
-            <text>分享</text>
+        <view class="shareBtn footerBtn">
+            <!-- <image src="../../../static/image/share.png" />
+            <text>分享</text> -->
+            <button open-type="share" plain="true" hover-class="none">
+                <image src="../../../static/image/share.png" />
+                <text>分享</text>
+            </button>
         </view>
         </view>
+        
     </view>
     </view>
-    <canvas canvas-id="myCanvas" style="width:370px;z-index=99999; height: 507px; position: absolute; left: -99rpx; top: -999rpx;"></canvas>
+    <canvas canvas-id="myCanvas" style="width:370px;z-index=99999; height: 507px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
     <shareDialog id="share-dialog" shareType='class' />
     <shareDialog id="share-dialog" shareType='class' />
+    <goBackHome id="goBackHome" shareType="{{goBackHome}}" wx:if="{{goBackHome}}" />
 </view>
 </view>

+ 51 - 14
pages/main/class/class.wxss

@@ -2,9 +2,12 @@
     width: 750rpx;
     width: 750rpx;
     height: 428rpx;
     height: 428rpx;
 }
 }
-.classPage{
+
+.classPage {
     background: #e8e8e8;
     background: #e8e8e8;
+    height: 100%;
 }
 }
+
 /**底部按钮区域**/
 /**底部按钮区域**/
 .footSection {
 .footSection {
     width: 750rpx;
     width: 750rpx;
@@ -40,53 +43,87 @@
     flex-direction: column;
     flex-direction: column;
     margin-top: 60rpx;
     margin-top: 60rpx;
 }
 }
-.collectBtn{
+
+.collectBtn {
     margin-left: 80rpx
     margin-left: 80rpx
 }
 }
-.shareBtn{
-    margin-right: 80rpx
+
+.shareBtn button {
+    display: flex;
+    flex-direction: column;
+    outline: none;
+    border: 0;
+    padding: 0;
+    margin: 0;
+    border-radius: 0;
+    /* line-height: 0; */
+    background: #f7f7f7;
+}
+
+button::after {
+    width: 0;
+    height: 0;
+    top: 0;
+    left: 0
+}
+
+.shareBtn {
+    margin-right: 80rpx;
+    padding: 0;
+    /* background: #fff; */
 }
 }
+
 .footerBtn image {
 .footerBtn image {
     width: 50rpx;
     width: 50rpx;
     height: 48rpx;
     height: 48rpx;
-    display:block;
-    margin: 0 auto 18rpx; 
+    display: block;
+    margin: 0 auto 18rpx;
 }
 }
+
 .footerBtn text {
 .footerBtn text {
     width: 112rpx;
     width: 112rpx;
     height: 40rpx;
     height: 40rpx;
+    line-height:40rpx;
     font-size: 28rpx;
     font-size: 28rpx;
     color: #414141;
     color: #414141;
     text-align: center;
     text-align: center;
 }
 }
+
 .footSection .microphone {
 .footSection .microphone {
     display: block;
     display: block;
     margin: -6rpx auto 0;
     margin: -6rpx auto 0;
     width: 108rpx;
     width: 108rpx;
     height: 106rpx;
     height: 106rpx;
 }
 }
-.footSection .readingBtn text{
+
+.footSection .readingBtn text {
     margin-top: -10rpx;
     margin-top: -10rpx;
 }
 }
+
 .readWorksSection {
 .readWorksSection {
     width: 100%;
     width: 100%;
-    height: 100%;
+    /* height: 100%; */
     background: #e8e8e8;
     background: #e8e8e8;
-    margin-bottom: 150rpx;
+    padding-bottom:75px;
+    /* margin-bottom: 150rpx; */
+    /* min-height: 710rpx; */
+
 }
 }
 
 
-.readWorksSection  .peopleNum{
+.readWorksSection .peopleNum {
     display: flex;
     display: flex;
     align-items: center;
     align-items: center;
     margin: 10rpx 0 10rpx 24rpx;
     margin: 10rpx 0 10rpx 24rpx;
 
 
 }
 }
-.peopleNum .peoplesIcon{
+
+.peopleNum .peoplesIcon {
     width: 28rpx;
     width: 28rpx;
     height: 28rpx;
     height: 28rpx;
     margin-right: 10rpx;
     margin-right: 10rpx;
 }
 }
-.peopleNum .title{
+
+.peopleNum .title {
     font-size: 24rpx;
     font-size: 24rpx;
     color: #5d5d5d;
     color: #5d5d5d;
     height: 24rpx;
     height: 24rpx;
@@ -95,8 +132,8 @@
 
 
 .readWorksSection .workCard {
 .readWorksSection .workCard {
     width: 716rpx;
     width: 716rpx;
-    /* height: 132rpx; */
-    height: 700rpx;
+    height: 132rpx;
+    /* height: 700rpx; */
     display: flex;
     display: flex;
     align-items: center;
     align-items: center;
     flex-direction: row;
     flex-direction: row;

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

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

+ 8 - 0
pages/main/week/week.wxss

@@ -51,3 +51,11 @@
     justify-content: space-between;
     justify-content: space-between;
     align-items: center;
     align-items: center;
 }
 }
+.hotWareCard .wareCardTip {
+    width: 178rpx;
+    height: 40rpx;
+    display: block;
+    text-align: left;
+    color: #414141;
+    font-size: 24rpx;
+}

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

@@ -20,7 +20,8 @@ Page({
           console.log(this.data.count);
           console.log(this.data.count);
         })
         })
         wx.setNavigationBarTitle({
         wx.setNavigationBarTitle({
-            title: option.count + '条回复' //页面标题为路由参数
+            // title: option.count + '条回复' //页面标题为路由参数
+            title: '回复详情' //页面标题为路由参数
         })
         })
         this.uid = wx.getStorageSync('uid');
         this.uid = wx.getStorageSync('uid');
         this.getReplyDetail();
         this.getReplyDetail();
@@ -50,7 +51,7 @@ Page({
     getReplyDetail: function () {
     getReplyDetail: function () {
         // let uid = wx.getStorageSync('uid');
         // let uid = wx.getStorageSync('uid');
         httpRequestApi.getReplyComment(this.uid, this.data.postId).success((res) => {
         httpRequestApi.getReplyComment(this.uid, this.data.postId).success((res) => {
-            // debugger;
+            console.log(res);
             const replyList = res.data.data.replyVOList;
             const replyList = res.data.data.replyVOList;
             const replied = res.data.data;
             const replied = res.data.data;
             const replyTemp = [];
             const replyTemp = [];
@@ -108,6 +109,8 @@ Page({
         httpRequestApi.postReplyComment(this.uid, data).success(res => {
         httpRequestApi.postReplyComment(this.uid, data).success(res => {
             this.setData({
             this.setData({
                 replyModal: false
                 replyModal: false
+            },()=>{
+                this.getReplyDetail();
             })
             })
         });
         });
     },
     },

+ 104 - 28
pages/social/works/works.js

@@ -22,31 +22,40 @@ Page({
         id: '',
         id: '',
         path: '',
         path: '',
         replyModal: false,
         replyModal: false,
-        totalRead: 0
+        totalRead: 0,
+        pageNo: 1,
+        pageSize: 2,
+        goBackHome: false
         // shareFlag: false
         // shareFlag: false
     },
     },
     onLoad: function (option) {
     onLoad: function (option) {
-        console.log(option.title);
-        // debugger;
+        console.log(option)
         let id = option.id ? option.id : option.scene.replace('QR', '')
         let id = option.id ? option.id : option.scene.replace('QR', '')
+        if(option.scene){
+            this.setData({
+                goBackHome: true
+            })
+        }
         wx.setNavigationBarTitle({
         wx.setNavigationBarTitle({
             title: option.title //页面标题为路由参数
             title: option.title //页面标题为路由参数
         })
         })
 
 
+        
+        this.uid = wx.getStorageSync('uid');
         this.setData({
         this.setData({
             title: option.title,
             title: option.title,
-            id
+            id,
+            myUid: this.uid
         })
         })
-        this.uid = wx.getStorageSync('uid');
         this.getWorks(this.uid, id);
         this.getWorks(this.uid, id);
     },
     },
-    onHide: function(){
-        if(this.innerAudioContext){
+    onHide: function () {
+        if (this.innerAudioContext) {
             this.innerAudioContext.stop();
             this.innerAudioContext.stop();
         }
         }
     },
     },
-    onUnload: function(){
-        if(this.innerAudioContext){
+    onUnload: function () {
+        if (this.innerAudioContext) {
             this.innerAudioContext.stop();
             this.innerAudioContext.stop();
         }
         }
     },
     },
@@ -59,7 +68,7 @@ Page({
             const works = res.data.data.userRead;
             const works = res.data.data.userRead;
             const othersTemp = [];
             const othersTemp = [];
             others.forEach((item) => {
             others.forEach((item) => {
-              const temp = {};
+                const temp = {};
                 temp.uid = item.userRead.id;
                 temp.uid = item.userRead.id;
                 temp.title = item.userRead.title;
                 temp.title = item.userRead.title;
                 temp.image = item.user.avatar;
                 temp.image = item.user.avatar;
@@ -67,7 +76,7 @@ Page({
                 othersTemp.push(temp);
                 othersTemp.push(temp);
             });
             });
             this.setData({
             this.setData({
-                user: othersTemp, 
+                user: othersTemp,
                 totalRead: res.data.data.totalRead,
                 totalRead: res.data.data.totalRead,
                 author: author.wechatName,
                 author: author.wechatName,
                 authorAvatar: author.avatar,
                 authorAvatar: author.avatar,
@@ -85,9 +94,19 @@ Page({
                 // 播放音频失败的回调
                 // 播放音频失败的回调
             })
             })
             this.innerAudioContext.src = this.data.audioSrc; // 这里可以是录音的临时路径
             this.innerAudioContext.src = this.data.audioSrc; // 这里可以是录音的临时路径
-            this.getReply();
+
         });
         });
     },
     },
+    onShow(options) {
+        console.log(options)
+        this.setData({
+            replyList: [],
+            pageNo: 1,
+            pageSize: 2
+        }, () => {
+            this.getReply();
+        })
+    },
     likeWorks: function (e) {
     likeWorks: function (e) {
         if (this.data.isLike) {
         if (this.data.isLike) {
             wx.showToast({
             wx.showToast({
@@ -122,7 +141,7 @@ Page({
             iconImg: this.data.iconImg,
             iconImg: this.data.iconImg,
             title: this.data.title,
             title: this.data.title,
             path: `pages/social/works/works`,
             path: `pages/social/works/works`,
-            scene: `QR${this.data.id}`
+            scene: `this.data.id`
             // tip: this.data.tip,
             // tip: this.data.tip,
         }
         }
         this.shareDialog.share(data);
         this.shareDialog.share(data);
@@ -140,11 +159,37 @@ Page({
         this.innerAudioContext.pause();
         this.innerAudioContext.pause();
     },
     },
     goToReading: function () {
     goToReading: function () {
-        let id = this.data.id;
-        let title = this.data.title;
-        wx.navigateTo({
-            url: `../../main/reading/reading?id=${this.data.classId}`
-        })
+
+        // wx.navigateTo({
+        //     url: `../../main/reading/reading?id=${this.data.classId}`
+        // })
+
+        const classId = this.data.classId;
+        httpRequestApi.checkLesson(classId).success(res => {
+            const productId = res.data.data[0];
+            httpRequestApi.areYouSuper(res.data.data).success(res => {
+                if (res.data.success) {
+                    wx.navigateTo({
+                        url: `../../main/reading/reading?id=${classId}`
+                    })
+                } else {
+                    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) {
     onShareAppMessage: function (res) {
         if (res.from === 'button') {
         if (res.from === 'button') {
@@ -203,19 +248,19 @@ Page({
     // 去其他用户的作品页
     // 去其他用户的作品页
     goToOthers: function (e) {
     goToOthers: function (e) {
         wx.navigateTo({
         wx.navigateTo({
-          url: `../../social/works/works?id=${e.currentTarget.dataset.uid}&title=${e.currentTarget.dataset.title}`
+            url: `../../social/works/works?id=${e.currentTarget.dataset.uid}&title=${e.currentTarget.dataset.title}`
         })
         })
     },
     },
     // 查询回复
     // 查询回复
     getReply: function () {
     getReply: function () {
         // let uid = wx.getStorageSync('uid');
         // let uid = wx.getStorageSync('uid');
         let columnId = this.data.id;
         let columnId = this.data.id;
-        let pageNo = 1;
-        let pageSize = 10;
+        let pageNo = this.data.pageNo;
+        let pageSize = this.data.pageSize;
         httpRequestApi.getReply(this.uid, columnId, pageNo, pageSize).success((res) => {
         httpRequestApi.getReply(this.uid, columnId, pageNo, pageSize).success((res) => {
             console.log(res.data.data.list);
             console.log(res.data.data.list);
             const replyList = res.data.data.list;
             const replyList = res.data.data.list;
-            const replyTemp = [];
+            // const replyTemp = [];
             replyList.forEach((item) => {
             replyList.forEach((item) => {
                 const temp = {};
                 const temp = {};
                 temp.nickName = item.user.wechatName;
                 temp.nickName = item.user.wechatName;
@@ -226,11 +271,12 @@ Page({
                 temp.time = formatDate(item.gmtModified, 3);
                 temp.time = formatDate(item.gmtModified, 3);
                 temp.likes = item.postsAttributeInfo.favors || 0;
                 temp.likes = item.postsAttributeInfo.favors || 0;
                 console.log(temp.time)
                 console.log(temp.time)
-                replyTemp.push(temp);
+                this.data.replyList.push(temp);
             });
             });
             this.setData({
             this.setData({
-                replyList: replyTemp,
-                total: res.data.data.totalSize
+                replyList: this.data.replyList,
+                total: res.data.data.totalSize,
+                totalPage: res.data.data.totalNo
             })
             })
         });
         });
     },
     },
@@ -261,15 +307,35 @@ Page({
             }
             }
             httpRequestApi.postReply(this.uid, data).success(res => {
             httpRequestApi.postReply(this.uid, data).success(res => {
                 console.log(res);
                 console.log(res);
+                this.setData({
+                    inputValue: ''
+                })
+                this.getReply();
             });
             });
+            // 评论成功后刷新数据
+
+        }
+    },
+    // 触底加载
+    onReachBottom: function () {
+        // 当前在推荐页面 加载推荐
+        if (this.data.pageNo <= this.data.totalPage) {
+            this.setData({
+                pageNo: this.data.pageNo + 1
+            }, () => {
+                this.getReply();
+            })
         }
         }
+
+
     },
     },
     // 设置点击时的id
     // 设置点击时的id
     setSBId: function (e) {
     setSBId: function (e) {
         console.log(e)
         console.log(e)
         this.setData({
         this.setData({
             replySBId: e.currentTarget.dataset.id,
             replySBId: e.currentTarget.dataset.id,
-            replyModal: true
+            replyModal: true,
+            replyIndex: e.currentTarget.dataset.index
         })
         })
     },
     },
     // 回复某个评论
     // 回复某个评论
@@ -279,8 +345,13 @@ Page({
             content: this.data.inputSBValue
             content: this.data.inputSBValue
         }
         }
         httpRequestApi.postReplyComment(this.uid, data).success(res => {
         httpRequestApi.postReplyComment(this.uid, data).success(res => {
+            console.log(res)
+            const replyWho = this.data.replyList[this.data.replyIndex];
+            const indexStr = `replyList[${this.data.replyIndex}]`;
+            replyWho.replyCount++;
             this.setData({
             this.setData({
-                replyModal: false
+                replyModal: false,
+                [indexStr]: replyWho
             })
             })
         });
         });
     },
     },
@@ -356,5 +427,10 @@ Page({
             }
             }
         })
         })
     },
     },
-
+    // 回到首页
+    goBackHome: function(){
+        wx.redirectTo({
+            url: '../../index/index'
+        })
+    }
 })
 })

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

@@ -2,6 +2,10 @@
     "component": true,
     "component": true,
     "usingComponents": {
     "usingComponents": {
         "shareDialog": "/component/share/share",
         "shareDialog": "/component/share/share",
-        "popup": "/component/popup/popup"
-    }
+        "popup": "/component/popup/popup",
+        "goBackHome": "/component/goBackHome/goBackHome"
+    },
+    "window": {
+        "onReachBottomDistance": 50
+      }
 }
 }

+ 18 - 12
pages/social/works/works.wxml

@@ -3,11 +3,12 @@
     <view class="readAuthorSection">
     <view class="readAuthorSection">
         <image class="avatar" src="{{authorAvatar}}" />
         <image class="avatar" src="{{authorAvatar}}" />
         <text class="nickName">{{author}}</text>
         <text class="nickName">{{author}}</text>
-        <view class="like" bindtap="likeWorks">
-            <image src="{{isLike? '../../../static/image/liked.png' : '../../../static/image/like.png'}}" />
+        <view class="like" bindtap="likeWorks" wx:if="{{authorUid !== myUid}}">
+            <image src="{{isLike? '../../../static/image/red_like_empty.png' : '../../../static/image/red_like.png'}}" />
             <text class="likeBtn">{{isLike ? '已' : ''}}点赞</text>
             <text class="likeBtn">{{isLike ? '已' : ''}}点赞</text>
         </view>
         </view>
-        <view class="follow">
+        <view class="follow" wx:if="{{authorUid !== myUid}}">
+            <image src="{{isFans? '../../../static/image/fully_heart.png' : '../../../static/image/empty_heart.png'}}" />
             <text class="followBtn" bindtap="follow">{{isFans ? '已' : ''}}关注</text>
             <text class="followBtn" bindtap="follow">{{isFans ? '已' : ''}}关注</text>
         </view>
         </view>
     </view>
     </view>
@@ -24,10 +25,10 @@
             </view>
             </view>
         </scroll-view>
         </scroll-view>
     </view>
     </view>
-    <!-- <view class="commentSection">
+    <view class="commentSection">
         <view class="title">评论({{total}})</view>
         <view class="title">评论({{total}})</view>
         <input class="commentInput" bindconfirm="sendHandler" confirm-type="send" placeholder="听了这么多,说点什么吧" bindinput="inputValue"></input>
         <input class="commentInput" bindconfirm="sendHandler" confirm-type="send" placeholder="听了这么多,说点什么吧" bindinput="inputValue"></input>
-    </view> -->
+    </view>
     <view class="commentArea">
     <view class="commentArea">
         <view class="commentItem" wx:for="{{replyList}}" wx:key="{{index}}">
         <view class="commentItem" wx:for="{{replyList}}" wx:key="{{index}}">
             <image class="avatar" src="{{item.avatar}}" />
             <image class="avatar" src="{{item.avatar}}" />
@@ -35,15 +36,15 @@
                 <text class="nickName">{{item.nickName}}</text>
                 <text class="nickName">{{item.nickName}}</text>
                 <text class="time">{{item.time}}</text>
                 <text class="time">{{item.time}}</text>
                 <text class="gut">{{item.text}}</text>
                 <text class="gut">{{item.text}}</text>
-                <view class="commentAll" bindtap="goToDetail" data-id="{{item.id}}" data-count="{{item.replyCount}}">
+                <view class="commentAll" bindtap="goToDetail" data-id="{{item.id}}" data-count="{{item.replyCount}}" wx:if="{{item.replyCount}}">
                     共有{{item.replyCount}}条评论
                     共有{{item.replyCount}}条评论
                 </view>
                 </view>
             </view>
             </view>
             <view class="btnWrapper">
             <view class="btnWrapper">
-                <image class="commentBtn" src="../../../static/image/comment.png" bindtap="setSBId" data-id="{{item.id}}" />
-                <text class="commentText">评论</text>
+                <image class="commentBtn" src="../../../static/image/comment.png" bindtap="setSBId" data-id="{{item.id}}" data-index="{{index}}" />
+                <text class="commentText" bindtap="setSBId" data-id="{{item.id}}" data-index="{{index}}">评论</text>
                 <image class="likeBtn" src="../../../static/image/like.png" data-index="{{index}}" data-likes="{{item.likes}}" data-id="{{item.id}}" bindtap="likeCommend" />
                 <image class="likeBtn" src="../../../static/image/like.png" data-index="{{index}}" data-likes="{{item.likes}}" data-id="{{item.id}}" bindtap="likeCommend" />
-                <text class="likeText">{{item.likes}}</text>
+                <text class="likeText" data-index="{{index}}" data-likes="{{item.likes}}" data-id="{{item.id}}" bindtap="likeCommend">{{item.likes}}</text>
             </view>
             </view>
         </view>
         </view>
     </view>
     </view>
@@ -67,11 +68,12 @@
         </view>
         </view>
     </view>
     </view>
     <!-- 分享框 -->
     <!-- 分享框 -->
-    <canvas canvas-id="myCanvas" style="width:370px;z-index=99999; height: 507px; position: absolute; left: -99rpx; top: -999rpx;"></canvas>
+    <!-- <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' shareId="{{id}}" />
     <!-- 评论框 -->
     <!-- 评论框 -->
     <view class="replySection" wx:if="{{replyModal}}">
     <view class="replySection" wx:if="{{replyModal}}">
-        <input bindblur="bindTextAreaBlur"  bindconfirm="replySB" confirm-type="send" placeholder="回复" bindinput="inputSBValue" auto-focus auto-height />
+        <input bindblur="bindTextAreaBlur" bindconfirm="replySB" confirm-type="send" placeholder="回复" bindinput="inputSBValue" auto-focus auto-height />
     </view>
     </view>
     <!-- 奖励弹窗 -->
     <!-- 奖励弹窗 -->
     <cover-view class="modalWrapper" wx:if="{{ifReward}}">
     <cover-view class="modalWrapper" wx:if="{{ifReward}}">
@@ -94,5 +96,9 @@
         </cover-view>
         </cover-view>
         <cover-image class="quitBtn" bindtap="quitReward" src="../../../static/groupImg/cha.png" />
         <cover-image class="quitBtn" bindtap="quitReward" src="../../../static/groupImg/cha.png" />
     </cover-view>
     </cover-view>
-    
+    <!-- 回到首页弹窗 -->
+    <!-- <view class="goBackHome" bindtap="goBackHome" wx:if="{{goBackHome}}">
+        <image src="../../../static/image/goBackHome.png" />
+    </view> -->
+    <goBackHome id="goBackHome" shareType="{{goBackHome}}" wx:if="{{goBackHome}}" />
 </view>
 </view>

+ 31 - 7
pages/social/works/works.wxss

@@ -21,7 +21,7 @@
 
 
 .readAuthorSection .nickName {
 .readAuthorSection .nickName {
     margin-left: 20rpx;
     margin-left: 20rpx;
-    width: 160rpx;
+    width: 250rpx;
     height: 46rpx;
     height: 46rpx;
     font-size: 32rpx;
     font-size: 32rpx;
     color: #101010;
     color: #101010;
@@ -32,15 +32,15 @@
     display: flex;
     display: flex;
     align-items: center;
     align-items: center;
     justify-content: center;
     justify-content: center;
-    margin-left: 90rpx;
+    /* margin-left: 90rpx; */
     width: 160rpx;
     width: 160rpx;
     height: 60rpx;
     height: 60rpx;
-    border: 2rpx solid rgba(255, 152, 0, 1);
+    border: 2rpx solid #FF0000;
     font-size: 28rpx;
     font-size: 28rpx;
     border-radius: 30rpx;
     border-radius: 30rpx;
     text-align: center;
     text-align: center;
     /* line-height: 60rpx; */
     /* line-height: 60rpx; */
-    color: #ff9800;
+    color: #FF0000;
 }
 }
 
 
 .readAuthorSection .like image {
 .readAuthorSection .like image {
@@ -51,15 +51,25 @@
 }
 }
 
 
 .readAuthorSection .follow {
 .readAuthorSection .follow {
+    display: flex;
+    align-items: center;
+    justify-content: center;
     margin-left: 12rpx;
     margin-left: 12rpx;
     width: 160rpx;
     width: 160rpx;
     height: 60rpx;
     height: 60rpx;
-    border: 2rpx solid #259b24;
+    border: 2rpx solid #ff0000;
     font-size: 28rpx;
     font-size: 28rpx;
     border-radius: 30rpx;
     border-radius: 30rpx;
     text-align: center;
     text-align: center;
     line-height: 60rpx;
     line-height: 60rpx;
-    color: #539bee;
+    color: #ff0000;
+}
+
+.readAuthorSection .follow image {
+    width: 36rpx;
+    height: 36rpx;
+    margin-right: 15rpx;
+
 }
 }
 
 
 .userSection {
 .userSection {
@@ -213,6 +223,7 @@
     right: 10rpx;
     right: 10rpx;
     display: flex;
     display: flex;
     align-items: center;
     align-items: center;
+    /* width: 200rpx; */
 }
 }
 
 
 .btnWrapper .commentBtn {
 .btnWrapper .commentBtn {
@@ -319,7 +330,7 @@ button::after {
 
 
 .footSection .microphone {
 .footSection .microphone {
     display: block;
     display: block;
-    margin: -6rpx auto 0;
+    margin:-12rpx auto 8rpx;
     width: 108rpx;
     width: 108rpx;
     height: 106rpx;
     height: 106rpx;
 }
 }
@@ -452,4 +463,17 @@ button::after {
     width: 100%;
     width: 100%;
     height: 300rpx;
     height: 300rpx;
     text-indent: 4rpx;
     text-indent: 4rpx;
+}
+
+.goBackHome {
+    width: 100rpx;
+    height: 100rpx;
+    position: fixed;
+    bottom: 168rpx;
+    right: 45rpx;
+
+}
+.goBackHome image{
+    width: 100%;
+    height: 100%;
 }
 }

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

@@ -44,7 +44,7 @@ Page({
     const data = {
     const data = {
       wechatName: e.detail.value.nickname || '',
       wechatName: e.detail.value.nickname || '',
       mobile: '',
       mobile: '',
-      gender: 1,
+      gender: e.detail.value.radioGroup1,
       schoolProvince: '',
       schoolProvince: '',
       schoolCity: '',
       schoolCity: '',
       schoolName: e.detail.value.address || '',
       schoolName: e.detail.value.address || '',

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

@@ -33,7 +33,7 @@ Page({
     APIClient.myWallet().success(res => {
     APIClient.myWallet().success(res => {
       console.log(res.data.data);
       console.log(res.data.data);
       this.setData({
       this.setData({
-        totalMoney:res.data.data.income
+        totalMoney:res.data.data.income / 100
       });
       });
     }).fail(err => {
     }).fail(err => {
       console.log(err);
       console.log(err);

+ 0 - 1
pages/user/mycourse/mycourse.js

@@ -37,7 +37,6 @@ Page({
   toCourse: function(e) {
   toCourse: function(e) {
     let productId = e.currentTarget.dataset.productid;
     let productId = e.currentTarget.dataset.productid;
     let productTitle = e.currentTarget.dataset.producttitle;
     let productTitle = e.currentTarget.dataset.producttitle;
-    debugger
     wx.navigateTo({
     wx.navigateTo({
       url: `../../groupPage/grade-details/grade-details?productId=${productId}&title=${productTitle}`
       url: `../../groupPage/grade-details/grade-details?productId=${productId}&title=${productTitle}`
     });
     });

+ 0 - 1
pages/user/myread/myread.js

@@ -104,7 +104,6 @@ Page({
     }
     }
     APIClient.myRead().success(res => {
     APIClient.myRead().success(res => {
       console.log(res.data.data.list);
       console.log(res.data.data.list);
-      debugger;
       this.setData({
       this.setData({
         wareCards: res.data.data.list
         wareCards: res.data.data.list
       });
       });

+ 1 - 74
pages/user/myworks/myworks.js

@@ -7,80 +7,7 @@ Page({
    * 页面的初始数据
    * 页面的初始数据
    */
    */
   data: {
   data: {
-    wareCards: [
-      {
-        title: "古诗词诵读(一)江南",
-        grade: "一年级(上学期)",
-        avatarUrl: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg',
-        previewUrl: "../../../static/image/timg.jpg",
-        plays: "17230",
-        likes: "71230",
-        classId: "1",
-        avatar: '../../static/image/timg.jpg',
-        nickName: '喔喔',
-        time: '10-18 09:56'
-      },
-      {
-        title: "古诗词诵读(一)江南",
-        grade: "一年级(上学期)",
-        avatarUrl: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg',
-        previewUrl: "../../../static/image/timg.jpg",
-        plays: "17230",
-        likes: "71230",
-        classId: "2",
-        avatar: '../../static/image/timg.jpg',
-        nickName: '喔喔',
-        time: '10-18 09:56'
-      },
-      {
-        title: "古诗词诵读(一)江南",
-        grade: "一年级(上学期)",
-        avatarUrl: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg',
-        previewUrl: "../../../static/image/timg.jpg",
-        plays: "17230",
-        likes: "71230",
-        classId: "3",
-        avatar: '../../static/image/timg.jpg',
-        nickName: '喔喔',
-        time: '10-18 09:56'
-      },
-      {
-        title: "古诗词诵读(一)江南",
-        grade: "一年级(上学期)",
-        avatarUrl: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg',
-        previewUrl: "../../../static/image/timg.jpg",
-        plays: "17230",
-        likes: "71230",
-        classId: "4",
-        avatar: '../../static/image/timg.jpg',
-        nickName: '喔喔',
-        time: '10-18 09:56'
-      },
-      {
-        title: "古诗词诵读(一)江南",
-        grade: "一年级(上学期)",
-        avatarUrl: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg',
-        previewUrl: "../../../static/image/timg.jpg",
-        plays: "17230",
-        likes: "71230",
-        classId: "5",
-        avatar: '../../static/image/timg.jpg',
-        nickName: '喔喔',
-        time: '10-18 09:56'
-      },
-      {
-        title: "古诗词诵读(一)江南",
-        grade: "一年级(上学期)",
-        avatarUrl: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg',
-        previewUrl: "../../../static/image/timg.jpg",
-        plays: "17230",
-        likes: "71230",
-        classId: "6",
-        avatar: '../../static/image/timg.jpg',
-        nickName: '喔喔',
-        time: '10-18 09:56'
-      }
-    ],
+    wareCards: [],
     pageNo: 1,
     pageNo: 1,
     totalNo: 0,
     totalNo: 0,
     uid: ''
     uid: ''

+ 9 - 6
pages/user/myworks/myworks.wxml

@@ -33,9 +33,12 @@
       <view class='avatar-msg'>
       <view class='avatar-msg'>
         <view class='avatar-nickname'>
         <view class='avatar-nickname'>
           <text>{{ wareCards[0].user.wechatName }}</text>
           <text>{{ wareCards[0].user.wechatName }}</text>
-          <view class='flowers-box'>
+          <view class='flowers-box' wx:if='{{ true }}'>
             <image src='../../../static/image/flowers.png'></image>
             <image src='../../../static/image/flowers.png'></image>
           </view>
           </view>
+          <view class='flowers-box' wx:else>
+            <image src='../../../static/image/boy.png'></image>
+          </view>
         </view>
         </view>
         <view class='avatar-birthday'>{{ wxs.getBirthday(wareCards[0].user.birthday) }}</view>
         <view class='avatar-birthday'>{{ wxs.getBirthday(wareCards[0].user.birthday) }}</view>
         <view class='avatar-address'>{{ wareCards[0].user.schoolName }}</view>
         <view class='avatar-address'>{{ wareCards[0].user.schoolName }}</view>
@@ -52,7 +55,7 @@
           </view>
           </view>
         </view>
         </view>
         <view class='follow-count'>
         <view class='follow-count'>
-          <view class='color'>{{ wareCards[0].userRead.playAmount }}</view>
+          <view class='color'>{{ wareCards[0].userRead.fansAmount || 0 }}</view>
           <view class='border-right'>
           <view class='border-right'>
             <view class='play-img'>
             <view class='play-img'>
               <image src='../../../static/image/follow.png'></image>
               <image src='../../../static/image/follow.png'></image>
@@ -61,7 +64,7 @@
           </view>
           </view>
         </view>
         </view>
         <view class='point-count'>
         <view class='point-count'>
-          <view class='color'>{{ wareCards[0].userRead.likeAmount }}</view>
+          <view class='color'>{{ wareCards[0].userRead.likeAmount || 0 }}</view>
           <view class='border-right'>
           <view class='border-right'>
             <view class='play-img'>
             <view class='play-img'>
               <image src='../../../static/image/point.png'></image>
               <image src='../../../static/image/point.png'></image>
@@ -70,7 +73,7 @@
           </view>
           </view>
         </view>
         </view>
         <view class='flower-count'>
         <view class='flower-count'>
-          <view class='color'>{{ 100 }}</view>
+          <view class='color'>{{ wareCards[0].userRead.pointAmount || 0 }}</view>
           <view class='border-right'>
           <view class='border-right'>
             <view class='play-img'>
             <view class='play-img'>
               <image src='../../../static/image/flower.png'></image>
               <image src='../../../static/image/flower.png'></image>
@@ -92,11 +95,11 @@
             <view class='play-img'>
             <view class='play-img'>
               <image src='../../../static/image/hotPlays.png'></image>
               <image src='../../../static/image/hotPlays.png'></image>
             </view>
             </view>
-            <text class='plays-count'>{{ item.userRead.playAmount }}</text>
+            <text class='plays-count'>{{ item.userRead.playAmount || 0 }}</text>
           </view>
           </view>
         </view>
         </view>
         <view class='user-name'>
         <view class='user-name'>
-          <view class='left-detail'>{{ wxs.formatDate(item.userRead.gmtCreated) }}</view>
+          <view class='left-detail'>{{ wxs.formatDate(item.userRead.gmtCreated) || 0 }}</view>
           <view class='right-detail'>
           <view class='right-detail'>
             <view class='point-img'>
             <view class='point-img'>
               <image src='../../../static/image/like.png'></image>
               <image src='../../../static/image/like.png'></image>

+ 9 - 45
project.config.json

@@ -36,62 +36,26 @@
 			"list": []
 			"list": []
 		},
 		},
 		"miniprogram": {
 		"miniprogram": {
-			"current": 8,
+			"current": 2,
 			"list": [
 			"list": [
 				{
 				{
-					"id": 0,
-					"name": "edit",
-					"pathName": "pages/groupPage/my-group/my-group",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "团购详情",
-					"pathName": "pages/group-details/group-details",
-					"query": ""
-				},
-				{
 					"id": -1,
 					"id": -1,
 					"name": "课程详情",
 					"name": "课程详情",
-					"pathName": "pages/grade-details/grade-details",
-					"query": ""
-				},
-				{
-					"id": 7,
-					"name": "作品页面",
 					"pathName": "pages/social/works/works",
 					"pathName": "pages/social/works/works",
-					"query": "id=1541489786444388&title=铺满色巴掌的水泥道"
-				},
-				{
-					"id": 5,
-					"name": "修改资料",
-					"pathName": "pages/user/myEdit/myEdit",
-					"query": "title=修改资料",
-					"scene": "1012"
-				},
-				{
-					"id": -1,
-					"name": "read",
-					"pathName": "pages/user/myread/myread",
-					"query": ""
+					"query": "id=1541877751982865&title=【课文5】影子"
 				},
 				},
 				{
 				{
 					"id": -1,
 					"id": -1,
-					"name": "replydetails",
-					"pathName": "pages/social/replyDetail/replyDetail",
-					"query": ""
+					"name": "课程详情",
+					"pathName": "pages/groupPage/collage-details/collage-details",
+					"query": "orderId=1542270071624081",
+					"scene": "1012"
 				},
 				},
 				{
 				{
 					"id": -1,
 					"id": -1,
-					"name": "replydetails",
-					"pathName": "pages/social/replyDetail/replyDetail",
-					"query": ""
-				},
-				{
-					"id": 8,
-					"name": "myworks",
-					"pathName": "pages/user/myworks/myworks",
-					"query": ""
+					"name": "团购分享",
+					"pathName": "pages/groupPage/collage-details/collage-details",
+					"query": "orderId=1542621051065701"
 				}
 				}
 			]
 			]
 		}
 		}

BIN
static/groupImg/Preservation.png


BIN
static/groupImg/circle.png


BIN
static/groupImg/faqiren.png


BIN
static/groupImg/jiang.png


BIN
static/groupImg/share.png


BIN
static/groupImg/weixin.png


BIN
static/image/bonus.png


BIN
static/image/boy.png


BIN
static/image/collected.png


BIN
static/image/course.png


BIN
static/image/empty_heart.png


BIN
static/image/fully_heart.png


BIN
static/image/goBackHome.png


BIN
static/image/group_poster.jpg


BIN
static/image/hot_recommend.png


BIN
static/image/like.png


BIN
static/image/listen.png


BIN
static/image/microphone.png


BIN
static/image/reading_poster.jpg


BIN
static/image/red_like.png


BIN
static/image/red_like_empty.png


BIN
static/image/search_new.png


BIN
static/image/share.png


BIN
static/image/timg.jpg


BIN
static/image/works_poster.png


+ 23 - 0
utils/APIClient.js

@@ -111,6 +111,15 @@ module.exports = {
       "uid": followUid
       "uid": followUid
     }).method('POST').send();
     }).method('POST').send();
   },
   },
+  // 取消关注
+  cancerFollow(uid, followUid) {
+    let url = getBaseUrl(`wx/fans`);
+    return request.getInstance().header({
+      uid
+    }).url(url).data({
+      "uid": followUid
+    }).method('PUT').send();
+  },
   //获取关注的用户列表
   //获取关注的用户列表
   getFollowUsers(uid, pageNo, pageSize) {
   getFollowUsers(uid, pageNo, pageSize) {
     let url = getBaseUrl(`wx/fans`);
     let url = getBaseUrl(`wx/fans`);
@@ -322,6 +331,20 @@ module.exports = {
       uid: wx.getStorageSync('uid')
       uid: wx.getStorageSync('uid')
     }).url(url).send();
     }).url(url).send();
   },
   },
+  // 产品鉴权
+  areYouSuper(productArr){
+    let url = getBaseUrl(`wx/groupPurchase/auth`);
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).data(productArr).method('POST').send();
+  },
+  // 找到课程对应的课本
+ checkLesson(lessonId){
+    let url = getProductUrl(`wx/lesson/product/${lessonId}`);
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).send();
+  },
   // 获取 用户朗读的作品
   // 获取 用户朗读的作品
   userWorks(followUid, pageNo, pageSize){
   userWorks(followUid, pageNo, pageSize){
     let url = getBaseUrl('wx/userRead');
     let url = getBaseUrl('wx/userRead');

+ 8 - 1
utils/util.js

@@ -32,7 +32,14 @@ function formatDate(time, flag) {
 		return month + '-' + day + ' ' + hour + ':' + minute;
 		return month + '-' + day + ' ' + hour + ':' + minute;
 	}
 	}
 }
 }
+function GetQueryString(str,name){
+	var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
+	var r = str.match(reg);
+	if(r!=null) return  unescape(r[2]); 
+	return null;
+}
 module.exports = {
 module.exports = {
   formatTime: formatTime,
   formatTime: formatTime,
-  formatDate
+	formatDate,
+	GetQueryString
 }
 }