diff --git a/src/user/order/components/OrderList.tsx b/src/user/order/components/OrderList.tsx index 3f0cdc9..d82faa8 100644 --- a/src/user/order/components/OrderList.tsx +++ b/src/user/order/components/OrderList.tsx @@ -11,8 +11,8 @@ import {ShopOrderGoods} from "@/api/shop/shopOrderGoods/model"; import {copyText} from "@/utils/common"; const getInfiniteUlStyle = (showSearch: boolean = false): CSSProperties => ({ - marginTop: showSearch ? '65px' : '44px', // 如果显示搜索框,增加更多的上边距 - height: showSearch ? '75vh' : '82vh', // 相应调整高度 + marginTop: showSearch ? '0' : '0', // 如果显示搜索框,增加更多的上边距 + height: showSearch ? '75vh' : '84vh', // 相应调整高度 width: '100%', padding: '0', overflowY: 'auto', @@ -263,7 +263,6 @@ function OrderList(props: OrderListProps) { align={'left'} className={'fixed left-0'} style={{ - top: '44px', zIndex: 998, borderBottom: '1px solid #e5e5e5' }} diff --git a/src/user/order/order.tsx b/src/user/order/order.tsx index 2860672..a023949 100644 --- a/src/user/order/order.tsx +++ b/src/user/order/order.tsx @@ -1,8 +1,8 @@ import {useState} from "react"; import Taro, {useDidShow} from '@tarojs/taro' -import {Space, Empty, Button, ConfigProvider, Input} from '@nutui/nutui-react-taro' -import {Search, Filter} from '@nutui/icons-react-taro' -import { View } from '@tarojs/components'; +import {Space, NavBar, Empty, Button, ConfigProvider, Input} from '@nutui/nutui-react-taro' +import {Search, Filter, ArrowLeft} from '@nutui/icons-react-taro' +import {View} from '@tarojs/components'; import OrderList from "./components/OrderList"; // import OrderSearch from "./components/OrderSearch"; import {ShopOrder, ShopOrderParam} from "@/api/shop/shopOrder/model"; @@ -10,6 +10,7 @@ import {pageShopOrder} from "@/api/shop/shopOrder"; import './order.scss' function Order() { + const [statusBarHeight, setStatusBarHeight] = useState() const [list, setList] = useState([]) const [searchParams, setSearchParams] = useState({}) const [showSearch, setShowSearch] = useState(false) @@ -39,6 +40,12 @@ function Order() { } useDidShow(() => { + // 获取状态栏高度 + Taro.getSystemInfo({ + success: (res) => { + setStatusBarHeight(res.statusBarHeight) + }, + }) // 设置导航栏标题 Taro.setNavigationBarTitle({ title: '我的订单' @@ -54,6 +61,27 @@ function Order() { return ( + + +
+ + Taro.navigateBack()}/> + setShowSearch(!showSearch)} + /> + +
+ + } + > + 我的订单 +
{/* 搜索和筛选工具栏 */} @@ -84,7 +112,7 @@ function Order() { onChange={setSearchKeyword} onConfirm={() => { if (searchKeyword.trim()) { - handleSearch({ keywords: searchKeyword.trim() }); + handleSearch({keywords: searchKeyword.trim()}); } }} style={{ @@ -100,7 +128,7 @@ function Order() { type="primary" onClick={() => { if (searchKeyword.trim()) { - handleSearch({ keywords: searchKeyword.trim() }); + handleSearch({keywords: searchKeyword.trim()}); } }} > @@ -123,7 +151,7 @@ function Order() {