Browse Source

个人信息

Rorschach 5 years ago
parent
commit
af0a7cba22

+ 60 - 78
component/my/my.js

@@ -1,88 +1,70 @@
-export const myInit =  (that) => {
+export const myInit = (that) => {
   that.setData({
     myData: {
-        title: '修改资料',
-        concern: '我的关注',
-        course: '我的课程',
-        read: '我的朗读',
-        keep: '我的收藏',
-        collage: '我的拼团',
-        wallet: '我的钱包',
-        address:['北京海淀','中关村','三小'],
-        schoolCity: '青岛市',
-        schoolName: '黄岛区志贤中学',
-        playNum: 31549,
-        attentionCount: 10254,
-        point: 6317,
-        flowerNum: 56245,
-        user: {}
+      title: '修改资料',
+      concern: '我的关注',
+      course: '我的课程',
+      read: '我的朗读',
+      keep: '我的收藏',
+      collage: '我的拼团',
+      wallet: '我的钱包',
+      address: ['北京海淀', '中关村', '三小'],
+      schoolCity: '',
+      schoolName: '',
+      playNum: 31549,
+      attentionCount: 10254,
+      point: 6317,
+      flowerNum: 56245,
+      user: {}
     }
   });
+  that.getUserWorksInfo();
   that.toMyEdit = (e) => {
-    let title = e.currentTarget.dataset.title;
-    wx.navigateTo({
-      url: `../user/myEdit/myEdit?title=${title}`
-    });
-  },
-  that.toMyConcern = e => {
-    let title = e.currentTarget.dataset.title;
-    wx.navigateTo({
-      url: `../user/myconcern/myconcern?title=${title}`
-    });
-  }
+      let title = e.currentTarget.dataset.title;
+      wx.navigateTo({
+        url: `../user/myEdit/myEdit?title=${title}`
+      });
+    },
+    that.toMyConcern = e => {
+      let title = e.currentTarget.dataset.title;
+      wx.navigateTo({
+        url: `../user/myconcern/myconcern?title=${title}`
+      });
+    }
   that.toMyWallet = e => {
-    let title = e.currentTarget.dataset.title;
-    wx.navigateTo({
-      url: `../user/myWallet/myWallet?title=${title}`
-    });
-  },
-  that.toMyCourse = e => {
-    let title = e.currentTarget.dataset.title;
-    wx.navigateTo({
-      url: `../user/mycourse/mycourse?title=${title}`
-    });
-  },
-  that.toMyRead = e => {
-    let title = e.currentTarget.dataset.title;
-    wx.navigateTo({
-      url: `../user/myread/myread?title=${title}`
-    });
-  },
-  that.toMyKeep = e => {
-    let title = e.currentTarget.dataset.title;
-    wx.navigateTo({
-      url: `../user/mycollection/mycollection?title=${title}`
-    });
-  },
-  that.toMyCollage = e => {
-    let title = e.currentTarget.dataset.title;
-    wx.navigateTo({
-      url: `../../pages/groupPage/my-group/my-group?title=${title}`
-    });
+      let title = e.currentTarget.dataset.title;
+      wx.navigateTo({
+        url: `../user/myWallet/myWallet?title=${title}`
+      });
+    },
+    that.toMyCourse = e => {
+      let title = e.currentTarget.dataset.title;
+      wx.navigateTo({
+        url: `../user/mycourse/mycourse?title=${title}`
+      });
+    },
+    that.toMyRead = e => {
+      let title = e.currentTarget.dataset.title;
+      wx.navigateTo({
+        url: `../user/myread/myread?title=${title}`
+      });
+    },
+    that.toMyKeep = e => {
+      let title = e.currentTarget.dataset.title;
+      wx.navigateTo({
+        url: `../user/mycollection/mycollection?title=${title}`
+      });
+    },
+    that.toMyCollage = e => {
+      let title = e.currentTarget.dataset.title;
+      wx.navigateTo({
+        url: `../../pages/groupPage/my-group/my-group?title=${title}`
+      });
       debugger
       APIClient.myWallet().success(res => {
-          debugger
-          console.log(res.data.data.data);
+        debugger
+        console.log(res.data.data.data);
       });
-  },
-  that.userInfo = function () {
-      const userInfo = wx.getStorageSync('user');
-      console.log(userInfo.data.data.data);
-      that.data.myData.user = userInfo.data.data.data;//直接赋值 给 myData的user对象。
-      that.setData({
-          myData: that.data.myData,
-      },()=>{
-          console.log('myData的user对象,赋值成功')
-          console.log(that.data.myData);
-      });
-    // APIClient.getOpenidSessionKey(res => {
-    //   console.log(res.data.data.data);
-    //   that.data.myData.user = res.data.data.data;//挂载user对象。
-    //   that.setData({
-    //     myData: that.data.myData
-    //   },() => {
-    //     console.log(that.data.myData)
-    //   });
-    // });
-  }()
+    }
+    
 }

