mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-06-23 10:30:26 +08:00
- 在 global-layout.scss 中引入全局布局样式,统一页面宽度与对齐方式 - 更新多个组件与页面以优化响应式,包括宽度、间距及 flex 布局等调整 - 在 API 请求中增加 loading 状态管理,改善用户体验 - 优化领券中心与商品详情页,提升功能与 UI 一致性
111 lines
2.4 KiB
JavaScript
111 lines
2.4 KiB
JavaScript
|
||
export function promotionsStatusRender(h, params) {
|
||
let text = "未知",
|
||
color = "red";
|
||
if (params.row.promotionStatus == "NEW") {
|
||
text = "未开始";
|
||
color = "geekblue";
|
||
} else if (params.row.promotionStatus == "START") {
|
||
text = "已开始";
|
||
color = "green";
|
||
} else if (params.row.promotionStatus == "END") {
|
||
text = "已结束";
|
||
color = "red";
|
||
} else if (params.row.promotionStatus == "CLOSE") {
|
||
text = "已关闭";
|
||
color = "red";
|
||
}
|
||
return h("div", [
|
||
h(
|
||
"Tag",
|
||
{
|
||
props: {
|
||
color: color,
|
||
},
|
||
},
|
||
text
|
||
),
|
||
]);
|
||
}
|
||
|
||
export function promotionsScopeTypeRender(h, params) {
|
||
let text = "未知",
|
||
color = "red";
|
||
if (params.row.scopeType == "ALL") {
|
||
text = "全品类";
|
||
color = "default";
|
||
} else if (params.row.scopeType == "PORTION_GOODS_CATEGORY") {
|
||
text = "商品分类";
|
||
color = "yellow";
|
||
} else if (params.row.scopeType == "PORTION_SHOP_CATEGORY") {
|
||
text = "店铺分类";
|
||
color = "pink";
|
||
} else if (params.row.scopeType == "PORTION_GOODS") {
|
||
text = "指定商品";
|
||
color = "magenta";
|
||
}
|
||
return h("div", [
|
||
h(
|
||
"Tag",
|
||
{
|
||
props: {
|
||
color: color,
|
||
},
|
||
},
|
||
text
|
||
),
|
||
]);
|
||
}
|
||
|
||
export function memberPromotionsStatusRender(h, status) {
|
||
let text = "未知",
|
||
color = "red";
|
||
if (status == "NEW") {
|
||
text = "已领取";
|
||
color = "geekblue";
|
||
} else if (status == "USED") {
|
||
text = "已使用";
|
||
color = "green";
|
||
} else if (status == "EXPIRE") {
|
||
text = "已过期";
|
||
color = "red";
|
||
} else if (status == "CLOSED") {
|
||
text = "已作废";
|
||
color = "red";
|
||
}
|
||
return h("div", [
|
||
h(
|
||
"Tag",
|
||
{
|
||
props: {
|
||
color: color,
|
||
},
|
||
},
|
||
text
|
||
),
|
||
]);
|
||
}
|
||
|
||
/**
|
||
* 优惠券「活动时间 / 有效期」文案(活动获取券:effectiveDays 为领取后有效天数)
|
||
*/
|
||
export function formatPromotionCouponValidityHtml(row) {
|
||
if (!row) return "-";
|
||
if (row.getType === "ACTIVITY") {
|
||
const days = row.effectiveDays;
|
||
if (days !== undefined && days !== null && days !== "") {
|
||
const n = Number(days);
|
||
if (!Number.isNaN(n) && n > 0) {
|
||
return `领取后${n}天有效`;
|
||
}
|
||
}
|
||
}
|
||
if (row.startTime && row.endTime) {
|
||
return `${row.startTime}<br/>${row.endTime}`;
|
||
}
|
||
if (row.getType === "ACTIVITY" && row.rangeDayType === "DYNAMICTIME") {
|
||
return "长期有效";
|
||
}
|
||
return "-";
|
||
}
|