Bladeren bron

联调页面红点

bayi 2 jaren geleden
bovenliggende
commit
920e2cf1d3

+ 1 - 1
custom-tab-bar/index.less

@@ -23,7 +23,7 @@
 
     .noticeTips {
       position: absolute;
-      left: 116rpx;
+      left: 100rpx;
       top: -12rpx;
       width: 28rpx;
       padding: 4rpx 0rpx;

+ 1 - 1
custom-tab-bar/index.wxss

@@ -23,7 +23,7 @@
 }
 .tab-bar .tab-bar-item .noticeTips {
   position: absolute;
-  left: 116rpx;
+  left: 100rpx;
   top: -12rpx;
   width: 28rpx;
   padding: 4rpx 0rpx;

+ 6 - 1
pages/friend/index.js

@@ -1,5 +1,6 @@
 import {
   getFansList,
+  getMyInfo,
   setFans
 } from '~/api/user'
 import reachBottom from '~/mixins/reachBottom'
@@ -10,6 +11,7 @@ Page({
     currentType: 1,
     c1: 0,
     c2: 0,
+    userInfo: {},
     localUid: wx.getStorageSync('uid')
   },
   async onShow() {
@@ -22,9 +24,12 @@ Page({
       pageSize: 1,
       type: 2
     })
+    let userInfo = await getMyInfo()
+
     this.setData({
       c1: c1.totalSize,
-      c2: c2.totalSize
+      c2: c2.totalSize,
+      userInfo
     })
   },
   setType({

+ 16 - 0
pages/friend/index.less

@@ -15,10 +15,26 @@
     background-color: #F2F6FC;
     padding-left: 20rpx;
 
+
     .type {
+      position: relative;
       padding: 4rpx 0rpx;
       color: #666;
       font-size: 26rpx;
+
+      .noticeTips {
+        position: absolute;
+        right: -6rpx;
+        top: 0rpx;
+        width: 30rpx;
+        padding: 2rpx 0rpx;
+        border-radius: 40rpx;
+        color: white;
+        font-size: 18rpx;
+        text-align: center;
+        background-color: #FF0000;
+      }
+
     }
 
     .currentType {

+ 3 - 1
pages/friend/index.wxml

@@ -3,7 +3,9 @@
 <view class="followBox">
   <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="type {{currentType==2?'currentType':''}}" data-type="2" bindtap="setType">我的粉丝({{c2}}) <view
+        class="noticeTips" wx:if="{{userInfo.newFansCount>0}}">{{userInfo.newFansCount}}</view>
+    </view>
     <view class="searchFriend" bindtap="searchFriend">
       <image src="/static/search.png" />
       找朋友

+ 13 - 0
pages/friend/index.wxss

@@ -16,10 +16,23 @@
   padding-left: 20rpx;
 }
 .followBox .screening .type {
+  position: relative;
   padding: 4rpx 0rpx;
   color: #666;
   font-size: 26rpx;
 }
+.followBox .screening .type .noticeTips {
+  position: absolute;
+  right: -6rpx;
+  top: 0rpx;
+  width: 30rpx;
+  padding: 2rpx 0rpx;
+  border-radius: 40rpx;
+  color: white;
+  font-size: 18rpx;
+  text-align: center;
+  background-color: #FF0000;
+}
 .followBox .screening .currentType {
   color: #333;
   font-weight: bold;

+ 1 - 1
pages/my/index.wxml

@@ -28,7 +28,7 @@
         <text class="title">朋友 {{filters.numFilter(userInfo.friendCount)}}</text>
       </view>
       <view class="sBox" bindtap='jump' data-url="/pages/userWorks/index">
-        <view class="noticeTips" wx:if="{{userInfo.user.unReadPostsCount>0}}">{{userInfo.user.unReadPostsCount}}</view>
+        <view class="noticeTips" wx:if="{{userInfo.unReadPostsCount>0}}">{{userInfo.unReadPostsCount}}</view>
         <image class="img" src="/static/work.png" mode="" />
         <text class="title">作品 {{filters.numFilter(userInfo.readAmount)}}</text>
       </view>