Browse Source

解决冲突

Limengbo 5 years atrás
parent
commit
9c28b1e3a5

+ 2 - 1
app.json

@@ -20,7 +20,8 @@
     "pages/user/mycourse/mycourse",
     "pages/user/myread/myread",
     "pages/user/mycollection/mycollection",
-    "pages/user/walletDetails/walletDetails"
+    "pages/user/walletDetails/walletDetails",
+    "pages/user/myworks/myworks"
   ],
   "window": {
     "backgroundTextStyle": "light",

+ 76 - 64
component/share/share.js

@@ -26,9 +26,9 @@ Component({
     iconImg: '',
     title: '',
     path: '',
-    QRCodeImagePath:'',
-    QRCodeImageLocalPath:'',
-    groupPurchaseInfo:{}
+    QRCodeImagePath: '',
+    QRCodeImageLocalPath: '',
+    groupPurchaseInfo: {}
   },
 
   /**
@@ -62,13 +62,13 @@ Component({
         })
         .then(() => {
           wx.getImageInfo({
-            src: this.data.QRCodeImagePath,//服务器返回的图片地址
+            src: this.data.QRCodeImagePath, //服务器返回的图片地址
             success: function (res) {
               console.log('下载content成功1')
               console.log(res.path)
               //res.path是网络图片的本地地址
-              ctx.drawImage(res.path, 227, 364, 135, 135);
-
+              ctx.drawImage(res.path, 213, 445, 126, 126);
+              // ctx.drawImage('../../../static/image/works_poster.png', 0, 0, 375, 667); //插入图片  
 
 
 
@@ -77,12 +77,12 @@ Component({
                 wx.canvasToTempFilePath({
                   x: 0,
                   y: 0,
-                  width: 370,
-                  height: 507,
+                  width: 750,
+                  height: 1334,
                   // destWidth: 370,
-                  destWidth: 1110,
+                  destWidth: 1500,
                   // destHeight: 507,
-                  destHeight: 1521,
+                  destHeight: 2668,
                   canvasId: 'myCanvas',
                   success: (res) => {
                     console.log(res.tempFilePath)
@@ -128,7 +128,7 @@ Component({
           iconImg: data.iconImg,
           title: data.title,
           // path: data.path,
-          QRData:{
+          QRData: {
             page: data.path,
             scene: data.scene,
             qrCodeId: this.data.shareId
@@ -145,7 +145,7 @@ Component({
           iconImg: data.iconImg,
           title: data.title,
           // path: data.path,
-          QRData:{
+          QRData: {
             page: data.path,
             scene: data.scene,
             qrCodeId: this.data.shareId
@@ -161,14 +161,14 @@ Component({
       }
     },
     //关闭弹框
-    close: function(e){
+    close: function (e) {
       console.log(e)
       this.setData({
         shareFlag: !this.data.shareFlag,
         imgUrls: ''
       })
     },
-    nothing: function(e){
+    nothing: function (e) {
       return
     },
     // 保存图片到本地
@@ -193,7 +193,7 @@ Component({
             //     // }, () => {
 
             //     // })
-  
+
             //   }
             // });
             console.log(this.data.QRCodeImagePath)
@@ -244,15 +244,17 @@ Component({
           mask: true
         })
         console.log('开始画背景')
-        ctx.rect(0, 0, 370, 507)
-        ctx.setFillStyle('#fff')
-        ctx.fill()
+        // ctx.rect(0, 0, 375, 667)
+        // ctx.setFillStyle('#fff')
+       
+        ctx.drawImage('../../../static/image/works_poster.png', 0, 0, 1500, 2668,0,0,750,1334); //插入图片  
+
+        // ctx.fill()
         ctx.save()
         ctx.beginPath()
-        ctx.setFillStyle('#fff')
+        // ctx.setFillStyle('#fff')
         ctx.fill()
-        ctx.arc(185, 48, 37, 0, 2 * Math.PI, false)
-        ctx.clip(); //画
+      
         resolve();
       });
       return background;
@@ -263,12 +265,17 @@ Component({
       let author = new Promise((resolve, reject) => {
         // resolve(() => {
         console.log('开始画头像')
-        ctx.drawImage(this.data.avatar, 148, 8, 100, 100); //插入图片  
+        console.log(this.data.avatar)
+        ctx.arc(51.5, 200.5, 35.5, 0, 2 * Math.PI, false) 
+        ctx.clip(); //剪切头像区域
+        ctx.drawImage(this.data.avatar, 16, 150, 87, 87); //插入图片  
+        // ctx.fill()
         ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
-        ctx.setFontSize(20)
+        ctx.setFontSize(18)
+        // ctx.setFillStyle('#535353')
         ctx.setFillStyle('#535353')
-        ctx.fillText(this.data.author, (370 - ctx.measureText(this.data.author).width) / 2, 115)
-        ctx.setFillStyle('#FF4400')
+        ctx.fillText(this.data.author, 98, 180)
+        
         // })
         resolve();
       })
@@ -279,19 +286,24 @@ Component({
       let works = new Promise((resolve, reject) => {
         // resolve(() => {
         console.log('开始画内容')
-        ctx.fillText('已使出洪荒之力,声情并茂的为', (370 - ctx.measureText('已使出洪荒之力,声情并茂的为').width) / 2, 138)
-        ctx.fillText(`《${this.data.title}》`, (370 - ctx.measureText(`《${this.data.title}》`).width) / 2, 160)
-        ctx.fillText(`配了一段惊世之作`, (370 - ctx.measureText(`配了一段惊世之作`).width) / 2, 182)
-        ctx.drawImage(this.data.iconImg, 9, 205, 704, 145);
-        ctx.setFontSize(18)
+        ctx.setFontSize(16)
         ctx.setFillStyle('#000')
-        ctx.drawImage('../../../static/groupImg/share_bottom.png', 3, 419, 370, 192);
-        ctx.setFontSize(20)
-        ctx.setFillStyle('red')
-        ctx.fillText('为TA疯狂打CALL', 9, 467)
-        ctx.setFontSize(18)
+        ctx.fillText('已使出洪荒之力,声情并茂的为课文', 90 ,198)
+        ctx.fillText(`配了一段惊世之作`,  90, 240)
+        // ctx.setFontSize(16)
+        // ctx.setFillStyle('red')
+        ctx.fillText(`《${this.data.title}》`, 90, 220)
+        
+        ctx.drawImage('../../../static/image/reading_poster.jpg', 11, 276, 351, 145);
+        ctx.setFontSize(16)
         ctx.setFillStyle('#000')
-        ctx.fillText('长按识别二维码,快去听听', 9, 493)
+        // ctx.setFillStyle('#000')
+        ctx.setFontSize(16)
+        ctx.setFillStyle('#c90000')
+        ctx.fillText('为TA疯狂打CALL', 12, 495)
+        ctx.setFontSize(14)
+        ctx.setFillStyle('#666666')
+        ctx.fillText('长按识别二维码,快去听听', 12, 530)
         // })
         resolve();
       })
@@ -302,33 +314,33 @@ Component({
     drawGroupGut: function (ctx) {
       let group = new Promise((resolve, reject) => {
         //resolve(() => {
-          ctx.fillText('郎朗读书声是世上最美的声音', 50, 138)
-          ctx.drawImage(this.data.iconImg, 9, 205, 352, 145);
-          ctx.drawImage('../../../static/groupImg/Rectangle 41.png', 134, 358, 59, 20);
-          ctx.setFontSize(14)
-          ctx.setFillStyle('#fff')
-          ctx.fillText(`${this.data.groupPurchaseInfo.headcount}人团`, 149, 373)
-          ctx.setFontSize(16)
-          ctx.setFillStyle('#A95A00')
-          ctx.fillText('原价', 20, 373)
-          ctx.setStrokeStyle('red')
-          ctx.moveTo(64, 368)
-          ctx.lineTo(114, 368)
-          ctx.stroke()
-          ctx.fillText(`¥${parseFloat(this.data.groupPurchaseInfo.originPrice / 100).toFixed(2)}元`, 54, 373)
-          ctx.setFontSize(18)
-          ctx.fillText('团购价仅需', 20, 403)
-          ctx.fillText('元', 185, 403)
-          ctx.setFontSize(20)
-          ctx.setFillStyle('red')
-          ctx.fillText(`¥${parseFloat(this.data.groupPurchaseInfo.price / 100).toFixed(2)}`, 115, 403)
-          ctx.drawImage('../../../static/groupImg/share_bottom.png', 3, 419, 370, 192);
-          ctx.setFontSize(20)
-          ctx.setFillStyle('red')
-          ctx.fillText('名额有限,售完截止', 9, 467)
-          ctx.setFontSize(18)
-          ctx.setFillStyle('#000')
-          ctx.fillText('长按识别二维码参加团购', 9, 493)
+        ctx.fillText('郎朗读书声是世上最美的声音', 50, 138)
+        ctx.drawImage(this.data.iconImg, 9, 205, 352, 145);
+        ctx.drawImage('../../../static/groupImg/Rectangle 41.png', 134, 358, 59, 20);
+        ctx.setFontSize(14)
+        // ctx.setFillStyle('#fff')
+        ctx.fillText(`${this.data.groupPurchaseInfo.headcount}人团`, 149, 373)
+        ctx.setFontSize(16)
+        ctx.setFillStyle('#A95A00')
+        ctx.fillText('原价', 20, 373)
+        ctx.setStrokeStyle('red')
+        ctx.moveTo(64, 368)
+        ctx.lineTo(114, 368)
+        ctx.stroke()
+        ctx.fillText(`¥${parseFloat(this.data.groupPurchaseInfo.originPrice / 100).toFixed(2)}元`, 54, 373)
+        ctx.setFontSize(18)
+        ctx.fillText('团购价仅需', 20, 403)
+        ctx.fillText('元', 185, 403)
+        ctx.setFontSize(20)
+        ctx.setFillStyle('red')
+        ctx.fillText(`¥${parseFloat(this.data.groupPurchaseInfo.price / 100).toFixed(2)}`, 115, 403)
+        ctx.drawImage('../../../static/groupImg/share_bottom.png', 3, 419, 370, 192);
+        ctx.setFontSize(20)
+        ctx.setFillStyle('red')
+        ctx.fillText('名额有限,售完截止', 9, 467)
+        ctx.setFontSize(18)
+        ctx.setFillStyle('#000')
+        ctx.fillText('长按识别二维码参加团购', 9, 493)
         //})
         resolve();
       })
@@ -340,7 +352,7 @@ Component({
     PreservationImg: function () {
       wx.saveImageToPhotosAlbum({
         filePath: this.data.imgUrls,
-        success: (res)=> {
+        success: (res) => {
           console.log(res)
           this.setData({
             imgUrls: false

+ 1 - 1
component/share/share.wxml

@@ -16,7 +16,7 @@
        <cover-image class="img" src="{{imgUrls}}"></cover-image>
        <view class="Preservation">
            <image class="PreservationBg" src="../../static/groupImg/Preservation.png"></image>
-           <text bindtap="PreservationImg">点我保存,并分享至朋友圈</text>
+           <text bindtap="PreservationImg">保存到相册中,快去分享吧</text>
        </view>
    </view>
 </view>

+ 11 - 7
component/share/share.wxss

@@ -47,17 +47,21 @@
 }
 
 .img {
-    position: absolute;
-    left: 5rpx;
-    top: 30rpx;
-    width: 740rpx;
-    height: 1014rpx;
+    display: block;
+    /* position: absolute; */
+    /* left: 5rpx; */
+    /* top: 30rpx; */
+    width: 80%;
+    height: 80%;
+    margin: 50rpx auto;
+    /* width: 375rpx; */
+    /* height: 667rpx; */
 }
 
 .Preservation {
     position: absolute;
     left: 15%;
-    bottom: 5%;
+    bottom: 50rpx;
     width: 70%;
     height: 88rpx;
 
@@ -75,7 +79,7 @@
     color: #fff;
     font-size: 36rpx;
     position: absolute;
-    left: 30rpx;
+    left: 43rpx;
     top: 20rpx;
     z-index: 9;
 }

+ 18 - 14
pages/social/replyDetail/replyDetail.js

@@ -8,12 +8,16 @@ Page({
         classNormal: 'commentItem',
         postId: '',
         comment: [],
-        replyInfo: ''
+        replyInfo: '',
+        count: ''
     },
     onLoad: function (option) {
-        console.log(option)
+        // console.log(option)
         this.setData({
-            postId: option.id
+            postId: option.id,
+            count: option.count
+        },() => {
+          console.log(this.data.count);
         })
         wx.setNavigationBarTitle({
             // title: option.count + '条回复' //页面标题为路由参数
@@ -24,24 +28,24 @@ Page({
     },
     // 保存 回复的内容
     saveValue: function(e){
-     this.setData({
-       replyInfo: e.detail.value
-     },() => {
-       console.log(this.data.replyInfo);
-     });
+      this.setData({
+        replyInfo: e.detail.value
+      });
     },
     replyDone:function(){
       const data = {
         postsId: this.data.postId,
         content: this.data.replyInfo
       }
-      
-      httpRequestApi.postReplyComment(this.uid, data).success(res => {
-        this.setData({
-          replyModal: false
+      if(this.data.replyInfo){
+        httpRequestApi.postReplyComment(this.uid, data).success(res => {
+          this.setData({
+            replyModal: false,
+            replyInfo: ''
+          });
+          this.getReplyDetail();//更新 变化后的 replyTemp。
         });
-        this.getReplyDetail();//更新 变化后的 replyTemp。
-      });
+      }
     },
     // 查询回复详情
     getReplyDetail: function () {

+ 16 - 23
pages/social/replyDetail/replyDetail.wxml

@@ -1,27 +1,20 @@
 <view class="commentArea">
+  <view class='padding-bottom'>
     <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}}" 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 class='reply-msg'>
-      <!-- <input name='reply' class='reply-input' placeholder='回复@{{ comment[0].name }}' confirm-type="send" bindinput='saveValue' auto-focus auto-height></input> -->
-
-      <input name='reply' class='reply-input' placeholder='回复@{{ comment[0].name }}' bindinput='saveValue'>
-      </input>
-      <text class='reply-btn' bindtap='replyDone'>回复</text>
+      <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>
+  <view class='reply-all'>
+    全部回复({{ count }})
+  </view>
+  <view class='reply-msg'>
+    <input name='reply' class='reply-input' placeholder='回复@{{ comment[0].name }}' value='{{ replyInfo }}' bindinput='saveValue' confirm-type ="send">
+    </input>
+    <text class='reply-btn' bindtap='replyDone'>回复</text>
+  </view>
 </view>

+ 54 - 79
pages/social/replyDetail/replyDetail.wxss

@@ -1,105 +1,80 @@
 .commentArea {
   width: 100%;
-  margin-bottom: 92rpx;
+}
+
+.padding-bottom{
+  padding-bottom: 92rpx;
+  width: 100%;
 }
 
 .commentArea .commentItem {
-    width: 100%;
-    padding: 0 0 0 23rpx;
-    height: 100%;
-    border-bottom: solid 2rpx #979797;
-    /* margin: 0 auto 10; */
-    display: flex;
-    position: relative;
-    background: #f0f1f5;
+  width: 100%;
+  padding: 0 0 0 23rpx;
+  height: 100%;
+  border-bottom: solid 2rpx #979797;
+  display: flex;
+  position: relative;
+  background: #F0F1F5;
 }
+
 .commentArea  .commentItemFirst{
-    background: #fff;
-    border-bottom: none;
-    min-height: 200rpx;
+  background: #fff;
+  border-bottom: none;
+  height: 280rpx;
 }
+
 .commentItem .commentCore {
-    margin-left: 14rpx;
-    width: 600rpx;
-    height: 100%;
-    display: flex;
-    flex-direction: column;
+  margin-left: 14rpx;
+  width: 600rpx;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
 }
 
 .commentItem .avatar {
-    border-radius: 50%;
-    width: 96rpx;
-    height: 96rpx;
-    margin-top: 18rpx;
+  border-radius: 50%;
+  width: 96rpx;
+  height: 96rpx;
+  margin-top: 18rpx;
 }
 
 .commentItem .nickName {
-    margin-top: 18rpx;
-    height: 44rpx;
-    font-size: 32rpx;
-    color: #000;
-    font-family: PingFangSC-Regular;
+  margin-top: 18rpx;
+  height: 44rpx;
+  font-size: 32rpx;
+  color: #000;
+  font-family: PingFangSC-Regular;
 }
 
 .commentItem .time {
-    width: 200rpx;
-    height: 44rpx;
-    font-size: 32rpx;
-    color: #686868;
+  width: 200rpx;
+  height: 44rpx;
+  font-size: 32rpx;
+  color: #686868;
 }
 
 .commentItem .gut {
-    margin-top: 12rpx;
-    width: 420rpx;
-    /* height: 44rpx; */
-    line-height: 60rpx;
-    font-size: 32rpx;
-    color: #000;
-    /* overflow: hidden;
-    text-overflow: ellipsis;
-    white-space: nowrap; */
-}
-
-.commentItem .btnWrapper {
-    position: absolute;
-    top: 10rpx;
-    right: 30rpx;
-    display: flex;
-    align-items: center;
-}
-
-.btnWrapper .commentBtn {
-    width: 32rpx;
-    height: 30rpx;
-    margin-left: 8rpx;
-}
-
-.btnWrapper .commentText,
-.likeText {
-    width: 58rpx;
-    height: 40rpx;
-    color: #545454;
-    font-size: 28rpx;
-    line-height: 40rpx;
-    margin-left: 8rpx;
+  margin-top: 12rpx;
+  width: 420rpx;
+  /* height: 44rpx; */
+  line-height: 60rpx;
+  font-size: 32rpx;
+  color: #000;
+  /* overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap; */
 }
 
-.btnWrapper .likeBtn {
-    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;
+.reply-all{
+  position: absolute;
+  box-sizing: border-box;
+  padding: 16rpx 23rpx;
+  width: 674rpx;
+  border-top: 2rpx solid #F0F1F5;
+  left: 40rpx;
+  top: 200rpx;
+  font-size: 28rpx;
+  color: #000000;
 }
 
 .reply-msg{

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

@@ -68,7 +68,8 @@
         </view>
     </view>
     <!-- 分享框 -->
-    <canvas canvas-id="myCanvas" style="width:370px;z-index=99999; height: 507px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
+    <!-- <canvas canvas-id="myCanvas" style="width:750rpx;z-index=99999; height: 1334rpx;"></canvas> -->
+    <canvas canvas-id="myCanvas" style="width:375px;z-index=99999; height: 668px; position: absolute; left: -999rpx; top: -9999rpx;"></canvas>
     <shareDialog id="share-dialog" shareType='works' shareId="{{id}}" />
     <!-- 评论框 -->
     <view class="replySection" wx:if="{{replyModal}}">

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

@@ -10,9 +10,10 @@ Page({
       fanList:[]
   },
   toUserDetails: function(e){
-    let fanId = e.currentTarget.dataset.fanId;
+    let uid = e.currentTarget.dataset.uid;
+    console.log(uid);
     wx.navigateTo({
-      url: `../../social/works/works?fanId=${fanId}`
+      url: `../myworks/myworks?uid=${uid}`
     });
   },
   /**

+ 10 - 4
pages/user/myconcern/myconcern.wxml

@@ -1,14 +1,20 @@
 <wxs module="wxs">
   function formatDate(time) {
-    var timeTemp = getDate(time);
-    var timeString = timeTemp.toLocaleDateString() + timeTemp.toLocaleTimeString();
-    return timeString.replace('/','-').replace('/','-').replace('上午',' ').replace('下午',' ');
+    console.log(time);
+    var t = getDate(time); 
+    var tf = function(i){return (i < 10 ? '0' : '') + i};
+    var year = t.getFullYear();
+    var month = tf(t.getMonth() + 1);
+    var day = tf(t.getDate());
+    var hour = tf(t.getHours());
+    var minute = tf(t.getMinutes());
+    return month + '-' + day + ' ' + hour + ':' + minute;
   }
   module.exports.formatDate = formatDate;
 </wxs>
 <view class='my-concern'>
   <view class="concern-center">
-    <view class='concern-info' wx:for="{{ fanList }}" wx:key="{{ index }}" bindtap='toUserDetails' data-fanId='{{ item.fans.fanId }}'>
+    <view class='concern-info' wx:for="{{ fanList }}" wx:key="{{ index }}" bindtap='toUserDetails' data-uid='{{ item.user.uid }}' data-fanId='{{ item.fans.fanId }}'>
       <view class='avatar-box'>
         <image class='avatar-image' src="{{ item.user.avatar }}" />
       </view>

+ 174 - 0
pages/user/myworks/myworks.js

@@ -0,0 +1,174 @@
+// pages/user/myworks/myworks.js
+import APIClient from '../../../utils/APIClient.js'
+import { formatDate } from '../../../utils/util.js'
+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: "2",
+        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: "3",
+        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: "4",
+        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: "5",
+        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: "6",
+        avatar: '../../static/image/timg.jpg',
+        nickName: '喔喔',
+        time: '10-18 09:56'
+      }
+    ],
+    pageNo: 1,
+    totalNo: 0,
+    uid: ''
+  },
+  toMyWorks: function(e){
+    let id = e.currentTarget.dataset.id;
+    let title = e.currentTarget.dataset.title;
+    wx.navigateTo({
+      url: `../../social/works/works?id=${id}&title=${title}`
+    });
+  },
+  getResults(){
+    let pageNo = this.data.pageNo;
+    let pageSize = 3;
+    let uid = this.data.uid;
+    console.log('用户身份',uid);
+    APIClient.userWorks(uid, pageNo, pageSize).success(res => {
+      // debugger;
+      this.setData({
+        wareCards: res.data.data.list
+      });
+    }).fail(err => {
+      console.log(err);
+    });
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.setData({
+      uid: options.uid
+    },() => {
+      console.log(options.uid);
+    });
+    this.getResults();
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+    this.setData({
+      pageNo: this.data.pageNo + 1
+    })
+    if (this.data.pageNo <= this.data.totalNo) {
+      this.getResults();
+    }
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

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

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

+ 51 - 0
pages/user/myworks/myworks.wxml

@@ -0,0 +1,51 @@
+<!--pages/user/myworks/myworks.wxml-->
+<wxs module="wxs">
+  function formatDate(time) {
+    console.log(time);
+    var t = getDate(time); 
+    var tf = function(i){return (i < 10 ? '0' : '') + i};
+    var year = t.getFullYear();
+    var month = tf(t.getMonth() + 1);
+    var day = tf(t.getDate());
+    var hour = tf(t.getHours());
+    var minute = tf(t.getMinutes());
+    return month + '-' + day + ' ' + hour + ':' + minute;
+  }
+  module.exports.formatDate = formatDate;
+</wxs>
+<view class='user-works'>
+  <view class='works-article' wx:for="{{ wareCards }}" wx:key="{{ index }}">
+    <view class='user-info'>
+      <view class='avatar-img'>
+        <image src='{{ item.user.avatar }}'></image>
+      </view>
+      <view>
+        <view class='user-name'>{{ item.user.wechatName }}</view>
+        <view class='user-time'>{{ wxs.formatDate(item.userRead.gmtCreated) }}</view>
+      </view>
+    </view>
+    <view class='video-preview' bindtap='toMyWorks' data-id='{{ item.userRead.id }}' data-title='{{ item.userRead.title }}'>
+      <image src='{{ item.userRead.iconImg }}'></image>
+    </view>
+    <view class='content-title'>
+      {{ item.userRead.title }}
+    </view>
+    <view class='content-detail'>
+      <view class='left'>{{ item.userRead.summary }}</view>
+      <view class='right'>
+        <view class='right-detail'>
+          <view class='play-img'>
+            <image src='../../../static/image/hotPlays.png'></image>
+          </view>
+          <text>{{ item.userRead.playAmount }}</text>
+        </view>
+        <view class='right-detail'>
+          <view class='point-img'>
+            <image src='../../../static/image/like.png'></image>
+          </view>
+          <text>{{ item.userRead.likeAmount }}</text>
+        </view>
+      </view>
+    </view>
+  </view>
+</view>

+ 108 - 0
pages/user/myworks/myworks.wxss

@@ -0,0 +1,108 @@
+/* pages/user/myworks/myworks.wxss */
+.user-works{
+  width: 750rpx;
+  background: #F0F1F5;
+}
+
+.works-article{
+  margin-top: 4rpx;
+  box-sizing: border-box;
+  width: 100%;
+  padding: 0 23rpx;
+  background: #FFFFFF;
+}
+
+.user-info{
+  width: 100%;
+  height: 120rpx;
+  font-size:32rpx;
+  display: flex;
+  align-items: center;
+}
+
+.avatar-img{
+  margin-right: 14rpx;
+  width: 96rpx;
+  height: 96rpx;
+  border-radius: 50%;
+}
+
+.avatar-img>image{
+  width: 100%;
+  height: 100%;
+  border-radius: 50%;
+}
+
+.user-name{
+  color: #000000;
+  font-weight: 500;
+}
+
+.user-time{
+  color: #686868;
+  font-weight: lighter;
+}
+
+.video-preview{
+  margin-top: 10rpx;
+  width: 100%;
+  height: 290rpx;
+  border-radius: 20rpx;
+}
+
+.video-preview>image{
+  width: 100%;
+  height: 100%;
+  border-radius: 20rpx;
+}
+
+.content-title{
+  margin-top: 10rpx;
+  width: 100%;
+  height: 40rpx;
+  font-size: 32rpx;
+  font-weight: 500;
+  color: #414141;
+}
+
+.content-detail{
+  margin-top: 30rpx;
+  width: 100%;
+  height: 50rpx;
+  display: flex;
+  justify-content: space-between;
+  font-size: 24rpx;
+}
+
+.left{
+  width: 200rpx;
+}
+
+.right{
+  width: 150rpx;
+  height: 100%;
+  display: flex;
+  justify-content: space-between;
+}
+
+.right image{
+  width: 100%;
+  height: 100%;
+}
+
+.play-img{
+  width: 20rpx;
+  height: 20rpx;
+}
+
+.point-img{
+  width: 26rpx;
+  height: 24rpx;
+}
+
+.right-detail{
+  width: 50rpx;
+  display: flex;
+  justify-content: space-between;
+  align-items: flex-start;
+}

+ 0 - 18
project.config.json

@@ -86,24 +86,6 @@
 					"name": "replydetails",
 					"pathName": "pages/social/replyDetail/replyDetail",
 					"query": ""
-				},
-				{
-					"id": 8,
-					"name": "faqiren",
-					"pathName": "pages/groupPage/make-money/make-money",
-					"query": "id=1542264513955412"
-				},
-				{
-					"id": -1,
-					"name": "团购",
-					"pathName": "pages/groupPage/grade-details/grade-details",
-					"query": "id=1542264513955412"
-				},
-				{
-					"id": -1,
-					"name": "参团",
-					"pathName": "pages/groupPage/collage-details/collage-details",
-					"query": ""
 				}
 			]
 		}

BIN
static/image/group_poster.png


BIN
static/image/reading_poster.jpg


BIN
static/image/timg.jpg


BIN
static/image/works_poster.png


+ 12 - 1
utils/APIClient.js

@@ -344,5 +344,16 @@ module.exports = {
     return request.getInstance().header({
       uid: wx.getStorageSync('uid')
     }).url(url).send();
-  }
+  },
+  // 获取 用户朗读的作品
+  userWorks(followUid, pageNo, pageSize){
+    let url = getBaseUrl('wx/userRead');
+    return request.getInstance().header({
+      uid: wx.getStorageSync('uid')
+    }).data({
+      uid: followUid,
+      pageNo: pageNo,
+      pageSize: pageSize
+    }).url(url).send();
+  },
 }