+ 7 - 7
component/my/my.wxml

@@ -4,7 +4,7 @@
       <view class='mine-info'>
         <view class='mine-bg'>
           <view class='mine-avatar'>
-            <image class='avatar-image' src='{{ myData.user.avatar }}'></image>
+            <image class='avatar-image' src='{{ myData.user.user.avatar }}'></image>
           </view>
         </view>
         <view class='mine-edit' bindtap='toMyEdit' data-title='{{ myData.title }}'>
@@ -15,13 +15,13 @@
         </view>
       </view>
       <view class='mine-detail'>
-        <text class='mine-title'>{{ myData.user.wechatName }}</text>
-        <view class='mine-address'>{{ myData.schoolCity }},{{ myData.schoolName }}</view>
+        <text class='mine-title'>{{ myData.user.user.wechatName }}</text>
+        <view class='mine-address'>{{ myData.user.user.schoolName }}</view>
         <view class='mine-line'></view>
       </view>
       <view class='mine-category'>
         <view class='play-count'>
-          <view>3232</view>
+          <view>{{ myData.user.playAmount }}</view>
           <view class='border-right'>
             <view class='play-img'>
               <image src='../../static/image/play.png'></image>
@@ -30,7 +30,7 @@
           </view>
         </view>
         <view class='follow-count'>
-          <view class='color'>5200</view>
+          <view class='color'>{{ myData.user.fansAmount }}</view>
           <view class='border-right'>
             <view class='play-img'>
               <image src='../../static/image/follow.png'></image>
@@ -39,7 +39,7 @@
           </view>
         </view>
         <view class='point-count'>
-          <view class='color'>300</view>
+          <view class='color'>{{ myData.user.likeAmount }}</view>
           <view class='border-right'>
             <view class='play-img'>
               <image src='../../static/image/point.png'></image>
@@ -48,7 +48,7 @@
           </view>
         </view>
         <view class='flower-count'>
-          <view class='color'>100</view>
+          <view class='color'>{{ myData.user.pointAmount }}</view>
           <view class='border-right'>
             <view class='play-img'>
               <image src='../../static/image/flower.png'></image>

+ 43 - 20
component/share/share.js

