提交 b14cd9de authored 作者: 刘旭's avatar 刘旭

优化

上级 7c99390a
......@@ -378,8 +378,8 @@ const valChange = (e: any, item: any) => {
};
// 初始化数据
const initCartIndex = (type: number) => {
getCartIndex({ type }).then((res: any) => {
const initCartIndex = (types: number) => {
getCartIndex({ types }).then((res: any) => {
if (res.data.code === 200) {
cartList.value = res.data.data.cartList;
totalPrice.value = res.data.data.cartTotal.checkedGoodsAmount.toFixed(2);
......@@ -428,6 +428,15 @@ const getCheckedList = (goods: any) => {
onShow(() => {
initCartIndex(type.value);
setTimeout(() => {
// 在初始化把勾选的失效商品清掉
let ids: any = [];
_.each(cartList.value, (v: any) => {
if (!v.isSubmit) ids.push(v.id);
});
// 把失效商品的id去掉
if (ids.length !== 0) initCartChecked(0, ids, type.value);
}, 50);
// type.value = 0;
});
</script>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论