forked from gxwebsoft/mp-10550
refactor(user): 移除多余的状态栏高度获取逻辑
- 删除了状态栏高度相关的状态变量定义 - 移除了系统信息获取的副作用逻辑 - 简化了页面顶部的安全区域处理 - 更新了导航栏配置以使用默认样式 - 优化了页面布局结构减少了不必要的视图组件
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: '我的送水订单',
|
navigationBarTitleText: '送水订单',
|
||||||
navigationBarTextStyle: 'black',
|
navigationBarTextStyle: 'black',
|
||||||
navigationBarBackgroundColor: '#ffffff'
|
navigationBarBackgroundColor: '#ffffff'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import Taro, { useDidShow } from '@tarojs/taro'
|
import Taro, { useDidShow } from '@tarojs/taro'
|
||||||
import { View, Text } from '@tarojs/components'
|
import { View, Text } from '@tarojs/components'
|
||||||
import { NavBar, Cell, CellGroup, InfiniteLoading, PullToRefresh, Empty, Loading } from '@nutui/nutui-react-taro'
|
import { Cell, CellGroup, InfiniteLoading, PullToRefresh, Empty, Loading } from '@nutui/nutui-react-taro'
|
||||||
import { ArrowLeft } from '@nutui/icons-react-taro'
|
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
|
|
||||||
import { pageGltTicketOrder } from '@/api/glt/gltTicketOrder'
|
import { pageGltTicketOrder } from '@/api/glt/gltTicketOrder'
|
||||||
@@ -11,7 +10,6 @@ import type { GltTicketOrder } from '@/api/glt/gltTicketOrder/model'
|
|||||||
const PAGE_SIZE = 10
|
const PAGE_SIZE = 10
|
||||||
|
|
||||||
export default function TicketOrdersPage() {
|
export default function TicketOrdersPage() {
|
||||||
const [statusBarHeight, setStatusBarHeight] = useState(0)
|
|
||||||
const [list, setList] = useState<GltTicketOrder[]>([])
|
const [list, setList] = useState<GltTicketOrder[]>([])
|
||||||
const [loading, setLoading] = useState(false)
|
const [loading, setLoading] = useState(false)
|
||||||
const [hasMore, setHasMore] = useState(true)
|
const [hasMore, setHasMore] = useState(true)
|
||||||
@@ -57,9 +55,6 @@ export default function TicketOrdersPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Taro.getSystemInfo({
|
|
||||||
success: (res) => setStatusBarHeight(res.statusBarHeight ?? 0)
|
|
||||||
})
|
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
useDidShow(() => {
|
useDidShow(() => {
|
||||||
@@ -71,16 +66,8 @@ export default function TicketOrdersPage() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View className="bg-gray-50 min-h-screen">
|
<View className="bg-gray-50 min-h-screen">
|
||||||
<View style={{ height: `${statusBarHeight || 0}px`, backgroundColor: '#ffffff' }} />
|
|
||||||
<NavBar
|
|
||||||
fixed
|
|
||||||
style={{ marginTop: `${statusBarHeight || 0}px`, backgroundColor: '#ffffff' }}
|
|
||||||
left={<ArrowLeft onClick={() => Taro.navigateBack()} />}
|
|
||||||
>
|
|
||||||
<span>我的送水订单</span>
|
|
||||||
</NavBar>
|
|
||||||
|
|
||||||
<View className="pt-14 px-3">
|
<View className="px-3">
|
||||||
<PullToRefresh onRefresh={() => reload(true)}>
|
<PullToRefresh onRefresh={() => reload(true)}>
|
||||||
{list.length === 0 && !loading ? (
|
{list.length === 0 && !loading ? (
|
||||||
<View className="bg-white rounded-lg p-6">
|
<View className="bg-white rounded-lg p-6">
|
||||||
|
|||||||
Reference in New Issue
Block a user