Commit a3f611a8 authored by 武广's avatar 武广

fix: 修改餐段可售日期问题

parent 2ac60452
...@@ -22,15 +22,18 @@ const SaleDateModal = props => { ...@@ -22,15 +22,18 @@ const SaleDateModal = props => {
return; return;
} }
if (props.productType === 4) { if (props.productType === 4) {
const data = props.dataSource.map(item => { const data = [];
props.dataSource.forEach(item => {
const obj = { const obj = {
saleDateList: item.saleDate, saleDateList: item.saleDate,
tabCateList: item.tabCateList, tabCateList: item.tabCate?.map(v => ({ tabId: v })),
}; };
if (props.item.skuId === item.skuId) { if (props.item.skuId === item.skuId && item.tabCate) {
obj.saleDateList = value; obj.saleDateList = value;
data.push(obj);
} else if (item.saleDate?.length && item.tabCate?.length) {
data.push(obj);
} }
return obj;
}); });
const res = await apiCheckInfo(data); const res = await apiCheckInfo(data);
if (!res || !res.success) { if (!res || !res.success) {
......
...@@ -24,15 +24,18 @@ const SaleDateModal = props => { ...@@ -24,15 +24,18 @@ const SaleDateModal = props => {
return; return;
} }
if (props.productType === 4) { if (props.productType === 4) {
const data = props.dataSource.map(item => { const data = [];
props.dataSource.forEach(item => {
const obj = { const obj = {
saleDateList: item.saleDate, saleDateList: item.saleDate,
tabCateList: item.tabCateList, tabCateList: item.tabCate?.map(v => ({ tabId: v })),
}; };
if (props.item.skuId === item.skuId) { if (props.item.skuId === item.skuId && item.saleDate) {
obj.tabCateList = value.map(v => ({ tabId: v })); obj.tabCateList = value.map(v => ({ tabId: v }));
data.push(obj);
} else if (item.saleDate?.length && item.tabCate?.length) {
data.push(obj);
} }
return obj;
}); });
const res = await apiCheckInfo(data); const res = await apiCheckInfo(data);
if (!res || !res.success) { if (!res || !res.success) {
......
...@@ -22,7 +22,7 @@ const VirtualGoodsInfo = props => { ...@@ -22,7 +22,7 @@ const VirtualGoodsInfo = props => {
const [visiblePrice, setVisiblePrice] = useState(false); // 修改企业商品价格弹窗 const [visiblePrice, setVisiblePrice] = useState(false); // 修改企业商品价格弹窗
const [dataSource, setDataSource] = useState([]); const [dataSource, setDataSource] = useState([]);
const [shopList, setShopList] = useState({}); // 店铺列表 const [shopList, setShopList] = useState({}); // 店铺列表
const [sleShopID, setSelShopID] = useState(''); // 选中的店铺ID const [sleShopID, setSelShopID] = useState(null); // 选中的店铺ID
const [sleShopName, setSelShopName] = useState(''); // 选中的店铺名称 const [sleShopName, setSelShopName] = useState(''); // 选中的店铺名称
const [selectedRowKeys, setSelectedRowKeys] = useState([]); const [selectedRowKeys, setSelectedRowKeys] = useState([]);
const [editItem, setEditItem] = useState({}); // 编辑信息 const [editItem, setEditItem] = useState({}); // 编辑信息
......
...@@ -129,7 +129,6 @@ request.interceptors.response.use(async (response, options) => { ...@@ -129,7 +129,6 @@ request.interceptors.response.use(async (response, options) => {
if (!isTob) { if (!isTob) {
window.location.href = loginPath; window.location.href = loginPath;
} else { } else {
console.log('isTob 4011 :>> ', isTob, 4011);
const iframeBridgeModel = new IframeBridge(); const iframeBridgeModel = new IframeBridge();
iframeBridgeModel.run({ event: 'toLogin' }); iframeBridgeModel.run({ event: 'toLogin' });
} }
......
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