Rorschach vor 6 Jahren
Ursprung
Commit
0f59dafd00
39 geänderte Dateien mit 704 neuen und 253 gelöschten Zeilen
  1. 6 4
      app.json
  2. 53 41
      component/follow/follow.js
  3. 1 1
      component/follow/follow.wxml
  4. 16 8
      component/group/group.js
  5. 2 2
      component/group/group.wxml
  6. 1 1
      component/hot/hot.js
  7. 1 1
      component/hot/hot.wxml
  8. 2 0
      component/my/my.js
  9. 66 11
      component/share/share.js
  10. 2 2
      pages/groupPage/collage-details/collage-details.js
  11. 2 15
      pages/groupPage/discount-group/discount-group.js
  12. 0 6
      pages/groupPage/discount-group/discount-group.wxml
  13. 11 23
      pages/groupPage/grade-details/grade-details.js
  14. 14 18
      pages/groupPage/group-details/group-details.js
  15. 2 2
      pages/groupPage/group-details/group-details.wxml
  16. 1 1
      pages/groupPage/group-details/group-details.wxss
  17. 2 2
      pages/groupPage/make-money/make-money.js
  18. 14 1
      pages/index/index.js
  19. 19 9
      pages/main/class/class.js
  20. 5 1
      pages/main/class/class.json
  21. 2 2
      pages/main/class/class.wxml
  22. 2 1
      pages/main/class/class.wxss
  23. 26 12
      pages/main/reading/reading.js
  24. 42 12
      pages/social/replyDetail/replyDetail.js
  25. 19 15
      pages/social/replyDetail/replyDetail.wxml
  26. 12 0
      pages/social/replyDetail/replyDetail.wxss
  27. 76 15
      pages/social/works/works.js
  28. 13 8
      pages/social/works/works.wxml
  29. 24 1
      pages/social/works/works.wxss
  30. 10 9
      pages/user/myWallet/myWallet.js
  31. 1 2
      pages/user/myWallet/myWallet.wxml
  32. 0 1
      pages/user/myWallet/myWallet.wxss
  33. 112 0
      pages/user/walletDetails/walletDetails.js
  34. 1 0
      pages/user/walletDetails/walletDetails.json
  35. 34 0
      pages/user/walletDetails/walletDetails.wxml
  36. 68 0
      pages/user/walletDetails/walletDetails.wxss
  37. 10 1
      project.config.json
  38. BIN
      static/image/walletdetails.png
  39. 32 25
      utils/APIClient.js

+ 6 - 4
app.json

@@ -7,19 +7,21 @@
     "pages/main/books/books",
     "pages/main/singleBook/singleBook",
     "pages/main/reading/reading",
-    "pages/user/myEdit/myEdit",
+    "pages/main/searchResult/searchResult",
     "pages/groupPage/discount-group/discount-group",
     "pages/groupPage/group-details/group-details",
     "pages/groupPage/grade-details/grade-details",
     "pages/groupPage/collage-details/collage-details",
-    "pages/main/searchResult/searchResult",
-    "pages/user/myconcern/myconcern",
     "pages/groupPage/my-group/my-group",
+    "pages/groupPage/make-money/make-money",
+    "pages/user/myEdit/myEdit",
+    "pages/user/myconcern/myconcern",
     "pages/user/myWallet/myWallet",
     "pages/groupPage/make-money/make-money",
     "pages/user/mycourse/mycourse",
     "pages/user/myread/myread",
-    "pages/user/mycollection/mycollection"
+    "pages/user/mycollection/mycollection",
+    "pages/user/walletDetails/walletDetails"
   ],
   "window": {
     "backgroundTextStyle": "light",

+ 53 - 41
component/follow/follow.js

@@ -1,61 +1,73 @@
 import httpRequestApi from '../../utils/APIClient';
+import {
+  formatDate
+} from '../../utils/util';
 export const followInit = (that) => {
   that.setData({
-    followData: {
-      title: '关注',
-      wareCards: [{
-          title: "铺满色巴掌的水泥道",
-          grade: "一年级 上学期",
-          img: "../../static/image/timg.jpg",
-          plays: "1",
-          likes: "2",
-          classId: "1",
-          avatar: '../../static/image/timg.jpg',
-          nickName: '萝莉小猫咪',
-          time: '11-01 14:14'
-        },
-        {
-          title: "铺满色巴掌的水泥道",
-          grade: "一年级 上学期",
-          img: "../../static/image/timg.jpg",
-          plays: "1",
-          likes: "2",
-          classId: "1",
-          avatar: '../../static/image/timg.jpg',
-          nickName: '萝莉小猫咪',
-          time: '11-01 14:14'
-        },
-        {
-          title: "铺满色巴掌的水泥道",
-          grade: "一年级 上学期",
-          img: "../../static/image/timg.jpg",
-          plays: "1",
-          likes: "2",
-          classId: "1",
-          avatar: '../../static/image/timg.jpg',
-          nickName: '萝莉小猫咪',
-          time: '11-01 14:14'
-        },
-      ]
-    }
+    followData: []
+    //   title: '关注',
+    //   wareCards: [{
+    //       title: "铺满色巴掌的水泥道",
+    //       grade: "一年级 上学期",
+    //       img: "../../static/image/timg.jpg",
+    //       plays: "1",
+    //       likes: "2",
+    //       classId: "1",
+    //       avatar: '../../static/image/timg.jpg',
+    //       nickName: '萝莉小猫咪',
+    //       time: '11-01 14:14'
+    //     },
+    //     {
+    //       title: "铺满色巴掌的水泥道",
+    //       grade: "一年级 上学期",
+    //       img: "../../static/image/timg.jpg",
+    //       plays: "1",
+    //       likes: "2",
+    //       classId: "1",
+    //       avatar: '../../static/image/timg.jpg',
+    //       nickName: '萝莉小猫咪',
+    //       time: '11-01 14:14'
+    //     },
+    //     {
+    //       title: "铺满色巴掌的水泥道",
+    //       grade: "一年级 上学期",
+    //       img: "../../static/image/timg.jpg",
+    //       plays: "1",
+    //       likes: "2",
+    //       classId: "1",
+    //       avatar: '../../static/image/timg.jpg',
+    //       nickName: '萝莉小猫咪',
+    //       time: '11-01 14:14'
+    //     },
+    //   ]
+    // }
   })
   //请求数据封装
   that.getWorks = (uid, pageNo, pageSize) => {
     httpRequestApi.getFollowWorks(uid, pageNo, pageSize).success(res => {
+      console.log(res)
       const followData = res.data.data.list;
-      const followTemp = [];
+      // const followTemp = [];
       followData.forEach(item => {
         const temp = {};
+        console.log(item.userRead.id)
         temp.nickName = item.user.wechatName;
         temp.avatar = item.user.avatar;
         temp.plays = item.userRead.playAmount;
         temp.likes = item.userRead.likeAmount;
+        temp.img = item.userRead.iconImg;
         temp.id = item.userRead.id;
+        temp.title = item.userRead.title;
+        temp.time = formatDate(item.userRead.gmtCreated, 3);
         // 还差一些字段
-        followTemp.push(temp);
+        that.data.followData.push(temp);
       });
-      console.log(followTemp);
+      // console.log(followTemp);
+      that.setData({
+        followData: that.data.followData,
+        followPageTotalNo: res.data.data.totalNo
+      })
     });
   }
-  that.getWorks(1, 1, 10);
+  that.getWorks(that.uid, 1, 5);
 }

+ 1 - 1
component/follow/follow.wxml

@@ -1,6 +1,6 @@
 <template name="follow">
   <view class="followWares" style="flex-direction:row;">
-    <view wx:for="{{followData.wareCards}}" wx:key="{{index}}" class="followWareCard" bindtap="openWorks" data-uid="{{item.classId}}" data-title="{{item.title}}">
+    <view wx:for="{{followData}}" wx:key="{{index}}" class="followWareCard" bindtap="openWorks" data-readid="{{item.id}}" data-title="{{item.title}}">
       <view class="userCard">
         <image class="avatar" src="{{item.avatar}}" />
         <view class="nameCross">

+ 16 - 8
component/group/group.js

@@ -35,17 +35,16 @@ export const groupInit = (that) => {
   //点击跳转
   that.more = function ({currentTarget}) {
     let type;
-    let title;
     if(currentTarget.dataset.type == 'group') {
-      type = true
-      title = '限量优惠团购'
+      wx.navigateTo({
+        url: `/pages/groupPage/discount-group/discount-group`
+      })
     }else {
-      type = false
-      title = '全部课'
+      wx.navigateTo({
+        url: `../main/books/books`
+      })
     }
-    wx.navigateTo({
-      url: `/pages/groupPage/discount-group/discount-group?type=${type}&title=${title}`
-    })
+
   }
   //发起团购
   that.sendGroup = function () {
@@ -100,4 +99,13 @@ export const groupInit = (that) => {
       url: `/pages/groupPage/group-details/group-details?productId=${productId}&id=${id}&groupId=${groupId}`
     })
   }
+  //跳转到课程详情
+  that.goToBook = function(e){
+    console.log(e.currentTarget.dataset)
+    let id = e.currentTarget.dataset.id;
+    let title = e.currentTarget.dataset.title;
+    wx.navigateTo({
+        url: `/pages/main/singleBook/singleBook?id=${id}&title=${title}`
+      })
+  }
 }

