feat: 设置会员明细
This commit is contained in:
parent
7e8cbdb6dd
commit
1a9c11f4ca
|
@ -108,7 +108,9 @@
|
||||||
<el-table-column label="会员权益" align="left">
|
<el-table-column label="会员权益" align="left">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span style="color: #666; line-height: 1.5;">
|
<span style="color: #666; line-height: 1.5;">
|
||||||
{{ generateMemberBenefits(scope.row) }}
|
{{
|
||||||
|
scope.row.benefitsInfo || generateMemberBenefits(scope.row)
|
||||||
|
}}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -184,16 +186,25 @@
|
||||||
<el-switch v-model="scope.row.enableBirthdayCoupons"></el-switch>
|
<el-switch v-model="scope.row.enableBirthdayCoupons"></el-switch>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="生日优惠券操作" width="130" align="center">
|
<el-table-column label="生日优惠券操作" width="150" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<div v-if="scope.row.enableBirthdayCoupons">
|
||||||
v-if="scope.row.enableBirthdayCoupons"
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAddCoupon(scope.row)"
|
@click="handleAddCoupon(scope.row)"
|
||||||
>
|
>
|
||||||
添加优惠券
|
{{
|
||||||
</el-button>
|
scope.row.birthdayCouponsName ? "编辑优惠券" : "添加优惠券"
|
||||||
|
}}
|
||||||
|
</el-button>
|
||||||
|
<div
|
||||||
|
v-if="scope.row.birthdayCouponsName"
|
||||||
|
style="margin-top: 5px; font-size: 12px; color: #666;"
|
||||||
|
>
|
||||||
|
{{ scope.row.birthdayCouponsName }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="开启生日双倍积分" align="center">
|
<el-table-column label="开启生日双倍积分" align="center">
|
||||||
|
@ -203,22 +214,25 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="150" align="center">
|
<el-table-column label="操作" width="150" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<!-- 只有最后一条记录显示操作按钮 -->
|
||||||
type="primary"
|
<div v-if="scope.$index === editLevelData.length - 1">
|
||||||
size="mini"
|
<el-button
|
||||||
@click="handleAddLevel(scope.$index)"
|
type="primary"
|
||||||
style="margin-right: 5px;"
|
size="mini"
|
||||||
>
|
@click="handleAddLevel()"
|
||||||
新增
|
style="margin-right: 5px;"
|
||||||
</el-button>
|
>
|
||||||
<el-button
|
新增
|
||||||
type="danger"
|
</el-button>
|
||||||
size="mini"
|
<el-button
|
||||||
@click="handleDeleteLevel(scope.$index)"
|
type="danger"
|
||||||
:disabled="editLevelData.length <= 1"
|
size="mini"
|
||||||
>
|
@click="handleDeleteLevel(scope.$index)"
|
||||||
删除
|
:disabled="editLevelData.length <= 1"
|
||||||
</el-button>
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -284,32 +298,36 @@
|
||||||
<el-form :model="couponForm" label-width="120px">
|
<el-form :model="couponForm" label-width="120px">
|
||||||
<el-form-item label="优惠券名称" required>
|
<el-form-item label="优惠券名称" required>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="couponForm.name"
|
v-model="couponForm.birthdayCouponsName"
|
||||||
placeholder="生日优惠券"
|
placeholder="生日优惠券"
|
||||||
></el-input>
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="优惠券门槛金额" required>
|
<el-form-item label="优惠券门槛金额" required>
|
||||||
<el-select v-model="couponForm.discountAmount" style="width: 100%">
|
<el-input-number
|
||||||
<el-option label="10元" value="10元"></el-option>
|
v-model="couponForm.birthdayCouponsThreshold"
|
||||||
<el-option label="20元" value="20元"></el-option>
|
:min="0"
|
||||||
<el-option label="50元" value="50元"></el-option>
|
:precision="2"
|
||||||
<el-option label="100元" value="100元"></el-option>
|
style="width: 100%"
|
||||||
</el-select>
|
placeholder="请输入门槛金额"
|
||||||
|
></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="优惠券减免金额" required>
|
<el-form-item label="优惠券减免金额" required>
|
||||||
<el-select v-model="couponForm.minAmount" style="width: 100%">
|
<el-input-number
|
||||||
<el-option label="1元" value="1元"></el-option>
|
v-model="couponForm.birthdayCouponsMinus"
|
||||||
<el-option label="2元" value="2元"></el-option>
|
:min="0"
|
||||||
<el-option label="5元" value="5元"></el-option>
|
:precision="2"
|
||||||
<el-option label="10元" value="10元"></el-option>
|
style="width: 100%"
|
||||||
</el-select>
|
placeholder="请输入减免金额"
|
||||||
|
></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="优惠券有效时间" required>
|
<el-form-item label="优惠券有效时间" required>
|
||||||
<el-select v-model="couponForm.validityPeriod" style="width: 100%">
|
<el-select
|
||||||
<el-option label="7天" value="7天"></el-option>
|
v-model="couponForm.couponsEffectiveTimeType"
|
||||||
<el-option label="15天" value="15天"></el-option>
|
style="width: 100%"
|
||||||
<el-option label="30天" value="30天"></el-option>
|
>
|
||||||
<el-option label="60天" value="60天"></el-option>
|
<el-option label="当天" :value="1"></el-option>
|
||||||
|
<el-option label="7天" :value="2"></el-option>
|
||||||
|
<el-option label="本月" :value="3"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
@ -590,11 +608,12 @@ export default {
|
||||||
showReviewDialog: false,
|
showReviewDialog: false,
|
||||||
// 弹框表单数据
|
// 弹框表单数据
|
||||||
couponForm: {
|
couponForm: {
|
||||||
name: "",
|
birthdayCouponsName: "",
|
||||||
discountAmount: "",
|
birthdayCouponsThreshold: 0,
|
||||||
minAmount: "",
|
birthdayCouponsMinus: 0,
|
||||||
validityPeriod: ""
|
couponsEffectiveTimeType: 1
|
||||||
},
|
},
|
||||||
|
currentEditingLevel: null, // 当前正在编辑优惠券的等级
|
||||||
// 积分任务设置数据(按接口格式)
|
// 积分任务设置数据(按接口格式)
|
||||||
dailySignSettings: {
|
dailySignSettings: {
|
||||||
taskEnable: false,
|
taskEnable: false,
|
||||||
|
@ -649,60 +668,84 @@ export default {
|
||||||
editPointsValidityDays: 365,
|
editPointsValidityDays: 365,
|
||||||
levelDetailData: [
|
levelDetailData: [
|
||||||
{
|
{
|
||||||
|
level: "LV1",
|
||||||
levelName: "LV1",
|
levelName: "LV1",
|
||||||
levelDisplayName: "铜牌会员",
|
levelDisplayName: "铜牌会员",
|
||||||
minGrowthValue: 0,
|
startGrowthValue: 0,
|
||||||
maxGrowthValue: 100,
|
endGrowthValue: 100,
|
||||||
requiredGrowthValue: "100",
|
requiredGrowthValue: "100",
|
||||||
memberCount: "1,250",
|
membershipCount: 1250,
|
||||||
memberBenefits: "新会员双倍积分,享受基础会员价格优惠",
|
memberBenefits: "新会员双倍积分,享受基础会员价格优惠",
|
||||||
enableDiscount: true,
|
enableDiscount: true,
|
||||||
discountRate: 5,
|
discountRate: 5,
|
||||||
enableExchange: false,
|
enablePointsRedemption: false,
|
||||||
enableBirthdayCoupon: true,
|
enableBirthdayCoupons: true,
|
||||||
enableBirthdayPoints: false
|
enableBirthdayReward: false,
|
||||||
|
birthdayCouponsName: "",
|
||||||
|
birthdayCouponsThreshold: 0,
|
||||||
|
birthdayCouponsMinus: 0,
|
||||||
|
couponsEffectiveTimeType: 1,
|
||||||
|
benefitsInfo: ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
level: "LV2",
|
||||||
levelName: "LV2",
|
levelName: "LV2",
|
||||||
levelDisplayName: "银牌会员",
|
levelDisplayName: "银牌会员",
|
||||||
minGrowthValue: 101,
|
startGrowthValue: 101,
|
||||||
maxGrowthValue: 500,
|
endGrowthValue: 500,
|
||||||
requiredGrowthValue: "500",
|
requiredGrowthValue: "500",
|
||||||
memberCount: "850",
|
membershipCount: 850,
|
||||||
memberBenefits: "享受9.5折优惠,每月专属优惠券,生日礼品",
|
memberBenefits: "享受9.5折优惠,每月专属优惠券,生日礼品",
|
||||||
enableDiscount: true,
|
enableDiscount: true,
|
||||||
discountRate: 10,
|
discountRate: 10,
|
||||||
enableExchange: true,
|
enablePointsRedemption: true,
|
||||||
enableBirthdayCoupon: true,
|
enableBirthdayCoupons: true,
|
||||||
enableBirthdayPoints: true
|
enableBirthdayReward: true,
|
||||||
|
birthdayCouponsName: "",
|
||||||
|
birthdayCouponsThreshold: 0,
|
||||||
|
birthdayCouponsMinus: 0,
|
||||||
|
couponsEffectiveTimeType: 1,
|
||||||
|
benefitsInfo: ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
level: "LV3",
|
||||||
levelName: "LV3",
|
levelName: "LV3",
|
||||||
levelDisplayName: "金牌会员",
|
levelDisplayName: "金牌会员",
|
||||||
minGrowthValue: 501,
|
startGrowthValue: 501,
|
||||||
maxGrowthValue: 1200,
|
endGrowthValue: 1200,
|
||||||
requiredGrowthValue: "1,200",
|
requiredGrowthValue: "1,200",
|
||||||
memberCount: "450",
|
membershipCount: 450,
|
||||||
memberBenefits: "享受9折优惠,免费配送服务,专属客服支持",
|
memberBenefits: "享受9折优惠,免费配送服务,专属客服支持",
|
||||||
enableDiscount: true,
|
enableDiscount: true,
|
||||||
discountRate: 15,
|
discountRate: 15,
|
||||||
enableExchange: true,
|
enablePointsRedemption: true,
|
||||||
enableBirthdayCoupon: true,
|
enableBirthdayCoupons: true,
|
||||||
enableBirthdayPoints: true
|
enableBirthdayReward: true,
|
||||||
|
birthdayCouponsName: "",
|
||||||
|
birthdayCouponsThreshold: 0,
|
||||||
|
birthdayCouponsMinus: 0,
|
||||||
|
couponsEffectiveTimeType: 1,
|
||||||
|
benefitsInfo: ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
level: "LV4",
|
||||||
levelName: "LV4",
|
levelName: "LV4",
|
||||||
levelDisplayName: "钻石会员",
|
levelDisplayName: "钻石会员",
|
||||||
minGrowthValue: 1201,
|
startGrowthValue: 1201,
|
||||||
maxGrowthValue: 9999,
|
endGrowthValue: 9999,
|
||||||
requiredGrowthValue: "2,500",
|
requiredGrowthValue: "2,500",
|
||||||
memberCount: "180",
|
membershipCount: 180,
|
||||||
memberBenefits: "享受8.5折优惠,优先配送,专属活动邀请,年度礼品",
|
memberBenefits: "享受8.5折优惠,优先配送,专属活动邀请,年度礼品",
|
||||||
enableDiscount: true,
|
enableDiscount: true,
|
||||||
discountRate: 20,
|
discountRate: 20,
|
||||||
enableExchange: true,
|
enablePointsRedemption: true,
|
||||||
enableBirthdayCoupon: true,
|
enableBirthdayCoupons: true,
|
||||||
enableBirthdayPoints: true
|
enableBirthdayReward: true,
|
||||||
|
birthdayCouponsName: "",
|
||||||
|
birthdayCouponsThreshold: 0,
|
||||||
|
birthdayCouponsMinus: 0,
|
||||||
|
couponsEffectiveTimeType: 1,
|
||||||
|
benefitsInfo: ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
editLevelData: [],
|
editLevelData: [],
|
||||||
|
@ -725,6 +768,12 @@ export default {
|
||||||
if (this.shopId && this.shopName && !this.isBatchMode) {
|
if (this.shopId && this.shopName && !this.isBatchMode) {
|
||||||
this.isEditMode = false; // 默认进入查看模式
|
this.isEditMode = false; // 默认进入查看模式
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 为现有数据生成会员权益信息
|
||||||
|
this.levelDetailData = this.levelDetailData.map(level => ({
|
||||||
|
...level,
|
||||||
|
benefitsInfo: level.benefitsInfo || this.generateMemberBenefits(level)
|
||||||
|
}));
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.isBatchMode) {
|
if (this.isBatchMode) {
|
||||||
|
@ -759,7 +808,8 @@ export default {
|
||||||
birthdayCouponsMinus: 0,
|
birthdayCouponsMinus: 0,
|
||||||
couponsEffectiveTimeType: 1,
|
couponsEffectiveTimeType: 1,
|
||||||
enableBirthdayReward: false,
|
enableBirthdayReward: false,
|
||||||
membershipCount: 0
|
membershipCount: 0,
|
||||||
|
benefitsInfo: ""
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
@ -794,11 +844,12 @@ export default {
|
||||||
|
|
||||||
// 重置表单数据
|
// 重置表单数据
|
||||||
this.couponForm = {
|
this.couponForm = {
|
||||||
name: "",
|
birthdayCouponsName: "",
|
||||||
discountAmount: "",
|
birthdayCouponsThreshold: 0,
|
||||||
minAmount: "",
|
birthdayCouponsMinus: 0,
|
||||||
validityPeriod: ""
|
couponsEffectiveTimeType: 1
|
||||||
};
|
};
|
||||||
|
this.currentEditingLevel = null;
|
||||||
|
|
||||||
// 重置积分任务设置数据
|
// 重置积分任务设置数据
|
||||||
this.dailySignSettings = {
|
this.dailySignSettings = {
|
||||||
|
@ -915,7 +966,8 @@ export default {
|
||||||
birthdayCouponsMinus: level.birthdayCouponsMinus || 0,
|
birthdayCouponsMinus: level.birthdayCouponsMinus || 0,
|
||||||
couponsEffectiveTimeType: level.couponsEffectiveTimeType || 1,
|
couponsEffectiveTimeType: level.couponsEffectiveTimeType || 1,
|
||||||
enableBirthdayReward: level.enableBirthdayReward,
|
enableBirthdayReward: level.enableBirthdayReward,
|
||||||
membershipCount: level.membershipCount || 0
|
membershipCount: level.membershipCount || 0,
|
||||||
|
benefitsInfo: level.benefitsInfo || ""
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
// 如果没有等级设置列表,查看模式下不显示数据
|
// 如果没有等级设置列表,查看模式下不显示数据
|
||||||
|
@ -950,19 +1002,23 @@ export default {
|
||||||
generateMemberBenefits(level) {
|
generateMemberBenefits(level) {
|
||||||
const benefits = [];
|
const benefits = [];
|
||||||
|
|
||||||
|
// 会员折扣权益
|
||||||
if (level.enableDiscount && level.discountRate) {
|
if (level.enableDiscount && level.discountRate) {
|
||||||
const discount = (100 - level.discountRate) / 10;
|
const discount = (100 - level.discountRate) / 10;
|
||||||
benefits.push(`享受${discount}折优惠`);
|
benefits.push(`享受${discount}折优惠`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 积分兑换权益
|
||||||
if (level.enablePointsRedemption) {
|
if (level.enablePointsRedemption) {
|
||||||
benefits.push("积分兑换商品");
|
benefits.push("积分兑换商品");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 生日优惠券权益
|
||||||
if (level.enableBirthdayCoupons) {
|
if (level.enableBirthdayCoupons) {
|
||||||
benefits.push("生日专属优惠券");
|
benefits.push("有生日优惠券");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 生日双倍积分权益
|
||||||
if (level.enableBirthdayReward) {
|
if (level.enableBirthdayReward) {
|
||||||
benefits.push("生日双倍积分");
|
benefits.push("生日双倍积分");
|
||||||
}
|
}
|
||||||
|
@ -990,7 +1046,8 @@ export default {
|
||||||
birthdayCouponsMinus: level.birthdayCouponsMinus,
|
birthdayCouponsMinus: level.birthdayCouponsMinus,
|
||||||
couponsEffectiveTimeType: level.couponsEffectiveTimeType,
|
couponsEffectiveTimeType: level.couponsEffectiveTimeType,
|
||||||
enableBirthdayReward: level.enableBirthdayReward,
|
enableBirthdayReward: level.enableBirthdayReward,
|
||||||
membershipCount: level.membershipCount
|
membershipCount: level.membershipCount,
|
||||||
|
benefitsInfo: this.generateMemberBenefits(level)
|
||||||
})),
|
})),
|
||||||
dailySignSettings: {
|
dailySignSettings: {
|
||||||
...this.dailySignSettings,
|
...this.dailySignSettings,
|
||||||
|
@ -1136,18 +1193,51 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
handleSaveEdit() {
|
handleSaveEdit() {
|
||||||
// 保存编辑的数据
|
// 保存编辑的数据,并为每个等级生成会员权益信息
|
||||||
this.levelDetailData = JSON.parse(JSON.stringify(this.editLevelData));
|
this.levelDetailData = JSON.parse(JSON.stringify(this.editLevelData)).map(
|
||||||
|
level => ({
|
||||||
|
...level,
|
||||||
|
benefitsInfo: this.generateMemberBenefits(level)
|
||||||
|
})
|
||||||
|
);
|
||||||
this.pointsValidityDays = this.editPointsValidityDays;
|
this.pointsValidityDays = this.editPointsValidityDays;
|
||||||
|
|
||||||
|
// 更新积分任务的启用状态:将 isEnabled 映射到 taskEnable
|
||||||
|
this.updateTaskEnableStatus();
|
||||||
|
|
||||||
this.isEditMode = false;
|
this.isEditMode = false;
|
||||||
|
|
||||||
// 调用保存接口
|
// 调用保存接口
|
||||||
this.saveSettingsData();
|
this.saveSettingsData();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 更新积分任务的启用状态:将 isEnabled 映射到 taskEnable
|
||||||
|
updateTaskEnableStatus() {
|
||||||
|
if (this.editPointsTaskData && this.editPointsTaskData.length > 0) {
|
||||||
|
this.editPointsTaskData.forEach(task => {
|
||||||
|
switch (task.taskName) {
|
||||||
|
case "每日签到":
|
||||||
|
this.dailySignSettings.taskEnable = task.isEnabled;
|
||||||
|
break;
|
||||||
|
case "浏览商品":
|
||||||
|
this.viewGoodsSettings.taskEnable = task.isEnabled;
|
||||||
|
break;
|
||||||
|
case "购买商品":
|
||||||
|
this.buyGoodsSettings.taskEnable = task.isEnabled;
|
||||||
|
break;
|
||||||
|
case "分享商品":
|
||||||
|
this.shareGoodsSettings.taskEnable = task.isEnabled;
|
||||||
|
break;
|
||||||
|
case "评价商品":
|
||||||
|
this.commentGoodsSettings.taskEnable = task.isEnabled;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 新增会员等级
|
// 新增会员等级
|
||||||
handleAddLevel(index) {
|
handleAddLevel() {
|
||||||
// 创建新的等级数据
|
// 创建新的等级数据
|
||||||
const newLevel = {
|
const newLevel = {
|
||||||
level: `LV${this.editLevelData.length + 1}`,
|
level: `LV${this.editLevelData.length + 1}`,
|
||||||
|
@ -1163,12 +1253,12 @@ export default {
|
||||||
birthdayCouponsMinus: 0,
|
birthdayCouponsMinus: 0,
|
||||||
couponsEffectiveTimeType: 1,
|
couponsEffectiveTimeType: 1,
|
||||||
enableBirthdayReward: false,
|
enableBirthdayReward: false,
|
||||||
membershipCount: 0
|
membershipCount: 0,
|
||||||
|
benefitsInfo: ""
|
||||||
};
|
};
|
||||||
|
|
||||||
// 在指定位置后插入新等级
|
// 总是在最后添加新等级
|
||||||
this.editLevelData.splice(index + 1, 0, newLevel);
|
this.editLevelData.push(newLevel);
|
||||||
this.$message.success("新增等级成功");
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 删除会员等级
|
// 删除会员等级
|
||||||
|
@ -1185,20 +1275,22 @@ export default {
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.editLevelData.splice(index, 1);
|
this.editLevelData.splice(index, 1);
|
||||||
this.$message.success("删除等级成功");
|
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
// 用户取消删除
|
// 用户取消删除
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
handleAddCoupon() {
|
handleAddCoupon(level) {
|
||||||
|
this.currentEditingLevel = level;
|
||||||
this.showCouponDialog = true;
|
this.showCouponDialog = true;
|
||||||
|
|
||||||
|
// 如果等级已有优惠券配置,则回显数据
|
||||||
this.couponForm = {
|
this.couponForm = {
|
||||||
name: "生日优惠券",
|
birthdayCouponsName: level.birthdayCouponsName || "生日优惠券",
|
||||||
discountAmount: "10元",
|
birthdayCouponsThreshold: level.birthdayCouponsThreshold || 0,
|
||||||
minAmount: "1元",
|
birthdayCouponsMinus: level.birthdayCouponsMinus || 0,
|
||||||
validityPeriod: "请选择有效时间"
|
couponsEffectiveTimeType: level.couponsEffectiveTimeType || 1
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1270,8 +1362,40 @@ export default {
|
||||||
|
|
||||||
// 保存弹框数据
|
// 保存弹框数据
|
||||||
saveCouponForm() {
|
saveCouponForm() {
|
||||||
// this.$message.success("优惠券添加成功");
|
// 验证表单数据
|
||||||
|
if (!this.couponForm.birthdayCouponsName) {
|
||||||
|
this.$message.error("请输入优惠券名称");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
!this.couponForm.birthdayCouponsThreshold &&
|
||||||
|
this.couponForm.birthdayCouponsThreshold !== 0
|
||||||
|
) {
|
||||||
|
this.$message.error("请输入优惠券门槛金额");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
!this.couponForm.birthdayCouponsMinus &&
|
||||||
|
this.couponForm.birthdayCouponsMinus !== 0
|
||||||
|
) {
|
||||||
|
this.$message.error("请输入优惠券减免金额");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.couponForm.couponsEffectiveTimeType) {
|
||||||
|
this.$message.error("请选择优惠券有效时间");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将优惠券数据设置到当前等级对象中
|
||||||
|
if (this.currentEditingLevel) {
|
||||||
|
this.currentEditingLevel.birthdayCouponsName = this.couponForm.birthdayCouponsName;
|
||||||
|
this.currentEditingLevel.birthdayCouponsThreshold = this.couponForm.birthdayCouponsThreshold;
|
||||||
|
this.currentEditingLevel.birthdayCouponsMinus = this.couponForm.birthdayCouponsMinus;
|
||||||
|
this.currentEditingLevel.couponsEffectiveTimeType = this.couponForm.couponsEffectiveTimeType;
|
||||||
|
}
|
||||||
|
|
||||||
this.showCouponDialog = false;
|
this.showCouponDialog = false;
|
||||||
|
this.currentEditingLevel = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
saveSignInForm() {
|
saveSignInForm() {
|
||||||
|
|
Loading…
Reference in New Issue