✨ feat:修改确认订单选择后无法渲染的问题,顶input框的高度问题
This commit is contained in:
@@ -21,7 +21,6 @@ type PropsType = {
|
||||
const ColorKindItem: FC<PropsType> = memo(
|
||||
(props) => {
|
||||
const { purchaserId, itemData, orderType = EnumSaleMode.Bulk } = props
|
||||
console.log('重新渲染 ColorKindItem', itemData.id, orderType, purchaserId)
|
||||
const { setChangedCheckbox, colorStore } = useShoppingContext()
|
||||
// @ts-ignore
|
||||
const { checked } = useWatch(purchaserId, itemData?.id)
|
||||
@@ -42,7 +41,7 @@ const ColorKindItem: FC<PropsType> = memo(
|
||||
}, [])
|
||||
|
||||
const handleSelect = () => {
|
||||
console.log('handleSelect')
|
||||
// console.log('handleSelect')
|
||||
setChangedCheckbox({
|
||||
purchaserId: purchaserId,
|
||||
goodsKind: { [itemData.id]: { ...colorStore[purchaserId].goodsKind?.[itemData.id]!, checked: true } },
|
||||
@@ -105,7 +104,7 @@ const ColorKindItem: FC<PropsType> = memo(
|
||||
(preProp, nextProp) => {
|
||||
const stringifyPreProp = JSON.stringify(preProp.itemData)
|
||||
const stringifyNextProp = JSON.stringify(nextProp.itemData)
|
||||
console.log('memo==>', preProp, nextProp)
|
||||
// console.log('memo==>', preProp, nextProp)
|
||||
let needMemoized = true
|
||||
if (preProp.purchaserId !== nextProp.purchaserId) {
|
||||
needMemoized = false
|
||||
|
||||
@@ -18,7 +18,6 @@ export interface ShoppingCartPropsType {
|
||||
// 购物车上下文组件
|
||||
export const ShoppingCart: FC<ShoppingCartPropsType> = (props) => {
|
||||
const { children, onTriggerCheckbox, initialValues, ref: refProps } = props
|
||||
console.log('重新渲染 ShoppingCart context', refProps)
|
||||
|
||||
const defaultShoppingCart = useShoppingCart()
|
||||
|
||||
@@ -38,7 +37,7 @@ export const ShoppingCart: FC<ShoppingCartPropsType> = (props) => {
|
||||
const [selectedAmount, setSelectedAmount] = useState(0)
|
||||
|
||||
const ctx: ShoppingContextValue = useMemo(() => {
|
||||
console.log('useMemo ShoppingContextValue')
|
||||
// console.log('useMemo ShoppingContextValue')
|
||||
return {
|
||||
isManageStatus,
|
||||
setManageStatus,
|
||||
@@ -48,7 +47,7 @@ export const ShoppingCart: FC<ShoppingCartPropsType> = (props) => {
|
||||
setCurrentCheckedSaleMode,
|
||||
colorStore,
|
||||
setChangedCheckbox(changedGoods) {
|
||||
console.log('changedGoods==>', colorStore, changedGoods)
|
||||
// console.log('changedGoods==>', colorStore, changedGoods)
|
||||
setColorStore((prev) => {
|
||||
const currentGoodsKind = { ...prev[changedGoods.purchaserId]?.goodsKind, ...changedGoods.goodsKind }
|
||||
return {
|
||||
|
||||
@@ -35,12 +35,10 @@ enum BackEndSaleModeListFieldMap {
|
||||
}
|
||||
|
||||
export default memo<PropsType>(props => {
|
||||
console.log('props==>', props)
|
||||
const { itemData } = props
|
||||
|
||||
const { setCurrentCheckedSaleMode } = useShoppingContext()
|
||||
|
||||
console.log('重新渲染 shoppingCartItem')
|
||||
const [openDetail, setOpenDetail] = useState(false)
|
||||
|
||||
const handleOpenDetail = () => {
|
||||
@@ -109,14 +107,12 @@ export default memo<PropsType>(props => {
|
||||
if (currentCheckedPurchaserId === itemData?.purchaser_id) {
|
||||
return
|
||||
}
|
||||
console.log('handleClickLayout')
|
||||
setSelectedAmount(0)
|
||||
setCurrentCheckedSaleMode(selected)
|
||||
setCurrentCheckedPurchaserId(itemData?.purchaser_id as number)
|
||||
}
|
||||
|
||||
const handleChecked = () => {
|
||||
console.log('handleChecked')
|
||||
// 初始化选中状态
|
||||
setChangedCheckbox({
|
||||
purchaserId: itemData?.purchaser_id!,
|
||||
@@ -124,7 +120,6 @@ export default memo<PropsType>(props => {
|
||||
})
|
||||
}
|
||||
const handleUnchecked = () => {
|
||||
console.log('handleUnchecked')
|
||||
// 初始化选中状态
|
||||
setChangedCheckbox({
|
||||
purchaserId: itemData?.purchaser_id!,
|
||||
@@ -134,7 +129,6 @@ export default memo<PropsType>(props => {
|
||||
// 统计已选面料
|
||||
const materialChecked = useMemo(() => {
|
||||
const targetGoodsKind = colorStore?.[itemData?.purchaser_id!]?.['goodsKind']
|
||||
console.log('targetGoodsKind==>', targetGoodsKind)
|
||||
if (!targetGoodsKind || isEmptyObject(targetGoodsKind)) return 0
|
||||
return new Set(
|
||||
Object.values(targetGoodsKind)?.reduce((prev, item: Goods) => {
|
||||
|
||||
Reference in New Issue
Block a user