feat: 会员明细设置接口对接

This commit is contained in:
lzhizhao 2025-08-09 21:19:56 +08:00
parent 54da2cb353
commit 7e8cbdb6dd
3 changed files with 611 additions and 151 deletions

View File

@ -334,5 +334,14 @@ export const mer_admin = {
},
membershipEnableList: data => {
return $http.post(`/merchant-api/membershipEnable/list`, data);
},
membershipEnableChange: data => {
return $http.post(`/merchant-api/membershipEnable/changeEnable`, data);
},
membershipEnableGetSettings: data => {
return $http.post(`/merchant-api/membershipEnable/getSettings`, data);
},
membershipEnableSaveSettings: data => {
return $http.post(`/merchant-api/membershipEnable/saveSettings`, data);
}
};

View File

@ -86,7 +86,7 @@
align="center"
>
<template slot-scope="scope">
<span :style="{ color: getLevelColor(scope.row.levelName) }">
<span :style="{ color: getLevelColor(scope.row.level) }">
{{ scope.row.levelName }}
</span>
</template>
@ -94,21 +94,21 @@
<el-table-column label="所需成长值" width="200" align="center">
<template slot-scope="scope">
<span style="color: #1890ff; font-weight: 500;">
{{ scope.row.requiredGrowthValue }}
{{ scope.row.startGrowthValue }}-{{ scope.row.endGrowthValue }}
</span>
</template>
</el-table-column>
<el-table-column label="会员人数" width="200" align="center">
<template slot-scope="scope">
<span style="color: #52c41a; font-weight: 500;">
{{ scope.row.memberCount }}
{{ scope.row.membershipCount }}
</span>
</template>
</el-table-column>
<el-table-column label="会员权益" align="left">
<template slot-scope="scope">
<span style="color: #666; line-height: 1.5;">
{{ scope.row.memberBenefits }}
{{ generateMemberBenefits(scope.row) }}
</span>
</template>
</el-table-column>
@ -129,32 +129,29 @@
align="center"
>
<template slot-scope="scope">
<span :style="{ color: getLevelColor(scope.row.levelName) }">
{{ scope.row.levelName }}
<span :style="{ color: getLevelColor(scope.row.level) }">
{{ scope.row.level }}
</span>
</template>
</el-table-column>
<el-table-column label="等级名称" align="center">
<template slot-scope="scope">
<el-input
v-model="scope.row.levelDisplayName"
size="mini"
></el-input>
<el-input v-model="scope.row.levelName" size="mini"></el-input>
</template>
</el-table-column>
<el-table-column label="成长值范围" width="280" align="center">
<template slot-scope="scope">
<div class="growth-range">
<el-input-number
v-model="scope.row.minGrowthValue"
v-model="scope.row.startGrowthValue"
:min="0"
size="mini"
style="width: 120px;"
></el-input-number>
<span style="margin: 0 5px;">-</span>
<el-input-number
v-model="scope.row.maxGrowthValue"
:min="scope.row.minGrowthValue"
v-model="scope.row.endGrowthValue"
:min="scope.row.startGrowthValue"
size="mini"
style="width: 120px;"
></el-input-number>
@ -177,20 +174,20 @@
></el-input-number>
</template>
</el-table-column>
<el-table-column label="开启会员兑换" width="120" align="center">
<el-table-column label="开启积分兑换" width="120" align="center">
<template slot-scope="scope">
<el-switch v-model="scope.row.enableExchange"></el-switch>
<el-switch v-model="scope.row.enablePointsRedemption"></el-switch>
</template>
</el-table-column>
<el-table-column label="开启生日优惠券" width="130" align="center">
<template slot-scope="scope">
<el-switch v-model="scope.row.enableBirthdayCoupon"></el-switch>
<el-switch v-model="scope.row.enableBirthdayCoupons"></el-switch>
</template>
</el-table-column>
<el-table-column label="生日优惠券操作" width="130" align="center">
<template slot-scope="scope">
<el-button
v-if="scope.row.enableBirthdayCoupon"
v-if="scope.row.enableBirthdayCoupons"
type="primary"
size="mini"
@click="handleAddCoupon(scope.row)"
@ -199,9 +196,29 @@
</el-button>
</template>
</el-table-column>
<el-table-column label="开启生日双倍积分" width="140" align="center">
<el-table-column label="开启生日双倍积分" align="center">
<template slot-scope="scope">
<el-switch v-model="scope.row.enableBirthdayPoints"></el-switch>
<el-switch v-model="scope.row.enableBirthdayReward"></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" width="150" align="center">
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
@click="handleAddLevel(scope.$index)"
style="margin-right: 5px;"
>
新增
</el-button>
<el-button
type="danger"
size="mini"
@click="handleDeleteLevel(scope.$index)"
:disabled="editLevelData.length <= 1"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
@ -310,10 +327,70 @@
:close-on-click-modal="false"
>
<div class="sign-in-form">
<div class="form-item" v-for="day in 7" :key="day">
<span class="label">连续签到{{ day }}</span>
<div class="form-item">
<span class="label">连续签到1</span>
<el-input-number
v-model="signInForm[`day${day}`]"
v-model="dailySignSettings.taskConfigDetail.oneDay"
:min="0"
:max="100"
size="small"
controls-position="right"
></el-input-number>
</div>
<div class="form-item">
<span class="label">连续签到2天</span>
<el-input-number
v-model="dailySignSettings.taskConfigDetail.twoDay"
:min="0"
:max="100"
size="small"
controls-position="right"
></el-input-number>
</div>
<div class="form-item">
<span class="label">连续签到3天</span>
<el-input-number
v-model="dailySignSettings.taskConfigDetail.threeDay"
:min="0"
:max="100"
size="small"
controls-position="right"
></el-input-number>
</div>
<div class="form-item">
<span class="label">连续签到4天</span>
<el-input-number
v-model="dailySignSettings.taskConfigDetail.fourDay"
:min="0"
:max="100"
size="small"
controls-position="right"
></el-input-number>
</div>
<div class="form-item">
<span class="label">连续签到5天</span>
<el-input-number
v-model="dailySignSettings.taskConfigDetail.fiveDay"
:min="0"
:max="100"
size="small"
controls-position="right"
></el-input-number>
</div>
<div class="form-item">
<span class="label">连续签到6天</span>
<el-input-number
v-model="dailySignSettings.taskConfigDetail.sixDay"
:min="0"
:max="100"
size="small"
controls-position="right"
></el-input-number>
</div>
<div class="form-item">
<span class="label">连续签到7天</span>
<el-input-number
v-model="dailySignSettings.taskConfigDetail.sevenDay"
:min="0"
:max="100"
size="small"
@ -338,7 +415,7 @@
<div class="form-item">
<span class="label">每浏览1个商品积分增加</span>
<el-input-number
v-model="browseForm.pointsPerProduct"
v-model="viewGoodsSettings.taskConfigDetail.oneGoodsViewPoints"
:min="0"
:max="100"
size="small"
@ -348,7 +425,7 @@
<div class="form-item">
<span class="label">该任务每日最高可获积分</span>
<el-input-number
v-model="browseForm.maxPointsPerDay"
v-model="viewGoodsSettings.taskConfigDetail.dailyPointsLimit"
:min="0"
:max="1000"
size="small"
@ -373,7 +450,7 @@
<div class="form-item">
<span class="label">购买商品实付</span>
<el-input-number
v-model="purchaseForm.pointsPerYuan"
v-model="buyGoodsSettings.taskConfigDetail.pointsRatioAmount"
:min="0"
:max="100"
size="small"
@ -384,7 +461,7 @@
<div class="form-item">
<span class="label">该任务每日最高获得</span>
<el-input-number
v-model="purchaseForm.maxPointsPerDay"
v-model="buyGoodsSettings.taskConfigDetail.dailyPointsLimit"
:min="0"
:max="10000"
size="small"
@ -410,7 +487,7 @@
<div class="form-item">
<span class="label">每分享1个商品1次获得</span>
<el-input-number
v-model="shareForm.pointsPerShare"
v-model="shareGoodsSettings.taskConfigDetail.oneSharePoints"
:min="0"
:max="100"
size="small"
@ -421,7 +498,7 @@
<div class="form-item">
<span class="label">该任务每日最高获得</span>
<el-input-number
v-model="shareForm.maxPointsPerDay"
v-model="shareGoodsSettings.taskConfigDetail.dailyPointsLimit"
:min="0"
:max="1000"
size="small"
@ -445,9 +522,22 @@
>
<div class="review-form">
<div class="form-item">
<span class="label">评价1个商品获得</span>
<span class="label">文字评价1个商品获得</span>
<el-input-number
v-model="reviewForm.pointsPerReview"
v-model="commentGoodsSettings.taskConfigDetail.textCommentPoints"
:min="0"
:max="100"
size="small"
controls-position="right"
></el-input-number>
<span class="unit">积分</span>
</div>
<div class="form-item">
<span class="label">图文评价1个商品获得</span>
<el-input-number
v-model="
commentGoodsSettings.taskConfigDetail.imageTextCommentPoints
"
:min="0"
:max="100"
size="small"
@ -458,7 +548,7 @@
<div class="form-item">
<span class="label">该任务每日最高获得</span>
<el-input-number
v-model="reviewForm.maxPointsPerDay"
v-model="commentGoodsSettings.taskConfigDetail.dailyPointsLimit"
:min="0"
:max="1000"
size="small"
@ -485,6 +575,7 @@ export default {
isEditMode: false,
shopId: "", // ID
shopName: "", //
recordId: null, // ID
isBatchMode: false, //
selectedShopIds: [], // ID
availableShops: [], //
@ -504,30 +595,56 @@ export default {
minAmount: "",
validityPeriod: ""
},
signInForm: {
day1: 0,
day2: 0,
day3: 0,
day4: 0,
day5: 0,
day6: 0,
day7: 0
//
dailySignSettings: {
taskEnable: false,
taskConfigDetail: {
oneDay: 0,
twoDay: 0,
threeDay: 0,
fourDay: 0,
fiveDay: 0,
sixDay: 0,
sevenDay: 0
},
taskDesc: ""
},
browseForm: {
pointsPerProduct: 0,
maxPointsPerDay: 0
viewGoodsSettings: {
taskEnable: false,
taskConfigDetail: {
oneGoodsViewPoints: 0,
enableDailyPointsLimit: true,
dailyPointsLimit: 0
},
taskDesc: ""
},
purchaseForm: {
pointsPerYuan: 0,
maxPointsPerDay: 0
buyGoodsSettings: {
taskEnable: false,
taskConfigDetail: {
pointsRatioAmount: 0,
enableDailyPointsLimit: true,
dailyPointsLimit: 0
},
taskDesc: ""
},
shareForm: {
pointsPerShare: 0,
maxPointsPerDay: 0
shareGoodsSettings: {
taskEnable: false,
taskConfigDetail: {
oneSharePoints: 0,
enableDailyPointsLimit: true,
dailyPointsLimit: 0
},
taskDesc: ""
},
reviewForm: {
pointsPerReview: 0,
maxPointsPerDay: 0
commentGoodsSettings: {
taskEnable: false,
taskConfigDetail: {
textCommentPoints: 0,
imageTextCommentPoints: 0,
enableDailyPointsLimit: true,
dailyPointsLimit: 0
},
taskDesc: ""
},
editPointsValidityDays: 365,
levelDetailData: [
@ -589,38 +706,6 @@ export default {
}
],
editLevelData: [],
pointsTaskData: [
{
taskName: "每日签到",
taskDescription: "第一天签到1分第二天2分第三天3分连续7天1折",
isEnabled: true
},
{
taskName: "浏览商品",
taskDescription: "浏览一个商品获得1分每天最多获得2分",
isEnabled: true
},
{
taskName: "购买商品",
taskDescription: "购买1元=1分每天最多获得500分",
isEnabled: true
},
{
taskName: "分享商品",
taskDescription: "分享一个商品获得5分每天最多获得3次",
isEnabled: false
},
{
taskName: "评价商品",
taskDescription: "评价一个商品获得3分每天最多获得5次",
isEnabled: true
},
{
taskName: "评价商品",
taskDescription: "评价一个商品获得10分文字评价+4图可获得20分",
isEnabled: false
}
],
editPointsTaskData: []
};
},
@ -631,6 +716,7 @@ export default {
//
this.shopId = this.$route.query.shopId;
this.shopName = this.$route.query.shopName;
this.recordId = this.$route.query.id;
//
this.isBatchMode = this.$route.query.mode === "batch";
@ -648,9 +734,36 @@ export default {
} else if (this.shopId && this.shopName) {
//
this.isEditMode = false;
// ID
if (this.recordId) {
this.loadSettingsData();
}
}
},
methods: {
//
getDefaultLevelData() {
return [
{
level: "LV1",
levelName: "等级1",
startGrowthValue: 0,
endGrowthValue: 100,
enableDiscount: false,
discountRate: 0,
enablePointsRedemption: false,
enableBirthdayCoupons: false,
birthdayCouponsName: "",
birthdayCouponsThreshold: 0,
birthdayCouponsMinus: 0,
couponsEffectiveTimeType: 1,
enableBirthdayReward: false,
membershipCount: 0
}
];
},
//
resetPageState() {
//
@ -660,11 +773,13 @@ export default {
//
this.shopId = "";
this.shopName = "";
this.recordId = null;
this.selectedShopIds = [];
this.availableShops = [];
this.isAllSelected = false;
//
this.levelDetailData = [];
this.editLevelData = [];
this.editPointsTaskData = [];
this.editPointsValidityDays = 365;
@ -684,33 +799,239 @@ export default {
minAmount: "",
validityPeriod: ""
};
this.signInForm = {
day1: 0,
day2: 0,
day3: 0,
day4: 0,
day5: 0,
day6: 0,
day7: 0
//
this.dailySignSettings = {
taskEnable: false,
taskConfigDetail: {
oneDay: 0,
twoDay: 0,
threeDay: 0,
fourDay: 0,
fiveDay: 0,
sixDay: 0,
sevenDay: 0
},
taskDesc: ""
};
this.browseForm = {
pointsPerProduct: 0,
maxPointsPerDay: 0
this.viewGoodsSettings = {
taskEnable: false,
taskConfigDetail: {
oneGoodsViewPoints: 0,
enableDailyPointsLimit: true,
dailyPointsLimit: 0
},
taskDesc: ""
};
this.purchaseForm = {
pointsPerYuan: 0,
maxPointsPerDay: 0
this.buyGoodsSettings = {
taskEnable: false,
taskConfigDetail: {
pointsRatioAmount: 0,
enableDailyPointsLimit: true,
dailyPointsLimit: 0
},
taskDesc: ""
};
this.shareForm = {
pointsPerShare: 0,
maxPointsPerDay: 0
this.shareGoodsSettings = {
taskEnable: false,
taskConfigDetail: {
oneSharePoints: 0,
enableDailyPointsLimit: true,
dailyPointsLimit: 0
},
taskDesc: ""
};
this.reviewForm = {
pointsPerReview: 0,
maxPointsPerDay: 0
this.commentGoodsSettings = {
taskEnable: false,
taskConfigDetail: {
textCommentPoints: 0,
imageTextCommentPoints: 0,
enableDailyPointsLimit: true,
dailyPointsLimit: 0
},
taskDesc: ""
};
},
//
loadSettingsData() {
if (!this.recordId) {
// ID使
this.levelDetailData = [];
return;
}
this.$api.mer_admin
.membershipEnableGetSettings({
id: this.recordId
})
.then(res => {
console.log("获取会员设置数据:", res);
if (res.data && res.data.code == 200) {
const settingsData = res.data.data;
this.applySettingsData(settingsData);
} else {
console.error("获取设置数据失败:", res.data?.message);
//
this.levelDetailData = [];
}
})
.catch(err => {
console.error("获取会员设置失败:", err);
//
this.levelDetailData = [];
});
},
//
applySettingsData(settingsData) {
if (!settingsData) {
//
this.levelDetailData = [];
return;
}
//
if (settingsData.pointsValidDays) {
this.pointsValidityDays = settingsData.pointsValidDays;
}
//
if (
settingsData.levelSettingsList &&
settingsData.levelSettingsList.length > 0
) {
this.levelDetailData = settingsData.levelSettingsList.map(level => ({
level: level.level,
levelName: level.levelName,
startGrowthValue: level.startGrowthValue,
endGrowthValue: level.endGrowthValue,
enableDiscount: level.enableDiscount,
discountRate: level.discountRate,
enablePointsRedemption: level.enablePointsRedemption,
enableBirthdayCoupons: level.enableBirthdayCoupons,
birthdayCouponsName: level.birthdayCouponsName || "",
birthdayCouponsThreshold: level.birthdayCouponsThreshold || 0,
birthdayCouponsMinus: level.birthdayCouponsMinus || 0,
couponsEffectiveTimeType: level.couponsEffectiveTimeType || 1,
enableBirthdayReward: level.enableBirthdayReward,
membershipCount: level.membershipCount || 0
}));
} else {
//
this.levelDetailData = [];
}
// 使
if (settingsData.dailySignSettings) {
this.dailySignSettings = { ...settingsData.dailySignSettings };
}
if (settingsData.viewGoodsSettings) {
this.viewGoodsSettings = { ...settingsData.viewGoodsSettings };
}
if (settingsData.buyGoodsSettings) {
this.buyGoodsSettings = { ...settingsData.buyGoodsSettings };
}
if (settingsData.shareGoodsSettings) {
this.shareGoodsSettings = { ...settingsData.shareGoodsSettings };
}
if (settingsData.commentGoodsSettings) {
this.commentGoodsSettings = { ...settingsData.commentGoodsSettings };
}
console.log("数据回显完成");
},
//
generateMemberBenefits(level) {
const benefits = [];
if (level.enableDiscount && level.discountRate) {
const discount = (100 - level.discountRate) / 10;
benefits.push(`享受${discount}折优惠`);
}
if (level.enablePointsRedemption) {
benefits.push("积分兑换商品");
}
if (level.enableBirthdayCoupons) {
benefits.push("生日专属优惠券");
}
if (level.enableBirthdayReward) {
benefits.push("生日双倍积分");
}
return benefits.length > 0 ? benefits.join("") : "暂无特殊权益";
},
//
saveSettingsData() {
const saveData = {
shopIdList: this.isBatchMode ? this.selectedShopIds : [this.shopId],
pointsValidDays: this.pointsValidityDays,
enable: true,
levelSettingsList: this.levelDetailData.map(level => ({
level: level.level,
levelName: level.levelName,
startGrowthValue: level.startGrowthValue,
endGrowthValue: level.endGrowthValue,
enableDiscount: level.enableDiscount,
discountRate: level.discountRate,
enablePointsRedemption: level.enablePointsRedemption,
enableBirthdayCoupons: level.enableBirthdayCoupons,
birthdayCouponsName: level.birthdayCouponsName,
birthdayCouponsThreshold: level.birthdayCouponsThreshold,
birthdayCouponsMinus: level.birthdayCouponsMinus,
couponsEffectiveTimeType: level.couponsEffectiveTimeType,
enableBirthdayReward: level.enableBirthdayReward,
membershipCount: level.membershipCount
})),
dailySignSettings: {
...this.dailySignSettings,
taskDesc: "第一天签到1分第二天2分第三天3分连续7天10分"
},
buyGoodsSettings: {
...this.buyGoodsSettings,
taskDesc: "购买1元=1分每天最多获得500分"
},
shareGoodsSettings: {
...this.shareGoodsSettings,
taskDesc: "分享一个商品获得5分每天最多获得3次"
},
commentGoodsSettings: {
...this.commentGoodsSettings,
taskDesc: "评价一个商品获得3分每天最多获得5次"
},
viewGoodsSettings: {
...this.viewGoodsSettings,
taskDesc: "浏览一个商品获得1分每天最多获得2分"
}
};
console.log("保存数据:", saveData);
this.$api.mer_admin
.membershipEnableSaveSettings(saveData)
.then(res => {
console.log("保存设置数据:", res);
if (res.data && res.data.code == 200) {
this.$message.success("设置保存成功");
} else {
this.$message.error(res.data?.message || "保存失败");
}
})
.catch(err => {
console.error("保存设置失败:", err);
this.$message.error("保存失败");
});
},
goBack() {
//
const currentRouteName = this.$route.name;
@ -792,9 +1113,14 @@ export default {
handleEditLevel() {
this.isEditMode = true;
// 使
if (this.levelDetailData.length === 0) {
this.levelDetailData = this.getDefaultLevelData();
}
//
this.editLevelData = JSON.parse(JSON.stringify(this.levelDetailData));
this.editPointsTaskData = JSON.parse(JSON.stringify(this.pointsTaskData));
console.log(this.editPointsTaskData);
this.editPointsValidityDays = this.pointsValidityDays;
},
@ -812,11 +1138,58 @@ export default {
handleSaveEdit() {
//
this.levelDetailData = JSON.parse(JSON.stringify(this.editLevelData));
this.pointsTaskData = JSON.parse(JSON.stringify(this.editPointsTaskData));
this.pointsValidityDays = this.editPointsValidityDays;
this.isEditMode = false;
this.$message.success("保存成功");
//
this.saveSettingsData();
},
//
handleAddLevel(index) {
//
const newLevel = {
level: `LV${this.editLevelData.length + 1}`,
levelName: `等级${this.editLevelData.length + 1}`,
startGrowthValue: 0,
endGrowthValue: 0,
enableDiscount: false,
discountRate: 0,
enablePointsRedemption: false,
enableBirthdayCoupons: false,
birthdayCouponsName: "",
birthdayCouponsThreshold: 0,
birthdayCouponsMinus: 0,
couponsEffectiveTimeType: 1,
enableBirthdayReward: false,
membershipCount: 0
};
//
this.editLevelData.splice(index + 1, 0, newLevel);
this.$message.success("新增等级成功");
},
//
handleDeleteLevel(index) {
if (this.editLevelData.length <= 1) {
this.$message.warning("至少需要保留一个等级");
return;
}
this.$confirm("确定要删除这个等级吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.editLevelData.splice(index, 1);
this.$message.success("删除等级成功");
})
.catch(() => {
//
});
},
handleAddCoupon() {
@ -832,78 +1205,98 @@ export default {
//
handleEditSignIn() {
this.showSignInDialog = true;
this.signInForm = {
day1: 1,
day2: 2,
day3: 3,
day4: 4,
day5: 5,
day6: 6,
day7: 10
};
// ID
if (!this.recordId) {
this.dailySignSettings.taskConfigDetail = {
oneDay: 1,
twoDay: 2,
threeDay: 3,
fourDay: 4,
fiveDay: 5,
sixDay: 6,
sevenDay: 10
};
}
},
handleEditBrowse() {
this.showBrowseDialog = true;
this.browseForm = {
pointsPerProduct: 1,
maxPointsPerDay: 2
};
// ID
if (!this.recordId) {
this.viewGoodsSettings.taskConfigDetail = {
oneGoodsViewPoints: 1,
enableDailyPointsLimit: true,
dailyPointsLimit: 2
};
}
},
handleEditPurchase() {
this.showPurchaseDialog = true;
this.purchaseForm = {
pointsPerYuan: 1,
maxPointsPerDay: 500
};
// ID
if (!this.recordId) {
this.buyGoodsSettings.taskConfigDetail = {
pointsRatioAmount: 1,
enableDailyPointsLimit: true,
dailyPointsLimit: 500
};
}
},
handleEditShare() {
this.showShareDialog = true;
this.shareForm = {
pointsPerShare: 5,
maxPointsPerDay: 15
};
// ID
if (!this.recordId) {
this.shareGoodsSettings.taskConfigDetail = {
oneSharePoints: 5,
enableDailyPointsLimit: true,
dailyPointsLimit: 15
};
}
},
handleEditReview() {
this.showReviewDialog = true;
this.reviewForm = {
pointsPerReview: 3,
maxPointsPerDay: 15
};
// ID
if (!this.recordId) {
this.commentGoodsSettings.taskConfigDetail = {
textCommentPoints: 3,
imageTextCommentPoints: 5,
enableDailyPointsLimit: true,
dailyPointsLimit: 15
};
}
},
//
saveCouponForm() {
this.$message.success("优惠券添加成功");
// this.$message.success("");
this.showCouponDialog = false;
},
saveSignInForm() {
this.$message.success("每日签到设置保存成功");
this.showSignInDialog = false;
// this.$message.success("");
},
saveBrowseForm() {
this.$message.success("浏览商品设置保存成功");
this.showBrowseDialog = false;
// this.$message.success("");
},
savePurchaseForm() {
this.$message.success("购买商品设置保存成功");
this.showPurchaseDialog = false;
// this.$message.success("");
},
saveShareForm() {
this.$message.success("分享商品设置保存成功");
this.showShareDialog = false;
// this.$message.success("");
},
saveReviewForm() {
this.$message.success("评价商品设置保存成功");
this.showReviewDialog = false;
// this.$message.success("");
},
handleEditTask(row) {
@ -944,7 +1337,38 @@ export default {
"marketList",
"storeList",
"marketId"
])
]),
//
pointsTaskData() {
return [
{
taskName: "每日签到",
taskDescription: "第一天签到1分第二天2分第三天3分连续7天10分",
isEnabled: this.dailySignSettings.taskEnable
},
{
taskName: "浏览商品",
taskDescription: "浏览一个商品获得1分每天最多获得2分",
isEnabled: this.viewGoodsSettings.taskEnable
},
{
taskName: "购买商品",
taskDescription: "购买1元=1分每天最多获得500分",
isEnabled: this.buyGoodsSettings.taskEnable
},
{
taskName: "分享商品",
taskDescription: "分享一个商品获得5分每天最多获得3次",
isEnabled: this.shareGoodsSettings.taskEnable
},
{
taskName: "评价商品",
taskDescription: "评价一个商品获得3分每天最多获得5次",
isEnabled: this.commentGoodsSettings.taskEnable
}
];
}
}
};
</script>

View File

@ -92,6 +92,10 @@ export default {
created() {
this.initData();
},
activated() {
//
this.getList();
},
methods: {
initData() {
//
@ -132,18 +136,40 @@ export default {
},
handleMemberToggle(row) {
// /
console.log(
"Toggle member for shop:",
row.shopName,
"Enable:",
row.enable
);
// API
//
this.$message.success(
`${row.shopName} 会员功能已${row.enable ? "启用" : "禁用"}`
);
// ID
if (!row.id) {
//
row.enable = !row.enable;
this.$message.warning("请先设置会员等级明细");
return;
}
// API
this.$api.mer_admin
.membershipEnableChange({
id: row.id,
enable: row.enable
})
.then(res => {
console.log("修改会员状态响应:", res);
if (res.data && res.data.code == 200) {
this.$message.success(
`${row.shopName} 会员功能已${row.enable ? "启用" : "禁用"}`
);
//
this.getList();
} else {
//
row.enable = !row.enable;
this.$message.error(res.data?.message || "修改会员状态失败");
}
})
.catch(err => {
console.error("修改会员状态失败:", err);
//
row.enable = !row.enable;
this.$message.error("修改会员状态失败");
});
},
//
@ -159,14 +185,15 @@ export default {
//
this.closeLevelDetailTab();
//
setTimeout(() => {
//
this.$router.push({
name: "marketing-level-detail",
query: {
shopId: row.shopId,
shopName: row.shopName,
timestamp: Date.now() //
id: row.id || null,
timestamp: Date.now()
}
});
}, 200);