🎈 perf(购物页面): 多选面料的性能优化

This commit is contained in:
xuan
2022-10-20 12:49:20 +08:00
parent bd08ba8df2
commit cd676c4e8b
7 changed files with 14065 additions and 86 deletions
+5 -2
View File
@@ -32,13 +32,15 @@ export type Goods = {
estimate_amount: number // 预估金额
count: number // 已选的条数或米数
sale_mode: number
checked: boolean
}
// 分组
export interface GoodsMeta {
purchaserId: number
goodsKind?: {
[id: number]: Goods
[id: Goods['id']]: Goods
}
multipleSelection: {
[id: Goods['id']]: Goods
}
}
@@ -100,6 +102,7 @@ export function shoppingReducer(state: ShoppingStateContextValue, action: Shoppi
[data.purchaserId as number]: {
purchaserId: data.purchaserId,
goodsKind: { ...state.colorStore[data.purchaserId]?.goodsKind, ...data.goodsKind },
multipleSelection: { ...data.multipleSelection },
},
},
}