xujing 5 vuotta sitten
vanhempi
commit
ee00b1d22b
2 muutettua tiedostoa jossa 17 lisäystä ja 13 poistoa
  1. 2
    2
      src/pages/shop/rule/index.js
  2. 15
    11
      src/utils/track.js

+ 2
- 2
src/pages/shop/rule/index.js Näytä tiedosto

@@ -150,8 +150,8 @@ export default class Shop extends Component {
150 150
             pointRule.length === 0 ? '' : (
151 151
               pointRule.map(item => (
152 152
                 <View className='rule_item' key={item.ruleId}>
153
-                  <View className="item-name">{item.ruleName}<Text className="item-num">+{item.pointsAmount}</Text><Text className="jifen">积分</Text></View>
154
-                  <View className="item-rule">{item.remark}</View>
153
+                  <View className="item-name">{item.ruleName || " "}<Text className="item-num">+{item.pointsAmount || 0}</Text><Text className="jifen">积分</Text></View>
154
+                  <View className="item-rule">{item.remark || " "}</View>
155 155
                   <View className={(this.getBtnName(item.code) == '已签到' || this.getBtnName(item.code) == '已授权') ? 'yiqiandao' : "item-btn"} onClick={(this.getBtnName(item.code) == '已签到' || this.getBtnName(item.code) == '已授权') ? "" : this.handleItemClick.bind(this, item)}>{this.getBtnName(item.code)}</View>
156 156
                 </View>
157 157
               ))

+ 15
- 11
src/utils/track.js Näytä tiedosto

@@ -4,13 +4,13 @@ import { savePoint, updatePoint } from '@/services/common'
4 4
 const pathEventTypeMap = {
5 5
   // '' : 'agent',  // 暂时不需要
6 6
   // '' : 'info',  // 暂时不需要
7
-  'pages/activity/detail/index' : { type: 'activity', desc: '活动' },
8
-  'pages/activity/detail/assistance' : { type: 'activity', desc: '活动' },
9
-  'pages/activity/detail/assemble' : { type: 'activity', desc: '活动' },
10
-  'pages/project/detail/index' : { type: 'building', desc: '项目' },
11
-  'pages/card/index' : { type: 'card', desc: '名片' },
12
-  'pages/project/index' : { type: 'main', desc: '首页' },
13
-  'pages/news/detail/index' : { type: 'news', desc: '资讯' },
7
+  'pages/activity/detail/index': { type: 'activity', desc: '活动' },
8
+  'pages/activity/detail/assistance': { type: 'activity', desc: '活动' },
9
+  'pages/activity/detail/assemble': { type: 'activity', desc: '活动' },
10
+  'pages/project/detail/index': { type: 'building', desc: '项目' },
11
+  'pages/card/index': { type: 'card', desc: '名片' },
12
+  'pages/project/index': { type: 'main', desc: '首页' },
13
+  'pages/news/detail/index': { type: 'news', desc: '资讯' },
14 14
   'pages/project/h5Page': { type: 'h5', desc: 'H5' },
15 15
 }
16 16
 
@@ -21,7 +21,7 @@ const pathEventTypeMap = {
21 21
 export async function trackUserSource(router) {
22 22
   const { path, query, scene } = router || {}
23 23
 
24
-  const pageInfo = pathEventTypeMap['path'] || { type: '', desc: '其他' }
24
+  const pageInfo = pathEventTypeMap[path] || { type: '', desc: '其他' }
25 25
 
26 26
   const trackPayload = {
27 27
     event: 'start',
@@ -34,12 +34,16 @@ export async function trackUserSource(router) {
34 34
   }
35 35
 
36 36
   try {
37
+    const sceneList = [1005, 1006, 1053, 1042, 1007, 1008, 1011, 1012, 1013, 1045, 1046, 1047, 1048, 1058, 1067, 1000]
38
+    if (sceneList.indexOf(trackPayload.sceneId) != -1) {
37 39
 
38
-    const { recordId } = await savePoint(trackPayload)
39
-    return function () { updatePoint(recordId); }
40
+      const { recordId } = await savePoint(trackPayload)
41
+      return function () { updatePoint(recordId); }
42
+
43
+    }
40 44
 
41 45
   } catch (e) {
42 46
     console.error('进入小程序埋点出错:', e);
43
-    return function(){}
47
+    return function () { }
44 48
   }
45 49
 }