diff --git a/src/components/sp-sku-select/index.js b/src/components/sp-sku-select/index.js index 93de10694..e8619f1e9 100644 --- a/src/components/sp-sku-select/index.js +++ b/src/components/sp-sku-select/index.js @@ -294,7 +294,7 @@ function SpSkuSelect(props) { discount_fee: valid_cart[0]?.discount_fee || '', //优惠金额 storeDetails: valid_cart[0] || {} } - dispatch(updateCount({ shop_type: 'distributor'})) + dispatch(updateCount({ shop_type: 'distributor', shop_id: distributor_id })) dispatch(updateShopCartCount(shopCats)) } diff --git a/src/hooks/useLogin.js b/src/hooks/useLogin.js index 77be3f8b1..c84eb60b1 100644 --- a/src/hooks/useLogin.js +++ b/src/hooks/useLogin.js @@ -6,7 +6,7 @@ import { updateUserInfo, fetchUserFavs, clearUserInfo, updateIsNewUser } from '@ import { updateCount, clearCart } from '@/store/slices/cart' import { purchaseClearCart } from '@/store/slices/purchase' import api from '@/api' -import { isWeixin, showToast, entryLaunch, isAlipay, alipayAutoLogin } from '@/utils' +import { isWeixin, showToast, entryLaunch, isAlipay, alipayAutoLogin, getDistributorId } from '@/utils' import S from '@/spx' import { SG_POLICY } from '@/consts/localstorage' import { INVITE_ACTIVITY_ID } from '@/consts' @@ -92,7 +92,7 @@ export default (props = {}) => { entryLaunch.postGuideTask() dispatch(updateIsNewUser(false)) dispatch(fetchUserFavs()) - dispatch(updateCount({ shop_type: 'distributor' })) // 获取购物车商品数量 + dispatch(updateCount({ shop_type: 'distributor', shop_id: getDistributorId() })) // 获取购物车商品数量 console.log('useLogin setToken redirect_url:', redirect_url, decodeURIComponent(redirect_url)) if (redirect_url) { Taro.redirectTo({ url: decodeURIComponent(redirect_url) }) diff --git a/src/pages/category/comps/comp-goods-item.js b/src/pages/category/comps/comp-goods-item.js index fb25f8669..3cb191d39 100644 --- a/src/pages/category/comps/comp-goods-item.js +++ b/src/pages/category/comps/comp-goods-item.js @@ -90,7 +90,7 @@ function CompGoodsItem(props) { shop_type: 'distributor' }) ) - dispatch(updateCount({ shop_type: 'distributor' })) + dispatch(updateCount({ shop_type: 'distributor', shop_id: distributorId })) Taro.hideLoading() showToast('成功加入购物车') }