|
@@ -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
|