checkpoint: pre-refactor state before fixing P0/P1 issues
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
import { api } from '../../utils/api'
|
||||
import { getAvatarGradient } from '../../utils/format'
|
||||
import { AppGlobalData } from '../../types/index'
|
||||
|
||||
const app = getApp<{ globalData: AppGlobalData }>()
|
||||
|
||||
Page({
|
||||
data: {
|
||||
statusBarHeight: 0,
|
||||
navbarHeight: 44,
|
||||
navbarPaddingRight: 0,
|
||||
keyword: '',
|
||||
resultTab: 'posts' as 'posts' | 'users',
|
||||
postResults: [] as any[],
|
||||
@@ -13,8 +18,8 @@ Page({
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
const info = wx.getSystemInfoSync()
|
||||
this.setData({ statusBarHeight: info.statusBarHeight })
|
||||
const { statusBarHeight, navbarHeight, navbarPaddingRight } = app.globalData.navBarInfo
|
||||
this.setData({ statusBarHeight, navbarHeight, navbarPaddingRight })
|
||||
this.loadHotTopics()
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user