import type { Media } from '../../types/props.js'; import type { Product } from '../Listing/types/product.js'; export type { Media }; export interface GiftShelfProduct { /** 产品 SKU */ sku: string; /** 产品名称 */ name: string; /** 产品图片 URL */ image: string; /** 产品值/标识 (通常与 handle 相同) */ value: string; /** 产品 handle (URL slug) */ handle: string; /** Shopify 产品 ID */ shopify_id: string; /** 自定义库存 */ custom_inventory?: number; /** 自定义价格 */ custom_price?: number; /** 自定义产品描述 */ custom_description?: string | null; } /** * 满赠阶梯产品项 */ export interface GiftTierProduct { /** 价值单位(如 "Value") */ valueUnit?: string; } /** * 满赠阶梯项 */ export interface GiftTierItem { /** 阶梯门槛文本(如 "Order Over $3,000") */ threshold: string; /** 该阶梯对应的产品 */ products: GiftShelfProduct[]; /** 是否显示会员标签 */ showMemberTag?: boolean; /** 会员标签图片 */ memberTagImage?: Media; /** 价值单位(如 "Value") */ valueUnit?: string; } /** * 满赠货架组件数据接口 */ export interface GiftTierShelfData { /** 阶梯项列表 */ items: GiftTierItem[]; /** 主题模式 */ theme?: 'light' | 'dark'; /** 是否显示时间轴 */ showTimeline?: boolean; } /** * 语义化类名 */ export type GiftTierShelfSemanticName = 'root' | 'card' | 'timeline' | 'thresholdText'; /** * 满赠货架组件 Props */ export interface GiftTierShelfProps extends React.HTMLAttributes { /** 业务数据 */ data: GiftTierShelfData; /** 构建时数据(产品列表等) */ buildData?: { products: Product[]; }; /** 语义化类名 */ classNames?: Partial>; /** 卡片点击回调 */ onCardClick?: (item: GiftTierItem, index: number) => void; }