mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-08-06 19:07:25 +08:00
feat(buyer): 添加电子卡券(E_COUPON)支持
- 新增 E_COUPON 商品类型,支持电子卡券的展示与购买逻辑 - 优化商品详情页,调整促销、库存和购买按钮逻辑以适应电子卡券 - 增加卡密信息展示与管理功能,支持商家端卡池管理 - 更新相关页面以处理电子卡券的特殊逻辑,如免地址、隐藏优惠券等
This commit is contained in:
41
seller/src/constants/cardKey.js
Normal file
41
seller/src/constants/cardKey.js
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* 卡密商品(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",
|
||||
VOIDED: "VOIDED",
|
||||
};
|
||||
|
||||
export const CARD_KEY_STATUS_TEXT = {
|
||||
UNUSED: "未使用",
|
||||
ALLOCATED: "已分配",
|
||||
VOIDED: "已作废",
|
||||
};
|
||||
|
||||
export const CARD_KEY_STATUS_TAG = {
|
||||
UNUSED: "success",
|
||||
ALLOCATED: "info",
|
||||
VOIDED: "danger",
|
||||
};
|
||||
|
||||
/** Tab:全部 + 各状态 */
|
||||
export const CARD_KEY_STATUS_TABS = [
|
||||
{ key: "", label: "全部" },
|
||||
{ key: CARD_KEY_STATUS.UNUSED, 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 || "—";
|
||||
}
|
||||
Reference in New Issue
Block a user