소스 검색

合并代码

Rorschach 6 년 전
부모
커밋
6281a8da00

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

@@ -211,7 +211,6 @@ Page({
           })
         }
       }else {
-        debugger;
         setTimeout(() => {
           wx.navigateTo({
             url: `/pages/groupPage/collage-details/collage-details?orderId=${detailId}`
@@ -244,6 +243,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
+    debugger
     wx.setNavigationBarTitle({
       title: '拼团详情'
     })

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

@@ -5,7 +5,7 @@ Page({
    */
   data: {
     title: '',
-    totalMoney: 3000,
+    totalMoney: 0,
     textDoc: '收到的赏金',
     textPrompt: '收到的奖励自动转入微信钱包',
     walletDetail: '资金明细',

+ 24 - 84
pages/user/mycollection/mycollection.js

@@ -1,148 +1,88 @@
-// pages/user/mycollection/mycollection.js
+import httpRequestApi from '../../../utils/APIClient';
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-    collection_data: [
-      {
-        title: "古诗词诵读(一)江南",
-        grade: "一年级(上学期)",
-        avatarUrl: '../../../static/image/timg.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: '../../../static/image/timg.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: '../../../static/image/timg.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: '../../../static/image/timg.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: '../../../static/image/timg.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: '../../../static/image/timg.jpg',
-        previewUrl: "../../../static/image/timg.jpg",
-        plays: "17230",
-        likes: "71230",
-        classId: "1",
-        avatar: '../../static/image/timg.jpg',
-        nickName: '木小雅',
-        time: '10-18 09:56'
-      }
-    ]
+    collection_data: []
+  },
+
+  toClass: function(e) {
+    let targetCode = e.currentTarget.dataset.targetcode;
+    let title = e.currentTarget.dataset.title;
+    wx.navigateTo({
+      url: `../../main/class/class?id=${targetCode}&title=${title}`
+    });
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function (option) {
+  onLoad: function(option) {
     console.log(option.title);
     if (option.title) {
       wx.setNavigationBarTitle({
-        title: option.title//页面标题为路由参数
+        title: option.title //页面标题为路由参数
       });
       this.setData({
         title: option.title
       });
     }
 
+    httpRequestApi.myFavorites().success(res => {
+      this.setData({
+        collection_data: res.data.data.list
+      });
+    });
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
-  onReady: function () {
+  onReady: function() {
 
   },
 
   /**
    * 生命周期函数--监听页面显示
    */
-  onShow: function () {
+  onShow: function() {
 
   },
 
   /**
    * 生命周期函数--监听页面隐藏
    */
-  onHide: function () {
+  onHide: function() {
 
   },
 
   /**
    * 生命周期函数--监听页面卸载
    */
-  onUnload: function () {
+  onUnload: function() {
 
   },
 
   /**
    * 页面相关事件处理函数--监听用户下拉动作
    */
-  onPullDownRefresh: function () {
+  onPullDownRefresh: function() {
 
   },
 
   /**
    * 页面上拉触底事件的处理函数
    */
-  onReachBottom: function () {
+  onReachBottom: function() {
 
   },
 
   /**
    * 用户点击右上角分享
    */
-  onShareAppMessage: function () {
+  onShareAppMessage: function() {
 
   }
 })

+ 3 - 26
pages/user/mycollection/mycollection.wxml

@@ -1,36 +1,13 @@
 <view class='my-collection'>
-  <view class='collection-article' wx:for="{{ collection_data }}" wx:key="{{ index }}">
-    <view class='collection-top'>
-      <view class='top-img'>
-        <image src='{{ item.avatarUrl }}'></image>
-      </view>
-      <view class='collection-info'>
-        <view class='title'>{{ item.nickName }}</view>
-        <view class='date'>{{ item.time }}</view>
-      </view>
-    </view>
+  <view class='collection-article' wx:for="{{ collection_data }}" wx:key="{{ index }}" bindtap='toClass' data-targetCode="{{item.targetCode}}" data-title='{{ item.title }}'>
     <view class='video-preview'>
-      <image src='{{ item.previewUrl }}'></image>
+      <image src='{{ item.iconImg }}'></image>
     </view>
     <view class='content-title'>
       {{ item.title }}
     </view>
     <view class='content-detail'>
-      <view class='left'>{{ item.grade }}</view>
-      <view class='right'>
-        <view class='right-detail'>
-          <view class='play-img'>
-            <image src='../../../static/image/hotPlays.png'></image>
-          </view>
-          <text>{{ item.plays }}</text>
-        </view>
-        <view class='right-detail'>
-          <view class='point-img'>
-            <image src='../../../static/image/like.png'></image>
-          </view>
-          <text>{{ item.likes }}</text>
-        </view>
-      </view>
+      <view class='left'>{{ item.summary }}</view>
     </view>
   </view>
 </view>

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

@@ -63,7 +63,7 @@
 .content-title{
   margin-top: 10rpx;
   width: 100%;
-  height: 50rpx;
+  height: 55rpx;
   font-size: 32rpx;
   font-weight: 600;
   color: #414141;

+ 3 - 78
pages/user/myconcern/myconcern.js

@@ -7,80 +7,7 @@ Page({
       fullScreenBtn: false,
       playBtn: false,
       gesture: true,
-      concerns:[
-          {
-              nickName: '清然未',
-              time: '10-18 09:56',
-              avatar: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg?t=18102320',
-              concerned: '已关注',
-              followBack: '相互关注',
-              isEachOther: false
-          },
-          {
-              nickName: '木小雅',
-              time: '10-18 09:56',
-              avatar: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg?t=18102320',
-              concerned: '已关注',
-              followBack: '相互关注',
-              isEachOther: true
-          },
-          {
-              nickName: '清然未',
-              time: '10-18 09:56',
-              avatar: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg?t=18102320',
-              concerned: '已关注',
-              followBack: '相互关注',
-              isEachOther: false
-          },
-          {
-              nickName: '木小雅',
-              time: '10-18 09:56',
-              avatar: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg?t=18102320',
-              concerned: '已关注',
-              followBack: '相互关注',
-              isEachOther: true
-          },
-          {
-              nickName: '清然未',
-              time: '10-18 09:56',
-              avatar: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg?t=18102320',
-              concerned: '已关注',
-              followBack: '相互关注',
-              isEachOther: false
-          },
-          {
-              nickName: '清然未',
-              time: '10-18 09:56',
-              avatar: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg?t=18102320',
-              concerned: '已关注',
-              followBack: '相互关注',
-              isEachOther: false
-          },
-          {
-              nickName: '清然未',
-              time: '10-18 09:56',
-              avatar: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg?t=18102320',
-              concerned: '已关注',
-              followBack: '相互关注',
-              isEachOther: false
-          },
-          {
-              nickName: '木小雅',
-              time: '10-18 09:56',
-              avatar: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg?t=18102320',
-              concerned: '已关注',
-              followBack: '相互关注',
-              isEachOther: true
-          },
-          {
-              nickName: '木小雅',
-              time: '10-18 09:56',
-              avatar: 'https://developers.weixin.qq.com/miniprogram/dev/image/cat/0.jpg?t=18102320',
-              concerned: '已关注',
-              followBack: '相互关注',
-              isEachOther: true
-          },
-      ]
+      fanList:[]
   },
 
   /**
@@ -96,11 +23,9 @@ Page({
         title: option.title
       });
     }
-    let uid = 1, pageNo = 8, pageSize = 18;
-    httpRequestApi.getFollowUsers(uid, pageNo, pageSize).success(res => {
-      let { data } = res.data;
+    httpRequestApi.myFans().success(res => {
       this.setData({
-        isEachOther: data.hasPrevious
+        fanList: res.data.data.list
       });
     });
   },

+ 14 - 6
pages/user/myconcern/myconcern.wxml

@@ -1,24 +1,32 @@
+<wxs module="wxs">
+  function formatDate(time) {
+    var timeTemp = getDate(time);
+    var timeString = timeTemp.toLocaleDateString() + timeTemp.toLocaleTimeString();
+    return timeString.replace('/','-').replace('/','-').replace('上午',' ').replace('下午',' ');
+  }
+  module.exports.formatDate = formatDate;
+</wxs>
 <view class='my-concern'>
   <view class="concern-center">
-    <view class='concern-info' wx:for="{{ concerns }}" wx:key="{{ index }}">
+    <view class='concern-info' wx:for="{{ fanList }}" wx:key="{{ index }}">
       <view class='avatar-box'>
-        <image class='avatar-image' src="{{ item.avatar }}" />
+        <image class='avatar-image' src="{{ item.user.avatar }}" />
       </view>
       <view class="avatar-name">
-        <text class="nickName">{{ item.nickName }}</text>
-        <text class="time">{{ item.time }}</text>
+        <text class="nickName">{{ item.user.wechatName }}</text>
+        <text class="time">{{ wxs.formatDate(item.fans.gmtCreated) }}</text>
       </view>
       <view class="avatar-follow" wx:if='{{ item.isEachOther }}'>
         <view class='avatar-img'>
           <image class='avatar-images' src="../../../static/image/concerned.png" />
         </view>
-        <view class="follow-status">{{ item.concerned }}</view>
+        <view class="follow-status">相互关注</view>
       </view>
       <view class="avatar-follow" wx:elif='{{ item.followBack === item.followBack || item.isEachOther }}'>
         <view class='avatar-img'>
           <image class='avatar-images' src="../../../static/image/concernback.png" />
         </view>
-        <view class="follow-status">{{ item.followBack }}</view>
+        <view class="follow-status">已关注</view>
       </view>
     </view>
   </view>

+ 9 - 8
pages/user/myconcern/myconcern.wxss

@@ -25,7 +25,7 @@ page{
 }
 
 .avatar-box{
-  margin-left: 20rpx;
+  margin-left: 30rpx;
   width: 96rpx;
   height: 96rpx;
   border-radius: 50%;
@@ -38,25 +38,26 @@ page{
 }
 
 .nickName{
-  width: 200rpx;
+  width: 420rpx;
   height: 44rpx;
   color: #000000;
   font-size: 32rpx;
 }
 
 .time{
-  width: 200rpx;
+  width: 420rpx;
   height: 44rpx;
   color: #686868;
   font-size: 32rpx;
 }
 
 .avatar-follow{
-  margin-left: 270rpx;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  width: 100rpx;
+  margin-left:30rpx;
+  display:flex;
+  flex-direction:column;
+  align-items:center;
+  width:100rpx;
+
 }
 
 .avatar-img{

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

@@ -33,7 +33,15 @@ Page({
       // }
     ]
   },
-
+  // 进入课本
+  toCourse: function(e) {
+    let productId = e.currentTarget.dataset.productid;
+    let productTitle = e.currentTarget.dataset.producttitle;
+    debugger
+    wx.navigateTo({
+      url: `../../groupPage/grade-details/grade-details?productId=${productId}&title=${productTitle}`
+    });
+  },
   /**
    * 生命周期函数--监听页面加载
    */

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

@@ -1,7 +1,7 @@
 <view class='my-course'>
   <block wx:for="{{ bookList }}" wx:key="{{ index }}">
     <view class="book-item">
-      <view class='book-box'>
+      <view class='book-box' bindtap='toCourse' data-productId='{{ item.productId }}' data-productTitle='{{ item.productTitle }}'>
         <image class="item-img" src="{{ item.iconImg }}"></image>
       </view>
       <view class='item-title'>{{ item.groupTitle }}</view>

+ 83 - 74
pages/user/myread/myread.js

@@ -6,81 +6,89 @@ Page({
    */
   data: {
     wareCards: [
-      // {
-      //   title: "古诗词诵读(一)江南",
-      //   grade: "一年级(上学期)",
-      //   avatarUrl: '../../../static/image/timg.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: '../../../static/image/timg.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: '../../../static/image/timg.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: '../../../static/image/timg.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: '../../../static/image/timg.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: '../../../static/image/timg.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: '../../../static/image/timg.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: '../../../static/image/timg.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: '../../../static/image/timg.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: '../../../static/image/timg.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: '../../../static/image/timg.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: '../../../static/image/timg.jpg',
+        previewUrl: "../../../static/image/timg.jpg",
+        plays: "17230",
+        likes: "71230",
+        classId: "1",
+        avatar: '../../static/image/timg.jpg',
+        nickName: '喔喔',
+        time: '10-18 09:56'
+      }
     ]
   },
 
+  toWork: function (e) {
+    let lessonId = e.currentTarget.dataset.lessonid;
+    let title = e.currentTarget.dataset.title;
+    wx.navigateTo({
+      url: `../../social/works/works?id=${lessonId}&title=${title}`
+    });
+  },
+
   /**
    * 生命周期函数--监听页面加载
    */
@@ -95,9 +103,10 @@ Page({
       });
     }
     APIClient.myRead().success(res => {
-      console.log(res);
+      console.log(res.data.data.list);
+      debugger;
       this.setData({
-        // wareCards: res.data.data.data.list
+        wareCards: res.data.data.list
       });
     }).fail(err => {
       console.log(err);

+ 13 - 14
pages/user/myread/myread.wxml

@@ -1,34 +1,33 @@
+<wxs module="wxs">
+  function formatDate(time) {
+    var timeTemp = getDate(time);
+    var timeString = timeTemp.toLocaleDateString() + timeTemp.toLocaleTimeString();
+    return timeString.replace('/','-').replace('/','-').replace('上午',' ').replace('下午',' ');
+  }
+  module.exports.formatDate = formatDate;
+</wxs>
 <view class='my-read'>
-  <view class='read-article' wx:for="{{ wareCards }}" wx:key="{{ index }}">
-    <view class='read-top'>
-      <view class='top-img'>
-        <image src='{{ item.avatarUrl }}'></image>
-      </view>
-      <view class='read-info'>
-        <view class='title'>{{ item.nickName }}</view>
-        <view class='date'>{{ item.time }}</view>
-      </view>
-    </view>
+  <view class='read-article' wx:for="{{ wareCards }}" wx:key="{{ index }}" bindtap='toWork' data-lessonId='{{ item.id }}' data-title='{{ item.title }}'>
     <view class='video-preview'>
-      <image src='{{ item.previewUrl }}'></image>
+      <image src='{{ item.iconImg }}'></image>
     </view>
     <view class='content-title'>
       {{ item.title }}
     </view>
     <view class='content-detail'>
-      <view class='left'>{{ item.grade }}</view>
+      <view class='left'>{{ item.summary }}</view>
       <view class='right'>
         <view class='right-detail'>
           <view class='play-img'>
             <image src='../../../static/image/hotPlays.png'></image>
           </view>
-          <text>{{ item.plays }}</text>
+          <text>{{ item.playAmount }}</text>
         </view>
         <view class='right-detail'>
           <view class='point-img'>
             <image src='../../../static/image/like.png'></image>
           </view>
-          <text>{{ item.likes }}</text>
+          <text>{{ item.likeAmount }}</text>
         </view>
       </view>
     </view>

+ 24 - 36
pages/user/walletDetails/walletDetails.wxml

@@ -1,46 +1,34 @@
-<wxs module="m1">
-    function formatDate(time, flag) {
-	const t = new Date(time); 
-	const tf = function(i){return (i < 10 ? '0' : '') + i};
-	const year = t.getFullYear();
-	const month = tf(t.getMonth() + 1);
-	const day = tf(t.getDate());
-	const hour = tf(t.getHours());
-	const minute = tf(t.getMinutes());
-	//console.log( month + '月' + day + '日' + hour + ':' + minute);
-	if(flag == 1) {
-		return  month + '月' + day + '日' + ' ' + hour + ':' + minute;
-	}else if(flag == 2) {
-		return year + '-' + month + '-' + day
-	}else if(flag == 3){
-		return month + '-' + day + ' ' + hour + ':' + minute;
-	}
-}
-    module.exports.formatDate = formatDate;
+<wxs module="wxs">
+  function formatDate(time) {
+    var timeTemp = getDate(time);
+    var timeString = timeTemp.toLocaleDateString() + timeTemp.toLocaleTimeString();
+    return timeString.replace('/','-').replace('/','-').replace('上午',' ').replace('下午',' ');
+  }
+  module.exports.formatDate = formatDate;
 </wxs>
 <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">{{ item.description }}</text>
+      <view class="walletDetails-left">
+        <view class='avatar-box'>
+          <image src="../../../static/image/walletdetails.png" />
+        </view>
+        <view class="avatar-info">
+          <text class="avatar-doc">{{ item.description }}</text>
 
-                <text class="avatar-time"></text>
-            </view>
+          <text class="avatar-time">{{wxs.formatDate(item.gmtCreated)}}</text>
+        </view>
+      </view>
+      <view class="walletDetails-right">
+        <view class="avatar-value-pos" wx:if="{{ item.type === 'INCOME' }}">
+          <text class="avatar-symbol">+</text>
+          <text>{{ item.price / 100 }}</text>
         </view>
-        <view class="walletDetails-right">
-            <view class="avatar-value-pos" wx:if="{{ item.type === 'INCOME' }}">
-                <text class="avatar-symbol">+</text>
-                <text>{{ item.price }}</text>
-            </view>
-            <view class="avatar-value-neg" wx:else>
-                <text class="avatar-symbol">-</text>
-                <text>{{ item.price }}</text>
-            </view>
+        <view class="avatar-value-neg" wx:else>
+          <text class="avatar-symbol">-</text>
+          <text>{{ item.price / 100 }}</text>
         </view>
+      </view>
     </view>
   </view>
 </view>

+ 1 - 1
project.config.json

@@ -41,7 +41,7 @@
 				{
 					"id": 0,
 					"name": "edit",
-					"pathName": "pages/user/myEdit/myEdit",
+					"pathName": "pages/user/mycollection/mycollection",
 					"query": ""
 				},
 				{

+ 312 - 298
utils/APIClient.js

@@ -5,307 +5,321 @@ let request = require('WXHttpRequest.js');
 const httputil = require('httpUtil.js');
 
 function getProductUrl(action) {
-	return HOST_PRODUCT + action;
+  return HOST_PRODUCT + action;
 }
 
 function getBaseUrl(action) {
-	return HOST_BASE + action;
+  return HOST_BASE + action;
 }
 module.exports = {
-    //获取推荐首页信息
-    getIndex(uid) {
-        let url = getProductUrl('wx/index');
-        return request.getInstance().header({
-            uid
-        }).url(url).send();
-    },
-    // 获取首页人气推荐
-    getHotRecommend(uid, pageNo, pageSize) {
-        let url = getBaseUrl('wx/userRead/recommend');
-        return request.getInstance().header({
-            uid
-        }).data({
-            pageNo,
-            pageSize,
-        }).url(url).send();
-    },
-    // 获取用户朗读详细信息
-    getWorksDetail(uid, readId) {
-        let url = getBaseUrl(`wx/userRead/info/${readId}`);
-        return request.getInstance().header({
-            uid
-        }).url(url).send();
-    },
-    // 获取全部课本
-    getAllBooks(pageNo, pageSize) {
-        let url = getProductUrl('wx/product');
-        return request.getInstance().header({
-            uid: wx.getStorageSync('uid')
-        }).url(url).data({
-            pageNo,
-            pageSize
-        }).send();
-    },
-    // 获取课本详情
-    getBookDetail(uid, id) {
-        let url = getProductUrl(`wx/product/${id}`);
-        return request.getInstance().header({
-            uid
-        }).url(url).send();
-    },
-    // 获取单课详情
-    getClassDetail(uid, id) {
-        let url = getProductUrl(`wx/lesson/${id}`);
-        return request.getInstance().header({
-            uid
-        }).url(url).send();
-    },
-    // 检查是否收藏过课程
-    classIsLike(uid, data) {
-        let url = getProductUrl(`wx/favorites/isLike`);
-        return request.getInstance().header({
-            uid
-        }).url(url).data(data).send();
-    },
-    getClassDetail(uid, id) {
-        let url = getProductUrl(`wx/lesson/${id}`);
-        return request.getInstance().header({
-            uid
-        }).url(url).send();
-    },
-    // 获取单课朗读信息
-    getClassRead(uid, data) {
-        let url = getBaseUrl(`wx/userRead`);
-        return request.getInstance().header({
-            uid
-        }).data(data).url(url).send();
-    },
-    // 作品播放了+1
-    playWorks(uid, readId) {
-        let url = getBaseUrl(`wx/userRead/play/${readId}`);
-        return request.getInstance().header({
-            uid
-        }).url(url).send();
-    },
-    // 发布作品
-    postWork(uid, data) {
-        console.log(data);
-        let url = getBaseUrl(`wx/userRead`);
-        return request.getInstance().header({
-            uid
-        }).url(url).data(data).method('POST').send();
-    },
-    // 点赞作品
-    likeWorks(uid, readId) {
-        let url = getBaseUrl(`wx/userRead/like/${readId}`);
-        return request.getInstance().header({
-            uid
-        }).url(url).send();
-    },
-    // 关注用户
-    followUser(uid, followUid) {
-        let url = getBaseUrl(`wx/fans`);
-        return request.getInstance().header({
-            uid
-        }).url(url).data({
-            "uid": followUid
-        }).method('POST').send();
-    },
-    //获取关注的用户列表
-    getFollowUsers(uid, pageNo, pageSize) {
-        let url = getBaseUrl(`wx/fans`);
-        return request.getInstance().header({
-            uid
-        }).url(url).data({
-            pageNo: pageNo,
-            pageSize: pageSize
-        }).send();
-    },
-    // 获取关注用户的作品列表
-    getFollowWorks(uid, pageNo, pageSize) {
-        let url = getBaseUrl(`wx/fans/interest`);
-        return request.getInstance().header({
-            uid
-        }).url(url).data({
-            pageNo: pageNo,
-            pageSize: pageSize
-        }).send();
-    },
-    // 搜索
-    getSearchResult(uid, key, pageNo, pageSize) {
-        let url = getProductUrl(`wx/lesson`);
-        return request.getInstance().header({
-            uid
-        }).url(url).data({
-            title: key,
-            productId: '',
-            pageNo: pageNo,
-            pageSize: pageSize
-        }).send();
-    },
-    // 获取回复信息
-    getReply(uid, columnId, pageNo, pageSize) {
-        let url = getBaseUrl(`wx/posts/reply`);
-        return request.getInstance().header({
-            uid
-        }).url(url).data({
-            columnId: columnId,
-            pageNo: pageNo,
-            pageSize: pageSize
-        }).send();
-    },
-    // 获取回复(楼中楼)
-    getReplyComment(uid, postId) {
-        let url = getBaseUrl(`wx/posts/one/${postId}`);
-        return request.getInstance().header({
-            uid
-        }).url(url).send();
-    },
-    // 发布回复(楼中楼)
-    postReplyComment(uid, data) {
-        let url = getBaseUrl(`wx/reply`);
-        return request.getInstance().header({
-            uid
-        }).url(url).data(data).method('POST').send();
-    },
-    // 点赞评论
-    likeCommend(uid, likeUid) {
-        let url = getBaseUrl(`wx/posts/attribute/${likeUid}`);
-        return request.getInstance().header({
-            uid
-        }).url(url).method('GET').send();
-    },
-    // 发布讨论
-    postReply(uid, data) {
-        let url = getBaseUrl(`wx/posts`);
-        return request.getInstance().header({
-            uid
-        }).url(url).data(data).method('POST').send();
-    },
-    // 获取推荐团购信息
-    getGroupList() {
-        let url = getBaseUrl(`wx/groupPurchaseInfo/recommend`);
-        return request.getInstance().header({
-            uid: wx.getStorageSync('uid')
-        }).url(url).send();
-    },
-    // 获取课程团购信息
-    getGroupPurchaseInfo(productId) {
-        let url = getBaseUrl(`wx/groupPurchaseInfo/info/${productId}`);
-        return request.getInstance().header({
-            uid: wx.getStorageSync('uid')
-        }).url(url).send();
-    },
-    // 发起团购
-    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) {
-        let url = getBaseUrl(`wx/groupPurchase/join`);
-        return request.getInstance().header({
-            uid: wx.getStorageSync('uid')
-        }).url(url).data({
-            orderId
-        }).method('POST').send();
-    },
-    // 收藏课程
-    collectClass(uid, data) {
-        let url = getProductUrl(`wx/favorites`);
-        return request.getInstance().header({
-            uid
-        }).url(url).data(data).method('POST').send();
-    },
-    //我的团
-    getMygroup() {
-        let url = getBaseUrl(`wx/groupPurchase/my`);
-        return request.getInstance().header({
-            uid: wx.getStorageSync('uid')
-        }).url(url).data({
-            pageNo: 1,
-            pageSize: 100
-        }).send();
-    },
-    //获取团购详情
-    getMygroupInfo(orderId) {
-        let url = getBaseUrl(`wx/groupPurchase/info/${orderId}`);
-        return request.getInstance().header({
-            uid: wx.getStorageSync('uid')
-        }).url(url).send();
-    },
-    //团购是否成功
-    groupSuccess(orderId) {
-        let url = getBaseUrl(`wx/groupPurchase/joinStatus`);
-        return request.getInstance().header({
-            uid: wx.getStorageSync('uid')
-        }).url(url).data({
-            orderId
-        }).send();
-    },
-    // 发起奖励
-    rewardMoney(uid, data) {
-        let url = getBaseUrl(`wx/wallet/award`);
-        return request.getInstance().header({
-            uid
-        }).url(url).data(data).method('POST').send();
-    },
-    // 修改资料
-    settingUserInfo(data) {
-        let url = getBaseUrl(`wx/user`);
-        return request.getInstance().header({
-            uid:wx.getStorageSync('uid')
-        }).data(data).url(url).method('PUT').send();
-    },
-    //获取个人信息
-    getUserInfo() {
-        let url = getBaseUrl(`wx/user`);
-        return request.getInstance().header({
-            uid: wx.getStorageSync('uid')
-        }).url(url).send();
-    },
-    // 获取播放量等数据
-    getUserWorksInfo() {
-        let url = getBaseUrl(`wx/user/my`);
-        return request.getInstance().header({
-            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();
-    },
-//	我的奖金
-    myWallet() {
-      let url = getBaseUrl('wx/wallet/bonus');
-      return request.getInstance().header({
-          uid: wx.getStorageSync('uid')
-      }).url(url).send();
-    },
-    // 資金明細
-    myWalletDetails() {
-      let url = getBaseUrl('wx/wallet/record');
-      return request.getInstance().header({
-        uid: wx.getStorageSync('uid')
-      }).url(url).send();
-    },
-    // 我的課程
-    myCourse() {
-      let url = getBaseUrl('wx/groupPurchase/myCourse');
-      return request.getInstance().header({
-        uid: wx.getStorageSync('uid')
-      }).url(url).send();
-    },
-    // 我的朗读
-    myRead() {
-      let url = getBaseUrl('wx/userRead/my');
-      return request.getInstance().header({
-        uid: wx.getStorageSync('uid')
-      }).url(url).send();
-    },
+  //获取推荐首页信息
+  getIndex(uid) {
+    let url = getProductUrl('wx/index');
+    return request.getInstance().header({
+      uid
+    }).url(url).send();
+  },
+  // 获取首页人气推荐
+  getHotRecommend(uid, pageNo, pageSize) {
+    let url = getBaseUrl('wx/userRead/recommend');
+    return request.getInstance().header({
+      uid
+    }).data({
+      pageNo,
+      pageSize,
+    }).url(url).send();
+  },
+  // 获取用户朗读详细信息
+  getWorksDetail(uid, readId) {
+    let url = getBaseUrl(`wx/userRead/info/${readId}`);
+    return request.getInstance().header({
+      uid
+    }).url(url).send();
+  },
+  // 获取全部课本
+  getAllBooks(pageNo, pageSize) {
+    let url = getProductUrl('wx/product');
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).data({
+      pageNo,
+      pageSize
+    }).send();
+  },
+  // 获取课本详情
+  getBookDetail(uid, id) {
+    let url = getProductUrl(`wx/product/${id}`);
+    return request.getInstance().header({
+      uid
+    }).url(url).send();
+  },
+  // 获取单课详情
+  getClassDetail(uid, id) {
+    let url = getProductUrl(`wx/lesson/${id}`);
+    return request.getInstance().header({
+      uid
+    }).url(url).send();
+  },
+  // 检查是否收藏过课程
+  classIsLike(uid, data) {
+    let url = getProductUrl(`wx/favorites/isLike`);
+    return request.getInstance().header({
+      uid
+    }).url(url).data(data).send();
+  },
+  getClassDetail(uid, id) {
+    let url = getProductUrl(`wx/lesson/${id}`);
+    return request.getInstance().header({
+      uid
+    }).url(url).send();
+  },
+  // 获取单课朗读信息
+  getClassRead(uid, data) {
+    let url = getBaseUrl(`wx/userRead`);
+    return request.getInstance().header({
+      uid
+    }).data(data).url(url).send();
+  },
+  // 作品播放了+1
+  playWorks(uid, readId) {
+    let url = getBaseUrl(`wx/userRead/play/${readId}`);
+    return request.getInstance().header({
+      uid
+    }).url(url).send();
+  },
+  // 发布作品
+  postWork(uid, data) {
+    console.log(data);
+    let url = getBaseUrl(`wx/userRead`);
+    return request.getInstance().header({
+      uid
+    }).url(url).data(data).method('POST').send();
+  },
+  // 点赞作品
+  likeWorks(uid, readId) {
+    let url = getBaseUrl(`wx/userRead/like/${readId}`);
+    return request.getInstance().header({
+      uid
+    }).url(url).send();
+  },
+  // 关注用户
+  followUser(uid, followUid) {
+    let url = getBaseUrl(`wx/fans`);
+    return request.getInstance().header({
+      uid
+    }).url(url).data({
+      "uid": followUid
+    }).method('POST').send();
+  },
+  //获取关注的用户列表
+  getFollowUsers(uid, pageNo, pageSize) {
+    let url = getBaseUrl(`wx/fans`);
+    return request.getInstance().header({
+      uid
+    }).url(url).data({
+      pageNo: pageNo,
+      pageSize: pageSize
+    }).send();
+  },
+  // 获取关注用户的作品列表
+  getFollowWorks(uid, pageNo, pageSize) {
+    let url = getBaseUrl(`wx/fans/interest`);
+    return request.getInstance().header({
+      uid
+    }).url(url).data({
+      pageNo: pageNo,
+      pageSize: pageSize
+    }).send();
+  },
+  // 搜索
+  getSearchResult(uid, key, pageNo, pageSize) {
+    let url = getProductUrl(`wx/lesson`);
+    return request.getInstance().header({
+      uid
+    }).url(url).data({
+      title: key,
+      productId: '',
+      pageNo: pageNo,
+      pageSize: pageSize
+    }).send();
+  },
+  // 获取回复信息
+  getReply(uid, columnId, pageNo, pageSize) {
+    let url = getBaseUrl(`wx/posts/reply`);
+    return request.getInstance().header({
+      uid
+    }).url(url).data({
+      columnId: columnId,
+      pageNo: pageNo,
+      pageSize: pageSize
+    }).send();
+  },
+  // 获取回复(楼中楼)
+  getReplyComment(uid, postId) {
+    let url = getBaseUrl(`wx/posts/one/${postId}`);
+    return request.getInstance().header({
+      uid
+    }).url(url).send();
+  },
+  // 发布回复(楼中楼)
+  postReplyComment(uid, data) {
+    let url = getBaseUrl(`wx/reply`);
+    return request.getInstance().header({
+      uid
+    }).url(url).data(data).method('POST').send();
+  },
+  // 点赞评论
+  likeCommend(uid, likeUid) {
+    let url = getBaseUrl(`wx/posts/attribute/${likeUid}`);
+    return request.getInstance().header({
+      uid
+    }).url(url).method('GET').send();
+  },
+  // 发布讨论
+  postReply(uid, data) {
+    let url = getBaseUrl(`wx/posts`);
+    return request.getInstance().header({
+      uid
+    }).url(url).data(data).method('POST').send();
+  },
+  // 获取推荐团购信息
+  getGroupList() {
+    let url = getBaseUrl(`wx/groupPurchaseInfo/recommend`);
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).send();
+  },
+  // 获取课程团购信息
+  getGroupPurchaseInfo(productId) {
+    let url = getBaseUrl(`wx/groupPurchaseInfo/info/${productId}`);
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).send();
+  },
+  // 发起团购
+  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) {
+    let url = getBaseUrl(`wx/groupPurchase/join`);
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).data({
+      orderId
+    }).method('POST').send();
+  },
+  // 收藏课程
+  collectClass(uid, data) {
+    let url = getProductUrl(`wx/favorites`);
+    return request.getInstance().header({
+      uid
+    }).url(url).data(data).method('POST').send();
+  },
+  //我的团
+  getMygroup() {
+    let url = getBaseUrl(`wx/groupPurchase/my`);
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).data({
+      pageNo: 1,
+      pageSize: 100
+    }).send();
+  },
+  //获取团购详情
+  getMygroupInfo(orderId) {
+    let url = getBaseUrl(`wx/groupPurchase/info/${orderId}`);
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).send();
+  },
+  //团购是否成功
+  groupSuccess(orderId) {
+    let url = getBaseUrl(`wx/groupPurchase/joinStatus`);
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).data({
+      orderId
+    }).send();
+  },
+  // 发起奖励
+  rewardMoney(uid, data) {
+    let url = getBaseUrl(`wx/wallet/award`);
+    return request.getInstance().header({
+      uid
+    }).url(url).data(data).method('POST').send();
+  },
+  // 修改资料
+  settingUserInfo(data) {
+    let url = getBaseUrl(`wx/user`);
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).data(data).url(url).method('PUT').send();
+  },
+  //获取个人信息
+  getUserInfo() {
+    let url = getBaseUrl(`wx/user`);
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).send();
+  },
+  // 获取播放量等数据
+  getUserWorksInfo() {
+    let url = getBaseUrl(`wx/user/my`);
+    return request.getInstance().header({
+      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();
+  },
+  //	我的奖金
+  myWallet() {
+    let url = getBaseUrl('wx/wallet/bonus');
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).send();
+  },
+  // 資金明細
+  myWalletDetails() {
+    let url = getBaseUrl('wx/wallet/record');
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).send();
+  },
+  // 我的課程
+  myCourse() {
+    let url = getBaseUrl('wx/groupPurchase/myCourse');
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).send();
+  },
+  // 我的朗读
+  myRead() {
+    let url = getBaseUrl('wx/userRead/my');
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).send();
+  },
+  // 我的收藏
+  myFavorites() {
+    let url = getProductUrl(`wx/favorites`);
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).send();
+  },
+  // 我的关注
+  myFans() {
+    let url = getBaseUrl(`wx/fans`);
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).url(url).send();
+  },
 }