张延森 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,7 +5,7 @@ module.exports = {
5 5
   defineConstants: {
6 6
     HOST: '"https://sgl-v2.njyunzhi.com"',
7 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 10
   mini: {},
11 11
   h5: {

+ 14
- 19
src/pages/index/index.jsx 查看文件

@@ -17,9 +17,12 @@ import Mine from './tabs/Mine'
17 17
 import Recommend from './tabs/Recommend'
18 18
 
19 19
 import './index.less'
20
+import { getQueryString } from '@/utils'
20 21
 
21 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 26
 export default withLayout((props) => {
24 27
   const { router, person, location } = props
25 28
   let { roomId, roomOrderId } = router.params
@@ -50,26 +53,18 @@ export default withLayout((props) => {
50 53
     const { index } = e.detail
51 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 69
     if (index === 1) {
75 70
       // 民宿离店消息