Skip to content

Commit

Permalink
修复了没有商品时商品列表加载动画不能结束的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
vhvy committed Apr 7, 2020
1 parent 2c9fcd0 commit b4cb0d7
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions client/src/views/Home/Main/warehouse/Commodity/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,30 @@ export function Commodity() {
setOriginList(data);


if (data.length === 0) return;
// 切换需要展示的商品
if (id) {
dispatch(createWareCommodityAction(id));
} else if (newCommodityIdFlag) {
dispatch(createWareCommodityAction(newCommodityIdFlag));
} else if (queryCommodityIdFlag) {

if (data.length !== 0) {
// 切换需要展示的商品
if (id) {
dispatch(createWareCommodityAction(id));
} else if (newCommodityIdFlag) {
dispatch(createWareCommodityAction(newCommodityIdFlag));
} else if (queryCommodityIdFlag) {


let selectId = queryCommodityIdFlag;
setTimeout(() => {
setSelect({
selectId,
selectType: "down"
});
});

let selectId = queryCommodityIdFlag;
setTimeout(() => {
queryCommodityIdFlag = null;
} else {
setSelect({
selectId,
selectType: "down"
selectId: data[0] && data[0].id || -1,
selectType: "origin"
});
});

queryCommodityIdFlag = null;
} else {
setSelect({
selectId: data[0] && data[0].id || -1,
selectType: "origin"
});
}
}

setSpinStatus(false);
Expand Down

0 comments on commit b4cb0d7

Please sign in to comment.