|
@@ -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) => {
|