bayi 2 年之前
父節點
當前提交
28fa3a9f88
共有 4 個文件被更改,包括 20 次插入5 次删除
  1. 13 0
      pages/message/index.js
  2. 3 2
      pages/my/index.less
  3. 1 1
      pages/my/index.wxml
  4. 3 2
      pages/my/index.wxss

+ 13 - 0
pages/message/index.js

@@ -6,6 +6,12 @@ import {
 import {
   getMyInfo,
 } from '~/api/user'
+import {
+  createStoreBindings
+} from 'mobx-miniprogram-bindings'
+import {
+  store
+} from '~/store/index'
 import reachBottom from '~/mixins/reachBottom'
 const app = getApp()
 Page({
@@ -27,6 +33,12 @@ Page({
     this.setData({
       uid: wx.getStorageSync('uid')
     })
+    this.storeBindings = createStoreBindings(this, {
+      store,
+      actions: {
+        setUser: 'setUser'
+      }
+    })
   },
   async onShow() {
     if (typeof this.getTabBar === 'function') {
@@ -40,6 +52,7 @@ Page({
     this.setData({
       userInfo
     })
+    this.setUser(userInfo.user)
     wx.createSelectorQuery().select('.menu').boundingClientRect((rect) => {
       this.setData({
         menuH: rect.height

+ 3 - 2
pages/my/index.less

@@ -82,7 +82,7 @@
   }
 
   .below {
-    padding: 20rpx 30rpx;
+    padding: 20rpx 0rpx;
     display: flex;
     align-items: center;
     justify-content: space-between;
@@ -90,6 +90,7 @@
     border-radius: 20rpx;
 
     .sBox {
+      width: 110rpx;
       position: relative;
       display: flex;
       flex-direction: column;
@@ -108,7 +109,7 @@
 
       .noticeTips {
         position: absolute;
-        right: 10rpx;
+        right: 8rpx;
         top: -8rpx;
         width: 34rpx;
         padding: 4rpx 0rpx;

+ 1 - 1
pages/my/index.wxml

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

+ 3 - 2
pages/my/index.wxss

@@ -68,7 +68,7 @@
   color: #666;
 }
 .container .below {
-  padding: 20rpx 30rpx;
+  padding: 20rpx 0rpx;
   display: flex;
   align-items: center;
   justify-content: space-between;
@@ -76,6 +76,7 @@
   border-radius: 20rpx;
 }
 .container .below .sBox {
+  width: 110rpx;
   position: relative;
   display: flex;
   flex-direction: column;
@@ -92,7 +93,7 @@
 }
 .container .below .sBox .noticeTips {
   position: absolute;
-  right: 10rpx;
+  right: 8rpx;
   top: -8rpx;
   width: 34rpx;
   padding: 4rpx 0rpx;