@@ -21,7 +21,8 @@ Component({
     author: '',
     iconImg: '',
     title: '',
-    path: ''
+    path: '',
+    QRCode:''
   },
 
   /**
@@ -54,7 +55,7 @@ Component({
           }
         })
         .then(() => {
-          ctx.drawImage('../../../static/groupImg/code.png', 217, 374, 135, 135);
+          ctx.drawImage(this.data.QRCode, 217, 374, 135, 135);
           console.log(ctx)
           ctx.draw(true, function (res) {
             wx.canvasToTempFilePath({
@@ -75,7 +76,7 @@ Component({
                 })
                 that.setData({
                   imgUrls: res.tempFilePath
-                },()=>{
+                }, () => {
                   wx.hideLoading();
                 })
               },
@@ -100,10 +101,10 @@ Component({
           iconImg: data.iconImg,
           title: data.title,
           // path: data.path,
-          // QRData:{
-          //   page: data.path,
-          //   scene: "par=no"
-          // }
+          QRData:{
+            page: data.path,
+            scene: data.scene
+          }
         })
 
       }
@@ -124,7 +125,33 @@ Component({
     saveImg: function () {
       console.log('yibuububu')
       let download = new Promise((resolve, reject) => {
-        let downAvatar = () =>{
+        let QRCode = () => {
+          // 生成二维码并下载
+          httpRequestApi.createQRCode(this.data.QRData).success(res => {
+            // let base64 = wx.arrayBufferToBase64(res.data);
+            // console.log(a)
+            this.setData({
+              QRCode: res.data
+            })
+            // wx.downloadFile({
+            //   url: res,
+            //   success: (res) => {
+            //     console.log(res)
+            //     console.log('下载二维码成功')
+            //     // this.setData({
+            //     //   avatar: res.tempFilePath
+            //     // }, () => {
+
+            //     // })
+  
+            //   }
+            // });
+            console.log(this.data.QRCode)
+            console.log(res)
+            resolve();
+          })
+        }
+        let downAvatar = () => {
           wx.downloadFile({
             url: this.data.avatar,
             success: (res) => {
@@ -132,11 +159,14 @@ Component({
               console.log(this.data.avatar)
               this.setData({
                 avatar: res.tempFilePath
+              }, () => {
+                QRCode();
               })
-              resolve();
+
             }
           });
         }
+
         // resolve(()=>{
         // 下载icon
         wx.downloadFile({
@@ -146,20 +176,13 @@ Component({
             console.log(this.data.iconImg)
             this.setData({
               iconImg: res.tempFilePath
+            }, () => {
+              // 下载头像
+              downAvatar();
             })
-            // 下载头像
-            downAvatar();
+
           }
         });
-
-        // 生成二维码并下载
-        // httpRequestApi.createQRCode(this.data.QRData).success(res => {
-        //   console.log(data.path)
-        //   console.log(res)
-        // })
-
-        // })
-
       })
       return download;
     },

+ 41 - 32
pages/index/index.js

@@ -18,8 +18,9 @@ import {
   followInit
 } from '../../component/follow/follow';
 // import '../../utils/hls';
-// import httpRequestApi from '../../utils/APIRequest';
+import httpRequestApi from '../../utils/APIClient';
 import httputil from '../../utils/httpUtil';
+
 Page({
   data: {
     tab: [{
@@ -41,11 +42,12 @@ Page({
     ],
     winH: 568,
     myIndex: 1,
-    followData:[],
-    recommendPageNo:1,
-    recommendTotalNo:0,
-    followPageNo:1,
-    followPageTotalNo:0,
+    followData: [],
+    recommendPageNo: 1,
+    recommendTotalNo: 0,
+    followPageNo: 1,
+    followPageTotalNo: 0,
+    myData: {},
     templates: 'hot',
     title: 'index中的title',
     jurisdictionFlag: true,
@@ -95,34 +97,28 @@ Page({
       // });
     }
   },
-  aa: function(){
-    let a = new Promise((resolve, reject)=>{
+  aa: function () {
+    let a = new Promise((resolve, reject) => {
       resolve(console.log('aa'))
     });
     return a;
   },
-  bb: function(){
-    let b = new Promise((resolve, reject)=>{
+  bb: function () {
+    let b = new Promise((resolve, reject) => {
       resolve(console.log('bb'))
     });
     return b
   },
-  cc: function(){
-    let c = new Promise((resolve, reject)=>{
+  cc: function () {
+    let c = new Promise((resolve, reject) => {
       console.log('cc')
     });
     return c
   },
   onLoad: function (options) {
-    this.aa().then(()=>{
-      console.log(1)
-      return this.bb()
-    }).then(()=>{
-      console.log(2)
-      return this.cc()
-    })
-    
+    console.log(options)
     this.uid = wx.getStorageSync('uid');
+
     wx.getSystemInfo({
       success: (res) => {
         this.setData({
@@ -138,6 +134,7 @@ Page({
 
   },
   onShow: function () {
+
     // this.init();
     getOpenidSessionKey((res) => {}, (error) => {
       // console.log(error)
@@ -145,15 +142,15 @@ Page({
         hide: !this.data.hide
       })
     });
+    if (this.data.myIndex === 3) {
+      console.log('aaaaaaa')
+      this.getUserWorksInfo();
+    }
   },
   //初始化数据
   init: function () {
     httputil.getOpenidSessionKey((res) => {
-      console.log('微信的用户信息', res);
-      // this.setData({
-      //   jurisdictionFlag: true
-      // })
-      // lookInit(this);
+      console.log('微信的用户信息', res)
     }, (error) => {
       console.log(error);
       this.jurisdiction()
@@ -162,6 +159,18 @@ Page({
       // })
     });
   },
+  // 获取用户信息
+  getUserWorksInfo: function () {
+    httpRequestApi.getUserWorksInfo().success(res => {
+      console.log(res)
+      this.data.myData.user = res.data.data; //直接赋值 给 myData的user对象。
+      this.setData({
+        myData: this.data.myData,
+      });
+    }).fail(error => {
+      console.log(error)
+    })
+  },
   // 触底加载
   onReachBottom: function () {
     console.log(this.data.recommendPageNo)
@@ -169,23 +178,23 @@ Page({
     // 当前在推荐页面 加载推荐
     if (this.data.myIndex === 1) {
       this.setData({
-        recommendPageNo: this.data.recommendPageNo+1
+        recommendPageNo: this.data.recommendPageNo + 1
       })
-      if(this.data.recommendPageNo <= this.data.recommendTotalNo ){
+      if (this.data.recommendPageNo <= this.data.recommendTotalNo) {
         this.getHotRecommend(this.uid, this.data.recommendPageNo, 3);
-        
+
       } else {
         console.log('没有更多')
       }
     }
-    if(this.data.myIndex === 2){
+    if (this.data.myIndex === 2) {
       console.log(this.data.followPageTotalNo)
       this.setData({
-        followPageNo: this.data.followPageNo+1
+        followPageNo: this.data.followPageNo + 1
       })
-      if(this.data.followPageNo <= this.data.followPageTotalNo ){
+      if (this.data.followPageNo <= this.data.followPageTotalNo) {
         this.getWorks(this.uid, this.data.followPageNo, 5);
-        
+
       } else {
         console.log('没有更多')
       }

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

@@ -109,7 +109,8 @@ 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}`
+            path: `pages/social/works/works`,
+            scene: `QR${this.data.id}`
             // tip: this.data.tip,
         }
         this.shareDialog.share(data);

+ 88 - 45
pages/user/myEdit/myEdit.js

@@ -1,124 +1,167 @@
 import httpRequestApi from '../../../utils/APIClient';
+import {
+  formatDate
+} from '../../../utils/util';
 Page({
   /**
    * 页面的初始数据
    */
   data: {
-    sexs: [
-      { value: '女',checked: true },
-      { value: '男', checked: false }
-      ], 
-    occupations: [
-      { value: '家长', checked: false },
-      { value: '老师', checked: false },
-      { value: '学生', checked: true }
-    ],
-    date: '2001年12月12日',
+    user: {},
+    sexs: [],
+    occupations: [],
+    date: '',
     msg: '',
     nickname: ''
   },
-  saveNickName: function(e){
+  saveNickName: function (e) {
     let nickname = e.detail.value;
     this.setData({
       nicename: nickname
-    }, () => {
-      console.log(nickname);
     });
   },
-  saveAddress: function(e){
+  saveAddress: function (e) {
     let msg = e.detail.value;
     this.setData({
       msg: msg
-    },() => {
-      console.log(msg);
     });
   },
-  bindDateChange: function(e) {
+  bindDateChange: function (e) {
     console.log(e.detail.value)
     this.setData({
-        date: e.detail.value
+      date: e.detail.value
     });
   },
-  optionAction:function(e){
+  optionAction: function (e) {
     console.log(e.detail.value);
   },
   optionSetting: function (e) {
     console.log(e.detail.value);
   },
-  formSubmit: function(e){
-    let { nickname, picker, radioGroup1, radioGroup2, address } = e.detail.value;
-    let uid = 1, wechatName = nickname, mobile = '13994969642', gender = 3, schoolProvince = 11, schoolCity = '运城市', schoolName = '康杰中学', profession = radioGroup2, birthday = picker;
-    httpRequestApi.settingUserInfo(uid, wechatName, mobile, gender, schoolProvince, schoolCity, schoolName, profession, birthday).success(res => {
-      console.log(res.data.data.wechatName);//修改资料成功后 调用 getUserInfo
-        wx.redirectTo({
-            url: '/pages/index/index?index=3'
-        });
-      // wx.navigateBack({
-      //
-      //  });
+  formSubmit: function (e) {
+    console.log(e.detail.value)
+    // const uid = wx.getStorageSync('uid');
+    const data = {
+      wechatName: e.detail.value.nickname || '',
+      mobile: '',
+      gender: 1,
+      schoolProvince: '',
+      schoolCity: '',
+      schoolName: e.detail.value.address || '',
+      profession: e.detail.value.radioGroup2 || '',
+      birthday: e.detail.value.picker || ''
+    }
+    httpRequestApi.settingUserInfo(data).success(res => {
+      console.log(res.data.data); //修改资料成功后 调用 getUserInfo
+      // wx.redirectTo({
+      //   url: '/pages/index/index?index=3'
+      // });
+      wx.navigateBack({
+        delta: 1
+      })
     });
   },
   /**
    * 生命周期函数--监听页面加载
    */
+  getUserInfo: function () {
+
+  },
   onLoad: function (option) {
-    console.log(option.title);
-    if (option.title) {
-      wx.setNavigationBarTitle({
-        title: option.title//页面标题为路由参数
-      });
+
+    httpRequestApi.getUserInfo().success(res => {
+      const user = res.data.data
+      console.log(user)
+      const birthday = user.birthday ? formatDate(user.birthday, 2) : '2018-01-01';
+      console.log(birthday)
       this.setData({
-        title: option.title
-      });
-    }
+        user: user,
+        date: birthday,
+        sexs: [{
+            value: 2,
+            checked: user.gender === 2 ? true : false,
+            sex: '女'
+          },
+          {
+            value: 1,
+            checked: user.gender === 1 ? true : false,
+            sex: '男'
+          }
+        ],
+        occupations: [{
+            value: '家长',
+            checked: user.profession === '家长' ? true : false
+          },
+          {
+            value: '老师',
+            checked: user.profession === '老师' ? true : false
+          },
+          {
+            value: '学生',
+            checked: user.profession === '学生' ? true : false
+          }
+        ],
+
+      })
+      console.log(this.data.date)
+      if (option.title) {
+        wx.setNavigationBarTitle({
+          title: option.title //页面标题为路由参数
+        });
+        this.setData({
+          title: option.title
+        });
+      }
+    });
+
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady: function () {
-     
+
   },
 
   /**
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-    
+
   },
 
   /**
    * 生命周期函数--监听页面隐藏
    */
   onHide: function () {
-    
+
   },
 
   /**
    * 生命周期函数--监听页面卸载
    */
   onUnload: function () {
-    
+
   },
 
   /**
    * 页面相关事件处理函数--监听用户下拉动作
    */
   onPullDownRefresh: function () {
-    
+
   },
 
   /**
    * 页面上拉触底事件的处理函数
    */
   onReachBottom: function () {
-    
+
   },
 
   /**
    * 用户点击右上角分享
    */
   onShareAppMessage: function () {
-    
+
   }
 })

+ 4 - 4
pages/user/myEdit/myEdit.wxml

@@ -4,7 +4,7 @@
       <view class='nickname-box'>
         <text class='setting-title'>昵称</text>
         <view class='user-action'>
-          <input name='nickname' class='nickname' type='text' placeholder='喔喔' placeholder-class='placeholderStyle' focus='{{ true }}' value='{{ nickname }}' bindblur='saveNickName'>
+          <input name='nickname' class='nickname' type='text' placeholder='{{user.wechatName}}' placeholder-class='placeholderStyle' focus='{{ true }}' value='{{user.wechatName}}' bindblur='saveNickName'>
           </input>
         </view>
         <view class='edit-img'>
@@ -15,13 +15,13 @@
         <view class='setting-title'>性别</view>
         <radio-group name='radioGroup1' class="radio-group" bindchange="optionAction">
           <label class="radio" wx:for="{{ sexs }}" wx:key="{{ index }}">
-            <text class='sex-title'>{{ item.value }}</text>
+            <text class='sex-title'>{{ item.sex }}</text>
             <radio value="{{ item.value }}" checked="{{ item.checked }}" color='#fff' />
           </label>
         </radio-group>
       </view>
       <view class='birthday-box'>
-        <picker name='picker' mode="date" value="{{ date }}" start="1900-01-01" end="2018-09-01" bindchange="bindDateChange">
+        <picker name='picker' mode="date" value="{{ date }}" start="1900-01-01" end="2020-09-01" bindchange="bindDateChange">
             <view class="picker">
               <text class='setting-title'>生日</text>
               <text>{{ date }}</text>
@@ -39,7 +39,7 @@
       </view>
       <view class='school-box'>
         <text class='setting-title'>学校</text>
-        <input name='address' class='address' type='text' placeholder='北京市海淀区万泉胜景远小学' value='{{ msg }}' bindblur='saveAddress'></input>
+        <input name='address' class='address' type='text' placeholder='{{user.schoolName}}' value='{{ user.schoolName }}' bindblur='saveAddress'></input>
         <view class='edit-image'>
           <image src='../../../static/image/edit.png' class='icon'></image>
         </view>

+ 3 - 2
pages/user/myEdit/myEdit.wxss

@@ -26,7 +26,8 @@ page{
 }
 
 .user-action{
-  width: 100rpx;
+  min-width: 100rpx;
+  max-width: 400rpx;
 }
 
 .nickname{
@@ -45,7 +46,7 @@ page{
 
 .edit-img{
   position: absolute;
-  left: 220rpx;
+  right:130rpx;
   top: 24rpx;
   width: 22rpx;
   height: 32rpx;

+ 5 - 88
project.config.json

@@ -36,7 +36,7 @@
 			"list": []
 		},
 		"miniprogram": {
-			"current": 19,
+			"current": 5,
 			"list": [
 				{
 					"id": 0,
@@ -63,100 +63,17 @@
 					"query": ""
 				},
 				{
-					"id": -1,
-					"name": "团购",
-					"pathName": "pages/groupPage/collage-details/collage-details",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "aaa",
-					"pathName": "pages/groupPage/collage-details/collage-details",
-					"query": "productId=1"
-				},
-				{
-					"id": 5,
-					"name": "concern",
-					"pathName": "pages/user/myconcern/myconcern",
-					"query": ""
-				},
-				{
 					"id": 7,
 					"name": "作品页面",
 					"pathName": "pages/social/works/works",
 					"query": "id=1541489786444388&title=铺满色巴掌的水泥道"
 				},
 				{
-					"id": -1,
-					"name": "read",
-					"pathName": "pages/user/myread/myread",
-					"query": "productId=1"
-				},
-				{
-					"id": -1,
-					"name": "keep",
-					"pathName": "pages/user/mycollection/mycollection",
-					"query": "productId=1"
-				},
-				{
-					"id": -1,
-					"name": "course",
-					"pathName": "pages/user/mycourse/mycourse",
-					"query": "productId=1"
-				},
-				{
-					"id": -1,
-					"name": "course",
-					"pathName": "pages/user/mycourse/mycourse",
-					"query": "productId=1"
-				},
-				{
-					"id": -1,
-					"name": "course",
-					"pathName": "pages/index/index",
-					"query": "productId=1"
-				},
-				{
-					"id": -1,
-					"name": "course",
-					"pathName": "pages/user/mycourse/mycourse",
-					"query": "productId=1"
-				},
-				{
-					"id": 8,
-					"name": "测试的",
-					"pathName": "pages/social/works/works",
-					"query": "id=1541743536238348&title=【课文6】比尾巴",
+					"id": 5,
+					"name": "修改资料",
+					"pathName": "pages/user/myEdit/myEdit",
+					"query": "title=修改资料",
 					"scene": "1012"
-				},
-				{
-					"id": -1,
-					"name": "collage",
-					"pathName": "pages/user/mycollage/mycollage",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "collage",
-					"pathName": "pages/user/mycollage/mycollage",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "details",
-					"pathName": "pages/user/myWallet/myWallet",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "details",
-					"pathName": "pages/user/myWallet/myWallet",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "course",
-					"pathName": "pages/user/mycourse/mycourse"
 				}
 			]
 		}

+ 8 - 12
utils/APIClient.js

@@ -253,27 +253,23 @@ module.exports = {
         }).url(url).data(data).method('POST').send();
     },
     // 修改资料
-    settingUserInfo(wechatName, mobile, gender, schoolProvince, schoolCity, schoolName, profession, birthday) {
+    settingUserInfo(data) {
         let url = getBaseUrl(`wx/user`);
         return request.getInstance().header({
             uid:wx.getStorageSync('uid')
-        }).data({
-            wechatName: wechatName,
-            mobile: mobile,
-            gender: gender,
-            schoolProvince: schoolProvince,
-            schoolCity: schoolCity,
-            schoolName: schoolName,
-            profession: profession,
-            birthday: birthday
-        }).url(url).method('PUT').send();
+        }).data(data).url(url).method('PUT').send();
     },
     //获取个人信息
     getUserInfo() {
         let url = getBaseUrl(`wx/user`);
         return request.getInstance().header({
             uid: wx.getStorageSync('uid')
-        }).data({
+        }).url(url).send();
+    },
+    // 获取播放量等数据
+    getUserWorksInfo() {
+        let url = getBaseUrl(`wx/user/my`);
+        return request.getInstance().header({
             uid: wx.getStorageSync('uid')
         }).url(url).send();
     },

+ 1 - 0
utils/httpUtil.js

@@ -54,6 +54,7 @@ function getLoginSchedule(sessionKey, openId, successcallback, failcallback) {
                       })
                       wx.setStorageSync('uid', res.data.data.data.uid)
                       wx.setStorageSync('user', res)
+                      console.log(res)
                       successcallback(res)
                   });
                 },

+ 2 - 0
utils/util.js

@@ -14,6 +14,7 @@ const formatNumber = n => {
 }
 //时间戳转时间
 function formatDate(time, flag) {
+	console.log(time)
 	const t = new Date(time); 
 	const tf = function(i){return (i < 10 ? '0' : '') + i};
 	const year = t.getFullYear();
@@ -25,6 +26,7 @@ function formatDate(time, flag) {
 	if(flag == 1) {
 		return  month + '月' + day + '日' + ' ' + hour + ':' + minute;
 	}else if(flag == 2) {
+		console.log(year,month,day)
 		return year + '-' + month + '-' + day
 	}else if(flag == 3){
 		return month + '-' + day + ' ' + hour + ':' + minute;