修改代客下单商品是否能够下单的逻辑
This commit is contained in:
parent
57ef84aae1
commit
c473f30a37
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,13 @@
|
||||||
//判断商品是否可以下单
|
//判断商品是否可以下单
|
||||||
export function isCanBuy(goods,isStock) {
|
export function isCanBuy(skuGoods,goods) {
|
||||||
return goods.isGrounding && goods.isPauseSale == 0 && (isStock?goods.stockNumber > 0:true) ;
|
if(goods.typeEnum=='normal'){
|
||||||
|
//单规格
|
||||||
|
return goods.isGrounding&&goods.isPauseSale==0&&(goods.isStock?goods.stockNumber>0:true);
|
||||||
|
}else{
|
||||||
|
//多规格
|
||||||
|
return goods.isGrounding&&goods.isPauseSale==0&&skuGoods.isGrounding&&skuGoods.isPauseSale==0&&(goods.isStock?goods.stockNumber>0:true);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 一个数组是否包含另外一个数组全部元素
|
// 一个数组是否包含另外一个数组全部元素
|
||||||
|
|
@ -15,6 +22,8 @@ export function arrayContainsAll(arr1, arr2) {
|
||||||
|
|
||||||
//n项 n-1项组合,生成全部结果
|
//n项 n-1项组合,生成全部结果
|
||||||
export function generateCombinations(arr, k) {
|
export function generateCombinations(arr, k) {
|
||||||
|
console.log(arr)
|
||||||
|
console.log(k)
|
||||||
let result = [];
|
let result = [];
|
||||||
|
|
||||||
function helper(index, current) {
|
function helper(index, current) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue