From d2afab14a129ba360314708caee30aaea007aa1e Mon Sep 17 00:00:00 2001 From: maqian Date: Thu, 25 Sep 2025 11:11:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BA=97=E9=93=BAid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/sp-sku-select/index.js | 2 +- src/hooks/useLogin.js | 4 ++-- src/pages/category/comps/comp-goods-item.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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('成功加入购物车') }