bayi il y a 2 ans
Parent
commit
a6f7a7ccb1

+ 77 - 67
pages/friend/index.less

@@ -2,11 +2,17 @@
   padding: 0rpx 20rpx 20rpx;
 
   .screening {
+    position: fixed;
+    top: 0px;
+    left: 0px;
+    width: 100%;
+    padding: 0rpx 28rpx 20rpx;
     display: flex;
+    z-index: 9;
     align-items: center;
-    // justify-content: space-between;
-    justify-content: space-around;
+    justify-content: space-between;
     box-sizing: border-box;
+    background-color: #F2F6FC;
     padding-left: 20rpx;
 
     .type {
@@ -17,7 +23,6 @@
 
     .currentType {
       color: #333;
-      font-size: 32rpx;
       font-weight: bold;
       border-bottom: 6rpx solid #00C657;
     }
@@ -26,7 +31,7 @@
       font-size: 26rpx;
       display: flex;
       align-items: center;
-      padding: 10rpx 26rpx;
+      padding: 10rpx 30rpx;
       border-radius: 25rpx;
       color: #666666;
       background-color: white;
@@ -39,81 +44,86 @@
     }
   }
 
-  .follow {
-    margin-top: 20rpx;
-    box-sizing: border-box;
-    width: 100%;
-    background-color: white;
-    border-radius: 10rpx;
-    margin-bottom: 20rpx;
-    padding: 20rpx;
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
+  .box {
+    padding-bottom: 20rpx;
+    margin-top: 100rpx;
 
-    .userInfo {
-      flex: 1;
+    .follow {
+      margin-top: 20rpx;
+      box-sizing: border-box;
+      width: 100%;
+      background-color: white;
+      border-radius: 10rpx;
+      margin-bottom: 20rpx;
+      padding: 20rpx;
       display: flex;
+      align-items: center;
+      justify-content: space-between;
 
-      .avatar {
-        position: relative;
-
-        .avatar-image {
-          width: 96rpx;
-          height: 96rpx;
-          background-color: wheat;
-          border-radius: 50%;
-          border: 4rpx solid #61CA54;
-        }
-
-        .user-profession {
-          position: absolute;
-          bottom: -4rpx;
-          left: 17rpx;
-          width: 68rpx;
-          height: 24rpx;
-          background: rgba(97, 202, 84, 1);
-          border-radius: 50rpx;
-          border: 2rpx solid rgba(255, 255, 255, 1);
-          font-size: 16rpx;
-          color: rgba(255, 255, 255, 1);
-          line-height: 24rpx;
-          text-align: center;
+      .userInfo {
+        flex: 1;
+        display: flex;
 
+        .avatar {
+          position: relative;
+
+          .avatar-image {
+            width: 96rpx;
+            height: 96rpx;
+            background-color: wheat;
+            border-radius: 50%;
+            border: 4rpx solid #61CA54;
+          }
+
+          .user-profession {
+            position: absolute;
+            bottom: -4rpx;
+            left: 17rpx;
+            width: 68rpx;
+            height: 24rpx;
+            background: rgba(97, 202, 84, 1);
+            border-radius: 50rpx;
+            border: 2rpx solid rgba(255, 255, 255, 1);
+            font-size: 16rpx;
+            color: rgba(255, 255, 255, 1);
+            line-height: 24rpx;
+            text-align: center;
+
+          }
         }
-      }
 
-      .infoBox {
-        display: flex;
-        flex-direction: column;
-        justify-content: space-around;
-        margin-left: 14rpx;
-        margin-top: 2rpx;
-
-        .gmtCreated {
-          font-size: 26rpx;
-          color: #888;
+        .infoBox {
+          display: flex;
+          flex-direction: column;
+          justify-content: space-around;
+          margin-left: 14rpx;
+          margin-top: 2rpx;
+
+          .gmtCreated {
+            font-size: 26rpx;
+            color: #888;
+          }
         }
       }
-    }
 
-    .state {
-      text-align: center;
+      .state {
+        text-align: center;
 
-      .stateText {
-        width: 160rpx;
-        padding: 16rpx 0rpx;
-        border-radius: 50rpx;
-        font-size: 24rpx;
-      }
+        .stateText {
+          width: 160rpx;
+          padding: 16rpx 0rpx;
+          border-radius: 50rpx;
+          font-size: 24rpx;
+        }
 
-      .already {
-        background-color: #E4EDFB;
-      }
+        .already {
+          background-color: #E4EDFB;
+        }
 
-      .yet {
-        background-color: #1BC665;
-        color: white;
+        .yet {
+          background-color: #1BC665;
+          color: white;
+        }
       }
     }
   }

+ 21 - 19
pages/friend/index.wxml

@@ -4,30 +4,32 @@
   <view class="screening">
     <view class="type {{currentType==1?'currentType':''}}" data-type="1" bindtap="setType">我的关注({{c1}})</view>
     <view class="type {{currentType==2?'currentType':''}}" data-type="2" bindtap="setType">我的粉丝({{c2}})</view>
-    <!--  <view class="searchFriend" bindtap="searchFriend">
+    <view class="searchFriend" bindtap="searchFriend">
       <image src="/static/search.png" />
       找朋友
-    </view> -->
+    </view>
   </view>
-  <view class="follow" wx:for="{{list}}" wx:key="index">
-    <view class="userInfo" bindtap="jumpUserInfo" data-uid='{{item.user.uid}}'>
-      <view class='avatar'>
-        <image class='avatar-image' src="{{ item.user.avatar }}" />
-        <view class="user-profession">{{item.user.profession}}</view>
-      </view>
-      <view class="infoBox">
-        <view class="nickName">
-          {{item.user.nickName||item.user.eid}}
+  <view class="box">
+    <view class="follow" wx:for="{{list}}" wx:key="index">
+      <view class="userInfo" bindtap="jumpUserInfo" data-uid='{{item.user.uid}}'>
+        <view class='avatar'>
+          <image class='avatar-image' src="{{ item.user.avatar }}" />
+          <view class="user-profession">{{item.user.profession}}</view>
+        </view>
+        <view class="infoBox">
+          <view class="nickName">
+            {{item.user.nickName||item.user.eid}}
+          </view>
+          <view class="gmtCreated">{{filters.formatDate(item.fans.gmtCreated,4)}}</view>
         </view>
-        <view class="gmtCreated">{{filters.formatDate(item.fans.gmtCreated,4)}}</view>
-      </view>
-    </view>
-    <view class="state" data-uid='{{item.user.uid}}' data-isEachOther="{{item.isEachOther}}" bindtap="setFans">
-      <view class="stateText already" wx:if="{{currentType==1}}">
-        {{item.isEachOther?'互相关注':'已关注'}}
       </view>
-      <view class="stateText {{item.isEachOther?'already':'yet'}}" wx:else>
-        {{item.isEachOther?'互相关注':'回关'}}
+      <view class="state" data-uid='{{item.user.uid}}' data-isEachOther="{{item.isEachOther}}" bindtap="setFans">
+        <view class="stateText already" wx:if="{{currentType==1}}">
+          {{item.isEachOther?'互相关注':'已关注'}}
+        </view>
+        <view class="stateText {{item.isEachOther?'already':'yet'}}" wx:else>
+          {{item.isEachOther?'互相关注':'回关'}}
+        </view>
       </view>
     </view>
   </view>

+ 24 - 14
pages/friend/index.wxss

@@ -2,10 +2,17 @@
   padding: 0rpx 20rpx 20rpx;
 }
 .followBox .screening {
+  position: fixed;
+  top: 0px;
+  left: 0px;
+  width: 100%;
+  padding: 0rpx 28rpx 20rpx;
   display: flex;
+  z-index: 9;
   align-items: center;
-  justify-content: space-around;
+  justify-content: space-between;
   box-sizing: border-box;
+  background-color: #F2F6FC;
   padding-left: 20rpx;
 }
 .followBox .screening .type {
@@ -15,7 +22,6 @@
 }
 .followBox .screening .currentType {
   color: #333;
-  font-size: 32rpx;
   font-weight: bold;
   border-bottom: 6rpx solid #00C657;
 }
@@ -23,7 +29,7 @@
   font-size: 26rpx;
   display: flex;
   align-items: center;
-  padding: 10rpx 26rpx;
+  padding: 10rpx 30rpx;
   border-radius: 25rpx;
   color: #666666;
   background-color: white;
@@ -33,7 +39,11 @@
   height: 22rpx;
   margin-right: 10rpx;
 }
-.followBox .follow {
+.followBox .box {
+  padding-bottom: 20rpx;
+  margin-top: 100rpx;
+}
+.followBox .box .follow {
   margin-top: 20rpx;
   box-sizing: border-box;
   width: 100%;
@@ -45,21 +55,21 @@
   align-items: center;
   justify-content: space-between;
 }
-.followBox .follow .userInfo {
+.followBox .box .follow .userInfo {
   flex: 1;
   display: flex;
 }
-.followBox .follow .userInfo .avatar {
+.followBox .box .follow .userInfo .avatar {
   position: relative;
 }
-.followBox .follow .userInfo .avatar .avatar-image {
+.followBox .box .follow .userInfo .avatar .avatar-image {
   width: 96rpx;
   height: 96rpx;
   background-color: wheat;
   border-radius: 50%;
   border: 4rpx solid #61CA54;
 }
-.followBox .follow .userInfo .avatar .user-profession {
+.followBox .box .follow .userInfo .avatar .user-profession {
   position: absolute;
   bottom: -4rpx;
   left: 17rpx;
@@ -73,30 +83,30 @@
   line-height: 24rpx;
   text-align: center;
 }
-.followBox .follow .userInfo .infoBox {
+.followBox .box .follow .userInfo .infoBox {
   display: flex;
   flex-direction: column;
   justify-content: space-around;
   margin-left: 14rpx;
   margin-top: 2rpx;
 }
-.followBox .follow .userInfo .infoBox .gmtCreated {
+.followBox .box .follow .userInfo .infoBox .gmtCreated {
   font-size: 26rpx;
   color: #888;
 }
-.followBox .follow .state {
+.followBox .box .follow .state {
   text-align: center;
 }
-.followBox .follow .state .stateText {
+.followBox .box .follow .state .stateText {
   width: 160rpx;
   padding: 16rpx 0rpx;
   border-radius: 50rpx;
   font-size: 24rpx;
 }
-.followBox .follow .state .already {
+.followBox .box .follow .state .already {
   background-color: #E4EDFB;
 }
-.followBox .follow .state .yet {
+.followBox .box .follow .state .yet {
   background-color: #1BC665;
   color: white;
 }

+ 8 - 0
pages/searchFriend/index.js

@@ -25,6 +25,14 @@ Page({
       query: this.data.text,
     })
   },
+  async setFans({
+    currentTarget
+  }) {
+    let uid = currentTarget.dataset.uid
+    wx.navigateTo({
+      url: `/pages/personal/index?uid=${uid}`,
+    })
+  },
   onReachBottom() {
     this.loadMore()
   }

+ 2 - 3
pages/searchFriend/index.less

@@ -5,7 +5,7 @@
     top: 0px;
     left: 0px;
     width: 100%;
-    padding: 0rpx 28rpx;
+    padding: 0rpx 28rpx 18rpx;
     box-sizing: border-box;
     z-index: 9;
     overflow: hidden;
@@ -21,8 +21,7 @@
     .searchBtn {
       position: absolute;
       right: 50rpx;
-      top: 50%;
-      transform: translateY(-50%);
+      top: 6rpx;
       padding: 6rpx 40rpx;
       background: #00C657;
       border-radius: 40rpx;

+ 4 - 7
pages/searchFriend/index.wxml

@@ -6,7 +6,7 @@
     </view>
   </view>
   <view class="box">
-    <view class="follow" wx:for="{{list}}" wx:key="index">
+    <view class="follow" wx:for="{{list}}" wx:key="index" data-uid='{{item.uid}}' bindtap="setFans">
       <view class="userInfo" bindtap="jumpUserInfo" data-uid='{{item.uid}}'>
         <view class='avatar'>
           <image class='avatar-image' src="{{ item.avatar }}" />
@@ -19,12 +19,9 @@
           <view class="gmtCreated">{{filters.formatDate(item.gmtCreated,4)}}</view>
         </view>
       </view>
-      <view class="state" data-uid='{{item.uid}}' data-isEachOther="{{item.isEachOther}}" bindtap="setFans">
-        <view class="stateText already" wx:if="{{currentType==1}}">
-          {{item.isEachOther?'互相关注':'已关注'}}
-        </view>
-        <view class="stateText {{item.isEachOther?'already':'yet'}}" wx:else>
-          {{item.isEachOther?'互相关注':'回关'}}
+      <view class="state">
+        <view class="stateText {{item.isEachOther?'already':'yet'}}">
+          {{item.isEachOther?'已关注':'关注'}}
         </view>
       </view>
     </view>

+ 2 - 3
pages/searchFriend/index.wxss

@@ -3,7 +3,7 @@
   top: 0px;
   left: 0px;
   width: 100%;
-  padding: 0rpx 28rpx;
+  padding: 0rpx 28rpx 18rpx;
   box-sizing: border-box;
   z-index: 9;
   overflow: hidden;
@@ -18,8 +18,7 @@
 .searchFriend .searchBox .searchBtn {
   position: absolute;
   right: 50rpx;
-  top: 50%;
-  transform: translateY(-50%);
+  top: 6rpx;
   padding: 6rpx 40rpx;
   background: #00C657;
   border-radius: 40rpx;

+ 3 - 3
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 {
+} else { */
   baseUrl = 'https://reader-api.ai160.com/wx'
   oldUrl = 'https://reader-api.ai160.com'
-}
+// }
 
 function request(url, method, data, oldBaseUrl = false) {
   let header = {