feat: diy editor property
This commit is contained in:
@@ -23,7 +23,7 @@ export const CouponDiscountDesc = defineComponent({
|
|||||||
const discountDesc =
|
const discountDesc =
|
||||||
coupon.discountType === PromotionDiscountTypeEnum.PRICE.type
|
coupon.discountType === PromotionDiscountTypeEnum.PRICE.type
|
||||||
? `减${floatToFixed2(coupon.discountPrice)}元`
|
? `减${floatToFixed2(coupon.discountPrice)}元`
|
||||||
: `打${coupon.discountPercent ?? 0 / 10}折`;
|
: `打${(coupon.discountPercent ?? 0) / 10}折`;
|
||||||
return () => (
|
return () => (
|
||||||
<div>
|
<div>
|
||||||
<span>{useCondition}</span>
|
<span>{useCondition}</span>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export const CouponDiscount = defineComponent({
|
|||||||
setup(props) {
|
setup(props) {
|
||||||
const coupon = props.coupon as MallCouponTemplateApi.CouponTemplate;
|
const coupon = props.coupon as MallCouponTemplateApi.CouponTemplate;
|
||||||
// 折扣
|
// 折扣
|
||||||
let value = `${coupon.discountPercent ?? 0 / 10}`;
|
let value = `${(coupon.discountPercent ?? 0) / 10}`;
|
||||||
let suffix = ' 折';
|
let suffix = ' 折';
|
||||||
// 满减
|
// 满减
|
||||||
if (coupon.discountType === PromotionDiscountTypeEnum.PRICE.type) {
|
if (coupon.discountType === PromotionDiscountTypeEnum.PRICE.type) {
|
||||||
|
|||||||
@@ -40,8 +40,6 @@ const props = defineProps<{ modelValue: CouponCardProperty }>();
|
|||||||
|
|
||||||
const emit = defineEmits(['update:modelValue']);
|
const emit = defineEmits(['update:modelValue']);
|
||||||
|
|
||||||
const { Text: ATypographyText } = Typography;
|
|
||||||
|
|
||||||
const formData = useVModel(props, 'modelValue', emit);
|
const formData = useVModel(props, 'modelValue', emit);
|
||||||
|
|
||||||
const couponList = ref<MallCouponTemplateApi.CouponTemplate[]>([]); // 已选择的优惠券列表
|
const couponList = ref<MallCouponTemplateApi.CouponTemplate[]>([]); // 已选择的优惠券列表
|
||||||
@@ -90,22 +88,24 @@ watch(
|
|||||||
:key="index"
|
:key="index"
|
||||||
class="flex items-center justify-between"
|
class="flex items-center justify-between"
|
||||||
>
|
>
|
||||||
<ATypographyText ellipsis class="text-base">
|
<Typography>
|
||||||
{{ coupon.name }}
|
<Typography.Title :level="5">
|
||||||
</ATypographyText>
|
{{ coupon.name }}
|
||||||
<ATypographyText type="secondary" ellipsis>
|
</Typography.Title>
|
||||||
<span v-if="coupon.usePrice > 0">
|
<Typography.Text type="secondary">
|
||||||
满{{ floatToFixed2(coupon.usePrice) }}元,
|
<span v-if="coupon.usePrice > 0">
|
||||||
</span>
|
满{{ floatToFixed2(coupon.usePrice) }}元,
|
||||||
<span
|
</span>
|
||||||
v-if="
|
<span
|
||||||
coupon.discountType === PromotionDiscountTypeEnum.PRICE.type
|
v-if="
|
||||||
"
|
coupon.discountType === PromotionDiscountTypeEnum.PRICE.type
|
||||||
>
|
"
|
||||||
减{{ floatToFixed2(coupon.discountPrice) }}元
|
>
|
||||||
</span>
|
减{{ floatToFixed2(coupon.discountPrice) }}元
|
||||||
<span v-else> 打{{ coupon.discountPercent }}折 </span>
|
</span>
|
||||||
</ATypographyText>
|
<span v-else> 打{{ (coupon.discountPercent ?? 0) / 10 }}折 </span>
|
||||||
|
</Typography.Text>
|
||||||
|
</Typography>
|
||||||
</div>
|
</div>
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<Button
|
<Button
|
||||||
@@ -114,9 +114,7 @@ watch(
|
|||||||
ghost
|
ghost
|
||||||
class="mt-2 w-full"
|
class="mt-2 w-full"
|
||||||
>
|
>
|
||||||
<template #icon>
|
<IconifyIcon icon="lucide:plus" />
|
||||||
<IconifyIcon icon="ep:plus" />
|
|
||||||
</template>
|
|
||||||
添加
|
添加
|
||||||
</Button>
|
</Button>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
@@ -126,17 +124,26 @@ watch(
|
|||||||
<RadioGroup v-model:value="formData.columns">
|
<RadioGroup v-model:value="formData.columns">
|
||||||
<Tooltip title="一列" placement="bottom">
|
<Tooltip title="一列" placement="bottom">
|
||||||
<RadioButton :value="1">
|
<RadioButton :value="1">
|
||||||
<IconifyIcon icon="fluent:text-column-one-24-filled" />
|
<IconifyIcon
|
||||||
|
icon="fluent:text-column-one-24-filled"
|
||||||
|
class="size-6"
|
||||||
|
/>
|
||||||
</RadioButton>
|
</RadioButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip title="二列" placement="bottom">
|
<Tooltip title="二列" placement="bottom">
|
||||||
<RadioButton :value="2">
|
<RadioButton :value="2">
|
||||||
<IconifyIcon icon="fluent:text-column-two-24-filled" />
|
<IconifyIcon
|
||||||
|
icon="fluent:text-column-two-24-filled"
|
||||||
|
class="size-6"
|
||||||
|
/>
|
||||||
</RadioButton>
|
</RadioButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip title="三列" placement="bottom">
|
<Tooltip title="三列" placement="bottom">
|
||||||
<RadioButton :value="3">
|
<RadioButton :value="3">
|
||||||
<IconifyIcon icon="fluent:text-column-three-24-filled" />
|
<IconifyIcon
|
||||||
|
icon="fluent:text-column-three-24-filled"
|
||||||
|
class="size-6"
|
||||||
|
/>
|
||||||
</RadioButton>
|
</RadioButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user