+ 2 - 2
component/group/group.wxml

@@ -26,12 +26,12 @@
       <view class="whole-group">
           <view class="title">
             <image class="ren" src="../../static/groupImg/Shape3.png" style="width: 30rpx; height: 38rpx;"></image>
-            <text class="left">全部课程<text class="quota" style="margin-left: 20rpx;">拼团大不同</text></text>
+            <text class="left">全部课程</text>
             <text class="right" bindtap="more" data-type="course">更多 ></text>
           </view>
           <view class="group-box"> 
             <block wx:for="{{groupData.bookList}}" wx:key="{{index}}">
-              <view class="group-item">
+              <view class="group-item" data-id="{{item.id}}" data-title="{{item.title}}" bindtap="goToBook">
                 <image class="item-img" src="{{item.iconImg}}"></image>
                 <view id="grade">一年级</view>
               </view>    

+ 1 - 1
component/hot/hot.js

@@ -148,5 +148,5 @@ export const hotInit = (that) => {
     console.log(e)
   }
   that.getIndex();
-  that.getHotRecommend(1, 1, 3)
+  that.getHotRecommend(that.uid, 1, 3)
 }

+ 1 - 1
component/hot/hot.wxml

@@ -47,7 +47,7 @@
             </view>
         </view>
         <view class="hotWares"  >
-            <view wx:for="{{hotData.hotWorks}}" wx:key="{{index}}" class="hotWareCard" bindtap="openWorks" data-readId="1541489786444388" data-title="{{item.title}}">
+            <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">

+ 2 - 0
component/my/my.js

