|
@@ -11,7 +11,7 @@ import {
|
|
|
pauseActivity,
|
|
pauseActivity,
|
|
|
resumeActivity
|
|
resumeActivity
|
|
|
} from "@/api/activity";
|
|
} from "@/api/activity";
|
|
|
-import type { PaginationProps, TableColumnList } from "@pureadmin/table";
|
|
|
|
|
|
|
+import type { PaginationProps } from "@pureadmin/table";
|
|
|
import { deviceDetection } from "@pureadmin/utils";
|
|
import { deviceDetection } from "@pureadmin/utils";
|
|
|
import { onMounted, reactive, ref, toRaw } from "vue";
|
|
import { onMounted, reactive, ref, toRaw } from "vue";
|
|
|
import {
|
|
import {
|
|
@@ -63,14 +63,16 @@ export function useActivity() {
|
|
|
{ id: 3, name: "新人专享10元券", discountValue: 10 }
|
|
{ id: 3, name: "新人专享10元券", discountValue: 10 }
|
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
- const typeMap: Record<number, { text: string; type: string; color: string }> = {
|
|
|
|
|
|
|
+ type TagType = "success" | "primary" | "warning" | "info" | "danger";
|
|
|
|
|
+
|
|
|
|
|
+ const typeMap: Record<number, { text: string; type: TagType; color: string }> = {
|
|
|
1: { text: "首单立减", type: "primary", color: "#409EFF" },
|
|
1: { text: "首单立减", type: "primary", color: "#409EFF" },
|
|
|
2: { text: "优惠折扣", type: "success", color: "#67C23A" },
|
|
2: { text: "优惠折扣", type: "success", color: "#67C23A" },
|
|
|
3: { text: "商品满减", type: "warning", color: "#E6A23C" },
|
|
3: { text: "商品满减", type: "warning", color: "#E6A23C" },
|
|
|
4: { text: "邀请有礼", type: "danger", color: "#F56C6C" }
|
|
4: { text: "邀请有礼", type: "danger", color: "#F56C6C" }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const statusMap: Record<number, { text: string; type: string }> = {
|
|
|
|
|
|
|
+ const statusMap: Record<number, { text: string; type: TagType }> = {
|
|
|
0: { text: "草稿", type: "info" },
|
|
0: { text: "草稿", type: "info" },
|
|
|
1: { text: "已发布", type: "primary" },
|
|
1: { text: "已发布", type: "primary" },
|
|
|
2: { text: "进行中", type: "success" },
|
|
2: { text: "进行中", type: "success" },
|
|
@@ -78,17 +80,17 @@ export function useActivity() {
|
|
|
4: { text: "已结束", type: "info" }
|
|
4: { text: "已结束", type: "info" }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const applyScopeMap: Record<number, { text: string; type: string }> = {
|
|
|
|
|
|
|
+ const applyScopeMap: Record<number, { text: string; type: TagType }> = {
|
|
|
1: { text: "全部门店", type: "primary" },
|
|
1: { text: "全部门店", type: "primary" },
|
|
|
2: { text: "指定门店", type: "warning" }
|
|
2: { text: "指定门店", type: "warning" }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const deviceScopeMap: Record<number, { text: string; type: string }> = {
|
|
|
|
|
|
|
+ const deviceScopeMap: Record<number, { text: string; type: TagType }> = {
|
|
|
1: { text: "全部设备", type: "primary" },
|
|
1: { text: "全部设备", type: "primary" },
|
|
|
2: { text: "指定设备", type: "warning" }
|
|
2: { text: "指定设备", type: "warning" }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const productScopeMap: Record<number, { text: string; type: string }> = {
|
|
|
|
|
|
|
+ const productScopeMap: Record<number, { text: string; type: TagType }> = {
|
|
|
1: { text: "全部商品", type: "primary" },
|
|
1: { text: "全部商品", type: "primary" },
|
|
|
2: { text: "指定商品", type: "warning" }
|
|
2: { text: "指定商品", type: "warning" }
|
|
|
};
|
|
};
|
|
@@ -675,7 +677,7 @@ export function useActivity() {
|
|
|
<div>
|
|
<div>
|
|
|
<ElForm label-width="80px" size="default">
|
|
<ElForm label-width="80px" size="default">
|
|
|
<ElFormItem label="立减金额" required>
|
|
<ElFormItem label="立减金额" required>
|
|
|
- <ElInputNumber v-model={formData.discountValue} min={0.01} precision={2} class="w-full" placeholder="首单立减金额" prefix="¥" />
|
|
|
|
|
|
|
+ <ElInputNumber v-model={formData.discountValue} min={0.01} precision={2} class="w-full" placeholder="首单立减金额" />
|
|
|
</ElFormItem>
|
|
</ElFormItem>
|
|
|
</ElForm>
|
|
</ElForm>
|
|
|
<div class="discount-preview">
|
|
<div class="discount-preview">
|
|
@@ -694,7 +696,7 @@ export function useActivity() {
|
|
|
<ElInputNumber v-model={formData.discountValue} min={0.1} max={1} step={0.1} precision={1} class="w-full" placeholder="如 0.8 表示 8 折" />
|
|
<ElInputNumber v-model={formData.discountValue} min={0.1} max={1} step={0.1} precision={1} class="w-full" placeholder="如 0.8 表示 8 折" />
|
|
|
</ElFormItem>
|
|
</ElFormItem>
|
|
|
<ElFormItem label="最大优惠">
|
|
<ElFormItem label="最大优惠">
|
|
|
- <ElInputNumber v-model={formData.maxDiscount} min={0} precision={2} class="w-full" placeholder="可选" prefix="¥" />
|
|
|
|
|
|
|
+ <ElInputNumber v-model={formData.maxDiscount} min={0} precision={2} class="w-full" placeholder="可选" />
|
|
|
</ElFormItem>
|
|
</ElFormItem>
|
|
|
</div>
|
|
</div>
|
|
|
</ElForm>
|
|
</ElForm>
|
|
@@ -711,10 +713,10 @@ export function useActivity() {
|
|
|
<ElForm label-width="80px" size="default">
|
|
<ElForm label-width="80px" size="default">
|
|
|
<div class="form-grid-2">
|
|
<div class="form-grid-2">
|
|
|
<ElFormItem label="满减门槛" required>
|
|
<ElFormItem label="满减门槛" required>
|
|
|
- <ElInputNumber v-model={formData.minAmount} min={0} precision={2} class="w-full" placeholder="订单满多少" prefix="¥" />
|
|
|
|
|
|
|
+ <ElInputNumber v-model={formData.minAmount} min={0} precision={2} class="w-full" placeholder="订单满多少" />
|
|
|
</ElFormItem>
|
|
</ElFormItem>
|
|
|
<ElFormItem label="减免金额" required>
|
|
<ElFormItem label="减免金额" required>
|
|
|
- <ElInputNumber v-model={formData.discountValue} min={0.01} precision={2} class="w-full" placeholder="减免金额" prefix="¥" />
|
|
|
|
|
|
|
+ <ElInputNumber v-model={formData.discountValue} min={0.01} precision={2} class="w-full" placeholder="减免金额" />
|
|
|
</ElFormItem>
|
|
</ElFormItem>
|
|
|
</div>
|
|
</div>
|
|
|
</ElForm>
|
|
</ElForm>
|