diff --git a/src/components/EmptyState/index.scss b/src/components/EmptyState/index.scss index dd79951..e516d8f 100644 --- a/src/components/EmptyState/index.scss +++ b/src/components/EmptyState/index.scss @@ -3,7 +3,7 @@ flex-direction: column; align-items: center; justify-content: center; - padding: 124px 16px; + padding: 60px 16px; min-height: 400px; .empty-icon { diff --git a/src/components/EmptyState/index.tsx b/src/components/EmptyState/index.tsx index f0d2f14..deb917e 100644 --- a/src/components/EmptyState/index.tsx +++ b/src/components/EmptyState/index.tsx @@ -4,14 +4,16 @@ import "./index.scss"; interface EmptyStateProps { text?: string; icon?: any; // 图片资源 + styles?: any; } const EmptyState = ({ text = "暂无数据", - icon = require("@/static/message/emi.svg") + icon = require("@/static/message/emi.svg"), + styles, }: EmptyStateProps) => { return ( - + diff --git a/src/user_pages/downloadBillRecords/index.tsx b/src/user_pages/downloadBillRecords/index.tsx index b40334f..d6edf52 100644 --- a/src/user_pages/downloadBillRecords/index.tsx +++ b/src/user_pages/downloadBillRecords/index.tsx @@ -5,6 +5,7 @@ import "./index.scss"; import httpService from "@/services/httpService"; import Taro, { useReachBottom } from "@tarojs/taro"; import img from "@/config/images"; +import { EmptyState } from "@/components"; interface BillRecord { id: number; @@ -81,7 +82,7 @@ const DownloadBillRecords: React.FC = () => { - {records.map((record) => ( + {records.length ? records.map((record) => ( {record.file_name} @@ -97,7 +98,7 @@ const DownloadBillRecords: React.FC = () => { 查看材料 - ))} + )) : } 出于信息安全考虑,仅保留并展示7天内的账单下载记录 diff --git a/src/user_pages/wallet/index.tsx b/src/user_pages/wallet/index.tsx index 8a28538..66506d1 100644 --- a/src/user_pages/wallet/index.tsx +++ b/src/user_pages/wallet/index.tsx @@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react"; import { View, Text, Input, Button, Image } from "@tarojs/components"; import Taro, { useDidShow, useReachBottom } from "@tarojs/taro"; import "./index.scss"; -import { CommonPopup } from "@/components"; +import { CommonPopup, EmptyState } from "@/components"; import httpService from "@/services/httpService"; import { withAuth } from "@/components"; import { PopupPicker } from "@/components/Picker/index"; @@ -603,9 +603,10 @@ const WalletPage: React.FC = () => { ); }) ) : ( - - 暂无交易记录 - + // + // 暂无交易记录 + // + )}