chore: prettier js codes

This commit is contained in:
陈嘉涵
2020-01-19 17:02:01 +08:00
parent 2adcfd8b8b
commit 1e864a445f
28 changed files with 333 additions and 174 deletions
+4 -4
View File
@@ -65,11 +65,11 @@ export const isAllSelected = (skuTree, selectedSku) => {
// 根据已选择的 sku 获取 skuComb
export const getSkuComb = (skuList, selectedSku) => {
const skuComb = skuList.filter(item => (
const skuComb = skuList.filter(item =>
Object.keys(selectedSku).every(
skuKeyStr => String(item[skuKeyStr]) === String(selectedSku[skuKeyStr])
)
));
);
return skuComb[0];
};
@@ -103,11 +103,11 @@ export const isSkuChoosable = (skuList, selectedSku, skuToChoose) => {
skuKey => matchedSku[skuKey] !== UNSELECTED_SKU_VALUE_ID
);
const filteredSku = skuList.filter(sku => (
const filteredSku = skuList.filter(sku =>
skusToCheck.every(
skuKey => String(matchedSku[skuKey]) === String(sku[skuKey])
)
));
);
const stock = filteredSku.reduce((total, sku) => {
total += sku.stock_num;