|
|
@ -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<number>() |
|
|
|
const [list, setList] = useState<ShopOrder[]>([]) |
|
|
|
const [searchParams, setSearchParams] = useState<ShopOrderParam>({}) |
|
|
|
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 ( |
|
|
|
<View className="bg-gray-50 min-h-screen"> |
|
|
|
<View style={{height: `${statusBarHeight}px`, backgroundColor: '#ffffff'}}></View> |
|
|
|
<NavBar |
|
|
|
fixed={true} |
|
|
|
style={{marginTop: `${statusBarHeight}px`, backgroundColor: '#ffffff'}} |
|
|
|
left={ |
|
|
|
<> |
|
|
|
<div className={'flex justify-between items-center w-full'}> |
|
|
|
<Space> |
|
|
|
<ArrowLeft onClick={() => Taro.navigateBack()}/> |
|
|
|
<Search |
|
|
|
size={18} |
|
|
|
className={'mx-4'} |
|
|
|
onClick={() => setShowSearch(!showSearch)} |
|
|
|
/> |
|
|
|
</Space> |
|
|
|
</div> |
|
|
|
</> |
|
|
|
} |
|
|
|
> |
|
|
|
<span>我的订单</span> |
|
|
|
</NavBar> |
|
|
|
{/* 搜索和筛选工具栏 */} |
|
|
|
<View className="bg-white px-4 py-3 flex justify-between items-center border-b border-gray-100"> |
|
|
|
<View className="flex items-center"> |
|
|
@ -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() { |
|
|
|
<ConfigProvider> |
|
|
|
<div className={'h-full flex flex-col justify-center items-center'} style={{ |
|
|
|
height: showSearch ? 'calc(100vh - 200px)' : 'calc(100vh - 150px)', |
|
|
|
marginTop: showSearch ? '60px' : '0px' |
|
|
|
marginTop: showSearch ? '60px' : '0' |
|
|
|
}}> |
|
|
|
<Empty |
|
|
|
style={{ |
|
|
|