1002884655 3 år sedan
förälder
incheckning
e750f7afa6

+ 12
- 0
src/pages/index/buildingDetail/index.jsx Visa fil

@@ -8,6 +8,7 @@ import { API_ITEMS_DETAIL } from '@/constants/api'
8 8
 import useParams from '@/utils/hooks/useParams'
9 9
 import useShare from '@/utils/hooks/useShare'
10 10
 import usePoster from '@/utils/hooks/usePoster'
11
+import { savePoint } from '@/services/common'
11 12
 import DetailBottom from './components/DetailBottom/index'
12 13
 import BuildingDetailBanner from './components/BuildingDetailBanner/index'
13 14
 import BasicInfo from './components/BasicInfo/index'
@@ -45,6 +46,17 @@ export default withLayout((props) => {
45 46
     fullTrackData,
46 47
   )
47 48
 
49
+  useEffect(() => {
50
+    if(trackData.eventType && DetailInfo.buildingId) {
51
+      savePoint({
52
+        ...trackData,
53
+        event: 'detail',
54
+        eventType: 'building',
55
+        targetType: 'building'
56
+      })
57
+    }
58
+  }, [trackData, DetailInfo])
59
+
48 60
   // 海报
49 61
   const posterData = usePoster(person, DetailInfo?.poster, router, paramsRef)
50 62
 

+ 13
- 1
src/pages/index/newsDetail/index.jsx Visa fil

@@ -1,12 +1,13 @@
1 1
 import { useState, useEffect } from "react";
2 2
 import Taro from "@tarojs/taro";
3 3
 import withLayout from "@/layout";
4
-import { ScrollView, Image, RichText, WebView } from "@tarojs/components";
4
+import { ScrollView, RichText, WebView } from "@tarojs/components";
5 5
 import useParams from '@/utils/hooks/useParams'
6 6
 import useFavor from "@/utils/hooks/useFavor";
7 7
 import { queryNewsDetail } from "@/services/news";
8 8
 import { formatDate } from "@/utils/chatDate";
9 9
 import useShare from "@/utils/hooks/useShare";
10
+import { savePoint } from '@/services/common'
10 11
 import "@/assets/css/iconfont.css";
11 12
 import "./index.scss";
12 13
 
@@ -35,6 +36,17 @@ export default withLayout((props) => {
35 36
     fullTrackData
36 37
   );
37 38
 
39
+  useEffect(() => {
40
+    if(trackData.eventType && (data || {}).newsId) {
41
+      savePoint({
42
+        ...trackData,
43
+        event: 'detail',
44
+        eventType: 'news',
45
+        targetType: 'news'
46
+      })
47
+    }
48
+  }, [trackData, data])
49
+
38 50
   const getData = (params) => {
39 51
     Taro.showLoading();
40 52
     queryNewsDetail(params).then((res) => {

+ 7
- 0
src/subpackages/pages/consultant/myHomepage/index.jsx Visa fil

@@ -8,6 +8,7 @@ import { fetch } from '@/utils/request'
8 8
 import { API_CARDS_UV, API_ITEMS_DETAIL, API_CARDS_LIST } from '@/constants/api'
9 9
 import { getImgURL } from '@/utils/image'
10 10
 import useLike from "@/utils/hooks/useLike";
11
+import { savePoint } from '@/services/common'
11 12
 import '@/assets/css/iconfont.css'
12 13
 import './index.scss'
13 14
 
@@ -47,6 +48,12 @@ export default withLayout((props) => {
47 48
       if(id) {
48 49
         fetch({ url: `${API_CARDS_LIST}/${id}`, method: 'get' }).then((res) => {
49 50
           setUserInfo(res)
51
+          savePoint({
52
+            ...trackData,
53
+            event: 'detail',
54
+            eventType: 'card',
55
+            targetType: 'card'
56
+          })
50 57
         })
51 58
       } else {
52 59
         setPersonId(user.userInfo.person.personId)