feat: 积分商品接口对接调整
This commit is contained in:
parent
74fdbd41c4
commit
5c200241a8
|
@ -231,5 +231,14 @@ export const marketing = {
|
|||
method: "post",
|
||||
data
|
||||
});
|
||||
},
|
||||
|
||||
// 积分商品启用/禁用状态切换
|
||||
changeEnableMembershipPointsProduct: data => {
|
||||
return $http.request({
|
||||
url: `/merchant-api/membershipPointsProduct/changeEnable`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
@ -173,17 +173,14 @@ export default {
|
|||
this.$refs.productSelector.show(shopIdList);
|
||||
},
|
||||
handleEnableChange(row) {
|
||||
// 使用编辑接口进行启用状态切换
|
||||
const updateData = {
|
||||
// 使用专门的启用/禁用接口
|
||||
const changeData = {
|
||||
id: row.id,
|
||||
exchangeRequiredPoints: row.exchangeRequiredPoints,
|
||||
increaseInventory: 0, // 默认为0
|
||||
exchangeRequiredAmount: row.exchangeRequiredAmount || 0,
|
||||
enable: row.enable // 使用当前的启用状态
|
||||
enable: row.enable
|
||||
};
|
||||
|
||||
this.$api.marketing
|
||||
.updateMembershipPointsProduct(updateData)
|
||||
.changeEnableMembershipPointsProduct(changeData)
|
||||
.then(() => {
|
||||
this.$message.success("状态切换成功");
|
||||
this.$refs.oTable.reload();
|
||||
|
@ -314,6 +311,7 @@ export default {
|
|||
|
||||
// 直接使用列表中的数据作为编辑数据
|
||||
const editData = {
|
||||
...row,
|
||||
id: row.id,
|
||||
shopId: row.shopId,
|
||||
productId: row.productId,
|
||||
|
|
|
@ -258,13 +258,20 @@ export default {
|
|||
exchangeRequiredPoints: this.configForm.exchangeRequiredPoints,
|
||||
increaseInventory: this.configForm.exchangeInventory, // 增加库存
|
||||
exchangeRequiredAmount:
|
||||
this.configForm.exchangeRequiredAmount || 0,
|
||||
enable: true // 默认启用
|
||||
this.configForm.exchangePointsType === 2
|
||||
? this.configForm.exchangeRequiredAmount || 0
|
||||
: 0.01, // 如果不是积分优惠购,固定传0.01
|
||||
enable: false // 默认禁用
|
||||
};
|
||||
} else {
|
||||
// 新增模式使用原有格式
|
||||
submitData = {
|
||||
...this.configForm
|
||||
...this.configForm,
|
||||
enable: false, // 默认禁用
|
||||
exchangeRequiredAmount:
|
||||
this.configForm.exchangePointsType === 2
|
||||
? this.configForm.exchangeRequiredAmount || 0
|
||||
: 0.01 // 如果不是积分优惠购,固定传0.01
|
||||
};
|
||||
}
|
||||
console.log(submitData);
|
||||
|
|
Loading…
Reference in New Issue