Rorschach 6 anni fa
parent
commit
53de19230a
3 ha cambiato i file con 28 aggiunte e 9 eliminazioni
  1. 5 5
      pages/social/works/works.wxml
  2. 14 4
      pages/social/works/works.wxss
  3. 9 0
      utils/APIClient.js

+ 5 - 5
pages/social/works/works.wxml

@@ -8,7 +8,8 @@
             <text class="likeBtn">{{isLike ? '已' : ''}}点赞</text>
         </view>
         <view class="follow" wx:if="{{authorUid !== myUid}}">
-            <text class="followBtn" bindtap="follow" >{{isFans ? '已' : ''}}关注</text>
+            <image src="{{isFans? '../../../static/image/fully_heart.png' : '../../../static/image/empty_heart.png'}}" />
+            <text class="followBtn" bindtap="follow">{{isFans ? '已' : ''}}关注</text>
         </view>
     </view>
     <view class="userSection">
@@ -41,9 +42,9 @@
             </view>
             <view class="btnWrapper">
                 <image class="commentBtn" src="../../../static/image/comment.png" bindtap="setSBId" data-id="{{item.id}}" data-index="{{index}}" />
-                <text class="commentText" bindtap="setSBId" data-id="{{item.id}}" data-index="{{index}}" >评论</text>
+                <text class="commentText" bindtap="setSBId" data-id="{{item.id}}" data-index="{{index}}">评论</text>
                 <image class="likeBtn" src="../../../static/image/like.png" data-index="{{index}}" data-likes="{{item.likes}}" data-id="{{item.id}}" bindtap="likeCommend" />
-                <text class="likeText"  data-index="{{index}}" data-likes="{{item.likes}}" data-id="{{item.id}}" bindtap="likeCommend">{{item.likes}}</text>
+                <text class="likeText" data-index="{{index}}" data-likes="{{item.likes}}" data-id="{{item.id}}" bindtap="likeCommend">{{item.likes}}</text>
             </view>
         </view>
     </view>
@@ -71,7 +72,7 @@
     <shareDialog id="share-dialog" shareType='works' shareId="{{id}}" />
     <!-- 评论框 -->
     <view class="replySection" wx:if="{{replyModal}}">
-        <input bindblur="bindTextAreaBlur"  bindconfirm="replySB" confirm-type="send" placeholder="回复" bindinput="inputSBValue" auto-focus auto-height />
+        <input bindblur="bindTextAreaBlur" bindconfirm="replySB" confirm-type="send" placeholder="回复" bindinput="inputSBValue" auto-focus auto-height />
     </view>
     <!-- 奖励弹窗 -->
     <cover-view class="modalWrapper" wx:if="{{ifReward}}">
@@ -94,5 +95,4 @@
         </cover-view>
         <cover-image class="quitBtn" bindtap="quitReward" src="../../../static/groupImg/cha.png" />
     </cover-view>
-    
 </view>

+ 14 - 4
pages/social/works/works.wxss

@@ -51,15 +51,25 @@
 }
 
 .readAuthorSection .follow {
+    display: flex;
+    align-items: center;
+    justify-content: center;
     margin-left: 12rpx;
     width: 160rpx;
     height: 60rpx;
-    border: 2rpx solid #259b24;
+    border: 2rpx solid #ff0000;
     font-size: 28rpx;
     border-radius: 30rpx;
     text-align: center;
     line-height: 60rpx;
-    color: #539bee;
+    color: #ff0000;
+}
+
+.readAuthorSection .follow image {
+    width: 36rpx;
+    height: 36rpx;
+    margin-right: 15rpx;
+
 }
 
 .userSection {
@@ -213,6 +223,7 @@
     right: 10rpx;
     display: flex;
     align-items: center;
+    /* width: 200rpx; */
 }
 
 .btnWrapper .commentBtn {
@@ -221,8 +232,7 @@
     margin-left: 8rpx;
 }
 
-.btnWrapper .commentText,
-.likeText {
+.btnWrapper .commentText, .likeText {
     width: 58rpx;
     height: 40rpx;
     color: #545454;

+ 9 - 0
utils/APIClient.js

@@ -111,6 +111,15 @@ module.exports = {
       "uid": followUid
     }).method('POST').send();
   },
+  // 取消关注
+  cancerFollow(uid, followUid) {
+    let url = getBaseUrl(`wx/fans`);
+    return request.getInstance().header({
+      uid
+    }).url(url).data({
+      "uid": followUid
+    }).method('PUT').send();
+  },
   //获取关注的用户列表
   getFollowUsers(uid, pageNo, pageSize) {
     let url = getBaseUrl(`wx/fans`);