diff --git a/src/pages/custom/custom-page.js b/src/pages/custom/custom-page.js index 99eec088c..09505be71 100644 --- a/src/pages/custom/custom-page.js +++ b/src/pages/custom/custom-page.js @@ -46,8 +46,6 @@ function CustomPage(props) { useEffect(() => { fetch() - entryLaunch.postGuideUV() - entryLaunch.postGuideTask() }, []) useEffect(() => { diff --git a/src/pages/item/espier-detail.js b/src/pages/item/espier-detail.js index fa07ff9d1..a1d5828a1 100644 --- a/src/pages/item/espier-detail.js +++ b/src/pages/item/espier-detail.js @@ -149,8 +149,6 @@ function EspierDetail(props) { useEffect(() => { init() - entryLaunch.postGuideUV() - entryLaunch.postGuideTask() }, []) useEffect(() => { diff --git a/src/pages/share-land.js b/src/pages/share-land.js index db34ac41c..2170da17b 100644 --- a/src/pages/share-land.js +++ b/src/pages/share-land.js @@ -30,10 +30,10 @@ function ShareIand() { if (routeParams?.gu || routeParams?.gu_user_id) { // 导购参数处理 Taro.setStorageSync(SG_GUIDE_PARAMS, routeParams) Taro.setStorageSync(SG_GUIDE_PARAMS_UPDATETIME, dayjs().unix()) - if (S.getAuthToken()) { - entryLaunch.postGuideUV() // 导购uv上报 - entryLaunch.postGuideTask() // 导购任务上报 - } + // if (S.getAuthToken()) { + // entryLaunch.postGuideUV() // 导购uv上报 + // entryLaunch.postGuideTask() // 导购任务上报 + // } } if (routeParams?.t == 1) { @@ -86,6 +86,9 @@ function ShareIand() { delete filteredParams.$taroTimestamp const queryString = qs.stringify(filteredParams) + entryLaunch.postGuideUV() // 导购uv上报 + entryLaunch.postGuideTask(welcomeRoutes[from_scene]) // 导购任务上报 + const targetUrl = queryString ? `${welcomeRoutes[from_scene]}?${queryString}` : welcomeRoutes[from_scene] console.log('导购任务分享跳转:', targetUrl, welcomeRoutes[from_scene]) @@ -128,6 +131,9 @@ function ShareIand() { if (normalizedPath && !normalizedPath.startsWith('/')) { normalizedPath = '/' + normalizedPath } + + entryLaunch.postGuideUV() // 导购uv上报 + entryLaunch.postGuideTask(normalizedPath) // 导购任务上报 // 构建目标URL const queryString = qs.stringify(filteredParams) diff --git a/src/subpage/pages/recommend/detail.js b/src/subpage/pages/recommend/detail.js index 6960f4ba8..db4003a94 100644 --- a/src/subpage/pages/recommend/detail.js +++ b/src/subpage/pages/recommend/detail.js @@ -43,8 +43,6 @@ export default class recommendDetail extends Component { screenWidth: res.screenWidth }) }) - entryLaunch.postGuideUV() - entryLaunch.postGuideTask() } onShareAppMessage(res) { diff --git a/src/subpages/marketing/coupon-center.js b/src/subpages/marketing/coupon-center.js index bea9feb9f..40292363f 100644 --- a/src/subpages/marketing/coupon-center.js +++ b/src/subpages/marketing/coupon-center.js @@ -19,8 +19,6 @@ function CouponCenter(props) { const { couponList } = state useEffect(() => { - entryLaunch.postGuideUV() - entryLaunch.postGuideTask() }, []) const fetch = async ({ pageIndex, pageSize }) => { diff --git a/src/utils/entryLaunch.js b/src/utils/entryLaunch.js index ee3140cc2..a72895aa3 100644 --- a/src/utils/entryLaunch.js +++ b/src/utils/entryLaunch.js @@ -549,16 +549,20 @@ class EntryLaunch { /** * 导购任务埋点上报 */ - async postGuideTask() { + async postGuideTask(customPath) { const { path, params } = $instance.router + const paths = customPath || path const routePath = { '/pages/item/espier-detail': 'activeItemDetail', '/pages/custom/custom-page': 'activeCustomPage', '/subpage/pages/recommend/detail': 'activeSeedingDetail', - '/pages/marketing/coupon-center': 'activeDiscountCoupon', - '/pages/cart/espier-checkout': 'orderPaymentSuccess' + '/subpages/marketing/coupon-center': 'activeDiscountCoupon', + '/pages/cart/espier-checkout': 'orderPaymentSuccess', + '/pages/index': 'activeHomePage', + '/pages/recommend/list': 'activeRecommendList', + '/subpages/member/index': 'activeMemberCenter' } - if (!routePath[path]) { + if (!routePath[paths]) { return } // gu_user_id: 欢迎语上带过来的员工编号, 同work_user_id @@ -571,7 +575,7 @@ class EntryLaunch { distributor_id: dtid, shop_code, item_id: item_id || id, - event_type: routePath[path] + event_type: routePath[paths] } api.wx.taskReportData(_params) @@ -581,7 +585,7 @@ class EntryLaunch { event_id: employee_number, user_type: 'wechat', user_id, - event_type: routePath[path], + event_type: routePath[paths], store_bn: shop_code }) }