mirror of
https://github.com/certd/certd.git
synced 2026-08-02 19:10:15 +08:00
perf(trade): 优化商品购买页面的规格展示和折扣计算,支持订单取消
This commit is contained in:
@@ -72,6 +72,7 @@ export default function (): CreateCrudOptionsRet {
|
||||
title: "升级金额",
|
||||
type: "number",
|
||||
form: {
|
||||
show: compute(({ form }) => form.levelType !== "exclusive"),
|
||||
component: { name: PriceInput, vModel: "modelValue", edit: true },
|
||||
rules: [{ required: true, message: "请输入升级金额" }],
|
||||
},
|
||||
@@ -100,7 +101,7 @@ export default function (): CreateCrudOptionsRet {
|
||||
}),
|
||||
form: {
|
||||
value: "normal",
|
||||
helper: "专属等级可由管理员手动指定,不参与普通用户自动升级。",
|
||||
helper: "专属等级可由管理员手动指定,不参与普通用户自动升级。专属等级不会在普通用户端展示。",
|
||||
},
|
||||
column: { width: 120, align: "center" },
|
||||
},
|
||||
|
||||
@@ -23,7 +23,6 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
|
||||
initialForm: {
|
||||
userId: row.userId,
|
||||
levelId: row.levelId,
|
||||
levelLocked: row.levelLocked === true,
|
||||
},
|
||||
columns: {
|
||||
levelId: {
|
||||
@@ -33,20 +32,7 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
|
||||
form: {
|
||||
col: { span: 24 },
|
||||
rules: [{ required: true, message: "请选择推广等级" }],
|
||||
},
|
||||
},
|
||||
levelLocked: {
|
||||
title: "锁定等级",
|
||||
type: "dict-switch",
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: "自动升级", value: false, color: "success" },
|
||||
{ label: "锁定", value: true, color: "warning" },
|
||||
],
|
||||
}),
|
||||
form: {
|
||||
col: { span: 24 },
|
||||
helper: "专属等级会自动锁定,不参与自动升级。",
|
||||
helper: "专属等级将锁定为当前等级,普通等级将按累计推广金额自动升级。",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -80,8 +66,17 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
|
||||
},
|
||||
columns: {
|
||||
userId: { title: "用户ID", type: "number", search: { show: true }, column: { width: 100 } },
|
||||
username: { title: "用户名", type: "text", search: { show: true }, column: { width: 160 } },
|
||||
userDisplay: { title: "显示名称", type: "text", column: { width: 160 } },
|
||||
username: {
|
||||
title: "用户名",
|
||||
type: "text",
|
||||
search: { show: true },
|
||||
column: {
|
||||
width: 180,
|
||||
cellRender({ row }) {
|
||||
return row.simpleUser?.displayName || row.userDisplay || row.username || row.userId;
|
||||
},
|
||||
},
|
||||
},
|
||||
enabled: {
|
||||
title: "开通状态",
|
||||
type: "dict-switch",
|
||||
|
||||
@@ -33,7 +33,8 @@
|
||||
</div>
|
||||
<div class="level-rate-label">佣金比例</div>
|
||||
<div class="level-rate">{{ item.commissionRate || 0 }}%</div>
|
||||
<div class="level-threshold">累计推广 ≥ {{ amountToYuan(item.minAmount) }} 元</div>
|
||||
<div v-if="item.levelType === 'exclusive'" class="level-threshold exclusive-threshold">平台指定专属等级</div>
|
||||
<div v-else class="level-threshold">累计推广 ≥ {{ amountToYuan(item.minAmount) }} 元</div>
|
||||
<div class="level-meta">
|
||||
<a-tag :color="item.disabled ? 'default' : 'success'">{{ item.disabled ? "已禁用" : "已启用" }}</a-tag>
|
||||
<span>排序 {{ item.sort || 0 }}</span>
|
||||
@@ -232,6 +233,10 @@ onActivated(() => {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.exclusive-threshold {
|
||||
color: #8a5a16;
|
||||
}
|
||||
|
||||
.level-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
Reference in New Issue
Block a user