bayi пре 2 година
родитељ
комит
d8c6693fe5

+ 4 - 0
api/video.js

@@ -21,4 +21,8 @@ module.exports = {
   likeReply: data => request(`/posts/like/${data}`, 'get'),
   // 作品播放统计
   submitPlayLog: data => request('/base/playLog', 'post', data),
+  // 获取作品点赞记录
+  getLikeNotes: data => request('/likeLog', 'get', data),
+  // 获取单条点赞记录
+  getLikeNote: data => request(`/likeLog/one/${data}`, 'get'),
 }

+ 9 - 6
components/comment/index.js

@@ -2,7 +2,9 @@ import {
   getComment,
   postReply,
   ReplyComment,
-  likeReply
+  likeReply,
+  getLikeNotes,
+  getLikeNote
 } from '~/api/video'
 import reachBottom from '~/mixins/reachBottom'
 Component({
@@ -14,10 +16,6 @@ Component({
       value: false
     }
   },
-
-  /**
-   * 组件的初始数据
-   */
   data: {
     show: false,
     quickShow: true,
@@ -33,7 +31,7 @@ Component({
     animation: {}
   },
   methods: {
-    open(columnId) {
+    open(columnId, type = 'comment') {
       // 背景遮罩层
       var animation = wx.createAnimation({
         duration: 300,
@@ -44,8 +42,10 @@ Component({
       this.setData({
         animationData: animation.export(),
         columnId,
+        type,
         show: true,
       })
+      console.log(type);
       setTimeout(() => {
         animation.translateY(0).step()
         this.setData({
@@ -83,6 +83,9 @@ Component({
     },
     loadMore() {
       if (this.data.type == 'like') {
+        this.getData(getLikeNotes, {
+          columnId: this.data.columnId,
+        })
         return
       }
       let params = {

+ 41 - 0
components/comment/index.less

@@ -145,6 +145,47 @@
               }
             }
           }
+
+          .c-like {
+            flex: 1;
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            .left {
+              height: 90rpx;
+              display: flex;
+              flex-direction: column;
+              justify-content: space-between;
+
+              .nickName {
+                font-size: 36rpx;
+                color: rgba(0, 0, 0, 0.60);
+              }
+
+              .time {
+                font-size: 24rpx;
+                color: #666666;
+              }
+            }
+            .follow {
+              display: flex;
+              align-items: center;
+              justify-content: center;
+              width: 140rpx;
+              font-size: 24rpx;
+              padding: 8rpx 0rpx;
+              border-radius: 50rpx;
+              border: 1rpx solid #1BC665;
+              color: #1BC665;
+      
+              .character {
+                width: 22rpx;
+                height: 22rpx;
+                margin-right: 6rpx;
+              }
+            }
+      
+          }
         }
 
         .content:last-child {

+ 15 - 2
components/comment/index.wxml

@@ -13,7 +13,7 @@
       <view class="body-box">
         <view class="content" wx:for="{{list}}" wx:key="id">
           <image src="{{item.user.avatar}}" class="c-avatar" data-uid='{{item.user.uid}}' bindtap="jumpUserInfo" />
-          <view class="c-right">
+          <view class="c-right" wx:if="{{type=='comment'}}">
             <view class="nickName">
               {{item.user.nickName||item.user.eid}}
             </view>
@@ -41,11 +41,24 @@
               </view>
             </view>
           </view>
+          <view class="c-like" wx:else>
+            <view class="left">
+              <view class="nickName">
+                {{item.user.nickName||item.user.eid}}
+              </view>
+              <view class="time">{{item.gmtCreated}}</view>
+            </view>
+            <view class="follow {{videoInfoCopy.isFans?'isFans':''}}" bindtap="setFans">
+              <image src="{{videoInfoCopy.isFans?'/static/follow_2.png':'/static/follow_3.png'}}" class="character"
+                mode="" />
+              <text class="text">{{videoInfoCopy.isFans?'已关注':'关注'}}</text>
+            </view>
+          </view>
         </view>
       </view>
     </scroll-view>
     <!-- 快捷回复 -->
-    <view class="quick" wx:if="{{quickShow}}">
+    <view class=" quick" wx:if="{{quickShow&&type=='comment'}}">
       <view class="close" catchtap="quickClose">×</view>
       <view class="quickTop">
         <view class="left">留下你的赞美,鼓励一下。</view>

+ 36 - 0
components/comment/index.wxss

@@ -126,6 +126,42 @@
   align-items: center;
   margin-left: 24rpx;
 }
+.commentBox .comment .body .body-box .content .c-like {
+  flex: 1;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.commentBox .comment .body .body-box .content .c-like .left {
+  height: 90rpx;
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+}
+.commentBox .comment .body .body-box .content .c-like .left .nickName {
+  font-size: 36rpx;
+  color: rgba(0, 0, 0, 0.6);
+}
+.commentBox .comment .body .body-box .content .c-like .left .time {
+  font-size: 24rpx;
+  color: #666666;
+}
+.commentBox .comment .body .body-box .content .c-like .follow {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  width: 140rpx;
+  font-size: 24rpx;
+  padding: 8rpx 0rpx;
+  border-radius: 50rpx;
+  border: 1rpx solid #1BC665;
+  color: #1BC665;
+}
+.commentBox .comment .body .body-box .content .c-like .follow .character {
+  width: 22rpx;
+  height: 22rpx;
+  margin-right: 6rpx;
+}
 .commentBox .comment .body .body-box .content:last-child {
   border: none;
 }

+ 0 - 3
components/worksList/index.js

@@ -60,9 +60,6 @@ Component({
     tabBarPadding: {
       type: Boolean,
       value: false,
-      observer(b) {
-        console.log(b);
-      }
     }
   },
   data: {

+ 2 - 1
mixins/video.js

@@ -87,7 +87,8 @@ module.exports = Behavior({
     openComment({
       target
     }) {
-      this.selectComponent('#comment').open(target.dataset.id)
+      console.log(target);
+      this.selectComponent('#comment').open(target.dataset.id, target.dataset.type)
     },
     // 分享
     creatShare(video) {

+ 13 - 12
pages/like/index.js

@@ -1,21 +1,18 @@
 import {
   getBeLikeList
 } from '~/api/message'
+import reachBottom from '~/mixins/reachBottom'
 Page({
+  behaviors: [reachBottom],
   data: {
     list: []
   },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad(options) {
-    this.getBeLikeList()
+  onShow(options) {
+    this.resetData()
   },
-  async getBeLikeList() {
-    let list = await getBeLikeList()
-    this.setData({
-      list
+  loadMore() {
+    this.getData(getBeLikeList, {
+      pageSize: 20
     })
   },
   jumpUserInfo({
@@ -28,9 +25,13 @@ Page({
   jumpWork({
     currentTarget
   }) {
-    console.log(currentTarget);
+    console.log(currentTarget.dataset);
+    let {
+      id,
+      likelog
+    } = currentTarget.dataset
     wx.navigateTo({
-      url: `/pages/userWorks/index?id=${currentTarget.dataset.id}`,
+      url: `/pages/userWorks/index?id=${id}&likeId=${likelog}`,
     })
   },
 })

+ 2 - 2
pages/like/index.less

@@ -35,8 +35,8 @@
     }
 
     .cover {
-      width: 134rpx;
-      height: 74rpx;
+      width: 230rpx;
+      height: 128rpx;
       border-radius: 10rpx;
     }
 

+ 1 - 1
pages/like/index.wxml

@@ -1,5 +1,5 @@
 <view class="like">
-  <view class="notes" wx:for="{{list}}" wx:key="index" data-id='{{item.userRead.id}}' bindtap="jumpWork">
+  <view class="notes" wx:for="{{list}}" wx:key="index" data-id='{{item.userRead.id}}' data-likelog="{{item.likeLog.id}}" bindtap="jumpWork">
     <view class="redDrop"></view>
     <image src="{{item.user.avatar}}" class="avatar" data-uid='{{item.user.uid}}' catchtap="jumpUserInfo" />
     <view class="body">

+ 2 - 2
pages/like/index.wxss

@@ -29,8 +29,8 @@
   font-size: 24rpx;
 }
 .like .notes .cover {
-  width: 134rpx;
-  height: 74rpx;
+  width: 230rpx;
+  height: 128rpx;
   border-radius: 10rpx;
 }
 .like .notes .audioCover {

+ 10 - 0
pages/userWorks/index.js

@@ -15,6 +15,16 @@ Page({
     console.log(options);
     if (options.id) {
       this.getreadInfo(options.id)
+      wx.nextTick(() => {
+        this.selectComponent('#worksList').openComment({
+          target: {
+            dataset: {
+              type: 'like',
+              id: options.id
+            }
+          }
+        })
+      })
     } else {
       this.loadMore()
     }

+ 5 - 5
utils/request.js

@@ -6,13 +6,13 @@ const {
     envVersion
   }
 } = wx.getAccountInfoSync();
-if (envVersion == 'develop') {
+// if (envVersion == 'develop') {
   baseUrl = 'https://reader-api.efunbox.cn/wx'
   oldUrl = 'https://reader-api.efunbox.cn'
-} else {
-  baseUrl = 'https://reader-api.ai160.com/wx'
-  oldUrl = 'https://reader-api.ai160.com'
-}
+// } else {
+//   baseUrl = 'https://reader-api.ai160.com/wx'
+//   oldUrl = 'https://reader-api.ai160.com'
+// }
 
 function request(url, method, data, oldBaseUrl = false) {
   let header = {