Compare commits

...

2 Commits

Author SHA1 Message Date
lzhizhao 919ec0710b feat: 会员等级配置 2025-08-09 22:34:23 +08:00
lzhizhao 1a9c11f4ca feat: 设置会员明细 2025-08-09 22:01:34 +08:00
1 changed files with 454 additions and 115 deletions

View File

@ -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">
<div v-if="scope.row.enableBirthdayCoupons">
<el-button <el-button
v-if="scope.row.enableBirthdayCoupons"
type="primary" type="primary"
size="mini" size="mini"
@click="handleAddCoupon(scope.row)" @click="handleAddCoupon(scope.row)"
> >
添加优惠券 {{
scope.row.birthdayCouponsName ? "编辑优惠券" : "添加优惠券"
}}
</el-button> </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,10 +214,12 @@
</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">
<!-- 只有最后一条记录显示操作按钮 -->
<div v-if="scope.$index === editLevelData.length - 1">
<el-button <el-button
type="primary" type="primary"
size="mini" size="mini"
@click="handleAddLevel(scope.$index)" @click="handleAddLevel()"
style="margin-right: 5px;" style="margin-right: 5px;"
> >
新增 新增
@ -219,6 +232,7 @@
> >
删除 删除
</el-button> </el-button>
</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -249,11 +263,7 @@
align="center" align="center"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="taskDesc" label="任务描述" align="center">
prop="taskDescription"
label="任务描述"
align="center"
>
</el-table-column> </el-table-column>
<el-table-column label="是否启用" width="100" align="center"> <el-table-column label="是否启用" width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@ -284,32 +294,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 +604,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 +664,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 +764,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 +804,8 @@ export default {
birthdayCouponsMinus: 0, birthdayCouponsMinus: 0,
couponsEffectiveTimeType: 1, couponsEffectiveTimeType: 1,
enableBirthdayReward: false, enableBirthdayReward: false,
membershipCount: 0 membershipCount: 0,
benefitsInfo: ""
} }
]; ];
}, },
@ -794,11 +840,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 +962,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 +998,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 +1042,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 +1189,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 +1249,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,28 +1271,77 @@ 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
}; };
}, },
//
isTaskConfigEmpty(taskSettings) {
if (!taskSettings || !taskSettings.taskConfigDetail) {
return true;
}
const config = taskSettings.taskConfigDetail;
// 0
//
if (config.hasOwnProperty("oneDay")) {
return (
!config.oneDay &&
!config.twoDay &&
!config.threeDay &&
!config.fourDay &&
!config.fiveDay &&
!config.sixDay &&
!config.sevenDay
);
}
//
if (config.hasOwnProperty("oneGoodsViewPoints")) {
return !config.oneGoodsViewPoints;
}
//
if (config.hasOwnProperty("pointsRatioAmount")) {
return !config.pointsRatioAmount;
}
//
if (config.hasOwnProperty("oneSharePoints")) {
return !config.oneSharePoints;
}
//
if (config.hasOwnProperty("textCommentPoints")) {
return !config.textCommentPoints && !config.imageTextCommentPoints;
}
// 0
const values = Object.values(config);
return values.every(value => !value || value === 0);
},
// //
handleEditSignIn() { handleEditSignIn() {
this.showSignInDialog = true; this.showSignInDialog = true;
// ID //
if (!this.recordId) { if (this.isTaskConfigEmpty(this.dailySignSettings)) {
this.dailySignSettings.taskConfigDetail = { this.dailySignSettings.taskConfigDetail = {
oneDay: 1, oneDay: 1,
twoDay: 2, twoDay: 2,
@ -1221,8 +1356,8 @@ export default {
handleEditBrowse() { handleEditBrowse() {
this.showBrowseDialog = true; this.showBrowseDialog = true;
// ID //
if (!this.recordId) { if (this.isTaskConfigEmpty(this.viewGoodsSettings)) {
this.viewGoodsSettings.taskConfigDetail = { this.viewGoodsSettings.taskConfigDetail = {
oneGoodsViewPoints: 1, oneGoodsViewPoints: 1,
enableDailyPointsLimit: true, enableDailyPointsLimit: true,
@ -1233,8 +1368,8 @@ export default {
handleEditPurchase() { handleEditPurchase() {
this.showPurchaseDialog = true; this.showPurchaseDialog = true;
// ID //
if (!this.recordId) { if (this.isTaskConfigEmpty(this.buyGoodsSettings)) {
this.buyGoodsSettings.taskConfigDetail = { this.buyGoodsSettings.taskConfigDetail = {
pointsRatioAmount: 1, pointsRatioAmount: 1,
enableDailyPointsLimit: true, enableDailyPointsLimit: true,
@ -1245,8 +1380,8 @@ export default {
handleEditShare() { handleEditShare() {
this.showShareDialog = true; this.showShareDialog = true;
// ID //
if (!this.recordId) { if (this.isTaskConfigEmpty(this.shareGoodsSettings)) {
this.shareGoodsSettings.taskConfigDetail = { this.shareGoodsSettings.taskConfigDetail = {
oneSharePoints: 5, oneSharePoints: 5,
enableDailyPointsLimit: true, enableDailyPointsLimit: true,
@ -1257,8 +1392,8 @@ export default {
handleEditReview() { handleEditReview() {
this.showReviewDialog = true; this.showReviewDialog = true;
// ID //
if (!this.recordId) { if (this.isTaskConfigEmpty(this.commentGoodsSettings)) {
this.commentGoodsSettings.taskConfigDetail = { this.commentGoodsSettings.taskConfigDetail = {
textCommentPoints: 3, textCommentPoints: 3,
imageTextCommentPoints: 5, imageTextCommentPoints: 5,
@ -1270,31 +1405,133 @@ 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() {
//
const taskDesc = this.generateDailySignDescription();
this.dailySignSettings.taskDesc = taskDesc;
// editPointsTaskData
if (this.editPointsTaskData && this.editPointsTaskData.length > 0) {
const task = this.editPointsTaskData.find(
t => t.taskName === "每日签到"
);
if (task) {
task.taskDesc = taskDesc;
}
}
this.showSignInDialog = false; this.showSignInDialog = false;
// this.$message.success(""); // this.$message.success("");
}, },
saveBrowseForm() { saveBrowseForm() {
//
const taskDesc = this.generateViewGoodsDescription();
this.viewGoodsSettings.taskDesc = taskDesc;
// editPointsTaskData
if (this.editPointsTaskData && this.editPointsTaskData.length > 0) {
const task = this.editPointsTaskData.find(
t => t.taskName === "浏览商品"
);
if (task) {
task.taskDesc = taskDesc;
}
}
this.showBrowseDialog = false; this.showBrowseDialog = false;
// this.$message.success(""); // this.$message.success("");
}, },
savePurchaseForm() { savePurchaseForm() {
//
const taskDesc = this.generateBuyGoodsDescription();
this.buyGoodsSettings.taskDesc = taskDesc;
// editPointsTaskData
if (this.editPointsTaskData && this.editPointsTaskData.length > 0) {
const task = this.editPointsTaskData.find(
t => t.taskName === "购买商品"
);
if (task) {
task.taskDesc = taskDesc;
}
}
this.showPurchaseDialog = false; this.showPurchaseDialog = false;
// this.$message.success(""); // this.$message.success("");
}, },
saveShareForm() { saveShareForm() {
//
const taskDesc = this.generateShareGoodsDescription();
this.shareGoodsSettings.taskDesc = taskDesc;
// editPointsTaskData
if (this.editPointsTaskData && this.editPointsTaskData.length > 0) {
const task = this.editPointsTaskData.find(
t => t.taskName === "分享商品"
);
if (task) {
task.taskDesc = taskDesc;
}
}
this.showShareDialog = false; this.showShareDialog = false;
// this.$message.success(""); // this.$message.success("");
}, },
saveReviewForm() { saveReviewForm() {
//
const taskDesc = this.generateCommentGoodsDescription();
this.commentGoodsSettings.taskDesc = taskDesc;
// editPointsTaskData
if (this.editPointsTaskData && this.editPointsTaskData.length > 0) {
const task = this.editPointsTaskData.find(
t => t.taskName === "评价商品"
);
if (task) {
task.taskDesc = taskDesc;
}
}
this.showReviewDialog = false; this.showReviewDialog = false;
// this.$message.success(""); // this.$message.success("");
}, },
@ -1329,6 +1566,108 @@ export default {
LV4: "#f5222d" LV4: "#f5222d"
}; };
return colorMap[levelName] || "#666"; return colorMap[levelName] || "#666";
},
//
generateDailySignDescription() {
const config = this.dailySignSettings.taskConfigDetail;
if (
!config ||
(!config.oneDay &&
!config.twoDay &&
!config.threeDay &&
!config.fourDay &&
!config.fiveDay &&
!config.sixDay &&
!config.sevenDay)
) {
return "-";
}
const descriptions = [];
if (config.oneDay) descriptions.push(`第一天签到${config.oneDay}`);
if (config.twoDay) descriptions.push(`第二天${config.twoDay}`);
if (config.threeDay) descriptions.push(`第三天${config.threeDay}`);
if (config.fourDay) descriptions.push(`第四天${config.fourDay}`);
if (config.fiveDay) descriptions.push(`第五天${config.fiveDay}`);
if (config.sixDay) descriptions.push(`第六天${config.sixDay}`);
if (config.sevenDay) descriptions.push(`连续7天${config.sevenDay}`);
return descriptions.length > 0 ? descriptions.join("") : "-";
},
//
generateViewGoodsDescription() {
const config = this.viewGoodsSettings.taskConfigDetail;
if (!config || !config.oneGoodsViewPoints) {
return "-";
}
let description = `浏览一个商品获得${config.oneGoodsViewPoints}`;
if (config.enableDailyPointsLimit && config.dailyPointsLimit) {
description += `,每天最多获得${config.dailyPointsLimit}`;
}
return description;
},
//
generateBuyGoodsDescription() {
const config = this.buyGoodsSettings.taskConfigDetail;
if (!config || !config.pointsRatioAmount) {
return "-";
}
let description = `购买${config.pointsRatioAmount}元=1分`;
if (config.enableDailyPointsLimit && config.dailyPointsLimit) {
description += `,每天最多获得${config.dailyPointsLimit}`;
}
return description;
},
//
generateShareGoodsDescription() {
const config = this.shareGoodsSettings.taskConfigDetail;
if (!config || !config.oneSharePoints) {
return "-";
}
let description = `分享一个商品获得${config.oneSharePoints}`;
if (config.enableDailyPointsLimit && config.dailyPointsLimit) {
const maxTimes = Math.floor(
config.dailyPointsLimit / config.oneSharePoints
);
description += `,每天最多获得${maxTimes}`;
}
return description;
},
//
generateCommentGoodsDescription() {
const config = this.commentGoodsSettings.taskConfigDetail;
if (
!config ||
(!config.textCommentPoints && !config.imageTextCommentPoints)
) {
return "-";
}
const descriptions = [];
if (config.textCommentPoints) {
descriptions.push(`文字评价获得${config.textCommentPoints}`);
}
if (config.imageTextCommentPoints) {
descriptions.push(`图文评价获得${config.imageTextCommentPoints}`);
}
let description = descriptions.join("");
if (config.enableDailyPointsLimit && config.dailyPointsLimit) {
description += `,每天最多获得${config.dailyPointsLimit}`;
}
return description;
} }
}, },
computed: { computed: {
@ -1339,32 +1678,32 @@ export default {
"marketId" "marketId"
]), ]),
// // 使
pointsTaskData() { pointsTaskData() {
return [ return [
{ {
taskName: "每日签到", taskName: "每日签到",
taskDescription: "第一天签到1分第二天2分第三天3分连续7天10分", taskDesc: this.generateDailySignDescription(),
isEnabled: this.dailySignSettings.taskEnable isEnabled: this.dailySignSettings.taskEnable
}, },
{ {
taskName: "浏览商品", taskName: "浏览商品",
taskDescription: "浏览一个商品获得1分每天最多获得2分", taskDesc: this.generateViewGoodsDescription(),
isEnabled: this.viewGoodsSettings.taskEnable isEnabled: this.viewGoodsSettings.taskEnable
}, },
{ {
taskName: "购买商品", taskName: "购买商品",
taskDescription: "购买1元=1分每天最多获得500分", taskDesc: this.generateBuyGoodsDescription(),
isEnabled: this.buyGoodsSettings.taskEnable isEnabled: this.buyGoodsSettings.taskEnable
}, },
{ {
taskName: "分享商品", taskName: "分享商品",
taskDescription: "分享一个商品获得5分每天最多获得3次", taskDesc: this.generateShareGoodsDescription(),
isEnabled: this.shareGoodsSettings.taskEnable isEnabled: this.shareGoodsSettings.taskEnable
}, },
{ {
taskName: "评价商品", taskName: "评价商品",
taskDescription: "评价一个商品获得3分每天最多获得5次", taskDesc: this.generateCommentGoodsDescription(),
isEnabled: this.commentGoodsSettings.taskEnable isEnabled: this.commentGoodsSettings.taskEnable
} }
]; ];