提交 720ec15c authored 作者: 刘旭's avatar 刘旭

优化

上级 f4d45d02
......@@ -176,9 +176,8 @@ let addCartFn = (obj: any) => {
icon: 'none',
duration: 300,
success() {
goodsInfo.value = {}
handleClose()
emits('partsClose') // 还原
skuPopupRef.value.handClose()
skuKey.value = false
}
});
......@@ -244,9 +243,8 @@ let buyNow = (selectShop: any) => {
})
});
setTimeout(function() {
goodsInfo.value = {}
handleClose()
emits('partsClose') // 还原
skuPopupRef.value.handClose()
skuKey.value = false
}, 300);
}
......@@ -274,7 +272,7 @@ const addProduct = (selectShop: any) => {
// console.log(selectShop, '加入产品线');
emits('addProduct', selectShop, productId, specifications, specificationCustom)
emits('close-sku', '') // 在修改规格时使用
goodsInfo.value = {}
handleClose()
detailData.value = undefined
detailId.value = undefined
}
......@@ -297,10 +295,18 @@ const getProductId = (specText: any) => {
return productId
}
// 清楚sku数据
const handleClose = () => {
goodsInfo.value = {}
skuPopupRef.value.handClose()
}
defineExpose({
skuKey,
skuMode,
init,
handleClose,
});
</script>
......
......@@ -156,8 +156,10 @@ let closeSku = (val: string) => {
if (editFlag.value) {
skuClose.value = val;
if (skuClose.value) {
// 取消修改后的逻辑
lineList.value.splice(editIndex.value.index, 0, editIndex.value.data);
} else {
// 确定修改产品
let index = lineList.value.length - 2;
if (lineList.value.length === 2) index = 0;
let data = lineList.value[index];
......@@ -168,7 +170,10 @@ let closeSku = (val: string) => {
store.$patch({
lineData: lineList.value,
});
goodsSkuRef.value.handleClose();
editFlag.value = false;
} else {
goodsSkuRef.value.handleClose();
}
};
......@@ -178,11 +183,11 @@ let editFlag = ref(false);
// 产品修改
let sheetEdit = (index: number) => {
editFlag.value = true;
let data = lineList.value[index];
editIndex.value = {
index,
data: lineList.value[index],
data,
};
let data = lineList.value[index];
store.$patch({
lineData: lineList.value.splice(index, 1),
});
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论