### feat: 优化优惠折扣输入组件 (master)
- 将`Input`组件替换为`InputNumber`组件,以确保输入的优惠折扣 在0.1到9.9之间,并支持一位小数。 - 在`full-discount-add.vue`和`full-discount-detail.vue`文件中, 更新了`FormItem`组件的`优惠折扣`输入逻辑。 - 在`coupon-publish.vue`文件中,更新了描述文本以强调输入 范围和格式。 - 在`coupon.vue`文件中,修复了优惠券类型判断逻辑,增加了 "DISCOUNT"类型和未知类型的处理。
This commit is contained in:
parent
376a3223dc
commit
b4a706820e
@ -42,10 +42,11 @@
|
|||||||
:max="9.9"
|
:max="9.9"
|
||||||
:min="0.1"
|
:min="0.1"
|
||||||
:step="0.1"
|
:step="0.1"
|
||||||
|
precision="1"
|
||||||
v-model="form.couponDiscount"
|
v-model="form.couponDiscount"
|
||||||
style="width: 260px">
|
style="width: 260px">
|
||||||
</InputNumber>
|
</InputNumber>
|
||||||
<span class="describe">请输入0-10之间数字,可以输入一位小数</span>
|
<span class="describe">请输入0-10的数字,可有一位小数</span>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="面额" prop="price" v-if="form.couponType == 'PRICE'">
|
<FormItem label="面额" prop="price" v-if="form.couponType == 'PRICE'">
|
||||||
<Input
|
<Input
|
||||||
|
@ -81,14 +81,14 @@
|
|||||||
label="优惠折扣"
|
label="优惠折扣"
|
||||||
prop="fullRate"
|
prop="fullRate"
|
||||||
>
|
>
|
||||||
<Input
|
<InputNumber
|
||||||
type="text"
|
|
||||||
v-model="form.fullRate"
|
|
||||||
placeholder="优惠折扣"
|
placeholder="优惠折扣"
|
||||||
disabled
|
:max="9.9"
|
||||||
clearable
|
:min="0.1"
|
||||||
style="width: 260px"
|
:step="0.1"
|
||||||
/>
|
precision="1"
|
||||||
|
v-model="form.fullRate"
|
||||||
|
style="width: 260px"/>
|
||||||
<span class="describe">优惠折扣为0-10之间数字,可有一位小数</span>
|
<span class="describe">优惠折扣为0-10之间数字,可有一位小数</span>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="额外赠送">
|
<FormItem label="额外赠送">
|
||||||
|
@ -38,10 +38,10 @@
|
|||||||
:max="9.9"
|
:max="9.9"
|
||||||
:min="0.1"
|
:min="0.1"
|
||||||
:step="0.1"
|
:step="0.1"
|
||||||
|
precision="1"
|
||||||
v-model="form.couponDiscount"
|
v-model="form.couponDiscount"
|
||||||
style="width: 260px">
|
style="width: 260px"/>
|
||||||
</InputNumber>
|
<span class="describe">请输入0-10的数字,可有一位小数</span>
|
||||||
<span class="describe">请输入0-10之间数字,可以输入一位小数</span>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="面额" prop="price" v-if="form.couponType == 'PRICE'">
|
<FormItem label="面额" prop="price" v-if="form.couponType == 'PRICE'">
|
||||||
<Input
|
<Input
|
||||||
@ -256,7 +256,6 @@ export default {
|
|||||||
formRule: {
|
formRule: {
|
||||||
promotionName: [{ required: true, message: "活动名称不能为空" }],
|
promotionName: [{ required: true, message: "活动名称不能为空" }],
|
||||||
couponName: [{ required: true, message: "优惠券名称不能为空" }],
|
couponName: [{ required: true, message: "优惠券名称不能为空" }],
|
||||||
couponLimitNum: [{ required: true, message: "领取限制不能为空" }],
|
|
||||||
price: [{ required: true, message: "请输入面额" }, { validator: checkPrice }],
|
price: [{ required: true, message: "请输入面额" }, { validator: checkPrice }],
|
||||||
consumeThreshold: [
|
consumeThreshold: [
|
||||||
{ required: true, message: "请输入消费门槛" },
|
{ required: true, message: "请输入消费门槛" },
|
||||||
|
@ -154,10 +154,12 @@ export default {
|
|||||||
key: "price",
|
key: "price",
|
||||||
width: 100,
|
width: 100,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.price) {
|
if (params.row.couponType === "PRICE") {
|
||||||
return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} );
|
return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} );
|
||||||
} else {
|
} else if(params.row.couponType === "DISCOUNT") {
|
||||||
return h("div", (params.row.couponDiscount || 0) + "折");
|
return h("div", (params.row.couponDiscount || 0) + "折");
|
||||||
|
}else{
|
||||||
|
return h("div", "未知");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -38,8 +38,14 @@
|
|||||||
clearable style="width: 280px" />
|
clearable style="width: 280px" />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem v-if="form.discountType == 'fullRateFlag'" label="优惠折扣" prop="fullRate">
|
<FormItem v-if="form.discountType == 'fullRateFlag'" label="优惠折扣" prop="fullRate">
|
||||||
<Input :disabled="form.promotionStatus != 'NEW'" type="text" v-model="form.fullRate" placeholder="优惠折扣"
|
<InputNumber :disabled="form.promotionStatus != 'NEW'"
|
||||||
clearable style="width: 280px" />
|
placeholder="优惠折扣"
|
||||||
|
:max="9.9"
|
||||||
|
:min="0.1"
|
||||||
|
:step="0.1"
|
||||||
|
precision="1"
|
||||||
|
v-model="form.fullRate"
|
||||||
|
style="width: 260px"/>
|
||||||
<span class="describe">优惠折扣为0-10之间数字,可有一位小数</span>
|
<span class="describe">优惠折扣为0-10之间数字,可有一位小数</span>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="额外赠送">
|
<FormItem label="额外赠送">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user