feat: 积分商品接口对接调整

This commit is contained in:
lzhizhao 2025-08-17 09:57:34 +08:00
parent 74fdbd41c4
commit 5c200241a8
3 changed files with 24 additions and 10 deletions

View File

@ -231,5 +231,14 @@ export const marketing = {
method: "post", method: "post",
data data
}); });
},
// 积分商品启用/禁用状态切换
changeEnableMembershipPointsProduct: data => {
return $http.request({
url: `/merchant-api/membershipPointsProduct/changeEnable`,
method: "post",
data
});
} }
}; };

View File

@ -173,17 +173,14 @@ export default {
this.$refs.productSelector.show(shopIdList); this.$refs.productSelector.show(shopIdList);
}, },
handleEnableChange(row) { handleEnableChange(row) {
// 使 // 使/
const updateData = { const changeData = {
id: row.id, id: row.id,
exchangeRequiredPoints: row.exchangeRequiredPoints, enable: row.enable
increaseInventory: 0, // 0
exchangeRequiredAmount: row.exchangeRequiredAmount || 0,
enable: row.enable // 使
}; };
this.$api.marketing this.$api.marketing
.updateMembershipPointsProduct(updateData) .changeEnableMembershipPointsProduct(changeData)
.then(() => { .then(() => {
this.$message.success("状态切换成功"); this.$message.success("状态切换成功");
this.$refs.oTable.reload(); this.$refs.oTable.reload();
@ -314,6 +311,7 @@ export default {
// 使 // 使
const editData = { const editData = {
...row,
id: row.id, id: row.id,
shopId: row.shopId, shopId: row.shopId,
productId: row.productId, productId: row.productId,

View File

@ -258,13 +258,20 @@ export default {
exchangeRequiredPoints: this.configForm.exchangeRequiredPoints, exchangeRequiredPoints: this.configForm.exchangeRequiredPoints,
increaseInventory: this.configForm.exchangeInventory, // increaseInventory: this.configForm.exchangeInventory, //
exchangeRequiredAmount: exchangeRequiredAmount:
this.configForm.exchangeRequiredAmount || 0, this.configForm.exchangePointsType === 2
enable: true // ? this.configForm.exchangeRequiredAmount || 0
: 0.01, // 0.01
enable: false //
}; };
} else { } else {
// 使 // 使
submitData = { submitData = {
...this.configForm ...this.configForm,
enable: false, //
exchangeRequiredAmount:
this.configForm.exchangePointsType === 2
? this.configForm.exchangeRequiredAmount || 0
: 0.01 // 0.01
}; };
} }
console.log(submitData); console.log(submitData);