张延森 3 년 전
부모
커밋
7aead571b8
2개의 변경된 파일15개의 추가작업 그리고 20개의 파일을 삭제
  1. 1
    1
      config/prod.js
  2. 14
    19
      src/pages/index/index.jsx

+ 1
- 1
config/prod.js 파일 보기

5
   defineConstants: {
5
   defineConstants: {
6
     HOST: '"https://sgl-v2.njyunzhi.com"',
6
     HOST: '"https://sgl-v2.njyunzhi.com"',
7
     OSS: '"yz-shigongli.oss-accelerate.aliyuncs.com"',
7
     OSS: '"yz-shigongli.oss-accelerate.aliyuncs.com"',
8
-    VERSION: '"2.0.33"',
8
+    VERSION: '"2.0.35_2021-10-11 19:39:20"',
9
   },
9
   },
10
   mini: {},
10
   mini: {},
11
   h5: {
11
   h5: {

+ 14
- 19
src/pages/index/index.jsx 파일 보기

17
 import Recommend from './tabs/Recommend'
17
 import Recommend from './tabs/Recommend'
18
 
18
 
19
 import './index.less'
19
 import './index.less'
20
+import { getQueryString } from '@/utils'
20
 
21
 
21
 const tips = 'https://yz-shigongli.oss-cn-shanghai.aliyuncs.com/images/sgl-v2-tips.png'
22
 const tips = 'https://yz-shigongli.oss-cn-shanghai.aliyuncs.com/images/sgl-v2-tips.png'
22
 
23
 
24
+const eventTypeArr = ['index_recommend', 'hotel_guide', 'user_center']
25
+
23
 export default withLayout((props) => {
26
 export default withLayout((props) => {
24
   const { router, person, location } = props
27
   const { router, person, location } = props
25
   let { roomId, roomOrderId } = router.params
28
   let { roomId, roomOrderId } = router.params
50
     const { index } = e.detail
53
     const { index } = e.detail
51
     setCurrentTab(index)
54
     setCurrentTab(index)
52
 
55
 
53
-    if (roomId && hotelId) {
54
-
55
-      trackClick({
56
-        eventParams: `tab=${index}&hotelId=${hotelId}&roomId=${roomId}`,
57
-        //如果首页增加新页面,这个判断一定要改;
58
-        onVarified: `${index === 0 ? 'index_recommend' : index === 1 ? 'hotel_guide' : 'user_center'}`,
59
-        page: `/pages/index/index`
60
-      }).then((val) => {
61
-
62
-      })
63
-
64
-    } else {
65
-      trackClick({
66
-        eventParams: `tab=${index}`,
67
-        onVarified: `${index === 0 ? 'index_recommend' : index === 1 ? 'hotel_guide' : 'user_center'}`,
68
-
69
-        page: `/pages/index/index`
70
-      }).then((res) => {
71
-      })
56
+    // 埋点页面切换
57
+    const eventParams = {
58
+      tab: index,
59
+      hotelId,
60
+      roomId,
61
+    }
62
+    const trackParams = {
63
+      eventParams: getQueryString(eventParams),
64
+      eventType: eventTypeArr[index],
65
+      page: path,
72
     }
66
     }
67
+    trackClick(trackParams)
73
 
68
 
74
     if (index === 1) {
69
     if (index === 1) {
75
       // 民宿离店消息
70
       // 民宿离店消息