Files
lilishop-ui/seller/src/constants/cardKey.js
田香琪 1accdf5826 feat(buyer): 更新电子卡券(E_COUPON)相关逻辑与展示
- 优化购物车与支付页面,确保电子卡券只能通过立即购买结算
- 增强商品详情页,添加限时折扣与第N件优惠展示
- 更新促销逻辑,支持拼团与积分购买选项
- 规范化商品类型与库存提示,提升用户体验
2026-08-02 13:55:19 +08:00

46 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 卡密商品(E_COUPON)— 商家端常量
*
* 卡池状态 UNUSED / ALLOCATED / VOIDED;Tab 与列表筛选、标签色映射。
* 需求:card-key-goods-api.md §2.1~2.3
*
* @author Mike
* @date 2026-07-31
*/
/** 卡密状态枚举(与后端 CardKeyStatusEnum 一致) */
export const CARD_KEY_STATUS = {
UNUSED: "UNUSED",
ALLOCATED: "ALLOCATED",
RESERVED: "RESERVED",
VOIDED: "VOIDED",
};
export const CARD_KEY_STATUS_TEXT = {
UNUSED: "未使用",
ALLOCATED: "已分配",
RESERVED: "已预占",
VOIDED: "已作废",
};
export const CARD_KEY_STATUS_TAG = {
UNUSED: "success",
ALLOCATED: "info",
RESERVED: "warning",
VOIDED: "danger",
};
/** Tab:全部 + 各状态 */
export const CARD_KEY_STATUS_TABS = [
{ key: "", label: "全部" },
{ key: CARD_KEY_STATUS.UNUSED, label: "未使用" },
{ key: CARD_KEY_STATUS.RESERVED, label: "已预占" },
{ key: CARD_KEY_STATUS.ALLOCATED, label: "已分配" },
{ key: CARD_KEY_STATUS.VOIDED, label: "已作废" },
];
export const E_COUPON_GOODS_TYPE = "E_COUPON";
export function formatCardKeyStatus(status) {
return CARD_KEY_STATUS_TEXT[status] || status || "—";
}