浏览代码

开发朋友页面

bayi 2 年之前
父节点
当前提交
f0c28def38
共有 3 个文件被更改,包括 20 次插入6 次删除
  1. 1 1
      components/activityList/index.wxml
  2. 16 2
      pages/follow/index.js
  3. 3 3
      pages/follow/index.wxml

+ 1 - 1
components/activityList/index.wxml

@@ -103,7 +103,7 @@
         <view class="row">
           <view class="title">{{item.title}}</view>
           <view class="partake">
-            <text>{{item.joinCount}}</text>人参与
+            <text>{{filters.numFilter(item.joinCount)}}</text>人参与
           </view>
         </view>
         <view class="row" style="margin-top: 10rpx;">

+ 16 - 2
pages/follow/index.js

@@ -7,10 +7,24 @@ Page({
   behaviors: [reachBottom],
   data: {
     // 1我的关注;2我的粉丝
-    currentType: 1
+    currentType: 1,
+    c1: 0,
+    c2: 0
   },
-  onShow() {
+  async onShow() {
     this.resetData()
+    let c1 = await getFansList({
+      pageSize: 1,
+      type: 1
+    })
+    let c2 = await getFansList({
+      pageSize: 1,
+      type: 2
+    })
+    this.setData({
+      c1: c1.totalSize,
+      c2: c2.totalSize
+    })
   },
   setType({
     currentTarget

+ 3 - 3
pages/follow/index.wxml

@@ -2,10 +2,10 @@
 
 <view class="followBox">
   <view class="screening">
-    <view class="type {{currentType==1?'currentType':''}}" data-type="1" bindtap="setType">我的关注</view>
-    <view class="type {{currentType==2?'currentType':''}}" data-type="2" bindtap="setType">我的粉丝</view>
+    <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>
-  <view class="follow" wx:for="{{list}}" wx:key="*this">
+  <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 }}" />