@@ -7,6 +7,8 @@ export const myInit =  (that) => {
         course: '我的课程',
         read: '我的朗读',
         keep: '我的收藏',
+        wallet: '我的钱包',
+        address:['北京海淀','中关村','三小'],
         schoolCity: '青岛市',
         schoolName: '黄岛区志贤中学',
         playNum: 31549,

+ 66 - 11
component/share/share.js

@@ -1,4 +1,5 @@
 // component/shar-dialog/shar-dialog.js
+import httpRequestApi from '../../utils/APIClient';
 Component({
   /**
    * 组件的属性列表
@@ -20,6 +21,7 @@ Component({
     author: '',
     iconImg: '',
     title: '',
+    path: ''
   },
 
   /**
@@ -38,6 +40,12 @@ Component({
       ctx.fill()
       ctx.arc(185, 48, 37, 0, 2 * Math.PI, false)
       ctx.clip(); //画了圆 再剪切  原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内  
+      // wx.downloadFile({
+      //   url: this.data.avatar,
+      //   success(res) {
+      //     ctx.drawImage(res.tempFilePath, 148, 8, 100, 100);
+      //   }
+      // });
       ctx.drawImage(this.data.avatar, 148, 8, 100, 100); //插入图片  
       ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
       ctx.setFontSize(20)
@@ -48,6 +56,14 @@ Component({
         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)
+        // 保存图片到本地
+        // wx.downloadFile({
+        //   url: this.data.iconImg,
+        //   success(res) {
+        //     console.log(res)
+        //     ctx.drawImage(res.tempFilePath, 9, 205, 352, 145);
+        //   }
+        // });
         ctx.drawImage(this.data.iconImg, 9, 205, 352, 145);
         ctx.setFontSize(18)
         ctx.setFillStyle('#000')
@@ -88,9 +104,8 @@ Component({
         ctx.setFillStyle('#000')
         ctx.fillText('长按识别二维码参加团购', 9, 493)
       }
-
-
       ctx.drawImage('../../../static/groupImg/code.png', 217, 374, 135, 135);
+      console.log(ctx)
       ctx.draw(true, function (res) {
         wx.canvasToTempFilePath({
           x: 0,
@@ -102,15 +117,18 @@ Component({
           canvasId: 'myCanvas',
           success: (res) => {
             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({
               imgUrls: res.tempFilePath
             })
+          },
+          fail: (res) => {
+            console.log(res)
           }
         })
       })
@@ -118,12 +136,39 @@ Component({
     share: function (data) {
       console.log(this.data)
       console.log(data)
+      // 下载icon
+      wx.downloadFile({
+        url: data.iconImg,
+        success: (res) => {
+          this.setData({
+            iconImg: res.tempFilePath
+          })
+        }
+      });
+      // 下载头像
+      wx.downloadFile({
+        url: data.avatar,
+        success: (res) => {
+          this.setData({
+            avatar: res.tempFilePath
+          })
+        }
+      });
+      // 生成二维码并下载
+      httpRequestApi.createQRCode({
+        page: data.path,
+        scene: "par=no"
+      }).success(res => {
+        console.log(data.path)
+        console.log(res)
+      })
       this.setData({
         shareFlag: !this.data.shareFlag,
-        avatar: data.avatar,
+        // avatar: data.avatar,
         author: data.author,
-        iconImg: data.iconImg,
+        // iconImg: data.iconImg,
         title: data.title,
+        path: data.path
       })
     },
     PreservationImg: function () {
@@ -137,5 +182,15 @@ Component({
     shareFriend: function () {
       this.triggerEvent('customevent', {})
     }
-  }
+  },
+  onShareAppMessage: (res) => {
+    if (res.from === 'button') {
+      // 来自页面内转发按钮
+      console.log(res.target)
+    }
+    return {
+      title: this.data.title,
+      path: this.data.path
+    }
+  },
 })

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

@@ -68,9 +68,9 @@ Page({
       for(var i = 0; i < surplusNum; i++) {
         this.data.surplusList.push(1);
       }
-      //console.log(res.data.data.groupPurchaseOrder.closeTimed - res.data.data.groupPurchaseOrder.gmtCreated)
+      //console.log(res.data.data.groupPurchaseOrder.closeTime - res.data.data.groupPurchaseOrder.gmtModified)
       //时间转换
-      const timeList = util.formatTime(res.data.data.groupPurchaseOrder.closeTimed - res.data.data.groupPurchaseOrder.gmtCreated);
+      const timeList = util.formatTime(res.data.data.groupPurchaseOrder.closeTime - res.data.data.groupPurchaseOrder.gmtModified);
       this.setData({
         surplusNum,
         joinUserList: res.data.data.joinUserList,

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

@@ -6,8 +6,7 @@ Page({
    * 页面的初始数据
    */
   data: {
-    recommendList: [],
-    bookList: []
+    recommendList: []
   },
 
   //点击跳转到团购详情
@@ -20,9 +19,8 @@ Page({
    */
   onLoad: function (options) {
     wx.setNavigationBarTitle({
-      title: options.title
+      title: '优惠团购'
     })
-    if(options.type == 'true') {
       //优惠内容
       httpRequestApi.getGroupList().success( (res) => {
         console.log('推荐团购',res.data.data)
@@ -32,17 +30,6 @@ Page({
       }).fail((error) => {
         console.log('错误',error)
       })
-    }else {
-      //全部课
-      httpRequestApi.getAllBooks(1, 10).success((res) => {
-        console.log('全部课',res.data.data.list)
-        this.setData({
-          bookList: res.data.data.list
-        })
-      }).fail((error) => {
-        console.log('错误',error)
-      })
-    }
   },
 
   /**

+ 0 - 6
pages/groupPage/discount-group/discount-group.wxml

@@ -14,12 +14,6 @@
                   <text>{{item.headcount}}人团</text>
                 </view>
               </view>
-            </block> 
-            <block wx:for="{{bookList}}" wx:key="{{index}}">
-              <view class="group-item">
-                <image class="item-img" src="{{item.iconImg}}"></image>
-                <view id="grade">一年级</view>
-              </view>    
             </block>                
           </view>                        
         </view>

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

@@ -54,7 +54,7 @@ Page({
           return false;
         }
         //掉起支付
-        this.prePayMap(res.data.data.prePayMap, res.data.data.groupPurchaseOrderDetail.orderId);
+        this.prePayMap(res.data.data.prePayMap, res.data.data.groupPurchaseOrder.id);
       }).fail( (error) => {
         
       })
@@ -78,27 +78,15 @@ Page({
             title: '提示',
             content: '支付成功',
             success (res) {
-              if (res.confirm) {
-                that.popup.close();
-                setTimeout(() => {
-                  wx.navigateTo({
-                    url: `/pages/groupPage/collage-details/collage-details?orderId=${orderId}`
-                  })
-                  wx.setNavigationBarTitle({
-                    title: '拼团详情'
-                  })
-                }, 1000)
-              } else if (res.cancel) {
-                that.popup.close();
-                setTimeout(() => {
-                  wx.navigateTo({
-                    url: `/pages/groupPage/collage-details/collage-details?orderId=${orderId}`
-                  })
-                  wx.setNavigationBarTitle({
-                    title: '拼团详情'
-                  })
-                }, 1000)                
-              }
+              that.popup.close();
+              setTimeout(() => {
+                wx.navigateTo({
+                  url: `/pages/groupPage/collage-details/collage-details?orderId=${orderId}`
+                })
+                wx.setNavigationBarTitle({
+                  title: '拼团详情'
+                })
+              }, 1000)
             }
           })
 
@@ -124,7 +112,7 @@ Page({
       })
     }
     //课本详情
-    httpRequestApi.getBookDetail(productId).success( (res) =>{
+    httpRequestApi.getBookDetail(wx.getStorageSync('uid'),productId).success( (res) =>{
       console.log('课本详情',res.data.data);
       const bookInfo = res.data.data.product;
       const lessonList = res.data.data.lessonList;

+ 14 - 18
pages/groupPage/group-details/group-details.js

@@ -88,14 +88,14 @@ Page({
         return false;
       }  
       //掉起支付
-      //this.prePayMap(res.data.data.prePayMap, res.data.data.orderId);
+      this.prePayMap(res.data.data.prePayMap, res.data.data.orderId, res.data.data.groupPurchaseOrder.id);
     }).fail( (error) => {
       
     })
   },
 
   //支付
-  prePayMap: function (prePayMap, orderId) {
+  prePayMap: function (prePayMap, orderId, detailId) {
     console.log(prePayMap)
     const that = this;
     wx.requestPayment(
@@ -112,16 +112,11 @@ Page({
             title: '提示',
             content: '支付成功',
             success (res) {
-              if (res.confirm) {
-                //获取拼团信息
-                this.jionSuccess(this.data.orderId);
-                this.groupSuccess(orderId);
-
-              } else if (res.cancel) {
-                //获取拼团信息
-                this.jionSuccess(this.data.orderId);                
-                this.groupSuccess(orderId);
-              }
+              //获取拼团信息
+              setTimeout( () => {
+                that.jionSuccess(that.data.orderId);
+                that.groupSuccess(orderId, detailId);
+              },2000)
             }
           })
 
@@ -143,9 +138,9 @@ Page({
       for(var i = 0; i < surplusNum; i++) {
         this.data.surplusList.push(1);
       }
-      console.log(res.data.data.groupPurchaseOrder.closeTimed - res.data.data.groupPurchaseOrder.gmtCreated)
+      console.log(res.data.data.groupPurchaseOrder.closeTime - res.data.data.groupPurchaseOrder.gmtModified)
       //时间转换
-      const timeList = util.formatTime(res.data.data.groupPurchaseOrder.closeTimed - res.data.data.groupPurchaseOrder.gmtCreated);
+      const timeList = util.formatTime(res.data.data.groupPurchaseOrder.closeTime - res.data.data.groupPurchaseOrder.gmtModified);
       this.setData({
         surplusNum,
         joinUserList: res.data.data.joinUserList,
@@ -158,13 +153,13 @@ Page({
   },
 
   //拼团是否成功并弹窗
-  groupSuccess: function (orderId) {
+  groupSuccess: function (orderId, detailId) {
     httpRequestApi.groupSuccess(orderId).success( res => {
       console.log('团购是否成功',res.data.data)
       const status = res.data.data.status;
+      debugger;
       const uid = res.data.data.uid;
       if(status == 'successed') {
-
         if(wx.getStorageSync(uid) == uid) {
           this.setData({
             typeOf: 'success',
@@ -216,9 +211,10 @@ Page({
           })
         }
       }else {
+        debugger;
         setTimeout(() => {
           wx.navigateTo({
-            url: `/pages/groupPage/collage-details/collage-details?orderId=${orderId}`
+            url: `/pages/groupPage/collage-details/collage-details?orderId=${detailId}`
           })
           wx.setNavigationBarTitle({
             title: '拼团详情'
@@ -261,7 +257,7 @@ Page({
       orderId
     })
     //课本详情
-    httpRequestApi.getBookDetail(productId).success( (res) =>{
+    httpRequestApi.getBookDetail(wx.getStorageSync('uid'), productId).success( (res) =>{
       console.log('课本详情',res.data.data);
       const bookInfo = res.data.data.product;
       const lessonList = res.data.data.lessonList;

+ 2 - 2
pages/groupPage/group-details/group-details.wxml

@@ -14,8 +14,8 @@
             </block>                      
         </view>
         <view class="shengyu">
-            <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'}}">仅剩<text>{{surplusNum}}</text>个名额就拼团成功了</view>
+            <view class="shengyu-num" hidden="{{surplusNum != '0'}}">拼团成功</view>
             <view class="shengyu-time">
                 剩余时间:
                 <view class="time">

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

@@ -76,7 +76,7 @@
 }
 
 scroll-view {
-    height: 59%;
+    height: 64%;
     width: 100%;
 }
 

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

@@ -44,9 +44,9 @@ Page({
       for(var i = 0; i < surplusNum; i++) {
         this.data.surplusList.push(1);
       }
-      //console.log(res.data.data.groupPurchaseOrder.closeTimed - res.data.data.groupPurchaseOrder.gmtCreated)
+      //console.log(res.data.data.groupPurchaseOrder.closeTime - res.data.data.groupPurchaseOrder.gmtModified)
       //时间转换
-      const timeList = util.formatTime(res.data.data.groupPurchaseOrder.closeTimed - res.data.data.groupPurchaseOrder.gmtCreated);
+      const timeList = util.formatTime(res.data.data.groupPurchaseOrder.closeTime - res.data.data.groupPurchaseOrder.gmtModified);
       this.setData({
         surplusNum,
         joinUserList: res.data.data.joinUserList,

+ 14 - 1
pages/index/index.js

@@ -41,10 +41,11 @@ Page({
     ],
     winH: 568,
     myIndex: 1,
+    followData:[],
     recommendPageNo:1,
     recommendTotalNo:0,
     followPageNo:1,
-    followPageSize:0,
+    followPageTotalNo:0,
     templates: 'hot',
     title: 'index中的title',
     jurisdictionFlag: true,
@@ -151,5 +152,17 @@ Page({
         console.log('没有更多')
       }
     }
+    if(this.data.myIndex === 2){
+      console.log(this.data.followPageTotalNo)
+      this.setData({
+        followPageNo: this.data.followPageNo+1
+      })
+      if(this.data.followPageNo <= this.data.followPageTotalNo ){
+        this.getWorks(this.uid, this.data.followPageNo, 5);
+        
+      } else {
+        console.log('没有更多')
+      }
+    }
   }
 })

+ 19 - 9
pages/main/class/class.js

@@ -14,6 +14,8 @@ Page({
     title: '',
     id: '',
     iconImg: '',
+    pageNo: 1,
+    totalNo: 0,
     collectFlag: false,
   },
   onLoad: function (option) {
@@ -53,7 +55,7 @@ Page({
     let id = this.data.id;
     let title = this.data.title;
     wx.navigateTo({
-      url: `../../main/reading/reading?id=${id}&title=${this.data.title}&img=${this.data.img}&video=${this.data.videoUrl}`
+      url: `../../main/reading/reading?id=${id}`
     })
   },
   goToWorks: function (e) {
@@ -82,9 +84,9 @@ Page({
   getReadInfo: function (pageNo, pageSize) {
     // const uid =  wx.getStorageSync('uid');
     const data = {
-      lessonId: 1,
-      pageNo: pageNo,
-      pageSize: pageSize
+      lessonId: this.data.id,
+      pageNo: this.data.pageNo,
+      pageSize: 1
     };
     httpRequestApi.getClassRead(this.uid, data).success(res => {
       const readInfo = res.data.data.list;
@@ -92,21 +94,29 @@ Page({
       readInfo.forEach(item => {
         const temp = {};
         temp.nickName = item.user.wechatName;
-        temp.time = formatDate(item.userRead.gmtCreated, 3);
+        temp.time = formatDate(item.userRead.gmtModified, 3);
         temp.avatar = item.user.avatar;
         temp.likes = item.userRead.likeAmount ? item.userRead.likeAmount : 0;
         temp.uid = item.userRead.uid;
         temp.id = item.userRead.id;
-        readTemp.push(temp);
+        this.data.works.push(temp);
       });
       this.setData({
+        totalNo: res.data.data.totalNo,
         total: res.data.data.totalSize,
-        works: readTemp
+        works: this.data.works
       })
     });
   },
   // 下拉加载
-  scrollUpdate: function (e) {
-    console.log(e)
+  onReachBottom: function(e){
+    console.log(this.data.totalNo);
+    this.setData({
+      pageNo: this.data.pageNo+1
+    })
+    if(this.data.pageNo <= this.data.totalNo ){
+      this.getReadInfo();
+      
+    }
   }
 })

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

@@ -1 +1,5 @@
-{}
+{
+    "window": {
+        "onReachBottomDistance": 50
+      }
+}

+ 2 - 2
pages/main/class/class.wxml

@@ -1,6 +1,6 @@
 <view class="classPage">
     <video id="classVideo" class="videoSection" src="{{videoUrl}}" controls show-fullscreen-btn="{{fullScreenBtn}}" show-play-btn="{{playBtn}}"></video>
-    <scroll-view class="readWorksSection" lower-threshold="160" bindscrolltolower="scrollUpdate">
+    <view class="readWorksSection" >
         <view class="peopleNum">
             <image class="peoplesIcon" src="../../../static/image/peoples.png" />
             <view class="title">共有{{total}}人完成了录音</view>
@@ -16,7 +16,7 @@
                 <text class="likeNum">{{item.likes}}</text>
             </view>
         </view>
-    </scroll-view>
+    </view>
     <view class="footSection">
         <image class="blackbord" src="../../../static/image/blackbord.png" />
         <view class="collectBtn footerBtn" bindtap="collect">

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

@@ -95,7 +95,8 @@
 
 .readWorksSection .workCard {
     width: 716rpx;
-    height: 132rpx;
+    /* height: 132rpx; */
+    height: 700rpx;
     display: flex;
     align-items: center;
     flex-direction: row;

Datei-Diff unterdrückt, da er zu groß ist
+ 26 - 12
pages/main/reading/reading.js


+ 42 - 12
pages/social/replyDetail/replyDetail.js

@@ -1,12 +1,14 @@
 import httpRequestApi from '../../../utils/APIClient';
-import {formatDate} from '../../../utils/util';
+import {
+    formatDate
+} from '../../../utils/util';
 Page({
     data: {
         class1: 'commentItem commentItemFirst',
         classNormal: 'commentItem',
         postId: '',
-        comment:[]
-        
+        comment: []
+
     },
     onLoad: function (option) {
         console.log(option)
@@ -14,14 +16,16 @@ Page({
             postId: option.id
         })
         wx.setNavigationBarTitle({
-            title: option.count + '条回复'//页面标题为路由参数
+            title: option.count + '条回复' //页面标题为路由参数
         })
+        this.uid = wx.getStorageSync('uid');
         this.getReplyDetail();
     },
     // 查询回复详情
     getReplyDetail: function () {
-        let uid = wx.getStorageSync('uid');
-        httpRequestApi.getReplyComment(uid, this.data.postId).success((res) => {
+        // let uid = wx.getStorageSync('uid');
+        httpRequestApi.getReplyComment(this.uid, this.data.postId).success((res) => {
+            debugger;
             console.log(res);
             const replyList = res.data.data.replyVOList;
             const replied = res.data.data;
@@ -29,7 +33,7 @@ Page({
             const authorDetail = {};
             authorDetail.name = replied.user.wechatName;
             authorDetail.text = replied.detailDesc;
-            authorDetail.time = formatDate(replied.gmtCreated,3);
+            authorDetail.time = formatDate(replied.gmtModified,3);
             authorDetail.likes = replied.postsAttributeInfo.favors;
             authorDetail.avatar = replied.user.avatar;
             replyTemp.push(authorDetail);
@@ -37,7 +41,7 @@ Page({
                 const temp = {};
                 temp.name = item.user.wechatName;
                 temp.text = item.content;
-                temp.time = formatDate(item.gmtCreated,3);
+                temp.time = formatDate(item.gmtModified,3);
                 temp.likes = 0;
                 temp.id = item.postId;
                 temp.avatar = item.user.avatar;
@@ -49,13 +53,13 @@ Page({
             })
         });
     },
-      // 点赞评论
-      likeCommend: function (e) {
+    // 点赞评论
+    likeCommend: function (e) {
         console.log(e);
-        let uid = wx.getStorageSync('uid');
+        // let uid = wx.getStorageSync('uid');
         let followUid = e.currentTarget.dataset.id;
         let index = e.currentTarget.dataset.index;
-        httpRequestApi.likeCommend(uid, followUid).success(res => {
+        httpRequestApi.likeCommend(this.uid, followUid).success(res => {
             console.log(res);
             const str = `comment[${index}].likes`;
             this.setData({
@@ -63,4 +67,30 @@ Page({
             })
         });
     },
+    // 设置点击时的id
+    setSBId: function (e) {
+        console.log(e)
+        this.setData({
+            // replySBId: e.currentTarget.dataset.id,
+            replyModal: true
+        })
+    },
+    // 回复某个评论
+    replySB: function () {
+        const data = {
+            postsId: this.data.postId,
+            content: this.data.inputSBValue
+        }
+        httpRequestApi.postReplyComment(this.uid, data).success(res => {
+            this.setData({
+                replyModal: false
+            })
+        });
+    },
+    // 获取回复楼中楼的内容
+    inputSBValue: function (e) {
+        this.setData({
+            inputSBValue: e.detail.value
+        });
+    },
 })

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

@@ -1,16 +1,20 @@
- <view class="commentArea">
-        <view class="{{index === 0? class1 : classNormal}}" wx:for="{{comment}}" wx:key="{{index}}" >
-            <image class="avatar" src="{{item.avatar}}" />
-            <view class="commentCore">
-                <text class="nickName">{{item.name}}</text>
-                <text class="time">{{item.time}}</text>
-                <text class="gut">{{item.text}}</text>
-            </view>
-            <view class="btnWrapper">
-                <image class="commentBtn" src="../../../static/image/comment.png" wx:if="{{index===0}}" />
-                <text class="commentText" wx:if="{{index===0}}">评论</text>
-                <!-- <image class="likeBtn" data-index="{{index}}" data-likes="{{item.likes}}" data-id="{{item.id}}" src="../../../static/image/like.png" bindtap="likeCommend" /> -->
-                <!-- <text class="likeText" >{{item.likes}}</text> -->
-            </view>
+<view class="commentArea">
+    <view class="{{index === 0? class1 : classNormal}}" wx:for="{{comment}}" wx:key="{{index}}">
+        <image class="avatar" src="{{item.avatar}}" />
+        <view class="commentCore">
+            <text class="nickName">{{item.name}}</text>
+            <text class="time">{{item.time}}</text>
+            <text class="gut">{{item.text}}</text>
         </view>
-    </view>
+        <view class="btnWrapper">
+            <image class="commentBtn" src="../../../static/image/comment.png" wx:if="{{index===0}}" bindtap="setSBId" />
+            <text class="commentText" wx:if="{{index===0}}">评论</text>
+            <!-- <image class="likeBtn" data-index="{{index}}" data-likes="{{item.likes}}" data-id="{{item.id}}" src="../../../static/image/like.png" bindtap="likeCommend" /> -->
+            <!-- <text class="likeText" >{{item.likes}}</text> -->
+        </view>
+    </view>
+    <!-- 评论框 -->
+    <view class="replySection" wx:if="{{replyModal}}">
+        <input bindblur="bindTextAreaBlur" bindconfirm="replySB" confirm-type="send" placeholder="回复" bindinput="inputSBValue" auto-focus auto-height />
+    </view>
+</view>

+ 12 - 0
pages/social/replyDetail/replyDetail.wxss

@@ -87,4 +87,16 @@
     width: 32rpx;
     height: 28rpx;
     margin-left: 8rpx;
+}
+.replySection{
+    width: 100%;
+    height: 300rpx;
+    position: fixed;
+    bottom: 0;
+    background: #eee;
+}
+.replySection input{
+    width: 100%;
+    height: 300rpx;
+    text-indent: 4rpx;
 }

+ 76 - 15
pages/social/works/works.js

@@ -12,13 +12,16 @@ Page({
         total: '',
         authorAvatar: '',
         user: [],
-        inputValue: 'smdx',
+        inputValue: '',
+        inputSBValue:'',
         replyList: [],
-        howMuch: '2000',
+        howMuch: '200',
         moneySelect: 'moneySelect',
         moneyNormal: 'moneyNormal',
         ifReward: false,
         id: '',
+        path:'',
+        replyModal: false
         // shareFlag: false
     },
     onLoad: function (option) {
@@ -41,6 +44,7 @@ Page({
     getWorks: function (uid, id) {
         httpRequestApi.getWorksDetail(uid, id).success((res) => {
             console.log(res);
+            console.log(id)
             const others = res.data.data.otherRead;
             const author = res.data.data.user;
             const works = res.data.data.userRead;
@@ -58,7 +62,10 @@ Page({
                 authorUid: author.uid,
                 videoSrc: works.originVideo,
                 audioSrc: works.audioPath,
-                iconImg: works.iconImg
+                iconImg: works.iconImg,
+                classId: works.lessonId,
+                isLike: res.data.data.isLike,
+                isFans: res.data.data.isFans,
             })
             // 设置音频路径
             this.innerAudioContext = wx.createInnerAudioContext();
@@ -70,9 +77,26 @@ Page({
         });
     },
     likeWorks: function (e) {
+        if(this.data.isLike){
+            wx.showToast({
+                title: '不要重复点赞哦',
+                icon: 'fail',
+                duration: 1000
+              })
+            return;
+        }
         httpRequestApi.likeWorks(this.uid, this.data.id).success(res => {
-            console.log(this.uid)
-        });
+            this.setData({
+                isLike: true
+            },()=>{
+                wx.showToast({
+                    title: '点赞数+1',
+                    icon: 'success',
+                    duration: 1000
+                  })
+            });
+            })
+            
     },
     // 弹出分享框
     openShare: function (e) {
@@ -85,6 +109,7 @@ Page({
             author: this.data.author,
             iconImg: this.data.iconImg,
             title: this.data.title,
+            path: `pages/social/works/works?id=${this.data.id}&title=${this.data.title}`
             // tip: this.data.tip,
         }
         this.shareDialog.share(data);
@@ -105,24 +130,29 @@ Page({
         let id = this.data.id;
         let title = this.data.title;
         wx.navigateTo({
-            url: `../../main/reading/reading?id=${id}&title=${title}`
+            url: `../../main/reading/reading?id=${this.data.classId}`
         })
     },
-    onShareAppMessage: function (res) {
+    onShareAppMessage: function(res) {
         if (res.from === 'button') {
-            // 来自页面内转发按钮
-            console.log(res.target)
+          // 来自页面内转发按钮
+          console.log(res.target)
         }
         return {
-            title: '测试',
-            path: '/pages/social/works/works'
+          title: this.data.title,
+          path: `pages/social/works/works?id=${this.data.id}&title=${this.data.title}`,
+          imageUrl: this.data.iconImg
         }
-    },
+      },
     follow: function () {
         // let uid = wx.getStorageSync('uid');
-        let followUid = 2;
+        let followUid = this.data.authorUid;
         httpRequestApi.followUser(this.uid, followUid).success((res) => {
-            console.log(res)
+            wx.showToast({
+                title: !this.data.isFans? '取消关注' : '关注啦',
+                icon: 'success',
+                duration: 1000
+              })
         });
     },
     // 点赞评论
@@ -162,7 +192,7 @@ Page({
                 temp.text = item.detailDesc;
                 temp.id = item.id;
                 temp.replyCount = item.replyCount;
-                temp.time = formatDate(item.gmtCreated, 3);
+                temp.time = formatDate(item.gmtModified, 3);
                 temp.likes = item.postsAttributeInfo.favors || 0;
                 console.log(temp.time)
                 replyTemp.push(temp);
@@ -203,6 +233,32 @@ Page({
             });
         }
     },
+    // 设置点击时的id
+    setSBId: function(e){
+        console.log(e)
+        this.setData({
+            replySBId: e.currentTarget.dataset.id,
+            replyModal: true
+        })
+    },
+    // 回复某个评论
+    replySB: function () {
+        const data = {
+            postsId: this.data.replySBId,
+            content: this.data.inputSBValue
+        }
+        httpRequestApi.postReplyComment(this.uid, data).success(res => {
+            this.setData({
+                replyModal: false
+            })
+        });
+    },
+    // 获取回复楼中楼的内容
+    inputSBValue: function(e){
+        this.setData({
+            inputSBValue: e.detail.value
+        });
+    },
     // 选择金额
     setMoney: function (e) {
         this.setData({
@@ -214,6 +270,11 @@ Page({
             ifReward: true
         })
     },
+    quitReward:function () {
+        this.setData({
+            ifReward: false
+        })
+    },
     // 奖励
     rewardMoney: function () {
         console.log(this.data.authorUid);

+ 13 - 8
pages/social/works/works.wxml

@@ -4,11 +4,11 @@
         <image class="avatar" src="{{authorAvatar}}" />
         <text class="nickName">{{author}}</text>
         <view class="like" bindtap="likeWorks">
-            <image src="../../../static/image/liked.png" />
-            <text class="likeBtn">点赞</text>
+            <image src="{{isLike? '../../../static/image/liked.png' : '../../../static/image/like.png'}}" />
+            <text class="likeBtn">{{isLike ? '已' : ''}}点赞</text>
         </view>
         <view class="follow">
-            <text class="followBtn" bindtap="follow">关注</text>
+            <text class="followBtn" bindtap="follow">{{isFans ? '已' : ''}}关注</text>
         </view>
     </view>
     <view class="userSection">
@@ -40,7 +40,7 @@
                 </view>
             </view>
             <view class="btnWrapper">
-                <image class="commentBtn" src="../../../static/image/comment.png" />
+                <image class="commentBtn" src="../../../static/image/comment.png" bindtap="setSBId" data-id="{{item.id}}" />
                 <text class="commentText">评论</text>
                 <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>
@@ -66,6 +66,10 @@
             <text>分享</text>
         </view>
     </view>
+    <!-- 评论框 -->
+    <view class="replySection" wx:if="{{replyModal}}">
+        <input bindblur="bindTextAreaBlur"  bindconfirm="replySB" confirm-type="send" placeholder="回复" bindinput="inputSBValue" auto-focus auto-height />
+    </view>
     <!-- 奖励弹窗 -->
     <cover-view class="modalWrapper" wx:if="{{ifReward}}">
         <cover-view class="rewardContent">
@@ -73,19 +77,20 @@
             <cover-image class="rewardAvatar" src="{{authorAvatar}}" />
             <cover-view class="rewardNickName">奖励给朗读者:{{author}}</cover-view>
             <cover-view class="moneyArea">
-                <cover-view class="{{howMuch ==='1000' ? 'money moneySelect' : 'money moneyNormal'}}" bindtap="setMoney" data-money="1000">
+                <cover-view class="{{howMuch ==='100' ? 'money moneySelect' : 'money moneyNormal'}}" bindtap="setMoney" data-money="100">
                     1.0元
                 </cover-view>
-                <cover-view class="{{howMuch ==='2000' ? 'money moneySelect' : 'money moneyNormal'}}" bindtap="setMoney" data-money="2000">
+                <cover-view class="{{howMuch ==='200' ? 'money moneySelect' : 'money moneyNormal'}}" bindtap="setMoney" data-money="200">
                     2.0元
                 </cover-view>
-                <cover-view class="{{howMuch ==='3000' ? 'money moneySelect' : 'money moneyNormal'}}" bindtap="setMoney" data-money="3000">
+                <cover-view class="{{howMuch ==='300' ? 'money moneySelect' : 'money moneyNormal'}}" bindtap="setMoney" data-money="300">
                     3.0元
                 </cover-view>
             </cover-view>
             <cover-view class="rewardBtn" bindtap="rewardMoney">立即奖励</cover-view>
         </cover-view>
+        <cover-image class="quitBtn" bindtap="quitReward" src="../../../static/groupImg/cha.png" />
     </cover-view>
     <canvas canvas-id="myCanvas" style="width:370px;z-index=99999; height: 507px; position: absolute; left: -99rpx; top: -999rpx;"></canvas>
-    <shareDialog id="share-dialog" shareType = 'works'/>
+    <shareDialog id="share-dialog" shareType='works' />
 </view>

+ 24 - 1
pages/social/works/works.wxss

@@ -409,6 +409,7 @@ button::after {
     color: #fff;
     border: 0;
 }
+
 .rewardBtn {
     width: 464rpx;
     height: 80rpx;
@@ -419,7 +420,7 @@ button::after {
     background: -o-linear-gradient(180deg, #FEC953, #FCA40F);
     background: -moz-linear-gradient(180deg, #FEC953, #FCA40F);
     box-shadow: 0 6rpx 18rpx 0 rgba(0, 0, 0, 0.5);
-    background:  #FCA40F;
+    background: #FCA40F;
     font-size: 40rpx;
     color: #fff;
     line-height: 80rpx;
@@ -428,5 +429,27 @@ button::after {
     z-index: 9999;
     top: 718rpx;
     left: 115rpx;
+}
+
+.quitBtn {
+    width: 68rpx;
+    height: 68rpx;
+    position: absolute;
+    left: 345rpx;
+    bottom: 110rpx;
+
+}
 
+.replySection {
+    width: 100%;
+    height: 300rpx;
+    position: fixed;
+    bottom: 0;
+    background: #eee;
+}
+
+.replySection input {
+    width: 100%;
+    height: 300rpx;
+    text-indent: 4rpx;
 }

+ 10 - 9
pages/user/myWallet/myWallet.js

@@ -4,28 +4,29 @@ Page({
    * 页面的初始数据
    */
   data: {
+    title: '',
     totalMoney: 3000,
     textDoc: '收到的赏金',
     textPrompt: '收到的奖励自动转入微信钱包',
     walletDetail: '资金明细',
   },
+
   toWalletDetail: function(e) {
-    console.log('GO TO 资金明细');
-    // let title = e.currentTarget.dataset.title;
-    // wx.navigateTo({
-    //   url: `../user/myEdit/myEdit?title=${title}`
-    // });
+    let title = e.currentTarget.dataset.title;
+    wx.navigateTo({
+      url: `../walletDetails/walletDetails?title=${title}`
+    });
   },
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function (option) {
-    if (option.title) {
+  onLoad: function (options) {
+    if (options.title) {
       wx.setNavigationBarTitle({
-        title: option.title//页面标题为路由参数
+        title: options.title//页面标题为路由参数
       });
       this.setData({
-        title: option.title
+        title: options.title
       });
     }
   },

+ 1 - 2
pages/user/myWallet/myWallet.wxml

@@ -10,7 +10,6 @@
         </view>
         <view class="text-prompt">{{ textPrompt }}</view>
     </view>
-
     <view class="wallet-container">
         <view class="wallet-detail" bindtap='toWalletDetail' data-title='{{ walletDetail }}'>
             <view class="wallet-center">
@@ -25,6 +24,6 @@
                 </view>
             </view>
         </view>
-
     </view>
+
 </view>

+ 0 - 1
pages/user/myWallet/myWallet.wxss

@@ -63,7 +63,6 @@ image{
     width:16rpx;
     height:28rpx;
 }
-
 .wallet-detail {
     margin-top:20rpx;
     width:716rpx;

+ 112 - 0
pages/user/walletDetails/walletDetails.js

@@ -0,0 +1,112 @@
+// pages/user/walletDetails/walletDetails.js
+Page({
+
+  /**
+   * 页面的初始数据
+   * @param value value = Math.abs(value)
+   */
+  data: {
+    title: '',
+    walletDatails:[
+      {
+        value: '-20.00',
+        time: '2018年9月30日 12:00',
+        nickName: '喔喔',
+      },
+      {
+        value: '-20.00',
+        time: '2018年9月30日 12:00',
+        nickName: '喔喔',
+      },
+      {
+        value: '20.00',
+        time: '2018年9月30日 12:00',
+        nickName: '追忆似水年华',
+      },
+      {
+        value: '-20.00',
+        time: '2018年9月30日 12:00',
+        nickName: '喔喔',
+      },
+      {
+        value: '1822.00',
+        time: '2018年9月30日 12:00',
+        nickName: 'kongzhishuxing',
+      },
+      {
+        value: '20.00',
+        time: '2018年9月30日 12:00',
+        nickName: '喔喔',
+      },
+      {
+        value: '-20.00',
+        time: '2018年9月30日 12:00',
+        nickName: 'hahahahahahahaha',
+      },
+      
+    ],
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    if (options.title) {
+      wx.setNavigationBarTitle({
+        title: options.title//页面标题为路由参数
+      });
+      this.setData({
+        title: options.title
+      });
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+  
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+  
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+  
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+  
+  }
+})

+ 1 - 0
pages/user/walletDetails/walletDetails.json

@@ -0,0 +1 @@
+{}

+ 34 - 0
pages/user/walletDetails/walletDetails.wxml

@@ -0,0 +1,34 @@
+<view class='walletDetails'>
+
+  <view class="walletDetails-center">
+
+    <view class='walletDetails-info' wx:for="{{ walletDatails }}" wx:key="{{ index }}">
+        
+        <view class="walletDetails-left">
+            <view class='avatar-box'>
+                <image src="../../../static/image/walletdetails.png" />
+            </view>
+            <view class="avatar-info">
+                <text class="avatar-doc" wx:if='{{ item.value > 0 }}'>收到的奖金-来自{{ item.nickName }}</text>
+                <text class="avatar-doc" wx:else>发出的奖金-奖励{{ item.nickName }}</text>
+                <text class="avatar-time">{{ item.time }}</text>
+            </view>
+        </view>
+
+        <view class="walletDetails-right">
+            <view class="avatar-value-pos" wx:if='{{ item.value > 0 }}'>
+                <text class="avatar-symbol">+</text>
+                <text>{{ item.value }}</text>
+            </view>
+            <view class="avatar-value-neg" wx:else>
+                <text class="avatar-symbol">-</text>
+                <text>{{ item.value }}</text>
+            </view>
+        </view>
+
+    </view>
+
+
+  </view>
+
+</view>

+ 68 - 0
pages/user/walletDetails/walletDetails.wxss

@@ -0,0 +1,68 @@
+page{
+    width: 750rpx;
+    background: #F0F1F5;
+}
+.walletDetails-center{
+    width: 716rpx;
+    margin: 20rpx auto;
+}
+  
+.walletDetails-info{
+    margin-bottom: 20rpx;
+    width: 100%;
+    height: 122rpx;
+    display: flex;
+    align-items: center;
+    justify-content:space-between;
+    border-radius: 12rpx;
+    background: #FFFFFF;
+}
+
+.walletDetails-left, .walletDetails-right{
+    display: flex;
+    align-items: center;
+}
+
+image {
+    width: 100%;
+    height: 100%;
+}
+.avatar-box {
+    margin-left: 16rpx;
+    width: 64rpx;
+    height: 64rpx;
+}
+.avatar-info{
+    display: flex;
+    flex-direction: column;
+    margin-left: 16rpx;
+}
+.avatar-doc{
+    height: 38rpx;
+    color: #3C3C3C;
+    font-size: 28rpx;
+} 
+.avatar-time{
+    height: 32rpx;
+    color: #909090;
+    font-size: 24rpx;
+}
+
+.walletDetails-right{
+    margin-right: 20rpx;
+    font-size: 24rpx;
+}
+
+.avatar-value-pos, .avatar-value-neg{
+    width: 100rpx;
+}
+.avatar-value-pos {
+    color: #FF5200;
+}
+.avatar-value-neg{
+    color: #61CA54;
+}
+.avatar-symbol {
+    font-weight: bold;
+}
+

+ 10 - 1
project.config.json

@@ -81,9 +81,10 @@
 					"query": ""
 				},
 				{
-					"id": -1,
+					"id": 7,
 					"name": "作品页面",
 					"pathName": "pages/social/works/works",
+<<<<<<< HEAD
 					"query": "id=1541489786444388&title=铺满色巴掌的水泥道"
 				},
 				{
@@ -121,6 +122,14 @@
 					"name": "course",
 					"pathName": "pages/user/mycourse/mycourse",
 					"query": "productId=1"
+					"query": "id=1541683622900612&title=【课文1】秋天"
+				},
+				{
+					"id": 8,
+					"name": "测试的",
+					"pathName": "pages/social/works/works",
+					"query": "id=1541743536238348&title=【课文6】比尾巴",
+					"scene": "1012"
 				}
 			]
 		}

BIN
static/image/walletdetails.png


+ 32 - 25
utils/APIClient.js

@@ -37,7 +37,7 @@ module.exports = {
 		}).url(url).send();
 	},
 	// 获取全部课本
-	getAllBooks(pageNo,pageSize) {
+	getAllBooks(pageNo, pageSize) {
 		let url = getProductUrl('wx/product');
 		return request.getInstance().header({
 			uid: wx.getStorageSync('uid')
@@ -47,41 +47,41 @@ module.exports = {
 		}).send();
 	},
 	// 获取课本详情
-	getBookDetail(uid,id) {
+	getBookDetail(uid, id) {
 		let url = getProductUrl(`wx/product/${id}`);
 		return request.getInstance().header({
 			uid
 		}).url(url).send();
 	},
 	// 获取单课详情
-	getClassDetail(uid,id) {
+	getClassDetail(uid, id) {
 		let url = getProductUrl(`wx/lesson/${id}`);
 		return request.getInstance().header({
 			uid
 		}).url(url).send();
 	},
 	// 检查是否收藏过课程
-	classIsLike(uid,data){
+	classIsLike(uid, data) {
 		let url = getProductUrl(`wx/favorites/isLike`);
 		return request.getInstance().header({
 			uid
 		}).url(url).data(data).send();
 	},
-	getClassDetail(uid,id) {
+	getClassDetail(uid, id) {
 		let url = getProductUrl(`wx/lesson/${id}`);
 		return request.getInstance().header({
 			uid
 		}).url(url).send();
 	},
 	// 获取单课朗读信息
-	getClassRead(uid,data){
+	getClassRead(uid, data) {
 		let url = getBaseUrl(`wx/userRead`);
 		return request.getInstance().header({
 			uid
 		}).data(data).url(url).send();
 	},
 	// 作品播放了+1
-	playWorks(uid,readId){
+	playWorks(uid, readId) {
 		let url = getBaseUrl(`wx/userRead/play/${readId}`);
 		return request.getInstance().header({
 			uid
@@ -96,7 +96,7 @@ module.exports = {
 		}).url(url).data(data).method('POST').send();
 	},
 	// 点赞作品
-	likeWorks(uid,readId){
+	likeWorks(uid, readId) {
 		let url = getBaseUrl(`wx/userRead/like/${readId}`);
 		return request.getInstance().header({
 			uid
@@ -132,19 +132,19 @@ module.exports = {
 		}).send();
 	},
 	// 搜索
-	getSearchResult(uid,key,pageNo,pageSize){
+	getSearchResult(uid, key, pageNo, pageSize) {
 		let url = getProductUrl(`wx/lesson`);
 		return request.getInstance().header({
 			uid
 		}).url(url).data({
-			title:key,
+			title: key,
 			productId: '',
 			pageNo: pageNo,
 			pageSize: pageSize
 		}).send();
 	},
 	// 获取回复信息
-	getReply(uid, columnId, pageNo, pageSize){
+	getReply(uid, columnId, pageNo, pageSize) {
 		let url = getBaseUrl(`wx/posts/reply`);
 		return request.getInstance().header({
 			uid
@@ -155,56 +155,56 @@ module.exports = {
 		}).send();
 	},
 	// 获取回复(楼中楼)
-	getReplyComment(uid, postId){
+	getReplyComment(uid, postId) {
 		let url = getBaseUrl(`wx/posts/one/${postId}`);
 		return request.getInstance().header({
 			uid
 		}).url(url).send();
 	},
 	// 发布回复(楼中楼)
-	postReplyComment(uid, data){
+	postReplyComment(uid, data) {
 		let url = getBaseUrl(`wx/reply`);
 		return request.getInstance().header({
 			uid
 		}).url(url).data(data).method('POST').send();
 	},
 	// 点赞评论
-	likeCommend(uid,likeUid){
+	likeCommend(uid, likeUid) {
 		let url = getBaseUrl(`wx/posts/attribute/${likeUid}`);
 		return request.getInstance().header({
 			uid
 		}).url(url).method('GET').send();
 	},
 	// 发布讨论
-	postReply(uid, data){
+	postReply(uid, data) {
 		let url = getBaseUrl(`wx/posts`);
 		return request.getInstance().header({
 			uid
 		}).url(url).data(data).method('POST').send();
 	},
 	// 获取推荐团购信息
-	getGroupList () {
+	getGroupList() {
 		let url = getBaseUrl(`wx/groupPurchaseInfo/recommend`);
 		return request.getInstance().header({
 			uid: wx.getStorageSync('uid')
 		}).url(url).send();
 	},
 	// 获取课程团购信息
-	getGroupPurchaseInfo (productId) {
+	getGroupPurchaseInfo(productId) {
 		let url = getBaseUrl(`wx/groupPurchaseInfo/info/${productId}`);
 		return request.getInstance().header({
 			uid: wx.getStorageSync('uid')
 		}).url(url).send();
 	},
 	// 发起团购
-	SendGroupPurchas (data) {
+	SendGroupPurchas(data) {
 		let url = getBaseUrl(`wx/groupPurchase/create`);
 		return request.getInstance().header({
 			uid: wx.getStorageSync('uid')
 		}).url(url).data(data).method('POST').send();
 	},
 	// 参加团购
-	JoinGroupPurchas (orderId) {
+	JoinGroupPurchas(orderId) {
 		let url = getBaseUrl(`wx/groupPurchase/join`);
 		return request.getInstance().header({
 			uid: wx.getStorageSync('uid')
@@ -213,14 +213,14 @@ module.exports = {
 		}).method('POST').send();
 	},
 	// 收藏课程
-	collectClass(uid, data){
+	collectClass(uid, data) {
 		let url = getProductUrl(`wx/favorites`);
 		return request.getInstance().header({
 			uid
 		}).url(url).data(data).method('POST').send();
 	},
 	//我的团
-	getMygroup () {
+	getMygroup() {
 		let url = getBaseUrl(`wx/groupPurchase/my`);
 		return request.getInstance().header({
 			uid: wx.getStorageSync('uid')
@@ -230,23 +230,23 @@ module.exports = {
 		}).send();
 	},
 	//获取团购详情
-	getMygroupInfo (orderId) {
+	getMygroupInfo(orderId) {
 		let url = getBaseUrl(`wx/groupPurchase/info/${orderId}`);
 		return request.getInstance().header({
 			uid: wx.getStorageSync('uid')
 		}).url(url).send();
 	},
 	//团购是否成功
-	groupSuccess (orderId) {
+	groupSuccess(orderId) {
 		let url = getBaseUrl(`wx/groupPurchase/joinStatus`);
 		return request.getInstance().header({
 			uid: wx.getStorageSync('uid')
 		}).url(url).data({
 			orderId
 		}).send();
-	},	
+	},
 	// 发起奖励
-	rewardMoney(uid, data){
+	rewardMoney(uid, data) {
 		let url = getBaseUrl(`wx/wallet/award`);
 		return request.getInstance().header({
 			uid
@@ -276,5 +276,12 @@ module.exports = {
     }).data({
         uid: wx.getStorageSync('uid')
     }).url(url).send();
+},
+	// 生成二维码
+	createQRCode(data){
+		let url = getBaseUrl(`wx/qrCode`);
+		return request.getInstance().header({
+			uid: wx.getStorageSync('uid')
+		}).data(data).url(url).send();
 	}
 }