feat(transactions): add transaction detail page with live energy and cost estimation

feat(transactions): implement active transaction checks and idTag validation
feat(id-tag): enhance idTag card with disabled state for active transactions
fix(transactions): improve error handling and user feedback for transaction actions
This commit is contained in:
2026-03-13 11:51:06 +08:00
parent c8ddaa4dcc
commit 83e6ed2412
7 changed files with 747 additions and 60 deletions

View File

@@ -34,6 +34,7 @@ type IdTagCardProps = {
idTag: string;
balance: number;
isSelected?: boolean;
isDisabled?: boolean;
/** 内容排列方式余额、logo、卡号等信息元素的布局 */
layout?: CardLayoutName;
/** 卡底装饰风格:纹理、光效、几何图形等视觉元素 */
@@ -45,6 +46,7 @@ export function IdTagCard({
idTag,
balance,
isSelected = false,
isDisabled = false,
layout = "around",
skin = "circles",
onClick,
@@ -55,10 +57,12 @@ export function IdTagCard({
return (
<button
type="button"
disabled={isDisabled}
onClick={onClick}
className={[
"relative w-full overflow-hidden rounded-2xl cursor-pointer select-none",
"relative w-full overflow-hidden rounded-2xl select-none",
"aspect-[1.586/1] transition-all duration-200 active:scale-[0.97]",
isDisabled ? "cursor-not-allowed opacity-45 grayscale-[0.25]" : "cursor-pointer",
isSelected
? "ring-3 ring-offset-2 ring-offset-background ring-accent shadow-2xl shadow-accent/25"
: "ring-1 ring-black/8 hover:ring-accent/40 shadow-md hover:shadow-xl",