mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-08-07 03:15:01 +08:00
feat(buyer): 更新电子卡券(E_COUPON)相关逻辑与展示
- 优化购物车与支付页面,确保电子卡券只能通过立即购买结算 - 增强商品详情页,添加限时折扣与第N件优惠展示 - 更新促销逻辑,支持拼团与积分购买选项 - 规范化商品类型与库存提示,提升用户体验
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
export const CARD_KEY_STATUS_TEXT = {
|
||||
UNUSED: "未使用",
|
||||
ALLOCATED: "已分配",
|
||||
RESERVED: "已预占",
|
||||
VOIDED: "已作废",
|
||||
};
|
||||
|
||||
|
||||
35
manager/src/constants/goodsType.js
Normal file
35
manager/src/constants/goodsType.js
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* 卡密商品(E_COUPON)— 平台端公共常量
|
||||
*
|
||||
* @author Mike
|
||||
* @date 2026-08-02
|
||||
*/
|
||||
export const E_COUPON_GOODS_TYPE = "E_COUPON";
|
||||
|
||||
export function isECoupon(goodsType) {
|
||||
return goodsType === E_COUPON_GOODS_TYPE;
|
||||
}
|
||||
|
||||
export function goodsTypeLabel(goodsType) {
|
||||
const map = {
|
||||
E_COUPON: "电子卡券",
|
||||
VIRTUAL_GOODS: "虚拟商品",
|
||||
PHYSICAL_GOODS: "实物商品",
|
||||
};
|
||||
return map[goodsType] || goodsType || "—";
|
||||
}
|
||||
|
||||
export function goodsTypeTagType(goodsType) {
|
||||
if (goodsType === E_COUPON_GOODS_TYPE) return "warning";
|
||||
if (goodsType === "VIRTUAL_GOODS") return "info";
|
||||
return "";
|
||||
}
|
||||
|
||||
export function eCouponStockHint(goodsType) {
|
||||
if (!isECoupon(goodsType)) return "";
|
||||
return "库存来自卡池同步(quantity)";
|
||||
}
|
||||
|
||||
export function promotionPriceMin(goodsType) {
|
||||
return isECoupon(goodsType) ? 0 : 0.01;
|
||||
}
|
||||
Reference in New Issue
Block a user