🎈 perf(购物页面): 多选面料的性能优化
This commit is contained in:
@@ -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 },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user