产品管理价格做保留2位小数 & 账单详情列添加充值消费提示

This commit is contained in:
Eamon
2026-03-30 16:14:25 +08:00
parent 3387056ea9
commit 7479b83f13
2 changed files with 43 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
"use client"
import { zodResolver } from "@hookform/resolvers/zod"
import { format } from "date-fns"
import { CreditCard } from "lucide-react"
import { Suspense, useEffect, useState } from "react"
import { Controller, useForm } from "react-hook-form"
import { toast } from "sonner"
@@ -342,6 +343,42 @@ export default function BillingPage() {
{ header: "ID", accessorKey: "id" },
{ header: "会员号", accessorFn: row => row.user?.phone || "-" },
{ header: "套餐号", accessorKey: "resource.resource_no" },
{
header: "账单详情",
accessorKey: "info",
cell: ({ row }) => {
const bill = row.original
return (
<div className="flex items-center gap-2">
{/* 类型展示 */}
<div className="shrink-0">
{bill.type === 1 && (
<div className="flex gap-2 items-center bg-orange-50 w-fit px-2 py-1 rounded-md">
<CreditCard size={16} />
<span></span>
</div>
)}
{bill.type === 2 && (
<div className="flex gap-2 items-center bg-green-50 w-fit px-2 py-1 rounded-md">
<CreditCard size={16} />
<span>退</span>
</div>
)}
{bill.type === 3 && (
<div className="flex gap-2 items-center bg-blue-50 w-fit px-2 py-1 rounded-md">
<CreditCard size={16} />
<span></span>
</div>
)}
</div>
{/* 账单详情 */}
<div className="text-sm">{bill.info}</div>
</div>
)
},
},
{
header: "应付金额",
accessorKey: "amount",