dongyuan0658 пре 6 година
родитељ
комит
0406e685be

+ 6 - 1
component/my/my.wxss

@@ -1,7 +1,8 @@
 .mine-container{
   width: 750rpx;
-  background: #F0F1F5;
+  height: 1136rpx;
   position: relative;
+  background: #F0F1F5;
   display: flex;
   flex-direction: column;
   align-items: center;
@@ -9,6 +10,10 @@
   box-sizing: border-box;
 }
 
+page{
+  background: #F0F1F5;
+}
+
 .follow-details{
   width: 750rpx;
   box-sizing: border-box;

+ 14 - 1
pages/user/mycollection/mycollection.js

@@ -5,7 +5,8 @@ Page({
    * 页面的初始数据
    */
   data: {
-    collection_data: []
+    collection_data: [],
+    user: {}
   },
 
   toClass: function(e) {
@@ -31,8 +32,20 @@ Page({
     }
 
     httpRequestApi.myFavorites().success(res => {
+      httpRequestApi.getUserWorksInfo().success(res => {
+        let user = res.data.data;
+        this.setData({
+          user: user,
+        }, () => {
+          console.log(this.data.user);
+        });
+      }).fail(error => {
+        console.log(error);
+      });
       this.setData({
         collection_data: res.data.data.list
+      },() => {
+        console.log(this.data.collection_data);
       });
     });
   },

+ 25 - 1
pages/user/mycollection/mycollection.wxml

@@ -1,5 +1,15 @@
+<wxs src="../../commonWxs/format.wxs" module="format" />
 <view class='my-collection'>
   <view class='collection-article' wx:for="{{ collection_data }}" wx:key="{{ index }}" bindtap='toClass' data-targetCode="{{item.targetCode}}" data-title='{{ item.title }}'>
+    <view class='user-info'>
+      <view class='avatar-box'>
+        <image class='avatar-image' src="{{ user.user.avatar }}" />
+      </view>
+      <view class="avatar-name">
+        <view>{{ user.user.wechatName }}</view>
+        <view>{{ format.formatDate(item.gmtCreated) }}</view>
+      </view>
+    </view>
     <view class='video-preview'>
       <image src='{{ item.iconImg }}'></image>
     </view>
@@ -8,6 +18,20 @@
     </view>
     <view class='content-detail'>
       <view class='left'>{{ item.summary }}</view>
-    </view>
+      <view class='right'>
+        <view class='right-detail'>
+          <view class='play-img'>
+            <image src='../../../static/image/hotPlays.png'></image>
+          </view>
+          <view class='count-add'>{{ item.playAmount || 0 }}</view>
+        </view>
+        <view class='right-details'>
+          <view class='point-img'>
+            <image src='../../../static/image/like.png'></image>
+          </view>
+          <view class='count-add'>{{ item.likeAmount || 0 }}</view>
+        </view>
+      </view>
+    </view> 
   </view>
 </view>

+ 73 - 16
pages/user/mycollection/mycollection.wxss

@@ -3,6 +3,56 @@
   background: #F0F1F5;
 }
 
+.user-info{
+  width: 100%;
+  height: 132rpx;
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+}
+
+.avatar-image{
+  width: 100%;
+  height: 100%;
+  border-radius: 50%;
+}
+
+.avatar-box{
+  width: 96rpx;
+  height: 96rpx;
+  border-radius: 50%;
+}
+
+.avatar-name{
+  width: 420rpx;
+  height: 80rpx;
+  font-size: 32rpx;
+  color: #444444;
+  margin-left: 14rpx;
+  margin-bottom: 16rpx;
+}
+
+.avatar-follow{
+  margin-left:30rpx;
+  display:flex;
+  flex-direction:column;
+  align-items:center;
+  width:100rpx;
+
+}
+
+.avatar-img{
+  width: 46rpx;
+  height: 40rpx;
+}
+
+.avatar-images{
+  width: 100%;
+  height: 100%;
+}
+
+
+
 .collection-article{
   margin-bottom: 4rpx;
   box-sizing: border-box;
@@ -39,7 +89,7 @@
 
 .collection-info>.title{
   color: #000000;
-  font-weight: 600;
+  font-weight: 500;
 }
 
 .collection-info>.date{
@@ -48,7 +98,7 @@
 }
 
 .video-preview{
-  margin-top: 10rpx;
+  /* margin-top: 10rpx; */
   width: 100%;
   height: 290rpx;
   border-radius: 20rpx;
@@ -60,15 +110,6 @@
   border-radius: 20rpx;
 }
 
-.content-title{
-  margin-top: 10rpx;
-  width: 100%;
-  height: 55rpx;
-  font-size: 32rpx;
-  font-weight: 600;
-  color: #414141;
-}
-
 .content-detail{
   width: 100%;
   height: 60rpx;
@@ -83,7 +124,6 @@
 }
 
 .right{
-  width: 220rpx;
   height: 100%;
   display: flex;
   justify-content: space-between;
@@ -97,7 +137,7 @@
 
 .play-img{
   width: 20rpx;
-  height: 20rpx;
+  height: 22rpx;
 }
 
 .point-img{
@@ -105,9 +145,26 @@
   height: 24rpx;
 }
 
-.right-detail{
-  width: 100rpx;
+.count-add{
+  width: 36rpx;
+  text-align: center;
+}
+
+.right-detail,.right-details{
   display: flex;
-  justify-content: space-between;
+  justify-content: flex-end;
   align-items: flex-start;
+}
+
+.right-details{
+  margin-left: 20rpx;
+}
+
+.content-title{
+  margin-top: 10rpx;
+  width: 100%;
+  height: 55rpx;
+  font-size: 32rpx;
+  font-weight: 500;
+  color: #414141;
 }

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

@@ -40,7 +40,7 @@ Page({
           console.log(this.data.user);
         });
       }).fail(error => {
-        console.log(error)
+        console.log(error);
       });
       this.setData({
         wareCards: res.data.data.list

+ 20 - 22
pages/user/myread/myread.wxml

@@ -10,30 +10,28 @@
         <view>{{ format.formatDate(item.gmtCreated) }}</view>
       </view>
     </view>
-    <view>
-      <view class='video-preview'>
-        <image src='{{ item.iconImg }}'></image>
-      </view>
-      <view class='content-title'>
-        {{ item.title }}
-      </view>
-      <view class='content-detail'>
-        <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>
-            <view class='count-add'>{{ item.playAmount }}</view>
+    <view class='video-preview'>
+      <image src='{{ item.iconImg }}'></image>
+    </view>
+    <view class='content-title'>
+      {{ item.title }}
+    </view>
+    <view class='content-detail'>
+      <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>
-          <view class='right-details'>
-            <view class='point-img'>
-              <image src='../../../static/image/like.png'></image>
-            </view>
-            <view class='count-add'>{{ item.likeAmount }}</view>
+          <view class='count-add'>{{ item.playAmount || 0 }}</view>
+        </view>
+        <view class='right-details'>
+          <view class='point-img'>
+            <image src='../../../static/image/like.png'></image>
           </view>
+          <view class='count-add'>{{ item.likeAmount || 0 }}</view>
         </view>
-      </view> 
-    </view>
+      </view>
+    </view> 
   </view>
 </view>

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

@@ -90,7 +90,7 @@
 
 .read-info>.title{
   color: #000000;
-  font-weight: 600;
+  font-weight: 500;
 }
 
 .read-info>.date{

+ 1 - 1
utils/APIClient.js

@@ -223,7 +223,7 @@ module.exports = {
   },
   // 收藏课程
   collectClass(uid, data) {
-    let url = getProductUrl(`wx/favorites`);
+    let url = getProductUrl(`wx/favorites`); 
     return request.getInstance().header({
       uid
     }).url(url).data(data).method('POST').send();