diff --git a/src/hooks/useLogin.js b/src/hooks/useLogin.js index c84eb60b1..ba69a9304 100644 --- a/src/hooks/useLogin.js +++ b/src/hooks/useLogin.js @@ -88,7 +88,7 @@ export default (props = {}) => { setIsLogin(true) await getUserInfo() // 导购UV统计 - // entryLaunch.postGuideUV() + entryLaunch.postGuideUV() entryLaunch.postGuideTask() dispatch(updateIsNewUser(false)) dispatch(fetchUserFavs()) diff --git a/src/pages/cart/espier-checkout.js b/src/pages/cart/espier-checkout.js index b218a5300..6827c62ef 100644 --- a/src/pages/cart/espier-checkout.js +++ b/src/pages/cart/espier-checkout.js @@ -367,6 +367,7 @@ function CartCheckout(props) { orderInfo, () => { entryLaunch.postGuideUV() + entryLaunch.postGuideUVBind() entryLaunch.postGuideTask() } ) @@ -476,7 +477,7 @@ function CartCheckout(props) { if (couponInfo?.coupon_code) { url = `${url}&coupon=${couponInfo?.coupon_code}` } - if (storageParams?.cxdid) { + if (storageParams?.cxdid && scene) { url = `${url}&cxdid=${storageParams?.cxdid}` } Taro.navigateTo({ @@ -805,7 +806,8 @@ function CartCheckout(props) { distributor_id: receiptType === 'ziti' && ziti_shopid ? ziti_shopid : shop_id } // 处理导购数据(旧) - if (storageParams?.cxdid) { + if (storageParams?.cxdid && scene) { + debugger cus_parmas.cxdid = storageParams?.cxdid; cus_parmas.distributor_id = storageParams?.dtid; cus_parmas.cart_type = "cxd"; diff --git a/src/pages/custom/custom-page.js b/src/pages/custom/custom-page.js index 11d088760..f192dedd8 100644 --- a/src/pages/custom/custom-page.js +++ b/src/pages/custom/custom-page.js @@ -46,6 +46,7 @@ function CustomPage(props) { useEffect(() => { fetch() + entryLaunch.postGuideUV() entryLaunch.postGuideTask() }, []) diff --git a/src/pages/item/espier-detail.js b/src/pages/item/espier-detail.js index e29767059..2053e4c39 100644 --- a/src/pages/item/espier-detail.js +++ b/src/pages/item/espier-detail.js @@ -146,6 +146,7 @@ function EspierDetail(props) { useEffect(() => { init() + entryLaunch.postGuideUV() entryLaunch.postGuideTask() }, []) diff --git a/src/pages/share-land.js b/src/pages/share-land.js index a032593b5..497501fea 100644 --- a/src/pages/share-land.js +++ b/src/pages/share-land.js @@ -52,7 +52,7 @@ function ShareIand() { Taro.setStorageSync(SG_GUIDE_PARAMS_UPDATETIME, dayjs().unix()) if (S.getAuthToken()) { - // entryLaunch.postGuideUV() + entryLaunch.postGuideUV() entryLaunch.postGuideTask() } } else { diff --git a/src/subpage/pages/recommend/detail.js b/src/subpage/pages/recommend/detail.js index a5a793486..6960f4ba8 100644 --- a/src/subpage/pages/recommend/detail.js +++ b/src/subpage/pages/recommend/detail.js @@ -43,6 +43,7 @@ export default class recommendDetail extends Component { screenWidth: res.screenWidth }) }) + entryLaunch.postGuideUV() entryLaunch.postGuideTask() } diff --git a/src/subpages/marketing/coupon-center.js b/src/subpages/marketing/coupon-center.js index 571e458aa..bea9feb9f 100644 --- a/src/subpages/marketing/coupon-center.js +++ b/src/subpages/marketing/coupon-center.js @@ -19,6 +19,7 @@ function CouponCenter(props) { const { couponList } = state useEffect(() => { + entryLaunch.postGuideUV() entryLaunch.postGuideTask() }, []) diff --git a/src/utils/entryLaunch.js b/src/utils/entryLaunch.js index aa52bf3d7..df6beb0d4 100644 --- a/src/utils/entryLaunch.js +++ b/src/utils/entryLaunch.js @@ -519,6 +519,7 @@ class EntryLaunch { * 导购UV统计 */ async postGuideUV() { + if (!S.getAuthToken()) return const routerParams = Taro.getStorageSync(SG_GUIDE_PARAMS) const { gu } = routerParams || {} if (gu) { @@ -526,7 +527,17 @@ class EntryLaunch { await api.user.uniquevisito({ work_userid }) - // 导购关系绑定 + } + } + + /** + * 导购关系绑定 + */ + async postGuideUVBind() { + const routerParams = Taro.getStorageSync(SG_GUIDE_PARAMS) + const { gu } = routerParams || {} + if (gu) { + const [work_userid] = gu.split('_') await api.user.bindSaleperson({ work_userid })