feat: 积分商品接口对接调整
This commit is contained in:
parent
74fdbd41c4
commit
5c200241a8
|
@ -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
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue