Переглянути джерело

开发朋友及搜索朋友页面

bayi 2 роки тому
батько
коміт
48b7992a60

+ 2 - 1
app.json

@@ -17,7 +17,8 @@
     "pages/reading/index",
     "pages/editUser/index",
     "pages/notice/index",
-    "pages/follow/index"
+    "pages/friend/index",
+    "pages/searchFriend/index"
   ],
   "tabBar": {
     "custom": true,

+ 5 - 0
pages/follow/index.js

@@ -81,5 +81,10 @@ Page({
         })
       }
     }
+  },
+  searchFriend() {
+    wx.navigateTo({
+      url: '/pages/searchFriend/index',
+    })
   }
 })

pages/follow/index.json → pages/friend/index.json


+ 20 - 5
pages/follow/index.less

@@ -3,23 +3,38 @@
 
   .screening {
     display: flex;
-    align-items: flex-end;
-    justify-content: space-around;
-    padding: 0rpx 24rpx;
+    align-items: center;
+    justify-content: space-between;
     box-sizing: border-box;
+    padding-left: 20rpx;
 
     .type {
       padding: 4rpx 0rpx;
       color: #666;
-      font-size: 28rpx;
+      font-size: 26rpx;
     }
 
     .currentType {
       color: #333;
       font-weight: bold;
-      font-size: 34rpx;
       border-bottom: 6rpx solid #00C657;
     }
+
+    .searchFriend {
+      font-size: 26rpx;
+      display: flex;
+      align-items: center;
+      padding: 10rpx 26rpx;
+      border-radius: 25rpx;
+      color: #666666;
+      background-color: white;
+
+      image {
+        width: 22rpx;
+        height: 22rpx;
+        margin-right: 10rpx;
+      }
+    }
   }
 
   .follow {

+ 4 - 0
pages/follow/index.wxml

@@ -4,6 +4,10 @@
   <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">
+      <image src="/static/search.png" />
+      找朋友
+    </view>
   </view>
   <view class="follow" wx:for="{{list}}" wx:key="index">
     <view class="userInfo" bindtap="jumpUserInfo" data-uid='{{item.user.uid}}'>

+ 18 - 5
pages/follow/index.wxss

@@ -3,22 +3,35 @@
 }
 .followBox .screening {
   display: flex;
-  align-items: flex-end;
-  justify-content: space-around;
-  padding: 0rpx 24rpx;
+  align-items: center;
+  justify-content: space-between;
   box-sizing: border-box;
+  padding-left: 20rpx;
 }
 .followBox .screening .type {
   padding: 4rpx 0rpx;
   color: #666;
-  font-size: 28rpx;
+  font-size: 26rpx;
 }
 .followBox .screening .currentType {
   color: #333;
   font-weight: bold;
-  font-size: 34rpx;
   border-bottom: 6rpx solid #00C657;
 }
+.followBox .screening .searchFriend {
+  font-size: 26rpx;
+  display: flex;
+  align-items: center;
+  padding: 10rpx 26rpx;
+  border-radius: 25rpx;
+  color: #666666;
+  background-color: white;
+}
+.followBox .screening .searchFriend image {
+  width: 22rpx;
+  height: 22rpx;
+  margin-right: 10rpx;
+}
 .followBox .follow {
   margin-top: 20rpx;
   box-sizing: border-box;

+ 1 - 1
pages/my/index.wxml

@@ -22,7 +22,7 @@
       </view>
     </view>
     <view class="below sectionBoxs">
-      <view class="sBox" bindtap='jump' data-url="/pages/follow/index">
+      <view class="sBox" bindtap='jump' data-url="/pages/friend/index">
         <image class="img" src="/static/concern.png" mode="" />
         <text class="title">朋友 {{filters.numFilter(userInfo.friendCount)}}</text>
       </view>

+ 66 - 0
pages/searchFriend/index.js

@@ -0,0 +1,66 @@
+// pages/searchFriend/index.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 4 - 0
pages/searchFriend/index.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "找朋友"
+}

+ 2 - 0
pages/searchFriend/index.wxml

@@ -0,0 +1,2 @@
+<!--pages/searchFriend/index.wxml-->
+<text>pages/searchFriend/index.wxml</text>

+ 1 - 0
pages/searchFriend/index.wxss

@@ -0,0 +1 @@
+/* pages/searchFriend/index.wxss */