/** * T-068 + T-653: 优惠券列表组件(含可领取 Tab) * Tab 切换:可领取 / 可用 / 已使用 / 已过期 * 可领取 Tab:展示可领取券模板 + 库存 + 领券按钮 * 其他 Tab:每张券类型标签 + 面额 + 使用门槛 + 有效期 */ import { BaseComponent } from '../base/BaseComponent'; /** 优惠券状态 */ export type CouponStatus = 'unused' | 'used' | 'expired'; /** 优惠券类型 */ export type CouponType = 'discount' | 'cash' | 'shipping' | 'gift'; /** 优惠券数据 */ export interface CouponItem { id: string; type: CouponType; name: string; faceValue: number; currency?: string; thresholdKey: string; thresholdParams?: Record; validFrom: string | number | Date; validTo: string | number | Date; status: CouponStatus; } /** 可领取券模板 */ export interface ClaimableCouponItem { id: number; name: string; type: number; value: number; minOrderAmount: number; perUserLimit: number; userClaimed: number; stockRemaining: number; totalCount: number; } /** 领券回调 */ export type ClaimCouponFn = (templateId: number) => Promise; /** 加载可领取券回调 */ export type LoadClaimableFn = () => Promise; /** 加载我的优惠券回调 */ export type LoadMineFn = () => Promise; export declare class CouponList extends BaseComponent { private coupons; private claimableItems; private activeTab; private claimCouponFn; private loadClaimableFn; private loadMineFn; private claimableLoading; private claimingId; private initialized; /** 设置优惠券数据(我的已领取) */ setData(coupons: CouponItem[]): void; /** 设置可领取券数据 */ setClaimableData(items: ClaimableCouponItem[]): void; /** 设置领券回调 */ setClaimCouponFn(fn: ClaimCouponFn): void; /** 设置加载可领取券回调 */ setLoadClaimableFn(fn: LoadClaimableFn): void; /** 设置加载我的优惠券回调 */ setLoadMineFn(fn: LoadMineFn): void; /** 获取当前 tab 下的优惠券 */ private getFilteredCoupons; /** 切换 Tab */ private switchTab; /** 加载可领取券 */ private loadClaimable; /** 领券 */ private handleClaim; /** 刷新我的优惠券列表 */ private refreshMine; /** 获取券类型标签文案 */ private getTypeLabel; /** 获取面额显示 */ private getFaceValueDisplay; protected styles(): string; protected render(): string; private renderClaimableTab; private renderCouponCard; protected afterRender(): void; } /** 注册自定义元素 */ export declare function registerCouponList(): void; //# sourceMappingURL=CouponList.d.ts.map