|
@@ -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
|
// 民宿离店消息
|