mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 20:03:26 +08:00
uniapp【优化】:sku提示判断
This commit is contained in:
@@ -270,8 +270,10 @@
|
||||
|
||||
/** 判断库存 */
|
||||
const handleHaveStock = () => {
|
||||
if (state.selectedSpecs.length !== state.spec_list.length) {
|
||||
handleShowToast('请选择sku');
|
||||
let skuName:Array<string> = state.selectedSpecs.map(item => item.name) || [];
|
||||
let sku = state.spec_list.find((item:any)=> !item.list.some((itemChild:any)=> skuName.includes(itemChild.name)));
|
||||
if (sku) {
|
||||
handleShowToast(`请选择 ${sku.name} 规格`);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user