Commit 9af7a6ba authored by 陈万宝's avatar 陈万宝

feat: 更新添加修改商品

parent 5da7897d
......@@ -279,12 +279,12 @@ const TakeawayGoodsInfo = forwardRef((props, ref) => {
singleDelivery,
specList: +repertoryType === 1 ? singularSpecList : multiSpecList, // 单库存和多库存specList
items: +repertoryType === 1 ? singularSpu : JSON.parse(JSON.stringify(multiSpu)),
categoryId:
(
infoMation?.categoryId &&
infoMation?.categoryId?.slice(infoMation?.categoryId?.length - 1)
)?.toString() ||
(Array.isArray(categoryId) && categoryId?.slice(categoryId?.length - 1)?.toString()),
// categoryId:
// (
// infoMation?.categoryId &&
// infoMation?.categoryId?.slice(infoMation?.categoryId?.length - 1)
// )?.toString() ||
// (Array.isArray(categoryId) && categoryId?.slice(categoryId?.length - 1)?.toString()),
};
setIntactData(intactDataTemp);
......
......@@ -207,8 +207,6 @@ const ServiceGoods = options => {
setPageLoading(true);
const sendAsyncHttpRequest = isEdit ? merchantProductEdit : merchantProductAdd;
const addResponse = await sendAsyncHttpRequest(sendData);
debugger;
if (addResponse.data) {
message.success(`${isEdit ? '修改' : '添加'}成功!`);
localStorage.remove(localAutoSaveKey);
......
......@@ -111,9 +111,12 @@ const filterItems = (type, props) => {
export const filterSendData = (type, params) => {
// takeawayItem 外卖商品
const { infoMation, infoImageData, attributeApplyList, takeawayItem } = params;
console.log('infoMation', infoMation, takeawayItem);
const temp = Object.assign({}, takeawayItem?.intactData, infoMation)
temp.categoryId = (Array.isArray(temp.categoryId) && temp.categoryId?.slice(temp.categoryId?.length - 1)?.toString())
// 外卖商品
if (type === 5) {
return takeawayItem?.intactData;
return temp;
}
const items = filterItems(type, params);
const commonImageList = type === 4 ? [] : infoImageData.commonImageList;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment