feat: 分组追加商品修复

This commit is contained in:
duan
2025-03-18 16:04:30 +08:00
parent 14d3ffb4cf
commit 188aad8035
6 changed files with 17 additions and 35 deletions

View File

@@ -3,33 +3,21 @@
<el-dialog :title="form.id ? '编辑活动' : '添加活动'" v-model="dialogVisible" @close="reset">
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="left">
<el-form-item label="充值">
<el-input
style="width: 220px"
placeholder="请输入金额"
v-model="form.amount"
@input="(v) => (form.amount = v.replace(/^(0+)|[^\d]+/g, ''))"
>
<el-input style="width: 220px" placeholder="请输入金额" v-model="form.amount"
@input="(v) => (form.amount = v.replace(/^(0+)|[^\d]+/g, ''))">
<template #prepend></template>
<template #append></template>
</el-input>
</el-form-item>
<el-form-item label="赠送">
<div style="display: flex">
<el-input
style="width: 220px"
placeholder="请输入金额"
v-model="form.giftAmount"
@input="(v) => (form.giftAmount = v.replace(/^(0+)|[^\d]+/g, ''))"
>
<el-input style="width: 220px" placeholder="请输入金额" v-model="form.giftAmount"
@input="(v) => (form.giftAmount = v.replace(/^(0+)|[^\d]+/g, ''))">
<template #prepend></template>
<template #append></template>
</el-input>
<el-input
style="margin-left: 20px; width: 220px"
placeholder="请输入金额"
v-model="form.giftPoints"
@input="(v) => (form.giftPoints = v.replace(/^(0+)|[^\d]+/g, ''))"
>
<el-input style="margin-left: 20px; width: 220px" placeholder="请输入金额" v-model="form.giftPoints"
@input="(v) => (form.giftPoints = v.replace(/^(0+)|[^\d]+/g, ''))">
<template #prepend></template>
<template #append>积分</template>
</el-input>
@@ -43,21 +31,13 @@
</el-form-item>
<el-form-item label="选择优惠劵" v-if="form.isGiftCoupon == 1">
<div>
<el-button
type="primary"
icon="el-icon-plus"
@click="$refs.coupon.show([...productIds])"
>
<el-button type="primary" icon="el-icon-plus" @click="$refs.coupon.show([...productIds])">
添加优惠劵
</el-button>
</div>
<div class="shop_list">
<div
class="item_wrap"
style="display: flex; align-items: center; margin-top: 6px"
v-for="(item, index) in productIds"
:key="index"
>
<div class="item_wrap" style="display: flex; align-items: center; margin-top: 6px"
v-for="(item, index) in productIds" :key="index">
<div class="name">{{ item.title }}</div>
<el-button type="text" @click="productIds = []" style="margin-left: 20px">
@@ -216,7 +196,6 @@ export default {
if (obj.couponId) {
this.productIds = [{ title: obj.couponName, id: obj.couponId }];
}
console.log(obj, "调试1");
}
},
close() {