From f7825b84b12281cb6d4a24387deb21ff431916d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Mon, 11 Aug 2025 21:20:48 +0800 Subject: [PATCH] =?UTF-8?q?feat(user/order):=20=E6=B7=BB=E5=8A=A0=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=A0=8F=E9=AB=98=E5=BA=A6=E9=80=82=E9=85=8D=E5=B9=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AE=A2=E5=8D=95=E9=A1=B5=E9=9D=A2=E5=B8=83?= =?UTF-8?q?=E5=B1=80-=20=E5=9C=A8=20Order=20=E7=BB=84=E4=BB=B6=E4=B8=AD?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=8A=B6=E6=80=81=E6=A0=8F=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=92=8C=E9=80=82=E9=85=8D=20-=20=E5=BC=95?= =?UTF-8?q?=E5=85=A5=20NavBar=20=E7=BB=84=E4=BB=B6=E5=B9=B6=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=9B=BA=E5=AE=9A=E4=BD=8D=E7=BD=AE=20-=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E6=90=9C=E7=B4=A2=E6=A0=8F=E5=92=8C=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E6=A0=B7=E5=BC=8F=E4=BB=A5=E9=80=82?= =?UTF-8?q?=E5=BA=94=E6=96=B0=E5=B8=83=E5=B1=80=20-=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20OrderList=20=E7=BB=84=E4=BB=B6=E7=9A=84=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=EF=BC=8C=E7=A7=BB=E9=99=A4=E5=9B=BA=E5=AE=9A=E7=9A=84=20top=20?= =?UTF-8?q?=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/user/order/components/OrderList.tsx | 5 ++-- src/user/order/order.tsx | 40 +++++++++++++++++++++---- 2 files changed, 36 insertions(+), 9 deletions(-) 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() {